How to use DNG ReqIF API
![]() My use case is that i need to import the reqifz file into the project area. I have referred this link https://jazz.net/wiki/bin/view/Main/DNGReqIF and created the request uri as per the document.
|
2 answers
![]() Hi ,
I have successfully used following code. You only need to add the Config-Context with the desired configuration.
private static String uploadReqIfFile (String packageFactoryUrl, String fileName , JazzFormAuthClient client ) throws ClientProtocolException, IOException {
String reqIfPackageUrl = null;
HttpPost uploadFile = new HttpPost(packageFactoryUrl);
uploadFile.addHeader("OSLC-Core-Version", "2.0");
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
builder.addTextBody("userMimeType", "application/zip", ContentType.TEXT_PLAIN);
// This attaches the file to the POST:
File f = new File(fileName);
builder.addBinaryBody(
"file",
new FileInputStream(f),
ContentType.create("application/zip"),
f.getName()
);
HttpEntity multipart = builder.build();
uploadFile.setEntity(multipart);
HttpResponse queryHttpResponse = client.getHttpClient().execute(uploadFile);
if ( queryHttpResponse != null ) {
int statusCode = queryHttpResponse.getStatusLine().getStatusCode();
if ( statusCode == 201 ) {
Header locationHeader = queryHttpResponse.getFirstHeader("Location");
if (locationHeader != null ) {
String locationUrl = locationHeader.getValue();
//We have a location, now lets import it
if ( locationUrl != null ) {
reqIfPackageUrl = locationUrl;
}
}
}
}
return reqIfPackageUrl;
}
Comments Hi ,
The packageFactoryUrl can be discovered from the project Services document. This API is just to upload the reqif file.
Use the import one to get the data from the ReqIF File
Is the request body what i have posted here is correct?
AFAIK no, for public API you should use:
Configuration-Context instead of vvc.configuration
OSLC-Core-Version instead of DoorsRP-Request-Type
AFAIK no, for public API you should use:
Configuration-Context instead of vvc.configuration
OSLC-Core-Version instead of DoorsRP-Request-Type
Hi,
Please do reply on the above comments.
Hi Gabriel,
Hi,
Sorry but with current inf, I am not sure what could be the error. It could be an issue with your RDNG version?
Hi Gabriel,
Hi,
Instead of "vvc.configuration" use "Configuration-Context" to specify the configuration uri. Also provide the required rdf body ( check docs ) for the Post.
Best Regards
Could you please send the link for checking docs.
Hello Gabriel,
In Addition to the above request,
Unable to see the latest comments.
showing 5 of 15
show 10 more comments
|
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.