Feature Elements

Feature is one of the roubust way to eliminate complexity,versioning, inconsistency.

Feature Snippet:

<Feature
  Id="ud34C3075-X5C0-CD#6-9XCF-CA6BBC7D43"

ActivateOnDefault = “TRUE” | “FALSE”

  Title="Location Services"
  Description="......"

Scope=”Web/Site/WebApplication/Farm>

  <ActivationDependencies>

<ActivationDependency

      FeatureId="al94C3075-X5C0-CD#6-9XCF-4T6BBC7DA5" />
  </ActivationDependencies>
  <ElementManifests>
    <ElementManifest
      Location="Location\LocationPart.xml"/>
    <ElementManifest
      Location="CustomerLocation\CustomerLocationList.xml"/>
    <ElementFile
      Location="test.aspx"/>
  </ElementManifests>

</Feature>

ActivateOnDefault

Optional Boolean. TRUE if the Feature is activated by default during installation or when a Web application is created; FALSE if the Feature is not activated. This attribute equals TRUE by default. The ActivateOnDefault attribute does not apply to site collection (Site) or Web site (Web) scoped Features.

In general, Farm-scoped Features become activated during installation, and when a new Web application is created, all installed Web application-scoped Features in it become activated.

Scope :

Feature one can set scope at the individual Web site level.
A site collection Feature contains items that apply to the site collection
as a whole (e.g.,content types that are shared across the site collection),
as well as items that can be activated per site.

Site Collection or Site scope include list definitions
(templates and instances), modules (file sets), and item content type behaviors
(per-item custom menu options and per-item events).

Web (Web site scope)

Control,Custom Action,Custom Action Group,Hide Custom Action,List Instance, List Template,Module,Receiver

Site (site collection)

Content Type,Content Type Binding,Control,Custom Action
Custom Action Group,Feature/Site Template Association,Field
Hide Custom Action,List Instance,Module,Workflow

WebApplication (Web application)

Control,Custom Action,Custom Action Group,Document Converter
Feature/Site Template Association,Hide Custom Action

Farm (farm)

Control,Custom Action,Custom Action Group,Feature/Site Template Association,Hide Custom Action

ActivationDependency

Features can have dependencies on other Features, and these other Features can be activated when the Feature that depends on them is activated.

Note : Windows SharePoint Services does not support a cross-scope activation dependency if the current Feature depends upon another Feature at a more restrictive scope, or if the current Feature depends on a hidden Feature. Click here

ElementManifest : Definition for a feature element

ElementFile : Support file required for the Feature this may contain

master pages, page layouts, images, style sheets etc

Click here:

Feature that provisions the instances does not remove the instances upon deactivation.

Provision a File : the Module element within a Feature or site definition. The Module element allows you to add one or more files, or file set, to a SharePoint Web site or document library.

Type="GhostableInLibrary"

This setting tells Windows SharePoint Services to create a list item to go with your file when it is added to the library

Type="Ghostable"

Provisioning a file outside a document library.

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