Sunday, June 1, 2014

Features in Sharepoint 2013

Using Features

A feature provides some additional functionality in a sharepoint site when it is activated and can remove that functionality when it is deactivated at the following levels of scope:

1. Farm
2. WebApplication
3. Site
4. Web

Creating custom features

All SharePoint features are stored under sharepoint root template\features folder.

Each feature related files are stored here in a subfolder with feature name.

A feature consists of :

1. A feature manifest file called feature.xml
2. One or more element manifest files.

A solution consists of one or more features and other related files such as assemblies, images, .css files, .js files, etc. that are packaged into a .wsp file.  (windows sharepoint services solution package file)

Solutions are of two types:

1. Sandboxed solutions
2. Farm Solutions

Sandboxed solutions can be deployed by a site collection administrator directly. They are run in a secured, monitored process. They have the following limitations:

1. They can only use a subset of the Server Object Model.
2. They cannot access any content outside the current site collection.
3. They cannot deploy any files to the server's file system.
4. They cannot contain code to be executed with elevated priveleges.

Farm solutions do not have any limitations. They can only be deployed by a server farm administrator.

To create a feature for adding a menu option in the Settings menu

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <CustomAction
        Id="CentralAdminLink"
         Title="Central Admin Site"
         Location="Microsoft.SharePoint.StandardMenu"
         GroupId="SiteActions"
          >
    <UrlAction Url="http://c4968397007:3695/default.aspx"/>
  </CustomAction>

  <CustomAction
        Id="BackupLink"
         Title="Site Collection Backup"
         Location="Microsoft.SharePoint.StandardMenu"
         GroupId="PersonalActions"
          >
    <UrlAction Url="http://c4968397007:3695/_admin/SiteCollectionBackup.aspx"/>
  </CustomAction>

</Elements>

No comments:

Post a Comment