Package org.jitterbit.integration.client.ui.interchange.entity.transformation.tree.utils

Examples of org.jitterbit.integration.client.ui.interchange.entity.transformation.tree.utils.Node


    }
    }

    public void changeHighLighted(NodeMapping mapping) {
        try {
            Node target = null;
            if (mapping != null) {
                target = treeMapper.m_targetTreeComponent.findNode(mapping.getTargetPath());
            }
            treeMapper.m_sourceTreeComponent.updateUnderlineNodes(target);
        } catch (Exception e) {
View Full Code Here


                treeMapper.setDirty(true);
            }
        }
        TransformationVariables projectVariables = treeMapper.getDataElements();
        projectVariables.scanMapping(treeMapper.getTransformation(), toReplace);
        Node targetNode = targetTreeComponent.findNode_expandTreeIfNotExist(target);
        targetNode.setFormulaFlag(treeMapper.checkIfFormula());
        try {
          treeMapper.checkDataTypeWarningForOneToOneMapping(targetNode);
          targetNode.updateMappingKits(expression);
          treeMapper.m_sourceTreeComponent.updateUnderlineNodes(targetNode);
          updateRequireMappingFlag();
          changeHighLighted(toReplace);
            validateMapping(toReplace, new FirstInstanceInserter());
            invalidMappingsMgr.deleteInvalidMapping(toReplace);
View Full Code Here

    }

    public void updateRequireMappingFlag() {
        treeMapper.m_targetTreeComponent.m_root.clearRequireMappingFlag();
        for (NodeMapping m : mappings) {
            Node targetNode = treeMapper.m_targetTreeComponent.findNode(m.getTargetPath());
            // See comment in addMapping for when targetNode can be null
            if (targetNode != null && !targetNode.isFolder()) {
                // set all parent folders as require mapping since leaf has already mapped
                targetNode.setRequireMappingFolders();
                targetNode.setMapped();
            }
        }
        treeMapper.m_targetTreeComponent.m_root.updateRequireMappingFlag();
        treeMapper.m_targetTreeComponent.m_root.clearMappedHiddenTypes();
        treeMapper.m_sourceTreeComponent.m_root.clearMappedHiddenTypes();
View Full Code Here

        bChecked=false;
        if (target.charAt(0) == '[') {
            // this is for generator map pair, not needed and the program can't handle it sometimes
            return;
        }
        Node node = targetTreeComponent.findNode(target);
        if (node == null && !target.endsWith(":nil")) {
            throw new TreeMapperException("Internal error, map list contains a target \"" + target
                            + "\" which is not in the target tree.");
        }
        String err = checkMapping.checkSource(source);
        firstInstanceInserter.setSourceDeList(checkMapping.sourceDeList);
        bChecked=true;

        // check multiple instance sources map to a single instance target
        if(!targetTreeComponent.m_flat && node!=null && target.indexOf('.')<0 &&
              checkMapping.checkLoopSourceToSingleTarget(source)){
            String replacedSource = firstInstanceInserter.processExpression(source);
            if (replacedSource != null) {
                source = replacedSource;
                m.setNewExpression(source);
            }
        }
        if (node != null) {
            node.setTargetMappedFlag(true);
            if (node.isLoopNode()) {
                node.setSourcePath(source);
            }
        }
        if (err != null && !err.equals("")) {
            throw new TreeMapperException("Error:\n" + err);
        }
View Full Code Here

    }

    private void readInTargets(Mapping m) throws TreeMapperException {
        NodeMapping nodeMapping = treeMapper.getNodeMappingFactory().newMapping(m);
        String targetDE = m.getTargetPath().toString();
        Node node = targetTreeComponent.findNode(targetDE);
        if(node==null){
          String path=targetDE;
          if(path.endsWith("xsi:nil")){
            path=path.substring(0,path.length()-7);
            Node targetEVNode=targetTreeComponent.findNode(path);
            node=targetEVNode.createNilNodeToMap();
          }
        }
        if (node == null) {
            // if recursive, append new node
            node = targetTreeComponent.expandTreeAndLookForNode(targetDE);
            // node may be null if the structure has been edited and a mapped LDAP attribute
            // has been removed
            if (node != null && LdapUtils.isLdapAttributeCommand(targetTreeComponent, node)) {
              LdapUtils.setLdapAttributeType(targetTreeComponent, node, m.getExpression());
            }
            targetTreeComponent.setDirty();
        }
        if (node == null) {
            throw new TreeMapperException("Cannot find the target node " + targetDE + " in the target tree.");
        }
        if (targetDE.charAt(0) == '[') {
            String expr = m.getExpression();
            String fixed = "Fixed ";
            if (expr != null && expr.startsWith(fixed)) {
                String expr1 = StringUtils.removeStart(expr, fixed);
                Node source_generator = treeMapper.m_sourceTreeComponent.expandTreeAndLookForNode(expr1);
                if (source_generator != null) {
                    addMapping(nodeMapping);
                    int k1 = fixed.length(), k2 = expr.length();
                    try {
                        // remove "Fixed [" and "]" from the expr
View Full Code Here

            }
            return false;
        }

        private void removeMappingFromTreeNode(NodeMapping toRemove) {
            Node node = treeMapper.findTargetNode(toRemove.getTargetPath());
            if (node == null) {
                return;
            }
            node.setTargetMappedFlag(false);
            node.removeMapping();
            treeMapper.updateMapAreaTables(node.m_deName, null);
            try {
                node.updateMappingKits("");
            } catch (Exception e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
View Full Code Here

        button.setToolTipText("Select Target data element to create formula");
        button.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                Node target=m_targetTreeComponent.m_highLightedNode;
                if(target!=null && !target.mapDisabled()){
                    doMap(target, true);
                }
            }
        });
        button.setEnabled(false);
View Full Code Here

  public void updateMapAreaTables(Mapping m) {
      updateMapAreaTables(m.getTargetPath().toString(), m.getExpression());
  }

  public void updateMapAreaTables(String targetDE, String expr){
    Node target=m_targetTreeComponent.findNode(targetDE);
    if(expr==null||expr.length()==0){// to remove the mapping for targetDE
      m_mapAreaTable.remove(target);
      m_sourceExpressionTable.remove(target);
    }
    else {
View Full Code Here

    }

    private void updateRenamedTargetNodes() {
        for (Map.Entry<String, String> e : renamedTargetNodes.entrySet()) {
            String path = e.getKey();
            Node node = m_targetTreeComponent.findNode_expandTreeIfNotExist(path);
            if (node == null) {
                // This is a major WTF, but it works in some cases. Frank will need to look at this.
                // Scenario: Flat target, I have created a multiple folder and given it
                // a new name. I haven't mapped anything to it. When I re-open the
                // transformation, findNode_expandTreeIfNotExist above returns null. However,
View Full Code Here

    }
  }

  void addOption(Node target)
  {
    Node parent=target.m_parent;
    if((target.isTypeDefinition()&&target.m_parent.isDerivedTypeHolder())||
        target.isSubstitutionGroup()||
        target.isOptional()||
        target.isLoopNode()||
        (parent!=null&&parent.isOneOf())||
        (target.isFolder()&&!isTargetXml()))
    {
        TLNOptionViewer options = new TLNOptionViewer(m_targetTreeComponent, target);
        options.open();
      return;
View Full Code Here

TOP

Related Classes of org.jitterbit.integration.client.ui.interchange.entity.transformation.tree.utils.Node

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.