Wednesday, July 25, 2012

SharePoint 2010 put back the "Set Up Groups for this Site" link

The "Set Up Groups for this Site" page has been, for some unknown reason, hidden in SharePoint 2010.

The page is still there and it can be accessed here:/_layouts/permsetup.aspx.

To make this generally available I created a custom action to add this to the "People and Groups: All Groups" (/_layouts/groups.aspx) page, in the Settings dropdown menu:

xml version="1.0" encoding="utf-8"?>
< Elements xmlns="http://schemas.microsoft.com/sharepoint/" >
  < CustomAction Id="64f25e2b-f9fb-4e37-b848-5949603b03ab"
                Title="Set Up Groups for this Site"
                Description="Use this page to specify who can access your site. You can create new SharePoint groups or re-use existing SharePoint groups."
                Location="Microsoft.SharePoint.GroupsPage"
                GroupId="SettingsMenu"
                Sequence="1000"
                >
    < UrlAction Url="~site/_layouts/permsetup.aspx">< /UrlAction>
  < /CustomAction >
< /Elements >  
This can a Site or Web level feature, depending on where it has to be applied.

Tuesday, July 17, 2012

How to create a custom Workflow Task / SharePoint Server Workflow Task content type using Visual Studio?


If you are designing an Workflow and you want to create custom Workflow Task or SharePoint Server Workflow Task using Visual Studio interface then you'll need to make these two content types visible.

To make them visible I'm using the following PowerShell script:

$site = Get-SPSite "http://site/url/here"
$web = $site.RootWeb

# Workflow Task
$contentType = $web.ContentTypes["Workflow Task"]
$contentType.Group = "Custom Content Types"
$contentType.Hidden = $FALSE
$contentType.Update()

# SharePoint Server Workflow Task
$contentType = $web.ContentTypes["SharePoint Server Workflow Task"]
$contentType.Group = "Custom Content Types"
$contentType.Hidden = $FALSE
$contentType.Update()

$site.Dispose()
Then when you can add a new Content Type from Visual Studio and you will see the two Content Type in the list.

To revert these changes run this PowerShell script:
$site = Get-SPSite "http://site/url/here" $web = $site.RootWeb # Workflow Task $contentType = $web.ContentTypes["Workflow Task"] $contentType.Group = "_Hidden" $contentType.Hidden = $TRUE $contentType.Update() # SharePoint Server Workflow Task $contentType = $web.ContentTypes["SharePoint Server Workflow Task"] $contentType.Group = "_Hidden" $contentType.Hidden = $TRUE $contentType.Update() $site.Dispose()