|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jalios.jcms.DescriptiveURLs
public class DescriptiveURLs
Manages Descriptive URLs production and decoding.
Nested Class Summary | |
---|---|
static class |
DescriptiveURLs.DescriptiveURLsListener
|
Constructor Summary | |
---|---|
DescriptiveURLs()
|
Method Summary | |
---|---|
static String |
cleanDescriptiveURLText(String str,
Locale locale)
Apply the following operation on the given string: unaccentuate lowercase (using given Locale) replace whitespace with "-" remove characters matching pattern [^0-9a-zA-Z/-] remove multiple contiguous letters [/-] |
static String |
getDescriptiveURL(Data data,
Locale locale)
Retrieve an descriptive URL for the given Data in the given language. |
static String |
getDescriptiveURLText(Data data,
Locale locale)
Returns the textual part of a descriptive URL built for the given Data. |
static Category |
getFirstDescriptiveCategory(Publication pub)
Returns the first category of the given Publication belonging to one the root categories specified for descriptive urls. |
static String |
getId(javax.servlet.http.HttpServletRequest request)
Returns a Data id computed from the URL of the requested url. |
static String |
getId(String path)
Returns a Data id computed from the given
requested path (servletPath + pathInfo). |
static String |
getServletPath()
Returns the servlet path used for descriptive URL. |
static void |
init()
Initialize or reinitialize Descriptive URLS |
static boolean |
isEnabled()
Check if descriptive URLs are enabled. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DescriptiveURLs()
Method Detail |
---|
public static void init()
public static boolean isEnabled()
public static String getId(javax.servlet.http.HttpServletRequest request)
Data
id computed from the URL of the requested url.
request
- the request for which we want the id
public static String getId(String path)
Data
id computed from the given
requested path (servletPath + pathInfo).
The given path should be "/prefix/id[/text]" or "prefix/id[/text]"
path
- the requested path relative to the webapp. That is if
an url is http://domain.tld+/contextPath+/servletPath+/pathInfo + ?querystring
the requested path would be /servletPath/pathInfo (starting slash is optionnal)
public static String getServletPath()
public static String getDescriptiveURL(Data data, Locale locale)
{prefix}/{id}[/text]
where
{prefix} is the servlet mapping of the DisplayServlet
{id} is the id of the given Data
[/text] is an optionnal textual part retrieve from
method getDescriptiveURLText(Data, Locale)
if textual part
has been enabled using property descriptive-urls.text.enabled
data
- the Data
for which create the URL (cannot be null)locale
- the Locale
to use for I18N and localized operations
if null, the channel locale is used Channel.getLocale()
IllegalArgumentException
- if data is nullpublic static String getDescriptiveURLText(Data data, Locale locale)
descriptive-urls.text.enabled
is set to "true".
data
- the Data
for which the URL is built.locale
- the Locale
to use I18N and localized operation.
public static Category getFirstDescriptiveCategory(Publication pub)
pub
- the publication for which we want the first Descriptive Category
public static String cleanDescriptiveURLText(String str, Locale locale)
str
- the string to cleanlocale
- the Locale
to use I18N and localized operation
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |