Example usage for javax.xml.registry.infomodel ExternalIdentifier getIdentificationScheme

List of usage examples for javax.xml.registry.infomodel ExternalIdentifier getIdentificationScheme

Introduction

In this page you can find the example usage for javax.xml.registry.infomodel ExternalIdentifier getIdentificationScheme.

Prototype

ClassificationScheme getIdentificationScheme() throws JAXRException;

Source Link

Document

Gets the ClassificationScheme that is used as the identification scheme for identifying this object.

Usage

From source file:it.cnr.icar.eric.client.ui.swing.graph.JBGraph.java

/**
 * DOCUMENT ME!/*from  w  ww .  j a v  a  2 s. c o  m*/
 *
 * @param cell DOCUMENT ME!
 * @param externalIdentifier DOCUMENT ME!
 *
 * @return DOCUMENT ME!
 */
private ArrayList<DefaultGraphCell> showRelatedObjects(JBGraphCell cell,
        ExternalIdentifier externalIdentifier) {
    ArrayList<DefaultGraphCell> relatedCells = new ArrayList<DefaultGraphCell>();

    if (externalIdentifier == null) {
        return relatedCells;
    }

    try {
        //scheme
        ClassificationScheme scheme = externalIdentifier.getIdentificationScheme();
        JBGraphCell newCell = addRelatedObject(cell, scheme, new Rectangle(0, 0, 50, 50),
                "identification scheme", false);
        relatedCells.add(newCell);
    } catch (JAXRException e) {
        RegistryBrowser.displayError(e);
    }

    return relatedCells;
}

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

private String checkExternalIdentifier(String status, RegistryObject ro) {
    StringBuffer eiFields = new StringBuffer();
    ExternalIdentifier tempEI = (ExternalIdentifier) ro;
    try {//from  ww  w  . j  a  v a 2s  .c o m
        if (tempEI.getIdentificationScheme() == null) {
            status = "failure";
            eiFields.append(WebUIResourceBundle.getInstance().getString("classificationScheme"));
        }

        if (tempEI.getValue() == null || tempEI.getValue().length() <= 0) {
            status = "failure";
            if (eiFields.toString().length() != 0) {
                eiFields.append("," + WebUIResourceBundle.getInstance().getString("classificationValueLabel"));
            } else {
                eiFields.append(WebUIResourceBundle.getInstance().getString("classificationValueLabel"));
            }
        }

        if (eiFields.toString().length() != 0) {
            append(WebUIResourceBundle.getInstance().getString("message.CouldNotCreateExternalIdentifier")
                    + eiFields.toString());
            return status;
        }
    } catch (Throwable t) {
        status = "failure";
        log.error(
                WebUIResourceBundle.getInstance().getString("message.FaildToValidateExternalIdentifierFields"),
                t);
        append(WebUIResourceBundle.getInstance().getString("validationEIROError") + t.getLocalizedMessage());
    }
    return status;
}

From source file:org.apache.ws.scout.util.ScoutJaxrUddiHelper.java

/**
  * Adds the objects identifiers from JAXR's external identifier collection
  * //from w w  w . j ava  2s  .  c o m
  * @param identifiers external identifiers to turn into identifiers
  * @throws JAXRException
  */
public static IdentifierBag getIdentifierBagFromExternalIdentifiers(Collection identifiers)
        throws JAXRException {
    try {
        if (identifiers == null || identifiers.size() == 0)
            return null;

        // Identifiers
        IdentifierBag ibag = objectFactory.createIdentifierBag();
        Iterator iditer = identifiers.iterator();
        while (iditer.hasNext()) {
            ExternalIdentifier extid = (ExternalIdentifier) iditer.next();
            if (extid != null) {
                KeyedReference keyr = objectFactory.createKeyedReference();
                ibag.getKeyedReference().add(keyr);

                InternationalStringImpl iname = (InternationalStringImpl) ((RegistryObject) extid).getName();
                String value = extid.getValue();
                ClassificationScheme scheme = extid.getIdentificationScheme();

                String name = iname.getValue();
                if (name != null)
                    keyr.setKeyName(name);

                if (value != null)
                    keyr.setKeyValue(value);

                if (scheme != null) {
                    Key key = scheme.getKey();
                    if (key != null && key.getId() != null)
                        keyr.setTModelKey(key.getId());
                }
            }
        }
        return ibag;
    } catch (Exception ud) {
        throw new JAXRException("Apache JAXR Impl:", ud);
    }
}