Package org.jboss.dashboard.workspace

Examples of org.jboss.dashboard.workspace.Section


        setPanelId(null);
        if (getNavigationManager().getCurrentWorkspace() != null) {
            setWorkspaceId(getNavigationManager().getCurrentWorkspace().getId());
        }
        if (getNavigationManager().getCurrentSection() != null) {
            Section section = getNavigationManager().getCurrentSection();
            setSectionId(section.getId());
            if (section.getParent() != null) setParentSectionId(section.getParent().getId());
        }
        if (request.getParameter("panelId") != null) {
            setPanelId(new Long(request.getParameter("panelId")));
        } else {
            setPanelId(null);
View Full Code Here


        // This is the case when embedding, for instance, the jBPM process dashboard as an UF panel because the login/logout is handled by the J2EE container & UF.
        boolean embeddedMode = Boolean.parseBoolean(httpServletRequest.getParameter(Parameters.PARAM_EMBEDDED));
        if (adminBarVisible && !embeddedMode) {
            renderFragment("administrationBar");
        }
        Section page = getNavigationManager().getCurrentSection();
        if (page == null) {
            renderFragment("noPage");
        } else {
            renderFragment("page");
        }
View Full Code Here

    public void setNavigationManager(NavigationManager navigationManager) {
        this.navigationManager = navigationManager;
    }

    public void service(HttpServletRequest request, HttpServletResponse response) throws FormatterException {
        Section page = navigationManager.getCurrentSection();
        if (page == null) return;
        Panel[] unassignedPanels = page.getUnassignedPanels();
        if (unassignedPanels != null && unassignedPanels.length > 0) {
            Arrays.sort(unassignedPanels);
            renderFragment("outputStart");
            LayoutRegion[] regions = page.getLayout().getRegions();
            for (int i = 0; i < unassignedPanels.length; i++) {
                Panel unassignedPanel = unassignedPanels[i];
                setAttribute("index", i);
                setAttribute("panel", unassignedPanel);
                setAttribute("panelId", unassignedPanel.getPanelId());
View Full Code Here

            Long currentSectionId = getNavigationManager().getCurrentSectionId();
            if (currentSectionId == null) {
                renderFragment("outputNoneSelected");
            }
            for (int i = 0; i < pages.size(); i++) {
                Section section = (Section) pages.get(i);
                String title = (String) pageTitles.get(i);
                setAttribute("id", section.getId());
                setAttribute("title", title);
                setAttribute("url", getPageUrl(request, section, permanentLink));
                renderFragment(section.getDbid().equals(currentSectionId) ? "outputSelected" : "output");
            }
            renderFragment("outputEnd");
        }
    }
View Full Code Here

    protected void initSections(String preffix, WorkspaceImpl workspace) {
        if (workspace != null) {
            Section[] sections = workspace.getAllSections(); //Sorted!
            for (int i = 0; i < sections.length; i++) {
                Section section = sections[i];
                int depth = section.getDepthLevel();
                SectionPermission viewPerm =
                        SectionPermission.newInstance(sections[i], SectionPermission.ACTION_VIEW);
                if (UserStatus.lookup().hasPermission(viewPerm)) {
                    pages.add(section);
                    String title = getTitle(sections[i]);
View Full Code Here

                setAttribute("visibleChecked",Boolean.valueOf(property.isVisible()));
                setAttribute("drillDownChecked",Boolean.valueOf(property.isDrillDownEnabled()));
                setAttribute("sectionId",property.getSectionId());
                // Drill down page title.
                String currentSectionTitle = "-- " + getBundle().getString(DashboardFilterHandler.I18N_PREFFIX + "select") + " --";
                Section section = property.getDrillDownPage();
                if (section != null) currentSectionTitle = getLocalizedValue(section.getTitle());
                setAttribute("currentSectionTitle", StringEscapeUtils.escapeHtml(currentSectionTitle));
                setAttribute("dataProviderName", StringEscapeUtils.escapeHtml(dataProviderName));
                setAttribute("propertyName",StringEscapeUtils.escapeHtml(property.getPropertyName(getLocale())));
                renderFragment("outputTableElement");
            }
View Full Code Here

            if (log.isDebugEnabled()) {
                log.debug("workspaceCandidate=" + workspaceCandidate);
                log.debug("sectionCandidate=" + sectionCandidate);
            }
            WorkspaceImpl workspace = null;
            Section section = null;
            if (workspaceCandidate != null) {
                boolean canbeWorkspaceId = canBeWorkspaceId(workspaceCandidate);
                if (canbeWorkspaceId) workspace = (WorkspaceImpl) UIServices.lookup().getWorkspacesManager().getWorkspace(workspaceCandidate);
                if (workspace == null) workspace = (WorkspaceImpl) UIServices.lookup().getWorkspacesManager().getWorkspaceByUrl(workspaceCandidate);
            }
            if (workspace != null && sectionCandidate != null) {
                try {
                    section = workspace.getSection(Long.decode(sectionCandidate));
                } catch (NumberFormatException nfe) {
                    section = workspace.getSectionByUrl(sectionCandidate);
                }
            }
            // Check the user has access permissions to the target workspace.
            if (workspace != null && section == null) {
                try {
                    Workspace currentWorkspace = navigationManager.getCurrentWorkspace();
                    log.debug("currentWorkspace = " + (currentWorkspace == null ? "null" : currentWorkspace.getId()) + " workspaceCandidate = " + workspaceCandidate);
                    if (!workspace.equals(currentWorkspace)) {

                        WorkspacePermission workspacePerm = WorkspacePermission.newInstance(workspace, WorkspacePermission.ACTION_LOGIN);
                        if (userStatus.hasPermission(workspacePerm)) {
                            navigationManager.setCurrentWorkspace(workspace);
                            log.debug("SessionManager.setWorkspace(" + workspace.getId() + ")");
                        } else {
                            if (log.isDebugEnabled()) log.debug("User has no " + WorkspacePermission.ACTION_LOGIN + " permission in workspace " + workspaceCandidate);
                            if (isShowLoginBackDoorOnPermissionDenied()) {
                                navigationManager.setUserRequiresLoginBackdoor(true);
                                navigationManager.setCurrentWorkspace(workspace);
                            }
                        }
                    }
                    requestContext.consumeURIPart("/" + workspaceCandidate);
                } catch (Exception e) {
                    log.error("Cannot set current workspace.", e);
                }
            }
            // Check the user has access permissions to the target section.
            else if (section != null) {
                try {
                    if (!section.equals(navigationManager.getCurrentSection())) {

                        WorkspacePermission workspacePerm = WorkspacePermission.newInstance(section.getWorkspace(), WorkspacePermission.ACTION_LOGIN);
                        SectionPermission sectionPerm = SectionPermission.newInstance(section, SectionPermission.ACTION_VIEW);
                        if (userStatus.hasPermission(workspacePerm) && userStatus.hasPermission(sectionPerm)) {
                            if (log.isDebugEnabled()) log.debug("SessionManager.setSection(" + section.getId() + ")");
                            navigationManager.setCurrentSection(section);
                        }
                        else {
                            if (log.isDebugEnabled()) log.debug("User has no " + WorkspacePermission.ACTION_LOGIN + " permission in workspace " + workspaceCandidate);
                            if (isShowLoginBackDoorOnPermissionDenied()) {
View Full Code Here

            if (!pages.isEmpty()) {
                renderFragment("outputStartSelect");
                renderFragment("outputNoneSelected");

                for (int i = 0; i < pages.size(); i++) {
                    Section section = (Section) pages.get(i);
                    String title = (String) pageTitles.get(i);
                    setAttribute("id", section.getId());
                    setAttribute("title", StringEscapeUtils.escapeHtml(title));
                    renderFragment("outputSelect");
                }
                renderFragment("outputEndSelect");
            }
View Full Code Here

    protected List initSections(String preffix, WorkspaceImpl workspace) {
        List pages = new ArrayList();
        if (workspace != null) {
            Section[] sections = workspace.getAllSections(); //Sorted!
            for (int i = 0; i < sections.length; i++) {
                Section section = sections[i];
                int depth = section.getDepthLevel();
                SectionPermission viewPerm = SectionPermission.newInstance(sections[i], SectionPermission.ACTION_VIEW);
                if (UserStatus.lookup().hasPermission(viewPerm)) {
                    pages.add(section);
                    String title = getTitle(sections[i]);
                    pageTitles.add(StringUtils.leftPad(title, title.length() + (depth * preffix.length()), preffix));
View Full Code Here

        renderFragment("outputHeaders");
        renderFragment("outputEndRow");

        int n = 0;
        WorkspaceImpl workspace;
        Section section;
        try {
            workspace = (WorkspaceImpl) UIServices.lookup().getWorkspacesManager().getWorkspace(getPanelsPropertiesHandler().getWorkspaceId());
            Panel[] panels;
            if (getPanelsPropertiesHandler().getSectionId() == null) {
                panels = ((WorkspaceImpl) UIServices.lookup().getWorkspacesManager().getWorkspace(workspace.getId())).getPanelInstance(getPanelsPropertiesHandler().getInstanceId()).getAllPanels();
                section = null;
            } else {
                section = workspace.getSection(getPanelsPropertiesHandler().getSectionId());
                panels = section.getAllPanels();
            }

            if (panels != null && panels.length == 0) {
                renderFragment("empty");
            }
View Full Code Here

TOP

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

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.