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

How do I get the GUID when submitting a new asset?

<Administrator> Question changed to what turned out to be the real question. The answer is for the real question</Administrator>

Sorry for the newbie question but I'm not sure how this is supposed to work.  I successfully uploaded an asset to RAM using the custom ant library but now I need the URL to that same asset.  It seems pretty straightforward: http://ramserver/ram/oslc/assets/<guid>/<version>.  The problem is, how do I get the GUID!

I have this:

    <ram:search server="ramServer"
            community="${ram.asset.community}"
            version="${ram.asset.version}"
            name="${ram.asset.name}"/>

The query is simple because I know the name is unique.  It runs successfully but there are no results anywhere.  Are the results loaded into a certain property or. . .?

Thanks for any suggestions!

- Andy

0 votes

Comments

Sorry with that post, somehow the snippet got mangled.  Try this:


<ram:search server="ramServer"
  community="${ram.asset.community}"
  version="${ram.asset.version}"
  name="${ram.asset.name}"/> 


Accepted answer

Permanent link
First off, indexing occurs in the background. This means it can take 30 seconds to a minute before an asset's changes show up in a search result.

Second, you don't need to search to get the guid. When the submit occurs you can have an ANT property set with the guid of the new asset. See Submit task and look at the "guidProperty" setting on the submit.
Andy Jewell selected this answer as the correct answer

1 vote

Comments

Well, that's just ideal:)  But could you help with one follow-up question?  I'm publishing the asset using the same task as is used in the ramPublishAsset.xml file (from the ramclient.zip and referenced in Carlos Ferreira's RAM/ant tutorial) and it actual uses ram:modify rather than ram:submit.  It also has that guidProperty.  I just tried it, it does exactly what you said which is exactly what I needed.  Is there any reason to use ram:modify rather than ram:submit or vice versa when publishing a new asset?

 P.s. . . I ran my same search that I referred to in the OP and I still don't get any results.  Though your answer meets my need (thank you!), for future generations could you help with the original ram:search question so that we have an answer to that on the same thread?  Or if you could modify the question to "How do I get the GUID when submitting a new asset?" then I can submit the ram:search question separately.

Modify is for modifying an existing asset. Submit is only for creating a new asset.

You can't modify an asset with submit and you can't create an asset (other than a new version of an existing asset, leaving the existing asset version still existing after the create new version) with modify.

1 vote

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
× 12,020
× 63

Question asked: Oct 24 '13, 6:59 p.m.

Question was seen: 5,146 times

Last updated: Oct 25 '13, 1:15 p.m.

Confirmation Cancel Confirm