zoukankan      html  css  js  c++  java
  • SharePoint Content Type ID's

    SharePoint - Content Type ID's

    Content types are little gems within SharePoint with many useful characteristics.  The one characteristic is that content types support inheritance.  For the non programmers; inheritance is when you define a content type it must be based on an existing content type.  The new type called the child type will get all the features, i.e. fields, settings of the parent type.  The child type can then have additional types.

    To illustrate this, let us say we have a business that has customers and suppliers and we need to store customers and suppliers.  We could easily create a content type for a Customer that inherits from Contact, however a customer has an additional Account number field and Account Manager field.  The Supplier is also a contact and thus inherits from contact, however it has a Customer Number field.

    At this point it is important to note that content types inherit from other content types and build a tree as shown in the diagram below:

    image

    You can create your own content types that inherit from other content types in CAML by understanding the ID field. Each content type must have a unique id, however unlike many other ID's that are Globally unique identifiers, a content type ID is a mixture of the parent ID, shown in the table below an a unique GUID.  Also the GUID is contains no braces or dashes like other GUIDS.

    Content Type

    ID Start

    System

    0x

    Item

    0x01

    Library Content Types

    Document

    0x0101

    Form

    0x010101

    Picture

    0x010102

    WikiDocument

    0x010108

    BasicPage

    0x010109

    WebPartPage

    0x01010901

    List Content Type

    Event

    0x0102

    Issue

    0x0103

    Announcemnt

    0x0104

    Link

    0x0105

    Contact

    0x0106

    Message

    0x0107

    Task

    0x0108

    BlogPost

    0x0110

    BlogComment

    0x0111

    Folder Content Types

    Folder

    0x0120

    RootOfList

    0x012001

    Discussion

    0x012002

    Where to set the ID

    When you define your content type in the Elements manifest file, there is a mandatory ID field which needs to be the content type.  A snipit of a content type is shown below:

    <?xml version="1.0" encoding="utf-8"?>
    <
    Elements xmlns="http://schemas.microsoft.com/sharepoint/">
      <
    ContentType
       ID="0x0106000BB3F82D2A624B77833C28045F765D7A"
        >

      </
    ContentType>
    </
    Elements>

    The syntax is :

    Parent ID + 00 + GUID

    Examples

    1. To create a content type with GUID {0BB3F82D-2A62-4b77-833C-28045F765D7A} that is based on contact (0x0106), you would se the ID to
      0x0106000BB3F82D2A624B77833C28045F765D7A
    2. To create a content type with GUID {0E3E8F35-3A21-4ed7-8151-816C48E2D64F} that is a based on document (0x0101), you would set the ID to
      0x0101000E3E8F353A214ED78151816C48E2D64F
    3. To create your own item with GUID {A6C62A39-E374-4d8d-9EFE-90DD65B659F9} that is based on item (0x01), you would set the ID to
      0x0100A6C62A39E3744D8D9EFE90DD65B659F9

    转载自:http://www.cnblogs.com/timoli/archive/2010/01/11/1644048.html
  • 相关阅读:
    微信小程序开发前期准备
    怎样在vs2013和vs2015中实现自动编译sass
    在MVC中使用Bundle打包压缩js和css
    Html5 突破微信限制实现大文件分割上传
    Automapper 实现自动映射
    Polly一种.NET弹性和瞬态故障处理库(重试策略、断路器、超时、隔板隔离、缓存、回退、策略包装)
    关于transactionscope 事务的脏数据
    IIS设置session时长
    已禁用对分布式事务管理器(MSDTC)的网络访问的解决方法之一
    DAL.SQLHelper 的类型初始值设定项引发异常的处理
  • 原文地址:https://www.cnblogs.com/qixing_gan/p/2815724.html
Copyright © 2011-2022 走看看