Package org.jboss.dashboard.workspace

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


        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

    /**
     * @see javax.servlet.jsp.tagext.TagSupport
     */
    public int doEndTag() throws JspTagException {

        WorkspaceImpl workspace = NavigationManager.lookup().getCurrentWorkspace();

        if (workspace != null) {
            Section section = workspace.getSection(getSection());

            if (section != null) {
                String linkStr = getLink((HttpServletRequest) pageContext.getRequest(), (HttpServletResponse) pageContext.getResponse(), section);
                try {
                    pageContext.getOut().print(StringEscapeUtils.escapeHtml(linkStr));
View Full Code Here

public class NavigationUpdater implements UserStatusListener {

    public void statusChanged(UserStatus us) {
        if (us.isRootUser()) return;

        WorkspaceImpl currentWorkspace = NavigationManager.lookup().getCurrentWorkspace();
        if (currentWorkspace != null && currentWorkspace.getHomeSearchMode() == Workspace.SEARCH_MODE_ROLE_HOME_PREFERENT) {
            Section section = currentWorkspace.getDefaultHomePageForRole(us.getUserRoleIds().iterator().next());
            if (section != null) {
                NavigationManager.lookup().setCurrentSection(section);
            }
        }
View Full Code Here

        //Old commands depended on these parameters to affect navigation status
        String workspaceId = request.getRequestObject().getParameter("idWorkspace");
        String pageId = request.getRequestObject().getParameter("idSection");
        try {
            if (!StringUtils.isEmpty(workspaceId) && !StringUtils.isEmpty(pageId)) {
                WorkspaceImpl workspace = (WorkspaceImpl) UIServices.lookup().getWorkspacesManager().getWorkspace(workspaceId);
                Section page = workspace.getSection(Long.decode(pageId));
                getNavigatorManager().setCurrentSection(page);
            }
        } catch (Exception e) {
            log.error("Error in beforeInvokeAction: ", e);
        }
View Full Code Here

     * @param workspaceId Workspace id to be referenced.
     * @return a non-friendly link to a workspace.
     * @deprecated use URLMarkupGenerator methods directly
     */
    public static String getLink(HttpServletRequest request, HttpServletResponse response, String workspaceId) {
        WorkspaceImpl workspace = null;
        try {
            workspace = (WorkspaceImpl) UIServices.lookup().getWorkspacesManager().getWorkspace(workspaceId);
        } catch (Exception e) {
            log.error("Error: ", e);
            return null;
View Full Code Here

    public void service(HttpServletRequest request, HttpServletResponse response) throws FormatterException {
        Panel panel = (Panel) getParameter("panel");
        PanelSession status = SessionManager.getPanelSession(panel);
        SectionRegion sectionRegion = panel.getSection().getSectionRegion(panel.getRegion().getId());
        boolean columnRegion = panel.getRegion().isColumnRegion();
        WorkspaceImpl workspace = NavigationManager.lookup().getCurrentWorkspace();
        boolean userIsAdmin = false;
        if (workspace != null) {
            WorkspacePermission permToCheck = WorkspacePermission.newInstance(workspace, WorkspacePermission.ACTION_ADMIN);
            userIsAdmin = UserStatus.lookup().hasPermission(permToCheck);
        }
View Full Code Here

        getWorkspaceHandler().deleteWorkspace();
    }

    public void actionCreateWorkspace(CommandRequest request) {
        MessagesComponentHandler messagesHandler = MessagesComponentHandler.lookup();
        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

    }

    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

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.