private SequenceDefinition(
      final Node sequenceRootNode,
      final String solutionPath,
      final ILogger logger,
      final IApplicationContext applicationContext) {

    // initialize this object from the contents of the xml

    this.xactionPath = solutionPath;
    this.applicationContext = applicationContext;

    // get the descriptive entries
    version = XmlDom4JHelper.getNodeText("version", sequenceRootNode); // $NON-NLS-1$
    title = XmlDom4JHelper.getNodeText("title", sequenceRootNode); // $NON-NLS-1$

    isWebService =
        "true"
            .equals(
                XmlDom4JHelper.getNodeText(
                    "web-service", sequenceRootNode)); // $NON-NLS-1$ //$NON-NLS-2$
    loggingLevel =
        Logger.getLogLevel(
            XmlDom4JHelper.getNodeText("logging-level", sequenceRootNode)); // $NON-NLS-1$

    description =
        XmlDom4JHelper.getNodeText("documentation/description", sequenceRootNode); // $NON-NLS-1$
    help = XmlDom4JHelper.getNodeText("documentation/help", sequenceRootNode); // $NON-NLS-1$
    author = XmlDom4JHelper.getNodeText("documentation/author", sequenceRootNode); // $NON-NLS-1$
    resultType =
        XmlDom4JHelper.getNodeText("documentation/result-type", sequenceRootNode); // $NON-NLS-1$
    iconPath = XmlDom4JHelper.getNodeText("documentation/icon", sequenceRootNode); // $NON-NLS-1$

    // get the input parameter definitions
    inputDefinitions = new ListOrderedMap();
    errorCode =
        SequenceDefinition.parseParameters(
            sequenceRootNode, logger, "inputs/*", inputDefinitions, null, true); // $NON-NLS-1$

    // get the ouput definitions
    outputDefinitions = new ListOrderedMap();
    errorCode =
        SequenceDefinition.parseParameters(
            sequenceRootNode, logger, "outputs/*", outputDefinitions, null, false); // $NON-NLS-1$
    if (errorCode != ISequenceDefinition.ACTION_SEQUENCE_DEFINITION_OK) {
      logger.info(
          Messages.getInstance()
              .getString(
                  "SequenceDefinition.INFO_OUTPUT_PARAMETERS_NOT_DEFINED")); //$NON-NLS-1$
    }
    // get the resource definitions
    errorCode = parseResourceDefinitions(sequenceRootNode, logger);
    if (errorCode != ISequenceDefinition.ACTION_SEQUENCE_DEFINITION_OK) {
      logger.info(
          Messages.getInstance()
              .getString(
                  "SequenceDefinition.INFO_RESOURCES_PARAMETERS_NOT_DEFINED")); //$NON-NLS-1$
    }
  }
Ejemplo n.º 2
0
  public ActionDefinition(final Node actionRootNode, final ILogger logger) {

    this.actionRootNode = actionRootNode;

    errorCode = ISequenceDefinition.ACTION_SEQUENCE_DEFINITION_OK;
    // this.sequenceData = sequenceData;

    // get the input parameter definitions
    actionInputDefinitions = new ListOrderedMap();
    actionInputMapping = new ListOrderedMap();
    errorCode =
        SequenceDefinition.parseParameters(
            actionRootNode,
            logger,
            "action-inputs/*",
            actionInputDefinitions,
            actionInputMapping,
            true); //$NON-NLS-1$

    // get the ouput definitions
    actionOutputDefinitions = new ListOrderedMap();
    actionOutputMapping = new ListOrderedMap();
    errorCode =
        SequenceDefinition.parseParameters(
            actionRootNode,
            logger,
            "action-outputs/*",
            actionOutputDefinitions,
            actionOutputMapping,
            false); //$NON-NLS-1$

    // get the resource definitions
    actionResourceMapping = new ListOrderedMap();
    if (actionRootNode.selectNodes("action-resources/*").size() > 0) { // $NON-NLS-1$
      hasActionResources = true;
      errorCode =
          SequenceDefinition.parseActionResourceDefinitions(
              actionRootNode, logger, "action-resources/*", actionResourceMapping); // $NON-NLS-1$
    }

    componentName = XmlDom4JHelper.getNodeText("component-name", actionRootNode); // $NON-NLS-1$
    String loggingLevelString =
        XmlDom4JHelper.getNodeText("logging-level", actionRootNode); // $NON-NLS-1$
    loggingLevel = Logger.getLogLevel(loggingLevelString);

    // get the component payload
    componentNode = actionRootNode.selectSingleNode("component-definition"); // $NON-NLS-1$
    if (componentNode == null) {
      componentNode = ((Element) actionRootNode).addElement("component-definition"); // $NON-NLS-1$
    }

    // TODO populate preExecuteAuditList and postExecuteAuditList
  }