Package org.xdams.xml.builder

Examples of org.xdams.xml.builder.XMLBuilder


      confBean = (ConfBean) modelMap.get("confBean");
      workFlowBean = (WorkFlowBean) modelMap.get("workFlowBean");

      xwconn = connectionManager.getConnection(workFlowBean.getArchive());
      MultiEditingManager editingManager = new MultiEditingManager(req.getParameterMap(), confBean, userBean, workFlowBean);
      editingManager.setTheXML(new XMLBuilder("root"));
      confBean = editingManager.rewriteMultipleConf(confControl);
      XMLBuilder xmlBuilder = confBean.getTheXMLConfQuery();
      String qlphrase = xmlBuilder.valoreNodo("/root/access_method/query[@ajaxCheck='notinhier']/text()");
      System.out.println("AjaxCommandNotInHier.execute() qlphrase " + qlphrase);
      if (!qlphrase.trim().equals("")) {
        int intDoc = Integer.parseInt(StringUtils.substringAfter(qlphrase.toLowerCase(), "notinhier:"));
        QueryResult queryResult = xwconn.getQRFromHier(intDoc, true);
        String query = " NOT ([?SEL]=" + queryResult.id + ") AND ([UD,/xw/@UdType/]=\"" + workFlowBean.getArchive().getPne() + "\")";
View Full Code Here


    try {
      UserBean userBean = (UserBean) modelMap.get("userBean");
      confBean = (ConfBean) modelMap.get("confBean");
      WorkFlowBean workFlowBean = (WorkFlowBean) modelMap.get("workFlowBean");
      MultiEditingManager editingManager = new MultiEditingManager(parameterMap, confBean, userBean, workFlowBean);
      editingManager.setTheXML(new XMLBuilder("root"));
      confBean = editingManager.rewriteMultipleConf(confControl);
      QueryBean queryBean = new QueryBean();
      try {
        xwconn = connectionManager.getConnection(workFlowBean.getArchive());
        XMLBuilder theXMLconf = confBean.getTheXMLConfQuery();
        // System.out.println("theXMLconftheXMLconftheXMLconftheXMLconf " + theXMLconf);
        it.highwaytech.db.QueryResult qr = null;
        if (theXMLconf.valoreNodo("/root/query/@numDocInfoQuery").equals("")) {
          qr = xwconn.selectQR("([UD,/xw/@UdType/]=\"" + workFlowBean.getArchive().getPne() + "\")");
        } else {
          qr = xwconn.selectQR(theXMLconf.valoreNodo("/root/query/@numDocInfoQuery", false));
        }
        queryBean.setTotNumDoc(qr.elements);
        queryBean.setLastUpdate(xwconn.getLastUpdate());
      } catch (Exception e) {
        // TODO: handle exception
View Full Code Here

      UserBean userBean = (UserBean) modelMap.get("userBean");
      confBean = (ConfBean) modelMap.get("confBean");
      WorkFlowBean workFlowBean = (WorkFlowBean) modelMap.get("workFlowBean");
      xwconn = connectionManager.getConnection(workFlowBean.getArchive());
      MultiEditingManager editingManager = new MultiEditingManager(parameterMap, confBean, userBean, workFlowBean);
      editingManager.setTheXML(new XMLBuilder(xwconn.getSingleXMLFromNumDoc(Integer.parseInt(physDoc)), "ISO-8859-1"));     
      confBean = editingManager.rewriteMultipleConf(confControl);
      managingBean = new ManagingBean();
      if (!physDoc.equals("") && makeAction.equals("")) {
        it.highwaytech.db.QueryResult qr = xwconn.getSonsFromNumDoc(Integer.parseInt(physDoc));
        managingBean.setTitle((xwconn.getTitle(xwconn.connection, xwconn.getTheDb(), Integer.parseInt(physDoc))).getTitle());
View Full Code Here

      UserBean userBean = (UserBean) modelMap.get("userBean");
      confBean = (ConfBean) modelMap.get("confBean");
      WorkFlowBean workFlowBean = (WorkFlowBean) modelMap.get("workFlowBean");
      viewBean = new ViewBean();
      xwconn = connectionManager.getConnection(workFlowBean.getArchive());
      XMLBuilder theXMLDoc = null;
      String idCode = MyRequest.getParameter("idCode", parameterMap);
      String queryFix = MyRequest.getParameter("queryFix", parameterMap);
      String physDoc = MyRequest.getParameter("physDoc", parameterMap);
      queryFix = "" + queryFix + "=\"" + idCode + "\"";
      if (!physDoc.equals("")) {
        viewBean.setPhysDoc(Integer.parseInt(physDoc));
      } else {
        int docNumber = xwconn.getNumDocFromQRElement(xwconn.getQRfromPhrase(queryFix), 0);
        viewBean.setPhysDoc(docNumber);
      }

      viewBean.setDocXml(XMLCleaner.clearXwXML(xwconn.getSingleXMLFromNumDoc(viewBean.getPhysDoc()), true));
      theXMLDoc = new XMLBuilder(viewBean.getDocXml(), "ISO-8859-1");
      viewBean.setXmlBuilder(theXMLDoc);
      viewBean.setHierPath(xwconn.getHierPath(viewBean.getPhysDoc()));
      MultiEditingManager editingManager = new MultiEditingManager(parameterMap, confBean, userBean, workFlowBean);
      editingManager.setTheXML(viewBean.getXmlBuilder());
      confBean = editingManager.rewriteMultipleConf(confControl);
View Full Code Here

      WorkFlowBean workFlowBean = (WorkFlowBean) modelMap.get("workFlowBean");
      httpSession = workFlowBean.getRequest().getSession(false);
      xwconn = connectionManager.getConnection(workFlowBean.getArchive());

      MultiEditingManager editingManager = new MultiEditingManager(parameterMap, confBean, userBean, workFlowBean);
      editingManager.setTheXML(new XMLBuilder(xwconn.getSingleXMLFromNumDoc(Integer.parseInt(physDoc)), "ISO-8859-1"));
      confBean = editingManager.rewriteMultipleConf(confControl);
      managingBean.setSelid(selid);
      if (!physDoc.equals("") && makeAction.equals("true")) { // DO
        managingBean.setPhysDoc(Integer.parseInt(physDoc));
        ArrayList elementiNum = new ArrayList();
        if (applyTo.equals("selected") || applyTo.equals("prevSibling") || applyTo.equals("nextSibling")) {
          if (applyTo.equals("nextSibling")) {
            int theBrother = managingBean.getPhysDoc();
            RenumberUtils.Renumber rn = RenumberUtils.getSiblingRenumber(theValue, 1);
            while (theBrother > 0) {
              theBrother = xwconn.getNumDocNextBrother(theBrother);
              if (theBrother > 0) {
                Object[] value = new Object[2];
                value[0] = new Integer(theBrother);
                value[1] = rn.renumber();
                elementiNum.add(value);
              }
            }
          } else if (applyTo.equals("prevSibling")) {
            int theBrother = managingBean.getPhysDoc();
            RenumberUtils.Renumber rn = RenumberUtils.getSiblingRenumber(theValue, -1, Integer.parseInt(numZeri));
            while (theBrother > 0) {
              theBrother = xwconn.getNumDocPreviousBrother(theBrother);
              if (theBrother > 0) {
                Object[] value = new Object[2];
                value[0] = new Integer(theBrother);
                value[1] = rn.renumber();
                // elementiNum.add(new Integer(theBrother));
                elementiNum.add(value);
              }
            }
          } else {// DA SELEZIONE MULTIPLA
            RenumberUtils.Renumber rn = RenumberUtils.getSiblingRenumber(theValue, 1, Integer.parseInt(numZeri));
            ArrayList elementiNumTemp = ((ManagingBean) httpSession.getAttribute(workFlowBean.getManagingBeanName())).getListPhysDoc();
            for (int i = 0; i < elementiNumTemp.size(); i++) {
              Object[] value = new Object[2];
              value[0] = (Integer) (elementiNumTemp.get(i));
              value[1] = rn.renumber();
              elementiNum.add(value);
            }
          }
        } else {
          it.highwaytech.db.QueryResult qr = null;
          if (applyTo.equals("selid")) {
            qr = xwconn.getQRFromSelId(selid);
            RenumberUtils.Renumber rn = RenumberUtils.getSiblingRenumber(theValue, 1, Integer.parseInt(numZeri));

            for (int z = 0; z < qr.elements; z++) {
              int theNumber = xwconn.getNumDocFromQRElement(qr, z);
              Object[] value = new Object[2];
              value[0] = new Integer(theNumber);
              value[1] = rn.renumber();

              elementiNum.add(value);
            }
          } else if (applyTo.equals("sons")) {
            qr = xwconn.getSonsFromNumDoc(managingBean.getPhysDoc());
            RenumberUtils.Renumber rn = RenumberUtils.getSonsRenumber(theValue, Integer.parseInt(numZeri));

            for (int z = 0; z < qr.elements; z++) {
              int theNumber = xwconn.getNumDocFromQRElement(qr, z);
              Object[] value = new Object[2];
              value[0] = new Integer(theNumber);
              value[1] = rn.renumber();

              elementiNum.add(value);
            }
          } else if (applyTo.equals("hier")) {
            RenumberUtils.Renumber rn = RenumberUtils.getHierRenumber(theValue, Integer.parseInt(numZeri));

            qr = xwconn.getQRFromHier(managingBean.getPhysDoc(), true);
            for (int i = 0; i < qr.elements; i++) {
              int theNumber = xwconn.getNumDocFromQRElement(qr, i);
              int tmpLevel = (xwconn.getHierPath(theNumber)).depth();
              System.out.println("MultiModRenumberCommand.execute() " + tmpLevel);
              Object[] value = new Object[2];
              value[0] = new Integer(theNumber);
              value[1] = rn.renumber(tmpLevel, countBlock);
              elementiNum.add(value);
            }
          }
        }
        managingBean.setNumElementi(elementiNum.size());
        managingBean.setTitle((xwconn.getTitle(xwconn.connection, xwconn.getTheDb(), Integer.parseInt(physDoc))).getTitle());
        managingBean.setDispatchView("multiModResult");
        int totElementi = elementiNum.size();
        int processati = 0;
        int errori = 0;
        // HashMap laMappa = new HashMap();
        for (int i = 0; i < totElementi; i++) {
          int docCorrente = 0;
          try {
            docCorrente = ((Integer) (((Object[]) elementiNum.get(i))[0])).intValue();
          } catch (Exception e) {
            docCorrente = (Integer.parseInt((String) elementiNum.get(i)));
          }
          try {
             String docXML = xwconn.getSingleXMLFromNumDoc(docCorrente);
            XMLBuilder xmlBuilder = new XMLBuilder(docXML, "ISO-8859-1");
            String codiceGenerato = ((String) (((Object[]) elementiNum.get(i))[1]));
            xmlBuilder.insertValueAt(codiceId, codiceGenerato);
            xwconn.executeUpdateByDocNumber(xmlBuilder.getXML("ISO-8859-1"), docCorrente);
            processati++;
          } catch (Exception e) {
            managingBean.addErrorMsg(e.getMessage());
            errori++;
          }
View Full Code Here

      // String referer = aReq.getHeader("referer");
      // if (referer != null && referer.indexOf("ServletQueryParser") != -1) {
      // httpSession.setAttribute("physDoc", physDoc);
      // }

      XMLBuilder theXMLDoc = null;
      if (!selid.equals("") && !pos.equals("")) {
        // httpSession.setAttribute("posInQr", new Integer(pos));
        QueryResult queryResult = xwconn.getQRFromSelId(selid);
        String docXML = xwconn.getSingleXMLFromQr(queryResult, Integer.parseInt(pos), true);
        try {
          viewBean.setPhysDocNext(xwconn.getNumDocFromQRElement(queryResult, Integer.parseInt(pos) + 1));
        } catch (Exception e) {
          viewBean.setPhysDocNext(-1);
        }
        try {
          viewBean.setPhysDocPrev(xwconn.getNumDocFromQRElement(queryResult, Integer.parseInt(pos) - 1));
        } catch (Exception e) {
          viewBean.setPhysDocPrev(-1);
        }
        if (Integer.parseInt(pos) < queryResult.elements - 1) {
          viewBean.setPosNext(Integer.parseInt(pos) + 1);
        }
        if (queryResult.elements > 0) {
          viewBean.setPosPrev(Integer.parseInt(pos) - 1);
        }
        // System.out.println("1111111111111111111111111111111111111111");
        // System.out.println("ViewPageCommand.execute() PRIMA" + docXML);
        viewBean.setDocXml(XMLCleaner.clearXwXML(docXML, false));
        // System.out.println("ViewPageCommand.execute() viewBean.getDocXml() DOPO" + viewBean.getDocXml());
        // System.out.println("2222222222222222222222222222222");
        theXMLDoc = new XMLBuilder(viewBean.getDocXml(), "ISO-8859-1", "evid");
        // System.out.println("333333333333333333333333333333333333333333");
        // theXMLDoc = new XMLBuilder(viewBean.getDocXml(), "ISO-8859-1");
        theXMLDoc.setTheTerm("");
      } else {
        // System.out.println("4444444444444444444444444444444444444444444");
        viewBean.setDocXml(XMLCleaner.clearXwXML(xwconn.getSingleXMLFromNumDoc(viewBean.getPhysDoc()), true));
        theXMLDoc = new XMLBuilder(viewBean.getDocXml(), "ISO-8859-1");
        // System.out.println("555555555555555555555555555555555555555555");
      }
      // System.out.println("ViewPageCommand.execute() theXMLDoc "+theXMLDoc.getXML("ISO-8859-1"));
      viewBean.setXmlBuilder(theXMLDoc);
      MultiEditingManager editingManager = new MultiEditingManager(parameterMap, confBean, userBean, workFlowBean);
View Full Code Here

        managingBean.setPhysDoc(Integer.parseInt(physDoc));
        managingBean.setTitle((xwconn.getTitle(xwconn.connection, xwconn.getTheDb(), Integer.parseInt(physDoc))).getTitle());
        String docXmlToSet = xwconn.getSingleXMLFromNumDoc(managingBean.getPhysDoc());
        docXmlToSet = XMLCleaner.clearXwXML(docXmlToSet, true);
        if (xmlInteraction.equals("view")) {
          XMLBuilder parsedBuilder = new XMLBuilder(docXmlToSet, "ISO-8859-1");
          docXmlToSet = parsedBuilder.getXML("ISO-8859-1");
          docXmlToSet = docXmlToSet.replaceAll("<", "&#60;");
          docXmlToSet = docXmlToSet.replaceAll(">", "&#62;");
          docXmlToSet = docXmlToSet.replaceAll("\t", "&#160;&#160;&#160;");
          docXmlToSet = docXmlToSet.replaceAll("\n", "<br>");
        } else {
          XMLBuilder parsedBuilder = new XMLBuilder(docXmlToSet, "ISO-8859-1");
          docXmlToSet = parsedBuilder.getXML("ISO-8859-1");
        }
        managingBean.setDocXML(docXmlToSet);
        managingBean.setDocLowerBrother(xwconn.getNumDocNextBrother(managingBean.getPhysDoc()));
        managingBean.setDocUpperBrother(xwconn.getNumDocPreviousBrother(managingBean.getPhysDoc()));
        managingBean.setDocFather(xwconn.getNumDocFather(managingBean.getPhysDoc()));
        managingBean.setDocFirstSon(xwconn.getNumDocFirstSon(managingBean.getPhysDoc()));
        managingBean.setPos(pos);
        if (!selid.equals("")) {
          it.highwaytech.db.QueryResult qr = xwconn.getQRFromSelId(selid);
          managingBean.setNumElementi(qr.elements);
        }
        int posInt = -1;
        try {
          posInt = Integer.parseInt(managingBean.getPos());
        } catch (Exception e) {
          posInt = -1;
        }
        if (posInt > 0) {
          managingBean.setDocPrev(posInt - 1);
        } else {
          managingBean.setDocPrev(-1);
        }
        if (posInt < (managingBean.getNumElementi() - 1)) {
          managingBean.setDocNext(posInt + 1);
        } else {
          managingBean.setDocNext(-1);
        }
        managingBean.setDispatchView("xmlMenu");

      } else if (!physDoc.equals("") && makeAction.equals("true")) { // DO
        xwconn = connectionManager.getConnection(workFlowBean.getArchive());
        managingBean.setPhysDoc(Integer.parseInt(physDoc));
        managingBean.setDispatchView("xmlResult");
        int processati = 0;
        int errori = 0;
        try {
          docXML = docXML.replaceAll("&", "&amp;");
          docXML = docXML.replaceAll("&amp;#", "&#");
          XMLBuilder xmlBuilder = new XMLBuilder(docXML, "ISO-8859-1");
          OutputFormat outputFormat = new OutputFormat();
          outputFormat.setEncoding("ISO-8859-1");
          outputFormat.setIndent(true);
          outputFormat.setIndentSize(0);
          outputFormat.setNewlines(true);
          // outputFormat.setTrimText(true);
          xwconn.executeUpdateByDocNumber(XMLCleaner.clearXwXML(xmlBuilder.getXML(outputFormat), false), managingBean.getPhysDoc());
          processati++;
        } catch (Exception e) {
          managingBean.addErrorMsg(e.getMessage());
          errori++;
        }
        managingBean.setTitle((xwconn.getTitle(xwconn.connection, xwconn.getTheDb(), managingBean.getPhysDoc())).getTitle());
        managingBean.setDocSuccessi(processati);
        managingBean.setDocErrori(errori);
      }

      MultiEditingManager editingManager = new MultiEditingManager(parameterMap, confBean, userBean, workFlowBean);
      editingManager.setTheXML(new XMLBuilder(xwconn.getSingleXMLFromNumDoc(managingBean.getPhysDoc()), "ISO-8859-1"));
      confBean = editingManager.rewriteMultipleConf(confControl);

      modelMap.put("confBean", confBean);
      modelMap.put("managingBean", managingBean);
    } catch (Exception e) {
View Full Code Here

      workFlowBean = (WorkFlowBean) modelMap.get("workFlowBean");
      httpSession = workFlowBean.getRequest().getSession(false);

      xwconn = connectionManager.getConnection(workFlowBean.getArchive());
      MultiEditingManager editingManager = new MultiEditingManager(req.getParameterMap(), confBean, userBean, workFlowBean);
      editingManager.setTheXML(new XMLBuilder(xwconn.getSingleXMLFromNumDoc(Integer.parseInt(physDoc)), "ISO-8859-1"));
      confBean = editingManager.rewriteMultipleConf(confControl);

      ModifyAuther modifyAuther = new ModifyAuther(req.getParameterMap(), modelMap);
      /*
       * qui forse ho un problema, forse � meglio non estendere ModifyAutherBean a MangingBean, ma semplicemente metterci un addModifyAutherBean e quindi un get e set all'interno di ManaginBean.
View Full Code Here

      UserBean userBean = (UserBean) modelMap.get("userBean");
      confBean = (ConfBean) modelMap.get("confBean");
      WorkFlowBean workFlowBean = (WorkFlowBean) modelMap.get("workFlowBean");
      httpSession = workFlowBean.getRequest().getSession(false);
      MultiEditingManager editingManager = new MultiEditingManager(parameterMap, confBean, userBean, workFlowBean);
      editingManager.setTheXML(new XMLBuilder("root"));
      confBean = editingManager.rewriteMultipleConf(confControl);
      // mettere queryBean
      System.out.println("QueryParserCommand.execute() workFlowBean.getAlias() " + workFlowBean.getAlias());
      System.out.println("QueryParserCommand.execute() aReq.getParameter(\"fromId\") " + workFlowBean.getRequest().getParameter("fromId") + "aaaaaaa");
      List<MultiArchiveBean> multiArchiveBeans = new ArrayList<MultiArchiveBean>();
View Full Code Here

    try {
      UserBean userBean = (UserBean) modelMap.get("userBean");
      confBean = (ConfBean) modelMap.get("confBean");
      WorkFlowBean workFlowBean = (WorkFlowBean) modelMap.get("workFlowBean");
      MultiEditingManager editingManager = new MultiEditingManager(parameterMap, confBean, userBean, workFlowBean);
      editingManager.setTheXML(new XMLBuilder("root"));
      confBean = editingManager.rewriteMultipleConf(confControl);
     
      confBean.setTheXMLConfQuery(confBean.getTheXMLConfQueryMultiArchive());
      QueryBean queryBean = new QueryBean();
      try {
        xwconn = connectionManager.getConnection(workFlowBean.getArchive());
        XMLBuilder theXMLconf = confBean.getTheXMLConfQuery();
        // System.out.println("theXMLconftheXMLconftheXMLconftheXMLconf " + theXMLconf);
        it.highwaytech.db.QueryResult qr = null;
        if (theXMLconf.valoreNodo("/root/query/@numDocInfoQuery").equals("")) {
          qr = xwconn.selectQR("([UD,/xw/@UdType/]=\"" + workFlowBean.getArchive().getPne() + "\")");
        } else {
          qr = xwconn.selectQR(theXMLconf.valoreNodo("/root/query/@numDocInfoQuery", false));
        }
        queryBean.setTotNumDoc(qr.elements);
        queryBean.setLastUpdate(xwconn.getLastUpdate());
      } catch (Exception e) {
        // TODO: handle exception
View Full Code Here

TOP

Related Classes of org.xdams.xml.builder.XMLBuilder

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.