Package com.britesnow.snow.web

Examples of com.britesnow.snow.web.RequestContext


   
    @Override
    public void execute(Environment env, Map args, TemplateModel[] tms, TemplateDirectiveBody body)
                            throws TemplateException, IOException {

        RequestContext rc = getDataModel("_r.rc", RequestContext.class);
       
        Boolean debug_links = rc.getParamAs(WebBundleManager.DEBUG_LINK_STRING, Boolean.class, null);
        //if not null, make sure we set the cookie with the value
        if (debug_links != null){
            rc.setCookie(WebBundleManager.DEBUG_LINK_STRING, debug_links);
        }
        //if there is not debug_link param in the URL, check the cookie (set false if not found)
        else{
            debug_links = rc.getCookie(WebBundleManager.DEBUG_LINK_STRING, Boolean.class, false);
        }
       
        String contextPath = rc.getContextPath();
       
       
        // [@webBundle folder="/css/" type="js" /]
        //get the param
        String path = getParam(args,"path",String.class);
View Full Code Here


   
    @Override
    public Object exec(List args) throws TemplateModelException {
        Map result = null;
        String path = getParamAs(args.get(0), String.class);
        RequestContext rc = getDataModel("_r.rc", RequestContext.class);
       
        if (path != null) {
           
            File jsonFile = pathFileResolver.resolve(path,rc);
           
View Full Code Here

   
   
    @Override
    public Object exec(List args) throws TemplateModelException {
       
        RequestContext rc = getDataModel("_r.rc", RequestContext.class);
       
        rc.setAttribute(FREEMARKER_METHOD_ARGUMENTS,args);
        Object result = null;
        try{
            result = ref.invoke(rc);
        }catch(Exception e){
            logger.error(e.getMessage());
        }finally{
            rc.removeAttribute(FREEMARKER_METHOD_ARGUMENTS);
        }
       
        // TODO Auto-generated method stub
        return result;
    }
View Full Code Here

    }
   
    public void execute(Environment env, Map paramMap, TemplateModel[] model, TemplateDirectiveBody body) throws TemplateException,
                            IOException {
       
        RequestContext rc = getDataModel("_r.rc", RequestContext.class);
        try {
            rc.setAttribute(FREEMARKER_DIRECTIVE_CONTEXT, new FreemarkerDirectiveContext(env, paramMap));
            freemarkerDirectiveRef.invoke(rc);
        } catch (Exception e) {
            logger.error(e.getMessage());
        }finally{
            rc.removeAttribute(FREEMARKER_DIRECTIVE_CONTEXT);
        }
    }
View Full Code Here

   
    @Override
    public void execute(Environment env, Map args, TemplateModel[] arg2, TemplateDirectiveBody arg3)
                            throws TemplateException, IOException {

        RequestContext rc = getDataModel("_r.rc", RequestContext.class);
       
        String path = rc.popFramePath();
        if (path == null){
            path = rc.getResourcePath();
        }
        String templateName = templateNameResolver.resolve(path);
       
        includeTemplate(rc,templateName,env);
    }
View Full Code Here

    @Override
    public void execute(Environment env, Map args, TemplateModel[] arg2, TemplateDirectiveBody arg3)
                            throws TemplateException, IOException {

        String templateName = getParam(args,"name",String.class);
        RequestContext rc = getDataModel("r.rc", RequestContext.class);
       
        includeTemplate(rc,templateName,env);
    }
View Full Code Here

   
    @Override
    public void execute(Environment env, Map args, TemplateModel[] tms, TemplateDirectiveBody body)
                            throws TemplateException, IOException {

        RequestContext rc = getDataModel("_r.rc", RequestContext.class);
       
        Boolean debug_links = rc.getParamAs(WebBundleManager.DEBUG_LINK_STRING, Boolean.class, null);
        //if not null, make sure we set the cookie with the value
        if (debug_links != null){
            rc.setCookie(WebBundleManager.DEBUG_LINK_STRING, debug_links);
        }
        //if there is not debug_link param in the URL, check the cookie (set false if not found)
        else{
            debug_links = rc.getCookie(WebBundleManager.DEBUG_LINK_STRING, Boolean.class, false);
        }
       
        String contextPath = rc.getContextPath();
       
       
        // [@webBundle folder="/css/" type="js" /]
        //get the param
        String path = getParam(args,"path",String.class);
View Full Code Here

        return name;
    }
   
    public void execute(Environment env, Map paramMap, TemplateModel[] model, TemplateDirectiveBody body) throws TemplateException,
                            IOException {
        RequestContext rc = getDataModel("r.rc", RequestContext.class);
        try {
            rc.setAttribute(FREEMARKER_DIRECTIVE_CONTEXT, new FreemarkerDirectiveContext(env, paramMap));
            webTemplateDirectiveRef.invoke(rc);
        } catch (Exception e) {
            logger.error(e.getMessage());
        }finally{
            rc.removeAttribute(FREEMARKER_DIRECTIVE_CONTEXT);
        }
    }
View Full Code Here

    }
   
    public void execute(Environment env, Map paramMap, TemplateModel[] model, TemplateDirectiveBody body) throws TemplateException,
                            IOException {
       
        RequestContext rc = getDataModel("_r.rc", RequestContext.class);
        try {
            rc.setAttribute(FREEMARKER_DIRECTIVE_CONTEXT, new FreemarkerDirectiveContext(env, paramMap));
            methodInvoker.invokeWebHandler(freemarkerDirectiveRef, rc);
        } catch (Exception e) {
            logger.error(e.getMessage());
        }finally{
            rc.removeAttribute(FREEMARKER_DIRECTIVE_CONTEXT);
        }
    }
View Full Code Here

   
    @Override
    public void execute(Environment env, Map args, TemplateModel[] arg2, TemplateDirectiveBody arg3)
                            throws TemplateException, IOException {

        RequestContext rc = getDataModel("_r.rc", RequestContext.class);
       
        String path = rc.popFramePath();
        if (path == null){
            path = rc.getResourcePath();
        }
        String templateName = templateNameResolver.resolve(path,rc);
       
        includeTemplate(rc,templateName,env);
    }
View Full Code Here

TOP

Related Classes of com.britesnow.snow.web.RequestContext

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.