Package org.jboss.dashboard.workspace

Examples of org.jboss.dashboard.workspace.Panel


        List childrenNodes = new ArrayList();
        try {
            List panels = new ArrayList(getPanels());
            Collections.sort(panels);
            for (int i = 0; i < panels.size(); i++) {
                Panel panel = (Panel) panels.get(i);
                childrenNodes.add(getNewPanelNode(panel));
            }
        } catch (Exception e) {
            log.error("Error: ", e);
        }
View Full Code Here


        try {
            String panelId = id.substring(id.indexOf("_")+1);
            String pageId = id.substring(0,id.indexOf("_"));
            Collection panels = getPanels();
            for (Iterator iterator = panels.iterator(); iterator.hasNext();) {
                Panel panel = (Panel) iterator.next();
                if (panelId.equals(panel.getPanelId().toString()) && pageId.equals(panel.getSection().getId().toString()))
                    return getNewPanelNode(panel);
            }
        } catch (Exception e) {
            log.error("Error: ", e);
        }
View Full Code Here

    }

    public String getName(Locale l) {
        try {
            TreeNode grandFather = getParent().getParent();
            Panel panel = getPanel();
            if (grandFather instanceof PanelInstanceNode) {
                Map<String, String> sectionTitle = panel.getSection().getTitle();
                String pageName = (String) LocaleManager.lookup().localize(sectionTitle);
                if (panel.getRegion() != null) pageName += " (" + panel.getRegion().getId() + ")";
                return pageName;
            } else {
                // Use instance title
                return (String) LocaleManager.lookup().localize(panel.getTitle());
            }
        } catch (Exception e) {
            log.error("Error: ", e);
            return "";
        }
View Full Code Here

            // Panel ID has been  passed
            idPanel = getPanel();
            setPanel(null);
        } else {
            // Try to get panel ID from request
            Panel panel = RequestContext.lookup().getActivePanel();
            if(panel != null){
                idPanel = panel.getPanelId().toString();
            }
        }
        Panel panel = null;
        if (idPanel != null) {
            Section currSection = NavigationManager.lookup().getCurrentSection();
            if (currSection != null) {
                panel = currSection.getPanel(idPanel);
            }
        }

        if (key != null && panel != null) {

            Locale locale = getLocale();

            try {
                // Retrieve and render resource
                // Resources may be a single text, or a jsp to include
                // They're located in the panel descriptor
                String res = panel.getResource(key, locale); // getProvider().getResource(key);

                if (res == null) {
                    // Resource not found => Print key to make it noticiable
                    pageContext.getOut().print(key);
                    log.error("Resource " + key + " for panel " + panel.getId() + " not found!");
                } else if (res.toLowerCase().indexOf(".jsp") != -1) {
                    // It's a JSP to include
                    jspInclude(res);
                } else {
                    // Just output resource value
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

    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 {
                    if (log.isDebugEnabled()) log.debug("Using a PanelScoped bean outside a panel. Will default to SessionScoped.");
                    return request.getSessionObject();
                }
            }
View Full Code Here

     * Called on panel status initialization
     */
    public void initSession(PanelSession status, HttpSession session) {
        if (log.isDebugEnabled()) log.debug("Initializing panel status for provider " + getId() + " " + getDriver().getClass().getName());

        Panel panel = status.getPanel();
        try {
            RequestContext.lookup().activatePanel(panel);
            getDriver().initPanelSession(status, session);
        } finally {
            RequestContext.lookup().deactivatePanel(panel);
View Full Code Here

        AjaxRefreshManager ajaxMgr = AjaxRefreshManager.lookup();
        List<Long> panelIdsToRefresh = ajaxMgr.getPanelIdsToRefresh();
        panelIdsToRefresh.clear();

        // Inspect all the dashboard's panels.
        Panel currentPanel = RequestContext.lookup().getActivePanel();
        for (Panel panel : getSection().getPanels()) {

            // Leave out non dashboard related panels.
            PanelDriver driver = panel.getProvider().getDriver();
            if (!(driver instanceof DashboardDriver)) {
                continue;
            }
            // Don't refresh the active panel as it's being updated already along the execution of this request.
            Long panelId = panel.getPanelId();
            if (currentPanel != null && currentPanel.getPanelId().equals(panelId)) {
                continue;
            }
            // Don't refresh panels that are not displaying any dashboard data.
            Set<DataProvider> providersUsed = ((DashboardDriver) driver).getDataProvidersUsed(panel);
            if (providersUsed.isEmpty()) {
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 = getPanel();
        UserStatus userStatus = UserStatus.lookup();
        boolean canEdit = userStatus.hasPermission(PanelPermission.newInstance(getPanel(), PanelPermission.ACTION_EDIT));
        boolean canViewParams = userStatus.hasPermission(WorkspacePermission.newInstance(getPanel().getWorkspace(), WorkspacePermission.ACTION_ADMIN));
        renderHelp(panel.getInstance(), canEdit, canViewParams);
    }
View Full Code Here

    /**
     * @see javax.servlet.jsp.tagext.TagSupport
     */
    public int doEndTag() throws JspTagException {
        Panel panel = RequestContext.lookup().getActivePanel();
        UIBeanHandler uiBean = UIBeanLocator.lookup().getCurrentBean(pageContext.getRequest());
        String encodedName = encode(panel, uiBean, name);
        try {
            pageContext.getOut().print(encodedName);
        } catch (Exception e) {
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.