Package org.jboss.dashboard.workspace

Examples of org.jboss.dashboard.workspace.Workspace


        //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


                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);
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 {
            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 (objectCreated == null) {
                renderFragment("abortedErrorMessageStart");
                renderWarnings(warnings, warningArguments, i);
                renderFragment("abortedEnd");
            } else if (objectCreated instanceof Workspace) {
                Workspace p = (Workspace) objectCreated;
                setAttribute("name", LocalizeTag.getLocalizedValue(p.getTitle(), SessionManager.getLang(), true));
                setAttribute("url", LinkToWorkspaceTag.getLink(request, response, p.getId()));
                if (anyErrors) {
                    renderFragment("abortedSuccessMessageStart");
                    renderWarnings(warnings, warningArguments, i);
                    renderFragment("abortedEnd");
                } else {
View Full Code Here

            if (objectCreated == null) {
                renderFragment("abortedErrorMessageStart");
                renderWarnings(warnings, warningArguments, i);
                renderFragment("abortedEnd");
            } else if (objectCreated instanceof Workspace) {
                Workspace p = (Workspace) objectCreated;
                setAttribute("name", LocalizeTag.getLocalizedValue(p.getTitle(), SessionManager.getLang(), true));
                setAttribute("url", LinkToWorkspaceTag.getLink(request, response, p.getId()));
                if (anyErrors) {
                    renderFragment("abortedSuccessMessageStart");
                    renderWarnings(warnings, warningArguments, i);
                    renderFragment("abortedEnd");
                } else {
View Full Code Here

     * 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

        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

            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

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.