Software Architecture-SharePoint 2010-To Create new menu item in Ribbon control in Permission tab

Objective:
To create a new menu item in Ribbon control in Permission tab of SharePoint 2010.
Steps to follow:
A feature will be used to deploy the customization of ribbon control. Create a new folder named “CustomMenuRibbon” in feature folder. Create one file named “feature.xml” with following content.

 
<?xml version="1.0" encoding="utf-8" ?>
<Feature xmlns="http://schemas.microsoft.com/sharepoint/"
  Id="4E1C8B4C-D7DD-4351-8A58-17CDD3688BB3"
  Title=” New Menu"
  Description="This Feature adds a new menu item to the site permissions page "
  Hidden="FALSE"
  Scope="Web"
  Version="1.2.0.0">
  <ElementManifests>
    <ElementManifest Location="CustomMenuItem.xml" />
  </ElementManifests>
</Feature>

In same folder create a new file named “CustomMenuItem.xml” with following content.

 
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <CustomAction Id="VN.SharePoint.Ribbon.CustomTab" Location="CommandUI.Ribbon">
    <CommandUIExtension>
      <CommandUIDefinitions>
        <CommandUIDefinition      Location="Ribbon.Permission.Scaling._children">
     <MaxSize      Id="Ribbon.Permission.Customs.MaxSize"      Sequence="15"      GroupId="Ribbon.Permission.Customs"      Size="LargeLarge" />
    </CommandUIDefinition>
        <CommandUIDefinition Location="Ribbon.Permission.Groups._children">
          <Group Id="Ribbon.Permission.Customs"
                   Sequence="101"
                   Command="Perm_Custom"
                   Description=""
                   Title="Imanami Corp - GroupID"                                     
                   Template="Ribbon.Templates.Flexible2" >
            <Controls Id="Ribbon.Permission.Customs.Controls">
              <Button
               Id="Ribbon.Permission.Customs.Add"
               Command="Perm_AddCustom"
               Sequence="10"
               Image16by16="/_layouts/$Resources:core,Language;/images/formatmap16x16.png" Image16by16Top="-128" Image16by16Left="0"
               Image32by32="/_layouts/$Resources:core,Language;/images/formatmap32x32.png" Image32by32Top="0" Image32by32Left="-416"              
               LabelText="Custom Permission"
               Alt=" Custom Permission"
               ToolTipTitle=" Custom integration with SharePoint"
               ToolTipDescription=" Custom integration with SharePoint . Custom integration with SharePoint . Custom integration with SharePoint . "
               TemplateAlias="o1"/>
            </Controls>
          </Group>
        </CommandUIDefinition>
      </CommandUIDefinitions>
      <CommandUIHandlers>
        <CommandUIHandler
         Command="Perm_AddCustom"
         CommandAction="javascript:window.showModalDialog('http://win2k8-ultimate/sites/softcom/_layouts/SSP/setpermission.aspx','', 'dialogWidth:500px; dialogHeight:400px; center:yes');" />
        <CommandUIHandler
         Command="Perm_Custom"
         CommandAction="javascript:window.showModalDialog('http://win2k8-ultimate/sites/softcom/_layouts/SSP/setpermission.aspx','', 'dialogWidth:500px; dialogHeight:400px; center:yes');" />
      </CommandUIHandlers>
    </CommandUIExtension>
  </CustomAction>
</Elements>

This feature can be installed as:

Install-spfeature CustomMenuRibbon –force

In site settings, go to features page and activate the feature. Go to site permissions page to view the new menu.
According to MSDN, Location of Ribbon control can be defined as:

The Server ribbon in Microsoft SharePoint Foundation supports customization of the default tabs, groups, and controls. In order to customize these objects, you need the specific identifier (ID) for the object you plan to customize. The IDs are found in the CMDUI.xml file that is stored in the %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\14\TEMPLATE\GLOBAL\XML directory on the front-end Web server.

Reference: http://msdn.microsoft.com/en-us/library/ee537543.aspx

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: