Welcome to Atalasoft Community Sign in | Join | Help

CustomActionGroup: Making your own grouping in SharePoint admin pages

CustomActionGroups are a way to group together CustomActions in your SharePoint admin pages.  Go figure!  I’m going to give you a quick example of how these things work.

A CustomActionGroup looks like this:

image

InfoPath Forms Services is the group, under which a number of CustomActions have been grouped.  To do this you need to know how to create a Feature.  For this example I’m going to use this feature.xml:

<?xml version="1.0" encoding="utf-8" ?>
<Feature Id="7E710DE2-D8DB-444D-A96F-9513787CEA0B"
    Title="UI Custom Actions"
    Description="This example shows how you can customize various areas inside Windows SharePoint Services."
    Version="1.0.0.0"
    Scope="Site"
    xmlns="http://schemas.microsoft.com/sharepoint/">
  <ElementManifests>
    <ElementManifest Location="UICustomActions.xml" />
  </ElementManifests>
</Feature>

and since you’re already a feature pro, you want to know what the ElementManifest file looks like because, after all, that’s where the content of this blog post is.  Without delay, here it is:

<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <CustomActionGroup Id="CA_Company"
                     Location="Microsoft.SharePoint.Administration.ApplicationManagement"
                     Title="Company Product Group" />
  <CustomAction Id="CA_CompanyThing"
                Title="Manage your Company Product installation"
                GroupId="CA_Company"
                Location="Microsoft.SharePoint.Administration.ApplicationManagement"
                Sequence="0"
                RequireSiteAdministrator="TRUE">
    <UrlAction Url="_layouts/Company/Action.aspx"/>
  </CustomAction>
</Elements>

You’ll notice a few things, first the Location of both items is set to Microsoft.SharePoint.Administration.ApplicationManagement.  This example will make a new group in the Application Management section of the Central Admin page in SharePoint.  You can check out the Default Custom Action Locations and IDs page on MSDN to figure out where else you can put your custom action groups and custom actions.

Next, have a look at the CustomAction’s GroupId attribute.  The GroupId is normally where you’d put something like SiteAdministration if you were to put your CustomAction in the Microsoft.SharePoint.SiteSettings Location.  In this case I’m using the CA_Company GroupId, which makes sense since we want the CustomAction to show up in our newly created CustomActionGroup.  Notice, there are a handful of optional Attributes on the CustomActionGroup that I haven’t used here, but you can have a look at the schema to see them all.

When you install and activate this feature

stsadm -o installfeature -filename company\feature.xml
stsadm -o activatefeature =filename company\feature.xml -url http://yourserver:32342

you should see your new group and action listed in the Application Management screen

image

Enjoy your grouping!

Published Monday, January 19, 2009 11:15 AM by dterrell

Comments

No Comments
Anonymous comments are disabled