Package railo.commons.lang.types

Examples of railo.commons.lang.types.RefBoolean


      try{
      int min=tag.getMin();
      int max=tag.getMax();
      int count=0;
      ArrayList<String> args=new ArrayList<String>();
      RefBoolean allowDefaultValue=new RefBooleanImpl(tag.getDefaultAttribute()!=null);
      while(data.cfml.isValidIndex())  {
        data.cfml.removeSpace();
        // if no more attributes break
        if(data.cfml.isCurrent('/') || data.cfml.isCurrent('>')) break;
       
View Full Code Here


    private static Attribute attribute(TagData data,TagLibTag tag, ArrayList<String> args,RefBoolean allowDefaultValue) throws TemplateException {
      Expression value=null;
     
      // Name
      StringBuffer sbType=new StringBuffer();
      RefBoolean dynamic=new RefBooleanImpl(false);
      boolean isDefaultValue=false;
      boolean[] parseExpression=new boolean[2];
      parseExpression[0]=true;
      parseExpression[1]=false;
      String name=attributeName(data.cfml,dynamic,args,tag,sbType,parseExpression,allowDefaultValue.toBooleanValue());
     
      // mixed in a noname attribute
      if(StringUtil.isEmpty(name)){
        allowDefaultValue.setValue(false);
        TagLibTagAttr attr = tag.getDefaultAttribute();
        if(attr==null)
          throw new TemplateException(data.cfml,"Invalid Identifier.");
        name=attr.getName();
        sbType.append(attr.getType());
        isDefaultValue=true;
      }
     
     
      comment(data.cfml,true);
     
      if(isDefaultValue || data.cfml.forwardIfCurrent('='))  {
        comment(data.cfml,true);
        // Value
        value=attributeValue(data,tag,sbType.toString(),parseExpression[0],false,LitString.toExprString(""))
      }
      // default value boolean true
      else {
        value=tag.getAttributeDefaultValue();
        if(sbType.toString().length()>0) {
          value=CastOther.toExpression(value, sbType.toString());
        }
      }   
      comment(data.cfml,true);
     
      return new Attribute(dynamic.toBooleanValue(),name,value,sbType.toString());
    }
View Full Code Here

        // init application
       
        Lock nameLock = lock.lock(name,getRequestTimeout());
        //print.o("inner-lock  :"+token);
        try {
          RefBoolean isNew=new RefBooleanImpl(false);
          application=scopeContext.getApplicationScope(this,isNew);// this is needed that the application scope is initilized
          if(isNew.toBooleanValue()) {
            try {
            if(!listener.onApplicationStart(this)) {
              scopeContext.removeApplicationScope(this);
                return false;
            }
View Full Code Here

public final class MixedAppListener extends ModernAppListener {

  @Override
  public void onRequest(PageContext pc, PageSource requestedPage, RequestListener rl) throws PageException {
    RefBoolean isCFC=new RefBooleanImpl(false);
   
    PageSource appPS=//pc.isCFCRequest()?null:
      AppListenerUtil.getApplicationPageSource(pc, requestedPage, mode, isCFC);
   
    if(isCFC.toBooleanValue())_onRequest(pc, requestedPage,appPS,rl);
    else ClassicAppListener._onRequest(pc, requestedPage,appPS,rl);
  }
View Full Code Here

        requestedPage=rl.execute(pc, requestedPage);
        if(requestedPage==null) return;
      }
     
      String targetPage=requestedPage.getFullRealpath();
      RefBoolean goon=new RefBooleanImpl(true);
     
      // onRequestStart
      if(app.contains(pc,ON_REQUEST_START)) {
        try {
          Object rtn=call(app,pci, ON_REQUEST_START, new Object[]{targetPage},false);
          if(!Caster.toBooleanValue(rtn,true))
            return;
        }
        catch(PageException pe){
          pe=handlePageException(pci,app,pe,requestedPage,targetPage,goon);
          if(pe!=null) throw pe;
        }
      }
       
      // onRequest
      if(goon.toBooleanValue()) {
      boolean isCFC=ResourceUtil.getExtension(targetPage,"").equalsIgnoreCase(pc.getConfig().getCFCExtension());
      Object method;
      if(isCFC && app.contains(pc,ON_CFCREQUEST) && (method=pc.urlFormScope().get(KeyConstants._method,null))!=null) {
       
        Struct url = (Struct)Duplicator.duplicate(pc.urlFormScope(),true);

        url.removeEL(KeyConstants._fieldnames);
        url.removeEL(KeyConstants._method);
       
        Object args=url.get(KeyConstants._argumentCollection,null);
       
        // url returnFormat
        Object oReturnFormat=url.removeEL(KeyConstants._returnFormat);
        int urlReturnFormat=-1;
        if(oReturnFormat!=null) urlReturnFormat=UDFUtil.toReturnFormat(Caster.toString(oReturnFormat,null),-1);
       
        // request header accept
        List<MimeType> accept = ReqRspUtil.getAccept(pc);
        int headerReturnFormat = MimeType.toFormat(accept, -1,-1);

            Object queryFormat=url.removeEL(KeyConstants._queryFormat);
           
            if(args==null){
              args=pc.getHttpServletRequest().getAttribute("argumentCollection");
            }
           
            if(args instanceof String){
              args=new JSONExpressionInterpreter().interpret(pc, (String)args);
            }
           
            if(args!=null) {
              if(Decision.isCastableToStruct(args)){
                Struct sct = Caster.toStruct(args,false);
                //Key[] keys = url.keys();
                Iterator<Entry<Key, Object>> it = url.entryIterator();
                Entry<Key, Object> e;
                while(it.hasNext()){
                  e = it.next();
                  sct.setEL(e.getKey(),e.getValue());
                }
                args=sct;
              }
              else if(Decision.isCastableToArray(args)){
                args = Caster.toArray(args);
              }
              else {
                Array arr = new ArrayImpl();
                arr.appendEL(args);
                args=arr;
              }
            }
            else
              args=url;

            Object rtn = call(app,pci, ON_CFCREQUEST, new Object[]{requestedPage.getComponentName(),method,args},true);
           
            if(rtn!=null){
              if(pc.getHttpServletRequest().getHeader("AMF-Forward")!=null) {
                pc.variablesScope().setEL("AMF-Forward", rtn);
                //ThreadLocalWDDXResult.set(rtn);
              }
              else {
                try {
              ComponentPage.writeToResponseStream(pc,app,method.toString(),urlReturnFormat,headerReturnFormat,queryFormat,rtn);
            } catch (Exception e) {
              throw Caster.toPageException(e);
            }
              }
            }
       
       
      }
      //else if(!isCFC && app.contains(pc,ON_REQUEST)) {}
      else {
        // TODO impl die nicht so generisch ist
        try{

          if(!isCFC && app.contains(pc,ON_REQUEST))
            call(app,pci, ON_REQUEST, new Object[]{targetPage},false);
          else
            pci.doInclude(requestedPage);
        }
        catch(PageException pe){
          pe=handlePageException(pci,app,pe,requestedPage,targetPage,goon);
          if(pe!=null) throw pe;
        }
      }
      }
      // onRequestEnd
      if(goon.toBooleanValue() && app.contains(pc,ON_REQUEST_END)) {
        try {
          call(app,pci, ON_REQUEST_END, new Object[]{targetPage},false);
        }
        catch(PageException pe){
          pe=handlePageException(pci,app,pe,requestedPage,targetPage,goon);
View Full Code Here

  }

  private void initApplicationContext(PageContextImpl pc, ComponentAccess app) throws PageException {
   
    // use existing app context
    RefBoolean throwsErrorWhileInit=new RefBooleanImpl(false);
    ModernApplicationContext appContext = new ModernApplicationContext(pc,app,throwsErrorWhileInit);

   
    pc.setApplicationContext(appContext);
    if(appContext.isORMEnabled()) {
      boolean hasError=throwsErrorWhileInit.toBooleanValue();
      if(hasError)pc.addPageSource(app.getPageSource(), true);
      try{
        ORMUtil.resetEngine(pc,false);
      }
      finally {
View Full Code Here

      DumpTable table=new DumpTable("#ffffff","#cccccc","#000000");
      table.appendRow(1,new SimpleDumpData(label));
      table.appendRow(0,dd);
      dd=table;
    }
    RefBoolean hasReference=new RefBooleanImpl(false);
    Struct sct = toStruct(dd,object,hasReference);
    sct.setEL("hasReference", hasReference.toBoolean());
    return sct;
  }
View Full Code Here

    }
   
    private  CFMLFactoryImpl loadJSPFactory(ConfigServerImpl configServer, ServletConfig sg, int countExistingContextes) throws ServletException {
      try {
            // Load Config
        RefBoolean isCustomSetting=new RefBooleanImpl();
            Resource configDir=getConfigDirectory(sg,configServer,countExistingContextes,isCustomSetting);
           
            QueryCacheSupport queryCache=QueryCacheSupport.getInstance();
            CFMLFactoryImpl factory=new CFMLFactoryImpl(this,queryCache);
            ConfigWebImpl config=ConfigWebFactory.newInstance(factory,configServer,configDir,isCustomSetting.toBooleanValue(),sg);
            factory.setConfig(config);
            return factory;
        }
        catch (Exception e) {
            ServletException se= new ServletException(e.getMessage());
View Full Code Here

TOP

Related Classes of railo.commons.lang.types.RefBoolean

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.