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
One answer
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
Comments
Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Apr 10 '24, 2:49 a.m.