Package org.xdams.xml.builder

Examples of org.xdams.xml.builder.XMLBuilder$CharUtil


      String xmlUsers = ConfManager.getConfString(userDetails.getAccount() + "-security/users.xml");
      String xmlArchives = ConfManager.getConfString(userDetails.getAccount() + "-security/accounts.xml");
      String xmlrole = ConfManager.getConfString(userDetails.getAccount() + "-security/role.xml");
      return LoadUserSpeedUp.loadUserByString(xmlUsers, xmlArchives, xmlrole, userDetails.getId(), userDetails.getAccount());
    } else {
      XMLBuilder xmlUsers = ConfManager.getConfXML(userDetails.getAccount() + "-security/users.xml");
      XMLBuilder xmlArchives = ConfManager.getConfXML(userDetails.getAccount() + "-security/accounts.xml");
      XMLBuilder xmlrole = ConfManager.getConfXML(userDetails.getAccount() + "-security/role.xml");
      return LoadUser.loadUser(xmlUsers, xmlArchives, xmlrole, userDetails.getId(), userDetails.getAccount());
    }
  }
View Full Code Here


  private XMLBuilder evaluteXml(XMLBuilder theXMLconf, PageContext pageContext) {
    if (pageContext != null) {
      try {
        String xmlConfstr = theXMLconf.getXML("ISO-8859-1");
        xmlConfstr = ExpressionEvaluationUtils.evaluateString(xmlConfstr, xmlConfstr, pageContext);
        return new XMLBuilder(xmlConfstr, false);
      } catch (Exception e) {
        return theXMLconf;
      }
    }
    return theXMLconf;
View Full Code Here

  private List<String> outputDataField = new ArrayList<String>();

  private List<String> outputSortField = new ArrayList<String>();

  public void generateView(WorkFlowBean workFlowBean, ConfBean confBean, UserBean userBean,ModelMap modelMap) throws UnsupportedEncodingException, TransformerException, XMLException {
    XMLBuilder theXMLconf = confBean.getTheXMLConfQuery();
    //System.out.println("QueryPageView.generateView() "+theXMLconf.getXML("ISO-8859-1"));
    String perPageNew = "10";
    // INIZIO /query/element per i dizionari e ric libera
    String prefix = "/root/query/element";
    Map<String, String> hashOutputField = null;

    List<Map<String, String>> arrLabel = new ArrayList<Map<String, String>>();
    int numField = theXMLconf.contaNodi(prefix);
    for (int i = 0; i < numField; i++) {
      hashOutputField = new HashMap<String, String>();
      String positionDiv = theXMLconf.valoreNodo(prefix + "[" + (i + 1) + "]/@position");
      String attrLabel = theXMLconf.valoreNodo(prefix + "[" + (i + 1) + "]/@label");
      String attrFirstIdx = theXMLconf.valoreNodo(prefix + "[" + (i + 1) + "]/@firstIdx");
      String attrTypology = theXMLconf.valoreNodo(prefix + "[" + (i + 1) + "]/@typology");
      String attrExternalPath = theXMLconf.valoreNodo(prefix + "[" + (i + 1) + "]/@externalPath");
      String attrValue = theXMLconf.valoreNodo(prefix + "[" + (i + 1) + "]/@value");
      String activeIdx = theXMLconf.valoreNodo(prefix + "[" + (i + 1) + "]/@activeIdx");
      String filteredKey = theXMLconf.valoreNodo(prefix + "[" + (i + 1) + "]/@filteredKey");
      String filteredNumDocs = theXMLconf.valoreNodo(prefix + "[" + (i + 1) + "]/@filteredNumDocs");
      String ajaxKey = theXMLconf.valoreNodo(prefix + "[" + (i + 1) + "]/@ajaxKey");
      String nameValue = theXMLconf.valoreNodo(prefix + "[" + (i + 1) + "]/text()");
      String genericFind = theXMLconf.valoreNodo(prefix + "[" + (i + 1) + "]/@genericFind");
      String selectAddEmptyValue = theXMLconf.valoreNodo(prefix + "[" + (i + 1) + "]/@addEmptyValue");
      if (genericFind.equals("true")) {
        continue;
      }
      String outputField = "";
      String nameValueEncoded = URLEncoder.encode(nameValue, "iso-8859-1").replaceAll("%", "").replaceAll("\\*", "");
      if (attrTypology.equals("radio")) {
        String ilValoreCorrente = attrValue;
        XMLBuilder theXMLconfTMP = confBean.getTheXMLValControllati();
        String thisExternalPath = attrExternalPath;
        int nodiOpzioni = theXMLconfTMP.contaNodi(thisExternalPath);
        if (theXMLconfTMP.contaNodi(thisExternalPath + "[@value = '']") == 0 && (!selectAddEmptyValue.equals("") && selectAddEmptyValue.equals("yes"))) {
          outputField = "<input type=\"radio\" name=\"[" + nameValue + "]\" value=\"\" checked=\"true\" />nessun valore";
        }
        for (int a = 0; a < nodiOpzioni; a++) {
          outputField += "<input type=\"radio\" name=\"[" + nameValue + "]\" value=\"" + theXMLconfTMP.valoreNodo(thisExternalPath + "[" + (a + 1) + "]/@value") + "\" />" + theXMLconfTMP.valoreNodo(thisExternalPath + "[" + (a + 1) + "]/text()").replaceAll(" ", "&#160;");
        }
      } else if (attrTypology.equals("select")) {
        String ilValoreCorrente = attrValue;
        XMLBuilder theXMLconfTMP = confBean.getTheXMLValControllati();
        String thisExternalPath = attrExternalPath;
        int nodiOpzioni = theXMLconfTMP.contaNodi(thisExternalPath);
        outputField = "<select class=\"text\" name=\"[" + nameValue + "]\" id=\"" + nameValueEncoded + "\">";
        if (theXMLconfTMP.contaNodi(thisExternalPath + "[@value = '']") == 0 && (!selectAddEmptyValue.equals("") && selectAddEmptyValue.equals("yes"))) {
          outputField += "<option value=\"\" selected=\"true\">nessun valore</option>";
        }
        for (int a = 0; a < nodiOpzioni; a++) {
          outputField += "<option  value=\"" + theXMLconfTMP.valoreNodo(thisExternalPath + "[" + (a + 1) + "]/@value") + "\">" + theXMLconfTMP.valoreNodo(thisExternalPath + "[" + (a + 1) + "]/text()").replaceAll(" ", "&#160;") + "</option>";
        }
        outputField += "</select>";
      } else if (attrTypology.equals("hidden")) {
        outputField = "<input name=\"[" + nameValue + "]\" type=\"hidden\" class=\"long\" id=\"" + nameValueEncoded + "\" value=\"" + attrValue + "\"/>";
      } else if (attrTypology.equals("wrap")) {
        String prefixSub = prefix + "[" + (i + 1) + "]/element";
        int numFieldSub = theXMLconf.contaNodi(prefixSub);
        outputField = "<div id=\"" + URLEncoder.encode(prefixSub, "iso-8859-1").replaceAll("%", "") + "\"><select onchange=\"return showInput(this.value)\" class=\"text\" style=\"float:left\"><option value=" + URLEncoder.encode(prefixSub, "iso-8859-1").replaceAll("%", "")
            + " selected=\"true\">scegli...</option>";
        for (int a = 0; a < numFieldSub; a++) {
          outputField += "<option value=\"" + URLEncoder.encode(prefixSub + (a + 1), "iso-8859-1").replaceAll("%", "") + "\">" + theXMLconf.valoreNodo(prefixSub + "[" + (a + 1) + "]/@label") + "</option>";
        }
        outputField += "</select>";
        for (int a = 0; a < numFieldSub; a++) {
          attrFirstIdx = theXMLconf.valoreNodo(prefixSub + "[" + (a + 1) + "]/@firstIdx");
          attrTypology = theXMLconf.valoreNodo(prefixSub + "[" + (a + 1) + "]/@typology");
          attrExternalPath = theXMLconf.valoreNodo(prefixSub + "[" + (a + 1) + "]/@externalPath");
          attrValue = theXMLconf.valoreNodo(prefixSub + "[" + (a + 1) + "]/@value");
          activeIdx = theXMLconf.valoreNodo(prefixSub + "[" + (a + 1) + "]/@activeIdx");
          filteredKey = theXMLconf.valoreNodo(prefixSub + "[" + (a + 1) + "]/@filteredKey");
          filteredNumDocs = theXMLconf.valoreNodo(prefixSub + "[" + (a + 1) + "]/@filteredNumDocs");
          ajaxKey = theXMLconf.valoreNodo(prefixSub + "[" + (a + 1) + "]/@ajaxKey");
          nameValue = theXMLconf.valoreNodo(prefixSub + "[" + (a + 1) + "]/text()");
          nameValueEncoded = URLEncoder.encode(nameValue, "iso-8859-1").replaceAll("%", "").replaceAll("\\*", "");
          if ((activeIdx.equals("yes") || ajaxKey.equals("yes"))) {
            String ajaxStr = "";
            if (ajaxKey.equals("yes")) {
              String idJs = nameValueEncoded;
              idJs = idJs.replaceAll("%", "");
              idJs = idJs.replaceAll(",", "");
              idJs = idJs.replaceAll("-", "");
              String attrTypologyAjax = attrTypology.equals("double") ? "doubleQuery" : attrTypology;
              outputField += "<div class=\"queryEleSub\" id=\"" + URLEncoder.encode(prefixSub + (a + 1), "iso-8859-1").replaceAll("%", "") + "\"><input name=\"[" + nameValue + "]\" type=\"text\" class=\"long complete\" id=\"" + nameValueEncoded
                  + "\" servlet=\""+modelMap.get("contextPath")+"/"+workFlowBean.getAlias()+"/ajax.html?actionFlag=vocabolarioJson&key=" + nameValue + "&typology=" + attrTypologyAjax + "&attrFirstIdx=" + attrFirstIdx + "&numKeys=20\" />";
              if (activeIdx.equals("yes")) {
                outputField += "<a title=\"accedi al dizionario del campo\" href=\"#n\" onclick=\"return apriIdx(document.theForm['[" + nameValue + "]'],'" + confBean.getKeyCountIDX() + "','" + workFlowBean.getArchive().getAlias() + "','" + nameValue + "','"
                    + attrTypology.replaceAll("Query", "").replaceAll("Reverse", "") + "','" + filteredKey + "','" + attrFirstIdx + "','" + filteredNumDocs + "');\"><img src=\"" + modelMap.get("frontUrl")
                    + "/img/spacer.gif\" class=\"diz\" border=\"0\" alt=\"apri dizionario di campo\" /></a>";
              }
              outputField += "</div>";
            } else {
              outputField += "<div class=\"queryEleSub\" id=\"" + URLEncoder.encode(prefixSub + (a + 1), "iso-8859-1").replaceAll("%", "") + "\"><input name=\"[" + nameValue + "]\" type=\"text\" class=\"long\" id=\"" + nameValueEncoded + "\" " + ajaxStr
                  + "/><a title=\"accedi al dizionario del campo\" href=\"#n\" onclick=\"return apriIdx(document.theForm['[" + nameValue + "]'],'" + confBean.getKeyCountIDX() + "','" + workFlowBean.getArchive().getAlias() + "','" + nameValue + "','"
                  + attrTypology.replaceAll("Query", "").replaceAll("Reverse", "") + "','" + filteredKey + "','" + attrFirstIdx + "','" + filteredNumDocs + "');\"><img src=\"" + modelMap.get("frontUrl")
                  + "/img/spacer.gif\" class=\"diz\" border=\"0\" alt=\"apri dizionario di campo\" /></a></div>";
            }
          } else {
            outputField += "<div class=\"queryEleSub\" id=\"" + URLEncoder.encode(prefixSub + (a + 1), "iso-8859-1").replaceAll("%", "") + "\"><input name=\"[" + nameValue + "]\" type=\"text\" class=\"long\" id=\"" + nameValueEncoded + "\" /></div>";
          }
        }
        outputField += "</div>";
      } else {
        if (!activeIdx.equals("") && activeIdx.equals("yes")) {
          String ajaxStr = "";
          if (ajaxKey.equals("yes") || ajaxKey.equals("yes")) {
            String idJs = nameValueEncoded;
            idJs = idJs.replaceAll("%", "");
            idJs = idJs.replaceAll(",", "");
            idJs = idJs.replaceAll("-", "");
            String attrTypologyAjax = attrTypology.equals("double") ? "doubleQuery" : attrTypology;
            outputField += "<input name=\"[" + nameValue + "]\" type=\"text\" class=\"long complete\" id=\"" + nameValueEncoded + "\" servlet=\""+modelMap.get("contextPath")+"/"+workFlowBean.getAlias()+"/ajax.html?actionFlag=vocabolarioJson&key=" + nameValue + "&typology=" + attrTypologyAjax + "&attrFirstIdx=" + attrFirstIdx
                + "&numKeys=20\" />";
            if (activeIdx.equals("yes")) {
              outputField += "<a title=\"accedi al dizionario del campo\" href=\"#n\" onclick=\"return apriIdx(document.theForm['[" + nameValue + "]'],'" + confBean.getKeyCountIDX() + "','" + workFlowBean.getArchive().getAlias() + "','" + nameValue + "','"
                  + attrTypology.replaceAll("Query", "").replaceAll("Reverse", "") + "','" + filteredKey + "','" + attrFirstIdx + "','" + filteredNumDocs + "');\"><img src=\"" + modelMap.get("frontUrl")
                  + "/img/spacer.gif\" class=\"diz\" border=\"0\" alt=\"apri dizionario di campo\" /></a>";
            }
          } else {
            outputField = "<input name=\"[" + nameValue + "]\" type=\"text\" class=\"long\" id=\"" + nameValueEncoded + "\" " + ajaxStr + "/><a title=\"accedi al dizionario del campo\" href=\"#n\" onclick=\"return apriIdx(document.theForm['[" + nameValue + "]'],'"
                + confBean.getKeyCountIDX() + "','" + workFlowBean.getArchive().getAlias() + "','" + nameValue + "','" + attrTypology.replaceAll("Query", "").replaceAll("Reverse", "") + "','" + filteredKey + "','" + attrFirstIdx + "','" + filteredNumDocs + "');\"><img src=\""
                + modelMap.get("frontUrl") + "/img/spacer.gif\" class=\"diz\" border=\"0\" alt=\"apri dizionario di campo\" /></a>";
          }
        } else {
          outputField = "<input name=\"[" + nameValue + "]\" type=\"text\" class=\"long\" id=\"" + nameValueEncoded + "\" />";
        }
      }

      hashOutputField.put(attrLabel, outputField);
      if (getPositionMap().containsKey(positionDiv)) {
        arrLabel = (ArrayList<Map<String, String>>) getPositionMap().get(positionDiv);
        arrLabel.add(hashOutputField);
        getPositionMap().put(positionDiv, arrLabel);
      } else {
        arrLabel = new ArrayList<Map<String, String>>();
        arrLabel.add(hashOutputField);
        getPositionMap().put(positionDiv, arrLabel);
      }

    }// end for master
      // FINE /query/element per i dizionari e ric libera

    // INIZO DATE /root/query/data/element
    prefix = "/root/query/data/element";
    numField = theXMLconf.contaNodi(prefix);

    for (int z = 0; z < numField; z++) {
      String outputField = "";
      String nameValue = theXMLconf.valoreNodo(prefix + "[" + (z + 1) + "]/text()");
      String attrLabel = theXMLconf.valoreNodo(prefix + "[" + (z + 1) + "]/@label");
      String nameValueEncoded = URLEncoder.encode(nameValue, "iso-8859-1").replaceAll("%", "").replaceAll("\\*", "");
      outputField += "<div class=\"ml20mt30\"><label>" + attrLabel + "</label></div>\n";
      outputField += "<div class=\"ml20\"><input type=\"text\" onblur=\"return findDate(document.theForm,'normalize',this,'day')\" class=\"data\" size=\"3\" name=\"giorno_ini\" maxlength=\"2\" />&#160;/&#160;<input type=\"text\" onblur=\"return findDate(document.theForm,'normalize',this,'month')\" class=\"data\"  size=\"3\" name=\"mese_ini\" maxlength=\"2\" />&#160;/&#160;<input type=\"text\" onblur=\"return findDate(document.theForm,'normalize',this,'year')\" class=\"data\" name=\"anno_ini\" maxlength=\"4\" />&#160;-&#160;<input type=\"text\" onblur=\"return findDate(document.theForm,'normalize',this,'day')\" class=\"data\"  size=\"3\"  name=\"giorno_fin\" maxlength=\"2\" />&#160;/&#160;<input type=\"text\" onblur=\"return findDate(document.theForm,'normalize',this,'month')\" class=\"data\"  size=\"3\" name=\"mese_fin\" maxlength=\"2\" />&#160;/&#160;<input type=\"text\" onblur=\"return findDate(document.theForm,'normalize',this,'year')\" class=\"data\" name=\"anno_fin\" maxlength=\"4\" />&#160;&#160;&#160;<input type=\"checkbox\" name=\"dataEsatta\" />esatta</div>\n";
      getOutputDataField().add(outputField);
    }
    prefix = "/root/query/hour/element";
    numField = theXMLconf.contaNodi(prefix);
    for (int z = 0; z < numField; z++) {
      String outputField = "";
      String nameValue = theXMLconf.valoreNodo(prefix + "[" + (z + 1) + "]/text()");
      String attrLabel = theXMLconf.valoreNodo(prefix + "[" + (z + 1) + "]/@label");
      String nameValueEncoded = URLEncoder.encode(nameValue, "iso-8859-1").replaceAll("%", "").replaceAll("\\*", "");
      outputField += "<div class=\"ml20mt30\"><label>" + attrLabel + "</label></div>\n";
      outputField += "<div class=\"ml20\"><input type=\"hidden\" name=\"[" + nameValue + "]\" title=\"[" + nameValue
          + "]\"/><input type=\"text\" class=\"data\" size=\"2\" name=\"ora_ini\" maxlength=\"2\" onblur=\"return oraNormal(document.theForm['ora_ini'],document.theForm['ora_fine'],document.theForm['[" + nameValue
          + "]'])\"/> <input type=\"text\" class=\"data\" name=\"ora_fine\" maxlength=\"2\" size=\"2\" onblur=\"return oraNormal(document.theForm['ora_ini'],document.theForm['ora_fine'],document.theForm['[" + nameValue + "]'])\"/> </div>\n";
      getOutputHourField().add(outputField);
    }
    // INIZIO ORDINAMENTO
    prefix = "/root/query/sort/element";
    numField = theXMLconf.contaNodi(prefix);
    String strChecked = "";
    for (int z = 0; z < numField; z++) {
      String outputField = "";
      if (z == 0) {
        outputField = "<div class=\"ml20mt30\"><label>Criteri di ordinamento:</label></div>";
        outputField += "<div class=\"ml20\"><select class=\"text\" onchange=\"return cambiaCriterio(this.value,document.theForm)\" name=\"ordinaCrescenteDecsrescente\"><option value=\"XML\">crescente</option><option value=\"xml\">decrescente</option></select>";
      }
      strChecked = "";
      if ((theXMLconf.valoreNodo(prefix + "[" + (z + 1) + "]/@checked").equals("yes"))) {
        strChecked = "checked=\"checked\"";
      }

      String nameValue = theXMLconf.valoreNodo(prefix + "[" + (z + 1) + "]/text()");
      String attrLabel = theXMLconf.valoreNodo(prefix + "[" + (z + 1) + "]/@label");
      outputField += "<input type=\"radio\" class=\"ml15\" name=\"sorting\" " + strChecked + " value=\"" + nameValue + "\" />" + attrLabel;
      if (numField - 1 == z) {
        outputField += "</div>";
      }
      getOutputSortField().add(outputField);
    }
    // FINE ORIDINAMENTO

    // INIZIO /query/element per i dizionari AMMINISTRATIVI
    Map<String, String> hashOutputFieldAdm = null;
    List<Map<String, String>> arrLabelAdm = new ArrayList<Map<String, String>>();
    if (userBean.getRole().equals("ROLE_ADMIN")) {
      prefix = "/root/queryAdm/element";
      numField = theXMLconf.contaNodi(prefix);
      for (int i = 0; i < numField; i++) {
        hashOutputFieldAdm = new HashMap<String, String>();
        String positionDiv = theXMLconf.valoreNodo(prefix + "[" + (i + 1) + "]/@position");
        String attrLabel = theXMLconf.valoreNodo(prefix + "[" + (i + 1) + "]/@label");
        String attrFirstIdx = theXMLconf.valoreNodo(prefix + "[" + (i + 1) + "]/@firstIdx");
        String attrTypology = theXMLconf.valoreNodo(prefix + "[" + (i + 1) + "]/@typology");
        String attrExternalPath = theXMLconf.valoreNodo(prefix + "[" + (i + 1) + "]/@externalPath");
        String attrValue = theXMLconf.valoreNodo(prefix + "[" + (i + 1) + "]/@value");
        String activeIdx = theXMLconf.valoreNodo(prefix + "[" + (i + 1) + "]/@activeIdx");
        String nameValue = theXMLconf.valoreNodo(prefix + "[" + (i + 1) + "]/text()");
        String filteredKey = theXMLconf.valoreNodo(prefix + "[" + (i + 1) + "]/@filteredKey");
        String filteredNumDocs = theXMLconf.valoreNodo(prefix + "[" + (i + 1) + "]/@filteredNumDocs");
        String ajaxKey = theXMLconf.valoreNodo(prefix + "[" + (i + 1) + "]/@ajaxKey");
        String selectAddEmptyValue = theXMLconf.valoreNodo(prefix + "[" + (i + 1) + "]/@addEmptyValue");
        String outputField = "";
        String nameValueEncoded = URLEncoder.encode(nameValue, "iso-8859-1").replaceAll("%", "").replaceAll("\\*", "");
        if (attrTypology.equals("radio")) {
          String ilValoreCorrente = attrValue;
          XMLBuilder theXMLconfTMP = confBean.getTheXMLValControllati();
          String thisExternalPath = attrExternalPath;
          int nodiOpzioni = theXMLconfTMP.contaNodi(thisExternalPath);
          if (theXMLconfTMP.contaNodi(thisExternalPath + "[@value = '']") == 0 && (!selectAddEmptyValue.equals("") && selectAddEmptyValue.equals("yes"))) {
            outputField = "<input type=\"radio\" name=\"[" + nameValue + "]\" value=\"\" checked=\"true\" >nessun valore";
          }
          for (int a = 0; a < nodiOpzioni; a++) {
            outputField += "<input type=\"radio\" name=\"[" + nameValue + "]\" value=\"" + theXMLconfTMP.valoreNodo(thisExternalPath + "[" + (a + 1) + "]/@value") + "\">" + theXMLconfTMP.valoreNodo(thisExternalPath + "[" + (a + 1) + "]/text()").replaceAll(" ", "&#160;");
          }
        } else if (attrTypology.equals("select")) {
          String ilValoreCorrente = attrValue;
          XMLBuilder theXMLconfTMP = confBean.getTheXMLValControllati();
          String thisExternalPath = attrExternalPath;
          int nodiOpzioni = theXMLconfTMP.contaNodi(thisExternalPath);
          outputField = "<select class=\"text\" name=\"[" + nameValue + "]\">";
          if (theXMLconfTMP.contaNodi(thisExternalPath + "[@value = '']") == 0 && (!selectAddEmptyValue.equals("") && selectAddEmptyValue.equals("yes"))) {
            outputField += "<option value=\"\" selected=\"true\">nessun valore</option>";
          }
          for (int a = 0; a < nodiOpzioni; a++) {
            outputField += "<option  value=\"" + theXMLconfTMP.valoreNodo(thisExternalPath + "[" + (a + 1) + "]/@value") + "\">" + theXMLconfTMP.valoreNodo(thisExternalPath + "[" + (a + 1) + "]/text()").replaceAll(" ", "&#160;") + "</option>";
          }
          outputField += "</select>";
        } else if (attrTypology.equals("hidden")) {
          outputField = "<input name=\"[" + nameValue + "]\" type=\"hidden\" class=\"long\" id=\"" + nameValueEncoded + "\" value=\"" + attrValue + "\"/>";
        } else {
View Full Code Here

    if (valoreCorrente.indexOf("document:") == 0) {
      String fullPath = valoreCorrente.replaceAll("document:", "");
      // com.regesta.dams.utility.xml.DomManager domManager = com.regesta.dams.utility.xml.DomManager.getInstance(isStatic, realPath);
      // XMLBuilder theXMLconfTMP = new XMLBuilder(domManager.getDocument(fullPath));
      System.out.println("1111 fullPath " + fullPath);
      XMLBuilder theXMLconfTMP = ConfManager.getConfXML(fullPath);// new XMLBuilder(domManager.getDocument(fullPath));
      String externalPath = theXMLconf.valoreNodo(nodoCorrente + "/@externalPath");
      int nodiOpzioni = theXMLconfTMP.contaNodi(externalPath);
      if (inputType.equals("select")) {
        out.println("<select   name=\"" + xpathCorrenteDot + "\" class=\"docEditInput\"  " + extra + ">");
        for (int a = 0; a < nodiOpzioni; a++) {
          extraPlus = "";
          if (theValue.equalsIgnoreCase(theXMLconfTMP.valoreNodo(externalPath + "[" + (a + 1) + "]/@value"))) {
            extraPlus = " selected=\"selected\" ";
          }
          if (theValue.equals("") && (theXMLconfTMP.valoreNodo(externalPath + "[" + (a + 1) + "]/@selected")).equals("true")) {
            extraPlus = " selected=\"selected\" ";
          }
          out.println(generateInput("option", theXMLconfTMP.valoreNodo(externalPath + "[" + (a + 1) + "]/@value"), theXMLconfTMP.valoreNodo(externalPath + "[" + (a + 1) + "]/text()"), "", extraPlus, ""));
        }
        out.println("</select>&#160;" + theHTMLextra);
      } else {
        for (int a = 0; a < nodiOpzioni; a++) {
          extraPlus = "";
          if (theValue.equalsIgnoreCase(theXMLconfTMP.valoreNodo(externalPath + "[" + (a + 1) + "]/@value"))) {
            extraPlus = " checked=\"checked\" ";
          }
          out.println(generateInput("radio", xpathCorrenteDot, theXMLconfTMP.valoreNodo(externalPath + "[" + (a + 1) + "]/@value"), theXMLconfTMP.valoreNodo(externalPath + "[" + (a + 1) + "]/text()"), "docEditInputRadio", extra + " " + extraPlus, theHTMLextra));
        }
      }
    } else if (valoreCorrente.indexOf("ajax:") == 0) {
      String fullPath = valoreCorrente.replaceAll("ajax:", "");
      // com.regesta.dams.utility.xml.DomManager domManager = com.regesta.dams.utility.xml.DomManager.getInstance(isStatic, realPath);
      // XMLBuilder theXMLconfTMP = new XMLBuilder(domManager.getDocument(fullPath));
      System.out.println("2222 fullPath " + fullPath);
      XMLBuilder theXMLconfTMP = ConfManager.getConfXML(fullPath);
      // System.out.println("FormGenerator.generateCustomDataDieg()3333333333333333333333 theXMLconfTMP "+theXMLconfTMP.getXML("ISO-8859-1"));
      String externalPath = theXMLconf.valoreNodo(nodoCorrente + "/@externalPath");
      int nodiOpzioni = theXMLconfTMP.contaNodi(externalPath);
      if (inputType.equals("select")) {// title=\"" +
        // xpathCorrenteDot.replace('.',
        // '/') + "\"
        out.println("<span><select  onfocus=\"setCurrInput(this);ajaxGetValues(this,'" + fullPath + "','" + StringEscapeUtils.escapeEcmaScript(externalPath) + "')\"  name=\"" + xpathCorrenteDot + "\" class=\"docEditInput\"  " + extra + ">");
        for (int a = 0; a < nodiOpzioni; a++) {
          extraPlus = "";
          if (theValue.equalsIgnoreCase(theXMLconfTMP.valoreNodo(externalPath + "[" + (a + 1) + "]/@value"))) {
            extraPlus = "selected";
            out.println(generateInput("option", theXMLconfTMP.valoreNodo(externalPath + "[" + (a + 1) + "]/@value"), theXMLconfTMP.valoreNodo(externalPath + "[" + (a + 1) + "]/text()"), "", extraPlus, ""));
          }
        }
        out.println("</select></span>&#160;" + theHTMLextra);
      } else {
        // NON IMPLEMENTABILI RADIOBUTTON AJAX
View Full Code Here

          fullPath = "valoriControllati.xml";
        }
        // com.regesta.dams.utility.xml.DomManager domManager = com.regesta.dams.utility.xml.DomManager.getInstance(isStatic, realPath);
        // XMLBuilder theXMLconfTMP = new XMLBuilder(domManager.getDocument(fullPath));
        System.out.println("333 fullPath " + fullPath);
        XMLBuilder theXMLconfTMP = ConfManager.getConfXML(fullPath);// new XMLBuilder(domManager.getDocument(fullPath));
        String externalPath = "/root/elemento[@name='secolo']/opzione";
        int nodiOpzioni = theXMLconfTMP.contaNodi(externalPath);
        String theValue = theXML.valoreNodo(prefix + "/date/text()");
        for (int a = 0; a < nodiOpzioni; a++) {
          String extra = "";
          if (theValue.equals(theXMLconfTMP.valoreNodo(externalPath + "[" + (a + 1) + "]/@value"))) {
            extra = "selected";
          }
          out.println(generateInput("option", theXMLconfTMP.valoreNodo(externalPath + "[" + (a + 1) + "]/@value"), theXMLconfTMP.valoreNodo(externalPath + "[" + (a + 1) + "]/text()"), "", extra, ""));
        }
        out.println("</select></td><td width=\"20\"><span style=\"font-size:1px\">&#160;</span></td>");
        out.println("</tr>");
      }
      out.println("<tr>");
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);
      if (httpSession.getAttribute(workFlowBean.getManagingBeanName()) != null) {
        managingBean = ((ManagingBean) httpSession.getAttribute(workFlowBean.getManagingBeanName()));
      } else {
        managingBean = new ManagingBean();
View Full Code Here

      confBean = (ConfBean) modelMap.get("confBean");
      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("")) {
        managingBean.setPhysDoc(Integer.parseInt(physDoc));
        managingBean.setDocLowerBrother(xwconn.getNumDocNextBrother(managingBean.getPhysDoc()));
        managingBean.setDocUpperBrother(xwconn.getNumDocPreviousBrother(managingBean.getPhysDoc()));
        it.highwaytech.db.QueryResult qrSons = xwconn.getSonsFromNumDoc(managingBean.getPhysDoc());
        managingBean.setNumElementiSons(qrSons.elements);
        it.highwaytech.db.QueryResult qrHier = xwconn.getQRFromHier(managingBean.getPhysDoc(), false);
        managingBean.setNumElementiHier(qrHier.elements);
        if (!selid.equals("")) {
          it.highwaytech.db.QueryResult qr = xwconn.getQRFromSelId(selid);
          managingBean.setNumElementi(qr.elements);
        }
        managingBean.setTitle((xwconn.getTitle(xwconn.connection, xwconn.getTheDb(), managingBean.getPhysDoc())).getTitle());
        managingBean.setDocXML(xwconn.getSingleXMLFromNumDoc(managingBean.getPhysDoc()));
        managingBean.setDispatchView("multiModMenu");
        if (httpSession.getAttribute(workFlowBean.getManagingBeanName()) != null) {
          ArrayList listDocs = ((ManagingBean) httpSession.getAttribute(workFlowBean.getManagingBeanName())).getListPhysDoc();
          if (listDocs != null && listDocs.size() > 0) {
            managingBean.setListPhysDoc(listDocs);
          }
        }

      } else if (!physDoc.equals("") && makeAction.equals("true")) { // DO
        managingBean.setPhysDoc(Integer.parseInt(physDoc));
        ArrayList elementiNum = ExtractDocument.extractDocument(httpSession, xwconn, managingBean, workFlowBean, applyTo, selid);
        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;
        SharpIncrementTool sharpIncrementTool = new SharpIncrementTool();
        for (int i = 0; i < totElementi; i++) {
          int docCorrente = 0;
          try {
            docCorrente = ((Integer) elementiNum.get(i)).intValue();
          } catch (Exception e) {
            docCorrente = (Integer.parseInt((String) elementiNum.get(i)));
          }
          try {
            // gestire con framework
            String docXML = xwconn.getSingleXMLFromNumDoc(docCorrente);
            XMLBuilder xmlBuilder = new XMLBuilder(docXML, "ISO-8859-1");
            String ilValore = theValue;
            String ilNome = theXpath;
            // if (ilValore.indexOf("[#") > 0 && ilValore.indexOf("#]") > 0 && totElementi > 1) {
            if ((ilValore.indexOf("[#") != -1) && (ilValore.indexOf("#]") > 0) && (totElementi > 1)) {
              ilValore = sharpIncrementTool.incrementValue(ilNome, ilValore);
            }
            xmlBuilder.insertValueAt(ilNome, ilValore);
            xwconn.executeUpdateByDocNumber(xmlBuilder.getXML("ISO-8859-1", false), docCorrente);
            processati++;
          } catch (Exception e) {
            managingBean.addErrorMsg(e.getMessage());
            errori++;
          }
View Full Code Here

  UserBean userBean = null;

  public TitleManager(InputStream inputStream) throws IOException, XMLException {
    bs = getBytesFromFile(inputStream);
    builder = new XMLBuilder(new ByteArrayInputStream(bs));
  }
View Full Code Here

    }
    // System.out.println("---- INFO ---- MultiEditingManager loading " + ilPath);
    // System.out.println("MultiEditingManager.execute() ilPath " + ilPath);
    /* GESTIONE MULTIFILE */
    String fullPath = "";
    XMLBuilder theXMLConf = null;
    String nomeFile = null;
    String xslFile = null;
    System.out.println("MultiEditingManager.execute() aaaaa " + getTheXMLConf().valoreNodo("/root/multiEditing" + ilPath + "/file/@name"));
    if (!(getTheXMLConf().valoreNodo("/root/multiEditing" + ilPath + "/file/@name")).equals("")) {
      try {
        nomeFile = getTheXMLConf().valoreNodo("/root/multiEditing" + ilPath + "/file/@name");
        System.out.println("MultiEditingManager.execute() nomeFile " + nomeFile);
        fullPath = "/" + nomeFile;
        System.out.println("MultiEditingManager.execute() fullPath " + fullPath);
        try {
          if (nomeFile.toLowerCase().endsWith("xsl") || nomeFile.toLowerCase().endsWith("xslt")) {
            xslFile = ConfManager.getConfString(fullPath);
          } else {
            //theXMLConf = evaluateBuilder(ConfManager.getConfXML(fullPath));
            theXMLConf = evaluateBuilder(ConfManager.getConfString(fullPath));
          }
        } catch (Exception e) {
          System.err.println(e.getMessage());
          theXMLConf = new XMLBuilder("root");
          // theXMLConf = new XMLBuilder(domManager.getDocument(fullPath));
        }
        // System.out.println("MultiEditingManager.execute() ilPath " + ilPath);
        // System.out.println("MultiEditingManager.execute() getIlPath " + getIlPath());
        // System.out.println("MultiEditingManager.execute() theXMLConf " + theXMLConf.getXML("ISO-8859-1"));
        if (xslFile == null && theXMLConf.contaNodi("/root/multiEditing[child::" + getElementToFind() + "]") > 0) {
          // System.out.println("MultiEditingManager.execute() theXMLConf1111111111111 " + theXMLConf.getXML("ISO-8859-1"));
          setTheXMLConf(theXMLConf);
          // ilPath = "/" + getIlPath();
          return execute();
        }
View Full Code Here

 
  public XMLBuilder evaluateBuilder(String xmlDoc) throws Exception {
    try {
       StringWriter w = new StringWriter();
        boolean isEvaluate = new VelocityEngine().evaluate(velocityContext, w, "mystring", xmlDoc);
       return new XMLBuilder(w.toString(), false);
    } catch (Exception e) {
      e.printStackTrace();
      throw new Exception(" configuration error in  MultipleConf evaluateBuilder(" + e.getMessage() + ")");
    }
  }
View Full Code Here

TOP

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

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.