oslc-mappings.xml
The oslc-mappings.xml configuration file controls how HCL Compass prefills new OSLC 2.0-linked records.
Description
- The
oslcRecordConfig
section maps HCL Compass record fields to OSLC properties. - The
oslcProjectPrefillConfig
section controls the OSLC properties that are used during the creation of new records.
The oslcRecordConfig section
The oslcRecordConfig
section maps specific HCL Compass record fields to specific OSLC properties.
Include one oslcRecordConfig
section for each HCL Compass record type that you use to prefill new
records.
For example, to prefill from both a Defect record type and a Customer record type in a SAMPL
database, the oslc-mappings.xml file must have two
oslcRecordConfig
sections:
<oslcRecordConfig type="cq.record:Defect@8.0.0/SAMPL">
<oslcFieldMapping name="dcterms:title" field="Headline"/>
<oslcFieldMapping name="dcterms:description" field="Description"/>
</oslcRecordConfig>
<oslcRecordConfig type="cq.record:Customer@8.0.0/SAMPL">
<oslcFieldMapping name="dcterms:title" field="Name"/>
<oslcFieldMapping name="dcterms:description" field="Description"/>
</oslcRecordConfig>
Each oslcRecordConfig
section can have one or more
oslcFieldMapping
attributes. Each oslcFieldMapping
attribute maps
a single ClearQuest® field to a corresponding OSLC
property. The mappings can be used for generic ClearQuest field to OSLC property mapping. There is no limit to the number of OSLC properties
that you can map. However, the only OSLC properties that currently are used to prefill a HCL Compass record creation dialog box are the
dcterms:title
and the dcterms:description
properties. In the
following example, the dcterms:title
OSLC property is mapped to the HCL Compass
Headline field , and the dcterms:description
OSLC property
is mapped to the ClearQuest
Description field .
<oslcRecordConfig type="cq.record:Defect@8.0.0/SAMPL">
<oslcFieldMapping name="dcterms:title" field="Headline"/>
<oslcFieldMapping name="dcterms:description" field="Description"/>
</oslcRecordConfig>
To map the same record type in
different schema repositories or in different user databases, you
must have oslcRecordConfig
sections for each schema
repository or database. The following example shows the configuration
for different schema repositories and user databases:
<oslcRecordConfig type="cq.record:Defect@8.0.0/SAMPL">
<oslcFieldMapping name="dcterms:title" field="Headline"/>
<oslcFieldMapping name="dcterms:description" field="Description"/>
</oslcRecordConfig>
<oslcRecordConfig type="cq.record:Defect@7.0.0/TEST">
<oslcFieldMapping name="dcterms:title" field="id"/>
<oslcFieldMapping name="dcterms:description" field="Headline"/>
</oslcRecordConfig>
<oslcRecordConfig type="cq.record:Defect@7.0.0/PROD">
<oslcFieldMapping name="dcterms:title" field="id"/>
<oslcFieldMapping name="dcterms:description" field="Headline"/>
</oslcRecordConfig>
The oslcProjectPrefillConfig section
The oslcProjectPrefillConfig
section controls the OSLC properties that are used
during the creation of new records. There is one oslcProjectPrefillConfig
section
for each related project that you want to provide prefill information for. In each
oslcProjectPrefillConfig
section, there are one or more sections for each HCL Compass record type that you want to provide
prefill information for.
The
following example shows prefill information for a project called RTC
4.0 Change Management. One oslcProjectPrefillConfig
section
contains two oslcRecordPrefill
sections, one for
prefill information from the Defect record type and one for Customer
record type in the 8.0.0/SAMPL database.
<oslcProjectPrefillConfig
projectName="RTC 4.0 (Change Management)" supportsPrefillMarkup="true">
<oslcRecordPrefill type="cq.record:Defect@8.0.0/SAMPL">
<oslcPrefillProperty name="dcterms:title" prefix="ClearQuest Headline: "/>
<oslcPrefillProperty name="dcterms:description" prefix="Problem Description:<br/>"/>
</oslcRecordPrefill>
<oslcRecordPrefill type="cq.record:Customer@8.0.0/SAMPL">
<oslcPrefillProperty name="dcterms:title" prefix="ClearQuest Customer Name: "/>
<oslcPrefillProperty name="dcterms:description" prefix="Customer Description:<br/>"/>
</oslcRecordPrefill>
</oslcProjectPrefillConfig>
Each oslcRecordPrefill
section
can contain up to two oslcPrefillProperty
lines.
Currently, only the dcterms:title
and dcterms:description
properties
are supported for prefill.
The supportsPrefillMarkup
attribute
determines which type of line breaks to use when information is prefilled
from ClearQuest to the
related project. If the supportsPrefillMarkup
attribute
is set to TRUE
, but the project does not support
rich text, you might notice the characters <br/>
in
your prefilled data instead of line breaks. If the supportsPrefillMarkup
attribute
is set to FALSE
and the project supports rich text,
you might notice that all prefilled multiline data is displayed on
a single line.
If the project supports rich text, you might be able to use HTML tags with the prefix. In the following example, there are begin and end tags for bold and italic, and two line breaks:
<oslcProjectPrefillConfig
projectName="RTC 4.0 (Change Management)" supportsPrefillMarkup="true">
<oslcRecordPrefill type="cq.record:Defect@8.0.0/SAMPL">
<oslcPrefillProperty name="dcterms:title" prefix="ClearQuest Headline: "/>
<oslcPrefillProperty name="dcterms:description" prefix="<b><i>ClearQuest Description:</b></i><br/><br/>"/>
</oslcRecordPrefill>
</oslcProjectPrefillConfig>
How OSLC mappings in cqrest.properties affect prefill attributes
If OSLC mappings are set in the cqrest.properties file,
only the mappings in the cqrest.properties file
are used, and none of the prefill properties in the oslcProjectPrefillConfig
section
are used.
If you require generic OSLC property mappings for GET/POST/PUT
calls,
and you need to prefill record forms, remove the values from the cqrest.properties file
and enter them in the oslcRecordConfig
section of
the oslc-mappings.xml file. The number of OSLC
properties that you can map in this section is unlimited.