Examples of WorkspaceImpl


Examples of org.jboss.dashboard.workspace.WorkspaceImpl

        List<String> selectedWorkspaceIds = menuDriver.getSelectedWorkspaceIds(getPanel());
        boolean isEditMode = getPanel().getPanelSession().isEditMode();
        if (workspacesIdentifiers != null && workspacesIdentifiers.size() > 0) {
            for (String id : workspacesIdentifiers) {
                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(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

Examples of org.jboss.dashboard.workspace.WorkspaceImpl

        List children = new ArrayList();
        PanelInstancesNode parent = (PanelInstancesNode) getParent();
        final String language = SessionManager.getLang();
        try {
            String workspaceId = parent.getHandler().getWorkspaceId();
            WorkspaceImpl workspace = (WorkspaceImpl) UIServices.lookup().getWorkspacesManager().getWorkspace(workspaceId);
            PanelInstance[] instances = workspace.getPanelInstancesInGroup(providerId);
            if (instances != null) {
                TreeSet<PanelInstance> panelInstances = new TreeSet<PanelInstance>(new Comparator<PanelInstance>() {
                    public int compare(PanelInstance p1, PanelInstance p2) {
                        return p1.getTitle(language).compareToIgnoreCase(p2.getTitle(language));
                    }
View Full Code Here

Examples of org.jboss.dashboard.workspace.WorkspaceImpl

                public int compare(PanelInstance p1, PanelInstance p2) {
                    return p1.getTitle(language).compareToIgnoreCase(p2.getTitle(language));
                }
            });

            WorkspaceImpl workspace = (WorkspaceImpl) UIServices.lookup().getWorkspacesManager().getWorkspace(getWorkspaceId());
            for (PanelInstance instance : workspace.getPanelInstances()) {
                String groupName = instance.getParameterValue(PanelInstance.PARAMETER_GROUP, language);
                String provider = instance.getProvider().getGroup();
                if (getGroupName().equals(groupName) && getProviderId().equals(provider)) {
                    panelInstances.add(instance);
                }
View Full Code Here

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<PanelInstance> panelInstances = 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

Examples of org.jboss.dashboard.workspace.WorkspaceImpl

        rqctx.getRequest().getRequestObject().removeAttribute(CURRENT_PAGE_ATTR);
    }

    protected WorkspaceImpl getCurrentWorkspaceFromCache() {
        RequestContext rqctx = RequestContext.lookup();
        WorkspaceImpl currentWorkspace = (WorkspaceImpl) rqctx.getRequest().getRequestObject().getAttribute(CURRENT_WORKSPACE_ATTR);
        return currentWorkspace;
    }
View Full Code Here

Examples of org.jboss.dashboard.workspace.WorkspaceImpl

     * Get the current workspace, repositioning the navigation in case it is not correct.
     *
     * @return current workspace after checking ubication is correct
     */
    public synchronized WorkspaceImpl getCurrentWorkspace() {
        WorkspaceImpl currentWorkspace = getCurrentWorkspaceFromCache();
        if (currentWorkspace != null) return currentWorkspace;
        if (!isValidUbication()) reposition();
        currentWorkspace = doGetCurrentWorkspace();
        return currentWorkspace;
    }
View Full Code Here

Examples of org.jboss.dashboard.workspace.WorkspaceImpl

        clearRequestCache();
        log.warn("Couldn't reposition navigation to a valid ubication.");
    }

    protected void repositionSection() {
        WorkspaceImpl workspace = doGetCurrentWorkspace();
        Section[] pages = workspace.getAllRootSections();

        // First search root sections in order
        for (int i = 0; i < pages.length; i++) {
            Section page = pages[i];
            setCurrentSectionId(page.getDbid());
            clearRequestCache();
            if (isValidUbication()) return;
        }
        // Then, the rest of sections
        pages = workspace.getAllSections();
        for (int i = 0; i < pages.length; i++) {
            Section page = pages[i];
            if (!page.isRoot()) {
                setCurrentSectionId(page.getId());
                clearRequestCache();
View Full Code Here

Examples of org.jboss.dashboard.workspace.WorkspaceImpl

    public void actionNavigateToPage(CommandRequest request) throws Exception {
        String workspaceId = request.getParameter(WORKSPACE_ID);
        String pageId = request.getParameter(PAGE_ID);
        if (workspaceId != null && pageId != null) {
            WorkspaceImpl workspace = (WorkspaceImpl) UIServices.lookup().getWorkspacesManager().getWorkspace(workspaceId);
            if (workspace != null) {
                setCurrentSection(workspace.getSection(Long.decode(pageId)));
            }
        }
    }
View Full Code Here

Examples of org.jboss.dashboard.workspace.WorkspaceImpl

    }

    public WorkspaceImpl getWorkspace() {
        if (getWorkspaceId() == null) return null;
        try {
            WorkspaceImpl workspace = (WorkspaceImpl) UIServices.lookup().getWorkspacesManager().getWorkspace(getWorkspaceId());
            if (workspace != null) return workspace;
            return (WorkspaceImpl) UIServices.lookup().getWorkspacesManager().getWorkspaceByUrl(getWorkspaceId());
        } catch (Exception e) {
            log.error("Error: ", e);
        }
View Full Code Here

Examples of org.jboss.dashboard.workspace.WorkspaceImpl

        return null;
    }

    public Section getPage() {
        if (getSectionId() == null) return null;
        WorkspaceImpl workspace = getWorkspace();
        if (workspace != null) {
            try {
                Section page = workspace.getSection(Long.decode(getSectionId()));
                if (page != null) return page;
            } catch (NumberFormatException nfe) {
            }
            return workspace.getSectionByUrl(getSectionId());
        }
        return null;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.