com.sapportals.portal.prt.service
Interface IServiceContext


public interface IServiceContext

A service context allows to contact other resources in the portal. It represents the context in which an IService is executed.


Method Summary
 java.lang.String getApplicationName()
          Gets the portal application name
 ILogger getClassLogger(java.lang.Class aClass)
          Returns the logger associated to aClass's package.
 ILogger getLogger()
          get the default log handler
 ILogger getLogger(java.lang.String aLoggerName)
          get the log handler
 java.lang.String getPrivateResourceHome()
          Gets the home path for private resources
 java.lang.String getPrivateServicePath()
          Returns the full path to access private resources of the current service.
 java.lang.String getPropertyValue(java.lang.String propertyName)
          Gets a property value form the service config
 java.lang.String getPublicServicePath()
          Returns the full path to access public resources of the current service.
 IResource getResource(java.lang.String resourceType, java.io.File file)
          Gets an IResource object referring to the file specified.
 IResource getResource(java.lang.String resourceType, java.lang.String fileName)
          Gets an IResource object that belongs to the current service.
 IResource getResource(java.lang.String serviceName, java.lang.String resourceType, java.lang.String fileName)
          Gets an IResource object that belongs to the service.
 IService getService(java.lang.String aService)
          get a service by its name
 IService getService(java.lang.String aService, IServiceConfiguration aServiceConfiguration)
          Deprecated. Do not use anymore.
 IService getService(java.lang.String aService, IServiceId aServiceUserId)
          Deprecated. Do not use anymore.
 IServiceConfig getServiceConfig()
          Gets the service config
 java.lang.String getServiceName()
          Gets the portal service name
 IServiceProfile getServiceProfile()
          Gets the service profile
 java.lang.String getWorkplaceProperty(java.lang.String key, java.lang.String lDefault)
          returns the system property corresponding to the key specified.
 

Method Detail

getResource

public IResource getResource(java.lang.String serviceName,
                             java.lang.String resourceType,
                             java.lang.String fileName)
Gets an IResource object that belongs to the service.

The IResource interface defines string constants for standard resource types.

Parameters:
serviceName - the name of the service
resourceType - the type of the resource
fileName - the file name
Returns:
an IResource object.
See Also:
getResource(String, String)

getResource

public IResource getResource(java.lang.String resourceType,
                             java.lang.String fileName)
Gets an IResource object that belongs to the current service.

The IResource interface defines string constants for standard resource types.

Parameters:
resourceType - the type of the resource
fileName - the file name
Returns:
an IResource object.

getResource

public IResource getResource(java.lang.String resourceType,
                             java.io.File file)
Gets an IResource object referring to the file specified.

The IResource interface defines string constants for standard resource types.

Parameters:
resourceType - the type of the resource
file - a File object referring to the resource
Returns:
an IResource object.

getWorkplaceProperty

public java.lang.String getWorkplaceProperty(java.lang.String key,
                                             java.lang.String lDefault)
returns the system property corresponding to the key specified.
Parameters:
key -  
lDefault -  

getPrivateResourceHome

public java.lang.String getPrivateResourceHome()
Gets the home path for private resources
Returns:
a String denoting the path where private resources are located.

getPrivateServicePath

public java.lang.String getPrivateServicePath()
Returns the full path to access private resources of the current service.
Returns:
a String denoting the full path to access private resources

getPublicServicePath

public java.lang.String getPublicServicePath()
Returns the full path to access public resources of the current service.
Returns:
a String denoting the full path to access public resources

getLogger

public ILogger getLogger()
get the default log handler

getLogger

public ILogger getLogger(java.lang.String aLoggerName)
get the log handler
Parameters:
aLoggerName -  

getClassLogger

public ILogger getClassLogger(java.lang.Class aClass)
Returns the logger associated to aClass's package.
Parameters:
aClass - The class which is calling the logger.
Returns:
The logger associated to aClass's package.

getService

public IService getService(java.lang.String aService,
                           IServiceId aServiceUserId)
                    throws ServiceException
Deprecated. Do not use anymore.

get a service
Parameters:
aService - the service to get
aServiceUserId - the Id of the user requesting the service
Returns:
the Service requested, null otherwise.
Throws:
ServiceException -  
See Also:
IService

getService

public IService getService(java.lang.String aService,
                           IServiceConfiguration aServiceConfiguration)
                    throws ServiceException
Deprecated. Do not use anymore.

get a service
Parameters:
aService - the service to get
aServiceUserId - the configuration for the service
aServiceConfiguration -  
Returns:
the Service requested, null otherwise.
Throws:
ServiceException -  
See Also:
IService

getService

public IService getService(java.lang.String aService)
                    throws ServiceException
get a service by its name
Parameters:
aService - the service name to get
Returns:
the Service requested, null otherwise.
Throws:
ServiceException -  
See Also:
IService

getPropertyValue

public java.lang.String getPropertyValue(java.lang.String propertyName)
Gets a property value form the service config

getApplicationName

public java.lang.String getApplicationName()
Gets the portal application name

getServiceName

public java.lang.String getServiceName()
Gets the portal service name

getServiceConfig

public IServiceConfig getServiceConfig()
Gets the service config

getServiceProfile

public IServiceProfile getServiceProfile()
Gets the service profile