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

Doors Web (not DNG) OSLC API - How do I get the text of custom fields

 Hello everyone,


we still use the old Doors Web (and also Doors Desktop 9.x) and I need to fetch all requirements via the OSLC API and convert them to JSON.

I already managed to query the requirements I need, but I just cant find a way to identify which XML attributes correspond to which custom field.

My response looks like this

<?xml version="1.0"?>
<rdf:RDF
        xmlns:rm_property="<company_url>/dwa/rm/urn:rational::1-48beda447cfb0c27-M-0000f900/types/">
    <oslc_rm:Requirement
            rdf:about="<about url>">
        <rm_property:attrDef-1049 rdf:parseType="Literal">
            <div>---</div>
        </rm_property:attrDef-1049>
        <rm_property:attrDef-1053 rdf:datatype="http://www.w3.org/2001/XMLSchema#integer"></rm_property:attrDef-1053>
        <rm_property:attrDef-1069
                rdf:resource="<company_url>/dwa/rm/urn:rational::1-48beda447cfb0c27-M-0000f900/types/attrDef-1069#2"/>
        <rm_property:attrDef-1067 rdf:parseType="Literal">
            <div></div>
        </rm_property:attrDef-1067>
        <rm_property:attrDef-1006
                rdf:resource="<company_url>/dwa/rm/urn:rational::1-48beda447cfb0c27-M-0000f900/types/attrDef-1006#9"/>
        <rm_property:attrDef-1078
                rdf:resource="<company_url>/dwa/rm/urn:rational::1-48beda447cfb0c27-M-0000f900/types/attrDef-1078#1"/>
        <rm_property:attrDef-1035 rdf:parseType="Literal">
            <div></div>
        </rm_property:attrDef-1035>
    </oslc_rm:Requirement>
</rdf:RDF>

How would I find what's the corresponding attribute in doors web and the value of that attribute.

When I query the URLs of the rm_property:attrDef-xxxx attributes, I just get a list of my requirements.

Any help is greatly appreciated.

0 votes

Comments

 Have you looked into how OSLC works? Here is the core specification: https://docs.oasis-open-projects.org/oslc-op/core/v3.0/oslc-core.html


Provided you pass the correct headers - this is critical, you are supposed to get a result back, where the properties of the OSLC resource are in the result body. Attributes/properties of simple types like string should be in the result. Otherwise the value would be a link to a resource that contains the detail. 

Headers are:
OSLC-Core-Version: 2.0
Accept: application/rdf+xml
Content-Type: application/rdf+xml

 Your XML does not look like RDF+XML.

@rschoon Why does this not look like RDF+XML? What's missing there? That's the (slightly shortened) Data I get from Doors.

I was wrong, pasted XML in this forum is usually hard to read. I was missing the prefixes, but there is a prefix. A better way might be using text/turtle.

the attributes are e,g, rm_property:attrDef-1049 and you could get more details using the rdf:resource url. 


  That's the strange part.
When I grab the URL from lets say rm_property:attrDef-1069 (<company_url>/dwa/rm/urn:rational::1-48beda447cfb0c27-M-0000f900/types/attrDef-1069#2) and query it using the application/rdf+xml headers I just get a long list of URLs back, which looks suspiciously like the list of all requirements instead of the enum values.


The response looke like this (but with over 1000 entries)

And if I try to access an OSLC URL with "Accept: text/turtle" header, doors refuses to answer and returns an error code.

  1.  Yes, it looks like you get the uses back.
  2. You have to always provide all headers e.g. OSLC-Core-Version
Maybe Doors does not support turtle. I have no Doors instance. 

With your pastebin response, I think it's working as intended. I think you need to query each one of those responses to get your DOORS objects.  

showing 5 of 7 show 2 more comments

Accepted answer

Permanent link

 Thanks for all the help I got.


In the end I found out that you can add "useEnumLabel=true" to the query and get enum labels back instead of links

Ralph Schoon selected this answer as the correct answer

0 votes

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

Question asked: Nov 09 '23, 4:41 a.m.

Question was seen: 653 times

Last updated: Nov 29 '23, 3:14 a.m.

Confirmation Cancel Confirm