Federation Services Mapping gives you the ability to map your content types and metadata from one system to another. There are two places in Federation Services where you can set up mappings:
- Reusable Mappings
- Mappings Tab
Reusable Mappings
From the Integration menu on the left-hand side of the Admin Page select Job Mappings. The Job Mappings menu item lets you create reusable mappings that you can then add to a job. This is especially useful when you have a lot of jobs with the same mappings. This way, you can edit one Job Mapping, and it will then be updated for all jobs that use that mapping. You can also download the JSON representation of the mapping to use for mappings import on another system.
Mappings Tab
The Mappings tab in a job is great when you need a one-off mapping that other jobs won’t use or if your mapping only applies to one job.
Mapping Types
There are several things you can map as seen below:
- Field Mappings allow you to map metadata fields from the source to the target. The names and data types can change from the source to the target by setting the Target type.
- Aspect Mappings allow you to map aspects for output systems that support them. Some systems, like OpenText Content Management System call these Categories. Aspects represent a collection of metadata field. You can typically have more than one aspect on a document.
- Type Mappings allow you to map the source type to a target type. These do not have to be the same name.
- Calculated Fields allow you to set constant values by surrounding them in single quotes (‘) or using the Federation Services Expressions Language (see Federation Services Expression Language).
Info: Calculated fields are processed before tasks and field/aspect mappings. If you wish to further use the product of a calculated field for you will need to create a separate mapping using the calculated fields output as the source.
Discovery Within Mappings
Mappings make heavy use of discovery information. Discovery allows you to pick your types and fields from drop-down lists instead of typing them out. It also knows the data types of each field. This allows for a much faster and less error-prone method of mapping types, aspects, and fields.
Audit Mappings
Audit mappings allow you to add field names and values to the Federation Services audit. These can later be used to create reports for analytics and/or validation. By default, Federation Services selects normal file system attributes to audit. These include file id, file name, created/modified dates, and author. A red eye is not being audited. Green is being audited. Simply clicking on the eye will change it to being audited or not.
Calculated Fields
Calculated fields allow you to hard code values or use functions. If you find the function calls getting too complex, we strongly suggest using a Job Task instead (see Event Job Configurations). Calculated fields are designed to be simple. Complex examples that have multiple levels of function calls are prone to error and tasks are designed for complex logic, unlike calculated fields.
Importing and Exporting Mappings
To export a mapping, go to the Job Mapping page, and select the export icon with the down arrow on it. Click Export Mappings to save the mappings as a json file. To import mappings go to the Mappings tab in the integration job and click on the green Import button.
You can import multiple mappings into the same job. Just click on the Import button and cut and paste the JSON from the export into the text area provided.
Example of a JSON format for import mapping under the mappings tab in the job config.
{"mappings":[ {"sourceType":"TEXT","watch":false,"mappingType":"TYPE_MAPPING","targetType":"TEXT","source":"Email","position":0,"target":"duotAF9"} , {"sourceType":"TEXT","watch":false,"mappingType":"ASPECT_MAPPING","targetType":"TEXT","source":"Email","position":1,"target":"cAF739"} , {"sourceType":"TEXT","watch":false,"mappingType":"FIELD_MAPPING","targetType":"TEXT","source":"Email.Subject","position":2,"target":"tAF723"} , {"sourceType":"TEXT","watch":false,"mappingType":"FIELD_MAPPING","targetType":"TEXT","source":"Email.To","position":3,"target":"tAF722"} , {"sourceType":"TEXT","watch":false,"mappingType":"FIELD_MAPPING","targetType":"CHECKBOX","source":"hasPii","position":15,"target":"tAF701"} ]}