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:
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); }
Package
The relevant APIs are contained in the com.sap.workspaces.workspace, com.sap.workspaces.module packages.