com.sap.workspaces.module

Class ModuleHelper

java.lang.Object
  extended by com.sap.workspaces.module.ModuleHelper

public final class ModuleHelper
extends Object

A helper class for simple retrieval of a module context. The module context can be used only by module instances. Other components, such as module templates, cannot use it. The service accepts module context, and obtains the module and workspace identifiers, as illustrated in the following sample::

The following example illustrates how to access and use the factory:
IModuleContext IModuleContext moduleContext = ModuleHelper.getModuleContext(request);


Constructor Summary
ModuleHelper()
           
 
Method Summary
static IModuleContext getModuleContext(IIdentifier workspaceID, String moduleInstanceID, com.sap.security.api.IUser user)
          Returns the module context specified by the workspace ID, a module instance ID and a user
static IModuleContext getModuleContext(com.sapportals.portal.prt.component.IPortalComponentRequest request)
          Returns the module context specified by the current request
static IModuleContext getModuleContext(String moduleInstancePcdUrl, com.sap.security.api.IUser user)
          Returns the module context specified by the workspace ID, a module instance ID and a user
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModuleHelper

public ModuleHelper()
Method Detail

getModuleContext

public static IModuleContext getModuleContext(com.sapportals.portal.prt.component.IPortalComponentRequest request)
                                       throws WorkspacesRuntimeException
Returns the module context specified by the current request

Parameters:
request - the current request. If an error occurs or the current running component is not a module instance, an exception is thrown
Returns:
the module context
Throws:
WorkspacesRuntimeException - if an error occurs or the current running component is not a module instance

getModuleContext

public static IModuleContext getModuleContext(IIdentifier workspaceID,
                                              String moduleInstanceID,
                                              com.sap.security.api.IUser user)
                                       throws WorkspacesRuntimeException
Returns the module context specified by the workspace ID, a module instance ID and a user

Parameters:
workspaceID - the workspace identifier
moduleInstanceID - the module instance unique ID
user - the user
Returns:
the module context
Throws:
WorkspacesRuntimeException

getModuleContext

public static IModuleContext getModuleContext(String moduleInstancePcdUrl,
                                              com.sap.security.api.IUser user)
                                       throws WorkspacesRuntimeException
Returns the module context specified by the workspace ID, a module instance ID and a user

Parameters:
moduleInstancePcdUrl - pcd url of the module instance
Returns:
the module context
Throws:
WorkspacesRuntimeException


Copyright 2010 SAP AG Complete Copyright Notice