use of org.dom4j.Node in project GenericKnimeNodes by genericworkflownodes.
the class GalaxyNodeConfigurationReader method readInPort.
private Port readInPort(Node portnode) throws Exception {
Port port = new Port();
port.setOptional(true);
Node n = DOMHelper.selectSingleNode(portnode, "label");
String portdescr = n.valueOf("text()");
port.setDescription(portdescr);
String extension = DOMHelper.valueOf(portnode, "@format");
port.addMimeType(extension);
String portname = DOMHelper.valueOf(portnode, "@name");
port.setName(portname);
String optional = DOMHelper.valueOf(portnode, "@optional");
if (optional.equals("false")) {
port.setOptional(false);
}
return port;
}
use of org.dom4j.Node in project GenericKnimeNodes by genericworkflownodes.
the class GalaxyNodeConfigurationReader method readParameters.
private void readParameters() throws Exception {
List<Node> nodes = DOMHelper.selectNodes(doc, "/tool/inputs/param[@type='text']");
for (Node n : nodes) {
processParameter(n);
}
nodes = DOMHelper.selectNodes(doc, "/tool/inputs/param[@type='float']");
for (Node n : nodes) {
processParameter(n);
}
nodes = DOMHelper.selectNodes(doc, "/tool/inputs/param[@type='boolean']");
for (Node n : nodes) {
processParameter(n);
}
nodes = DOMHelper.selectNodes(doc, "/tool/inputs/param[@type='integer']");
for (Node n : nodes) {
processParameter(n);
}
nodes = DOMHelper.selectNodes(doc, "/tool/inputs/param[@type='select']");
for (Node n : nodes) {
processParameter(n);
}
}
use of org.dom4j.Node in project GenericKnimeNodes by genericworkflownodes.
the class GalaxyNodeConfigurationReader method readPorts.
private void readPorts() throws Exception {
List<Node> nodes = DOMHelper.selectNodes(doc, "/tool/inputs/param[@type='data']");
for (Node n : nodes) {
Port port = readInPort(n);
inports.add(port);
}
nodes = DOMHelper.selectNodes(doc, "/tool/outputs/data");
for (Node n : nodes) {
Port port = readOutPort(n);
outports.add(port);
}
config.setInports(inports.toArray(new Port[inports.size()]));
config.setOutports(outports.toArray(new Port[outports.size()]));
}
use of org.dom4j.Node in project summer-mis by cn-cerc.
the class AlipayJs method query_timestamp.
// 用于防钓鱼,调用接口query_timestamp来获取时间戳的处理函数 注意:远程解析XML出错,与服务器是否支持SSL等配置有关
public String query_timestamp() throws MalformedURLException, DocumentException, IOException {
String strUrl = AlipayConfig.ALIPAY_GATEWAY_NEW + "service=query_timestamp&partner=" + this.partner + "&_input_charset" + AlipayConfig.input_charset;
StringBuffer result = new StringBuffer();
SAXReader reader = new SAXReader();
Document doc = reader.read(new URL(strUrl).openStream());
List<Node> nodeList = doc.selectNodes("//alipay/*");
for (Node node : nodeList) {
if (node.getName().equals("is_success") && node.getText().equals("T")) {
List<Node> nodeList1 = doc.selectNodes("//response/timestamp/*");
for (Node node1 : nodeList1) {
result.append(node1.getText());
}
}
}
return result.toString();
}
use of org.dom4j.Node in project GenericKnimeNodes by genericworkflownodes.
the class PluginXMLTemplate method registerNode.
/**
* Registers the given node (clazz, path) in the plugin.xml file.
*
* @param clazz
* @param path
*/
public void registerNode(String clazz, String path) {
LOGGER.info("registering Node " + clazz);
registerPath(path);
Node node = doc.selectSingleNode("/plugin/extension[@point='org.knime.workbench.repository.nodes']");
Element elem = (Element) node;
elem.addElement("node").addAttribute("factory-class", clazz).addAttribute("category-path", path);
}
Aggregations