Registration Receiver
One of the first things that I do when I get something new is make it uniquely my own. When I got my new desk, I broke out the drill and installed a USB Hub. New car… seat covers and dice for my mirror. New house… paint every room in the house (ok, so that one was actually my wife’s choice) but I think there is something about customizing or personalizing that makes the experience feel special and unique in some way. Your SharePoint extranet powered by ExCM should be no different!
AD vs. HUIL
Most people who have worked with SharePoint for a while know that Active Directory is the default location that is used to pull user information from. What some do not know is that there is another list that can be populated by AD called the User Information List, or sometimes called the Hidden User Information List. Typically this list is kept in Sync with Active Directory by the User Profile Service taking data from AD and adding it to the HUIL. In this article we will walk you though how to use this HUIL to store data about your external users. To access your HUIL, just browse out to;
SP User Registration
When an internal user logs into a site collection, their First and Last Name is displayed in the top right corner. This information is stored in Active Directory. However, your Forms Based Users are not stored in AD and therefore their user name is typically just their email address. We created the SPUser Registration Receiver to help personalize the experience for your external user and add their first and last name to the user information. The following code is used to accomplish this for us.
<add name="SPUser"
spUserFieldMap="Title=$registrationItem.FieldAnswers.get_Item('FirstName').Value $registrationItem.FieldAnswers.get_Item('LastName').Value;" type="SPSolutions.SharePoint.ExCM.ExtranetSPUserRegistrationReceiver, SPSolutions.SharePoint.ExCM, Version=3.0.0.0, Culture=neutral, PublicKeyToken=fdcedad4c93ea981" />
Assign a Department (built In)
Now that we know about the HUIL and have seen a registration receiver in action, let’s work through setting up our own registration receiver. For this example, we are going to add a new registration field and allow our end user to assign a department from a drop down list.
First, let’s create the registration field by adding a global registration field through the Global Application Settings ExCM menu. We could also create a registration field on an individual site collection, in case you have one site collection that you need to collect different information than the rest of your site collections
[Steps to add a drop down list to a registration page]
Now that the field is there, let’s test to ensure that we did not break anything. We browse out to the site and register as sally in the accounting department.
To correct this, we now need to add some logic to our web.config file so that we map the answer to the “department” registration field to the department field in the HUIL
[steps to add department registration receiver]
Open the Web App’s web.config file by browsing out to the Virtual Directory (in our case C:\inetpub\wwwroot\wss\VirtualDirectories\extranet.awbikes.com80)
Make a backup copy of the web.config file
Search for <registrationReceivers>
Copy the following text and paste just above SPUser line
<add name="SPDepartment" spUserFieldMap="Department=$registrationItem.FieldAnswers.get_Item('Department').Value;" type="SPSolutions.SharePoint.ExCM.ExtranetSPUserRegistrationReceiver, SPSolutions.SharePoint.ExCM, Version=3.0.0.0, Culture=neutral, PublicKeyToken=fdcedad4c93ea981" />
Save your web.config file.
Now that we have the Department registration receiver in place, lets create a new user and test. We browse out to the site and register as Tom from the Accounting department
We can see that the user was created and now has the appropriate department listed as chosen by the drop down box on the registration page
Be sure to check out our next post on how to take this a step further and assign a photo based on registration answer
by noreply@blogger.com (Johnathan Horton) via SharePoint Solutions Blog
No comments:
Post a Comment