Thursday, March 3, 2011

How to set up a Custom Attribute Store in ADFS 2.0

The custom attribute store provides the possibility to get claims from different sources like different databases, text files. In order to set up a custom attribute store is required to create an assembly that contains the classes with the methods that implements its functionality. The reference for this task is provided by MSDN .In order to set up the custom attribute store you have to take into account the following points:
.NET Framework 3.5
Make sure that you use the .NET Framework 3.5, the WIF references points to the 3.5 and the engine of ADFS does not support .NET Framework 4.0 yet. So if you use an earlier version you will get an error in the Event Viewer:
Error 149: Could not load file or assembly 'CustomAttributeStore' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
Register the assembly in the GAC (Global Assembly Cache)
Make sure that the assembly has a strong name, if you don’t do it, you will get an error in the command prompt that makes reference to this issue.
You can perform this task in visual studio going to Project Name > Properties >Signing > [Checkbox] Sign the assembly. Then choose a name for the key
Register the attribute store in the ADFS 2.0 Management Console
Open the ADFS 2.0 Management Console, and in the left pane open the folder of Trust Relationships and the select the folder of Attribute Stores.

(As shown in the first image)
Then, select in the right pane the option Add Custom Attribute Store. (As shown in the second image)
Then, it will prompt a window that requests the information of the store. Provide the full name, it means:
CustomAttributeStores.AttributeStore,AttributeStore, Version=1.0.0.0, Culture=neutral, PublicKeyToken=.
Check that the attribute store is workingCheck in the event viewer for a 149 event id. If you don’t find it, it means that the attribute is ready.

Monday, March 8, 2010

Ribbon

Value
Description

CommandUI.Ribbon
Customization appears everywhere for the specified RegistrationId.

CommandUI.Ribbon.ListView
Customization appears when the list view Web Part is present.

CommandUI.Ribbon.EditForm
Customization appears on the edit form.

CommandUI.Ribbon.NewForm
Customization appears on the new form.

CommandUI.Ribbon.DisplayForm
Customization appears on the display form.

Hiding the Buttons in the ribbon

Hi All,

Recently I had some requirement of hiding some of the button in the menu of the ribbon. I tried searching for it and nothing very specific was found. However after lot of head scratching !!! I found something which was really useful. So thought of sharing the same with everyone.

My requirement was to hide New option (both item and folder) in the ribbon. Below is the snippet of the element.xml file which I used and it worked for me.

Id="RemoveNewButton"
Location="CommandUI.Ribbon"
RegistrationId="0x0101009148F5A04DDD49CBA7127AADA5FB792B" //contentype id of the list where we want to apply
RegistrationType="ContentType"
>


Location="Ribbon.Documents.New.NewDocument" />




Id="RemoveNewFolderButton"
Location="CommandUI.Ribbon"
RegistrationId="0x0101009148F5A04DDD49CBA7127AADA5FB792B"
RegistrationType="ContentType"
>


Location="Ribbon.Documents.New.NewFolder" />


Monday, January 18, 2010

SP2010: SPFarm.Local is null or Web Application could not be found

http://blogs.msdn.com/ekraus/archive/2009/11/13/sp2010-spfarm-local-is-null-or-web-application-could-not-be-found.aspx
Power Shell

http://sharepointdotnetwiki.iblogger.org/2009/12/powershell/

Tuesday, September 29, 2009

Custom Search Control inheriting from OOTB SearchBoxex

Creating a Custom Search webpart that inherits from SearchBoxEx is a simple task. Also we can set a scope where we can perform search using the property 'AppQueryTerms'. Following code snippet shows how do we create the webpart.


this.AppQueryTerms = string.Empty;
this.AppendToQuery = false;
this.DropDownMode = DropDownModes.HideScopeDD;
string searchScope = specify your custom scope//
this.AppQueryTerms = "Country:Global Scope:" + searchScope; //I am querying on basis of scope and managed property country
string searchPageUrl = searchCenterSiteName + "/" + pageListName + "/" + RESULTSPAGE;
string advancedSearchpageUrl = searchCenterSiteName + "/" + pageListName + "/" + ADVANCESEARCH;
this.ShowAdvancedSearch = true;
this.SearchResultPageURL = Path.Combine(SPContext.Current.Web.ParentWeb.Url, searchPageUrl).Replace('\\', '/');//setting the url of the Search page url
this.AdvancedSearchPageURL = Path.Combine(SPContext.Current.Web.ParentWeb.Url, advancedSearchpageUrl).Replace('\\', '/');//setting the url of the advanced Search page url


Following link conatins some details about the Search settings.
http://blogs.msdn.com/markarend/archive/2007/01/24/search-results-page-may-be-different-per-search-scope.aspx.