How to get DNG Primary Text content from the history:changeEntry using the REST API?
Hello
When setting a query with the history=true parameters, the result contains a set of history:changeEntry data elements.
Example
https://<server>:<port>/rm/publish/resources?resourceURI=<artifact_itemid>&history=true;
For all attributes beside Primary Text, the changed value is in the history:value field.
Example
<history:changeEntry history:changeEvent="ATTRIBUTE" history:eventType="ADDED">
<rrm:title>AnAttributeName</rrm:title>
<history:value type="string">AnAttributeValue</history:value>
</history:changeEntry>
For the Primary Text the the changed value is a url.
<history:changeEntry history:changeEvent="ATTRIBUTE" history:eventType="ADDED">
<rrm:title>Primary Text</rrm:title>
<history:value type="url">
https://<server>:<port>/rm/resources/<artifact_itemid>?revision=<artifact_revisionid>
</history:value>
</history:changeEntry>
Base on that information, I woudl like to do a Text DNG REST Query to get the data and generate a RPE reports.
The url is of the form:
https://<server>:<port>/rm/resources/<artifact_itemid>?revision=<artifact_revisionid>
I would expect that using the following would provide the "old" Primary Text:
https://<server>:<port>/rm/publish/text?resourceURI=<artifact_itemid>?revision=<artifact_revisionid>
It seam that the revision parameter is ignored and only the latest and current Primary Text is returned.
Is there a way with the DNG REST API to get the previous Primary Text content?
Regards
Pierre
3 answers
Pierre:
I too am trying to return the primary text of the old value of an artifact as well. As an additional FYI...according to https://www.ibm.com/developerworks/community/forums/html/topic?id=ae7b9aa2-0a79-4d2b-ba81-847e07f9fed7#repliesPg=0 "We cannot get the old value since DNG does not support the filter by revision."
Regarding your baseline comparisons...Question: Do you provide the users with a list of baselines to choose from when generating the book report? I'd like to see how you did this if that is the case? I know currently there is no data source available for baselines and the information can not be reported using RPE, but just curious if you found another way other than knowing the snapshot id of the baseline as discussed in http://rpeactual.com/2014/08/06/producing-documents-from-dng-module-baselines/
Comments
Hello
Sorry for the late reply.
To get the Baseline data:
Using a RPE variable (BaselineID), the user provide the baseline name [ex: 1.0 (review) ]
We then use the info provided here:
Publishing DNG Module Baseline Metadata to get the snapshot Id.
We look in feed/entry/content/moduleBaseline for (uniqueId == BaselineID)
The snapshot id is available in
feed/entry/content/moduleBaseline/binding,
where (name == "jfsBaseline").
We get the data using the following script:
_snapshotId = uri.replace(/.*baselines\//,"")
Hope that helps.
Pierre
Comments
The OOTB template audithistory.dta creates a Hyperlink to the old value in DNG.
That is my current work around.
The purpose of our template is to show changes side by side, without any navigation to DNG.
Currently, we generate a Book report on two baselines (or current) and use Word compare to identify the changes. That work well when comparing baselines, but not for "in between" baseline time stamp.
X-jazz-downstream-auth-client-level: 4.0The "Accept" header does not appear to matter as it always return XML/RDF format.
DoorsRP-Request-Type: private
Note that rather than using the "history=true" parameter to get the revisions, it may be easier to just use the artifact type "revisions" to do so.
https://server:port/rm/publish/revisions?resourceURI=<UUID>