Document Property Promotion and Demotion Overview and Considerations
Document Property Promotion and Demotion Overview and Considerations
Overview
Document Property Promotion and Demotion is a Feature in versions of SharePoint designed to synchronize specific metadata across documents and its parent List columns and/or fields.
Property promotion refers to the process of extracting values from properties of a document and writing those values to corresponding columns on the list or document library where the document is stored.
Property demotion is the same process in reverse. Values are read from list columns and written to document properties.
Document Parser
SharePoint works together with a document parser to provide automation of the process of promoting and demoting properties so if the value of a one or more document properties changes, those changes are automatically synchronized to the parent List object or conversely when the values of the parent List columns or fields in a list item change, those changes are synchronized to the subordinate document associated with the item.
Document Parsers represent a significant advantage to managing metadata associated with one or more documents stored in a SharePoint List or Library, by providing a programmatic approach to managing the metadata associated with a document removing the need to manually synchronize important document characteristics across a document and its parent container. By default SharePoint Server 2013 provides document parsers (pluggable) for the following types:
docx SharePoint.SPDocumentParser.OfficeParser
docm SharePoint.SPDocumentParser.OfficeParser
dotx SharePoint.SPDocumentParser.OfficeParser
dotm SharePoint.SPDocumentParser.OfficeParser
pptx SharePoint.SPDocumentParser.OfficeParser
pptm SharePoint.SPDocumentParser.OfficeParser
potm SharePoint.SPDocumentParser.OfficeParser
potx SharePoint.SPDocumentParser.OfficeParser
ppsx SharePoint.SPDocumentParser.OfficeParser
ppsm SharePoint.SPDocumentParser.OfficeParser
xlsx SharePoint.SPDocumentParser.OfficeParser
xlsb SharePoint.SPDocumentParser.OfficeParser
xlsm SharePoint.SPDocumentParser.OfficeParser
xltx SharePoint.SPDocumentParser.OfficeParser
xltm SharePoint.SPDocumentParser.OfficeParser
gif SharePoint.SPDocumentParser.ImageParser
jpeg SharePoint.SPDocumentParser.ImageParser
jpg SharePoint.SPDocumentParser.ImageParser
jpe SharePoint.SPDocumentParser.ImageParser
jfif SharePoint.SPDocumentParser.ImageParser
bmp SharePoint.SPDocumentParser.ImageParser
dib SharePoint.SPDocumentParser.ImageParser
png SharePoint.SPDocumentParser.ImageParser
tif SharePoint.SPDocumentParser.ImageParser
tiff SharePoint.SPDocumentParser.ImageParser
ico SharePoint.SPDocumentParser.ImageParser
wdp SharePoint.SPDocumentParser.ImageParser
hdp SharePoint.SPDocumentParser.ImageParser
In addition to the parsers provided out of the box, SharePoint Server 2013 also provides an extensible document parsing infrastructure that allows developers to install custom parsers for types not included out of the box to enable the process of property promotion and demotion for those types.
Architecture
Flow
Document Promotion and Demotion is applied when the following conditions are met:
- A document is uploaded to a SharePoint Document Library
- List item fields associated with a document are modified
- SPFile object properties are programmatically modified
- A document is downloaded after the list item schema is modified (first run experience only)
In each scenario SharePoint will attempt to determine whether or not a parser is associated with the document type and in the event a parser is associated with the document type, SharePoint invokes the parser and sends the parser the document and property bag object. If a promotion scenario, the document parser will fill the property bag with the values that need to be synchronized with the parent list or in a demotion scenario, extracts values from the property bag that need to be written to the document.
Content Types
Referencing the illustration above, when using the document parser interface, document parsers can access the Content Type assigned to a document and subsequently store the content type in the document in addition to updating the Content Type definition stored in the document to match the version of the definition used by a List or Document Library.
Validating Input / Output
For content supportive of Document Parsing an XML namespace designation is added to the document metadata, in some cases, the document itself.
Example 1
Create a new HTML type document “PropValidation.html”.
Copy into the document the following HTML:
Hello World