public interface PortalPolicyFilter extends PolicyFilter
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
REVISION |
Modifier and Type | Method and Description |
---|---|
Category |
checkCategory(Category workingCategory,
Member loggedMember)
Hook called by display.jsp to update the working category.
|
void |
checkCtxCategories(java.util.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.
|
java.lang.String |
checkPermalink(java.lang.String permalink,
Data data)
Deprecated.
|
java.lang.String |
checkPermalink(java.lang.String permalink,
Data data,
java.util.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.
|
java.lang.String |
checkRedirect(java.lang.String redirectUrl,
PortalRedirect redirect,
DisplayContext context,
Member loggedMember)
Hook called by display.jsp to update the redirect url of PortletRedirect.
|
void |
checkWorkingCategories(java.util.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(java.util.Map<java.lang.String,java.lang.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,
java.lang.String fieldName,
Data data,
boolean computedValue)
Returns an alternate value for the given boolean field and given Data.
|
java.util.TreeSet<Category> |
getCategoryFieldValue(JcmsJspContext ctxt,
java.lang.String fieldName,
Data data,
java.util.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.
|
java.lang.String |
getDescriptiveURLId(java.lang.String descriptiveUrl,
java.lang.String id)
Retrieve the Data to display from the specified descriptive URL.
|
java.lang.String |
getDescriptiveURLLanguage(java.lang.String descriptiveUrl,
java.lang.String lang)
Retrieve the language in which to display the Data from the specified descriptive URL.
|
java.lang.String |
getDescriptiveURLPath(Data data,
java.util.Locale locale)
Returns the path of the descriptive URL to use for the specified Data and Locale.
|
java.lang.String |
getDescriptiveURLText(java.lang.String descriptiveURLtext,
Data data,
java.util.Locale locale)
Returns the textual part of a descriptive URL built for the given Data.
|
double |
getDoubleFieldValue(JcmsJspContext ctxt,
java.lang.String fieldName,
Data data,
double computedValue)
Returns an alternate value for the given double field and given Data.
|
java.lang.Object |
getFieldValue(JcmsJspContext ctxt,
java.lang.String fieldName,
Data data,
java.lang.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,
java.lang.String fieldName,
Data data,
int computedValue)
Returns an alternate value for the given int field and given Data.
|
long |
getLongFieldValue(JcmsJspContext ctxt,
java.lang.String fieldName,
Data data,
long computedValue)
Returns an alternate value for the given long field and given Data.
|
void |
initHeaders(java.util.Map header,
java.lang.String key,
JcmsJspContext context)
Initialise header data to include in HTML headers
in the Front and Back Office.
|
void |
initJavaScriptCodeSet(java.util.Set<java.lang.String> jsCodeSet,
JcmsJspContext context)
Setup the javascript codes to be invoked on page load for current page.
|
void |
initJavaScriptSet(java.util.Set<java.lang.String> jsSet,
JcmsJspContext context)
Setup the javascript files to be included for current page.
|
void |
setupHeaders(java.util.Map header,
java.lang.String key,
JcmsJspContext context)
Setup header data to include in HTML headers
in the Front and Back Office.
|
init
static final java.lang.String REVISION
Category getHomeCategory(Category jcmsChoice, Member loggedMember)
PortalPolicyManager.getHomeCategory(Category, Member)
.jcmsChoice
- the jcms standard responseloggedMember
- the logged memberPortalInterface getDefaultPortal(PortalInterface jcmsChoice, Member loggedMember)
PortalPolicyManager.getDefaultPortal(PortalInterface, Member)
.jcmsChoice
- the jcms standard responseloggedMember
- the logged membervoid filterDisplayContext(PortalManager.DisplayContextParameters dcp)
dcp
- PortalManager.DisplayContextParametersCategory checkCategory(Category workingCategory, Member loggedMember)
workingCategory
- the previous computed categoryloggedMember
- the logged memberPublication checkPublication(Publication workingPublication, Member loggedMember, boolean isPreview)
workingPublication
- the previous computed publicationloggedMember
- the logged memberisPreview
- boolean indicate preview modevoid checkCtxCategories(java.util.List ctxCategories)
ctxCategories
- the previous computed ctx categoriesPortalManager.getCtxCategories(HttpServletRequest)
boolean checkPortal(PortalInterface portal, Publication pub, DisplayContext context, Member loggedMember, boolean skipRedirect, boolean skipExact, boolean modePreview, boolean jcmsChoice)
PortalManager
to decide if the given portal may be used to display information.It is called:
Hook:
- since JCMS-7812, iterated category can be retrieved using:
Category itCat = request.getAttribute(PortalManager.CHECK_PORTAL_CATEGORY_ATTR)
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 responsePortalManager.checkPortal(Category, DisplayContext, Member, boolean, boolean)
void checkWorkingCategories(java.util.List workingCategories, Publication pub, Member loggedMember, boolean skipRedirect, boolean skipExact, boolean modePreview, Category[] ctxCategories)
pub
- the current publicationworkingCategories
- a sorted list of starting categories to work withloggedMember
- 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 parametersPortalManager.findPortal(Publication, DisplayContext, Member, boolean, boolean, boolean, Category[])
void checkDisplay(DisplayContext context, Category cat, Member loggedMember)
context
- the computed datacat
- the requested categoryloggedMember
- the current logged membervoid checkDisplay(DisplayContext context, Publication pub, Member loggedMember)
context
- the computed datapub
- the requested publicationloggedMember
- the current logged membervoid checkDisplay(DisplayContext context, Member member, Category home, Member loggedMember)
context
- the computed datamember
- the requested memberhome
- the home category used in redirect urlloggedMember
- the current logged memberWorkspace checkWorkspace(DisplayContext context, Workspace workspace, Member loggedMember)
context
- the computed dataworkspace
- The workspaceloggedMember
- the logged membervoid checkDisplayContext(DisplayContext context)
context
- the computed context or null if forbiddenjava.lang.String checkRedirect(java.lang.String redirectUrl, PortalRedirect redirect, DisplayContext context, Member loggedMember)
redirectUrl
- The redirect urlredirect
- the PortalRedirectcontext
- the computed historyloggedMember
- the logged memberjava.lang.String checkPermalink(java.lang.String permalink, Data data)
checkPermalink(String, Data, Locale)
permalink
- the computed permanent linkdata
- the working datajava.lang.String checkPermalink(java.lang.String permalink, Data data, java.util.Locale userLocale)
permalink
- the computed permanent linkdata
- the working datajava.lang.String getDescriptiveURLText(java.lang.String descriptiveURLtext, Data data, java.util.Locale locale)
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 textdata
- the Data
for which the URL is built.descriptiveURLtext
- null or a custom descriptive urllocale
- the Locale
to use I18N and localized operationjava.lang.String getDescriptiveURLPath(Data data, java.util.Locale locale)
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 getDescriptiveURLId(String, String)
at the same time.
Instead of implementing this method, the easiest way to modify descriptive URL is
to implement getDescriptiveURLText(String, Data, Locale)
in order to change the textual part of the descriptive URL and let JCMS perform all the rest.
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
.java.lang.String getDescriptiveURLId(java.lang.String descriptiveUrl, java.lang.String id)
You only need to implement this method if you have modified getDescriptiveURLPath(Data, Locale)
.
descriptiveUrl
- 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 getDescriptiveURLPath(Data, Locale)
id
- the ID already computed by JCMS (or null if none was found)java.lang.String getDescriptiveURLLanguage(java.lang.String descriptiveUrl, java.lang.String lang)
You only need to implement this method if you have modified getDescriptiveURLPath(Data, Locale)
.
descriptiveUrl
- 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 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()
void fillDescriptiveURLParameterMap(java.util.Map<java.lang.String,java.lang.String> paramMap, Data data)
paramMap
- the parameter mapdata
- the Data
for which the URL is built, might be null.java.lang.Object getFieldValue(JcmsJspContext ctxt, java.lang.String fieldName, Data data, java.lang.Object computedValue)
Data.getFieldValue(String)
ctxt
- the JCmsJspContextfieldName
- the name of the called fielddata
- the Data object to work withcomputedValue
- the already computed value (using extra data)int getIntFieldValue(JcmsJspContext ctxt, java.lang.String fieldName, Data data, int computedValue)
Data.getIntFieldValue(String)
ctxt
- the JCmsJspContextfieldName
- the name of the called fielddata
- the Data object to work withcomputedValue
- the already computed value (using extra data)long getLongFieldValue(JcmsJspContext ctxt, java.lang.String fieldName, Data data, long computedValue)
Data.getLongFieldValue(String)
ctxt
- the JCmsJspContextfieldName
- the name of the called fielddata
- the Data object to work withcomputedValue
- the already computed value (using extra data)double getDoubleFieldValue(JcmsJspContext ctxt, java.lang.String fieldName, Data data, double computedValue)
Data.getDoubleFieldValue(String)
ctxt
- the JCmsJspContextfieldName
- the name of the called fielddata
- the Data object to work withcomputedValue
- the already computed value (using extra data)boolean getBooleanFieldValue(JcmsJspContext ctxt, java.lang.String fieldName, Data data, boolean computedValue)
Data.getBooleanFieldValue(String)
ctxt
- the JCmsJspContextfieldName
- the name of the called fielddata
- the Data object to work withcomputedValue
- the already computed value (using extra data)java.util.TreeSet<Category> getCategoryFieldValue(JcmsJspContext ctxt, java.lang.String fieldName, Data data, java.util.TreeSet<Category> computedValue)
Data.getCategoryFieldValue(String, Member)
ctxt
- the JCmsJspContextfieldName
- the name of the called fielddata
- the Data object to work withcomputedValue
- the already computed value (using extra data)void initHeaders(java.util.Map header, java.lang.String key, JcmsJspContext context)
header
- the jcms Map headerkey
- the topic key (for javascript, css, ...)context
- the calling JcmsJspContextvoid setupHeaders(java.util.Map header, java.lang.String key, JcmsJspContext context)
header
- the jcms Map headerkey
- the topic key (for javascript, css, ...)context
- the calling JcmsJspContextvoid initJavaScriptSet(java.util.Set<java.lang.String> jsSet, JcmsJspContext context)
jsSet
- a set of relative file path (e.g. "js/custom/myfile.js")context
- the calling JcmsJspContextvoid initJavaScriptCodeSet(java.util.Set<java.lang.String> jsCodeSet, JcmsJspContext context)
jsCodeSet
- a set of javascript code (e.g. "if (true) { alert('page loaded'); }")context
- the calling JcmsJspContextCopyright © 2001-2021 Jalios SA. All Rights Reserved.