Mapping Document Properties to Columns
This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
After the document parser writes the document properties to the property bag object, Windows SharePoint Services promotes the document properties that match columns on the document library. To do this, Windows SharePoint Services compares the document property name with the internal names of the columns in the document's content type, or on the document library itself if the document doesn't have a content type. When Windows SharePoint Services finds a column whose internal name matches the document property, it promotes the document property value into that column for the document.
However, Windows SharePoint Services also enables you to explicitly map a document property to a specific column. You specify this mapping information in the column's field definition schema.
Mapping document properties to columns in the column's field definition enables you to map document properties to columns that may or may not be named the same. For example, you can map the document property "Author" to the "Creator" column of a content type or document library.
To specify this mapping, add a ParserRef element to the field definition schema, as shown in the following example.
<Field Type="Text" Name="Creator" … > <ParserRefs> <ParserRef Name="Author" Assembly="myParser.Assembly"> </ParserRefs> … </Field>
The following elements are used to define a document property mapping:
ParserRefs Optional. Represents a list of document parser references for this column.
ParserRef Optional. Represents a single document parser reference. This element contains the following attributes:
Name Required String**. The name of the document property to** map to this column.
Assembly Required String**. The name of the document parser used.**
A column's field definition might contain multiple parser references, each specifying a different document parser.
In addition, if you are working with files in multiple languages, you can use parser references to manage the mapping of document properties to the appropriate columns in multiple languages, rather than have to build that functionality into the parser itself. The parser can generate a single document property, while you use multiple parser references to make sure the property is mapped to the correct column for that language. For example, suppose a parser extracts a document property named "Singer". You could then map that property to a column named "Cantador", as shown in the following example.
<Field Type="Text" Name="Cantador" … > <ParserRefs> <ParserRef Name="Singer" CLSID="MyParser"> <ParserRef Name="Artist" Assembly="MP3Parser.Assembly"> </ParserRefs> </Field>
To edit a column's field definition schema programmatically, use the SPField.SchemaXML object. There is no equivalent user interface for specifying a parser for a column.
Unique Name for Columns
Each column has a unique identifier that does not change, even if the column is provisioned on multiple sites. This unique name is guaranteed to be unique across a given Windows SharePoint Services installation, and is a combination of the following two field properties:
FixedName The internal name given to the column when it is created. The fixed name of a column does not change when the column is provisioned onto different lists. The fixed name of a list column created from a site column is the same as the fixed name of the site column.
SourceID An arbitrary namespace designation given to the column when it is created. For default site columns included with Windows SharePoint Services, the SourceID is set to "Microsoft." For site columns, the SourceID is the GUID of the site on which the column was created. The SourceID of a list column created from a site column is the same as the SourceID of the site column. For columns created directly on lists, the SourceID is the GUID of the list where the column was created.