Why not to install 64-bit SharePoint Designer 2010

Today I wanted to install Visio 2010 on my SharePoint 2010 development machine. But the problem was I simply could not because there was already an Office 2010 64-bit application installed. Correct, yesterday I installed SharePoint Designer 2010 64-bit. Now comes the downside of this;

You can’t install Visio 2010 32-bit version when a 64-bit Office application is already installed on the system.

Conclusion, if there is no specific reason for installing a 64-bit version of Office. Simply install the 32-bit version.

Advertisements

Retrieve User Profile information and display all properties in simple webpart

When working with User Profiles I want an overview of all user profile properties and the contents of a particular user. This information can be retrieved from the Central Administration. The downside of this is you can either view the profile properties or the user profile. But I am looking for the display name, technical name and the value for a particular user.

User Profile WebPart

This can be achieved by developing a webpart which loops the user profile properties and retrieves per property the value of an user profile. The user profile which is displayed can be set in the webpart properties pane.

User Profile WebPart - Property Pane

The C# code which drives the webpart is shown below. It is pretty straight forward and shows only the retrieval of the user profile properties and values of the user profile.

System.Security.PermissionSet ps = new System.Security.PermissionSet(System.Security.Permissions.PermissionState.Unrestricted); ps.Assert(); Microsoft.SharePoint.SPServiceContext serviceContext = Microsoft.SharePoint.SPServiceContext.Current; UserProfileManager upm = new Microsoft.Office.Server.UserProfiles.UserProfileManager(serviceContext); ProfileSubtypePropertyManager pspm = upm.DefaultProfileSubtypeProperties; UserProfile profile = upm.GetUserProfile("CONTOSO\AaronP"); this.Controls.Add(new Literal() { Text = "<table border='0' > <tr><td>Displayname</td><td>Name</td><td>Value</td></tr>" }); foreach (ProfileSubtypeProperty prop in pspm.PropertiesWithSection) { if (prop.IsSection) this.Controls.Add(new Literal() { Text = string.Format("<tr><td colspan='3'><b>Section: {0}</b></td></tr>", prop.DisplayName) }); else { string text = string.Format("<tr><td>{0}</td><td>{1}</td><td>{2}</td></tr>", prop.DisplayName, prop.Name, profile[prop.Name].Value); this.Controls.Add(new Literal() { Text = text }); } } this.Controls.Add(new Literal() { Text = "</table>" });

DownloadYou can download the WSP package and source code at http://sp2010userprofilewp.codeplex.com/.

Create site-collection based on custom sandbox solution template

SharePoint provides a couple out-of-the-box web templates. When implementing SharePoint this you probably want to provide a customized template which suit the needs. A big advantage would be if you are not depending on an administrator and being able to provide your own custom template. With sandboxed solution in SharePoint 2010 this is possible! What is really nice about this, you can also do this when creating a site-collection and choose the custom template for the root web.

I created a site-collection based on the out-of-the-box Team Site template (STS#1). Made changes to the site by adding a new list FAQs, added a task to the Task list and added the Tasks list on the homepage. This is the basics for my template.

Template - Team Site

Next step is to save the team site as a template.

  1. Click Site Actions » Site Settings
  2. Click Save site as template
  3. Fill in the fields
    • File name: TeamSiteTemplate
    • Template name: Team Site Template
    • Check the Include Content checkbox
  4. Click OK
  5. Click the link Solution Gallery in the “Operation Completed Successfully” window
  6. Click the “TeamSiteTemplate” name to download the WSP solution file, save on your desktop

At this point we have a WSP solution file containing a template for a new site. We want to create a new site-collection based on this template. But we do not want to upload the WSP solution as a Farm Solution. We can create the new site-collection based a sandbox solution containing the template.

  1. Open SharePoint 2010 Central Administration via Start Menu
  2. Click Application Management » Create Site Collections
  3. Select a web application
  4. Fill in the fields
  5. When selecting a template, click the Custom tab and select “< Select template later… >”
  6. Click OK

The site-collection is created but has no template. Meaning it is also not provisioned with lists and libraries. We want the site-collection to be based on our sandboxed solution template. Next steps will explain!

  1. Open the new site-collection URL
  2. The “Template Selection” page is shown
    Template - Template Selection
  3. Click Solution Gallery
  4. Upload the sandboxed solution by click the Solutions tab in the ribbon
  5. When uploaded, activate the solution by clicking Activate in the Solution Gallery – Activate Solution window
  6. Go back to the Template Selection page (_layouts/templatepick.aspx) by using the Back-button
  7. Refresh the page, the Custom tab should show up
    Template - Template Selection 2
  8. Select the Custom tab and select our “TeamSiteTemplate”
  9. Click OK

Now the site-collection is provisioned based on the sandboxed solution. The site is provisioned with the FAQs list and one task in the Task list which is shown on the homepage.

Template - Complete