【问题标题】:Developing Custom DocumentSet Content Type that includes other Document Content Types开发包含其他文档内容类型的自定义 DocumentSet 内容类型
【发布时间】:2012-06-08 01:09:00
【问题描述】:

我已经成功地在 Visual Studio 中创建并部署了几个新的内容类型。一种基于文档集,另一种基于文档。我要做的是指定文档集的“默认内容类型”、“共享列”。我还想将我的添加文档类型指定为文档集的“允许的内容类型”列表中。我知道如何在 SharePoint UI 中做到这一点。如何通过我的 Visual Studio 项目完成此任务?

【问题讨论】:

    标签: visual-studio-2010 sharepoint sharepoint-2010 sharepoint-api document-set


    【解决方案1】:

    我找到了解决方案,感谢 Google 将我与比我更聪明的人联系起来。在 Document Set 的 Content Type 中,需要指定 XMLDocuments 元素。

    <XmlDocuments>
      <!-- List of all fields [site columns] shared between all content types and the document set. -->
      <XmlDocument NamespaceURI="http://schemas.microsoft.com/office/documentsets/sharedfields">
        <sf:SharedFields xmlns:sf="http://schemas.microsoft.com/office/documentsets/sharedfields" LastModified="1/1/2010 08:00:00 AM">
          <!-- Add shared fields here using the syntax below-->
          <!--<SharedField id="00000000-0000-0000-0000-000000000000" />-->
        </sf:SharedFields>
      </XmlDocument>
      <!-- List of all content types that are allowed in the document set. -->
      <XmlDocument NamespaceURI="http://schemas.microsoft.com/office/documentsets/allowedcontenttypes">
        <act:AllowedContentTypes xmlns:act="http://schemas.microsoft.com/office/documentsets/allowedcontenttypes" LastModified="1/1/2010 08:00:00 AM">
          <!-- Add content types that will be used in the document set using the syntax below -->
          <!--<AllowedContentType id="00000000-0000-0000-0000-000000000000" />-->
        </act:AllowedContentTypes>
      </XmlDocument>
      <!-- List of all fields [site columns] that should appear on welcome page. -->
      <XmlDocument NamespaceURI="http://schemas.microsoft.com/office/documentsets/welcomepagefields">
        <wpFields:WelcomePageFields xmlns:wpFields="http://schemas.microsoft.com/office/documentsets/welcomepagefields" LastModified="1/1/2010 08:00:00 AM">
          <!-- Add welcome fields here using the syntax below -->
          <!--<WelcomePageField id="00000000-0000-0000-0000-000000000000" />-->
        </wpFields:WelcomePageFields>
      </XmlDocument>
      <!-- List of all default documents associated with the content types. -->
      <XmlDocument NamespaceURI="http://schemas.microsoft.com/office/documentsets/defaultdocuments">
        <dd:DefaultDocuments xmlns:dd="http://schemas.microsoft.com/office/documentsets/defaultdocuments" AddSetName="TRUE" LastModified="1/1/2010 08:00:00 AM">
          <DefaultDocument idContentType="0x010100c462526dfcb94db3ab99dc52649a7f66" name="Template.docx" />
        </dd:DefaultDocuments>
      </XmlDocument>
    
      <XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms">
        <FormTemplates  xmlns="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms">
          <Display>ListForm</Display>
          <Edit>ListForm</Edit>
          <New>NewForm</New>
        </FormTemplates>
      </XmlDocument>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-02-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-09-08
      • 1970-01-01
      • 1970-01-01
      • 2023-03-24
      相关资源
      最近更新 更多