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

Quick Search    Search Deep

com.opensymphony.module.sitemesh.mapper: Javadoc index of package com.opensymphony.module.sitemesh.mapper.


Package Samples:

com.opensymphony.module.sitemesh.mapper

Classes:

AgentDecoratorMapper: The AgentDecoratorMapper can determine the user-agent (i.e. web-browser) requesting a page, and map to a suitable Decorator. This can be useful for supplying different versions of the same content for different browsers (e.g. vanilla HTML for Lynx, complex tables and frames for Netscape, extra stuff for IE5, etc). This can also be used to enhance search-engine ratings by using a 'bait and switch' system - this involves showing a search-engine friendly of the content to spiders only. When AgentDecoratorMapper is in the chain, it will request the appropriate Decorator from its parent. It will then ...
ParameterDecoratorMapper: The ParameterDecoratorMapper will map a suitable decorator based on request parameters. The ParameterDecoratorMapper is configured via three properties. decorator.parameter - the parameter which contains the name of the decorator which will be mapped. The default is "decorator". For example if decorator.parameter is "foobar" then myurl.jsp?foobar=mydecorator will map to the decorator named "mydecorator". You can also supply an optional 'confirmation parameter'. The decorator will only be mapped if the parameter named parameter.name is in the request URI and the value of that parameter is equal ...
ConfigLoader: The ConfigLoader reads a configuration XML file that contains Decorator definitions (name, url, init-params) and path-mappings (pattern, name). These can then be accessed by the getDecoratorByName() methods and getMappedName() methods respectively. The DTD for the configuration file in old (deprecated) format is located at http://www.opensymphony.com/dtds/sitemesh_1_0_decorators.dtd . The DTD for the configuration file in new format is located at http://www.opensymphony.com/dtds/sitemesh_1_5_decorators.dtd . Editing the config file will cause it to be auto-reloaded. This class is used by ConfigDecoratorMapper, ...
LanguageDecoratorMapper: The LanguageDecoratorMapper can determine the preferred language set in the browser requesting a page, and map to a suitable Decorator (using the "Accept-Language" HTTP header). This can be useful for supplying different versions of the same content for different languages. When LanguageDecoratorMapper is in the chain, it will request the appropriate Decorator from its parent. It will then add an extention to the filename of the Decorator, and if that file exists it shall be used as the Decorator instead. For example, if the Decorator path is /blah.jsp and the detected preferred language is en ...
EnvEntryDecoratorMapper: The EnvEntryDecoratorMapper allows the reference to a web-app environment entry for the decorator name, and falls back to ConfigDecoratorMapper's behavior if no matching environment entry is found. In some cases, it's desirable to allow a deployer, as opposed to a developer, to specify a decorator. In a .WAR file, this can be very difficult, since decorator mappings are specified in decorators.xml (more or less). This mapper corrects that by allowing two types of mapping. If the decorator name is found in an <env-entry> , the entry's value is used as the decorator reference. Known Issues: ...
PageDecoratorMapper: The PageDecoratorMapper allows the actual Page to determine the Decorator to be used. The 'meta.decorator' and 'decorator' properties of the page are accessed and if any of them contain the name of a valid Decorator, that Decorator shall be applied. As an example, if HTML is being used, the Decorator could be chosen by using a <html decorator="mydecorator"> root tag or by using a <meta name="decorator" content="mydecorator"> tag in the header. The actual properties to query are specified by passing properties to the mapper using the property.? prefix. As the properties are stored in ...
PathMapper: The PathMapper is used to map file patterns to keys, and find an approriate key for a given file path. The pattern rules are consistent with those defined in the Servlet 2.3 API on the whole. Wildcard patterns are also supported, using any combination of * and ?. Example PathMapper pm = new PathMapper(); pm.put("one","/"); pm.put("two","/mydir/*"); pm.put("three","*.xml"); pm.put("four","/myexactfile.html"); pm.put("five","/*\/admin/*.??ml"); String result1 = pm.get("/mydir/myfile.xml"); // returns "two"; String result2 = pm.get("/mydir/otherdir/admin/myfile.html"); // returns "five";
OSDecoratorMapper: 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 ...
PrintableDecoratorMapper: The PrintableDecoratorMapper is a sample DecoratorMapper that will check to see whether 'printable=true' is supplied as a request parameter and if so, use the specified decorator instead. The name of this decorator should be supplied in the decorator property. The exact 'printable=true' request criteria can be overriden with the parameter.name and parameter.value properties. Although this DecoratorMapper was designed for creating printable versions of a page, it can be used for much more imaginative purposes.
InlineDecoratorMapper: The InlineDecoratorMapper is used to determine the correct Decorator when using inline decorators. It will check the request attribute value defined by the key RequestConstants.DECORATOR > RequestConstants.DECORATOR 55 and use the appropriate named Decorator. This is passed across from the page:applyDecorator tag.
FrameSetDecoratorMapper: The FrameSetDecoratorMapper will use the specified decorator when the Page is an instance of com.opensymphony.module.sitemesh.HTMLPage and isFrameSet() returns true. The name of this decorator should be supplied in the decorator property - if no decorator property is supplied, no decorator is applied to frame based pages.
AbstractDecoratorMapper: Abstract DecoratorMapper implementation for easy creation of new DecoratorMappers. Typically, an implementation would override getNamedDecorator() or getDecorator(). If a Decorator cannot be returned from either of these, then they should delegate to their superclass.
RobotDecoratorMapper: The RobotDecoratorMapper will use the specified decorator when the requester is identified as a robot (also known as spider, crawler, ferret) of a search engine. The name of this decorator should be supplied in the decorator property.
CookieDecoratorMapper: The CookieDecoratorMapper will map a suitable decorator based on a cookie value. The CookieDecoratorMapper is configured via one properties. cookie.name - the cookie which contains the name of the decorator which will be mapped.
NullDecoratorMapper: The NullDecoratorMapper represents the top-level DecoratorMapper that is finally delegated to if no other DecoratorMapper has intervened. It is used so the parent property does not have to be checked by other DecoratorMappers (null object pattern).
ConfigDecoratorMapper: Default implementation of DecoratorMapper. Reads decorators and mappings from the config property (default '/WEB-INF/decorators.xml').
FileDecoratorMapper: The FileDecoratorMapper will treat the name of the decorator as a file-name to use (in the context of the web-app).
DefaultDecorator: Default implementation of Decorator. All properties are set by the constructor.
ConfigLoaderTest
PathMapperTest

Home | Contact Us | Privacy Policy | Terms of Service