com.sap.tc.webdynpro.clientserver.portal

Class WDPortalUtils

java.lang.Object
  extended bycom.sap.tc.webdynpro.clientserver.portal.WDPortalUtils

public class WDPortalUtils
extends Object

WDPortalUtils contains some helper functions for the portal environment.

Type Classification Type Classification:

This class is part of the Web Dynpro API, so applications may reference it or call any method of this type, but they must not subclass it.

For a detailed explanation of API classification see the Web Dynpro Compatibility Guide

Nested Class Summary
static interface WDPortalUtils.IWDPortalUtils
           
 
Method Summary
static String getPortalApplicationURL(String jndiPath)
          Returns the relative URL to the speficied portal application.
static String getPortalWebResourceURL(String resourcePath)
          Returns the relative web resource path to a resources stored as part of a portal component.
static Object getService(WDPortalServiceType type)
          Returns an instance of the specified portal service.
static Object getServiceReference(String serviceName)
          Returns an instance of the specified portal service or NULL if this service could not be found.
static Object getServiceReference(String serviceName, Hashtable environment)
          Returns an instance of the specified portal service or NULL if this service could not be found.
static boolean isRunningInPortal()
          Checks whether or not the Web Dynpro application is running the the portal environment or not.
static Object lookup(String serviceName)
          Returns a reference to the specified portal service or NULL if this service could not be found.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isRunningInPortal

public static boolean isRunningInPortal()
Checks whether or not the Web Dynpro application is running the the portal environment or not.

Returns:
TRUE if the Web Dynpro application is running in the portal environment and FALSE otherwise.

lookup

public static Object lookup(String serviceName)
Returns a reference to the specified portal service or NULL if this service could not be found.

Parameters:
serviceName - the name of the portal service
Returns:
a reference to the specified portal service of NULL if this servcie could not be found.

getServiceReference

public static Object getServiceReference(String serviceName)
Returns an instance of the specified portal service or NULL if this service could not be found. For the JNDI lookup to get a service instance the used environment contains one key Context.INITIAL_CONTEXT_FACTORY with value "com.sapportals.portal.prt.registry.PortalRegistryFactory".

Parameters:
serviceName - the full-qualfied name of the portal service
Returns:
a instance of the specified portal service of NULL if this service could not be found.

getServiceReference

public static Object getServiceReference(String serviceName,
                                         Hashtable environment)
Returns an instance of the specified portal service or NULL if this service could not be found.

Parameters:
serviceName - the full-qualfied name of the portal service
environment - the used environment for the JNDI lookup to get the instance of the specified portal service
Returns:
a instance of the specified portal service of NULL if this service could not be found.

getService

public static Object getService(WDPortalServiceType type)
Returns an instance of the specified portal service.

Parameters:
type - the requested portal service.
Returns:
a instance of the requested portal service or NULL if this service could not be found.

getPortalWebResourceURL

public static String getPortalWebResourceURL(String resourcePath)
Returns the relative web resource path to a resources stored as part of a portal component.

Parameters:
resourcePath - the resource path like "com.sap.portal.pcd.roleservice/images/role.gif"
Returns:
the web resource path like "/irj/portalapps/com.sap.portal.pcd.roleservice/images/role.gif"

getPortalApplicationURL

public static String getPortalApplicationURL(String jndiPath)
Returns the relative URL to the speficied portal application.

Parameters:
jndiPath - the portal application described as an JNDI lookup string like "pcd:portal_content/kermit/url"
Returns:
the portal application URL like "/irj/servlet/prt/portal/prtroot/pcd!3aportal_content!2fkermit!2furl"


Copyright 2006 SAP AG Complete Copyright Notice