Package edu.indiana.extreme.lead.metadata

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


      String uid = this.configuration.getUser();
      String project = this.configuration.getProject();

      if (redeploy) {
        LEADresourceDocument leadResourceDocument = this.stub
            .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.
      }

      String workflowTemplatesCollectionID = stub.getWorkflowTemplateCollectionId(uid, project);
      if( null == workflowTemplatesCollectionID){
        throw new MyLeadException("Template collection not found for the project :"+project+" for user :"+uid);
      }
      String name = workflow.getName();
      String description = workflow.getDescription();
      LEADresourceDocument resourceDocument = createResourceDocument(
          templateID, uid, name, description);

      // TODO change this to true in the future.
      boolean assignNewResourceID = false;
      String parentResourceID = workflowTemplatesCollectionID;
//
//      LEADResourceType resourceType = LEADResourceType.Factory
//          .newInstance();
//      OtheridinfoType newWorkflow = resourceType.addNewWorkflow();

      String resourceID =
        this.stub.createCollection(uid,  resourceDocument.getLEADresource(), parentResourceID,
          assignNewResourceID);
      return resourceID;
    } catch (RuntimeException e) {
      throw new MyLeadException(e);
    }
View Full Code Here


  public URI load(String resourceID) throws MyLeadException {
    try {
      connect();

      String uid = this.configuration.getUser();
      LEADresourceDocument resourceDocument = this.stub.getCollection(
          uid, resourceID);
      String templateID = getWorkflowTemplateID(resourceDocument);
      return new URI(templateID);
    } catch (URISyntaxException e) {
      String message = "Workflow template ID is in wrong format.";
View Full Code Here

  public URI loadWorkflow(String resourceID) throws MyLeadException {
    try {
      connect();

      String uid = this.configuration.getUser();
      LEADresourceDocument resourceDocument = this.stub.getCollection(
          uid, resourceID);
      String templateID = getWorkflowTemplateID(resourceDocument);
      return new URI(templateID);
    } catch (URISyntaxException e) {
      String message = "Workflow template ID is in wrong format.";
View Full Code Here

   * @return The LEADMetadata
   */
  private LEADresourceDocument createResourceDocument(URI templateID,
      String uid, String name, String description) {

    LEADresourceDocument leadResourceDoc = null;
    try {
    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);
View Full Code Here

        MinimalLEADMetadata workflowTemplatesMetadata = new MinimalLEADMetadata(
                FAKE_USER_ID, MyLead.WORKFLOW_TEMPLATES_COLLECTION,
                "Workflow templates collection description");
        workflowTemplatesMetadata.setResourceId("Unknown");
        LEADresourceDocument leadResourceDoc;

    leadResourceDoc = LEADresourceDocument.Factory.parse(workflowTemplatesMetadata.toString());

        String workflowTemplatesCollectionID = stub.createCollection(
                FAKE_USER_ID, leadResourceDoc.getLEADresource(), projectID,
                true);
        logger.info("workflowTemplatesCollectionID: "
                + workflowTemplatesCollectionID);
       
    } catch (XmlException e) {
View Full Code Here

        String description = workflow.getDescription();

        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

      CreateTopLevelObjectsRequestType params = inputMsg
          .addNewCreateProjectsRequest();
      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

            collMetadata.setResourceId("Unknown");
           
          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

      List<ObjectResponseType> objectResponseList = response
          .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

TOP

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

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.