oslc-mappings.xml

The oslc-mappings.xml configuration file controls how Rational® ClearQuest® prefills new OSLC 2.0-linked records.

Description

The oslc-mappings.xml file has two sections. Both sections are required to enable ClearQuest to prefill new records:
  • The oslcRecordConfig section maps ClearQuest 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 ClearQuest record fields to specific OSLC properties. Include one oslcRecordConfig section for each ClearQuest 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 8.0.0/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 ClearQuest 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 ClearQuest 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 ClearQuest 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/&gt;"/>
	</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/&gt;"/>
	</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 &ltbr/> 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&gt;<i&gt;ClearQuest Description:</b&gt;</i&gt;<br/&gt;<br/&gt;"/>
	
	</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.


Feedback