/** * Create synapse xpath expression * {} type user input is used to create real xpath expression * * @param elem the element * @param key xpath expression with {} * @return SynapseXpath */ public SynapseXPath createSynXpath(OMElement elem, String key) { //derive XPath Expression from key String xpathExpr = key.trim().substring(1, key.length() - 1); SynapseXPath synapseXPath = null; try { synapseXPath = SynapseXPathFactory.getSynapseXPath(elem, xpathExpr); } catch (JaxenException e) { handleException("Can not create Synapse Xpath from given key"); } return synapseXPath; }
/** * Create synapse xpath expression * {} type user input is used to create real xpath expression * * @param elem the element * @param key xpath expression with {} * @return SynapseXpath */ public SynapseXPath createSynXpath(OMElement elem, String key) { //derive XPath Expression from key String xpathExpr = key.trim().substring(1, key.length() - 1); SynapseXPath synapseXPath = null; try { synapseXPath = SynapseXPathFactory.getSynapseXPath(elem, xpathExpr); } catch (JaxenException e) { handleException("Can not create Synapse Xpath from given key"); } return synapseXPath; }
private static Map<String, Object> getParameters(OMElement elem) { Iterator params = elem.getChildrenWithName(PARAMETER_Q); Map<String, Object> parameters = new HashMap<String, Object>(); while (params.hasNext()) { Object o = params.next(); if (o instanceof OMElement) { OMElement prop = (OMElement) o; OMAttribute paramName = prop.getAttribute(NAME_Q); String paramValue = prop.getText(); OMAttribute paramExpression = prop.getAttribute(EXPRESSION_Q); if (paramName != null) { if (paramExpression != null) { try { SynapseXPath expression = SynapseXPathFactory.getSynapseXPath(prop, paramExpression.getAttributeValue()); parameters.put(paramName.getAttributeValue(), expression); } catch (JaxenException e) { handleException("Error while creating expression " + e.getMessage()); } } else if (paramValue != null) { parameters.put(paramName.getAttributeValue(), paramValue); } else { handleException("Invalid MessageStore parameter - Parameter must have a value or an expression "); } } else { handleException("Invalid MessageStore parameter - Parameter must have a name "); } } } return parameters; }
protected Endpoint createEndpoint(OMElement epConfig, boolean anonymousEndpoint, Properties properties) { ResolvingEndpoint resolvingEndpoint = new ResolvingEndpoint(); String name = epConfig.getAttributeValue(new QName("name")); if (name != null) { resolvingEndpoint.setName(name); } try { resolvingEndpoint.setKeyExpression( SynapseXPathFactory.getSynapseXPath(epConfig, ATTR_KEY_EXPRESSION)); } catch (JaxenException e) { handleException("Couldn't build the ResolvingEndpoint, unable to set " + "the key-expression XPath", e); } // process the parameters processProperties(resolvingEndpoint, epConfig); return resolvingEndpoint; } }
protected Endpoint createEndpoint(OMElement epConfig, boolean anonymousEndpoint, Properties properties) { ResolvingEndpoint resolvingEndpoint = new ResolvingEndpoint(); String name = epConfig.getAttributeValue(new QName("name")); if (name != null) { resolvingEndpoint.setName(name); } try { resolvingEndpoint.setKeyExpression( SynapseXPathFactory.getSynapseXPath(epConfig, ATTR_KEY_EXPRESSION)); } catch (JaxenException e) { handleException("Couldn't build the ResolvingEndpoint, unable to set " + "the key-expression XPath", e); } // process the parameters processProperties(resolvingEndpoint, epConfig); return resolvingEndpoint; } }
prop.setExpression(SynapseXPathFactory.getSynapseXPath( propEle, MediatorProperty.ATT_EXPR_Q));
if (xpath != null) { try { xp = SynapseXPathFactory.getSynapseXPath(paramElt, ATT_EXPRN);
if (xpath != null) { try { action.setXpath(SynapseXPathFactory.getSynapseXPath(actionElement, xpath_Q)); } catch (JaxenException e) { handleException("Error while parsing the XPath expression: " + xpath, e);
if (xpath != null) { try { xp = SynapseXPathFactory.getSynapseXPath(paramElt, ATT_EXPRN);
} else { try { property.setExpression(SynapseXPathFactory.getSynapseXPath(element, ATT_EXPRN)); } catch (JaxenException e) { throw new SynapseException("Invalid expression attribute in " + element.getLocalName(), e);
try { switchMediator.setSource(SynapseXPathFactory.getSynapseXPath(elem, ATT_SOURCE));
SynapseXPath xpath; try { xpath = SynapseXPathFactory.getSynapseXPath(child, ATT_EXPRN); pojoMediator.addMessageSetterProperty(propName, xpath); } catch (JaxenException e) {
try { transformMediator.setSourceXPathString(attSource.getAttributeValue()); transformMediator.setSource(SynapseXPathFactory.getSynapseXPath(elem, ATT_SOURCE));
} else { try { arg.setExpression(SynapseXPathFactory.getSynapseXPath(argElem, ATT_EXPRN)); } catch (JaxenException e) { handleException("Invalid XPath expression is provided for " +
try { transformMediator.setSourceXPathString(attSource.getAttributeValue()); transformMediator.setSource(SynapseXPathFactory.getSynapseXPath(elem, ATT_SOURCE));
if (xpathAttr != null && xpathAttr.getAttributeValue() != null) { try { source.setXpath(SynapseXPathFactory.getSynapseXPath(sourceEle, ATT_XPATH)); } catch (JaxenException e) { handleException("Invalid XPath expression: " + xpathAttr);
if (expression != null) { try { mediator.setExpression(SynapseXPathFactory.getSynapseXPath(elem, ATT_EXPRN)); } catch (JaxenException e) {
try { mediator.setCorrelateExpression( SynapseXPathFactory.getSynapseXPath(corelateOn, EXPRESSION_Q)); } catch (JaxenException e) { handleException("Unable to load the corelate XPATH expression", e); try { mediator.setAggregationExpression( SynapseXPathFactory.getSynapseXPath(onComplete, EXPRESSION_Q)); } catch (JaxenException e) { handleException("Unable to load the aggregating XPATH", e);
if (expression != null) { try { mediator.setExpression(SynapseXPathFactory.getSynapseXPath(elem, ATT_EXPRN)); } catch (JaxenException e) { handleException("Unable to build the IterateMediator. " + "Invalid XPATH " +
if (xpathAttr != null && xpathAttr.getAttributeValue() != null) { try { target.setXpath(SynapseXPathFactory.getSynapseXPath(sourceEle, ATT_XPATH)); } catch (JaxenException e) { handleException("Invalid XPath expression: " + xpathAttr);