From requirement or any DNG artifact , how to find in which module it is used using OSLC api's ?
I have requirement artifact URI when fetch details of it using oslc i am not finding any details related to where it is getting used .
I want to find the Module where it is been used .
Similarly another scenario with Test case. I have Test case URI I want to find the Test Plan details of it.
I want to find the Module where it is been used .
Similarly another scenario with Test case. I have Test case URI I want to find the Test Plan details of it.
Accepted answer
Which RM provider are you using? Is it DOORS or Requirement Management or some other RM provider?
I am not so sure but that might not be possible directly from the requirement uri.
But you might use the OSLC queries to do that. If you are implementing this in DXL, then you can actually find out the module from URI. Standard OSLC query should allow that.
Check
http://open-services.net/bin/view/Main/OSLCCoreSpecQuery . Depending on query support of DWA, it might work
Reverse should be possible. Requirement Collection should have list of requirements
Check
Reverse should be possible. Requirement Collection should have list of requirements
Comments
Thanks a lot for the info :)
I am using DOORS .
Just to be specific I am using DOORS next generation.
@
Reshma Ratnani
Similar to RM & CM oslc api's is it possible to program for the RQM. Because till now I have used REST Client in firefox to send OSLC API queries for RQM .I have got the results.
I got this doubt because why there is only RQM Utility Jar for RQM and not for CM or RM. Without using utility jar is it possible to program based on OSLC api's .
2 other answers
@
Reshma Ratnani
Is it same case with Requirement or any DNG artifact.
I know requirement artifact , from which I want to find the Module.
Thanks for the above info.
Is it same case with Requirement or any DNG artifact.
I know requirement artifact , from which I want to find the Module.
Thanks for the above info.
@
Reshma Ratnani
Similar to RM & CM oslc api's is it possible to program for the RQM. Because till now I have used REST Client in firefox to send OSLC API queries for RQM .I have got the results.
I got this doubt because why there is only RQM Utility Jar for RQM and not for CM or RM. Without using utility jar is it possible to program based on OSLC api's .
My example code might look like this: This is possible via REST Client in firefox why not I am getting same results here please share if you have sample code or suggestions where I have misunderstood something.I checked online couldnt find some workshop related to RQM for OSLC API's
public static void main(String[] args) {
//============== Code to adapt to your own configuration =============//
String server = "https://local:host:9443/qm"; // Set the Public URI of your RRC server
String JTS_Server = "https://local:host:9443/jts"; //Set the public URI of your JTS server
String login = "rak6si"; // Set the user login
String password = "Itsmedear8796"; // Set the associated password
//============== -------------------------------------- =============//
String rootServices = server + "/rootservices";
String catalogXPath = "/rdf:Description/oslc_qm:qmServiceProviders/@rdf:resource";
String serviceProviderTitleXPath = "//oslc:ServiceProvider/dcterms:title";
System.out.println(">> ExampleRQM02: Print out the content of the Service Providers catalog");
System.out.println(" - Root Services URI: "+rootServices);
System.out.println(" - Service Providers catalog XPath expression: "+catalogXPath);
System.out.println(" - Service Provider title XPath expression: "+serviceProviderTitleXPath);
System.out.println(" - Login: "+login);
// System.out.println(" - Password: "+password);
// Setup the HttClient
DefaultHttpClient httpclient = new DefaultHttpClient();
HttpUtils.setupLazySSLSupport(httpclient);
// Setup the rootServices request
HttpGet rootServiceDoc = new HttpGet(rootServices);
rootServiceDoc.addHeader("Accept", "application/rdf+xml");
rootServiceDoc.addHeader("OSLC-Core-Version", "2.0");
try {
// Request the Root Services document
HttpResponse rootServicesResponse = HttpUtils.sendGetForSecureDocument(
server, rootServiceDoc, login, password, httpclient,JTS_Server);
if (rootServicesResponse.getStatusLine().getStatusCode() == 200) {
// Define the XPath evaluation environment
XPathFactory factory = XPathFactory.newInstance();
XPath xpath = factory.newXPath();
xpath.setNamespaceContext(
new NamespaceContextMap(new String[]
{ "rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"oslc_qm","http://open-services.net/xmlns/qm/1.0/"}));
// Parse the response body to retrieve the catalog URI
InputSource source = new InputSource(rootServicesResponse.getEntity().getContent());
Node attribute = (Node) (xpath.evaluate(catalogXPath, source, XPathConstants.NODE));
String serviceProvidersCatalog = attribute.getTextContent();
rootServicesResponse.getEntity().consumeContent();
// Setup the catalog request
HttpGet catalogDoc = new HttpGet(serviceProvidersCatalog);
catalogDoc.addHeader("Accept", "application/xml");
catalogDoc.addHeader("OSLC-Core-Version", "2.0");
// Access to the Service Providers catalog
HttpResponse catalogResponse = HttpUtils.sendGetForSecureDocument(
server, catalogDoc, login, password, httpclient,JTS_Server);
if (catalogResponse.getStatusLine().getStatusCode() == 200) {
// Define the XPath evaluation environment
XPath xpath2 = factory.newXPath();
xpath2.setNamespaceContext(
new NamespaceContextMap(new String[]
{ "oslc", "http://open-services.net/ns/core#",
"dcterms","http://purl.org/dc/terms/"}));
// Parse the response body to retrieve the Service Provider
source = new InputSource(catalogResponse.getEntity().getContent());
NodeList titleNodes = (NodeList) (xpath2.evaluate(serviceProviderTitleXPath, source, XPathConstants.NODESET));
// Print out the title of each Service Provider
int length = titleNodes.getLength();
System.out.println(">> Project Areas:");
for (int i = 0; i < length; i++) {
System.out.println(">> \t - "+ titleNodes.item(i).getTextContent());
}
}
}
rootServicesResponse.getEntity().consumeContent();
} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (XPathExpressionException e) {
e.printStackTrace();
} catch (InvalidCredentialsException e) {
e.printStackTrace();
} finally {
// Shutdown the HTTP connection
httpclient.getConnectionManager().shutdown();
}
}
Ouput:
Example03: Print out the content of the Service Providers catalog
- Root Services URI: https://local:host:9443/qm/rootservices
- Service Providers catalog XPath expression: /rdf:Description/oslc_qm:qmServiceProviders/@rdf:resource
- Service Provider title XPath expression: //oslc:ServiceProvider/dcterms:title
- Login: rak6si
>> GET(1) https://local:host:9443/qm/rootservices
>> Response Headers:
- X-Powered-By: Servlet/3.0
- ETag: "2QDRDqDuCTaRnsLnKGvDrhVzqVs="
- Date: Fri, 28 Aug 2015 07:52:06 GMT
- Expires: Fri, 28 Aug 2015 07:57:06 GMT
- Cache-Control: public
- Content-Type: application/rdf+xml; charset=UTF-8
- Content-Language: en-US
- Transfer-Encoding: chunked
>> GET(1) https://local:host:9443/qm/oslc_qm/catalog
>> Response Headers:
- X-Powered-By: Servlet/3.0
- X-com-ibm-team-repository-web-auth-msg: authrequired
- Content-Type: text/html; charset=UTF-8
- Content-Language: en-US
- Set-Cookie: JazzFormAuth=Form; Path=/qm; Secure
- Set-Cookie: x-com-ibm-team-scenario=71306067-db4b-4a0d-b786-b41c4d60b9b9%3Bname%3DInitial+Page+Load%3Bextras%3D%2Fqm%2Fauth%2Fauthrequired%2C1440748327005; Path=/
- Transfer-Encoding: chunked
- Date: Fri, 28 Aug 2015 07:52:06 GMT
- Expires: Thu, 01 Dec 1994 16:00:00 GMT
- Cache-Control: no-cache="set-cookie, set-cookie2"
[Fatal Error] :21:77: Der Verweis auf Entität "etag" muss mit dem Begrenzer ';' enden.
org.xml.sax.SAXParseException: Der Verweis auf Entität "etag" muss mit dem Begrenzer ';' enden.
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at org.apache.xpath.jaxp.XPathExpressionImpl.evaluate(Unknown Source)
at org.apache.xpath.jaxp.XPathImpl.evaluate(Unknown Source)
at net.jazz.oslc.consumer.examples.ExampleRQM02.main(ExampleRQM02.java:104)
------------------------------------------
javax.xml.xpath.XPathExpressionException: org.xml.sax.SAXParseException: Der Verweis auf Entität "etag" muss mit dem Begrenzer ';' enden.
at org.apache.xpath.jaxp.XPathExpressionImpl.evaluate(Unknown Source)
at org.apache.xpath.jaxp.XPathImpl.evaluate(Unknown Source)
at net.jazz.oslc.consumer.examples.ExampleRQM02.main(ExampleRQM02.java:104)
Caused by: org.xml.sax.SAXParseException: Der Verweis auf Entität "etag" muss mit dem Begrenzer ';' enden.
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
... 3 more
Similar to RM & CM oslc api's is it possible to program for the RQM. Because till now I have used REST Client in firefox to send OSLC API queries for RQM .I have got the results.
I got this doubt because why there is only RQM Utility Jar for RQM and not for CM or RM. Without using utility jar is it possible to program based on OSLC api's .
My example code might look like this: This is possible via REST Client in firefox why not I am getting same results here please share if you have sample code or suggestions where I have misunderstood something.I checked online couldnt find some workshop related to RQM for OSLC API's
public static void main(String[] args) {
//============== Code to adapt to your own configuration =============//
String server = "https://local:host:9443/qm"; // Set the Public URI of your RRC server
String JTS_Server = "https://local:host:9443/jts"; //Set the public URI of your JTS server
String login = "rak6si"; // Set the user login
String password = "Itsmedear8796"; // Set the associated password
//============== -------------------------------------- =============//
String rootServices = server + "/rootservices";
String catalogXPath = "/rdf:Description/oslc_qm:qmServiceProviders/@rdf:resource";
String serviceProviderTitleXPath = "//oslc:ServiceProvider/dcterms:title";
System.out.println(">> ExampleRQM02: Print out the content of the Service Providers catalog");
System.out.println(" - Root Services URI: "+rootServices);
System.out.println(" - Service Providers catalog XPath expression: "+catalogXPath);
System.out.println(" - Service Provider title XPath expression: "+serviceProviderTitleXPath);
System.out.println(" - Login: "+login);
// System.out.println(" - Password: "+password);
// Setup the HttClient
DefaultHttpClient httpclient = new DefaultHttpClient();
HttpUtils.setupLazySSLSupport(httpclient);
// Setup the rootServices request
HttpGet rootServiceDoc = new HttpGet(rootServices);
rootServiceDoc.addHeader("Accept", "application/rdf+xml");
rootServiceDoc.addHeader("OSLC-Core-Version", "2.0");
try {
// Request the Root Services document
HttpResponse rootServicesResponse = HttpUtils.sendGetForSecureDocument(
server, rootServiceDoc, login, password, httpclient,JTS_Server);
if (rootServicesResponse.getStatusLine().getStatusCode() == 200) {
// Define the XPath evaluation environment
XPathFactory factory = XPathFactory.newInstance();
XPath xpath = factory.newXPath();
xpath.setNamespaceContext(
new NamespaceContextMap(new String[]
{ "rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"oslc_qm","http://open-services.net/xmlns/qm/1.0/"}));
// Parse the response body to retrieve the catalog URI
InputSource source = new InputSource(rootServicesResponse.getEntity().getContent());
Node attribute = (Node) (xpath.evaluate(catalogXPath, source, XPathConstants.NODE));
String serviceProvidersCatalog = attribute.getTextContent();
rootServicesResponse.getEntity().consumeContent();
// Setup the catalog request
HttpGet catalogDoc = new HttpGet(serviceProvidersCatalog);
catalogDoc.addHeader("Accept", "application/xml");
catalogDoc.addHeader("OSLC-Core-Version", "2.0");
// Access to the Service Providers catalog
HttpResponse catalogResponse = HttpUtils.sendGetForSecureDocument(
server, catalogDoc, login, password, httpclient,JTS_Server);
if (catalogResponse.getStatusLine().getStatusCode() == 200) {
// Define the XPath evaluation environment
XPath xpath2 = factory.newXPath();
xpath2.setNamespaceContext(
new NamespaceContextMap(new String[]
{ "oslc", "http://open-services.net/ns/core#",
"dcterms","http://purl.org/dc/terms/"}));
// Parse the response body to retrieve the Service Provider
source = new InputSource(catalogResponse.getEntity().getContent());
NodeList titleNodes = (NodeList) (xpath2.evaluate(serviceProviderTitleXPath, source, XPathConstants.NODESET));
// Print out the title of each Service Provider
int length = titleNodes.getLength();
System.out.println(">> Project Areas:");
for (int i = 0; i < length; i++) {
System.out.println(">> \t - "+ titleNodes.item(i).getTextContent());
}
}
}
rootServicesResponse.getEntity().consumeContent();
} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (XPathExpressionException e) {
e.printStackTrace();
} catch (InvalidCredentialsException e) {
e.printStackTrace();
} finally {
// Shutdown the HTTP connection
httpclient.getConnectionManager().shutdown();
}
}
Ouput:
Example03: Print out the content of the Service Providers catalog
- Root Services URI: https://local:host:9443/qm/rootservices
- Service Providers catalog XPath expression: /rdf:Description/oslc_qm:qmServiceProviders/@rdf:resource
- Service Provider title XPath expression: //oslc:ServiceProvider/dcterms:title
- Login: rak6si
>> GET(1) https://local:host:9443/qm/rootservices
>> Response Headers:
- X-Powered-By: Servlet/3.0
- ETag: "2QDRDqDuCTaRnsLnKGvDrhVzqVs="
- Date: Fri, 28 Aug 2015 07:52:06 GMT
- Expires: Fri, 28 Aug 2015 07:57:06 GMT
- Cache-Control: public
- Content-Type: application/rdf+xml; charset=UTF-8
- Content-Language: en-US
- Transfer-Encoding: chunked
>> GET(1) https://local:host:9443/qm/oslc_qm/catalog
>> Response Headers:
- X-Powered-By: Servlet/3.0
- X-com-ibm-team-repository-web-auth-msg: authrequired
- Content-Type: text/html; charset=UTF-8
- Content-Language: en-US
- Set-Cookie: JazzFormAuth=Form; Path=/qm; Secure
- Set-Cookie: x-com-ibm-team-scenario=71306067-db4b-4a0d-b786-b41c4d60b9b9%3Bname%3DInitial+Page+Load%3Bextras%3D%2Fqm%2Fauth%2Fauthrequired%2C1440748327005; Path=/
- Transfer-Encoding: chunked
- Date: Fri, 28 Aug 2015 07:52:06 GMT
- Expires: Thu, 01 Dec 1994 16:00:00 GMT
- Cache-Control: no-cache="set-cookie, set-cookie2"
[Fatal Error] :21:77: Der Verweis auf Entität "etag" muss mit dem Begrenzer ';' enden.
org.xml.sax.SAXParseException: Der Verweis auf Entität "etag" muss mit dem Begrenzer ';' enden.
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at org.apache.xpath.jaxp.XPathExpressionImpl.evaluate(Unknown Source)
at org.apache.xpath.jaxp.XPathImpl.evaluate(Unknown Source)
at net.jazz.oslc.consumer.examples.ExampleRQM02.main(ExampleRQM02.java:104)
------------------------------------------
javax.xml.xpath.XPathExpressionException: org.xml.sax.SAXParseException: Der Verweis auf Entität "etag" muss mit dem Begrenzer ';' enden.
at org.apache.xpath.jaxp.XPathExpressionImpl.evaluate(Unknown Source)
at org.apache.xpath.jaxp.XPathImpl.evaluate(Unknown Source)
at net.jazz.oslc.consumer.examples.ExampleRQM02.main(ExampleRQM02.java:104)
Caused by: org.xml.sax.SAXParseException: Der Verweis auf Entität "etag" muss mit dem Begrenzer ';' enden.
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
... 3 more
Comments
Reshma Ratnani
JAZZ DEVELOPER Aug 13 '15, 6:22 a.m.Hi Vijayakumar,
At present we dont have any facility in Repotable REST APIs to show test plan details in the TestCase xml. Reverse is present. If you have the testplan uri then you can get the list of testcase uris linked to that TestPlan
1 vote