SP SIN allows script library authors, designers, or front end developers, or users to package up their configuration for SP SIN into a configuration package.

To do this, you need to

  • build a WSP solution
  • mark a feature of the solution with two custom properties
  • deploy the configuration as part of the feature

Below is a video demonstrating one approach to building such as configuration package.

 

 

In order to mark a feature as an SP SIN configuration package, you need to add two properties to the feature. These properties will contain the title and the description of the package. The two properties can look like this:

<Properties>
  <Property Key="SPSIN_ConfigPackage_Title" Value="My Package Title"/>
  <Property Key="SPSIN_ConfigPackage_Description" Value="My Package Description."/>
</Properties>

You add these properties to your feature definition, for example as such:

<?xml version="1.0" encoding="utf-8"?>
<Feature  Id="7c7c7c5e-e1ec-44c1-99ae-32ab5041acc3"
          Title="SPSampleConfigPackage"
          Description="Description for SPSampleConfigPackage"
          Version="1.0.0.0"
          Hidden="FALSE"
          Scope="Web"
          DefaultResourceFile="core"
          xmlns="http://schemas.microsoft.com/sharepoint/">
  <ElementManifests>
    <ElementManifest Location="elements.xml"/>   
  </ElementManifests>
  <Properties>
    <Property Key="SPSIN_ConfigPackage_Title" Value="jQuery from CDN on Home page"/>
    <Property Key="SPSIN_ConfigPackage_Description" Value="This package will add the latest minified jQuery script framework on all pages. The script will be loaded directly from code.jquery.com so it will not add local files to your installation. Be aware that you may not always want to load the latest version of any script due to possible future breaking changes."/>
  </Properties>

</Feature>

When a user activates a configuration package, the feature is activated and also automatically deactivated. This will allow users to reactivate the package to create duplicates of the configuration, but as a developer, you need to be aware of this fact in case you utilize a feature receiver that activates on FeatureDeactivating.

You can download a sample Visual Studio project for an SP SIN configuration package if you’d like to experiment (it’s the project from the video above).

Last edited Oct 16, 2012 at 6:21 AM by furuknap, version 2

Comments

No comments yet.