Example usage for javax.xml.registry.infomodel Concept getParent

List of usage examples for javax.xml.registry.infomodel Concept getParent

Introduction

In this page you can find the example usage for javax.xml.registry.infomodel Concept getParent.

Prototype

RegistryObject getParent() throws JAXRException;

Source Link

Document

Gets the parent Concept or ClassificationScheme for this object.

Usage

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

/**
 * This constructor is to do a type-safe cast from a Concept with no parent to a scheme.
 * This has history in UDDI and we are not sure what value it has in ebXML.
 * We are implementing it as it is required by the JAXR API.
 * Needs evaluation for relevance in JAXR 2.0??
 **//*from   w  w  w .j av a2s  .c o  m*/
public ClassificationSchemeImpl(LifeCycleManagerImpl lcm, Concept concept) throws JAXRException {
    super(lcm);

    if (concept.getParent() != null) {
        throw new InvalidRequestException(JAXRResourceBundle.getInstance()
                .getString("message.error.cannot.create.concept.parent.classScheme"));
    }

    setName(concept.getName());
    setDescription(concept.getDescription());
    addClassifications(concept.getClassifications());
    addExternalIdentifiers(concept.getExternalIdentifiers());

    //??incomplete
}

From source file:it.cnr.icar.eric.client.ui.thin.RegistryObjectCollectionBean.java

private boolean isPseudoComposedObjectDirty(RegistryObjectBean bean) {
    boolean isDirty = false;
    // Check all dirty ROBs for pseudo composed objects (PCO)s. 
    // If parent id of PCO matches id of this rob passed, return 'true'
    Iterator<String> itr = registryObjectLookup.keySet().iterator();
    while (itr.hasNext()) {
        String key = itr.next();//  w ww  . j  a  va  2s .com
        RegistryObjectBean rob = registryObjectLookup.get(key);
        RegistryObject ro = rob.getRegistryObject();
        if (ro instanceof Concept && rob.isDirty()) {
            Concept concept = (Concept) ro;
            try {
                if (concept.getParent() != null) {
                    String parentId = concept.getParent().getKey().getId();
                    if (parentId.equalsIgnoreCase(bean.getId())) {
                        isDirty = true;
                    }
                }
            } catch (JAXRException ex) {
                log.error(WebUIResourceBundle.getInstance().getString("message.CouldNotGetId"));
            }
        }
    }
    return isDirty;
}