org.millstone.webadapter
Class ThemeFunctionLibrary

java.lang.Object
  |
  +--org.millstone.webadapter.ThemeFunctionLibrary

public class ThemeFunctionLibrary
extends java.lang.Object

This a function library that can be used from the theme XSL-files. It provides easy access to current application, window, theme, webbrowser and session. The internal threadlocal state must be maintained by the webadapter in order go guarantee that it works.

Since:
3.0
Version:
3.0.3
Author:
IT Mill Ltd.

Constructor Summary
ThemeFunctionLibrary()
           
 
Method Summary
static Application application()
          Returns a reference to the application object associated with the session that the call came from.
static WebBrowser browser()
          Returns a reference to the browser object associated with the session that the call came from.
protected static void cleanState()
           
protected static java.lang.String generateWindowScript(Window window, Application app, WebAdapterServlet wa, WebBrowser browser)
           
static int getFirstDayOfWeek()
          Get name for week day.
static java.lang.String getMonth(int month)
          Get name for month.
static java.lang.String getShortMonth(int month)
          Get short name for month.
static java.lang.String getShortWeekday(int dayOfWeek)
          Get name for week day.
protected static java.lang.String getWindowRefreshScript(Application application, Window window, WebBrowser browser)
          Generate JavaScript for updating given window
static java.lang.String getWindowTargetName()
          Returns an unique target name for current window.
static java.lang.String getWindowTargetName(Application application, Window window)
          Returns an unique target name for a given window name.
static java.lang.String getWindowTargetName(java.lang.String name)
          Returns an unique target name for current window.
static boolean probeClient()
          Generate JavaScript for page that performs client-side combility checks.
static java.lang.String resource(java.lang.String resource)
          Return an URI to the named resource.
static java.lang.String resource(java.lang.String resource, java.lang.String theme)
          Return an URI to the named resource from the named theme.
static javax.servlet.http.HttpSession session()
          Returns a reference to the current servlet http session object that is associated with the session that the call came from.
protected static void setState(Application application, Window window, WebBrowser webBrowser, javax.servlet.http.HttpSession session, WebAdapterServlet webAdapterServlet, java.lang.String theme)
           
static java.lang.String theme()
          Return a reference to the current theme object that is associated with the session that the call came from.
static Window window()
          Returns a reference to the current window object associated with the session that the call came from.
static java.lang.String windowScript()
          Generate JavaScript for page header that handles window refreshing, opening and closing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThemeFunctionLibrary

public ThemeFunctionLibrary()
Method Detail

setState

protected static void setState(Application application,
                               Window window,
                               WebBrowser webBrowser,
                               javax.servlet.http.HttpSession session,
                               WebAdapterServlet webAdapterServlet,
                               java.lang.String theme)

cleanState

protected static void cleanState()

application

public static Application application()
Returns a reference to the application object associated with the session that the call came from.


window

public static Window window()
Returns a reference to the current window object associated with the session that the call came from.


browser

public static WebBrowser browser()
Returns a reference to the browser object associated with the session that the call came from.


session

public static javax.servlet.http.HttpSession session()
Returns a reference to the current servlet http session object that is associated with the session that the call came from.


theme

public static java.lang.String theme()
Return a reference to the current theme object that is associated with the session that the call came from.


resource

public static java.lang.String resource(java.lang.String resource,
                                        java.lang.String theme)
Return an URI to the named resource from the named theme.


resource

public static java.lang.String resource(java.lang.String resource)
Return an URI to the named resource.


probeClient

public static boolean probeClient()
Generate JavaScript for page that performs client-side combility checks. The script includes HTML/JavaScript commands to be included in the body of the millstone-form.


windowScript

public static java.lang.String windowScript()
Generate JavaScript for page header that handles window refreshing, opening and closing. Generates script that:

generateWindowScript

protected static java.lang.String generateWindowScript(Window window,
                                                       Application app,
                                                       WebAdapterServlet wa,
                                                       WebBrowser browser)

getWindowTargetName

public static java.lang.String getWindowTargetName(Application application,
                                                   Window window)
Returns an unique target name for a given window name.

Returns:
An unique ID for window target
Throws:
java.lang.IllegalStateException - If application for window is null.

getWindowTargetName

public static java.lang.String getWindowTargetName()
Returns an unique target name for current window.

Returns:
An unique ID for window target

getWindowTargetName

public static java.lang.String getWindowTargetName(java.lang.String name)
Returns an unique target name for current window.

Returns:
An unique ID for window target
Throws:
java.lang.IllegalStateException - If application for window is null.

getFirstDayOfWeek

public static int getFirstDayOfWeek()
Get name for week day.

Returns:
Name of week day in applications current locale.

getShortWeekday

public static java.lang.String getShortWeekday(int dayOfWeek)
Get name for week day.

Returns:
Name of week day in applications current locale.

getShortMonth

public static java.lang.String getShortMonth(int month)
Get short name for month.

Returns:
Name of month in applications current locale.

getMonth

public static java.lang.String getMonth(int month)
Get name for month.

Returns:
Name of month in applications current locale.

getWindowRefreshScript

protected static java.lang.String getWindowRefreshScript(Application application,
                                                         Window window,
                                                         WebBrowser browser)
Generate JavaScript for updating given window



Copyright © 2000,2001,2002 IT Mill Ltd. All Rights Reserved.