Show TOC

Background documentationChanging Workspace Properties Locate this document in the navigation structure

 

You can change the workspace properties, such as its name, description, status or permission policy, as illustrated by the following sample:

Example Example

  1. public void changeWorkspaceProperties(IPortalComponentRequest request, IIdentifier identifier)
    {
    // Retrieve the workspace object
    IWorkspaceFactory workspacesFactory = (IWorkspaceFactory) RuntimeFactory.getWorkspacesRuntime().getService(IWorkspaceFactory.class);
    IWorkspace workspace = workspacesFactory.getWorkspace(request.getUser(), identifier);
    
    // Change permission policy     	
    WorkspaceProperties workspaceProperties = new WorkspaceProperties();
    workspaceProperties.setPermissionPolicy(PermissionPolicy.PUBLIC);
    workspace.update(workspaceProperties, request.getUser()); 
    
    // Change status
    workspace.setStatus(request.getUser(), Status.DRAFT, "The content is not approved");       	    	
    }
    
End of the source code.

Note Note

You can close a workspace by changing its status to Status.CLOSED:

workspace.setStatus(request.getUser(), Status.CLOSED, "The workspace owner has left the company");

End of the note.