It's all about the answers!

Ask a question

Is a file artifact in RAM given a URL?


Janette Wong (711311) | asked Mar 22 '12, 3:34 p.m.
Hi,

If I upload a file artifact (e.g. a Word doc) with an asset, can I programmatically by using the RAM API retrieve a URL/link which points to the file?

In the Class Artifact javadoc, there is no getURI() or something like that. There is a getPath(), but path is not the same as URI. I also looked into RAMArtifact class and LocalFileArtifact class and also could not find a getURI() type of method.

Thanks!

13 answers



permanent link
Derek Baron (6632) | answered Apr 06 '12, 10:03 a.m.
JAZZ DEVELOPER
Try something like this:

AssetAttribute ssd = serviceAsset.getAssetAttribute("Service Specification").setValues(new String[]{"<a href=\"myURL\">myLabel</a>"});


permanent link
Janette Wong (711311) | answered Apr 06 '12, 11:40 a.m.
Try something like this:

AssetAttribute ssd = serviceAsset.getAssetAttribute("Service Specification").setValues(new String[]{"<a>myLabel</a>"});



By using the code above, it works in that I could prove that the value of my attribute has been set (including its label). BUT... for some strange reasons, my attribute is not showing up on the General Details page.

Note: something seems to be wrong with this jazz forum -- the code isn't showing properly even if it is enclosed within the "code" and "/code".

permanent link
Janette Wong (711311) | answered Apr 08 '12, 3:15 p.m.
Try something like this:

AssetAttribute ssd = serviceAsset.getAssetAttribute("Service Specification").setValues(new String[]{"<a>myLabel</a>"});



By using the code above, it works in that I could prove that the value of my attribute has been set (including its label). BUT... for some strange reasons, my attribute is not showing up on the General Details page.

Note: something seems to be wrong with this jazz forum -- the code isn't showing properly even if it is enclosed within the "code" and "/code".

OK, I figured out why my attribute value wasn't showing on the General Details page -- it is because I need to add code to get the session and use the session to commit my changes. Once I did that, then the code works.

Thanks!

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.