Package railo.runtime.type

Examples of railo.runtime.type.Struct


  protected static Struct _loadData(PageContext pc, String cookieName, int type,String strType, Log log) {
    String data = (String)pc.cookieScope().get(cookieName,null);
    if(data!=null) {     
      try {
        Struct sct = (Struct) evaluator.interpret(pc,data);
        long l;
        String str;
       
        // last visit
        str = (String)pc.cookieScope().get(cookieName+"_LV",null);
        if(!StringUtil.isEmpty(str)) {
          l=Caster.toLongValue(str,0);
          if(l>0)sct.setEL(LASTVISIT, new DateTimeImpl(pc,l,true));
        }
       
       
        if(type==SCOPE_CLIENT){
          // hit count
          str= (String)pc.cookieScope().get(cookieName+"_HC",null);
            if(!StringUtil.isEmpty(str)) sct.setEL(HITCOUNT, Caster.toDouble(str,null));
         
          // time created
          str = (String)pc.cookieScope().get(cookieName+"_TC",null);
          if(!StringUtil.isEmpty(str)) {
            l=Caster.toLongValue(str,0);
            if(l>0)sct.setEL(TIMECREATED, new DateTimeImpl(pc,l,true));
          }
        }
               
        ScopeContext.info(log,"load data from cookie for "+strType+" scope for "+pc.getApplicationContext().getName()+"/"+pc.getCFID());
        return sct;
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

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

        ScopeContext.info(log,"create new "+strType+" scope for "+pc.getApplicationContext().getName()+"/"+pc.getCFID()+" in datasource ["+datasourceName+"]");
      return null;
      }
      String str=Caster.toString(query.get(KeyConstants._data));
      if(mxStyle) return null;
      Struct s = (Struct)pc.evaluate(str);
      ScopeContext.info(log,"load existing data from ["+datasourceName+"."+PREFIX+"_"+strType+"_data] to create "+strType+" scope for "+pc.getApplicationContext().getName()+"/"+pc.getCFID());
   
      return s;
  }
View Full Code Here

 
  protected static Struct _loadData(PageContext pc, String cacheName, String appName, String strType, Log log) throws PageException  {
    Cache cache = getCache(pc.getConfig(),cacheName);
    String key=getKey(pc.getCFID(),appName,strType);
   
    Struct s = (Struct) cache.getValue(key,null);
   
    if(s!=null)
      ScopeContext.info(log,"load existing data from  cache ["+cacheName+"] to create "+strType+" scope for "+pc.getApplicationContext().getName()+"/"+pc.getCFID());
    else
      ScopeContext.info(log,"create new "+strType+" scope for "+pc.getApplicationContext().getName()+"/"+pc.getCFID()+" in cache ["+cacheName+"]");
View Full Code Here

    // TODO Auto-generated method stub
    return null;
  }

  public Struct getAllowedSQL() {
    Struct allow=new StructImpl();
    allow.setEL(KeyConstants._alter, Caster.toBoolean(ds.hasAllow(DataSource.ALLOW_ALTER)));
    allow.setEL(KeyConstants._create, Caster.toBoolean(ds.hasAllow(DataSource.ALLOW_CREATE)));
    allow.setEL(KeyConstants._delete, Caster.toBoolean(ds.hasAllow(DataSource.ALLOW_DELETE)));
    allow.setEL(KeyConstants._drop, Caster.toBoolean(ds.hasAllow(DataSource.ALLOW_DROP)));
    allow.setEL(KeyConstants._grant, Caster.toBoolean(ds.hasAllow(DataSource.ALLOW_GRANT)));
    allow.setEL(KeyConstants._insert, Caster.toBoolean(ds.hasAllow(DataSource.ALLOW_INSERT)));
    allow.setEL(KeyConstants._revoke, Caster.toBoolean(ds.hasAllow(DataSource.ALLOW_REVOKE)));
    allow.setEL(KeyConstants._select, Caster.toBoolean(ds.hasAllow(DataSource.ALLOW_SELECT)));
    allow.setEL("storedproc", Caster.toBoolean(true));// TODO
    allow.setEL(KeyConstants._update, Caster.toBoolean(ds.hasAllow(DataSource.ALLOW_UPDATE)));
    return allow;
  }
View Full Code Here

  public String getDsn() {
    return ds.getDsnTranslated();
  }

  public Struct getExtraData() {
    Struct rtn=new StructImpl();
    Struct connprop=new StructImpl();
    String[] names = ds.getCustomNames();
    rtn.setEL("connectionprops", connprop);
    for(int i=0;i<names.length;i++) {
      connprop.setEL(names[i], ds.getCustomValue(names[i]));
    }
    rtn.setEL("maxpooledstatements",new Double(1000) );
    rtn.setEL("sid","");
    rtn.setEL("timestampasstring", Boolean.FALSE);
    rtn.setEL("useTrustedConnection", Boolean.FALSE);
View Full Code Here

    setParam(hpb);
  }

  @Override
  public int doEndTag() throws PageException {
      Struct cfhttp=new StructImpl();
    cfhttp.setEL(ERROR_DETAIL,"");
    pageContext.setVariable(result,cfhttp);

    // because commons
    PrintStream out = System.out;
        try {
View Full Code Here

      cfhttp.set(HTTP_VERSION,(rsp.getProtocolVersion()));
     
    //responseHeader
      railo.commons.net.http.Header[] headers = rsp.getAllHeaders();
      StringBuffer raw=new StringBuffer(rsp.getStatusLine()+" ");
      Struct responseHeader = new StructImpl();
      Struct cookie;
      Array setCookie = new ArrayImpl();
      Query cookies=new QueryImpl(new String[]{"name","value","path","domain","expires","secure","httpOnly"},0,"cookies");
     
          for(int i=0;i<headers.length;i++) {
            railo.commons.net.http.Header header=headers[i];
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.