Sharepoint 创建在MOSS中上载站点模板文件(.stp)的功能
从开始,我创建了一个功能,用于上传网站模板文件,作为SharePoint网站自动构建的一部分。但是,尽管该功能将.stp文件正确部署到配置单元中,并且解决方案显示在CAS |操作|解决方案管理页面中,但站点模板并未如预期那样显示在站点模板库中。我在下面给出了feature.xml和elements.xml文件的内容;谁能看出我哪里出了问题 feature.xmlSharepoint 创建在MOSS中上载站点模板文件(.stp)的功能,sharepoint,moss,sharepoint-2007,Sharepoint,Moss,Sharepoint 2007,从开始,我创建了一个功能,用于上传网站模板文件,作为SharePoint网站自动构建的一部分。但是,尽管该功能将.stp文件正确部署到配置单元中,并且解决方案显示在CAS |操作|解决方案管理页面中,但站点模板并未如预期那样显示在站点模板库中。我在下面给出了feature.xml和elements.xml文件的内容;谁能看出我哪里出了问题 feature.xml <?xml version="1.0" encoding="utf-8"?> <Feature Id="59627
<?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>
<?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>
elements.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>
<?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您尝试过将功能范围设置为站点吗?This 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的建议将功能设置为站点范围。Colin,谢谢,但我已经尝试将范围设置为站点,但没有成功。无论如何,谢谢你。亚历克斯,我接受了你的回答。在同事的帮助下,我成功地部署了.wsp,包括一个空类文件来更新.wsp中的.dll,即使.dll本身没有部署。没问题!功能接收器可能是另一种方法。STP文件是否与元素文件位于同一文件夹中?@Greg:Path和Url属性在我的经验中有点像黑色艺术。但是,再次阅读此XML后,我认为如果STP与
elements.XML
位于同一文件夹中,那么它应该可以工作。