Search in sources :

Example 1 with SetPropertyResponse

use of com.twinsoft.convertigo.engine.studio.responses.SetPropertyResponse 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)

Aggregations

XMLVector (com.twinsoft.convertigo.beans.common.XMLVector)1 DatabaseObject (com.twinsoft.convertigo.beans.core.DatabaseObject)1 IStepSourceContainer (com.twinsoft.convertigo.beans.core.IStepSourceContainer)1 CheStudio (com.twinsoft.convertigo.engine.studio.CheStudio)1 StepSourceWrap (com.twinsoft.convertigo.engine.studio.dnd.StepSourceWrap)1 SetPropertyResponse (com.twinsoft.convertigo.engine.studio.responses.SetPropertyResponse)1 SourcePickerViewWrap (com.twinsoft.convertigo.engine.studio.views.sourcepicker.SourcePickerViewWrap)1 HttpSession (javax.servlet.http.HttpSession)1 Element (org.w3c.dom.Element)1