Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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

0 votes



3 answers

Permanent link

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/  

0 votes

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


Permanent link
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.

0 votes

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.



Permanent link
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>

0 votes

Comments

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 log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,930
× 332

Question asked: Jun 10 '15, 11:02 p.m.

Question was seen: 6,352 times

Last updated: Jun 19 '18, 3:10 p.m.

Related questions
Confirmation Cancel Confirm