Package org.jboss.dashboard.workspace

Examples of org.jboss.dashboard.workspace.Panel


    protected HttpSession getSession() {
        RequestContext reqCtx = RequestContext.getCurrentContext();
        if (reqCtx != null) {
            CommandRequest request = reqCtx.getRequest();
            if (request != null) {
                Panel currentPanel = (Panel) request.getRequestObject().getAttribute(Parameters.RENDER_PANEL);
                if (currentPanel != null) {
                    return SessionManager.getPanelSession(currentPanel);
                } else {
                    if (log.isDebugEnabled())
                        log.debug("Using a panelSession component outside a panel. Will default to session component.");
View Full Code Here


        if (oldSection != null) {
            if (log.isDebugEnabled())
                log.debug("Invalidating panelSessions in section " + oldSection.getId() + " from workspace " + oldSection.getWorkspace().getId());
            Set panels = oldSection.getPanels();
            for (Iterator it = panels.iterator(); it.hasNext();) {
                Panel panel = (Panel) it.next();
                panel.pageLeft();
            }
        }
    }
View Full Code Here

                SectionPermission sectionPerm = SectionPermission.newInstance(section, SectionPermission.ACTION_VIEW);
                if (!getUserStatus().hasPermission(sectionPerm)) {
                    // No access permission in page
                    return false;
                }
                Panel panel = navigationPoint.getPanel();
                String actionName = navigationPoint.getActionName();
                if (panel != null) {
                    PanelPermission panelPerm = PanelPermission.newInstance(panel, PanelPermission.ACTION_VIEW);
                    if (!getUserStatus().hasPermission(panelPerm)) {
                        // No view permission in panel
                        return false;
                    }
                    if (!StringUtils.isEmpty(actionName)) {
                        // Can I invoke the action?
                        return panel.getProvider().getDriver().canInvokeAction(panel, actionName);
                    } else {
                        // No action? strange anyway
                        return true;
                    }
                } else {
View Full Code Here

        renderRegionPanelsStart();

        if (regionPanels.size() > 0) {
            renderTabbedRegionHeader();
            for (int i = 0; i < regionPanels.size(); i++) {
                Panel panel = regionPanels.get(i);
                if (!SessionManager.getRegionStatus(currentSection, currentRegion).isSelected(panel))
                    continue;
                PanelPermission editPerm = PanelPermission.newInstance(panel, PanelPermission.ACTION_EDIT);
                boolean canEditPanel = getUserStatus().hasPermission( editPerm);
                renderPanel(panel, canEditPanel);
View Full Code Here

        LayoutRegionStatus regionStatus = SessionManager.getRegionStatus(currentSection, currentRegion);
        if (regionStatus.getSelectedPanel() == null && !regionPanels.isEmpty()) {
            regionStatus.setSelectedPanel((Panel) regionPanels.get(0));
        }
        for (int i = 0; i < regionPanels.size(); i++) {
            Panel panel = regionPanels.get(i);
            setAttribute("tabTitle", LocaleManager.lookup().localize(panel.getTitle()));
            setAttribute("panel", panel);
            setAttribute("dragEnabled", userAdmin);
            setAttribute("url", UIServices.lookup().getUrlMarkupGenerator().getLinkToPanelAction(panel, "_select", true));
            setAttribute("selected", regionStatus.isSelected(panel));
            renderFragment("outputTab");
View Full Code Here

*/
public class RenderPanelContentFormatter extends Formatter {
    private static transient org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(RenderPanelContentFormatter.class.getName());

    public void service(HttpServletRequest request, HttpServletResponse response) throws FormatterException {
        Panel panel = (Panel) getParameter("panel");
        if (panel != null) {
            SessionManager.setCurrentPanel(panel);
            request.setAttribute(Parameters.RENDER_PANEL, panel);
            PanelSession status = SessionManager.getPanelSession(panel);
            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 {
                        panel.getProvider().getDriver().fireBeforeRenderPanel(panel, request, response);
                        PanelProvider provider = panel.getProvider();
                        String screen = status.getCurrentPageId();
                        if (!status.isEditMode()) {
                            if (screen != null) {
                                String jsp = panel.getProvider().getPage(screen);
                                if (jsp != null) {
                                    setAttribute("jsp", jsp);
                                    setAttribute("panelUID", HTTPSettings.AJAX_AREA_PREFFIX + "content_panel_" + panel.getPanelId());
                                    renderFragment("output");
                                } else {
                                    log.error("JSP not found for page " + screen + " in panel type " + provider.getId());
                                }
                            } else {
View Full Code Here

    /**
     * @see javax.servlet.jsp.tagext.TagSupport
     */
    public int doEndTag() throws JspTagException {
        Panel panel = (Panel) pageContext.getRequest().getAttribute(Parameters.RENDER_PANEL);
        UIComponentHandlerFactoryElement factoryComponent = (UIComponentHandlerFactoryElement) pageContext.getRequest().getAttribute(UseComponentTag.COMPONENT_ATTR_NAME);
        String encodedName = encode(panel, factoryComponent, name);
        try {
            pageContext.getOut().print(encodedName);
        } catch (Exception ex) {
            log.error("Error encoding panel name [" + name + "] for panel " + panel.getId(), ex);
        }
        return SKIP_BODY;
    }
View Full Code Here

    // Format Panel objects
    public String formatObject(Object obj) {
        if (obj instanceof Panel) {
            // Workspace de procesos > Tareas pendientes > Lista de tareas [id=13456]
            Panel panel = (Panel) obj;
            return panel.getFullDescription();
        }
        return super.formatObject(obj);
    }
View Full Code Here

                renderNewLineEnd();
                renderNewLineStart();
            }
            if (regionPanels.size() > 0) {
                for (int i = 0; i < regionPanels.size(); i++) {
                    Panel panel = regionPanels.get(i);
                    int position = panel.getPosition();

                    PanelPermission editPerm = PanelPermission.newInstance(panel, PanelPermission.ACTION_EDIT);
                    boolean canEditPanel = getUserStatus().hasPermission( editPerm);
                    renderPanel(panel, canEditPanel);
                    if (userAdmin && currentRegion.isRowRegion()) {
View Full Code Here

     * @param response response to the user
     * @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

TOP

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

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.