Package org.jboss.dashboard.workspace

Examples of org.jboss.dashboard.workspace.PanelSession


        try {
            kpi = getKPI(panel);
        } catch (Exception e) {
            log.error("Error: ",e);
        }
        PanelSession panelSession = getPanelSession(panel);
        if (kpi == null) panelSession.setCurrentPageId(PAGE_PROVIDER_SELECTION);
        else panelSession.setCurrentPageId(PAGE_SHOW);

        // Ensure that the UI editor & viewer see the KPI
        passKPItoUI(kpi);
    }
View Full Code Here


        try {
            kpi = getKPI(panel);
        } catch (Exception e) {
            log.error("Error: ",e);
        }
        PanelSession panelSession = getPanelSession(panel);
        if (kpi == null) panelSession.setCurrentPageId(PAGE_PROVIDER_SELECTION);
        else panelSession.setCurrentPageId(PAGE_SHOW);

        // Ensure that the UI editor & viewer see the KPI
        passKPItoUI(kpi);
    }
View Full Code Here

     *
     * @param panel
     * @return The text shown, i18n.
     */
    public Map getHtmlCode(Panel panel) {
        PanelSession pSession = SessionManager.getPanelSession(panel);
        Map m = (Map) pSession.getAttribute(ATTR_TEXT);
        if (m != null) return m;
        HTMLText text = load(panel.getInstance());
        if (text != null) return text.getText();
        try {
            HTMLText textToCreate = new HTMLText();
View Full Code Here

     *
     * @param panel
     * @return The text shown, i18n.
     */
    public Map<String, String> getHtmlCode(Panel panel) {
        PanelSession pSession = panel.getPanelSession();
        Map<String, String> m = (Map) pSession.getAttribute(ATTR_TEXT);
        if (m != null) return m;
        HTMLText text = load(panel.getInstance());
        if (text != null) return text.getText();
        try {
            HTMLText textToCreate = new HTMLText();
View Full Code Here

     *
     * @param panel
     * @return The text shown, i18n.
     */
    public Map getHtmlCode(Panel panel) {
        PanelSession pSession = SessionManager.getPanelSession(panel);
        Map m = (Map) pSession.getAttribute(ATTR_TEXT);
        if (m != null) return m;
        HTMLText text = load(panel.getInstance());
        if (text != null) return text.getText();
        try {
            HTMLText textToCreate = new HTMLText();
View Full Code Here

    public void service(HttpServletRequest request, HttpServletResponse response) throws FormatterException {
        Panel panel = RequestContext.lookup().getActivePanel();
        if (panel == null) throw new FormatterException("Panel not found");

        PanelSession status = panel.getPanelSession();
        if (status.isMinimized()) {
            renderFragment("minimized");
        } else {
            setAttribute("tableClass", panel.isPaintBorder() ? "skn-table_border" : "");
            setAttribute("panelHeight", panel.getHeight());
            setAttribute("panel", panel);
            setAttribute("panelUID", HTTPSettings.AJAX_AREA_PREFFIX + "content_panel_" + panel.getPanelId());
            renderFragment("outputStart");
            try {
                if (!panel.isWellConfigured()) {
                    renderFragment("outputNotWellConfigured");
                } else if (!panel.getProvider().isEnabled()) {
                    renderFragment("outputNotRegistered");
                } else {
                    PanelProvider provider = panel.getProvider();
                    provider.getDriver().fireBeforeRenderPanel(panel, request, response);
                    String screen = status.getCurrentPageId();
                    if (!status.isEditMode()) {
                        if (screen != null) {
                            String jsp = provider.getPage(screen);
                            if (jsp != null) {
                                setAttribute("jsp", jsp);
                                setAttribute("panel", panel);
View Full Code Here

     * @throws org.jboss.dashboard.ui.taglib.formatter.FormatterException
     *          in case of an unexpected exception.
     */
    public void service(HttpServletRequest request, HttpServletResponse response) throws FormatterException {
        Panel panel = (Panel) getParameter("panel");
        PanelSession status = SessionManager.getPanelSession(panel);
        SectionRegion sectionRegion = panel.getSection().getSectionRegion(panel.getRegion().getId());
        boolean columnRegion = panel.getRegion().isColumnRegion();
        WorkspaceImpl workspace = NavigationManager.lookup().getCurrentWorkspace();
        boolean userIsAdmin = false;
        if (workspace != null) {
            WorkspacePermission permToCheck = WorkspacePermission.newInstance(workspace, WorkspacePermission.ACTION_ADMIN);
            userIsAdmin = UserStatus.lookup().hasPermission(permToCheck);
        }

        if (!userIsAdmin) return;

        PanelPermission editPanelPerm = PanelPermission.newInstance(panel, PanelPermission.ACTION_EDIT);
        boolean userCanEditPanel = UserStatus.lookup().hasPermission(editPanelPerm);

        renderFragment("movePanel");

        setAttribute("cursorStyle", "move");
        setAttribute("title", StringEscapeUtils.escapeHtml((String) LocaleManager.lookup().localize(panel.getTitle())));
        renderFragment("menuLink");
        renderFragment("menuStart");

        setAttribute("title", LocalizeTag.getLocalizedValue(panel.getTitle(), getLang(), true));
        renderFragment("menuTitle");

        //Invalidate cache button.
        if (panel.getCacheTime() > 0)
            renderMenuOption("ui.panel.refresh", getPanelActionLink(request, response, panel, "_invalidate-cache"), refreshIco, "R", panel.getCacheTime() > 0);

        if (status.isShowMode()) {
            boolean isEditModeEnabled = !status.isEditMode() && panel.supportsEditMode() && userCanEditPanel;
            //Edit button.
            if (isEditModeEnabled) renderMenuOption("ui.panel.editMode", getPanelActionLink(request, response, panel, "_edit-mode"), editModeIco, "L", isEditModeEnabled);
        } else {
            //Show mode.
            renderMenuOption("ui.panel.showMode", getPanelActionLink(request, response, panel, "_show-mode"), showModeIco, "S", !status.isShowMode());
        }
        //Properties mode
        renderMenuOption("ui.panel.editProperties", getPanelActionLink(request, response, panel, "_start-config"), propertiesModeIco, "P", true);

        //Close button
        renderFragment("menuSeparator");
        renderMenuOption("ui.panel.close", getPanelActionLink(request, response, panel, "_close"), eraseIco, "D", true, false);

        //Help mode
        renderMenuOption("ui.panel.helpMode", getPanelActionLink(request, response, panel, "_help-mode"), helpModeIco, "?", !status.isHelpMode() && panel.supportsHelpMode());

        setAttribute("imageKey", closeIco);
        renderFragment("menuEnd");
    }
View Full Code Here

        return UIServices.lookup().getPanelsManager().getPaneltByDbId(panelId);
    }

    public boolean execute(CommandRequest cmdReq) throws Exception {
        Panel panel = getPanel();
        PanelSession pSession = panel.getPanelSession();
        pSession.setCurrentPageId(page);
        if (log.isDebugEnabled()) log.debug("FullPanelAjaxResponse: " + panel.getFullDescription());
        try {
            RequestContext.lookup().activatePanel(panel);

            cmdReq.getResponseObject().setHeader("Content-Encoding", HTTPSettings.lookup().getEncoding());
View Full Code Here

        renderFragment("outputEnd");
    }

    protected void renderButtons(boolean administratorMode) {
        UserStatus userStatus = UserStatus.lookup();
        PanelSession status = SessionManager.getPanelSession(panel);
        SectionRegion sectionRegion = panel.getSection().getSectionRegion(panel.getRegion().getId());
        PanelPermission editPanelPerm = PanelPermission.newInstance(panel, PanelPermission.ACTION_EDIT);
        PanelPermission minPanelPerm = PanelPermission.newInstance(panel, PanelPermission.ACTION_MINIMIZE);
        PanelPermission maxPanelPerm = PanelPermission.newInstance(panel, PanelPermission.ACTION_MAXIMIZE);
        boolean userCanEditPanel = userStatus.hasPermission(editPanelPerm);
        boolean userCanMinimizePanel = userStatus.hasPermission(minPanelPerm);
        boolean userCanMaximizePanel = userStatus.hasPermission(maxPanelPerm);
        boolean columnRegion = panel.getRegion().isColumnRegion();
        setAttribute("panelId", panel.getPanelId());
        setAttribute("panel", panel);
        renderFragment("beforePanelButtons");
        //Invalidate cache button.
        if (panel.getCacheTime() > 0) {
            renderButtonOutput("ui.panel.refresh", getPanelActionLink("_invalidate-cache"), "REFRESH", "R");
        }
        //Arrow buttons.
        if (administratorMode && !status.isMaximized()) {
            if (!sectionRegion.isFirstPanelInRegion(panel) && !sectionRegion.isOnlyPanelInRegion(panel)) {
                renderButtonOutput("ui.panel.moveBack", getPanelActionLink("_move-back"), columnRegion ? "UP" : "LEFT", columnRegion ? "^" : "&lt;");
            }
            if (!sectionRegion.isLastPanelInRegion(panel) && !sectionRegion.isOnlyPanelInRegion(panel)) {
                renderButtonOutput("ui.panel.moveForward", getPanelActionLink("_move-forward"), columnRegion ? "DOWN" : "RIGHT", columnRegion ? "v" : "&gt;");
            }
        }
        //Edit button.
        if (!status.isEditMode() && panel.supportsEditMode() && userCanEditPanel) {
            renderButtonOutput("ui.panel.editMode", getPanelActionLink("_edit-mode"), "EDIT_MODE", "L");
        }

        //Show mode.
        if (!status.isShowMode()) {
            renderButtonOutput("ui.panel.showMode", getPanelActionLink("_show-mode"), "SHOW", "S");
        }
        //Properties mode
        if (administratorMode) {
            renderButtonOutput("ui.panel.editProperties", "#print here link to treeshortcuthandler", "PROPERTIES", "P");
        }
        //Minimize button
        if (!status.isMinimized() && (panel.isMinimizable() || administratorMode) && userCanMinimizePanel) {
            renderButtonOutput("ui.panel.minimize", getPanelActionLink("_minimize"), "MINIMIZE", "_");
        }
        //Restore button
        if (status.isMinimized() || status.isMaximized() || status.isMaximizedInRegion()) {
            renderButtonOutput("ui.panel.restore", getPanelActionLink("_restore"), "RESTORE", "oO");
        }
        //Maximize button
        if (!status.isMaximized() && (panel.isMaximizable() || administratorMode) && userCanMaximizePanel) {
            if (status.isMaximizedInRegion())
                renderButtonOutput("ui.panel.maximize", getPanelActionLink("_maximize"), "MAXIMIZE", "O");
            else
                renderButtonOutput("ui.panel.maximizeInRegion", getPanelActionLink("_maximize-in-region"), "MAXIMIZE", "O");
        }
        //Close button
View Full Code Here

     *
     * @param panel
     * @return The text shown, i18n.
     */
    public Map getHtmlCode(Panel panel) {
        PanelSession pSession = SessionManager.getPanelSession(panel);
        Map m = (Map) pSession.getAttribute(ATTR_TEXT);
        if (m != null) return m;
        HTMLText text = load(panel.getInstance());
        if (text != null) return text.getText();
        try {
            HTMLText textToCreate = new HTMLText();
View Full Code Here

TOP

Related Classes of org.jboss.dashboard.workspace.PanelSession

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.