Search in sources :

Example 71 with Project

use of com.twinsoft.convertigo.beans.core.Project in project convertigo by convertigo.

the class ClipboardCopyProjectRemoteURLAction method run.

public void run() {
    Display display = Display.getDefault();
    Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);
    Shell shell = getParentShell();
    shell.setCursor(waitCursor);
    try {
        ProjectExplorerView explorerView = getProjectExplorerView();
        if (explorerView != null) {
            TreeObject treeObject = explorerView.getFirstSelectedTreeObject();
            Object databaseObject = treeObject.getObject();
            if (databaseObject instanceof Project) {
                Project project = (Project) databaseObject;
                String url = ProjectUrlParser.getUrl(project);
                if (!project.getName().equals(url)) {
                    Clipboard clipboard = new Clipboard(display);
                    TextTransfer textTransfer = TextTransfer.getInstance();
                    clipboard.setContents(new String[] { url }, new Transfer[] { textTransfer });
                    clipboard.dispose();
                }
            }
        }
    } catch (Throwable e) {
        ConvertigoPlugin.logException(e, "Unable to copy!");
    } finally {
        shell.setCursor(null);
        waitCursor.dispose();
    }
}
Also used : Project(com.twinsoft.convertigo.beans.core.Project) Shell(org.eclipse.swt.widgets.Shell) ProjectExplorerView(com.twinsoft.convertigo.eclipse.views.projectexplorer.ProjectExplorerView) TreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.TreeObject) TreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.TreeObject) Clipboard(org.eclipse.swt.dnd.Clipboard) Cursor(org.eclipse.swt.graphics.Cursor) Display(org.eclipse.swt.widgets.Display) TextTransfer(org.eclipse.swt.dnd.TextTransfer)

Example 72 with Project

use of com.twinsoft.convertigo.beans.core.Project in project convertigo by convertigo.

the class ConvertMobileUIApplicationToNgxAction method run.

public void run() {
    Display display = Display.getDefault();
    Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);
    Shell shell = getParentShell();
    shell.setCursor(waitCursor);
    try {
        ProjectExplorerView explorerView = getProjectExplorerView();
        if (explorerView != null) {
            TreeObject treeObject = explorerView.getFirstSelectedTreeObject();
            ProjectTreeObject projectTreeObject = treeObject.getProjectTreeObject();
            if (projectTreeObject.getModified()) {
                ConvertigoPlugin.warningMessageBox("Please save project before converting it.");
                return;
            }
            Project project = projectTreeObject.getObject();
            InputDialog dlg = new InputDialog(shell, "Converting Mobile Application to NGX", "Your project '" + project.getName() + "' will be converted to use the new version of the Mobile Builder.\n" + "Please enter a new project name for a converted copy.\n" + "Or convert the current project.", project.getName(), new IInputValidator() {

                @Override
                public String isValid(String newText) {
                    if (newText.isBlank()) {
                        return "cannot be blank";
                    }
                    if (!StringUtils.isNormalized(newText)) {
                        return "don't use special character";
                    }
                    if (newText.equals(project.getName())) {
                        return null;
                    }
                    if (Engine.theApp.databaseObjectsManager.existsProject(newText)) {
                        return "a project with that name already exists";
                    }
                    return null;
                }
            });
            if (dlg.open() == Window.CANCEL) {
                return;
            }
            String projectName = dlg.getValue();
            if (projectName.equals(project.getName())) {
                PlainMessageDialog msg = PlainMessageDialog.getBuilder(shell, "Confirmation").buttonLabels(Arrays.asList("Yes", "No")).image(IconAndMessageDialog.getImage(IconAndMessageDialog.DLG_IMG_MESSAGE_WARNING)).message("You are about to modify the current project.\n" + "The operation cannot be undone.\n" + "Please make a backup of your current version before continuing.\n" + "Are you sure you want to convert now?").build();
                int response = msg.open();
                if (response == 0) {
                    File projectDir = project.getDirFile();
                    explorerView.setSelectedTreeObject(projectTreeObject);
                    explorerView.unloadSelectedProjectTreeObject();
                    Job.create("Project '" + projectName + "' converting to NGX", monitor -> {
                        monitor.beginTask("Converting to NGX...", IProgressMonitor.UNKNOWN);
                        try {
                            new NgxConverter(projectDir).convertFile();
                        } catch (Exception e) {
                            Engine.logStudio.error("Error while converting to NGX", e);
                        }
                        monitor.beginTask("Open the converted project...", IProgressMonitor.UNKNOWN);
                        display.syncExec(() -> {
                            try {
                                TreeObject to = explorerView.getProjectRootObject(projectName);
                                if (to instanceof UnloadedProjectTreeObject) {
                                    explorerView.loadProject((UnloadedProjectTreeObject) to);
                                } else {
                                    ConvertigoPlugin.errorMessageBox("Cannot find the '" + projectName + "' project");
                                }
                            } catch (EngineException e) {
                                ConvertigoPlugin.errorMessageBox("Failed to get the '" + projectName + "' project: " + e.getMessage());
                            }
                        });
                    }).schedule();
                }
            } else {
                Job.create("Project '" + projectName + "' converting to NGX", monitor -> {
                    try {
                        monitor.beginTask("Exporting '" + project.getName() + "'", IProgressMonitor.UNKNOWN);
                        File car = CarUtils.makeArchive(project, ArchiveExportOption.all);
                        monitor.beginTask("Importing '" + projectName + "'", IProgressMonitor.UNKNOWN);
                        Project prj = Engine.theApp.databaseObjectsManager.deployProject(car.getAbsolutePath(), projectName, true);
                        if (prj == null) {
                            return;
                        }
                        monitor.beginTask("Converting to NGX...", IProgressMonitor.UNKNOWN);
                        new NgxConverter(prj.getDirFile()).convertFile();
                        prj = Engine.theApp.databaseObjectsManager.importProject(Engine.projectYamlFile(projectName), true);
                    } catch (Exception e) {
                        Engine.logStudio.error("Error while converting to NGX", e);
                    }
                    monitor.beginTask("Open the converted project...", IProgressMonitor.UNKNOWN);
                    display.syncExec(() -> {
                        try {
                            explorerView.importProjectTreeObject(projectName);
                        } catch (Exception e) {
                            ConvertigoPlugin.errorMessageBox("Failed to get the '" + projectName + "' project: " + e.getMessage());
                        }
                    });
                }).schedule();
            }
        }
    } catch (Throwable e) {
        ConvertigoPlugin.logException(e, "Unable to edit mobile component class!");
    } finally {
        shell.setCursor(null);
        waitCursor.dispose();
    }
}
Also used : PlainMessageDialog(org.eclipse.jface.dialogs.PlainMessageDialog) InputDialog(org.eclipse.jface.dialogs.InputDialog) PlainMessageDialog(org.eclipse.jface.dialogs.PlainMessageDialog) CarUtils(com.twinsoft.convertigo.engine.util.CarUtils) Arrays(java.util.Arrays) StringUtils(com.twinsoft.convertigo.engine.util.StringUtils) UnloadedProjectTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.UnloadedProjectTreeObject) NgxConverter(com.twinsoft.convertigo.engine.util.NgxConverter) Cursor(org.eclipse.swt.graphics.Cursor) Shell(org.eclipse.swt.widgets.Shell) Job(org.eclipse.core.runtime.jobs.Job) Engine(com.twinsoft.convertigo.engine.Engine) IconAndMessageDialog(org.eclipse.jface.dialogs.IconAndMessageDialog) Display(org.eclipse.swt.widgets.Display) TreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.TreeObject) ArchiveExportOption(com.twinsoft.convertigo.engine.enums.ArchiveExportOption) File(java.io.File) IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) Project(com.twinsoft.convertigo.beans.core.Project) ProjectExplorerView(com.twinsoft.convertigo.eclipse.views.projectexplorer.ProjectExplorerView) ConvertigoPlugin(com.twinsoft.convertigo.eclipse.ConvertigoPlugin) Window(org.eclipse.jface.window.Window) ProjectTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.ProjectTreeObject) IInputValidator(org.eclipse.jface.dialogs.IInputValidator) SWT(org.eclipse.swt.SWT) EngineException(com.twinsoft.convertigo.engine.EngineException) ProjectExplorerView(com.twinsoft.convertigo.eclipse.views.projectexplorer.ProjectExplorerView) InputDialog(org.eclipse.jface.dialogs.InputDialog) EngineException(com.twinsoft.convertigo.engine.EngineException) NgxConverter(com.twinsoft.convertigo.engine.util.NgxConverter) Cursor(org.eclipse.swt.graphics.Cursor) EngineException(com.twinsoft.convertigo.engine.EngineException) Project(com.twinsoft.convertigo.beans.core.Project) Shell(org.eclipse.swt.widgets.Shell) UnloadedProjectTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.UnloadedProjectTreeObject) UnloadedProjectTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.UnloadedProjectTreeObject) TreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.TreeObject) ProjectTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.ProjectTreeObject) UnloadedProjectTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.UnloadedProjectTreeObject) ProjectTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.ProjectTreeObject) File(java.io.File) Display(org.eclipse.swt.widgets.Display) IInputValidator(org.eclipse.jface.dialogs.IInputValidator)

Example 73 with Project

use of com.twinsoft.convertigo.beans.core.Project in project convertigo by convertigo.

the class NgxPickerContentProvider method getChildren.

@Override
public Object[] getChildren(Object parentElement) {
    if (parentElement instanceof TVObject) {
        return ((TVObject) parentElement).children.toArray();
    } else if (parentElement instanceof MobileComponent) {
        MobileComponent mobileComponent = (MobileComponent) parentElement;
        Project project = mobileComponent.getProject();
        ProjectExplorerView projectExplorerView = ConvertigoPlugin.getDefault().getProjectExplorerView();
        List<String> projectNames = Engine.theApp.databaseObjectsManager.getAllProjectNamesList();
        Map<String, Set<String>> map = mobileComponent.getApplication().getInfoMap();
        TVObject root = new TVObject("root", mobileComponent, null);
        if (filter.equals(Filter.Action)) {
            TVObject tvi = root.add(new TVObject("actions"));
            TVObject tvEvents = tvi.add(new TVObject("events"));
            TVObject tvControls = tvi.add(new TVObject("controls"));
            addActions(tvi, mobileComponent);
            if (tvEvents.isEmpty()) {
                tvi.remove(tvEvents);
            }
            if (tvControls.isEmpty()) {
                tvi.remove(tvControls);
            }
        }
        if (filter.equals(Filter.Shared)) {
            TVObject tvi = root.add(new TVObject("shared"));
            addSharedComponents(tvi, mobileComponent);
        }
        if (filter.equals(Filter.Sequence)) {
            TVObject tvs = root.add(new TVObject("sequences"));
            for (String projectName : projectNames) {
                try {
                    Project p = projectExplorerView.getProject(projectName);
                    boolean isReferenced = !p.getName().equals(project.getName());
                    addSequences(map, tvs, isReferenced ? p : project, isReferenced);
                } catch (Exception e) {
                }
            }
        }
        if (filter.equals(Filter.Database)) {
            TVObject tvd = root.add(new TVObject("databases"));
            for (String projectName : projectNames) {
                try {
                    Project p = projectExplorerView.getProject(projectName);
                    boolean isReferenced = !p.getName().equals(project.getName());
                    addFsObjects(map, tvd, isReferenced ? p : project, isReferenced);
                } catch (Exception e) {
                }
            }
        }
        if (filter.equals(Filter.Iteration)) {
            TVObject tvi = root.add(new TVObject("iterations"));
            addIterations(tvi, mobileComponent);
        }
        if (filter.equals(Filter.Form)) {
            TVObject tvi = root.add(new TVObject("forms"));
            addForms(tvi, mobileComponent);
        }
        if (filter.equals(Filter.Global)) {
            TVObject tvi = root.add(new TVObject("globals"));
            addGlobals(tvi, mobileComponent.getApplication());
        }
        if (filter.equals(Filter.Local)) {
            TVObject tvi = root.add(new TVObject("locals"));
            addLocals(tvi, mobileComponent.getApplication());
        }
        return root.children.toArray();
    } else if (parentElement instanceof JSONObject) {
        JSONObject jsonObject = (JSONObject) parentElement;
        TVObject root = new TVObject("root", jsonObject, null);
        addJsonObjects(root);
        return root.children.toArray();
    }
    return new Object[0];
}
Also used : Project(com.twinsoft.convertigo.beans.core.Project) ProjectExplorerView(com.twinsoft.convertigo.eclipse.views.projectexplorer.ProjectExplorerView) JSONObject(org.codehaus.jettison.json.JSONObject) ArrayList(java.util.ArrayList) List(java.util.List) DatabaseObject(com.twinsoft.convertigo.beans.core.DatabaseObject) JSONObject(org.codehaus.jettison.json.JSONObject) HashMap(java.util.HashMap) Map(java.util.Map) JSONException(org.codehaus.jettison.json.JSONException) MobileComponent(com.twinsoft.convertigo.beans.ngx.components.MobileComponent)

Example 74 with Project

use of com.twinsoft.convertigo.beans.core.Project in project convertigo by convertigo.

the class NgxPickerContentProvider method addFsObjects.

private void addFsObjects(Map<String, Set<String>> map, TVObject tvd, Object object, boolean isReferenced) {
    if (object != null) {
        if (object instanceof Project) {
            Project project = (Project) object;
            for (Connector c : project.getConnectorsList()) {
                if (c instanceof FullSyncConnector) {
                    String label = isReferenced ? c.getQName() : c.getName();
                    TVObject tvc = tvd.add(new TVObject(label));
                    for (Document d : c.getDocumentsList()) {
                        if (d instanceof DesignDocument) {
                            TVObject tdd = tvc.add(new TVObject(d.getName()));
                            JSONObject views = CouchKey.views.JSONObject(((DesignDocument) d).getJSONObject());
                            if (views != null) {
                                for (Iterator<String> it = GenericUtils.cast(views.keys()); it.hasNext(); ) {
                                    try {
                                        Set<String> infos = null;
                                        String view = it.next();
                                        String key = c.getQName() + "." + d.getName() + "." + view;
                                        TVObject tvv = tdd.add(new TVObject(view));
                                        SourceData sd = null;
                                        try {
                                            sd = Filter.Database.toSourceData(new JSONObject().put("connector", c.getQName()).put("document", d.getQName()).put("queryview", view).put("verb", "get"));
                                        } catch (JSONException e) {
                                            e.printStackTrace();
                                        }
                                        tvv.add(new TVObject("get", d, sd));
                                        infos = map.get(key + ".get");
                                        if (infos == null) {
                                            infos = map.get(c.getQName() + ".get");
                                        }
                                        if (infos != null) {
                                            for (String info : infos) {
                                                try {
                                                    JSONObject jsonInfo = new JSONObject(info);
                                                    boolean includeDocs = false;
                                                    if (jsonInfo.has("include_docs")) {
                                                        includeDocs = Boolean.valueOf(jsonInfo.getString("include_docs")).booleanValue();
                                                    }
                                                    if (jsonInfo.has("marker")) {
                                                        String marker = jsonInfo.getString("marker");
                                                        if (!marker.isEmpty()) {
                                                            String name = "get" + "#" + marker;
                                                            sd = Filter.Database.toSourceData(new JSONObject().put("connector", c.getQName()).put("document", d.getQName()).put("queryview", view).put("verb", "get").put("marker", marker).put("includeDocs", includeDocs));
                                                            tvv.add(new TVObject(name, d, sd, jsonInfo));
                                                        }
                                                    }
                                                } catch (JSONException e) {
                                                    e.printStackTrace();
                                                }
                                            }
                                        }
                                        try {
                                            sd = Filter.Database.toSourceData(new JSONObject().put("connector", c.getQName()).put("document", d.getQName()).put("queryview", view).put("verb", "view"));
                                        } catch (JSONException e) {
                                            e.printStackTrace();
                                        }
                                        tvv.add(new TVObject("view", d, sd));
                                        infos = map.get(key + ".view");
                                        if (infos != null) {
                                            for (String info : infos) {
                                                try {
                                                    JSONObject jsonInfo = new JSONObject(info);
                                                    boolean includeDocs = false;
                                                    if (jsonInfo.has("include_docs")) {
                                                        includeDocs = Boolean.valueOf(jsonInfo.getString("include_docs")).booleanValue();
                                                    }
                                                    if (jsonInfo.has("marker")) {
                                                        String marker = jsonInfo.getString("marker");
                                                        if (!marker.isEmpty()) {
                                                            String name = "view" + "#" + marker;
                                                            sd = Filter.Database.toSourceData(new JSONObject().put("connector", c.getQName()).put("document", d.getQName()).put("queryview", view).put("verb", "view").put("marker", marker).put("includeDocs", includeDocs));
                                                            tvv.add(new TVObject(name, d, sd, jsonInfo));
                                                        }
                                                    }
                                                } catch (JSONException e) {
                                                    e.printStackTrace();
                                                }
                                            }
                                        }
                                    } catch (Exception e) {
                                        e.printStackTrace();
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
Also used : Connector(com.twinsoft.convertigo.beans.core.Connector) FullSyncConnector(com.twinsoft.convertigo.beans.connectors.FullSyncConnector) JSONException(org.codehaus.jettison.json.JSONException) FullSyncConnector(com.twinsoft.convertigo.beans.connectors.FullSyncConnector) DesignDocument(com.twinsoft.convertigo.beans.couchdb.DesignDocument) Document(com.twinsoft.convertigo.beans.core.Document) SourceData(com.twinsoft.convertigo.beans.ngx.components.MobileSmartSource.SourceData) JSONException(org.codehaus.jettison.json.JSONException) Project(com.twinsoft.convertigo.beans.core.Project) JSONObject(org.codehaus.jettison.json.JSONObject) DesignDocument(com.twinsoft.convertigo.beans.couchdb.DesignDocument)

Example 75 with Project

use of com.twinsoft.convertigo.beans.core.Project in project convertigo by convertigo.

the class ClipboardManager method cutAndPaste.

public void cutAndPaste(final DatabaseObject object, DatabaseObject parentDatabaseObject) throws ConvertigoException {
    // Verifying if a sheet with the same browser does not already exist
    if (object instanceof Sheet) {
        String browser = ((Sheet) object).getBrowser();
        Sheet sheet = null;
        if (parentDatabaseObject instanceof ScreenClass) {
            sheet = ((ScreenClass) parentDatabaseObject).getLocalSheet(browser);
        } else if (parentDatabaseObject instanceof RequestableObject) {
            sheet = ((RequestableObject) parentDatabaseObject).getSheet(browser);
        }
        if (sheet != null) {
            throw new EngineException("You cannot cut and paste the sheet because a sheet is already defined for the browser \"" + browser + "\" in the screen class \"" + parentDatabaseObject.getName() + "\".");
        }
    }
    if (object instanceof Step) {
        if (object instanceof ThenStep) {
            throw new EngineException("You cannot cut the \"Then\" step");
        }
        if (object instanceof ElseStep) {
            throw new EngineException("You cannot cut the \"Else\" step");
        }
    }
    if (object instanceof Statement) {
        if (object instanceof ThenStatement)
            throw new EngineException("You cannot cut the \"Then\" statement");
        if (object instanceof ElseStatement)
            throw new EngineException("You cannot cut the \"Else\" statement");
    }
    // Verify object is accepted for paste
    if (!DatabaseObjectsManager.acceptDatabaseObjects(parentDatabaseObject, object)) {
        throw new EngineException("You cannot cut and paste to a " + parentDatabaseObject.getClass().getSimpleName() + " a database object of type " + object.getClass().getSimpleName());
    }
    if (parentDatabaseObject instanceof com.twinsoft.convertigo.beans.mobile.components.MobileComponent) {
        if (!com.twinsoft.convertigo.beans.mobile.components.dynamic.ComponentManager.acceptDatabaseObjects(parentDatabaseObject, object)) {
            throw new EngineException("You cannot cut and paste to a " + parentDatabaseObject.getClass().getSimpleName() + " a database object of type " + object.getClass().getSimpleName());
        }
        if (!com.twinsoft.convertigo.beans.mobile.components.dynamic.ComponentManager.isTplCompatible(parentDatabaseObject, object)) {
            String tplVersion = com.twinsoft.convertigo.beans.mobile.components.dynamic.ComponentManager.getTplRequired(object);
            throw new EngineException("Template project " + tplVersion + " compatibility required");
        }
    } else if (parentDatabaseObject instanceof com.twinsoft.convertigo.beans.ngx.components.MobileComponent) {
        if (!com.twinsoft.convertigo.beans.ngx.components.dynamic.ComponentManager.acceptDatabaseObjects(parentDatabaseObject, object)) {
            throw new EngineException("You cannot cut and paste to a " + parentDatabaseObject.getClass().getSimpleName() + " a database object of type " + object.getClass().getSimpleName());
        }
        if (!com.twinsoft.convertigo.beans.ngx.components.dynamic.ComponentManager.isTplCompatible(parentDatabaseObject, object)) {
            String tplVersion = com.twinsoft.convertigo.beans.ngx.components.dynamic.ComponentManager.getTplRequired(object);
            throw new EngineException("Template project " + tplVersion + " compatibility required");
        }
    }
    // Verify if a child object with same name exist
    boolean bContinue = true;
    boolean bIncName = false;
    String dboName = object.getName();
    while (bContinue) {
        try {
            if (bIncName) {
                dboName = DatabaseObject.incrementName(dboName);
                object.setName(dboName);
            }
            new WalkHelper() {

                boolean root = true;

                boolean find = false;

                @Override
                protected boolean before(DatabaseObject databaseObject, Class<? extends DatabaseObject> dboClass) {
                    boolean isInstance = dboClass.isInstance(object);
                    find |= isInstance;
                    return isInstance;
                }

                @Override
                protected void walk(DatabaseObject databaseObject) throws Exception {
                    if (root) {
                        root = false;
                        if (databaseObject instanceof Project) {
                            if (object instanceof Connector && ((Connector) object).isDefault) {
                                throw new EngineException("You cannot cut the default connector to another project");
                            }
                        } else if (databaseObject instanceof Connector) {
                            if (object instanceof ScreenClass) {
                                throw new EngineException("You cannot cut the default screen class to another connector");
                            } else if (object instanceof Transaction && ((Transaction) object).isDefault) {
                                throw new EngineException("You cannot cut the default transaction to another connector");
                            }
                        } else if (databaseObject instanceof ScreenClass) {
                            if (object instanceof Criteria && databaseObject.getParent() instanceof Connector) {
                                throw new EngineException("You cannot cut the criterion of default screen class");
                            }
                        } else if (databaseObject instanceof MobileObject) {
                            if (databaseObject instanceof com.twinsoft.convertigo.beans.mobile.components.ApplicationComponent) {
                                if (object instanceof com.twinsoft.convertigo.beans.mobile.components.PageComponent) {
                                    com.twinsoft.convertigo.beans.mobile.components.PageComponent pc = GenericUtils.cast(object);
                                    if (pc.isRoot) {
                                        throw new EngineException("You cannot cut the root page to another application");
                                    }
                                }
                            } else if (databaseObject instanceof com.twinsoft.convertigo.beans.ngx.components.ApplicationComponent) {
                                if (object instanceof com.twinsoft.convertigo.beans.ngx.components.PageComponent) {
                                    com.twinsoft.convertigo.beans.ngx.components.PageComponent pc = GenericUtils.cast(object);
                                    if (pc.isRoot) {
                                        throw new EngineException("You cannot cut the root page to another application");
                                    }
                                }
                            }
                        }
                        super.walk(databaseObject);
                        if (!find) {
                            throw new EngineException("You cannot cut and paste to a " + databaseObject.getClass().getSimpleName() + " a database object of type " + object.getClass().getSimpleName());
                        }
                    } else {
                        if (object != databaseObject && object.getName().equalsIgnoreCase(databaseObject.getName())) {
                            throw new ObjectWithSameNameException("Unable to cut the object because an object with the same name already exists in target.");
                        }
                    }
                }
            }.init(parentDatabaseObject);
            bContinue = false;
        } catch (ObjectWithSameNameException e) {
            bIncName = true;
        } catch (EngineException e) {
            throw e;
        } catch (Exception e) {
            throw new EngineException("Exception in cutAndPaste", e);
        }
    }
    move(object, parentDatabaseObject);
}
Also used : Connector(com.twinsoft.convertigo.beans.core.Connector) ElseStep(com.twinsoft.convertigo.beans.steps.ElseStep) JavelinScreenClass(com.twinsoft.convertigo.beans.screenclasses.JavelinScreenClass) ScreenClass(com.twinsoft.convertigo.beans.core.ScreenClass) EngineException(com.twinsoft.convertigo.engine.EngineException) Step(com.twinsoft.convertigo.beans.core.Step) ElseStep(com.twinsoft.convertigo.beans.steps.ElseStep) RequestableStep(com.twinsoft.convertigo.beans.core.RequestableStep) ThenStep(com.twinsoft.convertigo.beans.steps.ThenStep) WalkHelper(com.twinsoft.convertigo.engine.helpers.WalkHelper) Criteria(com.twinsoft.convertigo.beans.core.Criteria) ThenStep(com.twinsoft.convertigo.beans.steps.ThenStep) DatabaseObject(com.twinsoft.convertigo.beans.core.DatabaseObject) MobileObject(com.twinsoft.convertigo.beans.core.MobileObject) RequestableObject(com.twinsoft.convertigo.beans.core.RequestableObject) ElseStatement(com.twinsoft.convertigo.beans.statements.ElseStatement) FunctionStatement(com.twinsoft.convertigo.beans.statements.FunctionStatement) HTTPStatement(com.twinsoft.convertigo.beans.statements.HTTPStatement) Statement(com.twinsoft.convertigo.beans.core.Statement) ThenStatement(com.twinsoft.convertigo.beans.statements.ThenStatement) ThenStatement(com.twinsoft.convertigo.beans.statements.ThenStatement) SAXException(org.xml.sax.SAXException) EngineException(com.twinsoft.convertigo.engine.EngineException) ConvertigoException(com.twinsoft.convertigo.engine.ConvertigoException) IOException(java.io.IOException) JSONException(org.codehaus.jettison.json.JSONException) InvalidOperationException(com.twinsoft.convertigo.engine.InvalidOperationException) ObjectWithSameNameException(com.twinsoft.convertigo.engine.ObjectWithSameNameException) Project(com.twinsoft.convertigo.beans.core.Project) ObjectWithSameNameException(com.twinsoft.convertigo.engine.ObjectWithSameNameException) Transaction(com.twinsoft.convertigo.beans.core.Transaction) HtmlTransaction(com.twinsoft.convertigo.beans.transactions.HtmlTransaction) ElseStatement(com.twinsoft.convertigo.beans.statements.ElseStatement) Sheet(com.twinsoft.convertigo.beans.core.Sheet)

Aggregations

Project (com.twinsoft.convertigo.beans.core.Project)148 EngineException (com.twinsoft.convertigo.engine.EngineException)56 DatabaseObject (com.twinsoft.convertigo.beans.core.DatabaseObject)47 IOException (java.io.IOException)39 File (java.io.File)37 Sequence (com.twinsoft.convertigo.beans.core.Sequence)35 Connector (com.twinsoft.convertigo.beans.core.Connector)33 ArrayList (java.util.ArrayList)29 ProjectExplorerView (com.twinsoft.convertigo.eclipse.views.projectexplorer.ProjectExplorerView)26 JSONException (org.codehaus.jettison.json.JSONException)26 Transaction (com.twinsoft.convertigo.beans.core.Transaction)24 TreeObject (com.twinsoft.convertigo.eclipse.views.projectexplorer.model.TreeObject)22 SAXException (org.xml.sax.SAXException)21 CoreException (org.eclipse.core.runtime.CoreException)20 Step (com.twinsoft.convertigo.beans.core.Step)19 Element (org.w3c.dom.Element)19 Shell (org.eclipse.swt.widgets.Shell)18 JSONObject (org.codehaus.jettison.json.JSONObject)17 IProject (org.eclipse.core.resources.IProject)17 Cursor (org.eclipse.swt.graphics.Cursor)17