You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@oozie.apache.org by "Harsh J (Commented) (JIRA)" <ji...@apache.org> on 2012/01/02 12:36:30 UTC
[jira] [Commented] (OOZIE-580) use xml element to handle string
escape when configure evaluator
[ https://issues.apache.org/jira/browse/OOZIE-580?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13178357#comment-13178357 ]
Harsh J commented on OOZIE-580:
-------------------------------
This was committed as well. Please mark as resolved :)
> use xml element to handle string escape when configure evaluator
> ----------------------------------------------------------------
>
> Key: OOZIE-580
> URL: https://issues.apache.org/jira/browse/OOZIE-580
> Project: Oozie
> Issue Type: Improvement
> Reporter: Angelo K. Huang
> Assignee: Angelo K. Huang
>
> 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);
> }
> }
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira