Example usage for javax.xml.registry.infomodel Association setTargetObject

List of usage examples for javax.xml.registry.infomodel Association setTargetObject

Introduction

In this page you can find the example usage for javax.xml.registry.infomodel Association setTargetObject.

Prototype

void setTargetObject(RegistryObject targetObject) throws JAXRException;

Source Link

Document

Sets the Object that is the target of this Association.

Usage

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

/**
 * Create an Association instance using the specified parameters. The
 * sourceObject is left null and will be set when the Association is added
 * to a RegistryObject./*from  w  w w  .  j a  v  a2  s  .c om*/
 * <p>
 * Note that for a UDDI provider an Association may only be created between
 * Organizations.
 * 
 * <p>
 * <DL>
 * <DT><B>Capability Level: 0 </B>
 * </DL>
 * 
 */
public Association createAssociation(RegistryObject targetObject, Concept associationType)
        throws JAXRException {
    Association ass = createAssociation(associationType);
    ass.setTargetObject(targetObject);

    return ass;
}

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

/**
* This method do Intialization for Relationship Operation and also 
* determine what kind of Relation(Reference and Assocation) should be establish 
* between two Registry Objects.  /*w  w  w  . j  av  a  2 s  . c  o  m*/
* 
* @param none
* @return String
*/
@SuppressWarnings("unused")
private String initAssocation() {
    ArrayList<Object> associationList = new ArrayList<Object>();
    String sourceType = null;
    String status = "failure";
    try {
        @SuppressWarnings("static-access")
        BusinessLifeCycleManagerImpl blcm = RegistryBrowser.getInstance().getBLCM();
        Association assoc = (Association) blcm.createObject(LifeCycleManager.ASSOCIATION);
        VersionInfoType vit = BindingUtility.getInstance().rimFac.createVersionInfoType();
        ((RegistryObjectImpl) assoc).setVersionInfo(vit);
        if (pivotalRegistryObjectBean.size() == 2) {
            if (this.referenceSourceCode != null) {
                if (this.referenceSourceCode
                        .equals(((RegistryObjectBean) pivotalRegistryObjectBean.get(0)).getId())) {
                    sourceType = "source";
                } else {
                    sourceType = "target";
                }
            } else {
                sourceType = "source";
            }
        }

        Concept concept = RegistryBrowser.getBQM()
                .findConceptByPath("/" + CanonicalSchemes.CANONICAL_CLASSIFICATION_SCHEME_LID_AssociationType
                        + "/AccessControlPolicyFor");
        assoc.setSourceObject(this.relationshipBean.getSourceRegistryObject());
        assoc.setTargetObject(this.relationshipBean.getTargetRegistryObject());
        assoc.setAssociationType(concept);
        RegistryObjectBean rob = new RegistryObjectBean(null, assoc);
        rob.initRelatedObjects();
        currentRegistryObject = rob;
        this.clearRelationObjects();
        status = "relationSuccessful";
    } catch (Exception ex) {
        log.error(WebUIResourceBundle.getInstance()
                .getString("message.FailedDuringCreationOfAssociationUIInitOperation"), ex);
        RegistryBrowser.getInstance()
                .setErrorMessage(WebUIResourceBundle.getInstance().getString("errorAssociationLcm"));
    }
    return status;
}