use of com.twinsoft.convertigo.beans.core.Connector in project convertigo by convertigo.
the class ReferencesView method getSequenceReferencingRequires.
private void getSequenceReferencingRequires(Step step, Sequence sequenceSelected, ProjectExplorerView projectExplorerView, RequiresNode requiresNode, List<String> transactionList, List<String> sequenceList) {
try {
if (step instanceof SequenceStep) {
SequenceStep sequenceStep = (SequenceStep) step;
String projectName = sequenceStep.getProjectName();
String sequenceName = sequenceStep.getSequenceName();
Project project = getProject(projectName, projectExplorerView);
ProjectNode projectNode = new ProjectNode(requiresNode, projectName, project);
Sequence sequence = null;
try {
if (project != null)
sequence = project.getSequenceByName(sequenceStep.getSequenceName());
} catch (EngineException e) {
sequence = null;
}
SequenceNode sequenceNode = new SequenceNode(projectNode, sequenceName, sequence);
projectNode.addChild(sequenceNode);
if (!sequenceList.contains(projectName + sequenceName)) {
sequenceList.add(projectName + sequenceName);
requiresNode.addChild(projectNode);
}
} else if (step instanceof TransactionStep) {
TransactionStep transactionStep = (TransactionStep) step;
String projectName = transactionStep.getProjectName();
String connectorName = transactionStep.getConnectorName();
String transactionName = transactionStep.getTransactionName();
Project project = getProject(projectName, projectExplorerView);
ProjectNode projectNode = new ProjectNode(requiresNode, projectName, project);
Connector connector = null;
Transaction transaction = null;
try {
if (project != null) {
connector = project.getConnectorByName(connectorName);
if (connector != null) {
transaction = connector.getTransactionByName(transactionName);
}
}
} catch (EngineException e) {
connector = null;
transaction = null;
}
ConnectorNode connectorNode = getConnectorNode(projectNode, connector);
if (connectorNode == null)
connectorNode = new ConnectorNode(projectNode, connectorName, connector);
projectNode.addChild(connectorNode);
TransactionNode transactionNode = new TransactionNode(projectNode, transactionName, transaction);
connectorNode.addChild(transactionNode);
if (!transactionList.contains(projectName + connectorName + transactionName)) {
transactionList.add(projectName + connectorName + transactionName);
requiresNode.addChild(projectNode);
}
} else if (isStepContainer(step)) {
List<Step> steps = getStepList(step);
for (Step s : steps) {
getSequenceReferencingRequires(s, sequenceSelected, projectExplorerView, requiresNode, transactionList, sequenceList);
}
}
} catch (Exception e) {
ConvertigoPlugin.logException(e, "Unable to load the project", true);
}
}
use of com.twinsoft.convertigo.beans.core.Connector in project convertigo by convertigo.
the class ReferencesView method getRequiredRequestables.
private void getRequiredRequestables(Step step, Project projectSelected, ProjectExplorerView projectExplorerView, AbstractParentNode parentNode, List<String> transactionList, List<String> sequenceList) {
try {
if (step instanceof SequenceStep) {
SequenceStep sequenceStep = (SequenceStep) step;
String sourceProjectName = sequenceStep.getProjectName();
if (!sourceProjectName.equals(projectSelected.getName())) {
Project project;
project = getProject(sourceProjectName, projectExplorerView);
ProjectNode projectNode = new ProjectNode(parentNode, sourceProjectName, project);
Sequence sourceSequence = null;
String sourceSequenceName = sequenceStep.getSequenceName();
try {
if (project != null)
sourceSequence = project.getSequenceByName(sourceSequenceName);
} catch (EngineException e) {
sourceSequence = null;
}
projectNode.addChild(new SequenceNode(projectNode, sourceSequenceName, sourceSequence));
if (!sequenceList.contains(sourceProjectName + sourceSequenceName)) {
sequenceList.add(sourceProjectName + sourceSequenceName);
parentNode.addChild(projectNode);
}
}
} else if (step instanceof TransactionStep) {
TransactionStep transactionStep = (TransactionStep) step;
String sourceProjectName = transactionStep.getProjectName();
if (!sourceProjectName.equals(projectSelected.getName())) {
Project project;
project = getProject(sourceProjectName, projectExplorerView);
ProjectNode projectNode = new ProjectNode(parentNode, sourceProjectName, project);
if (project != null) {
Connector connector = project.getConnectorByName(transactionStep.getConnectorName());
ConnectorNode connectorNode = null;
connectorNode = getConnectorNode(projectNode, connector);
projectNode.addChild(connectorNode);
Transaction sourceTransaction = null;
String sourceTransactionName = transactionStep.getTransactionName();
try {
if (connector != null)
sourceTransaction = connector.getTransactionByName(sourceTransactionName);
} catch (Exception e) {
sourceTransaction = null;
}
connectorNode.addChild(new TransactionNode(connectorNode, sourceTransactionName, sourceTransaction));
if (!transactionList.contains(project.getName() + connector.getName() + sourceTransactionName)) {
transactionList.add(project.getName() + connector.getName() + sourceTransactionName);
parentNode.addChild(projectNode);
}
}
}
} else if (isStepContainer(step)) {
List<Step> steps = getStepList(step);
if (steps != null) {
for (Step s : steps) {
getRequiredRequestables(s, projectSelected, projectExplorerView, parentNode, transactionList, sequenceList);
}
}
}
} catch (EngineException e) {
ConvertigoPlugin.logException(e, "Unable to load the project", true);
}
}
use of com.twinsoft.convertigo.beans.core.Connector in project convertigo by convertigo.
the class ComponentInfoWizardPage method fillTree.
public void fillTree(Class<? extends DatabaseObject> beanClass) {
treeItemName = null;
tree.removeAll();
if (parentObject instanceof Transaction) {
Connector connector = (Connector) ((Transaction) parentObject).getParent();
boolean isScreenClassAware = connector instanceof IScreenClassContainer<?>;
if (beanClass.equals(ScEntryHandlerStatement.class) || beanClass.equals(ScExitHandlerStatement.class)) {
if (isScreenClassAware) {
if (connector instanceof HtmlConnector) {
HtmlConnector htmlConnector = (HtmlConnector) connector;
ScreenClass defaultScreenClass = htmlConnector.getDefaultScreenClass();
TreeItem branch = new TreeItem(tree, SWT.NONE);
branch.setText(defaultScreenClass.getName());
List<ScreenClass> screenClasses = defaultScreenClass.getInheritedScreenClasses();
for (ScreenClass screenClass : screenClasses) {
getInHeritedScreenClass(screenClass, branch);
}
} else if (connector instanceof JavelinConnector) {
JavelinConnector javelinConnector = (JavelinConnector) connector;
ScreenClass defaultScreenClass = javelinConnector.getDefaultScreenClass();
TreeItem branch = new TreeItem(tree, SWT.NONE);
branch.setText(defaultScreenClass.getName());
List<ScreenClass> screenClasses = defaultScreenClass.getInheritedScreenClasses();
for (ScreenClass screenClass : screenClasses) {
getInHeritedScreenClass(screenClass, branch);
}
}
tree.setVisible(true);
}
} else if (beanClass.equals(HandlerStatement.class)) {
TreeItem branch;
branch = new TreeItem(tree, SWT.NONE);
branch.setText(HandlerStatement.EVENT_TRANSACTION_STARTED);
branch = new TreeItem(tree, SWT.NONE);
branch.setText(HandlerStatement.EVENT_XML_GENERATED);
tree.setVisible(true);
} else
tree.setVisible(false);
}
}
use of com.twinsoft.convertigo.beans.core.Connector in project convertigo by convertigo.
the class DboUtils method getTechnology.
public static String getTechnology(DatabaseObject parentObject, Class<? extends DatabaseObject> objectClass) {
String technology = null;
DatabaseObject parent = parentObject;
if (parent != null) {
// case of Variable
if (Variable.class.isAssignableFrom(objectClass)) {
return technology = parent.getClass().getName();
}
// parent is a connector
if (parent instanceof Connector) {
return technology = ((Connector) parent).getClass().getName();
}
// parent is a sequence
if (parent instanceof Sequence) {
return technology = ((Sequence) parent).getClass().getName();
}
// parent is a statement
if (parent instanceof Statement) {
return technology = "com.twinsoft.convertigo.beans.statements.BlockStatement";
}
// parent is a step
if (parent instanceof Step) {
technology = "com.twinsoft.convertigo.beans.steps.BlockStep";
if (getClassName(parent.getClass()).startsWith("XML")) {
technology = parent.getClass().getName();
}
return technology;
}
// parent is a transaction
if (parent instanceof Transaction) {
if (parent instanceof HtmlTransaction) {
return technology = "com.twinsoft.convertigo.beans.transactions.HtmlTransaction";
} else if (parent instanceof SiteClipperTransaction) {
return technology = "com.twinsoft.convertigo.beans.transactions.SiteClipperTransaction";
}
}
// parent is a screenclass
if (parent instanceof ScreenClass) {
while ((parent = parent.getParent()) instanceof ScreenClass) {
;
}
if (parent instanceof JavelinConnector)
technology = ((JavelinConnector) parent).getEmulatorTechnology();
if (parent instanceof HtmlConnector)
technology = "com.twinsoft.convertigo.beans.screenclasses.HtmlScreenClass";
if (parent instanceof SiteClipperConnector)
technology = "com.twinsoft.convertigo.beans.screenclasses.SiteClipperScreenClass";
}
}
return technology;
}
use of com.twinsoft.convertigo.beans.core.Connector in project convertigo by convertigo.
the class JavelinMashupEventEditorComposite method fillConnectorCombo.
private void fillConnectorCombo() {
if (project != null) {
int index = -1;
con_combo.removeAll();
con_combo.add("");
if (btnTransaction.getSelection()) {
con_combo.setEnabled(true);
req_label.setText("Transaction");
for (Connector connector : project.getConnectorsList()) con_combo.add(connector.getName());
if (jsonConnectorName != null)
index = con_combo.indexOf(jsonConnectorName);
}
if (btnSequence.getSelection()) {
con_combo.setEnabled(false);
req_label.setText("Sequence");
}
con_combo.select(index >= 0 ? index : 0);
}
fillRequestableCombo();
}
Aggregations