public class FriendlyURLManager
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
REVISION |
Modifier and Type | Method and Description |
---|---|
boolean |
addFriendlyURL(Data data,
java.lang.String friendlyURL)
Add the given friendlyURLSet to the friendly urls of the servlet.
|
java.lang.String |
buildCleanURL(java.lang.String str)
Method to clean the given string to have a proper URL.
Convert to CamelCase (keeping '/' separator) |
java.lang.String |
generateFriendlyURL(Category cat,
java.lang.String lang)
Build and return a friendly url that can be added later to the friendly urls
Servlet Filter.
|
java.lang.String |
generateFriendlyURL(Publication pub,
java.lang.String lang)
Build and return a friendly url that can be added later to the friendly urls
Servlet Filter.
|
Data |
getDataFromFriendlyURL(java.lang.String friendlyURL)
Return the data associated with the given friendly URL.
|
java.util.Map<java.lang.String,java.util.Set<java.lang.String>> |
getDataToFriendlyURLSetMap() |
java.util.Set<java.lang.String> |
getFriendlyURLSet(Data data)
Return a set of friendly urls associated with the given data
|
java.util.Map<java.lang.String,java.lang.String> |
getFriendlyURLToDataMap() |
static FriendlyURLManager |
getInstance() |
protected void |
initAfterStoreLoad() |
boolean |
isFriendlyURLAvailable(Data data,
java.lang.String friendlyURL)
Check if the given friendly URL is available, that is either :
the Friendly URL is not in the Friendly URLs of the servlet
or else the Friendly URL is already there with the same data
|
boolean |
isFriendlyURLAvailable(java.lang.String id,
java.lang.String friendlyURL)
Check if the given friendly URL is available, that is either :
the Friendly URL is not in the Friendly URLs of the servlet
or else the Friendly URL is already there with the same data
Instance method, to be used by rpc call in doEditCommonPubAttribute. |
static boolean |
isFriendlyURLAvailableWrapper(java.lang.String id,
java.lang.String friendlyURL) |
boolean |
isFriendlyURLValid(java.lang.String friendlyURL)
Check if the given friendly url is valid.
|
static boolean |
isFriendlyURLValidWrapper(java.lang.String friendlyURL) |
boolean |
removeDataFriendlyURL(Data data)
Remove the given data and all its associated friendly url.
|
boolean |
removeFriendlyURL(java.lang.String friendlyURL)
Remove the given friendly url.
|
void |
updateFriendlyURLs(Category cat)
Add the friendly URL of the given category.
|
void |
updateFriendlyURLs(Publication pub)
Add the friendly URL of the given publication.
|
public static final java.lang.String REVISION
public static FriendlyURLManager getInstance()
protected void initAfterStoreLoad()
public java.lang.String generateFriendlyURL(Category cat, java.lang.String lang)
cat
- the Category to build a url forlang
- the lang in which to build a urlpublic java.lang.String generateFriendlyURL(Publication pub, java.lang.String lang)
pub
- the Publication to build a url forlang
- the lang in which to build a urlpublic java.lang.String buildCleanURL(java.lang.String str)
str
- the string to cleanpublic boolean isFriendlyURLAvailable(java.lang.String id, java.lang.String friendlyURL)
id
- the id of the data associated with the friendly urlfriendlyURL
- the friendlyURL for which to check availabilitypublic static boolean isFriendlyURLAvailableWrapper(java.lang.String id, java.lang.String friendlyURL)
public boolean isFriendlyURLValid(java.lang.String friendlyURL)
friendlyURL
- the friendly url to checkpublic static boolean isFriendlyURLValidWrapper(java.lang.String friendlyURL)
public boolean isFriendlyURLAvailable(Data data, java.lang.String friendlyURL)
data
- the data associated with the friendly urlfriendlyURL
- the friendlyURL for which to check availabilitypublic java.util.Set<java.lang.String> getFriendlyURLSet(Data data)
data
- the data of which to retrieve friendly urlspublic Data getDataFromFriendlyURL(java.lang.String friendlyURL)
friendlyURL
- the friendly URL to testpublic void updateFriendlyURLs(Publication pub)
pub
- the publicationpublic void updateFriendlyURLs(Category cat)
cat
- the categorypublic boolean addFriendlyURL(Data data, java.lang.String friendlyURL)
data
- the data associated with the friendly urlfriendlyURL
- the friendly urlpublic boolean removeDataFriendlyURL(Data data)
data
- the data to remove from the servlet.public boolean removeFriendlyURL(java.lang.String friendlyURL)
friendlyURL
- the friendly url to removepublic java.util.Map<java.lang.String,java.lang.String> getFriendlyURLToDataMap()
public java.util.Map<java.lang.String,java.util.Set<java.lang.String>> getDataToFriendlyURLSetMap()
Copyright © 2001-2017 Jalios SA. All Rights Reserved.