use of com.twinsoft.convertigo.beans.connectors.JavelinConnector 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.connectors.JavelinConnector in project convertigo by convertigo.
the class ObjectInfoWizardPage 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.connectors.JavelinConnector in project convertigo by convertigo.
the class EmulatorTechnologyWizardPage method dialogChanged.
private void dialogChanged() {
String emTech = getEmulatorTechnology();
if (emTech.length() == 0) {
updateStatus("Emulator technology must be specified");
return;
}
try {
DatabaseObject dbo = ((ObjectExplorerWizardPage) getWizard().getPage("ObjectExplorerWizardPage")).getCreatedBean();
if (dbo != null) {
if (dbo instanceof JavelinConnector) {
((JavelinConnector) dbo).setEmulatorTechnology(emTech);
((JavelinConnector) dbo).emulatorID = ((JavelinConnector) dbo).findEmulatorId();
}
}
ServiceCodeWizardPage servCodeWP = (ServiceCodeWizardPage) getWizard().getPage("ServiceCodeWizardPage");
servCodeWP.update();
} catch (NullPointerException e) {
updateStatus("New Bean has not been instantiated");
return;
} catch (EngineException e) {
updateStatus("Emulmator id couldn't be found from emulator technology.");
return;
}
updateStatus(null);
}
use of com.twinsoft.convertigo.beans.connectors.JavelinConnector in project convertigo by convertigo.
the class Migration3_0_0 method migrate.
public static Element migrate(Document document, Element projectNode) throws Exception {
// Creation of the connector
Engine.logDatabaseObjectManager.info("Connector creation");
JavelinConnector connector = new JavelinConnector();
connector.setName("javelin");
connector.isDefault = true;
Element element;
// Set the connector properties and remove the associated project properties
NodeList nodeList = projectNode.getElementsByTagName("property");
element = (Element) XMLUtils.findNodeByAttributeValue(nodeList, "name", "emulatorTechnology");
String emulatorTechnology = (String) XMLUtils.readObjectFromXml((Element) XMLUtils.findChildNode(element, Node.ELEMENT_NODE));
connector.setEmulatorTechnology(emulatorTechnology);
projectNode.removeChild(element);
element = (Element) XMLUtils.findNodeByAttributeValue(nodeList, "name", "tasServiceCode");
String tasServiceCode = (String) XMLUtils.readObjectFromXml((Element) XMLUtils.findChildNode(element, Node.ELEMENT_NODE));
connector.setServiceCode(tasServiceCode);
projectNode.removeChild(element);
element = (Element) XMLUtils.findNodeByAttributeValue(nodeList, "name", "cariocaVirtualServer");
String cariocaVirtualServer = (String) XMLUtils.readObjectFromXml((Element) XMLUtils.findChildNode(element, Node.ELEMENT_NODE));
connector.setVirtualServer(cariocaVirtualServer);
projectNode.removeChild(element);
Element connectorNode = connector.toXml(document);
// Move the pools to the children of the connector
Engine.logDatabaseObjectManager.info("Moving pools");
nodeList = projectNode.getElementsByTagName("pool");
int len = nodeList.getLength();
Element[] pools = new Element[len];
for (int i = 0; i < len; i++) {
pools[i] = (Element) nodeList.item(i);
}
Element pool;
for (int i = 0; i < len; i++) {
pool = pools[i];
connectorNode.appendChild(pool);
}
// Move all transactions to the children of the connector
Engine.logDatabaseObjectManager.info("Moving transactions");
nodeList = projectNode.getElementsByTagName("transaction");
len = nodeList.getLength();
Element[] transactions = new Element[len];
for (int i = 0; i < len; i++) {
transactions[i] = (Element) nodeList.item(i);
}
Element transaction;
for (int i = 0; i < len; i++) {
transaction = transactions[i];
if (transaction.getAttribute("classname").equals("com.twinsoft.convertigo.beans.core.JavelinTransaction")) {
transaction.setAttribute("classname", "com.twinsoft.convertigo.beans.transactions.JavelinTransaction");
}
connectorNode.appendChild(transactions[i]);
}
// Move the root screen class to the children of the connector
Engine.logDatabaseObjectManager.info("Moving screen classes");
nodeList = projectNode.getElementsByTagName("screenclass");
Node rootScreenClass = nodeList.item(0);
connectorNode.appendChild(rootScreenClass);
projectNode.appendChild(connectorNode);
return projectNode;
}
use of com.twinsoft.convertigo.beans.connectors.JavelinConnector 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;
}
Aggregations