[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [lyo-dev] How to add Resources to DOORS modules?

Hi, Thomas. I'd suggest you ask on the jazz.net forums. As you've found, modules are not part of OSLC Requirements Management, so someone from the DOORS Next Generation development team would need to help you understand their support for modules in their OSLC implementation. Unfortunately, I don't know the answer.

Good luck,
--
Samuel Padgett | IBM Rational | spadgett@xxxxxxxxxx
Eclipse Lyo: Enabling tool integration with OSLC


Inactive hide details for "Noack, Thomas" ---03/18/2015 02:33:36 PM---Hello,  my name is Thomas and I am a Requirements and Tes"Noack, Thomas" ---03/18/2015 02:33:36 PM---Hello,  my name is Thomas and I am a Requirements and Test Engineering methodologist and DOORS DXL a


    From:

"Noack, Thomas" <thomas.noack@xxxxxxxxxxxxxxxxxxxxxxx>

    To:

"lyo-dev@xxxxxxxxxxx" <lyo-dev@xxxxxxxxxxx>

    Date:

03/18/2015 02:33 PM

    Subject:

[lyo-dev] How to add Resources to DOORS modules?

    Sent by:

lyo-dev-bounces@xxxxxxxxxxx




Hello,

my name is Thomas and I am a Requirements and Test Engineering methodologist and DOORS DXL and DNG OSLC programmer.

I am currently trying to migrate System Requirement Specification (SRS) templates and their methods from DOORS Classic to DOORS Next. Therefore, Iâm trying to implement a SRS-Module tailoring. The goal is to compose SRS modules from several mini-templates (which can exist multiple times in one SRS). Each mini template has several (sub)heading, example and working instruction artifacts.

I am using DOORS Next Generation 5.0.1 (Build-ID RMS5.0.1-I20140805_2017)

I understand, that
- OSLC RmSpecificationV2 describes Requirement and RequirementCollection Resources
- RequirementCollection corresponds to a DNG collection (rather a set than a list)

I experienced (see example below), that
- DNG modules can be retrieved by Lyo as a RequirementCollection
- DNG modules can be updated if no resources have been added by "addUses(URI pURI)â (see line "instanceModule.addUses(new URI(duplURL));â)
- DNG modules can be created (converted by client.createResource()) as a new RequirementCollection (i.e. DOORS collection)
- Interestingly, my DNG version shows the newly added resources
- But it is not showing the previously existing resources (more exactly it shows their existence but do not actually displays them, see screenshots below)

My question is, if there exists any possibility to add resources to existing modules (i.e. sorted lists).

Best regards from Berlin (Germany)
-- Thomas Noack

############# Example code #############

##### Step 1. Get the already existing template and instance modules #####
ClientResponse response = client.getResource(âpath to module", OslcMediaType.APPLICATION_RDF_XML);
RequirementCollection templateModule = response.getEntity(RequirementCollection.class);

response = client.getResource(âpath to module", OslcMediaType.APPLICATION_RDF_XML);
RequirementCollection instanceModule = response.getEntity(RequirementCollection.class);
String instanceEtag = response.getHeaders().getFirst(OSLCConstants.ETAG);

##### Step 2. Get the artifacts from the template module, duplicate them an add them to the instance module #####
URI[] uriL = templateModule.getUses();
for(URI uri : uriL) {
    response = client.getResource(uri.toString() , OslcMediaType.APPLICATION_RDF_XML);
    Requirement r = response.getEntity(Requirement.class);

    Requirement duplR = new Requirement();
    duplR.setInstanceShape(r.getInstanceShape());
    duplR.setTitle("It's really new: " + r.getTitle());
    org.w3c.dom.Element obj = RmUtil.convertStringToHTML(duplR.getTitle());
    duplR.getExtendedProperties().put(RmConstants.PROPERTY_PRIMARY_TEXT, obj);

    ClientResponse creationResponse = client.createResource(requirementFactory, duplR, OslcMediaType.APPLICATION_RDF_XML, OslcMediaType.APPLICATION_RDF_XML);
    String duplURL = creationResponse.getHeaders().getFirst(HttpHeaders.LOCATION);
    creationResponse.consumeContent();

    instanceModule.addUses(new URI(duplURL)); // uncommenting this leads to success (i.e. status code 200)
}

##### Step 3. Update instance module - RESULT: Update - Oh NO: 400 - Bad Request #####
response = client.updateResource(instanceURL, instanceModule, OslcMediaType.APPLICATION_RDF_XML, OslcMediaType.APPLICATION_RDF_XML, instanceEtag);
int statusCode = response.getStatusCode();
String statusMsg = response.getMessage();
response.consumeContent();

if(statusCode == HttpStatus.SC_OK) {
    System.out.println("Update - Oh YEAH: " + statusCode + " - " + statusMsg);
} else {
    System.out.println("Update - Oh NO: " + statusCode + " - " + statusMsg);
}

##### Step 4. Create new instance module - RESULT: Create - Oh YEAH: 201 - Created #####
response = client.createResource(requirementFactory, instanceModule, OslcMediaType.APPLICATION_RDF_XML, OslcMediaType.APPLICATION_RDF_XML);
statusCode = response.getStatusCode();
statusMsg = response.getMessage();
response.consumeContent();

if(statusCode == HttpStatus.SC_CREATED) {
    System.out.println("Create - Oh YEAH: " + statusCode + " - " + statusMsg);
} else {
    System.out.println("Create - Oh NO: " + statusCode + " - " + statusMsg);
}

##### Screenshot after step 4 #####

Screenshot 1: DNG says that 20 of 23 artifacts exist but actually nothing is displayed (page 1/2)

Screenshot 2: DNG only displays the newly added artifacts (page 2/2)
_______________________________________________
lyo-dev mailing list
lyo-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/lyo-dev

GIF image

GIF image

GIF image

GIF image