How to deploy Document Set using CAML in SharePoint2010 solution package
Posted
by ybbest
on YBBest
See other posts from YBBest
or by ybbest
Published on Wed, 04 Jul 2012 09:31:26 +0000
Indexed on
2012/08/30
9:51 UTC
Read the original article
Hit count: 690
SharePoint 2010
|Document Set
|ECM
|Enterprise Content Manage
|enterprise-it
|sharepoint2010
In my last post, I showed you how to use Document Set using SharePoint UI in the browser. In this post, I’d like to show you how to create the same Document Set using CAML and SharePoint solution package. You can download the complete solution here.
1. Create the Application Number site column using the SharePoint empty element item template in VS2010
<?xml version="1.0" encoding="utf-8"?> <Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <Field Type="Text" DisplayName="ApplicationNumber" Required="FALSE" EnforceUniqueValues="FALSE" Indexed="FALSE" MaxLength="255" Group="YBBEST" ID="{916bf3af-5ec1-4441-acd8-88ff62ab1b7e}" Name="ApplicationNumber" ></Field> </Elements>
2. Create the Loan Application Form and Loan Contract Form content types.
<?xml version="1.0" encoding="utf-8"?> <Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <!-- Parent ContentType: Document (0x0101) --> <ContentType ID="0x0101005dfbf820ce3c49f69c73a00e0e0e53f6" Name="Loan Contract Form" Group="YBBEST" Description="Loan Contract Form" Inherits="TRUE" Version="0"> <FieldRefs> <FieldRef ID="916bf3af-5ec1-4441-acd8-88ff62ab1b7e" Name="ApplicationNumber" DisplayName="ApplicationNumber" /> </FieldRefs> </ContentType> <!-- Parent ContentType: Document (0x0101) --> <ContentType ID="0x010100f3016e3d03454b93bc4d6ab63941c0d2" Name="Loan Application Form" Group="YBBEST" Description="Loan Application Form" Inherits="TRUE" Version="0"> <FieldRefs> <FieldRef ID="916bf3af-5ec1-4441-acd8-88ff62ab1b7e" Name="ApplicationNumber" DisplayName="ApplicationNumber" /> </FieldRefs> </ContentType> </Elements>
3. Create the Loan Application Document Set.
4. Create the Document Set Welcome Page using the SharePoint Module item template.
Notes:
1.When creating document set content type , you need to set the Inherits=”FALSE” or remove the Inherits=”TRUE” from the content type definition (default is Inherits=”FALSE”) . This is the Document Set limitation in the current version of SharePoint2010. Because of this , you also need to manually attach the event receiver and Document Set welcome page to your custom Document Set Content Type.
2. Shared Fields are push down only:
3. Not available in SharePoint foundation (only SharePoint Server 2010).
4. You can’t have folders within document sets (you can place document sets in folders though). For a complete limitation and considerations , you can see the references for details.
References:
Document Set Limitations and Considerations in SharePoint 2010 1
Document Set Limitations and Considerations in SharePoint 2010 2
Document Sets planning (SharePoint Server 2010)
http://msdn.microsoft.com/en-us/library/gg581064.aspx
http://channel9.msdn.com/Events/TechEd/NorthAmerica/2010/OSP305
© YBBest or respective owner