Search in sources :

Example 6 with TransactionNode

use of com.twinsoft.convertigo.eclipse.views.references.model.TransactionNode in project convertigo by convertigo.

the class ReferencesView method handleCallStepselection.

private void handleCallStepselection(Object firstElement) {
    try {
        ProjectExplorerView projectExplorerView = ConvertigoPlugin.getDefault().getProjectExplorerView();
        StepTreeObject stepTreeObject = (StepTreeObject) firstElement;
        Step step = stepTreeObject.getObject();
        RootNode root = new RootNode();
        if (step instanceof TransactionStep) {
            TransactionStep transactionStep = (TransactionStep) step;
            String transactionStepName = transactionStep.getName();
            TransactionStepNode transactionStepNode = new TransactionStepNode(root, transactionStepName, transactionStep);
            RequiresNode requiresNode = new RequiresNode(transactionStepNode, "Requires");
            String transactionName = transactionStep.getTransactionName();
            String connectorName = transactionStep.getConnectorName();
            String projectName = transactionStep.getProjectName();
            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);
            requiresNode.addChild(projectNode);
            transactionStepNode.addChild(requiresNode);
            root.addChild(transactionStepNode);
        } else if (step instanceof SequenceStep) {
            SequenceStep sequenceStep = (SequenceStep) step;
            String sequenceStepName = sequenceStep.getName();
            SequenceStepNode sequenceStepNode = new SequenceStepNode(root, sequenceStepName, sequenceStep);
            RequiresNode requiresNode = new RequiresNode(sequenceStepNode, "Requires");
            String sequenceName = sequenceStep.getSequenceName();
            String projectName = sequenceStep.getProjectName();
            Project project = getProject(projectName, projectExplorerView);
            ProjectNode projectNode = new ProjectNode(requiresNode, projectName, project);
            Sequence sequence = null;
            try {
                if (project != null)
                    sequence = project.getSequenceByName(sequenceName);
            } catch (EngineException e) {
                sequence = null;
            }
            projectNode.addChild(new SequenceNode(projectNode, sequenceName, sequence));
            requiresNode.addChild(projectNode);
            sequenceStepNode.addChild(requiresNode);
            root.addChild(sequenceStepNode);
        } else {
            root.addChild(new InformationNode(root, "References are not handled for this object"));
            treeViewer.setInput(root);
        }
        treeViewer.setInput(root);
        treeViewer.expandAll();
    } catch (Exception e) {
        ConvertigoPlugin.logException(e, "Error while analyzing the projects hierarchy", true);
    }
}
Also used : RootNode(com.twinsoft.convertigo.eclipse.views.references.model.RootNode) HtmlConnector(com.twinsoft.convertigo.beans.connectors.HtmlConnector) JavelinConnector(com.twinsoft.convertigo.beans.connectors.JavelinConnector) HttpConnector(com.twinsoft.convertigo.beans.connectors.HttpConnector) ProxyHttpConnector(com.twinsoft.convertigo.beans.connectors.ProxyHttpConnector) Connector(com.twinsoft.convertigo.beans.core.Connector) CicsConnector(com.twinsoft.convertigo.beans.connectors.CicsConnector) SiteClipperConnector(com.twinsoft.convertigo.beans.connectors.SiteClipperConnector) SqlConnector(com.twinsoft.convertigo.beans.connectors.SqlConnector) SequenceStep(com.twinsoft.convertigo.beans.steps.SequenceStep) ProjectExplorerView(com.twinsoft.convertigo.eclipse.views.projectexplorer.ProjectExplorerView) StepTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.StepTreeObject) EngineException(com.twinsoft.convertigo.engine.EngineException) Step(com.twinsoft.convertigo.beans.core.Step) ElseStep(com.twinsoft.convertigo.beans.steps.ElseStep) RequestableStep(com.twinsoft.convertigo.beans.core.RequestableStep) ThenStep(com.twinsoft.convertigo.beans.steps.ThenStep) SequenceStep(com.twinsoft.convertigo.beans.steps.SequenceStep) BranchStep(com.twinsoft.convertigo.beans.steps.BranchStep) XMLComplexStep(com.twinsoft.convertigo.beans.steps.XMLComplexStep) BlockStep(com.twinsoft.convertigo.beans.steps.BlockStep) TransactionStep(com.twinsoft.convertigo.beans.steps.TransactionStep) Sequence(com.twinsoft.convertigo.beans.core.Sequence) SequenceStepNode(com.twinsoft.convertigo.eclipse.views.references.model.SequenceStepNode) ConnectorNode(com.twinsoft.convertigo.eclipse.views.references.model.ConnectorNode) SiteClipperConnectorNode(com.twinsoft.convertigo.eclipse.views.references.model.SiteClipperConnectorNode) HtmlConnectorNode(com.twinsoft.convertigo.eclipse.views.references.model.HtmlConnectorNode) JavelinConnectorNode(com.twinsoft.convertigo.eclipse.views.references.model.JavelinConnectorNode) CicsConnectorNode(com.twinsoft.convertigo.eclipse.views.references.model.CicsConnectorNode) SqlConnectorNode(com.twinsoft.convertigo.eclipse.views.references.model.SqlConnectorNode) ProxyHttpConnectorNode(com.twinsoft.convertigo.eclipse.views.references.model.ProxyHttpConnectorNode) HttpConnectorNode(com.twinsoft.convertigo.eclipse.views.references.model.HttpConnectorNode) SequenceNode(com.twinsoft.convertigo.eclipse.views.references.model.SequenceNode) EngineException(com.twinsoft.convertigo.engine.EngineException) TransactionStep(com.twinsoft.convertigo.beans.steps.TransactionStep) Project(com.twinsoft.convertigo.beans.core.Project) TransactionStepNode(com.twinsoft.convertigo.eclipse.views.references.model.TransactionStepNode) Transaction(com.twinsoft.convertigo.beans.core.Transaction) HtmlTransaction(com.twinsoft.convertigo.beans.transactions.HtmlTransaction) JavelinTransaction(com.twinsoft.convertigo.beans.transactions.JavelinTransaction) RequiresNode(com.twinsoft.convertigo.eclipse.views.references.model.RequiresNode) TransactionNode(com.twinsoft.convertigo.eclipse.views.references.model.TransactionNode) InformationNode(com.twinsoft.convertigo.eclipse.views.references.model.InformationNode) ProjectNode(com.twinsoft.convertigo.eclipse.views.references.model.ProjectNode)

Example 7 with TransactionNode

use of com.twinsoft.convertigo.eclipse.views.references.model.TransactionNode in project convertigo by convertigo.

the class ReferencesView method handleTargetRequestable.

private void handleTargetRequestable(String targetRequestableName, ProjectExplorerView projectExplorerView, RequiresNode requiresNode) throws EngineException {
    StringTokenizer st = new StringTokenizer(targetRequestableName, ".");
    int count = st.countTokens();
    String projectName = st.nextToken();
    Project project = getProject(projectName, projectExplorerView);
    if (project != null) {
        ProjectNode requiresProjectNode = new ProjectNode(requiresNode, projectName, project);
        if (count == 2) {
            String sequenceName = count == 2 ? st.nextToken() : "";
            Sequence sequence = project.getSequenceByName(sequenceName);
            SequenceNode sequenceNode = new SequenceNode(requiresProjectNode, sequenceName, sequence);
            requiresProjectNode.addChild(sequenceNode);
        } else if (count == 3) {
            String connectorName = count == 3 ? st.nextToken() : "";
            Connector connector = project.getConnectorByName(connectorName);
            ConnectorNode connectorNode = new ConnectorNode(requiresProjectNode, connectorName, connector);
            requiresProjectNode.addChild(connectorNode);
            String transactionName = count == 3 ? st.nextToken() : "";
            Transaction transaction = connector.getTransactionByName(transactionName);
            TransactionNode transactionNode = new TransactionNode(connectorNode, transactionName, transaction);
            connectorNode.addChild(transactionNode);
        }
        if (requiresProjectNode.hasChildren()) {
            requiresNode.addChild(requiresProjectNode);
        }
    }
}
Also used : Project(com.twinsoft.convertigo.beans.core.Project) HtmlConnector(com.twinsoft.convertigo.beans.connectors.HtmlConnector) JavelinConnector(com.twinsoft.convertigo.beans.connectors.JavelinConnector) HttpConnector(com.twinsoft.convertigo.beans.connectors.HttpConnector) ProxyHttpConnector(com.twinsoft.convertigo.beans.connectors.ProxyHttpConnector) Connector(com.twinsoft.convertigo.beans.core.Connector) CicsConnector(com.twinsoft.convertigo.beans.connectors.CicsConnector) SiteClipperConnector(com.twinsoft.convertigo.beans.connectors.SiteClipperConnector) SqlConnector(com.twinsoft.convertigo.beans.connectors.SqlConnector) StringTokenizer(java.util.StringTokenizer) Transaction(com.twinsoft.convertigo.beans.core.Transaction) HtmlTransaction(com.twinsoft.convertigo.beans.transactions.HtmlTransaction) JavelinTransaction(com.twinsoft.convertigo.beans.transactions.JavelinTransaction) TransactionNode(com.twinsoft.convertigo.eclipse.views.references.model.TransactionNode) ProjectNode(com.twinsoft.convertigo.eclipse.views.references.model.ProjectNode) Sequence(com.twinsoft.convertigo.beans.core.Sequence) SequenceNode(com.twinsoft.convertigo.eclipse.views.references.model.SequenceNode) ConnectorNode(com.twinsoft.convertigo.eclipse.views.references.model.ConnectorNode) SiteClipperConnectorNode(com.twinsoft.convertigo.eclipse.views.references.model.SiteClipperConnectorNode) HtmlConnectorNode(com.twinsoft.convertigo.eclipse.views.references.model.HtmlConnectorNode) JavelinConnectorNode(com.twinsoft.convertigo.eclipse.views.references.model.JavelinConnectorNode) CicsConnectorNode(com.twinsoft.convertigo.eclipse.views.references.model.CicsConnectorNode) SqlConnectorNode(com.twinsoft.convertigo.eclipse.views.references.model.SqlConnectorNode) ProxyHttpConnectorNode(com.twinsoft.convertigo.eclipse.views.references.model.ProxyHttpConnectorNode) HttpConnectorNode(com.twinsoft.convertigo.eclipse.views.references.model.HttpConnectorNode)

Aggregations

CicsConnector (com.twinsoft.convertigo.beans.connectors.CicsConnector)7 HtmlConnector (com.twinsoft.convertigo.beans.connectors.HtmlConnector)7 HttpConnector (com.twinsoft.convertigo.beans.connectors.HttpConnector)7 JavelinConnector (com.twinsoft.convertigo.beans.connectors.JavelinConnector)7 ProxyHttpConnector (com.twinsoft.convertigo.beans.connectors.ProxyHttpConnector)7 SiteClipperConnector (com.twinsoft.convertigo.beans.connectors.SiteClipperConnector)7 SqlConnector (com.twinsoft.convertigo.beans.connectors.SqlConnector)7 Connector (com.twinsoft.convertigo.beans.core.Connector)7 Transaction (com.twinsoft.convertigo.beans.core.Transaction)7 HtmlTransaction (com.twinsoft.convertigo.beans.transactions.HtmlTransaction)7 JavelinTransaction (com.twinsoft.convertigo.beans.transactions.JavelinTransaction)7 TransactionNode (com.twinsoft.convertigo.eclipse.views.references.model.TransactionNode)7 Project (com.twinsoft.convertigo.beans.core.Project)6 Sequence (com.twinsoft.convertigo.beans.core.Sequence)6 CicsConnectorNode (com.twinsoft.convertigo.eclipse.views.references.model.CicsConnectorNode)6 ConnectorNode (com.twinsoft.convertigo.eclipse.views.references.model.ConnectorNode)6 HtmlConnectorNode (com.twinsoft.convertigo.eclipse.views.references.model.HtmlConnectorNode)6 HttpConnectorNode (com.twinsoft.convertigo.eclipse.views.references.model.HttpConnectorNode)6 JavelinConnectorNode (com.twinsoft.convertigo.eclipse.views.references.model.JavelinConnectorNode)6 ProjectNode (com.twinsoft.convertigo.eclipse.views.references.model.ProjectNode)6