Package org.jboss.dashboard.workspace

Examples of org.jboss.dashboard.workspace.WorkspaceImpl



    public Map prepareGroupsMap() {
        String showedGroupId = getShowedGroupId();

        WorkspaceImpl workspace = (WorkspaceImpl) getNavigationManager().getCurrentWorkspace();
        Map panelStatistics = calculatePanelsStatistics(workspace);
        String[] groupList = UIServices.lookup().getPanelsProvidersManager().enumerateProvidersGroups(workspace);

        if (groupList == null || groupList.length == 0) return null;

        Set instances = workspace.getPanelInstancesSet();
        Map groups = new HashMap();
        String groupId;
        for (int i = 0; i < groupList.length; i++) {
            groupId = groupList[i];
            Map group = (HashMap) groups.get(groupId);
View Full Code Here


        }
        if (getSectionsPropertiesHandler().getDuplicateSection().booleanValue()) {
            renderFragment("outputDuplicateSection");
            return;
        }
        WorkspaceImpl workspace;
        renderFragment("outputStart");
        try {
            workspace = (WorkspaceImpl) getSectionsPropertiesHandler().getWorkspace();
            renderFragment("outputCommandsBarStart");

            String preffix = (String) getParameter("preffix");
            List pages = initSections(preffix == null ? "--" : preffix, workspace);

            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");
            }

            WorkspacePermission workspacePerm = WorkspacePermission.newInstance(getSectionsPropertiesHandler().getWorkspace(), WorkspacePermission.ACTION_ADMIN_PROVIDERS);
            setAttribute("editPanels", UserStatus.lookup().hasPermission(workspacePerm));

            setAttribute("workspace", workspace);
            renderFragment("outputCommandsBarEnd");
            renderFragment("commandsBarSeparation");

            if (!getSectionsPropertiesHandler().getErrorPermission().isEmpty()) {

                for (int i = 0; i < getSectionsPropertiesHandler().getErrorPermission().size(); i++) {
                    setAttribute("errorCommand", getSectionsPropertiesHandler().getErrorPermission().get(i));
                    renderFragment("outputErrorCommands");
                }
                getSectionsPropertiesHandler().setErrorPermission(new ArrayList());
            }

            renderFragment("outputTreeStart");
            if (workspace.getSectionsCount() == 0)
                renderFragment("outputEmptySections");
            else {
                setAttribute("workspaceId", workspace.getId());
                renderFragment("outputTreeBody");
            }
            renderFragment("outputTreeEnd");
            setAttribute("moveLoop", getSectionsPropertiesHandler().getMoveLoop());
            renderFragment("outputEnd");
View Full Code Here


    public Map prepareGroupsMap() {
        String showedGroupId = getShowedGroupId();

        WorkspaceImpl workspace = (WorkspaceImpl) getNavigationManager().getCurrentWorkspace();
        Map panelStatistics = calculatePanelsStatistics(workspace);
        String[] groupList = UIServices.lookup().getPanelsProvidersManager().enumerateProvidersGroups(workspace);

        if (groupList == null || groupList.length == 0) return null;

        Set instances = workspace.getPanelInstancesSet();
        Map groups = new HashMap();
        String groupId;
        for (int i = 0; i < groupList.length; i++) {
            groupId = groupList[i];
            Map group = (HashMap) groups.get(groupId);
View Full Code Here

        return m;
    }


    public void initSections(Section rootSection, String indent, String preffix) throws Exception {
        WorkspaceImpl workspace;

        workspace = (WorkspaceImpl) getSectionsPropertiesHandler().getWorkspace();
        if (workspace != null) {
            Section[] sections = rootSection != null ?
                    workspace.getAllChildSections(rootSection.getId()) :
                    workspace.getAllRootSections();
            for (int i = 0; i < sections.length; i++) {
                SectionPermission viewPerm = SectionPermission.newInstance(sections[i], SectionPermission.ACTION_VIEW);
                if (UserStatus.lookup().hasPermission(viewPerm)) {
                    pageIds.add(sections[i].getId());
                    pageTitles.add(indent + getTitle(sections[i]));
View Full Code Here

    public List<WorkspaceImpl> getWorkspacesWithKPIs() throws Exception {
        List<WorkspaceImpl> results = new ArrayList<WorkspaceImpl>();
        WorkspaceImpl[] workspaces = UIServices.lookup().getWorkspacesManager().getWorkspaces();
        for (int i = 0; i < workspaces.length; i++) {
            WorkspaceImpl workspace = workspaces[i];
            List<Section> dashs = getSectionsWithKPIs(workspace);
            if (!dashs.isEmpty()) results.add(workspace);
        }
        return results;
    }
View Full Code Here

    public List<KPI> getSelectedKPIs() throws Exception {
        List<KPI> results = new ArrayList<KPI>();
        DashboardHandler dashboardHandler = DashboardHandler.lookup();
        for (String workspaceId : selectedSectionIds.keySet()) {
            WorkspaceImpl workspace = (WorkspaceImpl) UIServices.lookup().getWorkspacesManager().getWorkspace(workspaceId);
            Set<Section> sections = getSelectedSections(workspace);
            for (Section section : sections) {
                Dashboard dash = dashboardHandler.getDashboard(section);
                Iterator it = section.getPanels().iterator();
                while (it.hasNext()) {
View Full Code Here

            sectionIds.add(Long.valueOf(sectionId));
        }
    }

    public void actionSelectAllSections(CommandRequest request) throws Exception {
        WorkspaceImpl workspace = getSelectedWorkspace();
        if (workspace != null) {
            List<Section> dashs = getSectionsWithKPIs(workspace);
            Set<Long> sectionIds = new HashSet<Long>();
            selectedSectionIds.put(selectedWorkspaceId, sectionIds);
            for (Section dash : dashs) {
View Full Code Here

        boolean isEditMode = SessionManager.getPanelSession(getPanel()).isEditMode();
        if (workspacesIdentifiers != null && workspacesIdentifiers.size() > 0) {
            Iterator itWorkspacesIdentifiers = workspacesIdentifiers.iterator();
            while (itWorkspacesIdentifiers.hasNext()) {
                String id = (String) itWorkspacesIdentifiers.next();
                WorkspaceImpl workspace;
                try {
                    workspace = (WorkspaceImpl) UIServices.lookup().getWorkspacesManager().getWorkspace(id);
                } catch (Exception e) {
                    throw new FormatterException("No workspace found: ", e);
                }
                MenuItem menuItem = new WorkspaceMenuItem();
                menuItem.setId(workspace.getId());
                menuItem.setText(workspace.getName());
                menuItem.setUrl(menuDriver.getChangeWorkspaceLink(request, response, workspace.getId()));
                menuItem.setSelected(Boolean.valueOf(selectedWorkspaceIds.contains(workspace.getId())));
                menuItem.setVisible(Boolean.TRUE);
                if (workspace.getId().equals(getWorkspace().getId())) {
                    menuItem.setCurrent(Boolean.TRUE);
                } else {
                    menuItem.setCurrent(Boolean.FALSE);
                }
                renderItem(menuItem, selectedWorkspaceIds.contains(MenuDriver.PARAMETER_ALL_ITEMS), isEditMode);
View Full Code Here

            while ((section = section.getParent()) != null) {
                openedPages.add(section.getDbid());
            }
        }

        WorkspaceImpl workspace = (WorkspaceImpl) getWorkspace();
        Section[] rootSections = workspace.getAllRootSections();
        renderFragment("outputStart");
        if (isEditMode) {
            if (rootSections != null) {
                for (int i = 0; i < rootSections.length; i++) {
                    Section rootSection = rootSections[i];
View Full Code Here

    public List<WorkspaceImpl> getWorkspacesWithKPIs() throws Exception {
        List<WorkspaceImpl> results = new ArrayList<WorkspaceImpl>();
        WorkspaceImpl[] workspaces = UIServices.lookup().getWorkspacesManager().getWorkspaces();
        for (int i = 0; i < workspaces.length; i++) {
            WorkspaceImpl workspace = workspaces[i];
            List<Section> dashs = getSectionsWithKPIs(workspace);
            if (!dashs.isEmpty()) results.add(workspace);
        }
        return results;
    }
View Full Code Here

TOP

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

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.