Package railo.runtime

Examples of railo.runtime.MappingImpl


  public static void releaseDatasourceConnection(PageContext pc, DatasourceConnection dc) {
    ((ConfigWebImpl)pc.getConfig()).getDatasourceConnectionPool().releaseDatasourceConnection(dc); // TODO use reflection
  }

  public static MappingImpl createMapping(Config config, String virtual, String physical) {
    return new MappingImpl(config,
        virtual,
        physical,
        null,INSPECT_UNDEFINED,true,false,false,false,true,true,null
        );
  }
View Full Code Here


public class PageContextUtil {

  public static ApplicationListener getApplicationListener(PageContext pc) {
    PageSource ps = pc.getBasePageSource();
    if(ps!=null) {
      MappingImpl mapp=(MappingImpl) ps.getMapping();
      if(mapp!=null) return mapp.getApplicationListener();
    }
    return pc.getConfig().getApplicationListener();
  }
View Full Code Here

        Mapping[] mappings = config.getCustomTagMappings();
        railo.runtime.type.Query qry=new QueryImpl(new String[]{"archive","strarchive","physical","strphysical","virtual","hidden","physicalFirst","readonly","inspect"},mappings.length,"query");
       
       
        for(int i=0;i<mappings.length;i++) {
            MappingImpl m=(MappingImpl) mappings[i];
            int row=i+1;
            qry.setAt("archive",row,m.getArchive());
            qry.setAt("strarchive",row,m.getStrArchive());
            qry.setAt("physical",row,m.getPhysical());
            qry.setAt("strphysical",row,m.getStrPhysical());
            qry.setAt("virtual",row,m.getVirtual());
            qry.setAt("hidden",row,Caster.toBoolean(m.isHidden()));
            qry.setAt("physicalFirst",row,Caster.toBoolean(m.isPhysicalFirst()));
            qry.setAt("readonly",row,Caster.toBoolean(m.isReadonly()));
            qry.setAt("inspect",row,ConfigWebUtil.inspectTemplate(m.getInspectTemplateRaw(), ""));
        }
        pageContext.setVariable(getString("admin",action,"returnVariable"),qry);
    }
View Full Code Here

        Mapping[] mappings = config.getComponentMappings();
        railo.runtime.type.Query qry=new QueryImpl(new String[]{"archive","strarchive","physical","strphysical","virtual","hidden","physicalFirst","readonly","inspect"},mappings.length,"query");
       
       
        for(int i=0;i<mappings.length;i++) {
            MappingImpl m=(MappingImpl) mappings[i];
            int row=i+1;
            qry.setAt("archive",row,m.getArchive());
            qry.setAt("strarchive",row,m.getStrArchive());
            qry.setAt("physical",row,m.getPhysical());
            qry.setAt("strphysical",row,m.getStrPhysical());
            qry.setAt("virtual",row,m.getVirtual());
            qry.setAt("hidden",row,Caster.toBoolean(m.isHidden()));
            qry.setAt("physicalFirst",row,Caster.toBoolean(m.isPhysicalFirst()));
            qry.setAt("readonly",row,Caster.toBoolean(m.isReadonly()));
            qry.setAt("inspect",row,ConfigWebUtil.inspectTemplate(m.getInspectTemplateRaw(), ""));
        }
        pageContext.setVariable(getString("admin",action,"returnVariable"),qry);
    }
View Full Code Here

        Mapping[] mappings = config.getMappings();
        Struct sct=new StructImpl();
        String virtual=getString("admin",action,"virtual");
       
        for(int i=0;i<mappings.length;i++) {
            MappingImpl m=(MappingImpl) mappings[i];
            if(!m.getVirtual().equals(virtual)) continue;
           
            sct.set("archive",m.getArchive());
            sct.set("strarchive",m.getStrArchive());
            sct.set("physical",m.getPhysical());
            sct.set("strphysical",m.getStrPhysical());
            sct.set("virtual",m.getVirtual());
            sct.set(KeyConstants._hidden,Caster.toBoolean(m.isHidden()));
            sct.set("physicalFirst",Caster.toBoolean(m.isPhysicalFirst()));
            sct.set("readonly",Caster.toBoolean(m.isReadonly()));
            sct.set("inspect",ConfigWebUtil.inspectTemplate(m.getInspectTemplateRaw(), ""));
            sct.set("toplevel",Caster.toBoolean(m.isTopLevel()));

            pageContext.setVariable(getString("admin",action,"returnVariable"),sct);
            return;
        }
        throw new ApplicationException("there is no mapping with virtual ["+virtual+"]");
View Full Code Here

        Mapping[] mappings = config.getMappings();
        railo.runtime.type.Query qry=new QueryImpl(new String[]{"archive","strarchive","physical","strphysical","virtual","hidden","physicalFirst","readonly","inspect","toplevel"},mappings.length,"query");
       
       
        for(int i=0;i<mappings.length;i++) {
            MappingImpl m=(MappingImpl) mappings[i];
            int row=i+1;
            qry.setAt("archive",row,m.getArchive());
            qry.setAt("strarchive",row,m.getStrArchive());
            qry.setAt("physical",row,m.getPhysical());
            qry.setAt("strphysical",row,m.getStrPhysical());
            qry.setAt("virtual",row,m.getVirtual());
            qry.setAt("hidden",row,Caster.toBoolean(m.isHidden()));
            qry.setAt("physicalFirst",row,Caster.toBoolean(m.isPhysicalFirst()));
            qry.setAt("readonly",row,Caster.toBoolean(m.isReadonly()));
            qry.setAt("inspect",row,ConfigWebUtil.inspectTemplate(m.getInspectTemplateRaw(), ""));
            qry.setAt("toplevel",row,Caster.toBoolean(m.isTopLevel()));
        }
        pageContext.setVariable(getString("admin",action,"returnVariable"),qry);
    }
View Full Code Here

    }
   
    protected void setTagDirectory(Resource tagDirectory) {
      this.tagDirectory=tagDirectory;
     
      this.tagMapping= new MappingImpl(this,"/mapping-tag/",tagDirectory.getAbsolutePath(),null,ConfigImpl.INSPECT_NEVER,true,true,true,true,false,true,null);
     
      TagLib tl=getCoreTagLib();
     
        // now overwrite with new data
        if(tagDirectory.isDirectory()) {
View Full Code Here

        tl.setTag(tlt);
    }
   
    protected void setFunctionDirectory(Resource functionDirectory) {
      //this.functionDirectory=functionDirectory;
      this.functionMapping= new MappingImpl(this,"/mapping-function/",functionDirectory.getAbsolutePath(),null,ConfigImpl.INSPECT_NEVER,true,true,true,true,false,true,null);
      FunctionLib fl=flds[flds.length-1];
       
        // now overwrite with new data
        if(functionDirectory.isDirectory()) {
          String[] files=functionDirectory.list(new ExtensionResourceFilter(getCFMLExtensions()));
View Full Code Here

  public Mapping createCustomTagAppMappings(String virtual, String physical) {
    Mapping m=customTagAppMappings.get(physical.toLowerCase());
   
    if(m==null){
      m=new MappingImpl(
        this,virtual,
        physical,
        null,ConfigImpl.INSPECT_UNDEFINED,true,false,false,false,true,true,null
        );
      customTagAppMappings.put(physical.toLowerCase(),m);
View Full Code Here

         
         
          String primary = el.getAttribute("primary");
          boolean physicalFirst = primary == null || !primary.equalsIgnoreCase("archive");

          tmp = new MappingImpl(config, virtual, physical, archive, insTemp, physicalFirst, hidden, readonly, toplevel, false, false, listener, clMaxEl);
          mappings.put(tmp.getVirtualLowerCase(), tmp);
          if (virtual.equals("/")) {
            finished = true;
            // break;
          }
        }
      }
     
      // set default railo-server-context
      if(config instanceof ConfigServer && !hasRailoServerContext) {
        ApplicationListener listener = ConfigWebUtil.loadListener("modern", null);
        listener.setMode(ApplicationListener.MODE_CURRENT2ROOT);
       
        tmp = new MappingImpl(config, "/railo-server-context", "{railo-server}/context/", null, ConfigImpl.INSPECT_ONCE, true, false, true, true, false, false, listener, 100);
        mappings.put(tmp.getVirtualLowerCase(), tmp);
      }
    }


    if ( !finished ) {

      if ( (config instanceof ConfigWebImpl) && ResourceUtil.isUNCPath( config.getRootDirectory().getPath() ) ) {

        tmp = new MappingImpl( config, "/", config.getRootDirectory().getPath(), null, ConfigImpl.INSPECT_UNDEFINED, true, true, true, true, false, false, null );
      } else {

        tmp = new MappingImpl( config, "/", "/", null, ConfigImpl.INSPECT_UNDEFINED, true, true, true, true, false, false, null );
      }

      mappings.put( "/", tmp );
    }
View Full Code Here

TOP

Related Classes of railo.runtime.MappingImpl

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.