com.sapportals.portal.appintegrator
Class Utils

java.lang.Object
  |
  +--com.sapportals.portal.appintegrator.Utils

public class Utils
extends java.lang.Object

Version:
$Revision: #2 $.

Field Summary
protected static java.lang.String APPINTEGRATOR_COMPONET
          the component name of THIS component
 
Constructor Summary
Utils()
           
 
Method Summary
static java.lang.String beautifyURL(java.lang.String url)
          Removes some "blemishes" from the URL like double && and leading ?
static java.util.List chopURL(java.lang.String theUrl)
          Returns a list that contains the single pieces of the given URL in separate slots.
static java.lang.String dropDomains(java.lang.String uri, int n)
          returns the suffix of the given URL where the first n domain labels are dropped
static javax.servlet.http.Cookie getSessionCookie(java.lang.String name, java.lang.String value, java.lang.String domain, java.lang.String path)
          returns a session cookie with the given name, value, domain and path
static ISystem getSystem(java.lang.String alias, com.sap.security.api.IUser user)
          returns the ISystem object for the given alias
static ISystems getSystemLandscapeService()
          returns the system landscape service
static long hash(java.lang.Object obj)
           
static void includeJSP(com.sapportals.portal.prt.component.IPortalComponentRequest request, com.sapportals.portal.prt.component.IPortalComponentResponse response, IIntegrationLayer layer, java.lang.String name)
          returns the corresponding jsp resource for the given technique
static void info(java.lang.String message)
          writes the given message into the log-file
static void log(java.lang.String message, com.sapportals.portal.prt.logger.Level level)
          writes the given exception into the log-file
static void log(java.lang.Throwable e, java.lang.String message, com.sapportals.portal.prt.logger.Level level)
          writes the given exception into the log-file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

APPINTEGRATOR_COMPONET

protected static final java.lang.String APPINTEGRATOR_COMPONET
the component name of THIS component
Constructor Detail

Utils

public Utils()
Method Detail

chopURL

public static java.util.List chopURL(java.lang.String theUrl)
Returns a list that contains the single pieces of the given URL in separate slots. The addressing section (i.e schema, address, port and path) are copied into the first slot of the list which is just a String. The name-value pairs of the query string are copied into the following slots in that way that every slot contains a BasicAttribute object with the name and the value.

The URL http://server.domain.com/path?n1=v1&n2=v2&n3=v3
is choped into the following list:
[ "http://server.domain.com/path", [n1, v1], [n2, v2], [n3, v3] ]

Parameters:
theUrl - the URL
Returns:
list the contains the chopped URL

hash

public static long hash(java.lang.Object obj)

beautifyURL

public static java.lang.String beautifyURL(java.lang.String url)
Removes some "blemishes" from the URL like double && and leading ? or &
Parameters:
url - the url
Returns:
beautified URL

getSessionCookie

public static javax.servlet.http.Cookie getSessionCookie(java.lang.String name,
                                                         java.lang.String value,
                                                         java.lang.String domain,
                                                         java.lang.String path)
returns a session cookie with the given name, value, domain and path

dropDomains

public static java.lang.String dropDomains(java.lang.String uri,
                                           int n)
returns the suffix of the given URL where the first n domain labels are dropped

log

public static void log(java.lang.Throwable e,
                       java.lang.String message,
                       com.sapportals.portal.prt.logger.Level level)
writes the given exception into the log-file

log

public static void log(java.lang.String message,
                       com.sapportals.portal.prt.logger.Level level)
writes the given exception into the log-file

info

public static void info(java.lang.String message)
writes the given message into the log-file

includeJSP

public static void includeJSP(com.sapportals.portal.prt.component.IPortalComponentRequest request,
                              com.sapportals.portal.prt.component.IPortalComponentResponse response,
                              IIntegrationLayer layer,
                              java.lang.String name)
returns the corresponding jsp resource for the given technique

getSystemLandscapeService

public static ISystems getSystemLandscapeService()
returns the system landscape service

getSystem

public static ISystem getSystem(java.lang.String alias,
                                com.sap.security.api.IUser user)
                         throws javax.naming.NamingException
returns the ISystem object for the given alias