Search in sources :

Example 1 with CheStudio

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) {
            }
        }
    }
}
Also used : CheStudio(com.twinsoft.convertigo.engine.studio.CheStudio) HttpSession(javax.servlet.http.HttpSession) Element(org.w3c.dom.Element) SourcePickerViewWrap(com.twinsoft.convertigo.engine.studio.views.sourcepicker.SourcePickerViewWrap) Document(org.w3c.dom.Document)

Example 2 with CheStudio

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));
            }
        }
    }
}
Also used : CheStudio(com.twinsoft.convertigo.engine.studio.CheStudio) XMLVector(com.twinsoft.convertigo.beans.common.XMLVector) SetPropertyResponse(com.twinsoft.convertigo.engine.studio.responses.SetPropertyResponse) HttpSession(javax.servlet.http.HttpSession) Element(org.w3c.dom.Element) SourcePickerViewWrap(com.twinsoft.convertigo.engine.studio.views.sourcepicker.SourcePickerViewWrap) DatabaseObject(com.twinsoft.convertigo.beans.core.DatabaseObject) IStepSourceContainer(com.twinsoft.convertigo.beans.core.IStepSourceContainer) StepSourceWrap(com.twinsoft.convertigo.engine.studio.dnd.StepSourceWrap)

Example 3 with CheStudio

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);
        }
    }
}
Also used : CheStudio(com.twinsoft.convertigo.engine.studio.CheStudio) HttpSession(javax.servlet.http.HttpSession) SourcePickerViewWrap(com.twinsoft.convertigo.engine.studio.views.sourcepicker.SourcePickerViewWrap)

Example 4 with CheStudio

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)));
        }
    }
}
Also used : CheStudio(com.twinsoft.convertigo.engine.studio.CheStudio) HttpSession(javax.servlet.http.HttpSession) SourcePickerViewWrap(com.twinsoft.convertigo.engine.studio.views.sourcepicker.SourcePickerViewWrap) DatabaseObject(com.twinsoft.convertigo.beans.core.DatabaseObject) StepSourceWrap(com.twinsoft.convertigo.engine.studio.dnd.StepSourceWrap)

Example 5 with CheStudio

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));
        }
    }
}
Also used : CheStudio(com.twinsoft.convertigo.engine.studio.CheStudio) HttpSession(javax.servlet.http.HttpSession) Element(org.w3c.dom.Element) SourcePickerViewWrap(com.twinsoft.convertigo.engine.studio.views.sourcepicker.SourcePickerViewWrap)

Aggregations

CheStudio (com.twinsoft.convertigo.engine.studio.CheStudio)7 HttpSession (javax.servlet.http.HttpSession)7 SourcePickerViewWrap (com.twinsoft.convertigo.engine.studio.views.sourcepicker.SourcePickerViewWrap)5 Element (org.w3c.dom.Element)3 DatabaseObject (com.twinsoft.convertigo.beans.core.DatabaseObject)2 AbstractRunnableAction (com.twinsoft.convertigo.engine.studio.AbstractRunnableAction)2 StepSourceWrap (com.twinsoft.convertigo.engine.studio.dnd.StepSourceWrap)2 XMLVector (com.twinsoft.convertigo.beans.common.XMLVector)1 IStepSourceContainer (com.twinsoft.convertigo.beans.core.IStepSourceContainer)1 Sequence (com.twinsoft.convertigo.beans.core.Sequence)1 SetPropertyResponse (com.twinsoft.convertigo.engine.studio.responses.SetPropertyResponse)1 LauncEditableEditorAction (com.twinsoft.convertigo.engine.studio.views.projectexplorer.actions.LauncEditableEditorAction)1 LaunchConnectorEditorAction (com.twinsoft.convertigo.engine.studio.views.projectexplorer.actions.LaunchConnectorEditorAction)1 LaunchSequenceEditorAction (com.twinsoft.convertigo.engine.studio.views.projectexplorer.actions.LaunchSequenceEditorAction)1 IEditableTreeViewWrap (com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.IEditableTreeViewWrap)1 WrapDatabaseObject (com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.WrapDatabaseObject)1 HashSet (java.util.HashSet)1 Document (org.w3c.dom.Document)1