Search in sources :

Example 46 with Connector

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;
}
Also used : Connector(com.twinsoft.convertigo.beans.core.Connector) ConnectorEvent(com.twinsoft.convertigo.beans.core.ConnectorEvent) DatabaseObject(com.twinsoft.convertigo.beans.core.DatabaseObject) DatabaseObject(com.twinsoft.convertigo.beans.core.DatabaseObject) TreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.TreeObject) EventObject(java.util.EventObject) ConnectorTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.ConnectorTreeObject) TransactionTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.TransactionTreeObject)

Example 47 with Connector

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);
    }
}
Also used : Connector(com.twinsoft.convertigo.beans.core.Connector) Transaction(com.twinsoft.convertigo.beans.core.Transaction) EngineException(com.twinsoft.convertigo.engine.EngineException) Sequence(com.twinsoft.convertigo.beans.core.Sequence)

Example 48 with Connector

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);
    }
}
Also used : RestServiceReference(com.twinsoft.convertigo.beans.references.RestServiceReference) IStatus(org.eclipse.core.runtime.IStatus) Status(org.eclipse.core.runtime.Status) Connector(com.twinsoft.convertigo.beans.core.Connector) SapJcoConnector(com.twinsoft.convertigo.beans.connectors.SapJcoConnector) CicsConnector(com.twinsoft.convertigo.beans.connectors.CicsConnector) JavelinConnector(com.twinsoft.convertigo.beans.connectors.JavelinConnector) SiteClipperConnector(com.twinsoft.convertigo.beans.connectors.SiteClipperConnector) SqlConnector(com.twinsoft.convertigo.beans.connectors.SqlConnector) HttpConnector(com.twinsoft.convertigo.beans.connectors.HttpConnector) HttpConnector(com.twinsoft.convertigo.beans.connectors.HttpConnector) IStatus(org.eclipse.core.runtime.IStatus) CoreException(org.eclipse.core.runtime.CoreException) InvocationTargetException(java.lang.reflect.InvocationTargetException) JSONException(org.codehaus.jettison.json.JSONException) EngineException(com.twinsoft.convertigo.engine.EngineException) Project(com.twinsoft.convertigo.beans.core.Project) CoreException(org.eclipse.core.runtime.CoreException) RemoteFileReference(com.twinsoft.convertigo.beans.references.RemoteFileReference) ImportWsReference(com.twinsoft.convertigo.engine.util.ImportWsReference) WebServiceReference(com.twinsoft.convertigo.beans.references.WebServiceReference)

Example 49 with Connector

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()]);
}
Also used : Connector(com.twinsoft.convertigo.beans.core.Connector) SiteClipperConnector(com.twinsoft.convertigo.beans.connectors.SiteClipperConnector) SiteClipperConnector(com.twinsoft.convertigo.beans.connectors.SiteClipperConnector) ArrayList(java.util.ArrayList)

Example 50 with Connector

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();
}
Also used : Connector(com.twinsoft.convertigo.beans.core.Connector) SiteClipperConnector(com.twinsoft.convertigo.beans.connectors.SiteClipperConnector) EngineException(com.twinsoft.convertigo.engine.EngineException)

Aggregations

Connector (com.twinsoft.convertigo.beans.core.Connector)72 Transaction (com.twinsoft.convertigo.beans.core.Transaction)43 Project (com.twinsoft.convertigo.beans.core.Project)32 EngineException (com.twinsoft.convertigo.engine.EngineException)28 JavelinConnector (com.twinsoft.convertigo.beans.connectors.JavelinConnector)22 Sequence (com.twinsoft.convertigo.beans.core.Sequence)21 HtmlConnector (com.twinsoft.convertigo.beans.connectors.HtmlConnector)17 Step (com.twinsoft.convertigo.beans.core.Step)17 DatabaseObject (com.twinsoft.convertigo.beans.core.DatabaseObject)16 HttpConnector (com.twinsoft.convertigo.beans.connectors.HttpConnector)15 SiteClipperConnector (com.twinsoft.convertigo.beans.connectors.SiteClipperConnector)14 ScreenClass (com.twinsoft.convertigo.beans.core.ScreenClass)14 HtmlTransaction (com.twinsoft.convertigo.beans.transactions.HtmlTransaction)14 TreeObject (com.twinsoft.convertigo.eclipse.views.projectexplorer.model.TreeObject)12 CouchDbConnector (com.twinsoft.convertigo.beans.connectors.CouchDbConnector)11 SqlConnector (com.twinsoft.convertigo.beans.connectors.SqlConnector)11 Statement (com.twinsoft.convertigo.beans.core.Statement)11 ElseStep (com.twinsoft.convertigo.beans.steps.ElseStep)11 ThenStep (com.twinsoft.convertigo.beans.steps.ThenStep)11 ProjectExplorerView (com.twinsoft.convertigo.eclipse.views.projectexplorer.ProjectExplorerView)11