Examples of ListOption


Examples of org.openqreg.bean.ListOption

      // 2. Get all listboxes for this language
      // ps =
      // con.prepareStatement("SELECT TRIM(ID) AS ID, LISTORDER, TRIM(TEXT) AS TEXT, TRIM(TEXTVALUE) AS TEXTVALUE, SELECTED, VALIDFROM, VALIDTO, LANGUAGEID FROM listboxtextrow WHERE LANGUAGEID= ?  ORDER BY ID, LISTORDER");
      // ps.setString(1, currentLang);
      // rs = ps.executeQuery();
      ListOption oneListOption = null;

      Calendar fromCal;
      Calendar toCal;
      java.sql.Date fromDate;
      java.sql.Date toDate;
      // TODO: read in correct document order
      // Get text documents in correct order
      Collection<DocumentorderBean> docCol = DocumentorderFinder
          .findAllOrderByOrdernumber(con);
      // loop all containers in all documents (in right order) will lead
      // to
      // the ones existing in more than one document
      // being overwritten in correct order
      for (DocumentorderBean doBean : docCol) {
        for (Listboxtextrow lbtr : ListboxtextrowFinder.findByDocument(
            con, doBean.getDocument())) {
          // while (rs.next()) {
          oneListOption = new ListOption();
          // oneListOption.setSelectBoxName(rs.getString(1));
          // oneListOption.setListOrder(rs.getInt(2));
          // oneListOption.setSelected(rs.getInt(5));
          // oneListOption.setText(rs.getString(3));
          // oneListOption.setValue(rs.getString(4));
          oneListOption.setSelectBoxName(lbtr.getId());
          oneListOption.setListOrder(lbtr.getListorder());
          oneListOption.setSelected(lbtr.getSelected());
          // Text t = (Text) TextFinderBase.findByPrimaryKey(
          // con, new TextKey(lbtr.getId() + "_"
          // + lbtr.getListorder() + "_D", currentLang));
          // Collection<TextBean> ct = TextFinder.findByTextid(con,
          // lbtr.getTextid());
          Collection<TextBean> ct = TextFinder
              .findByIdLanguageidDocument(con, lbtr.getTextid(),
                  currentLang, doBean.getDocument());
          Text t = null;
          for (Text te : ct) {
            t = te;
          }
          // Text t = TextFinder.findByTextid(con, lbtr.getTextid());
          if (null != t) {
            oneListOption.setText(t.getText());
          } else {
            oneListOption.setText("");
            // logger.log(Level.WARN,
            // "Translation missing for option: "+lbtr.getId() + "_"
            // + lbtr.getListorder() + "_D "+ currentLang);
            logger.log(
                Level.DEBUG,
                "Translation missing for option: "
                    + lbtr.getTextid() + " langid: "
                    + currentLang);
          }
          // try {
          // oneListOption.setText(((Text)
          // TextFinderBase.findByPrimaryKey(
          // con, new TextKey(lbtr.getId() + "_"
          // + lbtr.getListorder() + "_D", currentLang)))
          // .getText());
          // }catch (Exception e) {
          // // TODO: handle exception
          // System.out.println(lbtr.getId() + "_"
          // + lbtr.getListorder() + "_D "+currentLang);
          // }
          oneListOption.setValue(lbtr.getTextvalue());

          // fromDate = rs.getDate(6);
          fromDate = lbtr.getValidfrom();
          fromCal = null;
          if (fromDate != null) {
            fromCal = Converter.sqlDateToGC(fromDate);
            fromCal.set(Calendar.HOUR_OF_DAY, 0);
            fromCal.set(Calendar.MINUTE, 0);
            fromCal.set(Calendar.SECOND, 0);
            fromCal.set(Calendar.MILLISECOND, 0);
          }
          // toDate = rs.getDate(7);
          toDate = lbtr.getValidto();
          toCal = null;
          if (toDate != null) {
            toCal = Converter.sqlDateToGC(toDate);
            toCal.set(Calendar.HOUR_OF_DAY, 23);
            toCal.set(Calendar.MINUTE, 59);
            toCal.set(Calendar.SECOND, 59);
            toCal.set(Calendar.MILLISECOND, 999);
          }
          // Startdate and enddate must include the whole day
          // Since we only have dates on the database, the time is
          // added
          // here
          oneListOption.setStartDate(fromCal);
          oneListOption.setEndDate(toCal);

          // oneListOption.setLangId(rs.getString(8));
          oneListOption.setLangId(currentLang);

          // check if option is an optgroup,an end of an optgroup or a
          // standard option
          if (oneListOption.getValue() != null
              && oneListOption.getValue().equalsIgnoreCase(
                  "optgroup")) {
            oneListOption.setType(ListOption.OPTGROUPSTART);
          } else if (oneListOption.getValue() != null
              && oneListOption.getValue().equalsIgnoreCase(
                  "/optgroup")) {
            oneListOption.setType(ListOption.OPTGROUPEND);
          } else {
            oneListOption.setType(ListOption.OPTION);
          }

          // languageListboxes.get(rs.getString(1)).put(rs.getInt(2),
          // oneListOption);
          languageListboxes.get(lbtr.getId()).put(
View Full Code Here

Examples of org.openqreg.bean.ListOption

      StringBuffer outBuffer = new StringBuffer();

      Map<Integer, ListOption> outTree = languageListboxKeeper
          .get(langid).get(key);
      if (outTree != null) {
        ListOption optionObject = null;
        for (Integer listOrder : outTree.keySet()) {
          optionObject = outTree.get(listOrder);

          if (optionObject.getType() == ListOption.OPTGROUPSTART) {
            outBuffer.append("<optgroup label=\""
                + optionObject.getText() + "\">");
          } else if (optionObject.getType() == ListOption.OPTGROUPEND) {
            outBuffer.append("</optgroup>");
          } else {
            outBuffer.append("<option ");

            if (optionObject.getSelected() == 1) {
              outBuffer.append(" selected ");
            }

            outBuffer.append(" value=\"");
            outBuffer.append(optionObject.getValue());
            outBuffer.append("\">");
            outBuffer.append(optionObject.getText());
            outBuffer.append("</option>\n");
          }
        }
        if (outBuffer.length() > 0) {
          return outBuffer.toString();
View Full Code Here

Examples of org.openqreg.bean.ListOption

      StringBuffer outBuffer = new StringBuffer("");

      TreeMap<Integer, ListOption> outTree = languageListboxKeeper.get(
          langId).get(key);
      if (outTree != null) {
        ListOption optionObject = null;
        for (Integer listOrder : outTree.keySet()) {
          optionObject = outTree.get(listOrder);
          outBuffer.append("<input type=\"radio\" name=\"" + key
              + "\" value=\"" + optionObject.getValue().trim()
              + "\">" + optionObject.getText().trim());
        }
        if (outBuffer.length() > 0) {
          return outBuffer.toString();
        }
      }
View Full Code Here

Examples of org.openqreg.bean.ListOption

      TreeMap<Integer, ListOption> outTree = languageListboxKeeper.get(
          langid).get(key);

      if (outTree != null) {
        String addValueToText = new String();
        ListOption optionObject = null;
        for (Integer listOrder : outTree.keySet()) {
          optionObject = outTree.get(listOrder);

          if (additionalInfo == 1) {
            addValueToText = optionObject.getValue() + " ";
          }

          if (optionObject.getType() == ListOption.OPTGROUPSTART) {
            outBuffer.append("<optgroup label=\"")
                .append(optionObject.getText()).append("\">");
          } else if (optionObject.getType() == ListOption.OPTGROUPEND) {
            outBuffer.append("</optgroup>");
          } else {
            outBuffer.append("<option ");

            if (optionObject.getSelected() == 1) {
              outBuffer.append(" selected ");
            }

            outBuffer.append(" value=\"");
            outBuffer.append(optionObject.getValue());
            outBuffer.append("\">");
            outBuffer.append(addValueToText);
            outBuffer.append(optionObject.getText());
            outBuffer.append("</option>\n");
          }

        }
        if (outBuffer.length() > 0) {
View Full Code Here

Examples of org.openqreg.bean.ListOption

      StringBuffer outBuffer = new StringBuffer("");

      TreeMap<Integer, ListOption> outTree = languageListboxKeeper.get(
          langId).get(key);
      if (outTree != null) {
        ListOption optionObject = null;
        if (checkDate == null) {
          checkDate = Calendar.getInstance();
        }
        for (Integer listOrder : outTree.keySet()) {
          optionObject = outTree.get(listOrder);
          // is the row within the specified interval
          if ((optionObject.getEndDate() != null && optionObject
              .getEndDate().equals(checkDate))
              || optionObject.getStartDate().equals(checkDate)
              || (optionObject.getStartDate().before(checkDate) && (optionObject
                  .getEndDate() == null || optionObject
                  .getEndDate().after(checkDate)))) {

            if (optionObject.getType() == ListOption.OPTGROUPSTART) {
              outBuffer.append("<optgroup label=\""
                  + optionObject.getText() + "\">");
            } else if (optionObject.getType() == ListOption.OPTGROUPEND) {
              outBuffer.append("</optgroup>");
            } else {
              outBuffer.append("<option ");

              if (optionObject.getSelected() == 1) {
                outBuffer.append(" selected ");
              }
              outBuffer.append(" value=\"");
              outBuffer.append(optionObject.getValue().trim());
              outBuffer.append("\">");
              outBuffer.append(optionObject.getText());
              outBuffer.append("</option>\n");
            }
          }
        }
        if (outBuffer.length() > 0) {
View Full Code Here

Examples of org.openqreg.bean.ListOption

      if (listboxMap != null && listboxMap.containsKey(key)) {
        outTree = listboxMap.get(key);
      }

      if (outTree != null) {
        ListOption optionObject = null;
        String descText = "";
        if (checkDate == null) {
          checkDate = Calendar.getInstance();
        }
        for (Integer listOrder : outTree.keySet()) {
          optionObject = outTree.get(listOrder);
          // is the row within the specified interval
          if ((optionObject.getStartDate().before(checkDate) || optionObject
              .getStartDate().equals(checkDate))
              && (optionObject.getEndDate() == null
                  || optionObject.getEndDate().after(
                      checkDate) || optionObject
                  .getEndDate().equals(checkDate))) {
            if (null != additionalInfo
                && additionalInfo.intValue() == 1
                && !optionObject.getValue().trim().equals("")) {
              descText = optionObject.getValue().trim() + " "
                  + optionObject.getText().trim();
            } else if (null != additionalInfo
                && additionalInfo.intValue() == 2
                && !optionObject.getValue().trim().equals("")) {
              descText = optionObject.getText().trim() + ", "
                  + optionObject.getValue().trim();
            } else {
              descText = optionObject.getText().trim();
            }

            if (optionObject.getType() == ListOption.OPTGROUPSTART) {
              outBuffer.append("<optgroup label=\""
                  + optionObject.getText() + "\">");
            } else if (optionObject.getType() == ListOption.OPTGROUPEND) {
              outBuffer.append("</optgroup>");
            } else {
              outBuffer.append("<option ");

              if (optionObject.getSelected() == 1) {
                outBuffer.append("selected ");
              }

              outBuffer.append("value=\"");
              outBuffer.append(optionObject.getValue().trim());
              outBuffer.append("\">");
              if (!"".equals(descText)) {
                outBuffer.append(descText);
              } else {
                outBuffer.append("&nbsp;");
View Full Code Here

Examples of org.openqreg.bean.ListOption

      if (listboxMap != null && listboxMap.containsKey(key)) {
        outTree = listboxMap.get(key);
      }

      if (outTree != null) {
        ListOption optionObject = null;
        String descText = "";
        if (checkDate == null) {
          checkDate = Calendar.getInstance();
        }
        for (Integer listOrder : outTree.keySet()) {
          optionObject = outTree.get(listOrder);
          // is the row within the specified interval
          if ((null == optionObject.getStartDate() && null == optionObject
              .getEndDate())
              || ((null == optionObject.getStartDate()
                  || optionObject.getStartDate().before(
                      checkDate) || optionObject
                  .getStartDate().equals(checkDate)) && (optionObject
                  .getEndDate() == null
                  || optionObject.getEndDate().after(
                      checkDate) || optionObject
                  .getEndDate().equals(checkDate)))) {
            if (null != additionalInfo
                && additionalInfo.intValue() == 1
                && !optionObject.getValue().trim().equals("")) {
              descText = optionObject.getValue().trim() + " "
                  + optionObject.getText().trim();
            } else if (null != additionalInfo
                && additionalInfo.intValue() == 2
                && !optionObject.getValue().trim().equals("")) {
              descText = optionObject.getText().trim() + ", "
                  + optionObject.getValue().trim();
            } else {
              descText = optionObject.getText().trim();
            }

            if (optionObject.getType() == ListOption.OPTGROUPSTART) {
              outBuffer.append("<optgroup label=\""
                  + optionObject.getText() + "\">");
            } else if (optionObject.getType() == ListOption.OPTGROUPEND) {
              outBuffer.append("</optgroup>");
            } else {
              outBuffer.append("<option ");

              if (value != null
                  && value.contains(optionObject.getValue())) {
                outBuffer.append("selected ");
              }

              /*
               * if (optionObject.getValue().equals(value)) {
               * outBuffer.append("selected "); }
               */

              outBuffer.append("value=\"");
              outBuffer.append(optionObject.getValue().trim());
              outBuffer.append("\">");
              if (!"".equals(descText)) {
                outBuffer.append(descText);
              } else {
                outBuffer.append("&nbsp;");
View Full Code Here

Examples of org.openqreg.bean.ListOption

      StringBuffer outBuffer = new StringBuffer("");

      TreeMap<Integer, ListOption> outTree = languageListboxKeeper.get(
          langId).get(key);
      if (outTree != null) {
        ListOption optionObject = null;
        if (checkDate == null) {
          checkDate = new Date();
        }
        for (Integer listOrder : outTree.keySet()) {
          optionObject = outTree.get(listOrder);
          // is the row within the specified interval
          if ((optionObject.getEndDate() != null && optionObject
              .getEndDate().equals(checkDate))
              || optionObject.getStartDate().equals(checkDate)
              || (optionObject.getStartDate().before(checkDate) && (optionObject
                  .getEndDate() == null || optionObject
                  .getEndDate().after(checkDate)))) {
            outBuffer.append("<input type=\"radio\" name=\"" + key
                + "\" value=\""
                + optionObject.getValue().trim() + "\">"
                + optionObject.getText().trim() + "\t");
          }
        }
        if (outBuffer.length() > 0) {
          return outBuffer.toString();
        }
View Full Code Here

Examples of org.openqreg.bean.ListOption

    try {
      Map<Integer, ListOption> outTree = languageListboxKeeper
          .get(langId).get(key);
      if (outTree != null) {
        ListOption optionObject = null;
        for (Integer listOrder : outTree.keySet()) {
          optionObject = outTree.get(listOrder);
          if (optionObject.getValue().equals(value)) {
            return optionObject.getText();
          }
        }
      }

      missingListboxes.get(langId).add(key);
View Full Code Here

Examples of org.openqreg.bean.ListOption

    try {
      StringBuffer outBuffer = new StringBuffer("");
      TreeMap<Integer, ListOption> outTree = languageListboxKeeper.get(
          langId).get(key);
      if (outTree != null) {
        ListOption optionObject = null;
        outBuffer.append(arrName + "[" + theIndex + "]=new Array();\n");
        int i = 0;
        for (Integer listOrder : outTree.keySet()) {
          optionObject = outTree.get(listOrder);
          outBuffer.append(arrName + "[" + theIndex + "][" + i
              + "]=new listOption('"
              + optionObject.getValue().trim() + "','"
              + optionObject.getText().trim() + "');\n");
          i++;
        }
        if (outBuffer.length() > 0) {
          return outBuffer.toString();
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.