Package railo.runtime.type

Examples of railo.runtime.type.StructImpl


 
 
 
 
  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


   * @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

   * @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

       
      }
    }
    ScopeContext.info(log,"create new "+strType+" scope for "+pc.getApplicationContext().getName()+"/"+pc.getCFID());
   
    return new StructImpl();
  }
View Full Code Here

   
    if(outNames.size()<=1) return AxisCaster.toRailoType(null,ret);
        //getParamData((org.apache.axis.client.Call)call,parameters.returnParam,ret);
    Map outputs = call.getOutputParams();
   
    Struct sct = new StructImpl();
    for(int pos = 0; pos < outNames.size(); pos++) {
      String name = outNames.get(pos);
            //print.ln(name);
      Object value = outputs.get(name);
      if(value == null && pos == 0) {
        sct.setEL(name, AxisCaster.toRailoType(null,ret));
      }
      else {
        sct.setEL(name, AxisCaster.toRailoType(null,value));
      }
    }
    return sct;
  }
View Full Code Here

    return psi.loadPage(pc);
  }

  public static Struct getPropertiesAsStruct(ComponentAccess ca, boolean onlyPersistent) {
    Property[] props = ca.getProperties(onlyPersistent);
    Struct sct=new StructImpl();
    if(props!=null)for(int i=0;i<props.length;i++){
      sct.setEL(KeyImpl.getInstance(props[i].getName()), props[i]);
    }
    return sct;
  }
View Full Code Here

      sct.setEL(KeyImpl.getInstance(props[i].getName()), props[i]);
    }
    return sct;
  }
  public static Struct getMetaData(PageContext pc,UDFPropertiesImpl udf) throws PageException {
    StructImpl func=new StructImpl();
        pc=ThreadLocalPageContext.get(pc);
    // TODO func.set("roles", value);
        // TODO func.set("userMetadata", value); neo unterst゚tzt irgendwelche a
        // meta data
        Struct meta = udf.meta;
        if(meta!=null) StructUtil.copy(meta, func, true);
       
        func.setEL(KeyConstants._closure, Boolean.FALSE);
   
    func.set(KeyConstants._access,ComponentUtil.toStringAccess(udf.getAccess()));
        String hint=udf.hint;
        if(!StringUtil.isEmpty(hint))func.set(KeyConstants._hint,hint);
        String displayname=udf.displayName;
        if(!StringUtil.isEmpty(displayname))func.set(KeyConstants._displayname,displayname);
        func.set(KeyConstants._name,udf.functionName);
        func.set(KeyConstants._output,Caster.toBoolean(udf.output));
        func.set(KeyConstants._returntype, udf.strReturnType);
        func.set(KeyConstants._description, udf.description);
       
        func.set(KeyConstants._owner, udf.pageSource.getDisplayPath());
       
          
      int format = udf.returnFormat;
        if(format<0 || format==UDF.RETURN_FORMAT_WDDX)      func.set(KeyConstants._returnFormat, "wddx");
        else if(format==UDF.RETURN_FORMAT_PLAINfunc.set(KeyConstants._returnFormat, "plain");
        else if(format==UDF.RETURN_FORMAT_JSONfunc.set(KeyConstants._returnFormat, "json");
        else if(format==UDF.RETURN_FORMAT_SERIALIZE)func.set(KeyConstants._returnFormat, "cfml");
       
       
        FunctionArgument[] args =  udf.arguments;
        Array params=new ArrayImpl();
        //Object defaultValue;
        Struct m;
        //Object defaultValue;
        for(int y=0;y<args.length;y++) {
            StructImpl param=new StructImpl();
            param.set(KeyConstants._name,args[y].getName().getString());
            param.set(KeyConstants._required,Caster.toBoolean(args[y].isRequired()));
            param.set(KeyConstants._type,args[y].getTypeAsString());
            displayname=args[y].getDisplayName();
            if(!StringUtil.isEmpty(displayname)) param.set(KeyConstants._displayname,displayname);
           
            int defType = args[y].getDefaultType();
            if(defType==FunctionArgument.DEFAULT_TYPE_RUNTIME_EXPRESSION){
              param.set(KeyConstants._default, "[runtime expression]");
            }
            else if(defType==FunctionArgument.DEFAULT_TYPE_LITERAL){
              param.set(KeyConstants._default,
                  UDFUtil.getDefaultValue(pc, udf.pageSource, udf.index, y, null));
            }
           
            hint=args[y].getHint();
            if(!StringUtil.isEmpty(hint))param.set(KeyConstants._hint,hint);
            // TODO func.set("userMetadata", value); neo unterst゚tzt irgendwelche attr, die dann hier ausgebenen werden blレdsinn
           
            // meta data
            m=args[y].getMetaData();
            if(m!=null) StructUtil.copy(m, param, true);
View Full Code Here

TOP

Related Classes of railo.runtime.type.StructImpl

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.