Querying a Module

Once you have instantiated an OSLC client, you can use the GetModule class to request the content of a DOORS Next Generation Module and GetModuleContext to get the hierarchy of its requirements:

	OslcClient client = OslcClients.jazzForm(new UsernamePasswordCredentials("myUser", "myPassword")).create();
	
	URI moduleUri = URI.create("https://myServer:9443/rm/myModule");
	Module module = new GetModule(client, collectionUri).get();
	
	System.out.println("Title: " + module.getTitle());
	System.out.println("Identifier: " + module.getIdentifier());
	
	System.out.println("Uses: ");
	for (URI requirementUri : module.getUses()) {
		System.out.println("- " + requirementUri);
	}
	
	System.out.println("Module structure: ");
	ModuleContext context = new GetModuleContext(client, moduleUri).call();
	for (ModuleContextBinding binding : context.getRoots()) {
		System.out.println("Root requirement: " + "[" + binding.getIdentifier() + "] " + binding.getSection() + " " + binding.getTitle());
		// then iterate on child requirements by calling: context.getChildren(binding)
	}

Related tasks
Module

Related tasks
Creating an OSLC client
Using OSLC Configurations
Inserting a Requirement in a Module

Related reference
API Reference