use of com.twinsoft.convertigo.engine.studio.CheStudio in project convertigo by convertigo.
the class EvaluateXpath 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();
try {
Document doc = XpathEvaluatorCompositeWrap.getXpathData(spv.getDom(), xpath);
Element xPathTree = TwsDomTreeWrap.getTree2(doc, doc.getDocumentElement(), "xpath_tree");
xPathTree = (Element) document.importNode(xPathTree, true);
document.getDocumentElement().appendChild(xPathTree);
} catch (Exception e) {
}
}
}
}
use of com.twinsoft.convertigo.engine.studio.CheStudio in project convertigo by convertigo.
the class SetStepSourceDefinition method getServiceResult.
@Override
protected void getServiceResult(HttpServletRequest request, Document document) throws Exception {
HttpSession session = request.getSession();
CheStudio cheStudio = CallAction.getStudio(session);
Element root = document.getDocumentElement();
if (cheStudio != null) {
SourcePickerViewWrap spv = cheStudio.getSourcePickerView();
if (spv != null) {
// Retrieve the StepSource definition
String qname = request.getParameter("qname");
DatabaseObject dbo = Engine.theApp.databaseObjectsManager.getDatabaseObjectByQName(qname);
StepSourceWrap ssw = (StepSourceWrap) spv.getDragData();
// Update step source definition
if (com.twinsoft.convertigo.engine.admin.services.studio.sourcepicker.CanCreateSource.canCreateSource(dbo, ssw)) {
XMLVector<String> sourceDefinition = new XMLVector<>(2);
sourceDefinition.add(ssw.getPriority());
sourceDefinition.add(ssw.getXpath());
IStepSourceContainer stepSourceContainer = (IStepSourceContainer) dbo;
stepSourceContainer.setSourceDefinition(sourceDefinition);
root.appendChild(new SetPropertyResponse("sourceDefinition").toXml(document, qname));
}
}
}
}
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);
}
}
}
use of com.twinsoft.convertigo.engine.studio.CheStudio in project convertigo by convertigo.
the class CanCreateSource 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 qname = request.getParameter("qname");
DatabaseObject dbo = Engine.theApp.databaseObjectsManager.getDatabaseObjectByQName(qname);
StepSourceWrap ssw = (StepSourceWrap) spv.getDragData();
boolean canCreateSource = canCreateSource(dbo, ssw);
document.getDocumentElement().appendChild(DOMUtils.createElementWithText(document, "response", Boolean.toString(canCreateSource)));
}
}
}
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));
}
}
}
Aggregations