Package railo.runtime

Examples of railo.runtime.Component


    String filename = Caster.toString(attrFilename.getDefaultValue());
    String name = Caster.toString(attrFilename.getDefaultValue());
    boolean isWeb = Caster.toBooleanValue(attrIsWeb.getDefaultValue());
    InitFile source = CFTagCore.createInitFile(pc, isWeb, filename);
   
    Component cfc = ComponentLoader.loadComponent(pc,null,source.getPageSource(), source.getFilename().substring(0,source.getFilename().length()-(pc.getConfig().getCFCExtension().length()+1)), false,true);
        ComponentWrap cw=ComponentWrap.toComponentWrap(Component.ACCESS_PRIVATE, cfc);
    Struct metadata=Caster.toStruct(cw.get("metadata",null),null,false);
   
   
    Struct sct=new StructImpl();
View Full Code Here


 
  private static final Object[] EMPTY = new Object[0];

  public static Object call(PageContext pc , Object[] objArr) throws PageException {
    String path = Caster.toString(objArr[objArr.length-1]);
    Component cfc = CreateObject.doComponent(pc, path);
   
    // no init method
    if(!(cfc.get(KeyConstants._init,null) instanceof UDF)){
     
      if(objArr.length>1) {
        Object arg1 = objArr[0];
        if(arg1 instanceof FunctionValue) {
          Struct args=Caster.toFunctionValues(objArr,0,objArr.length-1);
          EntityNew.setPropeties(pc, cfc, args,true);
        }
        else if(Decision.isStruct(arg1)){
          Struct args=Caster.toStruct(arg1);
          EntityNew.setPropeties(pc, cfc, args,true);
        }
      }
     
      return cfc;
    }
   
    Object rtn;
    // no arguments
    if(objArr.length==1) {
      rtn = cfc.call(pc, KeyConstants._init, EMPTY);
   
    // named arguments
    else if(objArr[0] instanceof FunctionValue) {
      Struct args=Caster.toFunctionValues(objArr,0,objArr.length-1);
      rtn = cfc.callWithNamedValues(pc, KeyConstants._init, args);
    }
    // no name arguments
    else {
      Object[] args = new Object[objArr.length-1];
      for(int i=0;i<objArr.length-1;i++) {
        args[i]=objArr[i];
        if(args[i] instanceof FunctionValue)
          throw new ExpressionException("invalid argument defintion,when using named parameters to a function, every parameter must have a name.");
      }
      rtn = cfc.call(pc, KeyConstants._init, args);
    }
    if(rtn==null)return cfc;
    return rtn;
  }
View Full Code Here

  protected ASObject toAMFObject(Component cfc) throws PageException {
    ASObject aso = new ASObject();
    aso.setType(cfc.getCallName());
   
   
    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

        Page p = PageSourceImpl.loadPage(pc, ((PageContextImpl)pc).getPageSources(name), null) ;

        if(p==null)throw new ApplicationException("Could not find a Component with name ["+aso.getType()+"]");
       
        Component cfc = ComponentLoader.loadComponent(pc, p, p.getPageSource(), aso.getType(), false);
        ComponentWrap cw=ComponentWrap.toComponentWrap(config.getComponentDataMemberDefaultAccess(),cfc);
       
        Iterator it = aso.entrySet().iterator();
        Map.Entry entry;
        while(it.hasNext()){
View Full Code Here

TOP

Related Classes of railo.runtime.Component

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.