|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jalios.jcms.servlet.JcmsServletFilter com.jalios.jcms.servlet.FriendlyURLFilter
public class FriendlyURLFilter
This filter allow Friendly URLs to be used to access JCMS data. It filter every request and look for the matching url to redirect to the associated Data.
Field Summary | |
---|---|
static String |
REVISION
|
Constructor Summary | |
---|---|
FriendlyURLFilter()
|
Method Summary | |
---|---|
static boolean |
addFriendlyURL(Data data,
String friendlyURL)
Add the given friendlyURLSet to the friendly urls of the servlet. |
static String |
buildCleanURL(String str)
Method to clean the given string to have a proper URL. Convert to CamelCase (keeping '/' separator) |
void |
destroy()
|
void |
doFilter(javax.servlet.ServletRequest req,
javax.servlet.ServletResponse res,
javax.servlet.FilterChain chain)
The main filter method. |
static String |
generateFriendlyURL(Category cat,
String lang)
Build and return a friendly url that can be added later to the friendly urls Servlet Filter. |
static String |
generateFriendlyURL(Publication pub,
String lang)
Build and return a friendly url that can be added later to the friendly urls Servlet Filter. |
static Data |
getDataFromFriendlyURL(String friendlyURL)
Return the data associated with the given friendly URL. |
static HashMap |
getDataToFriendlyURLSetMap()
|
static TreeSet |
getFriendlyURLSet(Data data)
Return a set of friendly urls associated with the given data |
static HashMap |
getFriendlyURLToDataMap()
|
static FriendlyURLFilter |
getInstance()
|
void |
init(javax.servlet.FilterConfig config)
|
static void |
initAfterLoad()
This method is called after the loading of the store (therefore after all specificied Data's FriendlyURL have been updated in this servlet) to generate FriendlyURL for the remaining Datas. |
static boolean |
isFriendlyURLAvailable(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 data |
boolean |
isFriendlyURLAvailable(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. |
boolean |
isFriendlyURLValid(String friendlyURL)
Check if the given friendly url is valid. |
static boolean |
removeDataFriendlyURL(Data data)
Remove the given data and all its associated friendly url. |
static boolean |
removeFriendlyURL(String friendlyURL)
Remove the given friendly url. |
Methods inherited from class com.jalios.jcms.servlet.JcmsServletFilter |
---|
endFilter, initJSONBridge, processFilter |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String REVISION
Constructor Detail |
---|
public FriendlyURLFilter()
Method Detail |
---|
public void doFilter(javax.servlet.ServletRequest req, javax.servlet.ServletResponse res, javax.servlet.FilterChain chain) throws IOException, javax.servlet.ServletException
doFilter
in interface javax.servlet.Filter
IOException
javax.servlet.ServletException
public static String generateFriendlyURL(Category cat, String lang)
cat
- the Category to build a url forlang
- the lang in which to build a url
public static String generateFriendlyURL(Publication pub, String lang)
pub
- the Publication to build a url forlang
- the lang in which to build a url
public static String buildCleanURL(String str)
str
- the string to clean
public boolean isFriendlyURLAvailable(String id, String friendlyURL)
id
- the id of the data associated with the friendly urlfriendlyURL
- the friendlyURL for which to check availability
public boolean isFriendlyURLValid(String friendlyURL)
friendlyURL
- the friendly url to check
public static boolean isFriendlyURLAvailable(Data data, String friendlyURL)
data
- the data associated with the friendly urlfriendlyURL
- the friendlyURL for which to check availability
public static TreeSet getFriendlyURLSet(Data data)
data
- the data of which to retrieve friendly urls
public static Data getDataFromFriendlyURL(String friendlyURL)
friendlyURL
- the friendly URL to test
public static boolean addFriendlyURL(Data data, String friendlyURL)
data
- the data associated with the friendly urlfriendlyURL
- the friendly url
public static boolean removeDataFriendlyURL(Data data)
data
- the data to remove from the servlet.
public static boolean removeFriendlyURL(String friendlyURL)
friendlyURL
- the friendly url to remove
public static HashMap getFriendlyURLToDataMap()
public static HashMap getDataToFriendlyURLSetMap()
public void init(javax.servlet.FilterConfig config)
init
in interface javax.servlet.Filter
public void destroy()
destroy
in interface javax.servlet.Filter
public static FriendlyURLFilter getInstance()
public static void initAfterLoad()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |