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

DNG custmization : Is it possible to fetch DNG artifact using java client api ? or Is there any Java client api available to access DNG artifact

Hi ,

I am new to DNG. I have requirement where, I have to fetch Artifact and update link info in respective artifact. Is there any java client side api available to achieve same. I have data input in XML according to that need update the artifcat 

Please let me know if there is any other alternate way

0 votes



3 answers

Permanent link
Hello Nilesh,

if you want to use Java, you should have a look at the Eclipse Lyo project which implements the OSLC RM specification (Lyo Tutorial). But, Lyo (more precisely OSLC) does not provide full accessibility concerning DNG (see my question). 

If you only need to get artifacts from the database, update links and write the changes back to the database, Lyo's DNG support could be fine for you.
If you need full accessibility, you should think about using the DNG Javascript API (which provides more and more functions) - check the links in Roberts post.

Best regards
-- Thomas Noack

1 vote

Comments

Hi Thomas,
Thank you for your answer. Could you please provide sample code for connecting DNG artifact and fetching data


Permanent link
Hi Nilesh,

sorry for the late answer. I had problems with my Jazz account and wasn't able to use the forum in the last week. 

First of all you have to include the jar packages of Eclipse Lyo into your project. Download OSLC4J 2.1 SDK with Dependencies and include all jars from the 'dist' and 'lib' folder.

Please have a look at the example below. It opens a module and prints the title of all included artifacts. I hope I could help you.

Best regards

-- Thomas

 

#### Minimal example ####

String jtsURL = "https://ToDo:9443";

String userName = "ToDo";

String password = "ToDo";

                  

// Get URL from properties of a module artifact

String moduleURL = "https://ToDo:9443/rm/resources/_Qe73hMy-EeS1FtpXUHbX_A";

                  

JazzRootServicesHelper helper = new JazzRootServicesHelper(jtsURL + "/rm" , OSLCConstants.OSLC_RM_V2 );

JazzFormAuthClient client = helper.initFormClient(userNamepasswordjtsURL + "/jts");

                  

client.formLogin();

                  

ClientResponse response = client.getResource(moduleURL , OslcMediaType.APPLICATION_RDF_XML);             

RequirementCollection requirementCollection = response.getEntity(RequirementCollection.class);

                  

System.out.println("Name of collection: " + requirementCollection.getTitle());

                  

URI[] uriL = requirementCollection.getUses();

for(URI uri : uriL) {

    response = client.getResource(uri.toString() , OslcMediaType.APPLICATION_RDF_XML);

    Requirement r = response.getEntity(Requirement.class);

                       

    System.out.println("Name of artifact: " + r.getTitle());

    response.consumeContent();

} 

1 vote


Permanent link
You can use JavaScript Client Extension or OSLC

see an easy example explained in detail
https://haunkofer.wordpress.com/2013/12/13/doors-next-generation-javascript-client-extension/

see the lient extension API documentation
https://jazz.net/wiki/bin/view/Main/RMExtensions405API

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

Question asked: Mar 26 '15, 8:31 a.m.

Question was seen: 6,514 times

Last updated: Apr 29 '15, 3:22 p.m.

Confirmation Cancel Confirm