CARMA has the ability to compare (associated) resources
in the Rational® Developer
workspace (for example, local or remote projects) with resources in
a CARMA RAM. This is useful for determining what changes have been
made to the workspace files before checking the changes into CARMA.
CARMA stores the current criteria values when it downloads
a resource into the workspace. Based on criteria value and workspace
changes CARMA can determine what changes have been made to the version
in the RAM and indicate what direction changes should be moved. For
example, CARMA can determine if a workspace file has been updated
locally, in the RAM, or both. Based on the change information CARMA
can indicate what portions of the file changed and indicate where
changes should be uploaded to the RAM, copied from the RAM, or if
a merge needs to occur because changes have occurred in the workspace
and the RAM.
In order to perform the compare in a flexible manner
CARMA has provided a Compare Criteria configuration file – syncConfig.xml.
This syncConfig file is placed in the RSE configuration directory*
and automatically picked up by CARMA when RSE starts**.
The
compare configuration file allows the RAM developer to specify a variety
of criteria for comparison on a RAM-by-RAM basis. An example of a
compare configuration file is:
<?xml version="1.0" encoding="UTF-8"?>
<CARMACompare xmlns="http://www.ibm.com/CARMA/SyncConfig">
<RAMCompare ramId="00">
<memberinfo key="Last Modified Date" type="date" format="MM/DD/YY"/>
<memberinfo key="Last Modified Time" type="date" format="HH:MM"/>
<memberinfo key="Last Modified Seconds" type="int" />
</RAMCompare>
<RAMCompare ramId="01">
<content />
</RAMCompare>
</CARMACompare>
The XML document must begin with
a
CARMACompare element. The
CARMACompare element
can contain 1 or more
RAMCompare elements. Each
RAMCompare element
specifies the comparison criteria for a single RAM. The RAM that
the criteria apply to is denoted by the
ramId attribute.
The
ramId value should match up with the RAM id
in the CARMA VSAM configuration and is a 2 digit number. 0s are required
to be added to the beginning of the Id value if the Id is less than
2 digits. The example above defines compare criteria for 2 RAMs, 01
and 02. Each
RAMCompare element contains the criteria
for the RAM. Currently the criteria available for checking include:
- Member Info
- Member contents
Member Info
The configuration can define
1 or more
memberinfo elements for each
RAMCompare.
The member info elements are concatenated together to form a comparison.
The member info element contains a
key,
type and
optional
format attributes. Currently the
type and
format attributes
are ignored but an explanation of usage is included. The keys are
currently compared directly for string equivalence.
- key attribute
- The key attribute references a member info item
found in the properties for a resource. The key attribute should match
the key returned by the RAM for the resource.
- type attribute
- The type attribute specifies how the key value
should be treated. The type attribute can be set
to one of the following:
The type defines how the member info should be compared. For
example, using the following criteria
<memberinfo key="Last Modified Seconds" type="int" />
A
member info value of 0001 would be equal to 1.
- format attribute
- The format attribute is only required for elements
which specify a type of “date”. The format attribute
allows the criteria to define how the date value should be parsed
and compared. For example, using the following criteria:
<memberinfo key="Last Modified Time" type="date" format="HH:MM"/>
A
member info value of 1:10 PM would be equivalent to 13:10.
Member Contents
The configuration
can define one content element for each
RAMCompare.
The contents element indicates that CARMA should inspect the byte
contents of the resource for changes.
Note: This requires that the
entire file is downloaded to the workspace to perform the comparison.
The file contents are downloaded to the workspace and a file hash
(MD5) is performed on the file contents. If the file contents hash
differs from the workspace file hash then a difference is indicated.
Default
Compare Criteria
If a RAMCompare element
is not defined for a RAM that CARMA is working with, a default compare
criteria set is used. The default compare criteria first looks to
see if a carma.version member info key is defined
for the resource being compared. If the carma.version key
is available, the single key value is used as the compare criteria.
If a carma.version key is not available, then the
comparison is performed based on member contents.
Note: * Please
refer to the Rational Developer
for System z® Host Configuration
Guide (SC23-7658-00) for more information on the RSE configuration
directory.
Note: ** The compare configuration file is only picked
up when RSE starts. In order for changes to be detected disconnect
RSE and re-connect.