Examples of StructImpl


Examples of railo.runtime.type.StructImpl

      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

Examples of railo.runtime.type.StructImpl

   * @param log
   * @param name
   */
  protected StorageScopeMemory(PageContext pc,String strType, int type, Log log) {
    super(
        new StructImpl(),
        new DateTimeImpl(pc.getConfig()),
        null,
        -1,1,strType,type);
    ScopeContext.info(log,"create new memory based "+strType+" scope for "+pc.getApplicationContext().getName()+"/"+pc.getCFID());
   
View Full Code Here

Examples of railo.runtime.type.StructImpl

    // 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

Examples of railo.runtime.type.StructImpl

  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

Examples of railo.runtime.type.StructImpl

  public String getJndiName() {
    return getJNDIName();
  }

  public Struct getJndienv() {
    return new StructImpl();
  }
View Full Code Here

Examples of railo.runtime.type.StructImpl

    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

Examples of railo.runtime.type.StructImpl

      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];
            //print.ln(header);
           
            raw.append(header.toString()+" ");
            if(header.getName().equalsIgnoreCase("Set-Cookie")) {
              setCookie.append(header.getValue());
              parseCookie(cookies,header.getValue());
            }
            else {
                //print.ln(header.getName()+"-"+header.getValue());
              Object value=responseHeader.get(KeyImpl.getInstance(header.getName()),null);
              if(value==null) responseHeader.set(KeyImpl.getInstance(header.getName()),header.getValue());
              else {
                  Array arr=null;
                  if(value instanceof Array) {
                      arr=(Array) value;
                  }
                  else {
                      arr=new ArrayImpl();
                      responseHeader.set(KeyImpl.getInstance(header.getName()),arr);
                      arr.appendEL(value);
                  }
                  arr.appendEL(header.getValue());
              }
            }
           
            // Content-Type
            if(header.getName().equalsIgnoreCase("Content-Type")) {
              mimetype=header.getValue();
              if(mimetype==null)mimetype=NO_MIMETYPE;
            }
           
            // Content-Encoding
            if(header.getName().equalsIgnoreCase("Content-Encoding")) {
              contentEncoding=header.getValue();
            }
           
          }
          cfhttp.set(RESPONSEHEADER,responseHeader);
          cfhttp.set(KeyConstants._cookies,cookies);
          responseHeader.set(STATUS_CODE,new Double(rsp.getStatusCode()));
          responseHeader.set(EXPLANATION,(rsp.getStatusText()));
          if(setCookie.size()>0)responseHeader.set(SET_COOKIE,setCookie);
         
      // is text
          boolean isText=
            mimetype == null || 
            mimetype == NO_MIMETYPE || HTTPUtil.isTextMimeType(mimetype);
View Full Code Here

Examples of railo.runtime.type.StructImpl

    cfhttp.setEL(CHARSET,"");
    cfhttp.setEL(ERROR_DETAIL,"Unknown host: "+t.getMessage());
    cfhttp.setEL(FILE_CONTENT,"Connection Failure");
    cfhttp.setEL(KeyConstants._header,"");
    cfhttp.setEL(KeyConstants._mimetype,"Unable to determine MIME type of file.");
    cfhttp.setEL(RESPONSEHEADER,new StructImpl());
    cfhttp.setEL(STATUSCODE,"Connection Failure. Status code unavailable.");
    cfhttp.setEL(KeyConstants._text,Boolean.TRUE);
  }
View Full Code Here

Examples of railo.runtime.type.StructImpl

    cfhttp.setEL(CHARSET,"");
    cfhttp.setEL(ERROR_DETAIL,"");
    cfhttp.setEL(FILE_CONTENT,"Connection Timeout");
    cfhttp.setEL(KeyConstants._header,"");
    cfhttp.setEL(KeyConstants._mimetype,"Unable to determine MIME type of file.");
    cfhttp.setEL(RESPONSEHEADER,new StructImpl());
    cfhttp.setEL(STATUSCODE,"408 Request Time-out");
    cfhttp.setEL(STATUS_CODE,new Double(408));
    cfhttp.setEL(STATUS_TEXT,"Request Time-out");
    cfhttp.setEL(KeyConstants._text,Boolean.TRUE);
  }
View Full Code Here

Examples of railo.runtime.type.StructImpl

    this.timeout = (long)timeout;
  }

  @Override
  public void setDynamicAttribute(String uri, String name, Object value) {
    if(attrs==null)attrs=new StructImpl();
    Key key = KeyImpl.getInstance(StringUtil.trim(name,""));
    attrs.setEL(key,value);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.