Package edu.indiana.extreme.lead.metadata

Examples of edu.indiana.extreme.lead.metadata.LEADResourceType


            .getCollection(uid, templateID.toString());
        if (leadResourceDocument != null) {
          // No need to create a new collection because it's already
          // there.

          LEADResourceType leadResource = leadResourceDocument
              .getLEADresource();
          String resourceID = leadResource.getResourceID();
          return resourceID;
        }

        // It comes here when the workflow template is only in GPEL, not
        // in myLEAD.
View Full Code Here


    MinimalLEADMetadata metadata = new MinimalLEADMetadata(uid, name, description);
        metadata.setResourceId(templateID.toString());      

    leadResourceDoc = LEADresourceDocument.Factory.parse(metadata.toString());
 
        LEADResourceType leadResourceType = leadResourceDoc.getLEADresource();
       
    DataType data = leadResourceType.getData();
    IdinfoBase idInfo = data.getIdinfo();
    KeywordsType keywords = idInfo.getKeywords();
    ThemeType leadProjectThema = keywords.getThemeArray(0);
    // This will get "leadproject.org";
    leadProjectThema.addThemekey("workflow");
View Full Code Here

    return leadResourceDoc;
  }

  private String getWorkflowTemplateID(LEADresourceDocument resourceDocument) {
    // Check if the templateID is set in the metadata.
    LEADResourceType resource = resourceDocument.getLEADresource();
    DataType data = resource.getData();
    IdinfoBase idInfo = data.getIdinfo();
    KeywordsType keywords = idInfo.getKeywords();
    ThemeType[] themes = keywords.getThemeArray();

    String templateID = null;
    for (ThemeType theme : themes) {
      String themekt = theme.getThemekt();
      if (WORKFLOW_TEMPLATE_ID_THEMEKT.equals(themekt)) {
        // Has only one key.
        templateID = theme.getThemekeyArray(0);
        break;
      }
    }

    if (templateID == null) {
      logger.warning("The LEAD metadata doesn't have workflow ID."
          + " Use resource ID as workflow ID instead.");
      // This happends with the metadata created by XBaya older than
      // 2.5.5.
      String resourceID = resource.getResourceID();
      templateID = resourceID;
    }
    return templateID;
  }
View Full Code Here

        MinimalLEADMetadata metadata = new MinimalLEADMetadata(uid, name, description);
        metadata.setResourceId(templateID);      

        LEADresourceDocument leadResourceDocument = LEADresourceDocument.Factory.parse(metadata.toString());
 
        LEADResourceType leadResourceType = leadResourceDocument.getLEADresource();
       
        String leadResourceString = leadResourceDocument.toString();

        logger.info("leadResourceString: " + leadResourceString);

        LEADresourceDocument leadResourceDocument2 = LEADresourceDocument.Factory
                .parse(leadResourceString);
        leadResourceDocument2.validate();
        LEADResourceType leadResource2 = leadResourceDocument2
                .getLEADresource();
        String templateID2 = leadResource2.getResourceID();
        // Compare if the read templateID is same as the original one.
        assertEquals(templateID, templateID2);
    }
View Full Code Here

      AgentPortType stub = this.createStub(uid);
      TopLevelObjectType topLevelObjectType = params.addNewObjectInfo();
      topLevelObjectType.setAssignNewResourceID(assignNewResourceID);
      LEADresourceDocument leadResourceDoc = LEADresourceDocument.Factory
          .parse(leadResource);
      LEADResourceType leadResourceType = leadResourceDoc
          .getLEADresource();
      topLevelObjectType.setLEADresource(leadResourceType);
      OperationResponseDocument outputMsg = stub.createProjects(inputMsg);
      OperationResponseType outputType = outputMsg.getOperationResponse();
      StatusEnumType.Enum statusType = outputType.getStatus();
View Full Code Here

           
          CreateCollectionsRequestDocument createColl = CreateCollectionsRequestDocument.Factory.newInstance();
            CreateCollectionsRequestType collParams = createColl.addNewCreateCollectionsRequest();
            
            LEADresourceDocument workflowCollResourceDoc = LEADresourceDocument.Factory.parse(collMetadata.toString());
            LEADResourceType workflowCollResourceType = workflowCollResourceDoc.getLEADresource();
            
            CollectionType collectionType = collParams.addNewCollectionInfo();
            collectionType.setAssignNewResourceID(true);
            collectionType.setParentID(projectId);
            
View Full Code Here

          .getObjectResponseList();
      if (objectResponseList.size() > 0) {
        ObjectResponseType collection = objectResponseList.get(0);
        LEADresourceDocument leadDoc = LEADresourceDocument.Factory
            .newInstance();
        LEADResourceType leadResource = collection.getLEADresource();
        leadDoc.setLEADresource(leadResource);
        return leadDoc;
      } else {
        throw new MyLeadException("Collection not found for id :"
            + collectionID);
View Full Code Here

        .addNewCollectionInfo();

    MinimalLEADMetadata minimalLEADMetadata = new MinimalLEADMetadata(
        userDN, experimentName, experimentDescription);

    LEADResourceType leadResource = minimalLEADMetadata
        .getLeadResourceDoc().getLEADresource();
    ThemeType theme = leadResource.addNewData().addNewIdinfo()
        .addNewKeywords().addNewTheme();

    theme.addNewThemekey().setStringValue(instanceID);
    theme.setThemekt("ROOT_WORKFLOW_ID");

    theme = leadResource.addNewData().addNewIdinfo().addNewKeywords()
        .addNewTheme();

    theme.addNewThemekey().setStringValue(templateID);
    theme.setThemekt("ROOT_WORKFLOW_INSTANCE_ID");
View Full Code Here

TOP

Related Classes of edu.indiana.extreme.lead.metadata.LEADResourceType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.