Package net.n3.nanoxml

Examples of net.n3.nanoxml.NonValidator


        }
        if ( rs.getSize() > 0 ){
            receiptGroup.add(rs);
        }

        IXMLElement xmlRe = new XMLElement("Facturas");

        for (ReceiptSap receiptSap : receiptGroup) {
            IXMLElement child = xmlRe.createElement("Re");
            xmlRe.addChild(child);
            child.setAttribute("getId", receiptSap.getId());
            child.setAttribute("getKind", receiptSap.getKind());
            child.setAttribute("getClient", receiptSap.getClient());
            child.setAttribute("range", receiptSap.getMinFiscalId() + "-" + receiptSap.getMaxFiscalId());
            child.setAttribute("getZ", receiptSap.getZ());
View Full Code Here


    }

    private IXMLElement createClients() throws SQLException{
        System.out.println("[" + Shared.now() + "] " + this.getClass().getName() + " " + Shared.lineNumber() " Creando xml para clientes");
        XMLElement clienXML = new XMLElement("Clientes");

        TreeSet<String> clientsAdded = new TreeSet<String>();
        for (String c : clients) {
            Client cc = ConnectionDrivers.listClients(c).get(0);
            if ( !clientsAdded.contains(cc.getId()) ){
                IXMLElement client = clienXML.createElement("C");
                client.setAttribute("ID", cc.getId());
                String tname = cc.getName();
                client.setAttribute("Name", tname.substring(0,Math.min(35, tname.length())));
                String tc = cc.getAddress() + " Tlf: " + cc.getPhone();
                client.setAttribute("Addr", (tc).substring(0, Math.min(30,tc.length())));
                clienXML.addChild(client);
                clientsAdded.add(cc.getId());
            }
        }
        System.out.println("[" + Shared.now() + "] " + this.getClass().getName() + " " + Shared.lineNumber() " Creado XML para clientes");
View Full Code Here

        return clienXML;
    }

    private IXMLElement createHistEnvios() throws SQLException{
        XMLElement xml = new XMLElement("HistoricosDeEnvios");

        xml.setAttribute("ventas", Shared.round((receiptTotal*(Shared.getIva()+100.0)/100.0),2) + "");
        xml.setAttribute("Observaciones", noteField.getText());

        return xml;
    }
View Full Code Here

            }

            Shared.sendMail(Shared.getConfig("sendEmail"), createCloseEmail(), createCloseEmailSubject());


            IXMLElement data2Sent = new XMLElement("data");
            data2Sent.setAttribute("storeName", Shared.getConfig("storeName"));
            data2Sent.setAttribute("day", myDay);
            data2Sent.addChild(createXml4Receipt());
            data2Sent.addChild(createXml4CN());
            data2Sent.addChild(createClients());
            data2Sent.addChild(createHistEnvios());
            data2Sent.addChild(ConnectionDrivers.createFiscalData(myDay));
            data2Sent.addChild(createCobranzas());

            ByteArrayOutputStream baosF = new ByteArrayOutputStream();
            XMLWriter xmlwF = new XMLWriter(baosF);
            xmlwF.write(data2Sent);
View Full Code Here

    private javax.swing.JButton updateButton;
    // End of variables declaration//GEN-END:variables

    private IXMLElement createCobranzas() {
        System.out.println("[" + Shared.now() + "] " + this.getClass().getName() + " " + Shared.lineNumber() " Creando XMl para cobranzas");
        IXMLElement xml = new XMLElement("Cobranza");

        // BANKS
        for ( int i = 0 ; i < bankTable.getRowCount() ; i++ ){
            IXMLElement child = xml.createElement("I");
            xml.addChild(child);
            child.setAttribute("waerks", Shared.getConfig("waerks"));
            child.setAttribute("simbo", (bankTable.getValueAt(i, 0).toString().split("-")[0]).trim());

            if ( bankTable.getValueAt(i, 2).equals(Shared.getConfig("creditPaymentName")) ){
                child.setAttribute("mpago", "B");
            }else if ( bankTable.getValueAt(i, 2).equals(Shared.getConfig("debitPaymentName")) ){
                child.setAttribute("mpago", "D");
            }else if ( bankTable.getValueAt(i, 2).equals(Shared.getConfig("americanExpressPaymentName")) ){
                child.setAttribute("mpago", "A");
            }else{
                System.out.println("Banco desconocido... agregando E");
                child.setAttribute("mpago", "E");
            }

            child.setAttribute("bpago", (bankTable.getValueAt(i, 0).toString().split("-")[0]).trim());
            child.setAttribute("lote", (String)bankTable.getValueAt(i, 1));
            child.setAttribute("monto", ((Double)bankTable.getValueAt(i, 4))+"");
            child.setAttribute("text", "");
        }

        System.out.println("[" + Shared.now() + "] " + this.getClass().getName() + " " + Shared.lineNumber() " Creando XML para gastos");

        // EXPENSES
        for ( int i = 0 ; i < expenseTable.getRowCount() ; i++ ){
            IXMLElement child = xml.createElement("I");
            xml.addChild(child);
            child.setAttribute("waerks", Shared.getConfig("waerks"));
            child.setAttribute("simbo", Shared.getConfig("genericBank"));

            String tmp = expenseTable.getValueAt(i, 0).toString().split("-")[0];
            child.setAttribute("mpago", tmp.substring(0, tmp.length() - 1));

            child.setAttribute("bpago", Shared.getConfig("genericBank"));
            child.setAttribute("lote", i+"");
            child.setAttribute("monto", ((String)expenseTable.getValueAt(i, 1)).replace(',', '.'));
            child.setAttribute("text", (String)expenseTable.getValueAt(i, 2));
           
        }

        System.out.println("[" + Shared.now() + "] " + this.getClass().getName() + " " + Shared.lineNumber() " Creando XML para efectivo");

        // CASH
        for ( int i = 0 ; i < depositTable.getRowCount() ; i++ ){
            IXMLElement child = xml.createElement("I");
            xml.addChild(child);
            child.setAttribute("waerks", Shared.getConfig("waerks"));
            String bancoId = ((String)depositTable.getValueAt(i, 0)).split("-")[0].trim();
            child.setAttribute("simbo", bancoId);
            child.setAttribute("mpago", "E");
View Full Code Here

  {
    BufferedOutputStream os =
      new BufferedOutputStream(new FileOutputStream(file));
    try
    {
      XMLWriter wtr = new XMLWriter(os);
      wtr.write(_rootElement, true);
    }
    finally
    {
      os.close();
    }
View Full Code Here

        IXMLElement root = new XMLElement(WebDAVConstants.PROPFIND_ELEM, WebDAVConstants.XML_DAV_NAMESPACE);
        root.addChild(new XMLElement(WebDAVConstants.ALLPROP_ELEM));

        StringWriter xml = new StringWriter();
        XMLWriter writer = new XMLWriter(xml);
        writer.write(root);

        String str = WebDAVConstants.XML_TEMPLATE + "\r\n" + xml.toString(); //$NON-NLS-1$
        byte[] content = str.getBytes("UTF8"); //$NON-NLS-1$

        request.setHeaderField("Content-Length", String.valueOf(content.length)); //$NON-NLS-1$
View Full Code Here

       LogBuffer.println("Not printing config to file, file is null.");
       return;
     }
     try {
       OutputStream os = new FileOutputStream(file);
       XMLWriter w = new XMLWriter(os);
       w.write(root.root);
       changed = false;
       LogBuffer.println("Successfully stored config file " + file);
     } catch (Exception e) {
       LogBuffer.logException(e);
       System.out.println("Caught exception " + e);
View Full Code Here

            data2Sent.addChild(createHistEnvios());
            data2Sent.addChild(ConnectionDrivers.createFiscalData(myDay));
            data2Sent.addChild(createCobranzas());

            ByteArrayOutputStream baosF = new ByteArrayOutputStream();
            XMLWriter xmlwF = new XMLWriter(baosF);
            xmlwF.write(data2Sent);

            TotalPosWebService ws = new TotalPosWebServiceService().getTotalPosWebServicePort();

            String ans = ws.closeDay(baosF.toString());
            if ( !ans.isEmpty() ){
View Full Code Here

  public void load(final Reader reader) throws XMLException {
    parser = new XMLParser();
    final IXMLReader nanoxmlReader = new StdXMLReader(reader);
    parser.setReader(nanoxmlReader);
    parser.setBuilder(this);
    parser.setValidator(new NonValidator());
    parser.parse();
  }
View Full Code Here

TOP

Related Classes of net.n3.nanoxml.NonValidator

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.