SharePoint Tip of the day – Don’t forget the Managed Metadata friendly “PageFieldValue” CQWP filter to create rich OOTB relations between your content


Cqwp-pagefieldvalue

Another reminder to myself (like nearly all the posts in this small diary) to rely whenever possible on the Content Query WebPart “PageFieldValue” for the relation between content.
No custom user/web controls wrapped or not in webpart(s), no extensive search service configuration and core search result webpart configuration (altough I still like that option !), the good old trusty CQWP with its PageFieldValue and the ability to work natively with Managed metada field (including children terms) is a pure joy to use.

And if you’re targeting content that might also bring the actual page, don’t forget to exclude it (eg : by its title or its ID) through once again the PageFieldValue since it will be obviously the first candidate to match your filter.

SharePoint Tip of the Day – X-UA-Compatible IE Edge / IE8 and anonymous audience


Ie_edge_sp2010

As some might now, switching the IE rendering mode to IE=Edge on your SharePoint master page might bring unexpected issue

But for mostly anonymous audience, it might be neat to have it while retaining the classic IE=8 mode for contributors.

In order to quickly toggle between IE Edge mode and IE 8 mode depending on the audience I relied on a LoginView :

    <asp:LoginView runat=”server”>
        <anonymoustemplate>
            <meta http-equiv=”X-UA-Compatible” content=”IE=Edge” />
        </anonymoustemplate>
        <LoggedInTemplate>
            <meta http-equiv=”X-UA-Compatible” content=”IE=8″ />
        </LoggedInTemplate>
    </asp:LoginView>

Simple and codeless. The contributors will work in IE8 mode (no issue with the people picker, calendar, dialog, etc.) while the final audience will see the (publishing) site in the freshest mode depending on their IE version.

Next step, finally implementing the dual master page solution from Johan Leino to remove the fat from these bloated master pages.

SharePoint Tip of the Day – Reminder on how to install Adobe PDF IFilter in SharePoint 2010


There are an outstanding amount of walkthroughs on the web to do it but some are missing some steps or overcomplicating the task. Here’s thus the recipe I give when I deliver projects requiring pdf content results.

  1. Install PDF iFilter 9.0 (64 bit) from http://www.adobe.com/support/downloads/detail.jsp?ftpID=4025
  2. Download PDF icon picture from Adobe web site http://www.adobe.com/misc/linking.html or used the one attached

    Pdf

    (the one from adobe is not clean IMHO) and copy to C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions14TEMPLATEIMAGES 

  3. Add the following entry in C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions14TEMPLATEXMLdocIcon.xml <Mapping Key=”pdf” Value=”pdf.gif” />
  4. Add a pdf file type on the File Type page under Search Service Application
  5. Open regedit and navigate to the following location HKEY_LOCAL_MACHINESOFTWAREMicrosoftOffice Server14.0SearchSetupContentIndexCommonFiltersExtension. Right-click > Click New > Key to create a new key for .pdf and add the following GUID in the default value {E8978DA6-047F-4E3D-9C78-CDBE46041603}
  6. KB article ask to restart the SharePoint Server Search 14 service and to reboot the SharePoint servers in the farm better not skip that part (and schedule it wisely in production).
  7. Perform a full crawl on all your content sources to get the pdf within your results.

If price is not an issue (hmmm…), you should consider the Foxit IFilter, which offers much better performance (by lowering the time for the crawls). In the meantime, the adobe way is working and fully supported.

Happy configuring

SharePoint Tip of the day – Reorder fields within your list instance


During your application lifecycle management, you’ll probably have to add new fields or update your content types based on new requirements / needs.
Re-ordering fields within list instances consuming these content types can be handy to give the professional finish touch to your upgrade scenario.

Fortunately, it’s extremely easy once you know how to do it ! Just grap the FieldLinks property on the content type of the list and call the re-order method on it. Don’t forget to update your list afterward !

                SPContentType bannerContentType = rootWeb.Lists[Configuration.Lists.Banners].ContentTypes[ContentTypes.Banner];                SPFieldLinkCollection fieldLinkCollection = bannerContentType.FieldLinks;                fieldLinkCollection.Reorder(new[]{                                                    Fields.Title, Fields.BannerKeyword,                                                     Fields.Language,Fields.Taxonomy, Fields.TargetChannels,                                                     Fields.BannerType, Fields.BannerImage, Fields.BannerAlternateText,                                                    Fields.BannerTargetUrl, Fields.BannerUrlTarget,                                                     Fields.BannerBody, Fields.BannerBodyPosition,                                                    Fields.PublicationStartDate, Fields.PublicationEndDate});                bannerContentType.Update();

SharePoint Annoyance of the day – Cryptography nightly error on a server


Dear all,

If you encounter like we did on one of our testing server  a popup (appearing in the morning) with a cryptography exception and wanting to attach the VS Debugger Process, don’t worry. It’s documented and somehow normal.

 

Image001

This will only happens on some configurations  and if we have VS installed on the server (it’s usually not the case on staging environment and definitively not on authoring / production environment) otherwise a warning will be logged and nothing else.

In case you encountered the same behaviour of the customer would be complaining that any of your solution is doing something harmful (after all, a cryptography exception is quite frightening by its sole name), please refer him to this entry

SharePoint Tip of the day – Lookup fields defined through xml, WebId and managed paths


Lookup

Wondering why your lookup field(s) defined through xml are not working anymore when you deploy your solution outside of the root of the web application ? (/sites/whatever or /whatever for the explicit inclusion managed paths) ? Turns out that you need to specify the web id to the tokenized ~sitecollection (and also set overwrite to true if you do have a separate feature for your field and your list schema).

Without this, the lookup field definition which was working flawlessly without any code on the root of the web application was unable to find back its associated list.

That webid attribute, awfully unproperly documented within msdn / sdk, also allows you to define the guid of the target web holding the list instance.

SharePoint Tip of the Day – How to access the term store management tool as a contributor (not an owner) from a specific site collection


Sharepoint-2010_term_store_man

Took me quite an unexpected long time to figure this out but got it working ! Site collection contributors are obviously not able to connect to the central administration and cannot access the complete site settings administration page on a specific site collection since they are not owners

The administration page of the Term Store Management tool is thus hidden for them but the access once they know the link is available (/_layouts/termstoremanager.aspx?tsid=my-farm-guid-for-my-term-store)

If added as contributors within the term store manager in central administration, they will be able to add / edit terms (and manage translations). If added as administrators (while still being only contributors on the site collection) they will be able to do structural changes to the metadatas.

Good news for companies since they will be able to easily deleguate this to contributors without making access to the central administration nor needing custom permissions ! Strange enough that with all the plumbing done, a simple link is not available…

As always, once you know it …

SharePoint Tip of the Day – Add Alternate URL using stsadm (AAM)


If you try to automate as much as possible your solution deployment, you'll likely enjoy having your alternate access mappings deployed in a structured and repeatable way.
Turns out that it's quite easy and manageable by stsadm without doing some custom development.

To add an internal url to your web application :

stsadm -o addalternatedomain -url http://agents.company.com -urlzone Internet -incomingurl http://agentABC.company.com

And to add a public url :

stsadm -o addzoneurl -url http://SP2010:88 -urlzone Internet -zonemappedurl http://www.company.com

Quite handy and something we can add to our little batch files that deploy our SharePoint solutions.

SharePoint Tip of the Day – Don’t forget to set Inherits=”false” when you’re removing field reference(s) in your SP2010 content types


… or how something that worked in SharePoint 2007 is now not working as expected in SharePoint 2010.

Never minds, if I read carefully msdn documentation, it was kinda explained, I need to remove the inherits="true" (or stop using the built-in template for the content type creation !) or change it to inherits="false".

Optional Boolean. The value of this attribute determines whether the content type inherits fields from its parent content type when it is created.If Inherits is TRUE, the child content type inherits all fields that are in the parent, including fields that users have added.

If Inherits is FALSE or absent and the parent content type is a built-in type, the child content type inherits only the fields that were in the parent content type when SharePoint Foundation was installed. The child content type does not have any fields that users have added to the parent content type.

(source : http://msdn.microsoft.com/en-us/library/aa544268.aspx)

If you use some  RemoveFieldRef entries in your content type definition and you're still seeing the removed fields, then you now know why.