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

Is it possible to search for an RRC artifact via REST API using the artifact ID as a parameter?

Hello,
 
I am using RRC 4.0.0.1 and I am trying to search for an artifact via REST API based on it's ID.  This is because the artifacts are referenced by their UUID (for example https://server.com/rm/resources/_vvjWoMz8EeKAvJ3otSDu6Q) and not by their IDs like in RTC.

I would like to pass the ID, find the corresponding UUID and then access the artifact by constructing the URL.  Is this possible?  Are there any other ways of achieving this?

Thank you in advance,

Andrew

edit:  I can construct a query 

https://server.com/rm/views?oslc.query=true&projectURL=https://server.com/jts/process/project-areas/_TIhVZLhvEeKto8qW7nvWBw&oslc.prefix=dcterms=<http://purl.org/dc/terms/>&oslc.select=*&oslc.where=dcterms:identifier=35

that searches a project area for an artifact with ID 35, but it returns an error:

    <rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:err="http://jazz.net/xmlns/prod/jazz/foundation/1.0/">
    <rdf:Description>
    <err:detailedMessage rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
    >getInternalRequestHandlerService(context) returned null. This error used to report 'The requested service requires a private header'. (More info found at entry [57f572ea2e6010e5] in RRS server log)</err:detailedMessage>
    <err:errorMessage rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
    >Forbidden</err:errorMessage>
    <err:errorStatus rdf:datatype="http://www.w3.org/2001/XMLSchema#long"
    >403</err:errorStatus>
    </rdf:Description>
    </rdf:RDF>

Any ideas?

0 votes


Accepted answer

Permanent link
Hi,
   That query should work, ensure that you are using the proper OSLC Headers. PLS check for smaples at : https://jazz.net/library/article/1197
Ralph Schoon selected this answer as the correct answer

0 votes

Comments

@gra

Hello Gabriel,

Thank you for the reply!

I checked the articles and now I have the correct headers and now I get the error:

java.lang.RuntimeException: com.hp.hpl.jena.shared.JenaException: org.xml.sax.SAXParseException: Premature end of file. (More info found at entry [85eaa7f3adfb094d] in RRS server log)

Here is a screenshot of the GET method using RESTClient for Firefox.


Any ideas?

Best regards,

Andrew

Hello Gabriel,

Thank you for the reply!

I checked the articles and now I have the correct headers and now I get the error:

java.lang.RuntimeException: com.hp.hpl.jena.shared.JenaException: org.xml.sax.SAXParseException: Premature end of file. (More info found at entry [85eaa7f3adfb094d] in RRS server log)

Here is a screenshot of the GET method using RESTClient for Firefox.


Any ideas?

Best regards,

Andrew 

Could you paste the complete URL used for the GET here? Thanks

A sample URL is like this:
https://<host>:9443/rm/views?oslc.query=true&oslc.prefix=dc=<http://purl.org/dc/terms/>&oslc.select=*&oslc.where=dc:identifier=1234

Based on the error, the request had already been processed and the data was being retrieved but got an error when it was parsed into XML format.

Did you check the rm.log file and see what underlying error it was?

Alternatively, use the "resource" URL with the GET method to confirm the said artifact can be retrieved. Or you can try with a different artifact.

@gra @dnong

Hello Gabriel, Donald,

Gabriel, the complete URL used for the GET is:


Donald, I used your sample URL but I get the same error.   I can get that same resource using the resource URL no problem, and unfortunately I don't have access to the the RRC log files.  Also, changing artifact ID gives me the same error.

Thanks again!

Regards,

Andrew

Hi,
Query looks fine, not sure what may be happening without the logs. I suggest to contact IBM support : Here is the link: http://www-01.ibm.com/software/rational/support/contact.html

showing 5 of 6 show 1 more comments

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

Question asked: Jan 29 '14, 7:30 a.m.

Question was seen: 5,088 times

Last updated: Jan 30 '14, 11:31 a.m.

Confirmation Cancel Confirm