sharepoint 2007中feature.xml中的多个Elements.xml

时间:2012-04-14 11:16:51

标签: xml sharepoint-2007

我刚与我的团队成员讨论过使用一个共享点功能做多件事。 讨论以挑战结束,我需要你的帮助。

我有一个问题:

  1. 我们可以在功能中执行多项操作,例如我想创建一个列表,同时还想为创建的相同列表添加新的ECB菜单项链接。
  2. 所以在feature.xml中有一个功能有多个elements.xml,现在我的头脑很紧。实际上我按照这些链接,它让我困惑, http://social.msdn.microsoft.com/forums/en-US/sharepointdevelopment/thread/40076dc2-8be6-4019-bf1e-54067880e8a8/

    不确定sharepoint 2007是否允许这些???

    谢谢, 穆克什

1 个答案:

答案 0 :(得分:0)

是的,一个功能可以有多个元素清单。

来自ElementManifest Element (Feature)

  

<强>出现次数

     

最低:0

     

最大值:无界

此外,Feature.xml Files中的示例显示了单个要素中的多个元素清单:

<Feature 
  Id="11111111-1111-1111-1111-11111111111" 
  Title="Location Services"
  Description="This Feature contains lists and parts that let you link location data to your customer lists."
  Scope="Web">
  <ActivationDependencies>
    <ActivationDependency
      FeatureId="11111111-1111-1111-1111-111111111111" />
  </ActivationDependencies>
  <ElementManifests>
    <ElementManifest 
      Location="Location\LocationPart.xml"/>
    <ElementManifest 
      Location="CustomerLocation\CustomerLocationList.xml"/>
    <ElementFile 
      Location="test.aspx"/>
  </ElementManifests>
  <Properties>
    <Property
      Key="Color"
      Value="Blue"/>
    <Property
      Key="Shape"
      Value="Triangle"/>
  </Properties> 
</Feature>

需要注意的一点是,您明确询问了单个功能是否可以包含多个名为Elements.xml的文件。如果每个Elements.xml文件都在一个唯一的目录中,答案也是肯定的。由于这些功能依赖于文件系统,因此显然不能在同一目录中将两个名为Elements.xml的文件放在一起。

相关问题