use of com.twinsoft.convertigo.beans.core.Connector in project convertigo by convertigo.
the class AbstractConnectorComposite method checkEventSource.
protected boolean checkEventSource(EventObject event) {
boolean isSourceFromConnector = false;
Object source = event.getSource();
if (event instanceof ConnectorEvent) {
if (source instanceof DatabaseObject) {
Connector connector = ((DatabaseObject) source).getConnector();
if ((connector != null) && (connector.equals(this.connector)))
isSourceFromConnector = true;
}
}
return isSourceFromConnector;
}
use of com.twinsoft.convertigo.beans.core.Connector in project convertigo by convertigo.
the class JavelinMashupEventEditorComposite method fillRequestableCombo.
private void fillRequestableCombo() {
if (project != null) {
int index = -1;
req_combo.removeAll();
if (getComboConnectorName().equals(""))
req_combo.add("");
if (btnTransaction.getSelection()) {
try {
Connector connector = project.getConnectorByName(getComboConnectorName());
for (Transaction transaction : connector.getTransactionsList()) req_combo.add(transaction.getName());
if (jsonTransactionName != null)
index = req_combo.indexOf(jsonTransactionName);
} catch (EngineException e) {
}
}
if (btnSequence.getSelection()) {
for (Sequence sequence : project.getSequencesList()) req_combo.add(sequence.getName());
if (jsonSequenceName != null)
index = req_combo.indexOf(jsonSequenceName);
}
req_combo.select(index >= 0 ? index : 0);
}
}
use of com.twinsoft.convertigo.beans.core.Connector in project convertigo by convertigo.
the class NewProjectWizard method doFinish.
/**
* The worker method. We create the project here according to the templateId
* variable
*/
private void doFinish(IProgressMonitor monitor) throws CoreException {
try {
if (page10 != null) {
projectName = page1.getProjectName();
monitor.beginTask("Creating project " + projectName, 7);
Project project = createFromBlankProject(monitor, false);
boolean needAuth = page10.useAuthentication();
String wsURL = page10.getWsdlURL().toString();
String login = page10.getLogin();
String password = page10.getPassword();
WebServiceReference webWsReference = null;
RestServiceReference restWsReference = null;
RemoteFileReference reference = null;
if (wizardId.equals("com.twinsoft.convertigo.eclipse.wizards.NewWebServiceSoapReferenceWizard")) {
reference = webWsReference = new WebServiceReference();
} else if (wizardId.equals("com.twinsoft.convertigo.eclipse.wizards.NewWebServiceSwaggerReferenceWizard")) {
reference = restWsReference = new RestServiceReference();
}
reference.setUrlpath(wsURL);
reference.setNeedAuthentication(needAuth);
reference.setAuthUser(login == null ? "" : login);
reference.setAuthUser(password == null ? "" : password);
reference.bNew = true;
ImportWsReference wsr = webWsReference != null ? new ImportWsReference(webWsReference) : new ImportWsReference(restWsReference);
HttpConnector httpConnector = wsr.importInto(project);
if (httpConnector != null) {
Connector defaultConnector = project.getDefaultConnector();
project.setDefaultConnector(httpConnector);
defaultConnector.delete();
project.hasChanged = true;
}
updateProjectTreeView();
} else if (page1 != null) {
projectName = page1.getProjectName();
monitor.beginTask("Creating project " + projectName, 7);
createFromBlankProject(monitor);
return;
} else if (pageSummarySampleProject != null) {
monitor.beginTask("Creating project", 7);
createFromArchiveProject(monitor);
return;
}
} catch (Exception e) {
ConvertigoPlugin.logException(e, "An error occured while creating the project", false);
String message = "An error occured while creating the project (see Error log):\n" + e.getMessage();
IStatus status = new Status(Status.ERROR, ConvertigoPlugin.PLUGIN_UNIQUE_ID, message, e);
throw new CoreException(status);
}
}
use of com.twinsoft.convertigo.beans.core.Connector in project convertigo by convertigo.
the class ContinueWithSiteClipperStatement method getSiteClippersConnectorNames.
public static String[] getSiteClippersConnectorNames(Project projectLoaded) {
List<String> connectorList = new ArrayList<String>();
connectorList.add("");
for (Connector connector : projectLoaded.getConnectorsList()) {
if (connector instanceof SiteClipperConnector) {
connectorList.add(connector.getName());
}
}
return connectorList.toArray(new String[connectorList.size()]);
}
use of com.twinsoft.convertigo.beans.core.Connector in project convertigo by convertigo.
the class ContinueWithSiteClipperStatement method execute.
@Override
public boolean execute(Context javascriptContext, Scriptable scope) throws EngineException {
if (isEnabled()) {
if (siteClipperConnectorName.equals("")) {
throw new EngineException("You didn't choose a Site Clipper connector for redirection.");
}
Connector siteClipperConnector = getProject().getConnectorByName(siteClipperConnectorName);
com.twinsoft.convertigo.engine.Context context = getParentTransaction().context;
String targetURL = getConnector().getHtmlParser().getReferer(context);
String location = SiteClipperConnector.constructSiteLocation(context, siteClipperConnector, targetURL);
getConnector().context.outputDocument.getDocumentElement().setAttribute("redirect_location", location);
ReturnStatement.returnLoop(this.parent, "skip");
context.setSharedScope(RhinoUtils.copyScope(javascriptContext, scope));
context.stopXulRecording();
}
return isEnabled();
}
Aggregations