Package org.jboss.dashboard.ui.controller

Examples of org.jboss.dashboard.ui.controller.RequestContext


     * Returns panel stored in session
     *
     * @deprecated
     */
    public static Object getCurrentPanel() {
        RequestContext reqCtx = RequestContext.getCurrentContext();
        HttpSession session = reqCtx.getRequest().getSessionObject();
        Object panel = reqCtx.getRequest().getRequestObject().getAttribute(ATTRIBUTE_PANEL);
        if (panel != null) return panel;
        return session.getAttribute(ATTRIBUTE_PANEL);
    }
View Full Code Here


    /**
     * @deprecated
     */
    public static void setCurrentPanel(Panel panel) {
        RequestContext reqCtx = RequestContext.getCurrentContext();
        HttpSession session = reqCtx.getRequest().getSessionObject();
        session.setAttribute(ATTRIBUTE_PANEL, panel);
        reqCtx.getRequest().getRequestObject().setAttribute(ATTRIBUTE_PANEL, panel);
    }
View Full Code Here

    /**
     * @deprecated
     */
    public static void setCurrentPanel(PanelInstance instance) {
        RequestContext reqCtx = RequestContext.getCurrentContext();
        HttpSession session = reqCtx.getRequest().getSessionObject();
        session.setAttribute(ATTRIBUTE_PANEL, instance);
    }
View Full Code Here

    /**
     * Returns the panel status object for a given panel. If it doesn't exist,
     * creates and stores it in the session.
     */
    public static PanelSession getPanelSession(Panel panel) {
        RequestContext reqCtx = RequestContext.getCurrentContext();
        HttpSession session = reqCtx.getRequest().getSessionObject();
        String key = "_panel_status_" + panel.getWorkspace().getId() + "." + panel.getSection().getId() + "." + panel.getPanelId();
        PanelSession panelStatus = (PanelSession) session.getAttribute(key);

        if (panelStatus == null) {
            panelStatus = new PanelSession(panel);
View Full Code Here

    /**
     * Returns the section status object for a given region. If it doesn't exist,
     * creates and stores it in the session.
     */
    public static LayoutRegionStatus getRegionStatus(Section section, LayoutRegion region) {
        RequestContext reqCtx = RequestContext.getCurrentContext();
        HttpSession session = reqCtx.getRequest().getSessionObject();
        if (section == null || region == null) return null;

        String key = "_region_status_" + section.getKey() + "_" + region.getId();
        LayoutRegionStatus sectionStatus = (LayoutRegionStatus) session.getAttribute(key);
        if (sectionStatus == null) {
View Full Code Here

    /**
     * @deprecated Use LocaleManager instead
     */
    public static Locale getCurrentLocale() {
        RequestContext reqCtx = RequestContext.getCurrentContext();
        String defaultLang = reqCtx.getRequest().getRequestObject().getParameter(Parameters.FORCE_LANGUAGE);
        LocaleManager localeManager = LocaleManager.lookup();
        if (defaultLang != null) localeManager.setCurrentLang(defaultLang);
        return localeManager.getCurrentLocale();
    }
View Full Code Here

    /**
     * @deprecated Use LocaleManager instead
     */
    public static String getLang() {
        RequestContext reqCtx = RequestContext.getCurrentContext();
        String defaultLang = reqCtx.getRequest().getRequestObject().getParameter(Parameters.FORCE_LANGUAGE);
        LocaleManager localeManager = LocaleManager.lookup();
        if (defaultLang != null) localeManager.setCurrentLang(defaultLang);
        return localeManager.getCurrentLang();
    }
View Full Code Here

            log.error("Error: ", e);
        }
    }

    protected void clearRequestCache() {
        RequestContext rqctx = RequestContext.getCurrentContext();
        rqctx.getRequest().getRequestObject().removeAttribute(CURRENT_WORKSPACE_ATTR);
        rqctx.getRequest().getRequestObject().removeAttribute(CURRENT_PAGE_ATTR);
    }
View Full Code Here

        rqctx.getRequest().getRequestObject().removeAttribute(CURRENT_WORKSPACE_ATTR);
        rqctx.getRequest().getRequestObject().removeAttribute(CURRENT_PAGE_ATTR);
    }

    protected WorkspaceImpl getCurrentWorkspaceFromCache() {
        RequestContext rqctx = RequestContext.getCurrentContext();
        WorkspaceImpl currentWorkspace = (WorkspaceImpl) rqctx.getRequest().getRequestObject().getAttribute(CURRENT_WORKSPACE_ATTR);
        return currentWorkspace;
    }
View Full Code Here

        WorkspaceImpl currentWorkspace = (WorkspaceImpl) rqctx.getRequest().getRequestObject().getAttribute(CURRENT_WORKSPACE_ATTR);
        return currentWorkspace;
    }

    protected Section getCurrentPageFromCache() {
        RequestContext rqctx = RequestContext.getCurrentContext();
        Section currentPage = (Section) rqctx.getRequest().getRequestObject().getAttribute(CURRENT_PAGE_ATTR);
        return currentPage;
    }
View Full Code Here

TOP

Related Classes of org.jboss.dashboard.ui.controller.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.