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.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

     * 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.getCurrentContext();
        rqctx.getRequest().getRequestObject().setAttribute(CURRENT_WORKSPACE_ATTR, getCurrentWorkspace());
        rqctx.getRequest().getRequestObject().setAttribute(CURRENT_PAGE_ATTR, getCurrentSection());
    }
View Full Code Here

                res = (String) resMap.get(null);//Try with no-language resource.
            if (res == null)
                res = (String) resMap.get(getLocaleManager().getDefaultLang());//Try with default lang

            res = getBaseDir() + "/" + res;
            RequestContext reqCtx = RequestContext.getCurrentContext();
            if (reqCtx != null) {
                //Resources are best retrieved through URL (the fastest way)
                log.debug("Resource relative name = " + res);
                String categoryMapping = getMappingDir();
                log.debug("Category where the resource belongs to is mapped to uri " + categoryMapping);
                String url = categoryMapping + "/" + res;
                log.debug("Returning UrlResource to " + url);
                return UrlResource.getInstance(resourceName, reqCtx.getRequest().getRequestObject().getContextPath(), url);
            } else {
                //Create a FileResource...
                try {
                    checkDeployment();
                    return FileResource.getInstance(resourceName, new File(Application.lookup().getBaseAppDirectory() + getMappingDir() + "/" + res));
View Full Code Here

        }
        return null;
    }

    protected Panel getPanel() {
        RequestContext reqCtx = RequestContext.getCurrentContext();
        CommandRequest request = reqCtx.getRequest();
        return (Panel) request.getRequestObject().getAttribute(Parameters.RENDER_PANEL);
    }
View Full Code Here

            }.execute();
        return panel[0];
    }

    private void init() {
        RequestContext ctx = RequestContext.getCurrentContext();
        Panel currentPanel = (Panel) ctx.getRequest().getRequestObject().getAttribute(Parameters.RENDER_PANEL);
        if (currentPanel != null) {
            panelId = currentPanel.getDbid();
        }
    }
View Full Code Here

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

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

        String code = panel.getParameterValue(FILTER_HANDLER_CODE);

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

        // Save the current panel instance and set the specified panel as current.
        HttpServletRequest httpReq = reqCtx.getRequest().getRequestObject();
        Panel currentPanel = (Panel) httpReq.getAttribute(Parameters.RENDER_PANEL);
        httpReq.setAttribute(Parameters.RENDER_PANEL, panel);

        // Get the handler component within the scope of the specified panel
        try {
View Full Code Here

    private static transient Logger log = LoggerFactory.getLogger(SessionClearerUserStatusListener.class.getName());

    public void statusChanged(UserStatus us) {
        if (us.isAnonymous()) { // just logout
            RequestContext ctx = RequestContext.getCurrentContext();
            HttpSession session = ctx.getRequest().getSessionObject();
            Enumeration en = session.getAttributeNames();
            Set attributesToDelete = new HashSet();
            while (en.hasMoreElements()) {
                String attrName = (String) en.nextElement();
                Object obj = session.getAttribute(attrName);
                if (obj == null || !(obj instanceof LogoutSurvivor)) {
                    attributesToDelete.add(attrName);
                }
            }
            for (Iterator iterator = attributesToDelete.iterator(); iterator.hasNext();) {
                String attrName = (String) iterator.next();
                session.removeAttribute(attrName);
            }
            try {
                ctx.getRequest().getRequestObject().logout();
                ctx.getRequest().getRequestObject().getSession().invalidate();
            } catch (ServletException e) {
                log.error("Error logging out", e);
            }
        }
    }
View Full Code Here

    /**
     * Returns current form status
     */
    public static FormStatus getCurrentFormStatus() {
        RequestContext reqCtx = RequestContext.getCurrentContext();
        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.