 |
|
AC's Blog Quick Links
|
|
SharePoint Quick Links
|
Article Categories
|
Archives
February, 2012 (2)
January, 2012 (12)
December, 2011 (6)
November, 2011 (3)
October, 2011 (17)
September, 2011 (8)
August, 2011 (6)
July, 2011 (7)
June, 2011 (13)
May, 2011 (9)
April, 2011 (15)
March, 2011 (1)
February, 2011 (6)
January, 2011 (5)
December, 2010 (11)
November, 2010 (6)
October, 2010 (12)
September, 2010 (5)
August, 2010 (4)
July, 2010 (5)
June, 2010 (6)
May, 2010 (11)
April, 2010 (11)
March, 2010 (9)
February, 2010 (9)
January, 2010 (3)
December, 2009 (10)
November, 2009 (15)
October, 2009 (15)
September, 2009 (7)
August, 2009 (4)
July, 2009 (10)
June, 2009 (8)
May, 2009 (2)
April, 2009 (9)
March, 2009 (6)
February, 2009 (16)
January, 2009 (6)
December, 2008 (12)
November, 2008 (12)
October, 2008 (27)
September, 2008 (13)
August, 2008 (14)
July, 2008 (14)
June, 2008 (12)
May, 2008 (23)
April, 2008 (12)
March, 2008 (15)
February, 2008 (13)
January, 2008 (12)
December, 2007 (10)
November, 2007 (8)
October, 2007 (15)
September, 2007 (20)
August, 2007 (21)
July, 2007 (16)
June, 2007 (8)
May, 2007 (25)
April, 2007 (16)
March, 2007 (18)
February, 2007 (18)
January, 2007 (12)
December, 2006 (16)
November, 2006 (13)
October, 2006 (18)
September, 2006 (22)
August, 2006 (27)
July, 2006 (23)
June, 2006 (23)
May, 2006 (23)
April, 2006 (9)
March, 2006 (17)
February, 2006 (15)
January, 2006 (23)
December, 2005 (31)
November, 2005 (32)
October, 2005 (38)
September, 2005 (53)
August, 2005 (30)
July, 2005 (63)
June, 2005 (30)
May, 2005 (59)
April, 2005 (29)
March, 2005 (74)
February, 2005 (27)
January, 2005 (22)
December, 2004 (32)
November, 2004 (42)
October, 2004 (39)
September, 2004 (20)
August, 2004 (14)
July, 2004 (27)
June, 2004 (40)
May, 2004 (5)
April, 2004 (6)
March, 2004 (16)
February, 2004 (26)
January, 2004 (23)
December, 2003 (7)
November, 2003 (14)
October, 2003 (20)
September, 2003 (4)
|
Post Categories
|

|
 |
|
WSS v3 Feature definitions (feature.xml) files contain a section that points to files that do most of the heavy lifting of a Feature: <ElementManifests />. This section is where you specify your element manifest files that contain CAML markup that is processed as instructions upon Feature activation. These element manifest files are deployed using the <ElementManifest> element. However there is a lesser known element that you can use in this same location to your advantage. The <ElementFile /> element, also a child to the <ElementManifests /> element tells SharePoint about other files that are part of the Feature. What kind of files would you put in here? Things such as master pages, page layouts, images, style sheets, Web Part definition files, etc. The Feature doesn't do anything with these files... it just is made aware that they "belong" to the Feature. "But I'm already using images in my Feature without this and I'm not having any problems... why do I need it?" Good question... When you package everything up in a WSS solution package you list your Feature's definition file within the manifest.xml file (using the <FeatureManifests /> node) which contain the instructions to SharePoint of what to do with the files within the package (*.wsp). If you have additional files that go along with your Feature, you should be listing them in the manifest.xml file as well using something like <TemplateFiles /> or <RootFiles /> (the former is preferred). But, if you listed all the files that were part of the Feature using the <ElementFile /> nodes within the Feature definition, you wouldn't have to list them here. Why? Because SharePoint will look at the definition and see those are files that are part of the Feature itself so the solution framework will deploy those as well. Take the following for example. This is a sample Feature that provisions a mater page, page layout, preview images for each, a stylesheet and an image. The element manifest file provisions all these files as uncustomized instances in the a Publishing site. <?xml version="1.0" encoding="utf-8" ?>
<Feature xmlns="http://schemas.microsoft.com/sharepoint/"
Id="D56F0D2D-0107-424d-AA0D-7120329A23E6"
Title="ACME: Provisioning Master Pages and Page Layouts"
Hidden="FALSE"
Scope="Site"
Version="1.0.0.0">
<ElementManifests>
<ElementManifest Location="elements.xml" />
<ElementFile Location="MasterPages\ACMETmp.master" />
<ElementFile Location="MasterPages\ACMEMasterPreviewTmp.gif" />
<ElementFile Location="Styles\ACMETmp.css" />
<ElementFile Location="Styles\ACMETmp.gif" />
<ElementFile Location="PageLayouts\ACMEPressTmp.aspx" />
<ElementFile Location="PageLayouts\ACMEPressPreviewTmp.gif" />
</ElementManifests>
</Feature>
Now, the manifest.xml file for the solution package is quite simple as it only points to the Feature definition within the packaged WSP file: <?xml version="1.0" encoding="utf-8" ?>
<Solution xmlns="http://schemas.microsoft.com/sharepoint/"
SolutionId="7DFC3075-45C0-4946-9E5F-CA6BBC749C64"
DeploymentServerType="WebFrontEnd"
ResetWebServer="FALSE">
<FeatureManifests>
<FeatureManifest Location="ACMESite\feature.xml"/>
</FeatureManifests>
</Solution>
Consider this approach when building Features... it saves you a lot of headaches when packaging up your Features.
Technorati tags: sharepoint, wss, Feature
posted on Thursday, September 27, 2007 3:19 PM
|
|
SharePoint 2010 Training
Looking for SharePoint 2010 training for developers, administrators, SharePoint Designer 2010 and end users? Look no further! My company, Critical Path Training offers the best SharePoint training around!
|
|
|