Package org.jboss.dashboard.workspace

Examples of org.jboss.dashboard.workspace.WorkspaceImpl


    public WorkspacesManager getWorkspacesManager() {
        return UIServices.lookup().getWorkspacesManager();
    }

    public void actionDeletePanel(CommandRequest request) throws Exception {
        WorkspaceImpl workspace = (WorkspaceImpl) getWorkspacesManager().getWorkspace(workspaceId);
        String panelId = request.getRequestObject().getParameter("panelId");
        getWorkspacesManager().removeInstance(workspace.getPanelInstance(panelId));
    }
View Full Code Here


    public void setPanelInstanceId(Long panelInstanceId) {
        this.panelInstanceId = panelInstanceId;
    }

    public PanelInstance getInstance() throws Exception {
        WorkspaceImpl workspace = (WorkspaceImpl) getWorkspacesManager().getWorkspace(getWorkspaceId());
        return workspace.getPanelInstance(getPanelInstanceId());
    }
View Full Code Here

    public void setWorkspaceId(String workspaceId) {
       this.workspaceId = workspaceId;
    }

    public CommandResponse actionSave(CommandRequest request) throws Exception {
        WorkspaceImpl workspace = NavigationManager.lookup().getCurrentWorkspace();
        WorkspacePermission workspacePerm = WorkspacePermission.newInstance(workspace, WorkspacePermission.ACTION_ADMIN);
        UserStatus.lookup().checkPermission(workspacePerm);

        PanelInstance instance = getPanelInstance();
View Full Code Here

        if (new File(Application.lookup().getBaseAppDirectory() + "/" + url).exists())
            return false;

        //No file or directory exists in root with same name
        try {
            WorkspaceImpl currentWorkspace = (WorkspaceImpl) getWorkspace();

            Workspace p = UIServices.lookup().getWorkspacesManager().getWorkspaceByUrl(url);
            if (p != null && !currentWorkspace.getId().equals(p.getId()))
                return false;//Exists workspace with this friendly URL

            Section sections[] = currentWorkspace.getAllSections();

            if (sections != null) {
                for (int i = 0; i < sections.length; i++) {
                    if (!sections[i].getId().equals(sectionId) && sections[i].getFriendlyUrl() != null && sections[i].getFriendlyUrl().equals(url))
                        return false;
View Full Code Here

        if (new File(Application.lookup().getBaseAppDirectory() + "/" + url).exists())
            return false;

        //No file or directory exists in root with same name
        try {
            WorkspaceImpl currentWorkspace = (WorkspaceImpl) getWorkspace();

            Workspace p = UIServices.lookup().getWorkspacesManager().getWorkspaceByUrl(url);
            if (p != null && !currentWorkspace.getId().equals(p.getId()))
                return false;//Exists workspace with this friendly URL

            Section sections[] = currentWorkspace.getAllSections();

            if (sections != null) {
                for (int i = 0; i < sections.length; i++) {
                    if (!sections[i].getId().equals(sectionId) && sections[i].getFriendlyUrl() != null && sections[i].getFriendlyUrl().equals(url))
                        return false;
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>();
        for (String workspaceId : selectedSectionIds.keySet()) {
            WorkspaceImpl workspace = (WorkspaceImpl) UIServices.lookup().getWorkspacesManager().getWorkspace(workspaceId);
            Set<Section> sections = getSelectedSections(workspace);
            for (Section section : sections) {
                for (Panel panel : section.getPanels()) {
                    KPI kpi = DashboardHandler.lookup().getKPI(panel);
                    if (kpi != null && !results.contains(kpi)) results.add(kpi);
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

        getWorkspaceHandler().setWorkspaceId(workspaceId);
        getWorkspaceHandler().deleteWorkspace();
    }

    public void actionCreateWorkspace(CommandRequest request) {
        final WorkspaceImpl newWorkspace = new WorkspaceImpl();
        try {
            buildI18nValues(request);
            if (validateBeforeCreation()) {
                newWorkspace.setId(UIServices.lookup().getWorkspacesManager().generateWorkspaceId());
                newWorkspace.setTitle(title);
                newWorkspace.setName(name);
                newWorkspace.setSkinId(skinId);
                newWorkspace.setEnvelopeId(envelopeId);

                // Register workspace (persistent operation)
                new HibernateTxFragment() {
                protected void txFragment(Session session) throws Exception {
                    UIServices.lookup().getWorkspacesManager().addNewWorkspace(newWorkspace);
View Full Code Here


    public void actionDiagnoseWorkspaces(CommandRequest request) throws Exception {
        Set<String> workspaceIds = UIServices.lookup().getWorkspacesManager().getAllWorkspacesIdentifiers();
        for (String wsId : workspaceIds) {
            WorkspaceImpl workspace = (WorkspaceImpl) UIServices.lookup().getWorkspacesManager().getWorkspace(wsId);
            int numErrors = workspace.sectionsDiagnose();
            log.error("Found " + numErrors + " page Errors.");
        }
    }
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.