Package com.dtrules.xmlparser

Examples of com.dtrules.xmlparser.XMLPrinter


    * Set the output streams for debug and trace.
    */
   public void setOutput(OutputStream debugtrace, OutputStream error){
       if(debugtrace != null){
           outPs = new PrintStream(debugtrace);
           out   = new XMLPrinter(outPs);
       }
       err   = new PrintStream(error);
   }
View Full Code Here


   /**
    * Set the output streams for debug and trace.
    */
   public void setOutput(PrintStream debugtrace, PrintStream error){
       outPs = debugtrace;
       out   = new XMLPrinter(outPs);
       err = error;
   }
View Full Code Here

     * Set the output streams for debug and trace.
     */
    public void setOutput(OutputStream debugtrace, OutputStream error) {
        if (debugtrace != null) {
            outPs = new PrintStream(debugtrace);
            out = new XMLPrinter(outPs);
        }
        err = new PrintStream(error);
    }
View Full Code Here

    /**
     * Set the output streams for debug and trace.
     */
    public void setOutput(PrintStream debugtrace, PrintStream error) {
        outPs = debugtrace;
        out = new XMLPrinter(outPs);
        err = error;
    }
View Full Code Here

    /**
     * Prints the current state of the AutoDataMap as a single configuration file.
     * @param fstream
     */
    public void printDataLoadXML(OutputStream fstream) {
        XMLPrinter xout = new XMLPrinter("dataload",fstream);
       
        for(IMapNode mno : dataMap){
            mno.printDataLoadXML(this, xout);
        }
       
        xout.close();
    }
View Full Code Here

     * @return
     * @throws Exception
     */   
  public void convertDecisionTables(RuleSet ruleset ,String destinationFile) throws Exception{
       
      XMLPrinter out = new XMLPrinter("decision_tables",new FileOutputStream(destinationFile));
      String directory = ruleset.getExcel_dtfolder();
      Iterator<String> includes = ruleset.getIncludedRuleSets().iterator();
      while(directory != null){
          directory = ruleset.getSystemPath()+"/"+directory;
          StringBuffer conversion = convertFiles(new File(directory),out,0);
          if(conversion != null){
              System.out.print(conversion);
          }else{
              System.out.println("No Decision Tables Found");
          }
          if(includes.hasNext()){
              String nextDirectory = includes.next();
              directory = ruleset.getRulesDirectory().getRuleSet(nextDirectory).getExcel_dtfolder();
          }else{
              directory = null;
          }
      }
      out.close();
    }
View Full Code Here

            }else{
                excelName = null;
            }
        }
       
        XMLPrinter   xptr  = new XMLPrinter(new FileOutputStream(outputXMLName));
        xptr.opentag("entity_data_dictionary","version","2","xmlns:xs","http://www.w3.org/2001/XMLSchema");
        ef.writeAttributes(xptr);
        xptr.close();
    }
View Full Code Here

           compareMapping(report);
       report.close();
   }
  
   public void compare(OutputStream reportStream) throws Exception {
       XMLPrinter report = new XMLPrinter(reportStream);
       compare(report);
   }
View Full Code Here

       compareDecisionTables(buff);
       return buff.toString();
   }
  
   public void compareDecisionTables(OutputStream reportStream) throws Exception {
       XMLPrinter report = new XMLPrinter(reportStream);
       compareDecisionTables(report);
   }
View Full Code Here

        HSSFWorkbook wb = new HSSFWorkbook(input);
        HSSFSheet sheet = wb.getSheetAt(0);

        // Open the EDD.xml output file
        String     tmpEDDfilename = rs.getWorkingdirectory()+tmpEDD;
        XMLPrinter xout = new XMLPrinter(new FileOutputStream(tmpEDDfilename));
       
        // Write out a header in the EDD xml file.
        xout.opentag("edd_header");
           xout.printdata("edd_create_stamp",
                new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss Z").format(new Date())
           );
           xout.printdata("Excel_File_Name",excelFileName);
        xout.closetag();
        xout.opentag("edd");

       
        // Get the indexes of the columns we need to write out the XML for this EDD.
        int rows = sheet.getLastRowNum();
        int entityIndex    = findvalue("entity",sheet,0);
        int attributeIndex = findvalue("attribute",sheet,0);
        int typeIndex      = findvalue("type",sheet,0);
        int subtypeIndex   = findvalue("subtype",sheet,0);
        int defaultIndex   = findvalue("defaultvalue",sheet,0);
        int inputIndex     = findvalue("input",sheet,0);
        int accessIndex    = findvalue("access",sheet,0);
        int commentIndex   = findvalue("comment",sheet,0);      // optional
        int sourceIndex    = findvalue("source",sheet,0);       // optional
       
        // Some columns we just have to have.  Make sure we have them here.
        if(entityIndex <0 || attributeIndex < 0 || typeIndex < 0 || defaultIndex < 0 || accessIndex < 0 || inputIndex <0 ){
            String err = " Couldn't find the following column header(s): "+
              (entityIndex<0?" entity":"")+
              (attributeIndex<0?" attribute":"")+
              (typeIndex<0?" type":"")+
              (defaultIndex<0?" default value":"")+
              (accessIndex<0?" access":"")+
              (inputIndex<0?" input":"");
            throw new Exception("This EDD may not be valid, as we didn't find the proper column headers\n"+err);
        }
       
        // Go through each row, writing out each entry to the XML.
        for(int row = 1; row <=rows; row++){
            String entityname = getCellValue(sheet,row,entityIndex);    // Skip all the rows that have no Entity
            if(entityname.length()>0){
               
                String src     = sourceIndex>=0 ? getCellValue(sheet,row,sourceIndex):"";
                String comment = commentIndex>=0 ? getCellValue(sheet,row,commentIndex):"";
                xout.opentag("entry");
                xout.opentag("entity",
                        "entityname"        , entityname,
                        "attribute"         , getCellValue(sheet,row,attributeIndex),
                        "type"              , getCellValue(sheet,row,typeIndex),
                        "subtype"           , getCellValue(sheet,row,subtypeIndex),
                        "default"           , getCellValue(sheet,row,defaultIndex),
                        "access"            , getCellValue(sheet,row,accessIndex),
                        "input"             , getCellValue(sheet,row,inputIndex),
                        "comment"           , getCellValue(sheet,row,commentIndex)
                );
                xout.closetag();
                if(comment.length()>0)xout.printdata("comment",getCellValue(sheet,row,commentIndex));
                if(src    .length()>0 )xout.printdata("source", getCellValue(sheet,row,sourceIndex));
                xout.closetag();               
            }
        }
        xout.closetag();
        xout.close();
        convertEDD(ef,rs, tmpEDDfilename);
    }
View Full Code Here

TOP

Related Classes of com.dtrules.xmlparser.XMLPrinter

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.