Package railo.runtime.type

Examples of railo.runtime.type.Struct


     */
    private FTPClient actionClose() throws PageException {
        FTPConnection conn = _createConnection();
        FTPClient client = pool.remove(conn);
       
        Struct cfftp = writeCfftp(client);
        cfftp.setEL("succeeded",Caster.toBoolean(client!=null));
        return client;
    }
View Full Code Here


     * @param client
     * @return FTPCLient
     * @throws PageException
     */
    private Struct writeCfftp(FTPClient client) throws PageException  {
        Struct cfftp=new StructImpl();
        if(result==null)pageContext.variablesScope().setEL(CFFTP,cfftp);
        else pageContext.setVariable(result,cfftp);
        if(client==null) {
            cfftp.setEL(SUCCEEDED,Boolean.FALSE);
            cfftp.setEL(ERROR_CODE,new Double(-1));
            cfftp.setEL(ERROR_TEXT,"");
            cfftp.setEL(RETURN_VALUE,"");
            return cfftp;
        }
        int repCode = client.getReplyCode();
        String repStr=client.getReplyString();
        cfftp.setEL(ERROR_CODE,new Double(repCode));
        cfftp.setEL(ERROR_TEXT,repStr);
       
        cfftp.setEL(SUCCEEDED,Caster.toBoolean(FTPReply.isPositiveCompletion(repCode)));
        cfftp.setEL(RETURN_VALUE,repStr);
        return cfftp;
    }
View Full Code Here

  @Override
  public int doStartTag() throws PageException  {
   
    // current
        CFTag current=getCFTag();
        Struct value;
        if(current==null || (value=current.getAttributesScope())==null)
          throw new ApplicationException("invalid context, tag is no inside a custom tag");
       
        // parent
        CFTag parent=GetBaseTagData.getParentCFTag(current.getParent(), basetag, -1);
        if(parent==null) throw new ApplicationException("there is no parent tag with name ["+basetag+"]");
       
        Struct thisTag=parent.getThis();
        Object obj=thisTag.get(datacollection,null);
       
        Array array;

        if(obj==null) {
            array=new ArrayImpl(new Object[]{value});
            thisTag.set(datacollection,array);  
        }
        else if(Decision.isArray(obj) && (array=Caster.toArray(obj)).getDimension()==1) {
            array.append(value);
        }
        else {
            array=new ArrayImpl(new Object[]{obj,value});
            thisTag.set(datacollection,array);  
        }
    return SKIP_BODY;
  }
View Full Code Here

   
    return threads;
  }
 
  private void pause(String name,CFMLFactoryImpl factory,List<IFDThread> threads) {
    Struct pcs = factory.getRunningPageContexts();
    Iterator<Entry<Key, Object>> it = pcs.entryIterator();
    PageContextImpl pc;
   
    while(it.hasNext()){
      pc=(PageContextImpl) it.next().getValue();
      try {
View Full Code Here

   * @param factory
   * @param id
   * @return matching thread or null
   */
  private FDThreadImpl getByNativeIdentifier(String name,CFMLFactoryImpl factory,String id) {
    Struct pcs = factory.getRunningPageContexts();
    Iterator it = pcs.entrySet().iterator();
    PageContextImpl pc;
   
    while(it.hasNext()){
      pc=(PageContextImpl) ((Entry) it.next()).getValue();
      if(equals(pc,id)) return new FDThreadImpl(this,factory,name,pc);
View Full Code Here

      Object obj;
     

      // struct
      if(CommonUtil.isStruct(params)) {
        Struct sct=CommonUtil.toStruct(params);
        Key[] keys   = CommonUtil.keys(sct);
        String name;
        // fix case-senstive
        Struct names=CommonUtil.createStruct();
        if(meta!=null){
          Iterator<String> it = meta.getNamedParameterNames().iterator();
          while(it.hasNext()){
            name=it.next();
            names.setEL(name, name);
          }
        }
       
        RefBoolean isArray=CommonUtil.createRefBoolean();
        for(int i=0;i<keys.length;i++){
          obj=sct.get(keys[i],null);
          if(meta!=null){
            name=(String) names.get(keys[i],null);
            if(name==null) continue; // param not needed will be ignored
            type = meta.getNamedParameterExpectedType(name);
            obj=HibernateCaster.toSQL(type, obj,isArray);
            if(isArray.toBooleanValue())
              query.setParameterList(name, (Object[])obj,type);
View Full Code Here

          return null;
         
    paramsStr = paramsStr.substring(1, paramsStr.length() - 1);
    String items[] = ListUtil.listToStringArray(paramsStr, ',');
   
    Struct params=new StructImpl();
    String arr$[] = items;
    int index;
        for(int i = 0; i < arr$.length; i++)  {
            String pair = arr$[i];
            index = pair.indexOf('=');
            if(index == -1) return null;
           
            params.setEL(
                KeyImpl.init(deleteQuotes(pair.substring(0, index).trim()).trim()),
                deleteQuotes(pair.substring(index + 1).trim()));
        }

        return params;
View Full Code Here

    Resource[] locs = getCfcLocations();
    Array arrLocs=new ArrayImpl();
    if(locs!=null)for(int i=0;i<locs.length;i++){
      arrLocs.appendEL(getAbsolutePath(locs[i]));
    }
    Struct sct=new StructImpl();
    sct.setEL(AUTO_GEN_MAP,this.autogenmap());
    sct.setEL(CATALOG,StringUtil.emptyIfNull(getCatalog()));
    sct.setEL(CFC_LOCATION,arrLocs);
    sct.setEL(IS_DEFAULT_CFC_LOCATION,isDefaultCfcLocation());
    sct.setEL(DB_CREATE,dbCreateAsString(getDbCreate()));
    sct.setEL(DIALECT,StringUtil.emptyIfNull(getDialect()));
    sct.setEL(EVENT_HANDLING,eventHandling());
    sct.setEL(EVENT_HANDLER,eventHandler());
    sct.setEL(NAMING_STRATEGY,namingStrategy());
    sct.setEL(FLUSH_AT_REQUEST_END,flushAtRequestEnd());
    sct.setEL(LOG_SQL,logSQL());
    sct.setEL(SAVE_MAPPING,saveMapping());
    sct.setEL(SCHEMA,StringUtil.emptyIfNull(getSchema()));
    sct.setEL(SECONDARY_CACHE_ENABLED,secondaryCacheEnabled());
    sct.setEL(SQL_SCRIPT,StringUtil.toStringEmptyIfNull(getSqlScript()));
    sct.setEL(USE_DB_FOR_MAPPING,useDBForMapping());
    sct.setEL(CACHE_CONFIG,getAbsolutePath(getCacheConfig()));
    sct.setEL(CACHE_PROVIDER,StringUtil.emptyIfNull(getCacheProvider()));
    sct.setEL(ORM_CONFIG,getAbsolutePath(getOrmConfig()));
   
   
   
    return sct;
  }
View Full Code Here

  public static Point toPoint(Object value, String argName) throws PageException {
    if(value instanceof Point) return (Point) value;
    String str = Caster.toString(value);
   
    Struct sct = Caster.toStruct(value,null);
    if(sct!=null){
      return new Point(Caster.toIntValue(sct.get("x")),Caster.toIntValue(sct.get("y")));
    }
   
    String[] arr = ListUtil.listToStringArray(str, ',');
    if(arr.length==2) {
      return new Point(Caster.toIntValue(arr[0]),Caster.toIntValue(arr[1]));
View Full Code Here

  public static LightFilter.Material toLightFilter$Material(Object value, String argName) throws PageException {
    if(value instanceof LightFilter.Material)
      return (LightFilter.Material) value;
   
    Struct sct = Caster.toStruct(value,null);
    if(sct!=null){
      Material material = new LightFilter.Material();
      material.setDiffuseColor(toColorRGB(sct.get("color"), argName+".color"));
      material.setOpacity(Caster.toFloatValue(sct.get("opacity")));
      return material;
    }
    String str = Caster.toString(value,null);
    if(str!=null){
      String[] arr = ListUtil.listToStringArray(str, ',');
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.