Blog Home  Home Feed your aggregator (RSS 2.0)  
.Net Jonesie - VSeWSS 1.1 Modules
A simple programmers blog
 
# Tuesday, February 26, 2008
I'm in lovely sunny Wellington this week working on some WSS samples using the Visual Studio Extensions for Windows SharePoint Services 1.1 (or more easily pronounced VissyWiss).  One of the samples requires the use of a Module Project Item.  There is surprisingly little documentation - official or otherwise - on what a module does and how to use it - at least, not that we can find.  So, here's my contribution - hopefully correct.

A Module Project Item is used to deploy files to any(?) part of your WSS installation.  You specify the source of the item to copy as a file path relative to the module, and the destination as a url path relative to the site root.  This all sounds very simple, but the problem is that there are 2 urls and 2 paths so there are several permitations possible and not all of them work!

When you add a Module Project Item to your project (Site def, Empty def etc) you will get an XML file called Module.xml in a folder.  Our one looks like this:

<?xml version="1.0" encoding="utf-8"?>
<Elements Id="b43cb805-eebf-421a-83d3-c2a6cb8afa10" xmlns="http://schemas.microsoft.com/sharepoint/">
  <Module Name="module_training" Url="images">
    <File Url="WORD_icon.jpg" Path="module_training\WORD_icon.jpg"
Type="Ghostable" />
  </Module>
</Elements>



Module Url: This is where the files will be copied to.  The url is relative to the site root.
File Path: Path to the file relative to the project in Visual Studio.
File Type: This can only be Ghostable or GhostableInLibrary.  You can only use GhostableInLibrary if the module Url is for a List, such as Shared Documents.

<Module> also has a Path attribute but we dont need it for this operation.

The module will create folders if they dont exist so in the above example we are copying an image to the root images folder, but this could easily be "customimages" and the folder will be created.

There's more to Modules but that is all I have for now.  I'll update when I know how to do Wildcards :)

Tuesday, February 26, 2008 8:11:15 AM (New Zealand Daylight Time, UTC+13:00)  #    Comments [3]   Sharepoint  | 
Wednesday, March 19, 2008 2:06:03 AM (New Zealand Standard Time, UTC+12:00)
Boy its incredible how LITTLE information is out there on Modules in WSS. I really need to get this working and even the above example isnt working for me. I created a modules in my project (VSEWSS1.1) called UserControls. I added the following in my module:<br>
<Module Name="Forms" Url="Forms">
<File Path="EditUserStocks.aspx" Url="EditUserStocks.aspx" Type="Ghostable" />
<File Path="NewsStory.aspx" Url="NewsStory.aspx" Type="Ghostable" />
<File Path="TextFile1.txt" Url="TextFile1.txt" Type="Ghostable" />
</Module>

and it just doesnt copy anything... I dont get it.
Troy Grosh
Wednesday, March 19, 2008 2:11:40 AM (New Zealand Standard Time, UTC+12:00)
Correction, I meant to say I create a module called Forms
Troy Grosh
Wednesday, June 11, 2008 4:15:43 AM (New Zealand Standard Time, UTC+12:00)
Im tryng to copy template_layout4.css to layouts/1033/styles folder but same thing - nothing gets copied and no error
there is nothing on localhost/_layouts/1033/styles/template_layout4.css
<Module Name="mdl_Css" >
<File Path="mdl_Css\template_layout4.css" Url="_layouts/1033/styles/template_layout4.css" />
</Module>

this is working fine:

<Module Name="mdl_Css" Url="my" >
<File Path="mdl_Css\template_layout4.css" Url="template_layout4.css" />
</Module>

when I browse to localhost/mysite/my/template_layout4.css i get the file
boro
Comments are closed.
Copyright © 2012 Peter G Jones. All rights reserved.
DasBlog 'Portal' theme by Johnny Hughes.
Pick a theme: