tags:

views:

723

answers:

2

I have deployed a custom Web Part as a Feature. I used STSDEV to create the Feature and supporting config files. I ran into some problems trying to add a simple XML file to contain values that I need to read. Where do I place the XML file within the Feature project and what do I need to do to access that file? After several attempts at this, my Web Part still renders but no longer appears in the list of Features to be activated via the browser interface... has anyone got any info on this? :-)

A: 

Feature.xml:

<?xml version="1.0" encoding="utf-8" ?> - <!-- Created by STSDEV at 12/3/2008 8:14:49 AM --> - <Feature RequireResources="TRUE" Id="7B604CA6-02B4-4F69-8ECA-81C36360DF02" Title="Security-Trimmed Links: Securelinks.WebParts" Description="This Web Part contains role-sensitive application links." Version="1.0.0.0" Scope="Site" Hidden="false" ImageUrl="Securelinks.WebParts\AfricanPith32.gif" xmlns="http://schemas.microsoft.com/sharepoint/"&gt; - <ElementManifests> <ElementManifest Location="WebParts.xml" /> <ElementFile Location="WebParts\SecureLinksWP.webpart" /> <ElementFile Location="WebParts\links.xml" /> </ElementManifests> </Feature>

WebParts.xml:

<?xml version="1.0" encoding="utf-8" ?> - <!-- Created by STSDEV at 12/3/2008 8:14:49 AM --> - <Elements xmlns="http://schemas.microsoft.com/sharepoint/"&gt; - <Module Name="Securelinks.WebParts" List="113" Url="_catalogs/wp" Path="WebParts" RootWebOnly="True"> - <File Url="SecurelinksWP.webpart" Type="GhostableInLibrary"> <Property Name="Group" Value="Securelinks.WebParts" /> </File> </Module> </Elements>

XML FIle I need to Read:

<links> <link text="Link to Secure Web App" url="/myapps/myapphomepage.aspx" AuthType="*" AuthArgs=""/> <link/> </links>

Unfortunately, I don't have the manifest of ddf files to hand, but any advice would be appreciated. I'm particularly worried by the Feature not appearing in the Feature list in site settings...

IrishChieftain
+1  A: 

If you need that simple xml as configuraion for your webpart, then you can provide it as one of parameters in your *.webpart file. You will have to encode that file, this approach worked in our project at least.

drax
Thanks drax, I'll give that a try :-)
IrishChieftain