Package railo.runtime.type.scope

Examples of railo.runtime.type.scope.Undefined


          return query.get(key,defaultValue);
      }
      // get it from undefined scope
    pc = ThreadLocalPageContext.get(pc);
    if(pc!=null){
      Undefined undefined = pc.undefinedScope();
      boolean old = undefined.setAllowImplicidQueryCall(false);
      Object sister = undefined.get(this.key,NullSupportHelper.NULL());
      undefined.setAllowImplicidQueryCall(old);
      if(sister!=NullSupportHelper.NULL()){
        try {
          return pc.get(sister, key);
        } catch (PageException e) {
          return defaultValue;
View Full Code Here


    if(key.equals(this.key)) {
        return get(qry.getCurrentrow(pc.getId()),defaultValue);
      }
      // get it from undefined scope
    if(pc!=null){
      Undefined undefined = pc.undefinedScope();
      boolean old = undefined.setAllowImplicidQueryCall(false);
      Object sister = undefined.get(this.key,null);
      undefined.setAllowImplicidQueryCall(old);
      if(sister!=null){
        try {
          return pc.get(sister, key);
        } catch (PageException e) {
          return defaultValue;
View Full Code Here

      PageContextImpl pci=(PageContextImpl) pc;
      Argument newArgs= pci.getScopeFactory().getArgumentInstance();
        newArgs.setFunctionArgumentNames(properties.argumentsSet);
        LocalImpl newLocal=pci.getScopeFactory().getLocalInstance();
       
    Undefined   undefined=pc.undefinedScope();
    Argument  oldArgs=pc.argumentsScope();
        Local    oldLocal=pc.localScope();
        Collection.Key oldCalledName=pci.getActiveUDFCalledName();
       
    pc.setFunctionScopes(newLocal,newArgs);
    pci.setActiveUDFCalledName(calledName);
   
    int oldCheckArgs=undefined.setMode(properties.localMode==null?pc.getApplicationContext().getLocalMode():properties.localMode.intValue());
    PageSource psInc=null;
    try {
      PageSource ps = getPageSource();
      if(doIncludePath)psInc = ps;
      //if(!ps.getDisplayPath().endsWith("Dump.cfc"))print.e(getPageSource().getDisplayPath());
      if(doIncludePath && getOwnerComponent()!=null) {
        //if(!ps.getDisplayPath().endsWith("Dump.cfc"))print.ds(ps.getDisplayPath());
        psInc=ComponentUtil.getPageSource(getOwnerComponent());
        if(psInc==pci.getCurrentTemplatePageSource()) {
          psInc=null;
        }
       
      }
      pci.addPageSource(ps,psInc);
      pci.addUDF(this);
     
//////////////////////////////////////////
      BodyContent bc=null;
      Boolean wasSilent=null;
      boolean bufferOutput=getBufferOutput(pci);
      if(!getOutput()) {
        if(bufferOutput) bc =  pci.pushBody();
        else wasSilent=pc.setSilent()?Boolean.TRUE:Boolean.FALSE;
      }
     
        UDF parent=null;
        if(ownerComponent!=null) {
          parent=pci.getActiveUDF();
          pci.setActiveUDF(this);
        }
        Object returnValue = null;
       
        try {
         
          if(args!=nulldefineArguments(pc,getFunctionArguments(),args,newArgs);
        else       defineArguments(pc,getFunctionArguments(),values,newArgs);
         
        returnValue=implementation(pci);
        if(ownerComponent!=null)pci.setActiveUDF(parent);
      }
          catch(Throwable t) {
            if(ownerComponent!=null)pci.setActiveUDF(parent);
            if(!getOutput()) {
              if(bufferOutput)BodyContentUtil.flushAndPop(pc,bc);
              else if(!wasSilent)pc.unsetSilent();
            }
            //BodyContentUtil.flushAndPop(pc,bc);
            throw Caster.toPageException(t);
          }
          if(!getOutput()) {
            if(bufferOutput)BodyContentUtil.clearAndPop(pc,bc);
            else if(!wasSilent)pc.unsetSilent();
          }
          //BodyContentUtil.clearAndPop(pc,bc);
         
         
         
         
          if(properties.returnType==CFTypes.TYPE_ANY) return returnValue;
          else if(Decision.isCastableTo(properties.strReturnType,returnValue,false,false,-1)) return returnValue;
          else throw new UDFCasterException(this,properties.strReturnType,returnValue);
      //REALCAST return Caster.castTo(pageContext,returnType,returnValue,false);
//////////////////////////////////////////
     
    }
    finally {
      pc.removeLastPageSource(psInc!=null);
      pci.removeUDF();
            pci.setFunctionScopes(oldLocal,oldArgs);
            pci.setActiveUDFCalledName(oldCalledName);
        undefined.setMode(oldCheckArgs);
            pci.getScopeFactory().recycle(newArgs);
            pci.getScopeFactory().recycle(newLocal);
    }
  }
View Full Code Here

        Variables var=pageContext.variablesScope();
        pageContext.setVariablesScope(ctVariablesScope);
       
       
        QueryStack cs=null;
        Undefined undefined=pageContext.undefinedScope();
        int oldMode=undefined.setMode(Undefined.MODE_NO_LOCAL_AND_ARGUMENTS);
        if(oldMode!=Undefined.MODE_NO_LOCAL_AND_ARGUMENTS)
          callerScope.setScope(var,pageContext.localScope(),pageContext.argumentsScope(),true);
        else
          callerScope.setScope(var,null,null,false);
       
        if(pageContext.getConfig().allowImplicidQueryCall()) {
            cs=undefined.getQueryStack();
            undefined.setQueryStack(new QueryStackImpl());
        }
           
        try {
            pageContext.doInclude(new PageSource[]{source.getPageSource()},false);
        }
        catch (Throwable t) {
            throw Caster.toPageException(t);
        }
        finally {
            undefined.setMode(oldMode);
            //varScopeData=variablesScope.getMap();
            pageContext.setVariablesScope(var);
            if(pageContext.getConfig().allowImplicidQueryCall()) {
                undefined.setQueryStack(cs);
            }
        }
   
    }
View Full Code Here

      }
     
      // Undefined Scope
      else if(scope instanceof Undefined) {
        PageContextImpl pci=(PageContextImpl) pc;
        Undefined undefined=(Undefined) scope;
       
        boolean check=undefined.getCheckArguments();
        Variables orgVar=pc.variablesScope();
        Argument orgArgs=pc.argumentsScope();
            Local orgLocal=pc.localScope();
       
        pci.setVariablesScope(undefined.variablesScope());
        if(check)pci.setFunctionScopes(undefined.localScope(), undefined.argumentsScope());
            try{
              if(value!=NULL) return setVariable(pc, str,value);
              return getVariable(pc, str);
            }
            finally{
View Full Code Here

    pc.setThreadScope("thread", new ThreadsImpl(this));
    pc.setThread(Thread.currentThread());
   
    //String encodings = pc.getHttpServletRequest().getHeader("Accept-Encoding");
   
    Undefined undefined=pc.us();
   
    Argument newArgs=new ArgumentThreadImpl((Struct) Duplicator.duplicate(attrs,false));
        LocalImpl newLocal=pc.getScopeFactory().getLocalInstance();
        //Key[] keys = attrs.keys();
        Iterator<Entry<Key, Object>> it = attrs.entryIterator();
        Entry<Key, Object> e;
    while(it.hasNext()){
      e = it.next();
      newArgs.setEL(e.getKey(),e.getValue());
    }
   
    newLocal.setEL(KEY_ATTRIBUTES, newArgs);

    Argument oldArgs=pc.argumentsScope();
        Local oldLocal=pc.localScope();
       
        int oldMode=undefined.setMode(Undefined.MODE_LOCAL_OR_ARGUMENTS_ALWAYS);
    pc.setFunctionScopes(newLocal,newArgs);
   
    try {
      p.threadCall(pc, threadIndex);
    }
    catch (Throwable t) {
      if(!Abort.isSilentAbort(t)) {
        ConfigWeb c = pc.getConfig();
        if(c instanceof ConfigImpl) {
          ConfigImpl ci=(ConfigImpl) c;
          LogAndSource log = ci.getThreadLogger();
          if(log!=null)log.error(this.getName(), ExceptionUtil.getStacktrace(t,true));
        }
        PageException pe = Caster.toPageException(t);
        if(!serializable)catchBlock=pe.getCatchBlock(pc);
        return pe;
      }
    }
    finally {
      completed=true;
      pc.setFunctionScopes(oldLocal,oldArgs);
        undefined.setMode(oldMode);
        //pc.getScopeFactory().recycle(newArgs);
            pc.getScopeFactory().recycle(newLocal);
           
            if(pc.getHttpServletResponse() instanceof HttpServletResponseDummy) {
              HttpServletResponseDummy rsp=(HttpServletResponseDummy) pc.getHttpServletResponse();
View Full Code Here

      }
     
      // Undefined Scope
      else if(objs[objs.length-1] instanceof Undefined) {
        PageContextImpl pci=(PageContextImpl) pc;
        Undefined undefined=(Undefined) objs[objs.length-1];
       
        boolean check=undefined.getCheckArguments();
        Variables orgVar=pc.variablesScope();
        Argument orgArgs=pc.argumentsScope();
            Local orgLocal=pc.localScope();
       
        pci.setVariablesScope(undefined.variablesScope());
        if(check)pci.setFunctionScopes(undefined.localScope(), undefined.argumentsScope());
            try{
              return _call(pc, objs,objs.length-1,preciseMath);
            }
            finally{
              pc.setVariablesScope(orgVar);
View Full Code Here

TOP

Related Classes of railo.runtime.type.scope.Undefined

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.