Oracle Application Server Wireless Java API Reference
B14043-01


oracle.panama.rt.hook
Class FolderRendererUtil

java.lang.Object
  extended byoracle.panama.rt.hook.FolderRendererUtil


public class FolderRendererUtil
extends java.lang.Object

Field Summary
static java.lang.String CHILDREN_DISPLAY_POSITION
The parameter used by folder render to decide current position of displayed children
static java.lang.String SERVICE_CONTEXT

Constructor Summary
FolderRendererUtil()

Method Summary
static java.util.Date getCurrentLocalTime(java.util.TimeZone userTimeZone)
static Service[] getCurrentServices(ServiceContext context)
Get all visible services in the given folder.
static User getCurrentUser(ServiceContext context)
Convenience method for getting the current user given a Service Context
static java.lang.String getEditPresetURL(ServiceContext context)
Returns the edit preset URL
static java.lang.String getFolderName(ServiceContext context, User user)
Returns the name of the current folder
static java.lang.String getHeaderName(User user)
Returns a string in the header.
static java.lang.String getHelpURL(ServiceContext context)
Returns the help string URL
static java.lang.String getLabel(java.lang.String key, java.lang.String defaultVal, java.util.Locale locale)
Returns a localized string
static java.lang.String getLoginURL(Request request)
Returns the login string URL
static java.lang.String getLoginURL(ServiceContext context)
Returns the login string URL
static java.lang.String getLogoffURL(Request request)
Returns the logoff string URL
static java.lang.String getLogoffURL(ServiceContext context)
Returns the logoff string URL
static int getPageSize()
This method returns how many maximum service / subfolder should be shown in a single page.
static java.lang.String getRegisterURL(ServiceContext context)
Returns the register string URL
static java.lang.String getScreenWidth(ServiceContext context)
Returns the width of the device.
static java.lang.String getServiceURL(Service service, ServiceContext context)
This method returns the URL string to a service
static java.lang.String getSetupServicesURL(ServiceContext context)
Returns the setup services URL
static java.lang.String getString(java.lang.String key, java.util.Locale locale)
Returns a localized string
static java.lang.String getURLPathParameter(Service service)
Returns the URL which can be used to invoke the service.
static java.lang.String getURLPathParameter(Service service, Request request)
Returns the URL which can be used to invoke the service.
static java.lang.String getUserInfoURL(ServiceContext context)
Returns the user info string URL
static java.lang.String getUserProfileURL(ServiceContext context)
Returns the user profile services URL
static boolean isAtHome(ServiceContext context)
Return a boolean that determines whether the current folder is home folder or not This is used to determine whether we need to show the Home link or not
static boolean isEditPresetEnabled(ServiceContext context)
Looks at the current state and returns whether edit preset link should be enabled or not
static boolean isHelpActive(ServiceContext context)
Looks at the current state and returns whether help link should be active or not
static boolean isLoginActive(ServiceContext context)
Looks at the current state and returns whether login link should be active or not
static boolean isLogoffActive(ServiceContext context)
Looks at the current state and returns whether logoff link should be active or not
static boolean isRegisterActive(ServiceContext context)
Looks at the current state and returns whether register link should be active or not
static boolean isServiceVisible(ServiceContext context, Service service)
Return a boolean value that tells whether a service is visible or not
static boolean isSetupServicesEnabled(ServiceContext context)
Looks at the current state and returns whether setup services link should be enabled or not
static boolean isUserInfoEnabled(ServiceContext context)
Looks at the current state and returns whether user info link is enabled or not
static boolean isUserProfileEnabled(ServiceContext context)
Looks at the current state and returns whether user profile link should be enabled or not
static void main(java.lang.String[] args)
static java.lang.String makeXMLSafe(java.lang.String str)
static java.lang.String[] parseImageSpec(java.lang.String filename)
Parse an image specification and returns an array of string describing the image.
static boolean shouldDisplayPersonalization(Session session, User effectiveUser)
Looks at the current user and session and return whether setup (personalization) link should be displayed or not

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

CHILDREN_DISPLAY_POSITION

public static final java.lang.String CHILDREN_DISPLAY_POSITION
The parameter used by folder render to decide current position of displayed children
See Also:
Constant Field Values

SERVICE_CONTEXT

public static final java.lang.String SERVICE_CONTEXT
See Also:
Constant Field Values

Constructor Detail

FolderRendererUtil

public FolderRendererUtil()

Method Detail

getCurrentLocalTime

public static final java.util.Date getCurrentLocalTime(java.util.TimeZone userTimeZone)

getCurrentServices

public static Service[] getCurrentServices(ServiceContext context)
Get all visible services in the given folder. This will include all group services
Parameters:
context - the current service context
Returns:
Service[] list of current services

getCurrentUser

public static User getCurrentUser(ServiceContext context)
Convenience method for getting the current user given a Service Context
Parameters:
context - the current service context
Returns:
The current User

getEditPresetURL

public static java.lang.String getEditPresetURL(ServiceContext context)
Returns the edit preset URL
Parameters:
context - the current service context
Returns:
edit preset string URL

getFolderName

public static java.lang.String getFolderName(ServiceContext context,
                                             User user)
Returns the name of the current folder
Parameters:
context - the current service context
user - the current user
Returns:
the name of current folder

getHeaderName

public static java.lang.String getHeaderName(User user)
Returns a string in the header. In general, it is the user name and the current date and time
Parameters:
user - the current user
Returns:
the name of current folder

getHelpURL

public static java.lang.String getHelpURL(ServiceContext context)
Returns the help string URL
Parameters:
context - the current service context
Returns:
help string URL

getLabel

public static java.lang.String getLabel(java.lang.String key,
                                        java.lang.String defaultVal,
                                        java.util.Locale locale)
Returns a localized string
Parameters:
key - used for lookup the localized string
defaultVal - default value in case look up returns null
locale - the current locale
Returns:
the localized string

getLoginURL

public static java.lang.String getLoginURL(Request request)
Returns the login string URL
Parameters:
request - the current request
Returns:
login string URL

getLoginURL

public static java.lang.String getLoginURL(ServiceContext context)
Returns the login string URL
Parameters:
context - the current service context
Returns:
login string URL

getLogoffURL

public static java.lang.String getLogoffURL(Request request)
Returns the logoff string URL
Parameters:
request - the current request
Returns:
logoff string URL

getLogoffURL

public static java.lang.String getLogoffURL(ServiceContext context)
Returns the logoff string URL
Parameters:
context - the current service context
Returns:
logoff string URL

getPageSize

public static int getPageSize()
This method returns how many maximum service / subfolder should be shown in a single page. This is read from system configuration parameter “folder.subfolder.pagesize”.
Returns:
page size

getRegisterURL

public static java.lang.String getRegisterURL(ServiceContext context)
Returns the register string URL
Parameters:
context - the current service context
Returns:
register string URL

getScreenWidth

public static java.lang.String getScreenWidth(ServiceContext context)
Returns the width of the device. If the device width is 0, it will return default width which is 80%, else it returns the width value – 10 (10 pixel is for scroll bar).
Parameters:
context - the current service context
Returns:
the string width of the device

getServiceURL

public static java.lang.String getServiceURL(Service service,
                                             ServiceContext context)
This method returns the URL string to a service
Parameters:
service - whose URL is returned
context - the current service context
Returns:
URL string of the service

getSetupServicesURL

public static java.lang.String getSetupServicesURL(ServiceContext context)
Returns the setup services URL
Parameters:
context - the current service context
Returns:
setup services string URL

getString

public static java.lang.String getString(java.lang.String key,
                                         java.util.Locale locale)
Returns a localized string
Parameters:
key - used for lookup the localized string
locale - the current locale
Returns:
the localized string

getURLPathParameter

public static java.lang.String getURLPathParameter(Service service)
Returns the URL which can be used to invoke the service. The returned URL is XML safe i.e all characters like '&', '<', '>' ..., are replaced by their corresponding XML serializable strings. Caveat: The difference between this method and the other one that takes request as the second parameter is that this method looks up the request using thread local. In general, it’s safer to use the other method that takes request because sometimes the J2EE container might use a different thread for calling JSP.
Parameters:
service - the service
Returns:
the URL string

getURLPathParameter

public static java.lang.String getURLPathParameter(Service service,
                                                   Request request)
Returns the URL which can be used to invoke the service. The returned URL is XML safe i.e all characters like '&', '<', '>' ..., are replaced by their corresponding XML serializable strings
Parameters:
service - the service
request - the current request
Returns:
the URL string

getUserInfoURL

public static java.lang.String getUserInfoURL(ServiceContext context)
Returns the user info string URL
Parameters:
context - the current service context
Returns:
user info string URL

getUserProfileURL

public static java.lang.String getUserProfileURL(ServiceContext context)
Returns the user profile services URL
Parameters:
context - the current service context
Returns:
user profile string URL

isAtHome

public static boolean isAtHome(ServiceContext context)
Return a boolean that determines whether the current folder is home folder or not This is used to determine whether we need to show the Home link or not
Parameters:
context - the current service context
Returns:
boolean we are currently at home folder or not

isEditPresetEnabled

public static boolean isEditPresetEnabled(ServiceContext context)
Looks at the current state and returns whether edit preset link should be enabled or not
Parameters:
context - the current service context
Returns:
whether edit preset link should be enabled or not

isHelpActive

public static boolean isHelpActive(ServiceContext context)
Looks at the current state and returns whether help link should be active or not
Parameters:
context - the current service context
Returns:
whether help link should be active or not

isLoginActive

public static boolean isLoginActive(ServiceContext context)
Looks at the current state and returns whether login link should be active or not
Parameters:
context - the current service context
Returns:
whether login link should be active or not

isLogoffActive

public static boolean isLogoffActive(ServiceContext context)
Looks at the current state and returns whether logoff link should be active or not
Parameters:
context - the current service context
Returns:
whether logoff link should be active or not

isRegisterActive

public static boolean isRegisterActive(ServiceContext context)
Looks at the current state and returns whether register link should be active or not
Parameters:
context - the current service context
Returns:
whether register link should be active or not

isServiceVisible

public static boolean isServiceVisible(ServiceContext context,
                                       Service service)
Return a boolean value that tells whether a service is visible or not
Parameters:
context - the current service context
service - the evaluated service
Returns:
boolean visible service or not

isSetupServicesEnabled

public static boolean isSetupServicesEnabled(ServiceContext context)
Looks at the current state and returns whether setup services link should be enabled or not
Parameters:
context - the current service context
Returns:
whether setup services link should be enabled or not

isUserInfoEnabled

public static boolean isUserInfoEnabled(ServiceContext context)
Looks at the current state and returns whether user info link is enabled or not
Parameters:
context - the current service context
Returns:
whether user info link should be active or not

isUserProfileEnabled

public static boolean isUserProfileEnabled(ServiceContext context)
Looks at the current state and returns whether user profile link should be enabled or not
Parameters:
context - the current service context
Returns:
whether user profile link should be enabled or not

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception

makeXMLSafe

public static java.lang.String makeXMLSafe(java.lang.String str)

parseImageSpec

public static java.lang.String[] parseImageSpec(java.lang.String filename)
Parse an image specification and returns an array of string describing the image. The first element in the array is the filename. The subsequent elements are the available extensions of the image filename.
Parameters:
filename - image specification
Returns:
array of string describing the image

shouldDisplayPersonalization

public static boolean shouldDisplayPersonalization(Session session,
                                                   User effectiveUser)
Looks at the current user and session and return whether setup (personalization) link should be displayed or not
Parameters:
session - user session
effectiveUser - the current user
Returns:
whether personalization link should be displayed or not

Oracle Application Server Wireless Java API Reference
B14043-01


Copyright © 2004 Oracle Corporation. All Rights Reserved.