Package org.openqreg.bean

Examples of org.openqreg.bean.Alternative


            if(ListElement.class.isAssignableFrom(clazz)) {
             
              if(arry[ALTERNATIVESCOLUMN] != null){
             
                Vector alternatives = new Vector();
                Alternative alternative = new Alternative();
                String[] altrows = ValidationHelper.separateToArray(
                    arry[ALTERNATIVESCOLUMN].toString(), "\n");
               
                for (int r = 0; r < altrows.length; r++) {
                  String row = altrows[r].toString();
                  if (row.indexOf("=") != -1) {
                    alternative = new Alternative();
                    alternative.setValue(row.substring(0,
                        row.indexOf("=")).trim().replaceAll("\"",
                        ""));
                    alternative.setText(row.substring(
                        row.indexOf("=") + 1).trim().replaceAll(
                        "\"", ""));
                    alternatives.add(alternative);
                  }
                }
                alternatives.trimToSize();
                var.setAlternatvies(alternatives);
              }
           
              if(arry[ALTERNATIVESDATECOLUMN] != null) {
                Vector alternatives = var.getAlternatvies();
                Alternative alternative = new Alternative();
                String[] altrows = ValidationHelper.separateToArray(
                    arry[ALTERNATIVESDATECOLUMN].toString(), "\n");
                for (int r = 0; r < altrows.length; r++) {
                  String row = altrows[r].toString();
                  if (row.indexOf("=") != -1) {
                    alternative = (Alternative) alternatives.get(r);
                    int startPos = row.indexOf("=") + 1;
                    alternative.setStartDate(((row.substring(startPos,
                        row.indexOf("/")).trim()).replaceAll("\"",
                        "")).replaceAll("\\(", ""));
                    alternative.setEndDate(((row.substring(row
                        .indexOf("/") + 1).trim()).replaceAll("\"",
                        "")).replaceAll("\\)", ""));
                  }
                }
                alternatives.trimToSize();
View Full Code Here


    StringBuffer out = new StringBuffer();
    Iterator it = variables.iterator();
    VariableForImport var;
    Vector alternatives = new Vector();
    int counter = 0;
    Alternative alternative = new Alternative();
    while (it.hasNext()) {
      counter = 0;
      var = (VariableForImport) it.next();
      alternatives = var.getAlternatvies();
     
      try {
        Class clazz = Class.forName(var.getType());     
     
        if (var.getName() != null
            && !var.getName().equals("")
            && alternatives != null
            && var.getTable() != null
            && !var.getTable().equals("")
            && (ListElement.class.isAssignableFrom(clazz))) {
 
          out
              .append("insert into listboxtextrow (ID, LISTORDER, LANGUAGEID, TEXT, TEXTVALUE, SELECTED, TSCREATED, TSUPDATED, CREATEDBY, UPDATEDBY, VALIDFROM)");
          out.append(" values (");
          out.append("'" + var.getTable().toUpperCase() + "_"
              + var.getName().toUpperCase() + "_L' ");
          out
              .append(", 0, '"
                  + var.getLanguageid()
                  + "', '', '', 1, localtimestamp,localtimestamp, 'System', 'System', DATE '2004-01-01');");
          out.append(nl);
 
          for (int r = 0; r < alternatives.size(); r++) {
            counter++;
            alternative = (Alternative) alternatives.get(r);
            out
                .append("insert into listboxtextrow (ID, LISTORDER, LANGUAGEID, TEXT, TEXTVALUE, "
                    + "SELECTED, TSCREATED, TSUPDATED, CREATEDBY, UPDATEDBY, VALIDFROM, VALIDTO)");
            out.append("values (");
            out.append("'" + var.getTable().toUpperCase() + "_"
                + var.getName().toUpperCase() + "_L' ");
            out.append(", " + counter);
            out.append(", '" + var.getLanguageid());
            out
                .append("', '"
                    + alternative.getText()
                    + "', '"
                    + alternative.getValue()
                    + "', "
                    + "0, localtimestamp,localtimestamp, 'System', 'System', DATE '"
                    + alternative.getStartDate() + "'");
            if (!"".equals(alternative.getEndDate())) {
              out.append(", DATE '" + alternative.getEndDate() + "'");
            } else {
              out.append(", null");
            }
 
            out.append(");");
View Full Code Here

TOP

Related Classes of org.openqreg.bean.Alternative

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.