このmodule.xmlファイルは、「Images」という名前のフォルダーにあります。すべての写真もこのフォルダーにあります(Visual Studio 2008 v1.3のSharePoint開発ツールを使用)。wspパッケージは、追加するすべてのファイルを認識する必要があるため、各ファイルを追加する必要があります。(.wspの名前を.cabに変更して開きます。これで、ソリューション内のすべてのファイルを確認できます)
<Elements Id="8f8113ef-75fa-41ef-a0a2-125d74fc29b7" xmlns="http://schemas.microsoft.com/sharepoint/">
<Module Name="Images" Url="Style Library/Images/myfolder" RootWebOnly="TRUE">
<File Path="hvi_logo.bmp" Url="hvi_logo.bmp" Type="GhostableInLibrary" />
<File Path="hvi_logo_small.bmp" Url="hvi_logo_small.bmp" Type="GhostableInLibrary" />
<File Path="epj-logo.png" Url="epj-logo.png" Type="GhostableInLibrary" />
</Module>
</Elements>
小さなC#アプリを作成して、次のようなxmlファイルを作成できます。
var info = new DirectoryInfo(@"c:\pathToImageFolder");
var files = info.GetFiles();
TextWriter writer = new StreamWriter(@"c:\pathToImageFolder\module.xml");
writer.WriteLine("<Elements Id=...");
foreach (FileInfo file in files)
{
writer.WriteLine(string.Format("<File Path='{0}' Url='{0}' Type='GhostableInLibrary' />",file.Name));
}
writer.WriteLine("</Elements>");
writer.Flush();
writer.Close();