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

Obtain artifact Wrapped Resource link from RM extension

Hello,
I would like to know if there is an easy way, using the Javascript RM API extensions, to retrieve the link to the wrapped resource (e.g. https://xxxxx.com/rm/wrappedResources/WR_tDcmoZrJEeyk_I2zbQzuyg) contained inside of an artifact, for example a picture.

Given the reference of the articfact, the .toUri() function only provides the link to the artifact, not to its content

0 votes

Comments

If you have to comment on an old question, please use a comment and not an answer. Now this question looks as it has an answer which it does not.



One answer

Permanent link
Hello Giovanni,
If you upload an artifact (for example an image) to a folder in RM, it will create an artifact (the wrapper resource) that references the actual image (the image would be the wrapped resource).
So lets say the URL of the artifact that was created when uploading the image, is https://xxxxx.com/rm/resources/WR_tDcmoZrJEeyk_I2zbQzuyg
Then you could change that URL to https://xxxxx.com/rm/wrappedResources/WR_tDcmoZrJEeyk_I2zbQzuyg and you would have the URL to the wrapped resource itself.
In ERM Doors Next v7.x*, the UID (WR_tDcmoZrJEeyk_I2zbQzuygc in this example) is usually the same for the wrapped resource and the wrapper resource. So perhaps you can use fact that in your script?

*Note that in older RM versions these UID's are not the same. So this only works for v7.x

0 votes

Comments

Thank you, but this does not seem to work in my case even i'm using version 7.0.3.
Trying to access the resources with the modified URL gives the following error:

Error 400: Bad Request

Propagated exception; original message [InternalServerErrorException: Propagated exception; original message [ClassCastException: com.ibm.rdm.service.artifacts.model.impl.Binding incompatible with com.ibm.rdm.service.artifacts.model.IWrapperResource]]


In the meantime we found the workaround to import the pictures inside a Word table, in this way the HTML table in the generated artifact will contain a "correct" Wrapped Resource URL allowing to directly download the picture if needed

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,937

Question asked: Mar 08 '22, 9:05 a.m.

Question was seen: 1,041 times

Last updated: Apr 10, 6:35 a.m.

Confirmation Cancel Confirm