Перевод цикла неплохих статей пол Mercurial:
http://habrahabr.ru/post/108658/
GUI
TortoiseHg
http://ratfactor.com/mercurial-named-branches
http://habrahabr.ru/post/108658/
GUI
TortoiseHg
http://ratfactor.com/mercurial-named-branches
| Port Name | Default Value | Files | ||||
|---|---|---|---|---|---|---|
| Application Server | Administrative Agent | Job Manager | Secure Proxy Server | Administrative Subsystem | ||
| Administrative Console Port (WC_adminhost) | 9060 | 9060 | 9960 | ---- | ---- | serverindex.xml and virtualhosts.xml |
| Administrative Console Secure Port (WC_adminhost_secure) | 9043 | 9043 | 9943 | ---- | ---- | |
| HTTP Transport Port (WC_defaulthost) | 9080 | ---- | ---- | 80 | ---- | |
| HTTPS Transport Secure Port (WC_defaulthost_secure) | 9443 | ---- | ---- | 443 | ---- | |
| Bootstrap Port (BOOTSTRAP_ADDRESS) | 2809 | 9807 | 9808 | ---- | ---- | serverindex.xml |
| Cell Discovery Address (CELL_DISCOVERY_ADDRESS) | ---- | ---- | ---- | ---- | ---- | |
| CSIV2 Client Authentication Listener Port (CSIV2_SSL_MUTUALAUTH_LISTENER_ADDRESS) | 9402 | 9402 | 9402 | ---- | ---- | |
| CSIV2 Server Authentication Listener Port (CSIV2_SSL_SERVERAUTH_LISTENER_ADDRESS) | 9403 | 9403 | 9403 | ---- | ---- | |
| High Availability Manager Communication Port (DCS_UNICAST_ADDRESS) | 9353 | ---- | ---- | ---- | ---- | |
| Internal JMS Server Port (JMSSERVER_SECURITY_PORT) | 5557 | ---- | ---- | ---- | ---- | |
| IPC Connector Port (IPC_CONNECTOR_ADDRESS) | 9633 | 9630 | 9631 | 9633 | 9634 | |
| MQ Transport Port (SIB_MQ_ENDPOINT_ ADDRESS) | 5558 | ---- | ---- | ---- | ---- | |
| MQ Transport Secure Port (SIB_MQ_ENDPOINT_SECURE_ADDRESS) | 5578 | ---- | ---- | ---- | ---- | |
| ORB Listener Port (ORB_LISTENER_ADDRESS) | 9100 | 9098 | 9099 | ---- | ---- | serverindex.xml |
| RMI Connector Port (RMI_CONNECTOR_ADDRESS) | ---- | ---- | ---- | ---- | 9810 | |
| JSR 160 RMI Connector Port (JSR160RMI_CONNECTOR_ADDRESS) | ---- | ---- | ---- | ---- | 9811 | |
| SAS_SSL_SERVERAUTH_LISTENER_ADDRESS | 9401 | 9401 | 9401 | ---- | ---- | |
| Service Integration Port (SIB_ENDPOINT_ADDRESS) | 7276 | ---- | ---- | ---- | ---- | |
| Service Integration Secure Port (SIB_ENDPOINT_SECURE_ADDRESS) | 7286 | ---- | ---- | ---- | ---- | |
| SIP Container Port (SIP_DEFAULTHOST) | 5060 | ---- | ---- | 5060 | ---- | |
| SIP Container Secure Port (SIP_DEFAULTHOST_SECURE) | 5061 | ---- | ---- | 5061 | ---- | |
| SOAP Connector Port (SOAP_CONNECTOR_ADDRESS) | 8880 | 8877 | 8876 | ---- | 8881 | |
| IBM® HTTP Server Port | 80 | ---- | ---- | ---- | ---- | virtualhosts.xml, plugin-cfg.xml, and web_ server_ root/conf/ httpd.conf |
| IBM HTTPS Server Administration Port | 8008 | ---- | ---- | ---- | ---- | web_ server_ root/conf/ admin.conf |
public String processByJavaAdapter(String data, FreeMarkerVars[] reportContext, String className) throws Exception
{
..
}
Если строка XML, то возвращается обертка в CDATA:
<ns2:processByJavaAdapterResponse xmlns:ns2="http://wsi.reg.sitronics.com/">
</ns2:processByJavaAdapterResponse>
<return><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<error>
<faultcode>Нет связи с сервером</faultcode>
<fault></fault>
</error>]]></return>
<ns2:processByJavaAdapterResponse xmlns:ns2="http://wsi.reg.sitronics.com/">
<return><?xml version="1.0" encoding="UTF-8"?>
<faultcode>Нет связи с сервером</faultcode></return>
</ns2:processByJavaAdapterResponse>
import org.apache.xpath.XPathAPI;
...
String respBody = "....";// XML
Element root = getXmlRoot(respBody);
Node requestIdRefNode = getXPath(root, "//*[local-name() = 'RequestIdRef']");
requestIdRefNode.setTextContent("New value");
public static final Element getXmlRoot(String xmlData) throws Exception
{
// logger.info("Trying get root from: " + xmlData);
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true);
DocumentBuilder builder = factory.newDocumentBuilder();
return builder.parse(new InputSource(new StringReader(xmlData))).getDocumentElement();
}
public static final Node getXPath(Element xmlData, String path) throws Exception
{
Node nodes = null;
nodes = XPathAPI.selectSingleNode(xmlData,
String.format("%s", path));
return nodes;
}
Альтернативный способ, без использование XPathAPI:
public static Document getXMLDocument(String xmlSource) throws Exception
{
DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = domFactory.newDocumentBuilder();
return builder.parse(new InputSource(new StringReader(xmlSource)));
}
public static Node getXMLTagContent(Document document, String nodeExpression) throws XPathExpressionException
{
Node node = null;
XPathFactory factory = XPathFactory.newInstance();
XPath xpath = factory.newXPath();
XPathExpression expression = xpath.compile(nodeExpression);
if (document != null)
node = (Node) expression.evaluate(document, XPathConstants.NODE);
return node;
}