use of com.twinsoft.convertigo.engine.studio.CheStudio in project convertigo by convertigo.
the class GetXpathTree method getServiceResult.
@Override
protected void getServiceResult(HttpServletRequest request, Document document) throws Exception {
HttpSession session = request.getSession();
CheStudio cheStudio = CallAction.getStudio(session);
if (cheStudio != null) {
SourcePickerViewWrap spv = cheStudio.getSourcePickerView();
if (spv != null) {
String nodeId = request.getParameter("nodeId");
Element root = document.getDocumentElement();
// Tree
Element xpahtTree = spv.getXpathTree(nodeId);
xpahtTree = (Element) document.importNode(xpahtTree, true);
root.appendChild(xpahtTree);
// xPath
String xpath = spv.getXpath(nodeId);
root.appendChild(DOMUtils.createElementWithText(document, "xpath", xpath));
// Anchor
String anchor = spv.getAnchor();
root.appendChild(DOMUtils.createElementWithText(document, "anchor", anchor));
}
}
}
use of com.twinsoft.convertigo.engine.studio.CheStudio in project convertigo by convertigo.
the class ModifyXPathText method getServiceResult.
@Override
protected void getServiceResult(HttpServletRequest request, Document document) throws Exception {
HttpSession session = request.getSession();
CheStudio cheStudio = CallAction.getStudio(session);
if (cheStudio != null) {
SourcePickerViewWrap spv = cheStudio.getSourcePickerView();
if (spv != null) {
String xpath = request.getParameter("xpath").trim();
spv.modifyXpathText(xpath);
}
}
}
Aggregations