oracle.panama.rt.hook
Class FolderRendererPolicy

java.lang.Object
  |
  +--oracle.panama.rt.hook.FolderRendererPolicy
All Implemented Interfaces:
FolderRendererHook

public class FolderRendererPolicy
extends java.lang.Object
implements FolderRendererHook

The default implementation of the FolderRendererHook.

Since:
iAS Wireless Edition Release 2.0

Inner Class Summary
TypeClass
 class FolderRendererPolicy.PapzSetupActionImpl
          Special version of setup action for actions that will invoke PapzLite Constructs the correct URL
 
Field Summary
TypeField
static java.lang.String BOTTOMIMAGE
           
static java.lang.String TOPIMAGE
           
 
Method Summary
TypeMethod
 org.w3c.dom.Element createServiceMenu(ServiceContext serviceContext)
          Create the service menu, using a MobilXML SimpleMenu tag.
 org.w3c.dom.Element createServiceMenuItem(org.w3c.dom.Element parent, Service currService)
          Create a service menu item, using a MobilXML SimpleMenuItem tag.
 org.w3c.dom.Element getBody(ServiceContext context)
          Helper to create the folder body
 Service[] getCurrentServices(ServiceContext context)
          Get all visible services in the given folder.
 User getCurrentUser(ServiceContext context)
          Convenience method for getting the current user given a Service Context This method should probably move to the ServiceContext interface
 FolderSetupAction getEditPresetsAction(ServiceContext context)
           
 FolderSetupAction getEditServicesAction(ServiceContext context)
           
 FolderSetupAction getEditUserInfoAction(ServiceContext context)
           
 FolderSetupAction getEditUserProfileAction(ServiceContext context)
           
 java.lang.String getFolderName(ServiceContext context)
          Get the 'canonical' title to use for the current folder.
 org.w3c.dom.Element getFooter(ServiceContext context)
          Add a footer with setup buttons etc.
 org.w3c.dom.Element getFooter(ServiceContext context, boolean addSetupMenu)
          Add a footer with setup buttons etc.
 org.w3c.dom.Element getHeader(ServiceContext context)
          Get the MobileXML for the header of the current folder
 org.w3c.dom.Element getHeader(ServiceContext context, java.lang.String headerName, java.lang.String imageName)
          Get the MobileXML for the header of the current folder, using the specified title and image
static FolderRendererPolicy getInstance()
          The "thread-safe" singleton getter
 FolderSetupAction getLoginAction(ServiceContext context)
           
 FolderSetupAction getLogoffAction(ServiceContext context)
           
 FolderSetupAction getRegisterAction(ServiceContext context)
           
 org.w3c.dom.Element invoke(Folder folder, ServiceContext context)
          Invoke the renderer using the service context.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TOPIMAGE

public static java.lang.String TOPIMAGE

BOTTOMIMAGE

public static java.lang.String BOTTOMIMAGE
Method Detail

createServiceMenu

public org.w3c.dom.Element createServiceMenu(ServiceContext serviceContext)
Create the service menu, using a MobilXML SimpleMenu tag. This method can be overriden in order to display services After the menu has been created, the method createServiceMenuItem will be called for each service, and will insert a SimpleMenuItem tag for that service using the SimpleMenu as the parent node. This means that if this method is overridden to use a different tag than SimpleMenu, the createSimpleMenuItem method should also be overriden.
Parameters:
Folder - the current folder
ServiceContext - the current service context
Returns:
Element SimpleMenu node for the services
See Also:
createServiceMenuItem

createServiceMenuItem

public org.w3c.dom.Element createServiceMenuItem(org.w3c.dom.Element parent,
                                                 Service currService)
Create a service menu item, using a MobilXML SimpleMenuItem tag. This method can be overriden in order to display services differently. After the menu has been created, the method createServiceMenuItem will be called for each service, and will insert a SimpleMenuItem tag for that service using the SimpleMenu as the parent node. This means that if the createServiceMenu method is overridden to use a different tag than SimpleMenu, the createSimpleMenuItem method should also be overriden.
Parameters:
Element - parent the Service menu tag
Service - the current service
Returns:
Element SimpleMenuItem node for the spoecified service
See Also:
createServiceMenu

getInstance

public static FolderRendererPolicy getInstance()
The "thread-safe" singleton getter
Returns:
the FolderRendererPolicy

getFolderName

public java.lang.String getFolderName(ServiceContext context)
Get the 'canonical' title to use for the current folder. If this is the users home folder, the users name will be returned, otherwise the name of the current folder.
Parameters:
ServiceContext - the current service context
Returns:
String display name of current folder

getCurrentUser

public User getCurrentUser(ServiceContext context)
Convenience method for getting the current user given a Service Context This method should probably move to the ServiceContext interface
Parameters:
ServiceContext - the current service context
Returns:
The current User

getCurrentServices

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

invoke

public org.w3c.dom.Element invoke(Folder folder,
                                  ServiceContext context)
                           throws PanamaRuntimeException
Invoke the renderer using the service context.
Specified by:
invoke in interface FolderRendererHook
Parameters:
folder - the Folder to be rendered
context - the ServiceContext that contains all parameters
Returns:
Element an XML DOM element compliant to the SimpleResult DTD
Throws:
<{PanamaRuntimeException}> -  

getBody

public org.w3c.dom.Element getBody(ServiceContext context)
Helper to create the folder body
Parameters:
sr - the service request.
children - the vector of services.

getLoginAction

public FolderSetupAction getLoginAction(ServiceContext context)
Parameters:
ServiceContext - the current service context
Returns:
the action to use for logging in this user

getLogoffAction

public FolderSetupAction getLogoffAction(ServiceContext context)
Parameters:
ServiceContext - the current service context
Returns:
the action to use for logging off this user

getRegisterAction

public FolderSetupAction getRegisterAction(ServiceContext context)
Parameters:
ServiceContext - the current service context
Returns:
the action to use for registering this user

getEditServicesAction

public FolderSetupAction getEditServicesAction(ServiceContext context)
Parameters:
ServiceContext - the current service context
Returns:
the action to use for setting up services

getEditUserInfoAction

public FolderSetupAction getEditUserInfoAction(ServiceContext context)
Parameters:
ServiceContext - the current service context
Returns:
the action to use for editing user info

getEditUserProfileAction

public FolderSetupAction getEditUserProfileAction(ServiceContext context)
Parameters:
ServiceContext - the current service context
Returns:
the action to use for editing user profiles

getEditPresetsAction

public FolderSetupAction getEditPresetsAction(ServiceContext context)
Parameters:
ServiceContext - the current service context
Returns:
the action to use for editing user presets

getHeader

public org.w3c.dom.Element getHeader(ServiceContext context)
Get the MobileXML for the header of the current folder
Parameters:
Folder - the current folder
ServiceContext - service context
Returns:
Element simpleResult the SimpleXML tag that encloses the page header

getHeader

public org.w3c.dom.Element getHeader(ServiceContext context,
                                     java.lang.String headerName,
                                     java.lang.String imageName)
Get the MobileXML for the header of the current folder, using the specified title and image
Parameters:
Folder - the current folder
ServiceContext - service context
String - title to use for header (can be null)
String - path/URL of image to use for header (can be null);
Returns:
Element simpleResult the SimpleXML tag that encloses the page header

getFooter

public org.w3c.dom.Element getFooter(ServiceContext context)
Add a footer with setup buttons etc.
Parameters:
Folder - the current folder
ServiceContext - service context
Returns:
Element simpleResult the MobileXML element -- will be inserted as child of SimpleResult

getFooter

public org.w3c.dom.Element getFooter(ServiceContext context,
                                     boolean addSetupMenu)
Add a footer with setup buttons etc.
Parameters:
Folder - the current folder
ServiceContext - service context
boolean - addSetupMenu flag for whether we should add setup menu or not
Returns:
Element simpleResult the MobileXML element -- will be inserted as child of SimpleResult