use of com.twinsoft.convertigo.beans.connectors.HtmlConnector in project convertigo by convertigo.
the class ConnectorEditorPart method getStudioContext.
private Context getStudioContext(boolean bForce) {
String projectName = connector.getParent().getName();
String connectorName = connector.getName();
String contextType = ContextManager.CONTEXT_TYPE_TRANSACTION;
String contextID = Engine.theApp.contextManager.computeStudioContextName(contextType, projectName, connectorName);
Context ctx = Engine.theApp.contextManager.get(contextID);
if ((ctx == null) || bForce) {
ctx = new Context(contextID);
if (connector instanceof HtmlConnector) {
ctx.cleanXpathApi();
ctx.htmlParser = ((HtmlConnector) connector).getHtmlParser();
}
ctx.contextID = contextID;
ctx.name = contextID;
ctx.projectName = projectName;
ctx.setConnector(connector);
ctx.lastAccessTime = System.currentTimeMillis();
Engine.theApp.contextManager.add(ctx);
}
return ctx;
}
use of com.twinsoft.convertigo.beans.connectors.HtmlConnector in project convertigo by convertigo.
the class ConnectorEditorPart method createTabFolderOutputDesign.
/**
* This method initializes tabFolder
*/
private void createTabFolderOutputDesign() {
GridData gridData2 = new org.eclipse.swt.layout.GridData();
gridData2.horizontalAlignment = org.eclipse.swt.layout.GridData.FILL;
gridData2.grabExcessVerticalSpace = true;
gridData2.grabExcessHorizontalSpace = true;
gridData2.verticalAlignment = org.eclipse.swt.layout.GridData.FILL;
tabFolderOutputDesign = new TabFolder(this, SWT.BOTTOM);
tabFolderOutputDesign.setLayoutData(gridData2);
createCompositeDesign();
createCompositeOutput();
tabItemOutput = new TabItem(tabFolderOutputDesign, SWT.NONE);
tabItemOutput.setText("Output");
tabItemOutput.setControl(compositeOutput);
tabItemDesign = new TabItem(tabFolderOutputDesign, SWT.NONE);
tabItemDesign.setText("Design");
tabItemDesign.setControl(compositeDesign);
if (connector instanceof HtmlConnector)
selectTabDesign();
}
use of com.twinsoft.convertigo.beans.connectors.HtmlConnector in project convertigo by convertigo.
the class HtmlConnectorDesignComposite method selectionChanged.
public void selectionChanged(SelectionChangedEvent event) {
if (event.getSource() instanceof ISelectionProvider) {
IStructuredSelection selection = (IStructuredSelection) event.getSelection();
TreeObject treeObject = (TreeObject) selection.getFirstElement();
if (treeObject != null) {
ConnectorTreeObject connectorTreeObject = treeObject.getConnectorTreeObject();
if (connectorTreeObject != null) {
Connector connector = (Connector) connectorTreeObject.getObject();
if (connector.equals(htmlConnector)) {
if (treeObject instanceof TransactionTreeObject) {
if (!htmlConnector.isLearning())
toolLearn.setEnabled(true);
} else {
if (!htmlConnector.isLearning())
toolLearn.setEnabled(false);
}
} else {
if (!htmlConnector.isLearning())
toolLearn.setEnabled(false);
}
}
}
}
}
use of com.twinsoft.convertigo.beans.connectors.HtmlConnector in project convertigo by convertigo.
the class HttpTriggerScreenClassEditorComposite method getScreenClassList.
private java.util.List<HtmlScreenClass> getScreenClassList() {
java.util.List<HtmlScreenClass> screenClasses = null;
TreeObject treeConnector = parent.cellEditor.databaseObjectTreeObject.getParentDatabaseObjectTreeObject().getConnectorTreeObject();
HtmlConnector connector = (HtmlConnector) treeConnector.getObject();
screenClasses = connector.getAllScreenClasses();
return screenClasses;
}
use of com.twinsoft.convertigo.beans.connectors.HtmlConnector in project convertigo by convertigo.
the class AbstractEventStatement method execute.
@Override
public boolean execute(Context javascriptContext, Scriptable scope) throws EngineException {
if (isEnabled()) {
if (super.execute(javascriptContext, scope)) {
evaluate(javascriptContext, scope, getXpath(), "xpath", false);
String jsXpath = evaluated.toString();
HtmlTransaction htmlTransaction = (HtmlTransaction) getParentTransaction();
HtmlConnector htmlConnector = (HtmlConnector) htmlTransaction.getParent();
Engine.logBeans.trace("Getting event...");
AbstractEvent event = getEvent(javascriptContext, scope);
event.setXPath(jsXpath);
event.setDelay(getDelay());
Engine.logBeans.trace("Dispatching event...");
boolean dispatch = htmlConnector.dispatchEvent(event, htmlTransaction.context, trigger.getTrigger());
Engine.logBeans.trace("Getting DOM...");
htmlTransaction.setCurrentXmlDocument(htmlConnector.getHtmlParser().getDom(htmlTransaction.context));
if (dispatch)
Engine.logBeans.trace("For target '" + jsXpath + " " + event + " has been successfully dispatched on webViewer");
else {
Engine.logBeans.warn("For target '" + jsXpath + " " + event + " has not been well dispatched on webViewer");
throw new EngineException("Error when dispatch Html event");
}
return true;
}
}
return false;
}
Aggregations