|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jalios.jcms.policy.AbstractPolicyFilter
com.jalios.jcms.policy.BasicPortalPolicyFilter
public class BasicPortalPolicyFilter
PortalPolicyFilter
,
PortalPolicyFilter
Field Summary | |
---|---|
static String |
REVISION
|
Fields inherited from class com.jalios.jcms.policy.AbstractPolicyFilter |
---|
order |
Constructor Summary | |
---|---|
BasicPortalPolicyFilter()
|
Method Summary | |
---|---|
Category |
checkCategory(Category workingCategory,
Member loggedMember)
Hook called by display.jsp to update the working category. |
void |
checkCtxCategories(List ctxCategories)
Hook called by doInitPortal.jsp to update the contextual category list. |
void |
checkDisplay(DisplayContext context,
Category cat,
Member loggedMember)
Hook called by getDisplayContext() to update the content of context. |
void |
checkDisplay(DisplayContext context,
Member member,
Category home,
Member loggedMember)
Hook called by getDisplayContext() to update the content of context. |
void |
checkDisplay(DisplayContext context,
Publication pub,
Member loggedMember)
Hook called by getDisplayContext() to update the content of context. |
void |
checkDisplayContext(DisplayContext context)
Hook called by display.jsp to create the display context if it is null otherwise sendForbidden. |
String |
checkPermalink(String permalink,
Data data)
Deprecated. use checkPermalink(String, Data, Locale) |
String |
checkPermalink(String permalink,
Data data,
Locale userLocale)
Hook called by PortalManager.getPermalink() to update the way to render permalinks |
boolean |
checkPortal(PortalInterface portal,
Publication pub,
DisplayContext context,
Member loggedMember,
boolean skipRedirect,
boolean skipExact,
boolean modePreview,
boolean jcmsChoice)
Hook called by PortalManager to decide if the given portal may be used to display information. |
Publication |
checkPublication(Publication workingPublication,
Member loggedMember,
boolean isPreview)
Hook called by display.jsp to update the working publication. |
String |
checkRedirect(String redirectUrl,
PortalRedirect redirect,
DisplayContext context,
Member loggedMember)
Hook called by display.jsp to update the redirect url of PortletRedirect. |
void |
checkWorkingCategories(List workingCategories,
Publication pub,
Member loggedMember,
boolean skipRedirect,
boolean skipExact,
boolean modePreview,
Category[] ctxCategories)
Hook called by PortalManager to change the order between categories of a given publication. |
Workspace |
checkWorkspace(DisplayContext context,
Workspace workspace,
Member loggedMember)
Hook called by handleDisplayRequest() (in display.jsp) to update the working worskpace. |
void |
fillDescriptiveURLParameterMap(Map<String,String> paramMap,
Data data)
Fill the given map with custom parameters to be added to the descriptive URL |
void |
filterDisplayContext(PortalManager.DisplayContextParameters dcp)
Hook called by PortalManager to compute display context parameters. |
boolean |
getBooleanFieldValue(JcmsJspContext ctxt,
String fieldName,
Data data,
boolean computedValue)
Returns an alternate value for the given boolean field and given Data. |
TreeSet<Category> |
getCategoryFieldValue(JcmsJspContext ctxt,
String fieldName,
Data data,
TreeSet<Category> computedValue)
Returns an alternate value for the given Category field and given Data. |
PortalInterface |
getDefaultPortal(PortalInterface jcmsChoice,
Member loggedMember)
Hook called by PortalManager to compute the default PortalInterface of the given logged Member. |
String |
getDescriptiveURLId(String descriptiveUrlPath,
String id)
Retrieve the Data to display from the specified descriptive URL. |
String |
getDescriptiveURLLanguage(String descriptiveUrlPath,
String lang)
Retrieve the language in which to display the Data from the specified descriptive URL. |
String |
getDescriptiveURLPath(Data data,
Locale locale)
Returns the path of the descriptive URL to use for the specified Data and Locale. |
String |
getDescriptiveURLText(String descriptiveURLtext,
Data data,
Locale locale)
Returns the textual part of a descriptive URL built for the given Data. |
double |
getDoubleFieldValue(JcmsJspContext ctxt,
String fieldName,
Data data,
double computedValue)
Returns an alternate value for the given double field and given Data. |
Object |
getFieldValue(JcmsJspContext ctxt,
String fieldName,
Data data,
Object computedValue)
Returns an alternate value for the given field and given Data. |
Category |
getHomeCategory(Category jcmsChoice,
Member loggedMember)
Hook called by PortalManager to compute the home Category of the given logged Member. |
int |
getIntFieldValue(JcmsJspContext ctxt,
String fieldName,
Data data,
int computedValue)
Returns an alternate value for the given int field and given Data. |
long |
getLongFieldValue(JcmsJspContext ctxt,
String fieldName,
Data data,
long computedValue)
Returns an alternate value for the given long field and given Data. |
boolean |
init(Plugin plugin)
Initialize the component with the given plugin configuration |
void |
initHeaders(Map header,
String key,
JcmsJspContext context)
Initialise header data to include in HTML headers in the Front and Back Office. |
void |
initJavaScriptCodeSet(Set<String> jsCodeSet,
JcmsJspContext context)
Setup the javascript codes to be invoked on page load for current page. |
void |
initJavaScriptSet(Set<String> jsSet,
JcmsJspContext context)
Setup the javascript files to be included for current page. |
void |
setupHeaders(Map header,
String key,
JcmsJspContext context)
Setup header data to include in HTML headers in the Front and Back Office. |
Methods inherited from class com.jalios.jcms.policy.AbstractPolicyFilter |
---|
compareTo, equals, getOrder, setOrder |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.lang.Comparable |
---|
compareTo |
Field Detail |
---|
public static final String REVISION
Constructor Detail |
---|
public BasicPortalPolicyFilter()
Method Detail |
---|
public boolean init(Plugin plugin)
PluginComponent
init
in interface PluginComponent
plugin
- the calling plugin
PluginComponent.init(Plugin)
public Category getHomeCategory(Category jcmsChoice, Member loggedMember)
PortalPolicyFilter
PolicyManager.getHomeCategory(Category, Member)
.
getHomeCategory
in interface PortalPolicyFilter
jcmsChoice
- the jcms standard responseloggedMember
- the logged member
PortalPolicyFilter.getHomeCategory(com.jalios.jcms.Category, com.jalios.jcms.Member)
public PortalInterface getDefaultPortal(PortalInterface jcmsChoice, Member loggedMember)
PortalPolicyFilter
PolicyManager.getDefaultPortal(PortalInterface, Member)
.
getDefaultPortal
in interface PortalPolicyFilter
jcmsChoice
- the jcms standard responseloggedMember
- the logged member
PortalPolicyFilter.getDefaultPortal(com.jalios.jcms.portlet.PortalInterface, com.jalios.jcms.Member)
public void filterDisplayContext(PortalManager.DisplayContextParameters dcp)
PortalPolicyFilter
filterDisplayContext
in interface PortalPolicyFilter
dcp
- PortalManager.DisplayContextParametersPortalPolicyFilter.filterDisplayContext(com.jalios.jcms.portlet.PortalManager.DisplayContextParameters)
public Category checkCategory(Category workingCategory, Member loggedMember)
PortalPolicyFilter
checkCategory
in interface PortalPolicyFilter
workingCategory
- the previous computed categoryloggedMember
- the logged member
PortalPolicyFilter.checkCategory(Category, Member)
public Publication checkPublication(Publication workingPublication, Member loggedMember, boolean isPreview)
PortalPolicyFilter
checkPublication
in interface PortalPolicyFilter
workingPublication
- the previous computed publicationloggedMember
- the logged memberisPreview
- boolean indicate preview mode
PortalPolicyFilter.checkPublication(Publication, Member, boolean)
public void checkCtxCategories(List ctxCategories)
PortalPolicyFilter
checkCtxCategories
in interface PortalPolicyFilter
ctxCategories
- the previous computed ctx categoriesPortalPolicyFilter.checkCtxCategories(List)
public boolean checkPortal(PortalInterface portal, Publication pub, DisplayContext context, Member loggedMember, boolean skipRedirect, boolean skipExact, boolean modePreview, boolean jcmsChoice)
PortalPolicyFilter
checkPortal
in interface PortalPolicyFilter
portal
- the portal to checkpub
- the current publication if we work on a publicationcontext
- the display contextloggedMember
- the logged memberskipRedirect
- true for display portal, false for display or redirect portalskipExact
- true no to check "exact" featuremodePreview
- is preview mode activatedjcmsChoice
- the jcms standard response
PortalPolicyFilter.checkPortal(PortalInterface, Publication, DisplayContext, Member, boolean, boolean, boolean, boolean)
public void checkWorkingCategories(List workingCategories, Publication pub, Member loggedMember, boolean skipRedirect, boolean skipExact, boolean modePreview, Category[] ctxCategories)
PortalPolicyFilter
checkWorkingCategories
in interface PortalPolicyFilter
workingCategories
- a sorted list of starting categories to work withpub
- the current publicationloggedMember
- the logged memberskipRedirect
- true for display portal, false for display or redirect portalskipExact
- true no to check "exact" featuremodePreview
- is preview mode activatedctxCategories
- the contextual categories in request parametersPortalPolicyFilter.checkWorkingCategories(List, Publication, Member, boolean, boolean, boolean, Category[])
public void checkDisplay(DisplayContext context, Category cat, Member loggedMember)
PortalPolicyFilter
checkDisplay
in interface PortalPolicyFilter
context
- the computed datacat
- the requested categoryloggedMember
- the current logged memberPortalPolicyFilter.checkDisplay(DisplayContext, Category, Member)
public void checkDisplay(DisplayContext context, Publication pub, Member loggedMember)
PortalPolicyFilter
checkDisplay
in interface PortalPolicyFilter
context
- the computed datapub
- the requested publicationloggedMember
- the current logged memberPortalPolicyFilter.checkDisplay(DisplayContext, Publication, Member)
public void checkDisplay(DisplayContext context, Member member, Category home, Member loggedMember)
PortalPolicyFilter
checkDisplay
in interface PortalPolicyFilter
context
- the computed datamember
- the requested memberhome
- the home category used in redirect urlloggedMember
- the current logged memberPortalPolicyFilter.checkDisplay(DisplayContext, Member, Category, Member)
public Workspace checkWorkspace(DisplayContext context, Workspace workspace, Member loggedMember)
PortalPolicyFilter
checkWorkspace
in interface PortalPolicyFilter
context
- the computed dataworkspace
- The workspaceloggedMember
- the logged member
PortalPolicyFilter.checkWorkspace(DisplayContext, Workspace, Member)
public void checkDisplayContext(DisplayContext context)
PortalPolicyFilter
checkDisplayContext
in interface PortalPolicyFilter
context
- the computed context or null if forbiddenPortalPolicyFilter.checkDisplayContext(DisplayContext)
public String checkRedirect(String redirectUrl, PortalRedirect redirect, DisplayContext context, Member loggedMember)
PortalPolicyFilter
checkRedirect
in interface PortalPolicyFilter
redirectUrl
- The redirect urlredirect
- the PortalRedirectcontext
- the computed historyloggedMember
- the logged member
PortalPolicyFilter.checkRedirect(String, PortalRedirect, DisplayContext, Member)
public String checkPermalink(String permalink, Data data)
checkPermalink(String, Data, Locale)
PortalPolicyFilter
checkPermalink
in interface PortalPolicyFilter
permalink
- the computed permanent linkdata
- the working data
public String checkPermalink(String permalink, Data data, Locale userLocale)
PortalPolicyFilter
checkPermalink
in interface PortalPolicyFilter
permalink
- the computed permanent linkdata
- the working data
PortalPolicyFilter.checkPermalink(String, Data, Locale)
public String getDescriptiveURLText(String descriptiveURLtext, Data data, Locale locale)
PortalPolicyFilter
descriptive-urls.text.enabled
is set to "true".
The given descriptiveURLtext is null or represents a custom descriptiveURLtext.
If the methods returns null then compute the default descriptive URL text
getDescriptiveURLText
in interface PortalPolicyFilter
descriptiveURLtext
- null or a custom descriptive urldata
- the Data
for which the URL is built.locale
- the Locale
to use I18N and localized operation
PortalPolicyFilter.getDescriptiveURLText(String, Data, Locale)
public String getDescriptiveURLPath(Data data, Locale locale)
PortalPolicyFilter
IMPORTANT : This method is provided for extreme customization of
the descriptive URL, but it might break internal features if not modified properly.
Ensure to implement method PortalPolicyFilter.getDescriptiveURLId(String, String)
at the same time.
Instead of implementing this method, the easiest way to modify descriptive URL is
to implement PortalPolicyFilter.getDescriptiveURLText(String, Data, Locale)
in order to change the textual part of the descriptive URL and let JCMS perform all the rest.
getDescriptiveURLPath
in interface PortalPolicyFilter
data
- the Data
for which the URL is built, might be null.locale
- the Locale
to use I18N and localized operation
/jcms/
)
and without '/' at begining, for example my-unique-data-title
Return null if you want to let JCMS generate it, eg : id/my-data-title
.PortalPolicyFilter.getDescriptiveURLPath(Data, Locale)
public String getDescriptiveURLId(String descriptiveUrlPath, String id)
PortalPolicyFilter
You only need to implement this method if you have modified PortalPolicyFilter.getDescriptiveURLPath(Data, Locale)
.
getDescriptiveURLId
in interface PortalPolicyFilter
descriptiveUrlPath
- a descriptive URL such as /jcms/id_42/some-text
or
anything starting with the DisplayServlet root mapping (usually /jcms/
) and
followed by value computed through PortalPolicyFilter.getDescriptiveURLPath(Data, Locale)
id
- the ID already computed by JCMS (or null if none was found)
PortalPolicyFilter.getDescriptiveURLId(String, String)
public String getDescriptiveURLLanguage(String descriptiveUrlPath, String lang)
PortalPolicyFilter
You only need to implement this method if you have modified PortalPolicyFilter.getDescriptiveURLPath(Data, Locale)
.
getDescriptiveURLLanguage
in interface PortalPolicyFilter
descriptiveUrlPath
- a descriptive URL such as /jcms/id_42/en/some-text
or
anything starting with the DisplayServlet root mapping (usually /jcms/
) and
followed by value computed through PortalPolicyFilter.getDescriptiveURLPath(Data, Locale)
lang
- the language already computed by JCMS (or null if none was found in the path, in which case default user language is used)
Channel.getLanguageList()
PortalPolicyFilter.getDescriptiveURLLanguage(String, String)
public void fillDescriptiveURLParameterMap(Map<String,String> paramMap, Data data)
PortalPolicyFilter
fillDescriptiveURLParameterMap
in interface PortalPolicyFilter
paramMap
- the parameter mapdata
- the Data
for which the URL is built, might be null.PortalPolicyFilter.fillDescriptiveURLParameterMap(Map, Data)
public Object getFieldValue(JcmsJspContext ctxt, String fieldName, Data data, Object computedValue)
PortalPolicyFilter
Data.getFieldValue(String)
getFieldValue
in interface PortalPolicyFilter
ctxt
- the JCmsJspContextfieldName
- the name of the called fielddata
- the Data object to work withcomputedValue
- the already computed value (using extra data)
PortalPolicyFilter.getFieldValue(JcmsJspContext, String, Data, Object)
public int getIntFieldValue(JcmsJspContext ctxt, String fieldName, Data data, int computedValue)
PortalPolicyFilter
Data.getIntFieldValue(String)
getIntFieldValue
in interface PortalPolicyFilter
ctxt
- the JCmsJspContextfieldName
- the name of the called fielddata
- the Data object to work withcomputedValue
- the already computed value (using extra data)
PortalPolicyFilter.getIntFieldValue(JcmsJspContext, String, Data, int)
public long getLongFieldValue(JcmsJspContext ctxt, String fieldName, Data data, long computedValue)
PortalPolicyFilter
Data.getLongFieldValue(String)
getLongFieldValue
in interface PortalPolicyFilter
ctxt
- the JCmsJspContextfieldName
- the name of the called fielddata
- the Data object to work withcomputedValue
- the already computed value (using extra data)
PortalPolicyFilter.getLongFieldValue(JcmsJspContext, String, Data, long)
public double getDoubleFieldValue(JcmsJspContext ctxt, String fieldName, Data data, double computedValue)
PortalPolicyFilter
Data.getDoubleFieldValue(String)
getDoubleFieldValue
in interface PortalPolicyFilter
ctxt
- the JCmsJspContextfieldName
- the name of the called fielddata
- the Data object to work withcomputedValue
- the already computed value (using extra data)
PortalPolicyFilter.getDoubleFieldValue(JcmsJspContext, String, Data, double)
public boolean getBooleanFieldValue(JcmsJspContext ctxt, String fieldName, Data data, boolean computedValue)
PortalPolicyFilter
Data.getBooleanFieldValue(String)
getBooleanFieldValue
in interface PortalPolicyFilter
ctxt
- the JCmsJspContextfieldName
- the name of the called fielddata
- the Data object to work withcomputedValue
- the already computed value (using extra data)
PortalPolicyFilter.getBooleanFieldValue(JcmsJspContext, String, Data, boolean)
public TreeSet<Category> getCategoryFieldValue(JcmsJspContext ctxt, String fieldName, Data data, TreeSet<Category> computedValue)
PortalPolicyFilter
Data.getCategoryFieldValue(String, Member)
getCategoryFieldValue
in interface PortalPolicyFilter
ctxt
- the JCmsJspContextfieldName
- the name of the called fielddata
- the Data object to work withcomputedValue
- the already computed value (using extra data)
PortalPolicyFilter.getCategoryFieldValue(JcmsJspContext, String, Data, TreeSet)
public void initHeaders(Map header, String key, JcmsJspContext context)
PortalPolicyFilter
initHeaders
in interface PortalPolicyFilter
header
- the jcms Map headerkey
- the topic key (for javascript, css, ...)context
- the calling JcmsJspContextPortalPolicyFilter.initHeaders(Map, String, JcmsJspContext)
public void setupHeaders(Map header, String key, JcmsJspContext context)
PortalPolicyFilter
setupHeaders
in interface PortalPolicyFilter
header
- the jcms Map headerkey
- the topic key (for javascript, css, ...)context
- the calling JcmsJspContextPortalPolicyFilter.setupHeaders(Map, String, JcmsJspContext)
public void initJavaScriptSet(Set<String> jsSet, JcmsJspContext context)
PortalPolicyFilter
initJavaScriptSet
in interface PortalPolicyFilter
jsSet
- a set of relative file path (e.g. "js/custom/myfile.js")context
- the calling JcmsJspContextPortalPolicyFilter.initJavaScriptSet(Set, JcmsJspContext)
public void initJavaScriptCodeSet(Set<String> jsCodeSet, JcmsJspContext context)
PortalPolicyFilter
initJavaScriptCodeSet
in interface PortalPolicyFilter
jsCodeSet
- a set of javascript code (e.g. "if (true) { alert('page loaded'); }")context
- the calling JcmsJspContextPortalPolicyFilter.initJavaScriptCodeSet(Set, JcmsJspContext)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |