Package org.openqreg.bean

Examples of org.openqreg.bean.Text


          // 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);
View Full Code Here


      int PREFIXCOLUMN, String LANGID) {
    String arry[] = null;
    int lastBoundry = 0;
    int nextBoundry;
    nextBoundry = input.indexOf(boundry);
    Text text = null;
    String prefix;
    String name;
    String type;
    StringBuffer textid;
   
    try {
    while (nextBoundry != -1) {
     
      text = new Text();
      prefix = "";
      name = "";
      type = "";
      textid = new StringBuffer();
     
      String oneRow = input.substring(lastBoundry, nextBoundry);
      arry = ValidationHelper.separateToArray(oneRow, separator);

      // only try to add variable if more columns than higest used in
      // array
      // and a name exists for variable
      // and type set...
      // and table set
      // and type = Listbox,Date,Number
      if (arry.length > NAMECOLUMN && arry.length > TEXTCOLUMN
            && arry.length > TYPECOLUMN
          && arry[NAMECOLUMN] != null
          && !arry[NAMECOLUMN].toString().equals("")
          && arry[TYPECOLUMN] != null
          && !arry[TYPECOLUMN].toString().equals("")
          && arry[TYPECOLUMN] != null
          && types.containsKey(arry[TYPECOLUMN].toString())) {

        if (arry.length > PREFIXCOLUMN && arry[PREFIXCOLUMN] != null) {
          prefix = arry[PREFIXCOLUMN].toString();
        }
        if (arry[NAMECOLUMN] != null) {
          name = arry[NAMECOLUMN].toString();
        }
        if (arry[TYPECOLUMN] != null) {
          type = arry[TYPECOLUMN].toString();
        }
        if (arry[TEXTCOLUMN] != null) {
          text.setText(arry[TEXTCOLUMN].toString().replaceAll(
              "&nbsp:", "&nbsp;"));
        }
       
        textid.append(prefix);
        if(prefix.length() > 0){
          textid.append("_");
        }
        textid.append(name);
        if(name.length() > 0){
          textid.append("_");
        }
        textid.append(type);
       
        text.setId(textid.toString());
//       sets lang id for this variable
        text.setLanguageid(LANGID);

        texts.add(text);
      }
      lastBoundry = nextBoundry;
      nextBoundry = input.indexOf(boundry, (lastBoundry + boundry
View Full Code Here

   * @return String containing SQL insert statements for all
   */
  public String getSQLInsertForAll() {
    StringBuffer out = new StringBuffer();
    Iterator it = texts.iterator();
    Text text;

    while (it.hasNext()) {
      text = (Text) it.next();
      if (text.getId() != null && !text.getId().equals("")
          && text.getText() != null && !text.getText().equals("")
      ) {
        out.append("insert into text (ID, LANGUAGEID, TEXT, TSCREATED, TSUPDATED, CREATEDBY, UPDATEDBY) ");
        out.append("values (");
        out.append("'").append(text.getId()).append("'");
        out.append(", '").append(text.getLanguageid()).append("'");
        out.append(", '").append(text.getText()).append("'");
        out.append(", localtimestamp, localtimestamp,'System','System');\r\n");
      }
    }
    return out.toString();
  }
View Full Code Here

   * @return String containing SQL delete statements for all
   */
  public String getSQLDeleteForAll() {
    StringBuffer out = new StringBuffer();
    Iterator it = texts.iterator();
    Text text;

    while (it.hasNext()) {
      text = (Text) it.next();
      out.append("delete from text where id = ");
      out.append("'").append(text.getId()).append("'");
      out.append(" and languageid= '").append(text.getLanguageid()).append("';\r\n");
    }
    return out.toString();
  }
View Full Code Here

TOP

Related Classes of org.openqreg.bean.Text

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.