Package org.ametys.web
Class URIPrefixInputModule
java.lang.Object
org.ametys.web.URIPrefixInputModule
- All Implemented Interfaces:
Component,Serviceable,InputModule
This input module gives access to various URI prefixes used for computing actual URIs depending on the rendering context (front, preview, back),
on the current path prefix (live/, preview/, ...) and other environment constraints.
It provides the following attributes:
<blockquote><table border="1" cellpadding="2">
<tr><th>Attribute</th>
<th>Description</th>
<th>Usage</th>
<th>CMS (BO) value</th>
<th>Front-office value</th></tr>
<tr><th rowspan="2"><i>uri-prefix</i></th>
<td rowspan="2">the uri prefix, with or without site name</td>
<td><code>{uri-prefix:uri-prefix}</code></td>
<td>/cmscontext/prefix</td>
<td>/sitecontext</td></tr>
<tr><td><code>{uri-prefix:uri-prefix:site}</code></td>
<td>/cmscontext/prefix/site</td>
<td>/sitecontext</td></tr>
<tr><th rowspan="2"><i>absolute-uri-prefix</i></th>
<td rowspan="2">the absolute uri prefix, with or without site name</td>
<td><code>{uri-prefix:absolute-uri-prefix}</code></td>
<td>http://cms.server.com:port/cmscontext/prefix</td>
<td>http://www.server.com:port/sitecontext</td></tr>
<tr><td><code>{uri-prefix:absolute-uri-prefix:site}</code></td>
<td>http://cms.server.com:port/cmscontext/prefix/site</td>
<td>http://www.server.com:port/sitecontext</td></tr>
</table></blockquote>
<h4>uri-prefix</h4>
<p>Represents the full prefix, with or without site name.
It comes in two forms: with and without the site name.
Use the first form when creating site-independent links, such as plugin URIs.
Use the first form when creating links within a given site, for instance when linking to a page.
<blockquote>Examples: <i>/app/_cms</i> (without site), <i>/app/_cms/www</i> (with site)</blockquote>
</p>
<h4>absolute-uri-prefix</h4>
<p>Absolutized version of the previous variable. Use it when linking to a page
or an URI from outside the server, for instance when sending a link to a specific
page in an e-mail.
<blockquote>Example: <i>http://cms.server:8080/app/_cms/www</i></blockquote>
</p>
-
Field Summary
Fields inherited from interface org.apache.cocoon.components.modules.input.InputModule
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAttribute(String name, Configuration modeConf, Map objectModel) getAttributeNames(Configuration modeConf, Map objectModel) Object[]getAttributeValues(String name, Configuration modeConf, Map objectModel) voidservice(ServiceManager manager)
-
Constructor Details
-
URIPrefixInputModule
public URIPrefixInputModule()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
getAttribute
public Object getAttribute(String name, Configuration modeConf, Map objectModel) throws ConfigurationException - Specified by:
getAttributein interfaceInputModule- Throws:
ConfigurationException
-
getAttributeNames
public Iterator getAttributeNames(Configuration modeConf, Map objectModel) throws ConfigurationException - Specified by:
getAttributeNamesin interfaceInputModule- Throws:
ConfigurationException
-
getAttributeValues
public Object[] getAttributeValues(String name, Configuration modeConf, Map objectModel) throws ConfigurationException - Specified by:
getAttributeValuesin interfaceInputModule- Throws:
ConfigurationException
-