1

我已成功在Visual Studio中創建和部署了一些新的內容類型。一個基於文檔集,其他基於文檔。我想要做的是指定文檔集的「默認內容類型」,「共享列」。我還希望將我的添加文檔類型指定爲文檔集的「允許的內容類型」列表。我知道如何做到這一點的SharePoint用戶界面。我怎樣才能通過我的Visual Studio項目來完成這個任務?開發包含其他文檔內容類型的自定義DocumentSet內容類型

回答

1

我找到了解決方案,同時也感謝谷歌把我和更聰明的人聯繫起來。在文檔集的內容類型中,您需要指定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> 
相關問題