Examples of UDF


Examples of railo.runtime.type.UDF

    ComponentScope scope = cw.getComponentScope();
    Struct udfs=new StructImpl(),sctUDF,sctArg;
    Array arrArg;
    Iterator<Object> it = scope.valueIterator();
    Object v;
    UDF udf;
    FunctionArgument[] args;
    while(it.hasNext()){
        v=it.next();
          // UDF
        if(v instanceof UDF) {
          udf=(UDF) v;
            sctUDF=new StructImpl();
            arrArg=new ArrayImpl();
            udfs.setEL(udf.getFunctionName(), sctUDF);
            args = udf.getFunctionArguments();
            for(int i=0;i<args.length;i++){
              sctArg=new StructImpl();
              arrArg.appendEL(sctArg);
              sctArg.setEL(KeyConstants._name, args[i].getName().getString());
              sctArg.setEL(KeyConstants._type, args[i].getTypeAsString());
              sctArg.setEL(KeyConstants._required, args[i].isRequired());
              if(!StringUtil.isEmpty(args[i].getHint()))sctArg.setEL(KeyConstants._hint, args[i].getHint());
            }
            sctUDF.set(KeyConstants._arguments, arrArg);
            sctUDF.set(KeyConstants._returntype, udf.getReturnTypeAsString());
           
          }
    }
    Struct rtn=new StructImpl();
    rtn.set(KeyConstants._functions, udfs);
View Full Code Here

Examples of railo.runtime.type.UDF

    catch(MissingIncludeException mie){
      ApplicationContext ac = pc.getApplicationContext();
      boolean rethrow=true;
      if(ac instanceof ClassicApplicationContext) {
        ClassicApplicationContext cfc=(ClassicApplicationContext) ac;
        UDF udf = cfc.getOnMissingTemplate();
        if(udf!=null) {
          String targetPage=requestedPage.getFullRealpath();
          rethrow=(!Caster.toBooleanValue(udf.call(pc, new Object[]{targetPage}, true),true));
        }
      }
      if(rethrow)throw mie;
    }
   
View Full Code Here

Examples of railo.runtime.type.UDF

    String filename=Caster.toString((((FunctionValue) objArr[0]).getValue()));
    Collection.Key name=KeyImpl.toKey((((FunctionValue) objArr[1]).getValue()));
    boolean isweb=Caster.toBooleanValue((((FunctionValue) objArr[2]).getValue()));
   
   
    UDF udf=loadUDF(pc, filename, name, isweb);
    Struct meta = udf.getMetaData(pc);
    boolean caller=meta==null?false:Caster.toBooleanValue(meta.get(KeyConstants._caller,Boolean.FALSE),false);
   
    Struct namedArguments=null;
    Object[] arguments=null;
    if(objArr.length<=3)arguments=ArrayUtil.OBJECT_EMPTY;
View Full Code Here

Examples of railo.runtime.type.UDF

  }

  public static synchronized UDF loadUDF(PageContext pc, String filename,Collection.Key name,boolean isweb) throws PageException {
    ConfigWebImpl config = (ConfigWebImpl) pc.getConfig();
    String key=isweb?name.getString()+config.getId():name.getString();
      UDF udf=config.getFromFunctionCache(key);
    if(udf!=null) return udf;
   
    Mapping mapping=isweb?config.getFunctionMapping():config.getServerFunctionMapping();
      PageSourceImpl ps = (PageSourceImpl) mapping.getPageSource(filename);
      Page p = ps.loadPage(pc)
View Full Code Here

Examples of railo.runtime.type.UDF

    Component c=cfc;
    if(cfc instanceof ComponentAccess)c=ComponentWrap.toComponentWrap(methodAccessLevel,cfc);
   

    Property[] prop = cfc.getProperties(false);
    Object v; UDF udf;
      if(prop!=null)for(int i=0;i<prop.length;i++) {
        boolean remotingFetch = Caster.toBooleanValue(prop[i].getDynamicAttributes().get(REMOTING_FETCH,Boolean.TRUE),true);
        if(!remotingFetch) continue;
       
        v=cfc.get(prop[i].getName(),null);
        if(v==null){
          v=c.get("get"+prop[i].getName(),null);
          if(v instanceof UDF){
                udf=(UDF) v;
                if(udf.getReturnType()==CFTypes.TYPE_VOID) continue;
                if(udf.getFunctionArguments().length>0) continue;
               
                try {
            v=c.call(ThreadLocalPageContext.get(), udf.getFunctionName(), ArrayUtil.OBJECT_EMPTY);
          } catch (PageException e) {
            continue;
          }
              }
        }
View Full Code Here

Examples of railo.runtime.type.UDF

    ArrayList<FunctionLibFunctionArg> args = function.getArg();
   
    String filename = Caster.toString(args.get(0).getDefaultValue());
    Key name = KeyImpl.toKey(args.get(1).getDefaultValue());
    boolean isWeb = Caster.toBooleanValue(args.get(2).getDefaultValue());
    UDF udf = CFFunction.loadUDF(pc, filename, name, isWeb);
   
    sct.set(KeyConstants._name,function.getName());
        sct.set(ARGUMENT_TYPE,"fixed");
        sct.set(KeyConstants._description,StringUtil.emptyIfNull(udf.getHint()));
        sct.set(RETURN_TYPE,StringUtil.emptyIfNull(udf.getReturnTypeAsString()));
        sct.set(KeyConstants._type,"cfml");
        sct.set(SOURCE,udf.getPageSource().getDisplayPath());
    sct.set(KeyConstants._status,"implemeted");
   
   
        FunctionArgument[] fas = udf.getFunctionArguments();
        Array _args=new ArrayImpl();
    sct.set(KeyConstants._arguments,_args);
        int min=0,max=0;
    for(int i=0;i<fas.length;i++) {
          FunctionArgument fa=fas[i];
View Full Code Here

Examples of railo.runtime.type.UDF

   
    Iterator it = cfc.entrySet().iterator();
        Map.Entry entry;
        Object v;
        Collection.Key k;
        UDF udf;
        String name;
        while(it.hasNext()) {
            entry=(Entry) it.next();
            k=KeyImpl.toKey(entry.getKey());
            v=entry.getValue();
           
            // add getters
            if(v instanceof UDF){
              if(!doGetters) continue;
              udf=(UDF) v;
              name=udf.getFunctionName();
              if(!StringUtil.startsWithIgnoreCase(name, "get"))continue;
              if(udf.getReturnType()==CFTypes.TYPE_VOID) continue;
              if(udf.getFunctionArguments().length>0) continue;
             
              try {
          v=cfc.call(ThreadLocalPageContext.get(), name, ArrayUtil.OBJECT_EMPTY);
        } catch (PageException e) {
          continue;
View Full Code Here

Examples of railo.transformer.bytecode.expression.var.UDF

                        ));
            }
      }
    }
    else {
      fm = new UDF(name);
    }
   
   
   
View Full Code Here

Examples of railo.transformer.bytecode.expression.var.UDF

        rtn=Types.OBJECT;
      }
     
      // UDF
      else if(member instanceof UDF) {
        UDF udf=(UDF) member;
       
        udf.getName().writeOut(bc, MODE_REF);
        ExpressionUtil.writeOutExpressionArray(bc, Types.OBJECT, udf.getArguments());
       
        adapter.invokeVirtual(Types.PAGE_CONTEXT,udf.hasNamedArgs()?GET_FUNCTION_WITH_NAMED_ARGS:GET_FUNCTION);
        rtn=Types.OBJECT;
       
      }
    }
   
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.