Package railo.runtime

Examples of railo.runtime.PageContext


    ContentType ct = getContentType();
    String charset=null;
    if(ct!=null)charset=ct.getCharset();
    if(!StringUtil.isEmpty(charset)) return charset;
   
    PageContext pc = ThreadLocalPageContext.get();
    if(pc!=null) return pc.getConfig().getWebCharset();
    return "ISO-8859-1";
  }
View Full Code Here


    public static void print(String value) {
      print(value, OUT);
    }
   
    public static void print(String value,int type) {
      PageContext pc=ThreadLocalPageContext.get();
      if(pc!=null) {
        if(type==ERR)
          print(pc.getConfig().getErrWriter(),value);
        else
          print(pc.getConfig().getOutWriter(),value);
      }
      else {
        print(new PrintWriter((type==ERR)?System.err:System.out),value);
      }
    }
View Full Code Here

  }

  @Override
  public final Object instantiate() {
    try {
      PageContext pc = CommonUtil.pc();
      HibernateORMSession session=HibernateUtil.getORMSession(pc,true);
      HibernateORMEngine engine=(HibernateORMEngine) session.getEngine();
      Component c = engine.create(pc, session, entityName, true);
      CommonUtil.setEntity(c,true);
      return c;//new CFCProxy(c);
View Full Code Here

   
    public static void invoke(Key name, Component cfc, Struct data, Object arg) {
      if(cfc==null) return;
     
    try {
      PageContext pc = ThreadLocalPageContext.get();
      Object[] args;
      if(data==null) {
        args=arg!=null?new Object[]{arg}:new Object[]{};
      }
      else {
View Full Code Here

  @Override
  public Object get(Object trg) throws HibernateException {
    try {
      // MUST cache this, perhaps when building xml
      HibernateORMEngine engine = getHibernateORMEngine();
      PageContext pc = CommonUtil.pc();
      Component cfc = CommonUtil.toComponent(trg);
      String name = HibernateCaster.getEntityName(cfc);
      ClassMetadata metaData = engine.getSessionFactory(pc).getClassMetadata(name);
      Type type = HibernateUtil.getPropertyType(metaData, key.getString());
View Full Code Here

    // TODO verify password
  }*/
 
 
  public static int getSessionCount(){
    PageContext pc = ThreadLocalPageContext.get();
    ScopeContext sc = ((CFMLFactoryImpl)pc.getCFMLFactory()).getScopeContext();
    return sc.getSessionCount(pc);
  }
View Full Code Here

    ScopeContext sc = ((CFMLFactoryImpl)pc.getCFMLFactory()).getScopeContext();
    return sc.getSessionCount(pc);
  }
 
  public static Struct getSessionCollection(String appName){
    PageContext pc = ThreadLocalPageContext.get();
    ScopeContext sc = ((CFMLFactoryImpl)pc.getCFMLFactory()).getScopeContext();
    return sc.getAllSessionScopes(appName);
  }
View Full Code Here




  private static Resource toRes(Config config, Object obj, boolean existing) throws ExpressionException {
    PageContext pc = ThreadLocalPageContext.get();
    if(pc!=null)return Caster.toResource(pc, obj, existing);
    return Caster.toResource(config, obj, existing);
  }
View Full Code Here

    //Resource root = config.getRootDirectory();
    String path = Caster.toString(obj,null);
    if(StringUtil.isEmpty(path,true)) return null;
    path=path.trim();
    Resource res;
    PageContext pc = ThreadLocalPageContext.get();
   
    // first check relative to application.cfc
    if(pc!=null) {
      if(ac==null) ac= pc.getApplicationContext();
     
      // abs path
      if(path.startsWith("/")){
        ConfigWebImpl cwi=(ConfigWebImpl) config;
        PageSource ps = cwi.getPageSourceExisting(
View Full Code Here

      return get(row);
  }
 
 
  private Object getChildElement(Key key, Object defaultValue) {
      PageContext pc = ThreadLocalPageContext.get();
    // column and query has same name
    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

TOP

Related Classes of railo.runtime.PageContext

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.