Package railo.runtime.type

Examples of railo.runtime.type.Struct


  @Override
  public Object next() {
    try {
      if(qry.go(++current,pid)) {
        Struct sct=new StructImpl();
        for(int i=0;i<names.length;i++){
          sct.setEL(names[i], qry.get(names[i],NullSupportHelper.empty()));
        }
        return sct;
      }
    } catch (PageException pe) {
      throw new PageRuntimeException(pe);
View Full Code Here


              print.o("not expired("+new Date(expires)+"):"+res);
              print.o(str);
            }*/
          }
        }
        Struct s = (Struct) evaluator.interpret(pc,str);
        ScopeContext.info(log,"load existing file storage ["+res+"]");
        return s;
      }
      catch (Throwable t) {
        ScopeContext.error(log, t);
View Full Code Here

 
 
 
 
  public Struct getSummaryInfo() {
        Struct infostruct = new StructImpl();
       
        int sheets = workbook.getNumberOfSheets();
        infostruct.setEL("SHEETS", new Double(sheets));
        if(sheets>0) {
          StringBuilder sb=new StringBuilder();
            for(int i=0; i<sheets; i++){
              if(i>0)sb.append(',');
              sb.append(workbook.getSheetName(i));
            }
            infostruct.setEL("SHEETNAMES", sb.toString());
        }
     
        if(xmlFormat==FORMAT_HSSF) {
          infostruct.setEL("SPREADSHEETTYPE", "Excel");
         
          HSSFWorkbook hssfworkbook = (HSSFWorkbook)workbook;
            info(infostruct,hssfworkbook.getSummaryInformation());
            info(infostruct,hssfworkbook.getDocumentSummaryInformation());
        }
        else if(xmlFormat==FORMAT_XSSF)  {
          infostruct.put("SPREADSHEETTYPE", "Excel (2007)");
           
          XSSFWorkbook xssfworkbook = (XSSFWorkbook)workbook;
            POIXMLProperties props = xssfworkbook.getProperties();
            info(infostruct,props.getCoreProperties().getUnderlyingProperties());
            info(infostruct,props.getExtendedProperties().getUnderlyingProperties());
View Full Code Here

   * @return
   */
  public static Client getInstance(String name, PageContext pc, Log log) {

    Resource res=_loadResource(pc.getConfig(),SCOPE_CLIENT,name,pc.getCFID());
    Struct data=_loadData(pc,res,log);
    return new ClientFile(pc,res,data);
  }
View Full Code Here

   * @param log
   * @return client datasource scope
   * @throws PageException
   */
  public static Client getInstance(String cacheName, String appName, PageContext pc, Log log) throws PageException {
      Struct _sct = _loadData(pc, cacheName, appName,"client",log);
      //structOk=true;
      if(_sct==null) _sct=new StructImpl();
     
    return new ClientCache(pc,cacheName,appName,_sct);
  }
View Full Code Here

   * @return client datasource scope
   * @throws PageException
   */
  public static Client getInstance(String datasourceName, PageContext pc, Log log) throws PageException {
     
      Struct _sct = _loadData(pc, datasourceName,"client",SCOPE_CLIENT,log, false);
      if(_sct==null) _sct=new StructImpl();
     
    return new ClientDatasource(pc,datasourceName,_sct);
  }
View Full Code Here

   * @param sct
   * @return
   */
  public static Struct duplicate(Struct sct,boolean deepCopy) {

    Struct rtn=new StructImpl();
    //railo.runtime.type.Collection.Key[] keys=sct.keys();
    //railo.runtime.type.Collection.Key key;
    Iterator<Entry<Key, Object>> it = sct.entryIterator();
      Entry<Key, Object> e;
        while(it.hasNext()) {
          e=it.next();
      rtn.setEL(e.getKey(),Duplicator.duplicate(e.getValue(),deepCopy));
    }
    return rtn;
  }
View Full Code Here

    }
    return arr;
  }

  public static Struct copyToStruct(Map map) throws PageException {
        Struct sct = new StructImpl();
        Iterator it=map.entrySet().iterator();
        Map.Entry entry;
        while(it.hasNext()) {
            entry=(Entry) it.next();
            sct.setEL(Caster.toString(entry.getKey()),entry.getValue());
        }
        return sct;
  }
View Full Code Here

    }
  }

 
    public static Struct merge(Struct[] scts) {
    Struct sct=new StructImpl();
   
    for(int i=scts.length-1;i>=0;i--){
      Iterator<Entry<Key, Object>> it = scts[i].entryIterator();
      Entry<Key, Object> e;
      while(it.hasNext()){
        e = it.next();
        sct.setEL(e.getKey(), e.getValue());
      }
    }
    return sct;
  }
View Full Code Here

              value=URLDecoder.decode(value,encoding,true);
            }
            // MUST valueStruct
            if(name.indexOf('.')!=-1) {
                StringList list=ListUtil.listToStringListRemoveEmpty(name,'.');
                Struct parent=this;
                while(list.hasNextNext()) {
                    parent=_fill(parent,list.next(),new CastableStruct(),false,scriptProteced,sameAsArray);
                }
                _fill(parent,list.next(),value,true,scriptProteced,sameAsArray);
            }
View Full Code Here

TOP

Related Classes of railo.runtime.type.Struct

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.