Show TOC

Background documentationAccessing Workspace Services Locate this document in the navigation structure

 

As a first step in using the Enterprise Workspaces API, you need to obtain access to the module context and workspace services, which is illustrated in the following example:

Example Example

  1. private IWorkspace getWorkspace(IPortalComponentRequest request)
    	{
    // Gets module context
    IModuleContext moduleContext = ModuleHelper.getModuleContext(request);
    
    // Gets workspace factory for workspace operations
    IWorkspaceFactory workspaceFactory = (IWorkspaceFactory)RuntimeFactory.getWorkspacesRuntime().getService(IWorkspaceFactory.class);
    IIdentifier workspaceIdentifier = moduleContext.getModuleID().getWorkspaceID();
    return workspaceFactory.getWorkspace(moduleContext.getUser(), workspaceIdentifier);
    	}
    
End of the source code.

Package

The relevant APIs are contained in the com.sap.workspaces.workspace, com.sap.workspaces.module packages.