Export (0) Print
Expand All

Document Properties and Content Types in SharePoint Server 2010 (ECM)

Last modified: October 05, 2009

Applies to: SharePoint Server 2010

If the content type assigned to a Microsoft Office 2010 document includes columns, the values for those columns are included in the document itself as document properties. In addition, if the document uses a custom document information panel, then information about that document information panel is included in the content type.

For Office documents in the Open XML Formats, the content type ID of the content type assigned to the document is stored in the document itself, as a custom document property in the Custom File Properties part of the file.

The content type schema is stored in the document in the customXml section, in the contentTypeSchema data store item.

Note Note

Each data store item in the customXml section is contained in a part named itemN.xml, with N being an arbitrary number. Because of this, when you work with the data store items, you should identify them by the root element or namespace instead of by part name.

Columns included in the content type are represented as properties in the content type schema stored in the document. They are identified in the documentManagement node of the properties element in the schema. These document properties map to document library columns, represented by Field elements in the content type definition stored in the document library.

For example, the following content type schema includes two document properties, Property A and Property B, listed in the documentManagement node of the properties element, and defined in the schema.

The schema has been edited for clarity.

<?xml version="1.0" encoding="utf-8"?>
<ct:contentTypeSchema ct:_="" ma:_=""   
    ma:contentTypeName="Document" 
    ma:contentTypeID="0x01010042D2ECEB487FD14A878A8B12B45AD0DF" 
    …
    xmlns:ct="http://schemas.microsoft.com/office/2006/metadata/contentType" 
    xmlns:ma="http://schemas.microsoft.com/office/2006/metadata/properties/metaAttributes">
  <xsd:schema targetNamespace="http://schemas.microsoft.com/office/2006/metadata/properties" 
      ma:root="true" 
      ma:fieldsID="5a5031a312590b36f5a800897888c4e2" 
      ns2:_="" 
      xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
      xmlns:p="http://schemas.microsoft.com/office/2006/metadata/properties" 
      xmlns:ns2="0523cb95-65e0-434b-b038-3cfd592e886c">
    <xsd:import namespace="0523cb95-65e0-434b-b038-3cfd592e886c"/>
    <xsd:element name="properties">
      <xsd:complexType>
        <xsd:sequence>
          <xsd:element name="documentManagement">
            <xsd:complexType>
              <xsd:all>
                <xsd:element ref="ns2:PropertyA" minOccurs="0"/>
                <xsd:element ref="ns2:PropertyB" minOccurs="0"/>
              </xsd:all>
            </xsd:complexType>
          </xsd:element>
        </xsd:sequence>
      </xsd:complexType>
    </xsd:element>
  </xsd:schema>
  <xsd:schema 
      targetNamespace="0523cb95-65e0-434b-b038-3cfd592e886c" 
      elementFormDefault="qualified" 
      xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
      xmlns:dms="http://schemas.microsoft.com/office/2006/documentManagement/types">
    <xsd:import namespace="http://schemas.microsoft.com/office/2006/documentManagement/types"/>
    <xsd:element name="PropertyA" 
        ma:index="8" 
        nillable="true" 
        ma:displayName="Property A" 
        ma:internalName="PropertyA">
      <xsd:simpleType>
        <xsd:restriction base="dms:Text">
          <xsd:maxLength value="255"/>
        </xsd:restriction>
      </xsd:simpleType>
    </xsd:element>
    <xsd:element name="PropertyB" 
        ma:index="9" 
        nillable="true" 
        ma:displayName="Property B" 
        ma:internalName="PropertyB">
      <xsd:simpleType>
        <xsd:restriction base="dms:Text">
          <xsd:maxLength value="255"/>
        </xsd:restriction>
      </xsd:simpleType>
    </xsd:element>
  </xsd:schema>
  …
</ct:contentTypeSchema>

The actual values for each document property are contained in the properties data store item in the customXml section. For more information, see Document Information Panel and Document Properties in SharePoint Server 2010 (ECM).

Custom document information panels that are associated with SharePoint Foundation store certain attributes of that document information in the content type definition; those attributes are demoted into the document itself. These attributes include the location of the Microsoft InfoPath 2010 form to use as the custom panel, whether the Office 2010 application should always display the panel when the document opens, and whether the application should use the default, autogenerated panel even if a custom panel is specified.

These attributes are stored in the content type definition on the document library in an XMLDocument element. For more information on the schema of this XMLDocument element, see Content Type Document Information Panel Schema in SharePoint Server 2010 (ECM).

For an Office document in the Open XML Formats, the contents of this XMLDocument element are demoted into the document as a data store item in the customXml section. The data store item has the root element of customXsn.

The following figure shows the relationships between the information demoted into the document, and the content type definition that resides on the document library

File properties and matching list properties.
  • The content type ID is demoted into the document as a custom property in the Custom File Properties part of the file.

  • Each document property defined in the contentTypeSchema data store item of the customXml section in the document maps to a column definition, represented by a Field element, in the content type definition on the document library.

  • For each document property defined in the contentTypeSchema data store item, there is an element in the properties data store item that contains the actual document property value.

  • The document information panel attributes contained in an XMLDocument in the content type definition on the document library are demoted into the document as the customXsn data store item.

Community Additions

ADD
Show:
© 2014 Microsoft