Package org.jboss.dashboard.ui.controller

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


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

    protected WorkspaceImpl getCurrentWorkspaceFromCache() {
        RequestContext rqctx = RequestContext.lookup();
        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.lookup();
        Section currentPage = (Section) rqctx.getRequest().getRequestObject().getAttribute(CURRENT_PAGE_ATTR);
        return currentPage;
    }
View Full Code Here

     * subsequent calls to getCurrentWorkspace and getCurrentSection get the cached version.
     * Called just before rendering the page, as rendering shouldn't
     * modify navigation location
     */
    public void freezeNavigationStatus() {
        RequestContext rqctx = RequestContext.lookup();
        rqctx.getRequest().getRequestObject().setAttribute(CURRENT_WORKSPACE_ATTR, getCurrentWorkspace());
        rqctx.getRequest().getRequestObject().setAttribute(CURRENT_PAGE_ATTR, getCurrentSection());
    }
View Full Code Here

            m.clear();
        }
    }

    protected HttpSession getSession() {
        RequestContext reqCtx = RequestContext.lookup();
        if (reqCtx != null) {
            CommandRequest request = reqCtx.getRequest();
            if (request != null) {
                Panel currentPanel = RequestContext.lookup().getActivePanel();
                if (currentPanel != null) {
                    return currentPanel.getPanelSession();
                } else {
View Full Code Here

        processorChain.add(CDIBeanLocator.getBeanByType(EnvelopeVerifier.class));
    }

    public void run() throws Exception {
        for (RequestChainProcessor processor : processorChain) {
            RequestContext reqCtx = RequestContext.lookup();
            if (processor.processRequest() == false) {
                // Stop in case the processor has explicitly stopped the chain's processing.
                return;
            }
        }
View Full Code Here

            log.warn("Ignoring page left for panel with dbid=" + getDbid());
            return;
        }
        if (getInstance() != null && !getInstance().isSessionAliveAfterPageLeft()) {
            PanelSession pSession = getPanelSession();
            RequestContext reqCtx = RequestContext.lookup();
            HttpSession session = reqCtx.getRequest().getSessionObject();
            pSession.clear();
            pSession.setWorkMode(PanelSession.SHOW_MODE);
            getProvider().initSession(pSession, session);
        }
    }
View Full Code Here

    /**
     * Returns the panel status object for this panel.
     */
    public PanelSession getPanelSession() {
        RequestContext reqCtx = RequestContext.lookup();
        HttpSession session = reqCtx.getRequest().getSessionObject();
        String key = "_panel_" + getWorkspace().getId() + "." + getSection().getId() + "." + getPanelId();
        PanelSession panelStatus = (PanelSession) session.getAttribute(key);

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

        if (!(panel.getInstance().getProvider().getDriver().getClass().getName().contains("DashboardFilterDriver"))) return null;

        String code = panel.getParameterValue(FILTER_HANDLER_CODE);

        // If no request context exists then do a standard lookup.
        RequestContext reqCtx = RequestContext.lookup();
        if (reqCtx == null) return DashboardFilterHandler.lookup(code);

        // Save the current panel instance and set the specified panel as current.
        RequestContext.lookup().activatePanel(panel);
View Full Code Here

@ApplicationScoped @Install
public class SessionClearerUserStatusListener implements UserStatusListener {

    public void statusChanged(UserStatus us) {
        if (us.isAnonymous()) { // just logout
            RequestContext ctx = RequestContext.lookup();
            HttpSession session = ctx.getRequest().getSessionObject();
            Enumeration<String> en = session.getAttributeNames();
            Set<String> attributesToDelete = new HashSet<String>();
            while (en.hasMoreElements()) {
                String attrName = en.nextElement();
                Object obj = session.getAttribute(attrName);
                if (obj == null || !(obj instanceof LogoutSurvivor)) {
                    attributesToDelete.add(attrName);
                }
            }
            for (String attrName : attributesToDelete) {
                session.removeAttribute(attrName);
            }
            try {
                ctx.getRequest().getRequestObject().getSession().invalidate();
                ctx.getRequest().getRequestObject().logout();
            } catch (Throwable e) {
                // Just ignore
            }
        }
    }
View Full Code Here

    /**
     * Returns current form status
     */
    public static FormStatus getCurrentFormStatus() {
        RequestContext reqCtx = RequestContext.lookup();
        HttpSession session = reqCtx.getRequest().getSessionObject();
        FormStatus formStatus = (FormStatus) session.getAttribute(ATTRIBUTE_FORM_STATUS);
        if (formStatus == null) {
            formStatus = new FormStatus();
            session.setAttribute(ATTRIBUTE_FORM_STATUS, formStatus);
        }
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.