Creating and Using an EPiServer CMS Mapping File
<?xml version="1.0" encoding="utf-8" ?>
<EpiServerMapping>
<Mapping type="Default">
<Fields>
<Title>%[coveo_Title]</Title>
<ModifiedDateUtc>%[coveo_DateModified]</ModifiedDateUtc>
<CustomFields>
<CustomField name="sysauthor">%[coveo_CreatedBy]</CustomField>
</CustomFields>
</Fields>
</Mapping>
<Mapping type="Page">
<Fields>
<ClickableUri>%[coveo_ServerUrl]%[coveo_StaticLinkUrl]</ClickableUri>
<PrintableUri>%[coveo_ServerUrl]%[coveo_StaticLinkUrl]</PrintableUri>
<Body>
<html><body>
%[MainBody]
%[SecondaryBody]
%[ThirdBody]
</body></html>
</Body>
<CustomFields>
<CustomField name="pagetype">%[coveo_TypeName]</CustomField>
</CustomFields>
</Fields>
</Mapping>
<Mapping type="Document">
<Fields>
<ClickableUri>%[coveo_ServerUrl]%[coveo_VirtualPath]</ClickableUri>
<PrintableUri>%[coveo_ServerUrl]%[coveo_VirtualPath]</PrintableUri>
</Fields>
</Mapping>
</EpiServerMapping>
You can optionally create and use a custom mapping file to tailor the mapping to your needs.
To create and use a custom EPiServer CMS mapping file
-
Using an administrator account, connect to the Coveo Master server.
-
Using a text editor:
-
Create an XML file respecting the format illustrated in the following commented example.
<?xml version="1.0" encoding="utf-8" ?> <EpiServerMapping> <!-- These fields will be applied to all the documents that have the mappings defined later. --> <CommonMapping> <Fields> <Title>%[coveo_Title]</Title> <ModifiedDateUtc>%[coveo_DateModified]</ModifiedDateUtc> <CustomFields> <CustomField name="sysauthor">%[coveo_CreatedBy]</CustomField> </CustomFields> </Fields> </CommonMapping> <Mapping type="Default"> <Fields> <Title>%[coveo_Title]</Title> <ModifiedDateUtc>%[coveo_DateModified]</ModifiedDateUtc> <CustomFields> <CustomField name="sysauthor">%[coveo_CreatedBy]</CustomField> </CustomFields> </Fields> </Mapping> <!-- It is valid to put the pagetype of an item to set metadata on. --> <Mapping type="[AlloyTech] News item"> <Fields> <Title>Grosse Ventouse</Title> <ClickableUri>%[coveo_ServerUrl]%[coveo_StaticLinkUrl]</ClickableUri> <PrintableUri>%[coveo_ServerUrl]%[coveo_StaticLinkUrl]</PrintableUri> <Body> <html><body> %[MainBody] %[SecondaryBody] %[ThirdBody] </body></html> </Body> <CustomFields> <CustomField name="sysauthor">JoeBeton</CustomField> <CustomField name="pagetype">%[coveo_TypeName]</CustomField> </CustomFields> </Fields> </Mapping> <!-- This is the type of mapping defined by the connector. "Page" comprises all pages of EPiServer that were not matched by their paged type, above. --> <Mapping type="Page"> <Fields> <ClickableUri>%[coveo_ServerUrl]%[coveo_StaticLinkUrl]</ClickableUri> <PrintableUri>%[coveo_ServerUrl]%[coveo_StaticLinkUrl]</PrintableUri> <Body> <html><body> %[MainBody] %[SecondaryBody] %[ThirdBody] </body></html> </Body> <CustomFields> <CustomField name="pagetype">%[coveo_TypeName]</CustomField> </CustomFields> </Fields> </Mapping> <!-- This is all the binary documents that will be retrieved from EPiServer, either from a page or the file manager. --> <Mapping type="Document"> <Fields> <ClickableUri>%[coveo_ServerUrl]%[coveo_VirtualPath]</ClickableUri> <PrintableUri>%[coveo_ServerUrl]%[coveo_VirtualPath]</PrintableUri> </Fields> </Mapping> </EpiServerMapping>
-
Save the file using a name of your choice in the [Index_Path]\Config folder.
Example: C:\CES7\Config\MyEPiServerCMSMapping.xml
-
-
To instruct the connector to use this configuration file, add the MappingFile hidden parameter to the EPiServer CMS source and use the filename and path where you saved the file as the value for the parameter (see Modifying Hidden EPiServer CMS Source Parameters).