Uploaded image for project: 'Oozie'
  1. Oozie
  2. OOZIE-580

use xml element to handle string escape when configure evaluator

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • pre-Apache
    • None
    • None

    Description

      Instead of using string value to do escape, xml element is able to do it and also avoid escaping legit character at XML element, such as <![CDATA[]]>.

      public static void configureEvaluator(ELEvaluator evaluator, WorkflowJobBean workflow, WorkflowActionBean action) {
      evaluator.setVariable(WORKFLOW, workflow);
      evaluator.setVariable(ACTION, action);
      for (Map.Entry<String, String> entry : workflow.getWorkflowInstance().getConf()) {
      if (ParamChecker.isValidIdentifier(entry.getKey()))

      { String value = entry.getValue().trim(); // escape the characters for xml value = XmlUtils.escapeCharsForXML(value); evaluator.setVariable(entry.getKey().trim(), value); }

      }
      try

      { evaluator.setVariable(ACTION_PROTO_CONF, new XConfiguration(new StringReader(workflow.getProtoActionConf()))); }

      catch (IOException ex)

      { throw new RuntimeException("It should not happen", ex); }

      }

      Attachments

        Activity

          People

            angeloh Angelo K. Huang
            angeloh Angelo K. Huang
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: