Package com.jalios.jcms.friendlyurl
Class FriendlyURLManager
java.lang.Object
com.jalios.jcms.friendlyurl.FriendlyURLManager
-
Method Summary
Modifier and TypeMethodDescriptionbooleanaddFriendlyURL(Data data, String friendlyURL) Add the given friendlyURLSet to the friendly urls of the servlet.buildCleanURL(String str) Method to clean the given string to have a proper URL.
Convert to CamelCase (keeping '/' separator)generateFriendlyURL(Category cat, String lang) Build and return a friendly url that can be added later to the friendly urls Servlet Filter.generateFriendlyURL(Publication pub, String lang) Build and return a friendly url that can be added later to the friendly urls Servlet Filter.getDataFromFriendlyURL(String friendlyURL) Return the data associated with the given friendly URL.getFriendlyURLSet(Data data) Return a set of friendly urls associated with the given datastatic FriendlyURLManagervoidbooleanisFriendlyURLAvailable(Data data, 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 databooleanisFriendlyURLAvailable(String id, 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 booleanisFriendlyURLAvailableWrapper(String id, String friendlyURL) booleanisFriendlyURLValid(String friendlyURL) Check if the given friendly url is valid.booleanremoveDataFriendlyURL(Data data) Remove the given data and all its associated friendly url.booleanremoveDataFriendlyURL(String dataId) Remove the given data and all its associated friendly url.booleanremoveFriendlyURL(String friendlyURL) Remove the given friendly url.voidAdd the friendly URL of the given category.voidAdd the friendly URL of the given publication.
-
Method Details
-
getInstance
-
initAfterStoreLoad
public void initAfterStoreLoad() -
generateFriendlyURL
Build and return a friendly url that can be added later to the friendly urls Servlet Filter.
This method does not check for availabilty of the built friendlyURL.- Parameters:
cat- the Category to build a url forlang- the lang in which to build a url- Returns:
- a friendlyURL
-
generateFriendlyURL
Build and return a friendly url that can be added later to the friendly urls Servlet Filter.
This method do not check for availabilty of the built friendly url.- Parameters:
pub- the Publication to build a url forlang- the lang in which to build a url- Returns:
- a friendly url or null if the url could not be build in the given language
-
buildCleanURL
Method to clean the given string to have a proper URL.
Convert to CamelCase (keeping '/' separator)- Parameters:
str- the string to clean- Returns:
- the cleaned string
-
isFriendlyURLAvailable
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.- Parameters:
id- the id of the data associated with the friendly urlfriendlyURL- the friendlyURL for which to check availability- Returns:
- true if available, false otherwise
-
isFriendlyURLAvailableWrapper
-
isFriendlyURLValid
Check if the given friendly url is valid.
Instance method, to be used by rpc call in doEditCommonPubAttribute.- Parameters:
friendlyURL- the friendly url to check- Returns:
- true if friendly URL is a valid one, false otherwise
-
isFriendlyURLAvailable
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
- Parameters:
data- the data associated with the friendly urlfriendlyURL- the friendlyURL for which to check availability- Returns:
- true if available, false otherwise
-
getFriendlyURLSet
Return a set of friendly urls associated with the given data- Parameters:
data- the data of which to retrieve friendly urls- Returns:
- a Set of String
-
getDataFromFriendlyURL
Return the data associated with the given friendly URL.- Parameters:
friendlyURL- the friendly URL to test- Returns:
- the associated Data or null.
-
updateFriendlyURLs
Add the friendly URL of the given publication.- Parameters:
pub- the publication- Since:
- jcms-10.0.0
-
updateFriendlyURLs
Add the friendly URL of the given category.- Parameters:
cat- the category- Since:
- jcms-10.0.0
-
addFriendlyURL
Add the given friendlyURLSet to the friendly urls of the servlet.
Check the friendly url is available.- Parameters:
data- the data associated with the friendly urlfriendlyURL- the friendly url- Returns:
- true if the friendlyURL was added or was already there, false otherwise.
-
removeDataFriendlyURL
Remove the given data and all its associated friendly url.- Parameters:
data- the data to remove from the servlet.- Returns:
- true if the data was removed, false if it was not there.
-
removeDataFriendlyURL
Remove the given data and all its associated friendly url.- Parameters:
dataId- the data id to remove from the servlet.- Returns:
- true if the data was removed, false if it was not there.
-
removeFriendlyURL
Remove the given friendly url.- Parameters:
friendlyURL- the friendly url to remove- Returns:
- true if the friendly url was removed, false if it was not there.
-
getFriendlyURLToDataMap
- Returns:
- a copy of the HashMap associating FriendlyURL with a Data
-
getDataToFriendlyURLSetMap
- Returns:
- a copy of the HashMap associating Data with a FriendlyURL Set
-