Search in sources :

Example 11 with WrapDatabaseObject

use of com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.WrapDatabaseObject in project convertigo by convertigo.

the class EnableMobileRouteComponentAction method run2.

@Override
protected void run2() throws Exception {
    try {
        WrapObject[] treeObjects = studio.getSelectedObjects().toArray(new WrapObject[0]);
        for (int i = treeObjects.length - 1; i >= 0; --i) {
            WrapDatabaseObject treeObject = (WrapDatabaseObject) treeObjects[i];
            if (treeObject.instanceOf(RouteComponent.class)) {
                // StepView stepTreeObject = (StepView) treeObject;
                RouteComponent component = (RouteComponent) treeObject.getObject();
                component.setEnabled(true);
            // stepTreeObject.setEnabled(true);
            // stepTreeObject.hasBeenModified(true);
            // TreeObjectEvent treeObjectEvent = new TreeObjectEvent(stepTreeObject, "isEnable", false, true);
            // explorerView.fireTreeObjectPropertyChanged(treeObjectEvent);
            }
        }
    // explorerView.refreshSelectedTreeObjects();
    } catch (Throwable e) {
        throw e;
    // ConvertigoPlugin.logException(e, "Unable to enable step!");
    }
// finally {
// shell.setCursor(null);
// waitCursor.dispose();
}
Also used : RouteComponent(com.twinsoft.convertigo.beans.mobile.components.RouteComponent) WrapObject(com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.WrapObject) WrapDatabaseObject(com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.WrapDatabaseObject)

Example 12 with WrapDatabaseObject

use of com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.WrapDatabaseObject in project convertigo by convertigo.

the class EnableMobileRouteEventComponentAction method run2.

@Override
protected void run2() throws Exception {
    try {
        WrapObject[] treeObjects = studio.getSelectedObjects().toArray(new WrapObject[0]);
        for (int i = treeObjects.length - 1; i >= 0; --i) {
            WrapDatabaseObject treeObject = (WrapDatabaseObject) treeObjects[i];
            if (treeObject.instanceOf(RouteEventComponent.class)) {
                // StepView stepTreeObject = (StepView) treeObject;
                RouteEventComponent component = (RouteEventComponent) treeObject.getObject();
                component.setEnabled(true);
            // stepTreeObject.setEnabled(true);
            // stepTreeObject.hasBeenModified(true);
            // TreeObjectEvent treeObjectEvent = new TreeObjectEvent(stepTreeObject, "isEnable", false, true);
            // explorerView.fireTreeObjectPropertyChanged(treeObjectEvent);
            }
        }
    // explorerView.refreshSelectedTreeObjects();
    } catch (Throwable e) {
        throw e;
    // ConvertigoPlugin.logException(e, "Unable to enable step!");
    }
// finally {
// shell.setCursor(null);
// waitCursor.dispose();
}
Also used : WrapObject(com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.WrapObject) WrapDatabaseObject(com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.WrapDatabaseObject) RouteEventComponent(com.twinsoft.convertigo.beans.mobile.components.RouteEventComponent)

Example 13 with WrapDatabaseObject

use of com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.WrapDatabaseObject in project convertigo by convertigo.

the class CheStudio method runAction.

public void runAction(AbstractRunnableAction action) throws Exception {
    try {
        // Get all qnames to generate the response later
        List<String> qnames = new ArrayList<>(getSelectedObjects().size());
        for (WrapObject wrapObject : getSelectedObjects()) {
            WrapDatabaseObject wrapDbo = (WrapDatabaseObject) wrapObject;
            qnames.add(((DatabaseObject) wrapDbo.getObject()).getQName());
        }
        action.run();
        synchronized (this) {
            isActionDone = action.isDone();
            // Generate responses
            for (String qname : qnames) {
                Element xmlResponse = action.toXml(document, qname);
                createResponse(xmlResponse);
            }
            // End of the action: notify
            notify();
        }
    } catch (Exception e) {
        isActionDone = true;
        throw e;
    }
}
Also used : Element(org.w3c.dom.Element) ArrayList(java.util.ArrayList) WrapObject(com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.WrapObject) WrapDatabaseObject(com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.WrapDatabaseObject)

Example 14 with WrapDatabaseObject

use of com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.WrapDatabaseObject in project convertigo by convertigo.

the class CallDblkAction method getServiceResult.

@Override
protected void getServiceResult(HttpServletRequest request, Document document) throws Exception {
    HttpSession session = request.getSession();
    CheStudio cheStudio = CallAction.getStudio(session);
    if (cheStudio == null || cheStudio.isActionDone()) {
        String qname = request.getParameter("qname");
        if (qname != null) {
            // Create sutdio
            cheStudio = new CheStudio(document);
            session.setAttribute(CallAction.PARAM_CHE_STUDIO, cheStudio);
            cheStudio.addSelectedObject(Engine.theApp.databaseObjectsManager.getDatabaseObjectByQName(qname));
            // Equivalent of com.twinsoft.convertigo.eclipse.views.projectexplorer.ProjectExplorerView#makeActions
            // Get the right action
            WrapDatabaseObject treeObject = (WrapDatabaseObject) cheStudio.getFirstSelectedTreeObject();
            AbstractRunnableAction runnableAction = null;
            if (treeObject.instanceOf(Connector.class)) {
                runnableAction = new LaunchConnectorEditorAction(cheStudio);
                session.setAttribute(CallAction.PARAM_LAST_ACTION, LaunchConnectorEditorAction.class.getName());
            } else if (treeObject.instanceOf(Sequence.class)) {
                runnableAction = new LaunchSequenceEditorAction(cheStudio);
                session.setAttribute(CallAction.PARAM_LAST_ACTION, LaunchSequenceEditorAction.class.getName());
            } else if (treeObject.instanceOf(Step.class)) {
                // showStepInPickerAction.run();
                if (treeObject instanceof IEditableTreeViewWrap) {
                    runnableAction = new LauncEditableEditorAction(cheStudio);
                    session.setAttribute(CallAction.PARAM_LAST_ACTION, LauncEditableEditorAction.class.getName());
                }
            } else if (treeObject instanceof IEditableTreeViewWrap) {
                runnableAction = new LauncEditableEditorAction(cheStudio);
                session.setAttribute(CallAction.PARAM_LAST_ACTION, LauncEditableEditorAction.class.getName());
            }
            // Execute action if found
            if (runnableAction != null) {
                synchronized (cheStudio) {
                    final AbstractRunnableAction localAction = runnableAction;
                    final CheStudio localCheStudio = cheStudio;
                    Engine.execute(() -> {
                        try {
                            localCheStudio.runAction(localAction);
                        } catch (Exception e) {
                            synchronized (localCheStudio) {
                                currentException = e;
                                localCheStudio.notify();
                            }
                        }
                    });
                    cheStudio.wait();
                }
            }
        }
    } else {
        if (CallAction.isCurrentAction(LaunchConnectorEditorAction.class, session)) {
            synchronized (cheStudio) {
                cheStudio.setDocument(document);
                cheStudio.notify();
                cheStudio.wait();
            }
        } else if (CallAction.isCurrentAction(LaunchSequenceEditorAction.class, session)) {
            synchronized (cheStudio) {
                cheStudio.setDocument(document);
                cheStudio.notify();
                cheStudio.wait();
            }
        }
    }
    if (currentException != null) {
        throw currentException;
    }
}
Also used : CheStudio(com.twinsoft.convertigo.engine.studio.CheStudio) LauncEditableEditorAction(com.twinsoft.convertigo.engine.studio.views.projectexplorer.actions.LauncEditableEditorAction) IEditableTreeViewWrap(com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.IEditableTreeViewWrap) HttpSession(javax.servlet.http.HttpSession) WrapDatabaseObject(com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.WrapDatabaseObject) LaunchConnectorEditorAction(com.twinsoft.convertigo.engine.studio.views.projectexplorer.actions.LaunchConnectorEditorAction) Sequence(com.twinsoft.convertigo.beans.core.Sequence) LaunchSequenceEditorAction(com.twinsoft.convertigo.engine.studio.views.projectexplorer.actions.LaunchSequenceEditorAction) AbstractRunnableAction(com.twinsoft.convertigo.engine.studio.AbstractRunnableAction)

Example 15 with WrapDatabaseObject

use of com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.WrapDatabaseObject in project convertigo by convertigo.

the class LaunchConnectorEditorAction method run2.

@Override
protected void run2() throws Exception {
    try {
        WrapDatabaseObject treeObject = (WrapDatabaseObject) studio.getFirstSelectedTreeObject();
        ((ConnectorView) treeObject).launchEditor();
    } catch (Exception e) {
        throw e;
    }
}
Also used : ConnectorView(com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.ConnectorView) WrapDatabaseObject(com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.WrapDatabaseObject)

Aggregations

WrapDatabaseObject (com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.WrapDatabaseObject)29 WrapObject (com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.WrapObject)20 ProjectView (com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.ProjectView)5 DatabaseObject (com.twinsoft.convertigo.beans.core.DatabaseObject)4 Sequence (com.twinsoft.convertigo.beans.core.Sequence)4 Step (com.twinsoft.convertigo.beans.core.Step)4 SequenceView (com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.SequenceView)4 Connector (com.twinsoft.convertigo.beans.core.Connector)3 Transaction (com.twinsoft.convertigo.beans.core.Transaction)3 ConnectorEditorWrap (com.twinsoft.convertigo.engine.studio.editors.connectors.ConnectorEditorWrap)3 ExtractionRule (com.twinsoft.convertigo.beans.core.ExtractionRule)2 Listener (com.twinsoft.convertigo.beans.core.Listener)2 Statement (com.twinsoft.convertigo.beans.core.Statement)2 RouteActionComponent (com.twinsoft.convertigo.beans.mobile.components.RouteActionComponent)2 RouteComponent (com.twinsoft.convertigo.beans.mobile.components.RouteComponent)2 RouteEventComponent (com.twinsoft.convertigo.beans.mobile.components.RouteEventComponent)2 UIComponent (com.twinsoft.convertigo.beans.mobile.components.UIComponent)2 EngineException (com.twinsoft.convertigo.engine.EngineException)2 SequenceEditorWrap (com.twinsoft.convertigo.engine.studio.editors.sequences.SequenceEditorWrap)2 ConnectorView (com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.ConnectorView)2