在 MOSS 中创建上传站点模板文件 (.stp) 的功能

发布于 2024-08-06 19:06:28 字数 1467 浏览 0 评论 0原文

这个问题之后,我创建了一个功能来上传网站模板文件作为 SharePoint 网站自动构建的一部分。但是,虽然该功能将 .stp 文件正确部署到配置单元,并且解决方案出现在 CAS | 中。运营|解决方案管理页面中,站点模板未按预期出现在站点模板库中。我在下面给出了 feature.xml 和 elements.xml 文件的内容;谁能发现我哪里出错了?

feature.xml

<?xml version="1.0" encoding="utf-8"?>
<Feature  Id="59627434-4B75-4f9c-B830-E6E34007DA70"
          Title=" Team Site Template"
          Description="UKTI Connect Team Site Template"
          Version="12.0.0.0"
          Hidden="FALSE"
          Scope="Web"
          DefaultResourceFile="core"
          xmlns="http://schemas.microsoft.com/sharepoint/">
  <ElementManifests>
    <ElementManifest Location="elements.xml"/>
    <ElementFile Location="TeamSiteTemplate.stp" />
  </ElementManifests>
</Feature>

elements.xml

<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Module Name="TeamSiteTemplate" Url="_catalogs/wt" RootWebOnly="TRUE" >
      <File Url="TeamSiteTemplate.stp" Type="GhostableInLibrary" IgnoreIfAlreadyExists="FALSE">
        <Property Name="LanguageDisplay" Value="English" />
        <Property Name="Version" Value="3" />
      </File>
  </Module>
</Elements>

谢谢,MagicAndi

Following on from this question, I have created a feature to upload an site template file as part of an automated build of a SharePoint site. However, while the feature deploys the .stp file correctly to the hive, and the solution appears in the CAS | Operations | Solution Management page, the site template does not appear in the site template gallery as expected. I have given the contents of the feature.xml and elements.xml files below; can anyone spot where I am going wrong?

feature.xml

<?xml version="1.0" encoding="utf-8"?>
<Feature  Id="59627434-4B75-4f9c-B830-E6E34007DA70"
          Title=" Team Site Template"
          Description="UKTI Connect Team Site Template"
          Version="12.0.0.0"
          Hidden="FALSE"
          Scope="Web"
          DefaultResourceFile="core"
          xmlns="http://schemas.microsoft.com/sharepoint/">
  <ElementManifests>
    <ElementManifest Location="elements.xml"/>
    <ElementFile Location="TeamSiteTemplate.stp" />
  </ElementManifests>
</Feature>

elements.xml

<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Module Name="TeamSiteTemplate" Url="_catalogs/wt" RootWebOnly="TRUE" >
      <File Url="TeamSiteTemplate.stp" Type="GhostableInLibrary" IgnoreIfAlreadyExists="FALSE">
        <Property Name="LanguageDisplay" Value="English" />
        <Property Name="Version" Value="3" />
      </File>
  </Module>
</Elements>

Thanks, MagicAndi

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

嘿嘿嘿 2024-08-13 19:06:28

这个 elements.xml 有效:

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <Module Name="TeamSiteTemplate" List="111" Url="_catalogs/wt">
        <File Url="TeamSiteTemplate.stp" Type="GhostableInLibrary">
            <Property Name="LanguageDisplay" Value="English" />
            <Property Name="Version" Value="3" />
        </File>
    </Module>
</Elements>

存在细微差别,但可能解决问题的是包含 List 属性。

为了解释这一点,请在 %CommonProgramFiles%\Microsoft Shared\web server extensions\12\TEMPLATE\GLOBAL\XML\ONET.XML 中查看包含单词 sitetemplategalleryList 的行。这显示了与 elements.xml 中的 List="111" 相对应的 Type="111"

另请注意,我按照 Colin 的建议将该功能设置为站点范围。

This elements.xml works:

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <Module Name="TeamSiteTemplate" List="111" Url="_catalogs/wt">
        <File Url="TeamSiteTemplate.stp" Type="GhostableInLibrary">
            <Property Name="LanguageDisplay" Value="English" />
            <Property Name="Version" Value="3" />
        </File>
    </Module>
</Elements>

There are minor differences but the one that probably solves the problem is the inclusion of the List attribute.

To explain, in %CommonProgramFiles%\Microsoft Shared\web server extensions\12\TEMPLATE\GLOBAL\XML\ONET.XML see the line containing the words sitetemplategalleryList. This shows Type="111" which corresponds to List="111" in elements.xml.

Also note that I set the feature to Site scope as Colin suggested.

淡水深流 2024-08-13 19:06:28

您是否尝试过将功能范围设置为“站点”?

Have you tried setting the scope of the feature to Site?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文