Package org.jboss.dashboard.workspace

Examples of org.jboss.dashboard.workspace.Workspace


     * Get the elements visible for a given context. These are the base elements plus the workspace, section and panel
     * elements. But hierarchy applies: Panel elements may hide section ones, workspace ones and global ones.
     * Assume current workspace, section and panel.
     */
    public GraphicElement[] getAvailableElements() {
        Workspace workspace = NavigationManager.lookup().getCurrentWorkspace();
        Section section = NavigationManager.lookup().getCurrentSection();
        RequestContext reqCtx = RequestContext.getCurrentContext();
        Long idPanel = null;
        Panel panel = (Panel) reqCtx.getRequest().getRequestObject().getAttribute(Parameters.RENDER_PANEL);
        if (panel != null && section != null) {
            idPanel = panel.getPanelId();
            if (getElementScopeDescriptor().isAllowedInstance()) {
                idPanel = panel.getInstanceId();
            }
        }
        return getAvailableElements(workspace == null ? null : workspace.getId(), section == null ? null : section.getId(), panel == null ? null : idPanel);
    }
View Full Code Here


    /**
     * Get the elements manageable for a given context. These are the base elements plus the workspace, section and panel
     * elements. Assume current workspace, section and panel.
     */
    public GraphicElement[] getManageableElements() {
        Workspace workspace = NavigationManager.lookup().getCurrentWorkspace();
        Section section = NavigationManager.lookup().getCurrentSection();
        Object panelObject = SessionManager.getCurrentPanel();//TODO : Current panel won't be set!
        Panel panel = null;
        if (panelObject != null && panelObject instanceof Panel)
            panel = (Panel) panelObject;
        return getManageableElements(workspace == null ? null : workspace.getId(), section == null ? null : section.getId(), panel == null ? null : panel.getPanelId());
    }
View Full Code Here

            StringBuffer urlprefix = new StringBuffer("http://" + request.getServerName());
            if (request.getServerPort() != 80)
                urlprefix.append(":").append(request.getServerPort());
            urlprefix.append(request.getContextPath());
            urlprefix.append("/workspace/<lang>/");
            Workspace currentWorkspace = getSectionPropertiesHandler().getWorkspace();
            String friendlyUrl = currentWorkspace.getFriendlyUrl();
            friendlyUrl = StringUtils.defaultIfEmpty(friendlyUrl, currentWorkspace.getId());
            urlprefix.append(friendlyUrl).append("/");

            setAttribute("urlPreffix", urlprefix.toString());
            setAttribute("value", getSectionPropertiesHandler().getUrl());
            setAttribute("error", getSectionPropertiesHandler().hasError("url"));
View Full Code Here

            StringBuffer urlprefix = new StringBuffer("http://" + request.getServerName());
            if (request.getServerPort() != 80)
                urlprefix.append(":").append(request.getServerPort());
            urlprefix.append(request.getContextPath());
            urlprefix.append("/workspace/<lang>/");
            Workspace currentWorkspace = getSectionPropertiesHandler().getWorkspace();
            String friendlyUrl = currentWorkspace.getFriendlyUrl();
            friendlyUrl = StringUtils.defaultIfEmpty(friendlyUrl, currentWorkspace.getId());
            urlprefix.append(friendlyUrl).append("/");

            setAttribute("urlPreffix", urlprefix.toString());
            setAttribute("value", getSectionPropertiesHandler().getUrl());
            setAttribute("error", getSectionPropertiesHandler().hasError("url"));
View Full Code Here

        //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) {
View Full Code Here

    public void service(HttpServletRequest request, HttpServletResponse response) throws FormatterException {
        if (navigationManager.isShowingConfig()) {
            renderFragment("config");
        } else {
            Workspace workspace = navigationManager.getCurrentWorkspace();
            if (workspace != null && !navigationManager.isUserRequiresLoginBackdoor()) {
                renderFragment("workspacePage");
            } else {
                renderFragment("loginPage");
            }
View Full Code Here

            Set workspaceIds = UIServices.lookup().getWorkspacesManager().getAllWorkspacesIdentifiers();
            TreeSet sortedWorkspaceIds = new TreeSet(workspaceIds);
            ArrayList list = new ArrayList();
            for (Iterator iterator = sortedWorkspaceIds.iterator(); iterator.hasNext();) {
                String workspaceId = (String) iterator.next();
                Workspace workspace = UIServices.lookup().getWorkspacesManager().getWorkspace(workspaceId);
                WorkspacePermission viewPerm = WorkspacePermission.newInstance(workspace, WorkspacePermission.ACTION_LOGIN);
                boolean canLogin = UserStatus.lookup().hasPermission(viewPerm);
                if (canLogin)
                    list.add(getNewWorkspaceNode(workspace));
            }
View Full Code Here

            Set workspaceIds = UIServices.lookup().getWorkspacesManager().getAllWorkspacesIdentifiers();
            TreeSet sortedWorkspaceIds = new TreeSet(workspaceIds);
            ArrayList list = new ArrayList();
            for (Iterator iterator = sortedWorkspaceIds.iterator(); iterator.hasNext();) {
                String workspaceId = (String) iterator.next();
                Workspace workspace = UIServices.lookup().getWorkspacesManager().getWorkspace(workspaceId);
                WorkspacePermission viewPerm = WorkspacePermission.newInstance(workspace, WorkspacePermission.ACTION_LOGIN);
                boolean canLogin = UserStatus.lookup().hasPermission(viewPerm);
                if (canLogin)
                    list.add(getNewWorkspaceNode(workspace));
            }
View Full Code Here

        this.permissionsPropertiesHandler = permissionsPropertiesHandler;
    }

    public boolean isEditable() {
        WorkspaceNode parent = (WorkspaceNode) getParent();
        Workspace workspace;
        try {
            workspace = parent.getWorkspace();
            WorkspacePermission editPerm = WorkspacePermission.newInstance(workspace, WorkspacePermission.ACTION_EDIT_PERMISSIONS);
            return super.isEditable() && UserStatus.lookup().hasPermission(editPerm);
        } catch (Exception e) {
View Full Code Here

        this.permissionsPropertiesHandler = permissionsPropertiesHandler;
    }

    public boolean isEditable() {
        WorkspaceNode parent = (WorkspaceNode) getParent();
        Workspace workspace;
        try {
            workspace = parent.getWorkspace();
            WorkspacePermission editPerm = WorkspacePermission.newInstance(workspace, WorkspacePermission.ACTION_EDIT_PERMISSIONS);
            return super.isEditable() && UserStatus.lookup().hasPermission(editPerm);
        } catch (Exception e) {
View Full Code Here

TOP

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

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.