[转]ContentTypeBinding via CAML
原文链接:http://www.cnblogs.com/zhalin/archive/2008/03/04/1089424.html
ContentTypeBinding是用来指定某个Document Library(或LIST)里面可以使用什么样的Content Type。 一个Document Library实际上也就是一个SharePoint List。
从下图Document Library Settings看到,这个“Pages” documentLibrary设置了多个Content Type可以使用,这个实际上就是用ContentTypeBinding的结果:
<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<!--Generic Content Content Type, inherits from System Page Content Type-->
<ContentTypeBinding
ContentTypeId="0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF39006EA5CDDCB9B546F4AFCF16381E5D5B33" ListUrl="$Resources:cmscore,List_Pages_UrlName;" />
</Elements>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<!--Generic Content Content Type, inherits from System Page Content Type-->
<ContentTypeBinding
ContentTypeId="0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF39006EA5CDDCB9B546F4AFCF16381E5D5B33" ListUrl="$Resources:cmscore,List_Pages_UrlName;" />
</Elements>
上面就是把一个content type跟Pages LIST 绑定在一起了。绑定过的content type就会出现在上图中的列表里面。
本贴子以“现状”提供且没有任何担保,同时也没有授予任何权利
This posting is provided "AS IS" with no warranties, and confers no rights.
This posting is provided "AS IS" with no warranties, and confers no rights.