Search in sources :

Example 1 with SequenceStepNode

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

the class ReferencesView method getSequenceReferencingIsUsedBy.

private void getSequenceReferencingIsUsedBy(Step step, Sequence sequenceSelected, SequenceNode seNode) {
    if (step instanceof SequenceStep) {
        String sourceSequence = ((SequenceStep) step).getSourceSequence();
        if (sourceSequence.equals(sequenceSelected.getProject().getName() + RequestableStep.SOURCE_SEPARATOR + sequenceSelected.getName())) {
            SequenceStepNode sequenceStepNode = new SequenceStepNode(seNode, step.getName(), step);
            seNode.addChild(sequenceStepNode);
        }
    } else if (isStepContainer(step)) {
        List<Step> steps = getStepList(step);
        for (Step s : steps) {
            getSequenceReferencingIsUsedBy(s, sequenceSelected, seNode);
        }
    }
}
Also used : SequenceStep(com.twinsoft.convertigo.beans.steps.SequenceStep) List(java.util.List) ArrayList(java.util.ArrayList) 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) SequenceStepNode(com.twinsoft.convertigo.eclipse.views.references.model.SequenceStepNode)

Example 2 with SequenceStepNode

use of com.twinsoft.convertigo.eclipse.views.references.model.SequenceStepNode 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 3 with SequenceStepNode

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

the class ReferencesView method getUsedRequestables.

private void getUsedRequestables(Step step, Project projectSelected, AbstractParentNode parentNode) {
    try {
        if (step instanceof SequenceStep) {
            SequenceStep sequenceStep = (SequenceStep) step;
            String sourceProjectName = sequenceStep.getProjectName();
            if (sourceProjectName.equals(projectSelected.getName())) {
                Sequence sourceSequence = null;
                String sourceSequenceName = sequenceStep.getSequenceName();
                try {
                    if (projectSelected != null)
                        sourceSequence = projectSelected.getSequenceByName(sourceSequenceName);
                } catch (EngineException e) {
                    sourceSequence = null;
                }
                SequenceStepNode sequenceStepNode = new SequenceStepNode(parentNode, step.getName() + " -> " + sequenceStep.getSourceSequence(), sourceSequence);
                parentNode.addChild(sequenceStepNode);
            }
        } else if (step instanceof TransactionStep) {
            TransactionStep transactionStep = (TransactionStep) step;
            String sourceProjectName = transactionStep.getProjectName();
            if (sourceProjectName.equals(projectSelected.getName())) {
                Transaction sourceTransaction = null;
                Connector connectorSelected = projectSelected.getConnectorByName(transactionStep.getConnectorName());
                try {
                    if (connectorSelected != null)
                        sourceTransaction = connectorSelected.getTransactionByName(transactionStep.getTransactionName());
                } catch (Exception e) {
                    sourceTransaction = null;
                }
                TransactionStepNode transactionStepNode = new TransactionStepNode(parentNode, step.getName() + " -> " + ((TransactionStep) step).getSourceTransaction(), sourceTransaction);
                parentNode.addChild(transactionStepNode);
            }
        } else if (isStepContainer(step)) {
            List<Step> steps = getStepList(step);
            if (steps != null) {
                for (Step s : steps) {
                    getUsedRequestables(s, projectSelected, parentNode);
                }
            }
        }
    } catch (EngineException e) {
        ConvertigoPlugin.logException(e, "Unable to load the project", true);
    }
}
Also used : TransactionStep(com.twinsoft.convertigo.beans.steps.TransactionStep) 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) Transaction(com.twinsoft.convertigo.beans.core.Transaction) HtmlTransaction(com.twinsoft.convertigo.beans.transactions.HtmlTransaction) JavelinTransaction(com.twinsoft.convertigo.beans.transactions.JavelinTransaction) TransactionStepNode(com.twinsoft.convertigo.eclipse.views.references.model.TransactionStepNode) EngineException(com.twinsoft.convertigo.engine.EngineException) Sequence(com.twinsoft.convertigo.beans.core.Sequence) 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) SequenceStepNode(com.twinsoft.convertigo.eclipse.views.references.model.SequenceStepNode) EngineException(com.twinsoft.convertigo.engine.EngineException)

Aggregations

RequestableStep (com.twinsoft.convertigo.beans.core.RequestableStep)3 Step (com.twinsoft.convertigo.beans.core.Step)3 BlockStep (com.twinsoft.convertigo.beans.steps.BlockStep)3 BranchStep (com.twinsoft.convertigo.beans.steps.BranchStep)3 ElseStep (com.twinsoft.convertigo.beans.steps.ElseStep)3 SequenceStep (com.twinsoft.convertigo.beans.steps.SequenceStep)3 ThenStep (com.twinsoft.convertigo.beans.steps.ThenStep)3 TransactionStep (com.twinsoft.convertigo.beans.steps.TransactionStep)3 XMLComplexStep (com.twinsoft.convertigo.beans.steps.XMLComplexStep)3 SequenceStepNode (com.twinsoft.convertigo.eclipse.views.references.model.SequenceStepNode)3 CicsConnector (com.twinsoft.convertigo.beans.connectors.CicsConnector)2 HtmlConnector (com.twinsoft.convertigo.beans.connectors.HtmlConnector)2 HttpConnector (com.twinsoft.convertigo.beans.connectors.HttpConnector)2 JavelinConnector (com.twinsoft.convertigo.beans.connectors.JavelinConnector)2 ProxyHttpConnector (com.twinsoft.convertigo.beans.connectors.ProxyHttpConnector)2 SiteClipperConnector (com.twinsoft.convertigo.beans.connectors.SiteClipperConnector)2 SqlConnector (com.twinsoft.convertigo.beans.connectors.SqlConnector)2 Connector (com.twinsoft.convertigo.beans.core.Connector)2 Sequence (com.twinsoft.convertigo.beans.core.Sequence)2 Transaction (com.twinsoft.convertigo.beans.core.Transaction)2