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

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


    }

    @Override
    protected Node getTargetNode(TreeMapper mapper) {
        TreeComponent targetTree = mapper.m_targetTreeComponent;
        Node root = getRootTable(targetTree);
        if (isTargetComplexText(mapper)) {
            root = getComplexTextRoot(root);
        } else if (isDbToXml(mapper)) {
            root = getXmlNodeToAutoMapFromDb(root);
        }
View Full Code Here


    private Node getXmlNodeToAutoMapFromDb(Node node) {
        // This is to handle the case where the user generates an XSD from the
        // DB structure. The XSD contains a dummy root element, with a single child
        // element which represents the table.
        if (node.getChildCount() == 1) {
            Node child = node.getFirstChild();
            if (child.getCROM().isElementNode()) {
                return child;
            }
        }
        return node;
    }
View Full Code Here

              StringBuilder collectedErrors = new StringBuilder();
                for (j = 0; j < m; j++) {
                    String sourceDE = deList.get(j);
                    if (m_TreeMapper.findSourceNode(sourceDE) == null) {
                      TreeComponent sourceTC=m_TreeMapper.m_sourceTreeComponent;
                        Node node = sourceTC.expandTreeAndLookForNode(sourceDE);
                      if(sourceDE.endsWith("xsi:nil")){ 
                        String path=sourceDE.substring(0,sourceDE.length()-7);
                        Node sourceEVNode=sourceTC.findNode(path);
                        node=sourceEVNode.createNilNodeToMap();
                      }
                      sourceTC.setDirty();
                        if (node == null) {
                            collectedErrors.append("undefined source DE: ").append(sourceDE).append("\n");
                        }
View Full Code Here

    }

    public final void apply() {
        if (isValid() && addMapSelector.isSelected()) {
            int numberOfMappings = new Integer(numberOfFoldersField.getText()).intValue();
            Node last = tlnNode.findLastMultipleMapping(-1);
            int i_mapping0 = last.getMultipleMappingNumber();
            for (int i = 1; i <= numberOfMappings; i++) {
                tlnNode.insertMultipleMapping(i + i_mapping0);
            }
        } else if (deleteSelector.isSelected()) {
            if (tlnNode.isMultipleMap()) {
View Full Code Here

    // connect new and old source
    if(s.isFolder()!=t.isFolder())return; // error, ignore it
    m_sourceMapArea.put(s,t);
    int nt=t.getChildCount(),ns=s.getChildCount();
    for(int it=0;it<nt;it++){
      Node ct=t.getChildAt(it);
      for(int is=0;is<ns;is++){
        Node cs=s.getChildAt(is);
        if(ct.getName().equalsIgnoreCase(cs.getName())){
          addSourceMapPair(cs,ct,status+1);
          break;
        }
      }
    }
View Full Code Here

                } catch (Exception e) {
                    e.printStackTrace();
                }
      }
    }
    Node old_condition = oldNode.getFirstChild();
    if(old_condition!=null && old_condition.isPrecondition()){
      Node new_condition=newNode.getFirstChild();
      if(new_condition!=null && !new_condition.isPrecondition())new_condition=m_newTargetTree.insertPreconditionNode(newNode);
      if(new_condition!=null)addTargetMapPair(old_condition, new_condition, status+1);
    }
    for(Node oldChild:oldNode.getChildren()){
      Debug.println("$$$ addTargetMapPair oldChild="+oldChild+", oldChild.m_name="+oldChild.getName());
      if(oldChild.isMultipleMap()){
        Node oldChild0=Utils.getMultipleMappingOriginal(oldChild), newChild0=null;
        // TODO: the result ct0 could be wrong, since it is possible to have more than one key mapped to the same value.
        for(Entry<Node, Node> entry:m_targetMapArea.m_table_new2old.entrySet()){
          if(entry.getValue()==oldChild0){
            newChild0=entry.getKey();
            break;
          }
        }
        String oldChild_i_mapping=ScriptUtils.getInstanceTag(oldChild.m_deName);
        Debug.println("$$$ cs.isMultipleMap() oldChild0="+oldChild0+", newChild0="+newChild0+", oldChild_i_mapping"+oldChild_i_mapping);
        for(Node newChild:newNode.getChildren()){
          if(newChild.isMultipleMap()){
            Debug.println("\tMultiple mapping ct="+newChild);
            Node newChild1=Utils.getMultipleMappingOriginal(newChild);
            String newChild_i_mapping=ScriptUtils.getInstanceTag(newChild.m_deName);
            Debug.println("$$$ cs.isMultipleMap() newChild1="+newChild1+", newChild_i_mapping"+newChild_i_mapping);
            if(newChild1!=null&&newChild0!=null&&oldChild_i_mapping.equals(newChild_i_mapping)&&newChild1.getName().equals(newChild0.getName())){
              Debug.println("Multiple mapping matches found");
              addTargetMapPair(oldChild,newChild,status+1);
              break;
            }
          }
View Full Code Here

      for(String line:lines){
        int k=line.indexOf('\t');
        if(k<0)continue;
        String s1=line.substring(0,k);
        String s2=line.substring(k+1);
        Node old_node=old_tree.findNode(bIsInvert?s2:s1);
        Node new_node=new_tree.findNode(bIsInvert?s1:s2);
        if(old_node!=null&&new_node!=null){
          map.m_table_old2new.put(old_node, new_node);
          map.m_table_new2old.put(new_node,old_node);
        } else {
          if(old_node==null&&new_node==null){
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.