use of com.twinsoft.convertigo.beans.core.Step in project convertigo by convertigo.
the class XMLSortStep method getTargetXPath.
@Override
protected String getTargetXPath() throws EngineException {
String xpath = "";
StepSource source = getSource();
if (!source.isEmpty()) {
Step sourceStep = source.getStep();
if (sourceStep instanceof IteratorStep) {
xpath = source.getXpath().substring(1);
}
}
return xpath;
}
use of com.twinsoft.convertigo.beans.core.Step in project convertigo by convertigo.
the class AbstractSequenceCompositeWrap method checkEventSource.
protected boolean checkEventSource(EventObject event) {
boolean isSourceFromSequence = false;
Object source = event.getSource();
if (event instanceof SequenceEvent) {
if ((source instanceof Sequence) || (source instanceof Step)) {
Sequence sequence = null;
if (source instanceof Sequence)
sequence = (Sequence) source;
if (source instanceof Step)
sequence = ((Step) source).getParentSequence();
if ((sequence != null) && (sequence.equals(this.sequence) || sequence.getOriginal().equals(this.sequence)))
isSourceFromSequence = true;
}
}
return isSourceFromSequence;
}
use of com.twinsoft.convertigo.beans.core.Step in project convertigo by convertigo.
the class DatabaseObjectDeleteAction method delete.
private void delete(DatabaseObject databaseObject) throws EngineException, IOException {
if (databaseObject instanceof Connector) {
if (((Connector) databaseObject).isDefault) {
throw new EngineException("Cannot delete the default connector!");
}
String projectName = databaseObject.getParent().getName();
deleteResourcesFolder(projectName, "soap-templates", databaseObject.getName());
deleteResourcesFolder(projectName, "Traces", databaseObject.getName());
} else if (databaseObject instanceof Transaction) {
if (((Transaction) databaseObject).isDefault) {
throw new EngineException("Cannot delete the default transaction!");
}
} else if (databaseObject instanceof ScreenClass) {
if ((databaseObject.getParent()) instanceof Project) {
throw new EngineException("Cannot delete the root screen class!");
}
} else if (databaseObject instanceof Statement) {
if ((databaseObject instanceof ThenStatement) || (databaseObject instanceof ElseStatement)) {
throw new EngineException("Cannot delete this statement!");
}
} else if (databaseObject instanceof Step) {
if ((databaseObject instanceof ThenStep) || (databaseObject instanceof ElseStep)) {
throw new EngineException("Cannot delete this step!");
}
} else if (databaseObject instanceof MobilePlatform) {
MobilePlatform mobilePlatform = (MobilePlatform) databaseObject;
File resourceFolder = mobilePlatform.getResourceFolder();
if (resourceFolder.exists()) {
// MessageBox messageBox = new MessageBox(getParentShell(), SWT.ICON_QUESTION | SWT.YES | SWT.NO);
// messageBox.setMessage("Do you want to delete the whole resource folder \"" + mobilePlatform.getRelativeResourcePath() + "\"?");
// messageBox.setText("Delete the \""+resourceFolder.getName()+"\" folder?");
// if (messageBox.open() == SWT.YES) {
// FileUtils.deleteQuietly(resourceFolder);
// }
}
} else if (databaseObject instanceof PageComponent) {
if (((PageComponent) databaseObject).isRoot) {
throw new EngineException("Cannot delete the root page!");
}
}
if (databaseObject instanceof Project) {
// Deleted project will be backup, car will be deleted to avoid its deployment at engine restart
// Engine.theApp.databaseObjectsManager.deleteProject(databaseObject.getName());
Engine.theApp.databaseObjectsManager.deleteProjectAndCar(databaseObject.getName());
// ConvertigoPlugin.getDefault().deleteProjectPluginResource(databaseObject.getName());
} else {
databaseObject.delete();
}
if (databaseObject instanceof CouchDbConnector) {
CouchDbConnector couchDbConnector = (CouchDbConnector) databaseObject;
String db = couchDbConnector.getDatabaseName();
if (!db.isEmpty()) {
// MessageBox messageBox = new MessageBox(getParentShell(), SWT.ICON_QUESTION | SWT.YES | SWT.NO);
// messageBox.setMessage("Do you want to delete the \""+db+"\" database from the CouchDb server?");
// messageBox.setText("Delete the database?");
// if (messageBox.open() == SWT.YES) {
// couchDbConnector.getCouchClient().deleteDatabase(db);
// }
}
}
// ConvertigoPlugin.logDebug("The object \"" + databaseObject.getQName() + "\" has been deleted from the database repository!");
}
use of com.twinsoft.convertigo.beans.core.Step in project convertigo by convertigo.
the class DisableStepAction 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(Step.class)) {
// StepView stepTreeObject = (StepView) treeObject;
Step step = (Step) treeObject.getObject();
step.setEnabled(false);
// 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();
}
use of com.twinsoft.convertigo.beans.core.Step in project convertigo by convertigo.
the class EnableStepAction 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(Step.class)) {
// StepView stepTreeObject = (StepView) treeObject;
Step step = (Step) treeObject.getObject();
step.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();
}
Aggregations