How Rules in Audiences work#

For a big customer we had to create about 80 different audiences, which should be deployed on multiple server (test, acceptance, production, etc.). Each audience have rules to describe if a user is part of the audience or not. Creating audiences is very easy, just provide a name and description. Rules however need some more attention.

Time to write a script for that! So, first of al, I searched the SDK for some more information about the way rules are used within the audiences. Basically you can add rules programatically like this:

using (SPSite site = new SPSite("http://servername"))
    {
          ServerContext context = ServerContext.GetContext(site);
          AudienceManager AudMgr = new AudienceManager(context);

          AudienceCollection ac = AudMgr.Audiences;
          Audience a = null;
          bool ruleListNotEmpty = false;

          try
          {
               a = AudMgr.Audiences["John and Joe Connection"];
          }
          catch (AudienceArgumentException ex)
           {
               //your exception handling code here
           }

          ArrayList aRules = a.AudienceRules;
          if (aRules == null)
          {
              aRules = new ArrayList();
          }
          else
          {
              ruleListNotEmpty = true;
          }

          try
          {
              //if the rule is not emply, start with a group operator 'AND' to append
             if (ruleListNotEmpty)
             {
                  aRules.Add(new AudienceRuleComponent(null, "AND", null));
             }

             AudienceRuleComponent r0 = new AudienceRuleComponent(null, "(", null);
             aRules.Add(r0);

             AudienceRuleComponent r1 = new AudienceRuleComponent("FirstName", "Contains", "John");
             aRules.Add(r1);

             AudienceRuleComponent r2 = new AudienceRuleComponent(null, "AND", null);
             aRules.Add(r2);

             AudienceRuleComponent r3 = new AudienceRuleComponent("WorkEmail", "Contains", "example.com");
             aRules.Add(r3);

             AudienceRuleComponent r4 = new AudienceRuleComponent(null, ")", null);
             aRules.Add(r4);

             AudienceRuleComponent r5 = new AudienceRuleComponent(null, "OR", null);
             aRules.Add(r5);

             AudienceRuleComponent r6 = new AudienceRuleComponent(null, "(", null);
             aRules.Add(r6);

             AudienceRuleComponent r7 = new AudienceRuleComponent("FirstName", "Contains", "Joe");
             aRules.Add(r7);

             AudienceRuleComponent r8 = new AudienceRuleComponent(null, "AND", null);
             aRules.Add(r8);

             AudienceRuleComponent r9 = new AudienceRuleComponent("WorkEmail", "Contains", "someexample.com");
             aRules.Add(r9);

             AudienceRuleComponent r10 = new AudienceRuleComponent(null, ")", null);
             aRules.Add(r10);
             a.AudienceRules = aRules;
             a.Commit();
           }
           catch (AudienceException e)
           {
               //Your exception handling code here
           }
     }
}

Quite a flexible way to deal with rules. However, there are three parts that you have to deal with:

  • LeftContent (AudienceRuleComponent.LeftContent Property), this is the part where the property is defined. In the example above, this is 'firstname' 'workemail'. etc. Not documented, for a 'member of' operator you need "DL".
  • RuleOperator (AudienceRuleComponent.Operator Property), this is the operator, that could be 'contains' or '='. Again, not documented, for 'member of', this is 'Member of'.
  • RightContent (AudienceRuleComponent.RightContent Property), this is the value, that can be the email address for example. Not documented, for a user it is the full AD path. for example: cn=SecurityGroup,ou=Groups,ou=AnotherGroup,dc=domain,dc=com

This way you can add change and construct audiences easily.

Thursday, August 09, 2007 1:23:29 PM UTC #     | 

 

Tam Tam first Microsoft Gold Partner with Search specialization in The Netherlands!#

After the latest requirements were met (SharePoint certifications), Tam Tam has become the first  Gold Partner with search specialization in the Netherlands! Great news after doing a lot of hard work on cool projects with enterprise search technology.

logo

From the official press release (in Dutch):

"Rijswijk, 6 augustus 2007 - Tam Tam behaalde als eerste Microsoft Gold Certified Partner in Nederland de 'search specialisatie' . Deze search specialisatie is een uitbreiding op de Information Worker competency en werd verworven met het succesvol realiseren van een drietal projecten op basis van Microsoft Office SharePoint Server (MOSS) 2007. Daarnaast behaalden zeven medewerkers van Tam Tam de voor de specialisatie benodigde examens. 

"De verwerving van de search specialisatie past binnen de focus van Tam Tam," aldus Arjan Nataraj, manager Information Worker Solutions, "om op basis van de nieuwste technologieën zoals MOSS 2007 oplossingen voor klanten te bedenken en te realiseren. Onze projecten hebben als doel informatiewerkers efficiënter samen te laten werken en meer waarde uit ongestructureerde informatie en daarmee uit zichzelf te halen. Met de aandacht voor 'het nieuwe werken' is ook 'enterprise search' onderdeel van onze oplossingen. Wij zorgen er met een intuïtief zoekmechanisme voor dat informatiewerkers op eenvoudige wijze toegang krijgen tot alle informatie, zowel de gestructureerde als de ongestructureerde."

Tam Tam behaalde de search competency ondermeer met de realisatie van projecten voor Twynstra Gudde, Isala Klinieken en VanderLande Industries. Op dit moment werkt Tam Tam aan SharePoint projecten voor onder meer Meeus, Tebodin Consultants & Engineers, Gemeentelijk Vervoerbedrijf Amsterdam, NIBC, ENECO, Sodexho, The British School, Vrije Universiteit Amsterdam en Royal Haskoning."

Tuesday, August 07, 2007 12:25:13 PM UTC #     | 

 

Content Editor Wepart error ("cannot retrieve properties at this time") workaround#

When using the content editor web part, in some cases you can receive the following message when editing the content, or saving the content: "cannot retrieve properties at this time"

This problem is caused by :

  • You configure an Internet Information Services (IIS) virtual server that has an assigned IP address, and then extend that virtual server by using Windows SharePoint Services.
  • You configure an IIS virtual server that has a host header name, you extend that virtual server by using Windows SharePoint Services, and then you install Web Part assemblies in the Bin folder instead of in the global assembly cache.

(http://support.microsoft.com/kb/830342)

There are some workaround described by that KB article but in some cases they are not advisable (for example when using SSL).

Another thing you can do (as described by a MS tech) is to remove the <clear /> tag in the web.config file in the ‘HttpHandlers’ section.

 

UPDATE: removing the tag can cause problems like an access denied page when you enter the root url (without /Pages/Default.aspx) under a non administrator user. The redirection could possibly not work anymore.

Monday, August 06, 2007 7:08:46 AM UTC #     | 

 

Disable size limits for wsp (cab) files#

Mikhail Dikov's post covers it all :) We've been struggling with half deployed SharePoint solutions a for an hour wondering why not all the files are added to our WSP file. 1424 KB sounds a lot like a 3,5" floppy... Anyway, the tip of the day is:

"Couple of days ago we added a big zip file to our SharePoint deployment and out of the sudden the solution started behaving strangely. After some trial and error Robin found out that every time we cross the 360KB limit we have a problem. Wait, 360KB this rings the bell, but it was such a long time ago. What was it? You guessed it right the default limit for file size of makecab.exe is 360KB the size of 5.25 inch diskette. Talk about legacy support... To disable all kinds of limitations I added these lines to my DDF files and everything worked fine again."

ddf


.Set CabinetFileCountThreshold=0
.Set FolderFileCountThreshold=0
.Set FolderSizeThreshold=0
.Set MaxCabinetSize=0
.Set MaxDiskFileCount=0
.Set MaxDiskSize=0

Lucy, thanks for Googling!

 

PS: did I already mentioned out free downloadable Tam Tam solution management tool of remote deployment?

Friday, August 03, 2007 12:23:53 PM UTC #     | 

 

All content © 2012, Mart Muller
On this page
This site
Calendar
<February 2012>
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
26272829123
45678910
Archives
Sitemap
Disclaimer

Powered by: newtelligence dasBlog 1.9.7174.0

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

Send mail to the author(s) E-mail

Theme design by Jelle Druyts