It's all about the answers!

Ask a question

How to get DNG Primary Text content from the history:changeEntry using the REST API?


Pierre Bentkowski (61517) | asked Jun 10 '15, 11:02 p.m.
edited Jun 19 '18, 3:10 p.m.

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



permanent link
michele choban (1644) | answered Jul 01 '15, 9:00 a.m.

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
Pierre Bentkowski commented Jul 20 '15, 5:44 p.m.

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


permanent link
Subramanya Prasad Pilar (4.6k16) | answered Jun 26 '15, 7:53 a.m.
You can use dataSource/artifact/aggregatedContent/history/changeLog/changeEntry/oldValue when value type="string". For other cases you should use script as in the OOTB template audithistory.dta.

Comments
Pierre Bentkowski commented Jun 26 '15, 9:37 a.m.

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.



permanent link
Donald Nong (14.5k414) | answered Jun 17 '15, 2:15 a.m.
You need two special HTTP request headers to retrieve it, given the fact that it's not a public API.
X-jazz-downstream-auth-client-level: 4.0
DoorsRP-Request-Type: private
The "Accept" header does not appear to matter as it always return XML/RDF format.

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>


Comments
Pierre Bentkowski commented Jun 26 '15, 9:42 a.m.

Can you provide an example on how to set the Dynamic Data Source using those special HTTP request headers?

The revisions does not have the data, we found it easier to go through the change entry.
We will consider the revisions, if we cannot move forward with this one.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.