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

OSLC: Is it possible to access all attributes and their types for particular work item type?

 Hello,

I'm trying to access work item type info:
- attributes
- attributes types
- enumerations

Is it possible via OSLC?

2 votes


Accepted answer

Permanent link
Resource Shape is what I believe you are looking for which is reached following the discovery mechanism starting with rootservices of ccm.

let me explain from the Services URL obtained through the discovery mechanism:

GET on
    https://localhost:9443/ccm/oslc/contexts/_87qOEKvrEeKxU5AQolS52w/workitems/services.xml

with following headers
    OSLC-Core-Version: 2.0
    Accept: application/xml

and from the response locate the creation factory for the work item type you want to understand and you will see the resourceShape URL

<oslc:creationFactory>
    <oslc:CreationFactory>
        <dcterms:title rdf:parseType="Literal">Location for creation of Defect change requests </dcterms:title>
        <oslc:usage rdf:resource="http://open-services.net/ns/core#default"/>
        <oslc:usage rdf:resource="http://open-services.net/ns/cm#defect"/>
        <oslc:resourceType rdf:resource="http://open-services.net/ns/cm#ChangeRequest"/>
        <oslc:resourceType rdf:resource="https://localhost:9443/ccm/oslc/types/_87qOEKvrEeKxU5AQolS52w/defect"/>
        <oslc:resourceShape rdf:resource="https://localhost:9443/ccm/oslc/context/_87qOEKvrEeKxU5AQolS52w/shapes/workitems/defect"/>
        <oslc:creation rdf:resource="https://localhost:9443/ccm/oslc/contexts/_87qOEKvrEeKxU5AQolS52w/workitems/defect"/>
    </oslc:CreationFactory>
</oslc:creationFactory>

perform a GET on the rdf:resource for oslc:resourceShape and you will see all the attributes of the work item type and the attriubtes data type and more (readonly, mandatory... )

here is a sample for Resolution Date of Defect Work Item Type:
<oslc:property>
    <oslc:Property rdf:about="https://localhost:9443/ccm/oslc/context/_87qOEKvrEeKxU5AQolS52w/shapes/workitems/defect/property/resolutionDate">
        <oslc:valueType rdf:resource="http://www.w3.org/2001/XMLSchema#dateTime"/>       
        <oslc:readOnly rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean">true</oslc:readOnly>
        <oslc:propertyDefinition rdf:resource="http://open-services.net/ns/cm#closeDate"/>       
        <oslc:occurs rdf:resource="http://open-services.net/ns/core#Zero-or-one"/>       
        <oslc:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string">closeDate</oslc:name>       
        <dcterms:title rdf:parseType="Literal">Resolution Date</dcterms:title>
    </oslc:Property>
</oslc:property>

hope this helps...
Timur Markunin selected this answer as the correct answer

5 votes

Comments

For a workshop on how to use the OSLC API, see this article Open Services for Lifecycle Collaboration Workshop

I realized that this answer is fairly old.  But hopefully someone will answer my question. A GET on the rdf:resource for oslc:resourceShape does appear to return properties for all of the attributes.  But it also seems to return properties for other items such as link types.  So how do I determine which properties refer to attributes?

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
× 10,936

Question asked: Jul 03 '13, 10:46 a.m.

Question was seen: 6,388 times

Last updated: Sep 15 '15, 3:59 p.m.

Confirmation Cancel Confirm