de.mguennewig.pobjform.html
Class Layout

java.lang.Object
  extended by de.mguennewig.pobjform.html.HtmlWriter
      extended by de.mguennewig.pobjform.html.Layout

public abstract class Layout
extends HtmlWriter

This class describes the layout of an HTML page.

Author:
Michael Günnewig

Field Summary
static java.lang.String INTERNATIONAL_LOCALE_KEY
          The session attribute key for our locale if we run in "international" mode.
static java.lang.String NON_INTERNATIONAL_LOCALE_KEY
          This is the name of the session attribute that stores the locale for the internal interface.
 
Fields inherited from class de.mguennewig.pobjform.html.HtmlWriter
DTD_HTML40_STRICT, DTD_HTML40_TRANSITIONAL, DTD_HTML401_STRICT, DTD_HTML401_TRANSITIONAL, DTD_XHTML10_STRICT, DTD_XHTML10_TRANSITIONAL, UNDEF_INT
 
Constructor Summary
Layout(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Creates a new Layout.
 
Method Summary
 void copyMessages(PObjHtmlForm form)
           
abstract  java.lang.String getBundleName()
          Returns the name of the application specific resource bundle used to resolve messages.
 java.lang.String getImageURL(java.lang.String imageId)
          Returns the image URL for the given imageId or null if no image should be shown.
 java.util.ResourceBundle getResourceBundle(java.util.Locale locale)
          Returns a resource bundle that contains the resources of the application and pobject library for the given locale.
 java.lang.ClassLoader getResourceLoader()
          Returns the class loader used to find the application resource bundle.
 boolean haveErrors()
           
 boolean haveErrors(java.lang.String property)
           
 void htmlErrors(java.lang.String property)
           
 boolean isInternational()
           
 java.lang.String mapCssClass(java.lang.String cssClass)
          Allows to map a cascading style sheet (CSS) class to an application one.
 java.lang.String message(java.lang.String resourceProperty, java.lang.Object... args)
           
 void resourceText(java.lang.String resourceProperty, java.lang.Object... args)
           
static java.util.Locale retrieveUserLocale(javax.servlet.http.HttpServletRequest request, java.lang.String localeKey)
           
 void setInternational(boolean international)
           
 void timeStamp(TimeStampType type, java.math.BigInteger timestamp, java.lang.String nullRepresentation)
          Writes a localized time stamp to the layout.
 void write(java.lang.String title, java.lang.String stylesheet, java.lang.String bodyClass)
           
 
Methods inherited from class de.mguennewig.pobjform.html.HtmlWriter
a, attr, attr, attr, attrUnquoted, attrUrl, aUrl, b, br, charRef, close, close, closeStart, end, end, getBasePath, getPrintWriter, getRequest, getResponse, h2, h3, h4, hidden, hr, img, img, inlineText, input, nbsp, newLine, option, option, start, start, start, submit, submit, td, text, text, textWithoutQuoting, th, tt
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INTERNATIONAL_LOCALE_KEY

public static final java.lang.String INTERNATIONAL_LOCALE_KEY
The session attribute key for our locale if we run in "international" mode.

See Also:
Constant Field Values

NON_INTERNATIONAL_LOCALE_KEY

public static final java.lang.String NON_INTERNATIONAL_LOCALE_KEY
This is the name of the session attribute that stores the locale for the internal interface. Right now, this is always "en".

See Also:
Constant Field Values
Constructor Detail

Layout

public Layout(javax.servlet.http.HttpServletRequest request,
              javax.servlet.http.HttpServletResponse response)
Creates a new Layout.

Method Detail

mapCssClass

public java.lang.String mapCssClass(java.lang.String cssClass)
Allows to map a cascading style sheet (CSS) class to an application one.


getImageURL

public java.lang.String getImageURL(java.lang.String imageId)
Returns the image URL for the given imageId or null if no image should be shown.


getBundleName

public abstract java.lang.String getBundleName()
Returns the name of the application specific resource bundle used to resolve messages.


getResourceBundle

public java.util.ResourceBundle getResourceBundle(java.util.Locale locale)
Returns a resource bundle that contains the resources of the application and pobject library for the given locale.

Throws:
java.lang.NullPointerException - if locale is null.
See Also:
getBundleName(), getResourceLoader(), MergedResourceBundle

getResourceLoader

public java.lang.ClassLoader getResourceLoader()
Returns the class loader used to find the application resource bundle.


isInternational

public final boolean isInternational()

setInternational

public void setInternational(boolean international)

message

public final java.lang.String message(java.lang.String resourceProperty,
                                      java.lang.Object... args)

resourceText

public final void resourceText(java.lang.String resourceProperty,
                               java.lang.Object... args)

timeStamp

public final void timeStamp(TimeStampType type,
                            java.math.BigInteger timestamp,
                            java.lang.String nullRepresentation)
Writes a localized time stamp to the layout.

See Also:
retrieveUserLocale(HttpServletRequest,String), TimeStampType.formatDate(BigInteger,java.text.DateFormat,String)

copyMessages

public final void copyMessages(PObjHtmlForm form)

htmlErrors

public final void htmlErrors(java.lang.String property)

haveErrors

public final boolean haveErrors()

haveErrors

public final boolean haveErrors(java.lang.String property)

write

public final void write(java.lang.String title,
                        java.lang.String stylesheet,
                        java.lang.String bodyClass)

retrieveUserLocale

public static java.util.Locale retrieveUserLocale(javax.servlet.http.HttpServletRequest request,
                                                  java.lang.String localeKey)