Package org.apache.velocity.tools.view.context

Examples of org.apache.velocity.tools.view.context.ViewContext


     * would probably not be the search tool's responsibility to ensure
     * that there is a session.
     */
    public void init(Object obj)
    {
        ViewContext context = (ViewContext)obj;
        context.getRequest().getSession(true);

        // then pass on to the super class
        super.init(obj);
    }
View Full Code Here


     *
     * @param obj the ViewContext of the current request
     */
    public void init(Object obj)
    {
        ViewContext context = (ViewContext)obj;
        this.request = context.getRequest();
        this.response = context.getResponse();
    }
View Full Code Here

        if (!(obj instanceof ViewContext))
        {
            throw new IllegalArgumentException("Tool can only be initialized with a ViewContext");
        }
        ViewContext context = (ViewContext)obj;
        this.request = context.getRequest();
        this.response = context.getResponse();
        this.application = context.getServletContext();
        Boolean b = (Boolean)context.getAttribute(ViewContext.XHTML);
        if (b != null)
        {
            setXhtml(b.booleanValue());
        }
    }
View Full Code Here

    public void init(Object obj) {
        if (! (obj instanceof ViewContext)) {
            throw new IllegalArgumentException("Tool can only be initialized with a ViewContext");
        }

        ViewContext context = (ViewContext) obj;
        this.request = context.getRequest();
        this.response = context.getResponse();
        this.application = context.getServletContext();
    }
View Full Code Here

    @Deprecated
    public void init(Object obj)
    {
        if (obj instanceof ViewContext)
        {
            ViewContext ctx = (ViewContext)obj;
            setRequest(ctx.getRequest());
            setResponse(ctx.getResponse());
            this.application = ctx.getServletContext();
            if (ctx.getVelocityEngine() != null)
            {
                this.LOG = ctx.getVelocityEngine().getLog();
            }
        }
    }
View Full Code Here

    {
        Context ctx = null;
        entityAccess = (PortletEntityAccessComponent) Jetspeed.getComponentManager().getComponent(PortletEntityAccessComponent.class);
        if (obj instanceof ViewContext)
        {
            ViewContext viewContext = (ViewContext) obj;
            this.viewCtx = viewContext;
            ctx = viewContext.getVelocityContext();
            setRequest((RenderRequest) ctx.get(RENDER_REQUEST_ATTR));
          
        }
        else if (obj instanceof PortletRequest)
        {
View Full Code Here

        if (!(obj instanceof ViewContext))
        {
            throw new IllegalArgumentException("Tool can only be initialized with a ViewContext");
        }

        ViewContext viewContext = (ViewContext)obj;
        this.velocityContext = viewContext.getVelocityContext();
        this.request = viewContext.getRequest();
        this.response = viewContext.getResponse();
        this.application = viewContext.getServletContext();
    }
View Full Code Here

        if (!(obj instanceof ViewContext))
        {
            throw new IllegalArgumentException("Tool can only be initialized with a ViewContext");
        }

        ViewContext context = (ViewContext)obj;
        this.request = context.getRequest();
        this.application = context.getServletContext();
        this.resources =
            StrutsUtils.getMessageResources(request, application);
        this.locale =
            StrutsUtils.getLocale(request, request.getSession(false));
    }
View Full Code Here

     * @param obj the current ViewContext
     * @throws ClassCastException if the param is not a ViewContext
     */
    public void init(Object obj)
    {
        ViewContext context = (ViewContext)obj;
        HttpServletRequest request = context.getRequest();
        session = request.getSession(false);
        setup(request);       
    }
View Full Code Here

     * @param initData the {@link ViewContext} for the current servlet request
     */
    public Map getToolbox(Object initData)
    {
        //we know the initData is a ViewContext
        ViewContext ctx = (ViewContext)initData;
       
        //create the toolbox map with the application tools in it
        Map toolbox = new HashMap(appTools);

        if (!sessionToolInfo.isEmpty())
        {
            HttpSession session = ctx.getRequest().getSession(createSession);
            if (session != null)
            {
                // allow only one thread per session at a time
                synchronized(getMutex(session))
                {
View Full Code Here

TOP

Related Classes of org.apache.velocity.tools.view.context.ViewContext

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.