Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.opensymphony.module.sitemesh.mapper
Class OSDecoratorMapper  view OSDecoratorMapper download OSDecoratorMapper.java

java.lang.Object
  extended bycom.opensymphony.module.sitemesh.mapper.AbstractDecoratorMapper
      extended bycom.opensymphony.module.sitemesh.mapper.OSDecoratorMapper
All Implemented Interfaces:
com.opensymphony.module.sitemesh.DecoratorMapper

public final class OSDecoratorMapper
extends AbstractDecoratorMapper

The OSDecoratorMapper will map a suitable decorator based on the operating system of the remote client.

OSDecoratorMapper works by checking to see if the "UA-OS" header was sent with the HTTP request. If it was, the class will check the value of the header with all the different os's the user has configured the Decorator Mapper to identify and, if a match is found, routes the request accordingly. Configuration is done using the sitemesh.xml file. The param name is a string literal (operating system name) you would like to match in the UA-OS header, and the value is what will be appended to the decorator name if the user is using that operating system

Version:
$Revision: 1.2 $

Field Summary
protected  java.util.Properties properties
          Properties holds the parameters that the object was initialized with.
 
Fields inherited from class com.opensymphony.module.sitemesh.mapper.AbstractDecoratorMapper
config, parent
 
Constructor Summary
OSDecoratorMapper()
           
 
Method Summary
 com.opensymphony.module.sitemesh.Decorator getDecorator(javax.servlet.http.HttpServletRequest request, com.opensymphony.module.sitemesh.Page page)
          Attempts to find the correct decorator for Page page based on the UA-OS HTTP header in the request.
 void init(com.opensymphony.module.sitemesh.Config config, java.util.Properties properties, com.opensymphony.module.sitemesh.DecoratorMapper parent)
          Init initializes the OSDecoratorMapper object by setting the parent DecoratorMapper, and loading the initialization properties.
 
Methods inherited from class com.opensymphony.module.sitemesh.mapper.AbstractDecoratorMapper
getNamedDecorator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

properties

protected java.util.Properties properties
Properties holds the parameters that the object was initialized with.

Constructor Detail

OSDecoratorMapper

public OSDecoratorMapper()
Method Detail

init

public void init(com.opensymphony.module.sitemesh.Config config,
                 java.util.Properties properties,
                 com.opensymphony.module.sitemesh.DecoratorMapper parent)
          throws java.lang.InstantiationException
Init initializes the OSDecoratorMapper object by setting the parent DecoratorMapper, and loading the initialization properties.

Specified by:
init in interface com.opensymphony.module.sitemesh.DecoratorMapper
Overrides:
init in class AbstractDecoratorMapper

getDecorator

public com.opensymphony.module.sitemesh.Decorator getDecorator(javax.servlet.http.HttpServletRequest request,
                                                               com.opensymphony.module.sitemesh.Page page)
Attempts to find the correct decorator for Page page based on the UA-OS HTTP header in the request.

Specified by:
getDecorator in interface com.opensymphony.module.sitemesh.DecoratorMapper
Overrides:
getDecorator in class AbstractDecoratorMapper