Package org.jboss.dashboard.workspace

Examples of org.jboss.dashboard.workspace.WorkspaceImpl


    }

    public void actionDiagnoseWorkspacesAndFix(CommandRequest request) throws Exception {
        Set<String> workspaceIds = UIServices.lookup().getWorkspacesManager().getAllWorkspacesIdentifiers();
        for (String wsId : workspaceIds) {
            WorkspaceImpl workspace = (WorkspaceImpl) UIServices.lookup().getWorkspacesManager().getWorkspace(wsId);
            workspace.sectionsDiagnoseFix();
        }
    }
View Full Code Here


        buildI18nValues(request);

        //For current Workspace, save new values.
        if (validateBeforeEdition()) {
            try {
                final WorkspaceImpl workspace = (WorkspaceImpl) getWorkspace();
                workspace.setName(name);
                workspace.setTitle(title);
                workspace.setSkinId(skin);
                workspace.setEnvelopeId(envelope);
                url = ("".equals(url)) ? null : url;
                workspace.setFriendlyUrl(url);
                workspace.setHomeSearchMode(homeSearchMode);

                HibernateTxFragment txFragment = new HibernateTxFragment() {
                    protected void txFragment(Session session) throws Exception {
                        if (defaultWorkspace) {
                            log.debug("Setting default workspace");
                            Workspace currentDefaultWorkspace = getWorkspacesManager().getDefaultWorkspace();
                            log.debug("Current default workspace is " + (currentDefaultWorkspace == null ? "null" : currentDefaultWorkspace.getId()));
                            if (currentDefaultWorkspace != null && (!currentDefaultWorkspace.getId().equals(workspace.getId())))
                            {
                                log.debug("Deleting default workspace property in current default workspace");
                                currentDefaultWorkspace.setDefaultWorkspace(false);
                                getWorkspacesManager().store(currentDefaultWorkspace);
                            }
                        }
                        workspace.setDefaultWorkspace(defaultWorkspace);
                        getWorkspacesManager().store(workspace);
                    }
                };

                txFragment.execute();
View Full Code Here

        //No file or directory exists in root with same name
        try {
            Workspace p = getWorkspacesManager().getWorkspaceByUrl(url);
            if (p == null) return true;//No workspace with same url exists.
            WorkspaceImpl workspace = (WorkspaceImpl) getWorkspace();
            if (workspace.getId().equals(p.getId())) return true;//It is my own workspace
        } catch (Exception e) {
            log.error("Error getting workspace", e);
        }
        return false;
    }
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

        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

        setAttribute("value", "ui.region");
        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

        this.homePagesHandler = homePagesHandler;
    }

    public void service(HttpServletRequest request, HttpServletResponse response) throws FormatterException {
        try {
            WorkspaceImpl workspace = (WorkspaceImpl) getHomePagesHandler().getWorkspace();
            renderFragment("outputStart");

            Set<Role> allRoles = SecurityServices.lookup().getRolesManager().getAllRoles();
            if (allRoles.size() > 0) {
                int i = 0;
View Full Code Here

        List children = new ArrayList();
        PanelInstancesNode parent = (PanelInstancesNode) getParent();
        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 instancias = new TreeSet(new Comparator() {
                    public int compare(Object o1, Object o2) {
                        PanelInstance p1 = (PanelInstance) o1;
                        PanelInstance p2 = (PanelInstance) o2;
View Full Code Here

    protected List listChildren() {
        List children = new ArrayList();
        String language = SessionManager.getLang();
        try {
            WorkspaceImpl workspace = (WorkspaceImpl) UIServices.lookup().getWorkspacesManager().getWorkspace(getWorkspaceId());
            PanelInstance[] instances = workspace.getPanelInstances();
            TreeSet instancias = new TreeSet(new Comparator() {
                public int compare(Object o1, Object o2) {
                    PanelInstance p1 = (PanelInstance) o1;
                    PanelInstance p2 = (PanelInstance) o2;
                    return p1.getTitle(SessionManager.getLang()).compareToIgnoreCase(p2.getTitle(SessionManager.getLang()));
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.