Example usage for javax.xml.registry.infomodel RegistryPackage addSlots

List of usage examples for javax.xml.registry.infomodel RegistryPackage addSlots

Introduction

In this page you can find the example usage for javax.xml.registry.infomodel RegistryPackage addSlots.

Prototype

void addSlots(Collection slots) throws JAXRException;

Source Link

Document

Adds more Slots to this object.

Usage

From source file:it.cnr.icar.eric.client.xml.registry.infomodel.RegistryPackageTest.java

/** Test Creation of RegistryPackage*/
public void testSubmit() throws Exception {
    // -- Create a Registry Package
    RegistryPackage pkg = getLCM().createRegistryPackage("RegistryPackage_SomeName");
    pkg.setKey(getLCM().createKey(pkgId));

    // -- Add the Slots ( a.k.a Attributes to it )
    ArrayList<Slot> slots = new ArrayList<Slot>();
    slots.add(getLCM().createSlot("TargetNamespace", "TargetNamepsace", null));
    pkg.addSlots(slots);

    // -- Save the Object
    ArrayList<RegistryPackage> pkgs = new ArrayList<RegistryPackage>();
    pkgs.add(pkg);/*from w w  w.j  a v a 2  s . com*/
    BulkResponse resp = getLCM().saveObjects(pkgs);
    System.out.println("Created Registry Package with Id " + pkgId);
    JAXRUtility.checkBulkResponse(resp);
}