Package org.opentides.bean

Examples of org.opentides.bean.SortedProperties


          missed.setName(name.getValue());
          // set the class
          Attribute clazz = elem.attribute("class");
          missed.setClazz(clazz.getValue());
          List<Element> props =elem.elements("property");
          Properties property = new SortedProperties();
          for (Element prop:props) {
            String propName = prop.attributeValue("name");
            String propValue = prop.attributeValue("value");
            if ("prompt.type".equals(propName)) {
              missed.setType(propValue);
            } else if ("prompt.query".equals(propName)) {
              // extract the native query to database             
              String queryName = propValue;
              if(!StringUtil.isEmpty(queryName)){
                //try to match :[paramName]
                Matcher matcher = Pattern.compile(":(\\w+)").matcher(queryName);
                while (matcher.find()) {
                  String paramName = matcher.group(0).substring(1);
                  if (!StringUtil.isEmpty(paramName) && requestParams.get(paramName)!=null){
                    String[] paramValueArr = requestParams.get(paramName);
                    String paramValue = StringUtil.explode(',', paramValueArr);
                    queryName = queryName.replaceAll(":" + paramName, paramValue);
                  }
                }
              }
             
              List<Object[]> rs = ((ReportDAO) getDao()).getParamOptionResults(queryName);
              for (Object[] option : rs) {
                property.put(Long.valueOf(option[1].toString()), option[0].toString());
              }
            }else if("prompt.command".equals(propName)){
              missed.setType(propName);
              property.put(propValue, dynamicParameters.get(propValue));
            }else
              property.put(propName, propValue);
          }
          missed.setProperties(property);
          missing.add(missed);
        }
      }
View Full Code Here


   * @param header
   */
  public static void saveProperty(String filename, Properties properties, String header) {
    OutputStream out = null;
    try {
      Properties sortedProperties = new SortedProperties(properties);
      File f = new File(filename);
      out = new FileOutputStream(f);
      sortedProperties.store(out, header);
    } catch (Exception e) {
      _log.error(e,e);
    } finally {
      try {
        out.close();
View Full Code Here

TOP

Related Classes of org.opentides.bean.SortedProperties

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.