Archive for the ‘Tips and Tricks’ Category

Oct
23
Filed Under (Development, SharePoint 2010, Tips and Tricks) by Andy Diericks on 25-04-2007

A really great article on MSDN in order to install SharePoint 2010 on Windows 7, and really explicit.

http://msdn.microsoft.com/en-us/library/ee554869%28office.14%29.aspx



Sep
02
Filed Under (Design, Tips and Tricks, XSLT) by Andy Diericks on 25-04-2007

Again a little tip concerning SharePoint and XSL.

Add the following snippet in the xsl file, for example one of your custom style in the itemstyle.xsl file.

<span class="presence-status-icon">
              By: <a href="http://[MySharePoint]/sites/intranetbelgium/_layouts/userdisp.aspx?ID={$AuthorID}">
                <xsl:value-of select="concat($AuthorName,’ ‘)" />
              </a>
              <img src="/_layouts/images/blank.gif" onload="IMNRC(’{$AuthorEmail}’)" alt="" id="{concat(’MWP_pawn_’,$ClientId,’_',@ID,’type=sip’)}" /> 
  </span>

Tips: you can add "ShowOfflinePawn=1” before the add property in the img tag, this will show the offline picture of OCS if the “AuthorName” is offline. I personnally prefer to remove it, I found that cleaner.



 

The problem: Microsoft provide a way to create custom headers using the file Header.xsl but doesn’t provide the same kind of file concerning the footer. So how to create a style containing a footer and a header?

Inside your new style in the file itemstyle.xsl add the following snippet:

For a header add a test to check if there is a preceding sibling:

<xsl:if test="count(preceding-sibling::*)=0">
This is the header !
</xsl:if>

For a footer add a test to check if there is a following sibling:

<xsl:if test="count(following-sibling::*)=0">
     This is the footer !
   </xsl:if>

That’s pretty easy to do and I hope it can help.



Apr
12
Filed Under (Security, Tips and Tricks, User Account) by Andy Diericks on 25-04-2007

 

 

  • When updating a value of a profile your changes won’t be applied until you make a commit, it can be so frustrating when you forget it…..
   1: UserProfile u;
   2: u[property].Value = "My string";
   3: u.Commit();

  • Maybe the user will not have the rights to edit profiles, the current user has to get the "Manage user profiles" right, you can set it up in the SSP.
  • If the users cannot have the rights to edit profiles and can’t have it through SSP, because of security or business reason you can run your code with elevated privileges using the object SPSecurity. In that case the user that will run the code will have the same rights as "SYSTEM\Administrator", so be careful. I have to admit I’m not a big fan of it. More information on MSDN: SPSecurity.RunWithElevatedPrivileges Method .You can use the impersonation too: a good post about it: Impersonation in Event Handlers by Ishai Sagi
   1: SPSecurity.RunWithElevatedPrivileges(delegate()
   2: {
   3:     using (SPSite site = new SPSite(web.Site.ID))
   4:     {
   5:     // your code
   6:     }
   7: });

 

  • Like always use some safe code, like testing if your user exist if not you can raise an exception
   1: try
   2: {
   3:    if (profileManager.UserExists("MOSS\\andy"))
   4:    {
   5:          //Do something
   6:    }
   7: }
   8: catch (UserNotFoundException ex)
   9: {
  10:     //Do something                
  11: }



Apr
02
Filed Under (Design, SharePoint Designer, Tips and Tricks) by Andy Diericks on 25-04-2007

No, the blog isn’t transformed into a warez board, that’s the real thing. ;-)

Since the 03/31/2009, you can freely download it directly from the microsoft site, link is below.

After the news about setting a part of the BI stack of Microsoft, PerformancePoint, for free to the enterprise CAL customers, it’s now the turn of the SPD 2007 to be free.

That will probably leverage again a bit higher the reasons to go for SharePoint for the futures customers.

LicenKeySPD2007

 

For the time being saying to  them:"Ok you’ve bought an expensive piece of software even if it’s a killer-app, now you have to buy for each of you’re developers or designers a new office 2007 licence".

The answer is rather often:"Oh, it’s not included in SharePoint or Visual Studio ?"

 

And now I’m waiting for Infopath for free ;-)

The download link:

http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=baa3ad86-bfc1-4bd4-9812-d9e710d44f42