Package com.jalios.jcms.profiling
Class ProfilingManager
java.lang.Object
com.jalios.jcms.profiling.ProfilingManager
- All Implemented Interfaces:
JPropertiesListener
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFirstStepProfileFilter(QueryHandler qh, Map context) This method is aimed to apply a first filter on Content instances to display.addSecondStepProfileFilter(QueryResultSet set, Map context) This method is aimed to apply a second filter on Content instances to display.booleancanUpdateMbrProfilingCategories(Member author, Member mbr) Checks if the logged member can update the profiling categories of the given member.getCategoryAxis(Category cat, Set<Category> axes) The purpose of this method is to get the axis (among the given axes) of a given category.getCommonCategories(Set<Category> catSet, Category axis) The aim of this method is to retain only the categories of the given axis in the categories provided.static ProfilingManagerThe purpose of this method is to return the member's chosen categories on his ESN profile.The purpose of this method is to return the member's profiling categories, inherited from his groups.getMemberProfilingUnexactCategories(Member mbr, Set<Category> axes) The purpose of this method is to return the member's chosen categories on his ESN profile.This method is aimed to return the profiling axes defined in property.Returns a string representation of the ancestor of this category (until the axis).booleanThis method is aimed to return the value (boolean) of the property indicating whether if we can categorize a content without selecting a profiling category from each profiling axis.booleanThe purpose of this method is to check whether a given category belongs to the “profiling” scope (profiling axis or as a descending category).booleanbooleanprofileFilter(Publication pub, Map context) This method is aimed to apply a second filter on Content instances to display.voidpropertiesChange(JProperties properties) Invoked after properties have been modified in JCMS and save on disk.voidsaveMemberProfilingCategories(Member author, Member mbr, String[] cids) The purpose of this method is to save profiling category ids for a given member, usingMemberPreference.boolean
-
Field Details
-
MEMBER_PROFILING_CATEGORIES
- See Also:
-
PROFILING_AXES_PROP
- See Also:
-
ALL_AXES_REQUIRED
- See Also:
-
SCORING_ENABLED_PROP
- See Also:
-
-
Method Details
-
getInstance
-
propertiesChange
Description copied from interface:JPropertiesListenerInvoked after properties have been modified in JCMS and save on disk.You cannot alter the value received in parameters.
Note that properties parameter may be null, a limited set of site properties, or all site properties.
To check that a property has been modified, reload the "current" property instead using
channel.getPropertiesorchannel.getProperty.- Specified by:
propertiesChangein interfaceJPropertiesListener- Parameters:
properties- the properties which have been submitted to change
-
reloadConfiguration
public void reloadConfiguration() -
isProfilingEnabled
public boolean isProfilingEnabled()- Returns:
- true if profiling axes have been declared.
-
addFirstStepProfileFilter
This method is aimed to apply a first filter on Content instances to display. Here, we determine the axis with less categories involving the member. Then, we add those categories to the query handler to have the partially filtered results.- Parameters:
qh- theQueryHandlercontext- the map containing useful informations
-
addSecondStepProfileFilter
This method is aimed to apply a second filter on Content instances to display. Here, we iterate on the other axis to apply filter with their respective categories, if they are common with the member's profile.- Parameters:
set- theQueryResultSetto filtercontext- the map containing useful informations- Returns:
- the given set
-
profileFilter
This method is aimed to apply a second filter on Content instances to display. Here, we iterate on the other axis to filter with their respective categories, if they are common with the member's profile.- Parameters:
pub- thePublicationto filtercontext- the map containing useful informations- Returns:
- true if the result must be kept and false if it must be ignored.
-
getProfilingAxes
This method is aimed to return the profiling axes defined in property.- Returns:
- A new Set containing copies of the profiling axes. Modifications to the returned set will not affect the original profilingAxes field.
-
isAllAxesRequired
public boolean isAllAxesRequired()This method is aimed to return the value (boolean) of the property indicating whether if we can categorize a content without selecting a profiling category from each profiling axis.- Returns:
- a boolean
- Since:
- 10.0.9 / JCMS-11229
-
getMemberProfilingUnexactCategories
The purpose of this method is to return the member's chosen categories on his ESN profile. It will also include all the descending and ascending categories of each category.- Parameters:
mbr- the member for whom we do the searchaxes- the profiling axes- Returns:
- the profiling categories of the member
-
getMemberChosenProfilingCategories
The purpose of this method is to return the member's chosen categories on his ESN profile.- Parameters:
mbr- the member for whom we do the search- Returns:
- the profiling categories of the member
-
getMemberProfilingCategoriesFromGroups
The purpose of this method is to return the member's profiling categories, inherited from his groups.- Parameters:
mbr- the member for whom we do the search- Returns:
- the profiling categories of the member
-
saveMemberProfilingCategories
The purpose of this method is to save profiling category ids for a given member, usingMemberPreference.- Parameters:
author- the author of the operationmbr- the member for whom we do savecids- the category ids to save- Returns:
ControllerStatus
-
canUpdateMbrProfilingCategories
Checks if the logged member can update the profiling categories of the given member.- Parameters:
author- the potential author of the updatembr- the potential member for whom we edit the categories- Returns:
- boolean
-
getCategoryAxis
The purpose of this method is to get the axis (among the given axes) of a given category.- Parameters:
cat- the cat for which we want to retrieve the axisaxes- the axes- Returns:
- the axis
-
getCommonCategories
The aim of this method is to retain only the categories of the given axis in the categories provided.- Parameters:
catSet- the initial set of categoriesaxis- the axis- Returns:
- the common categories
-
showRefineWithProfilingCategories
public boolean showRefineWithProfilingCategories() -
isProfilingCategory
The purpose of this method is to check whether a given category belongs to the “profiling” scope (profiling axis or as a descending category).- Parameters:
cat- the cat for which we do the check- Returns:
- a boolean
-
getProfilingCategoryAncestorString
Returns a string representation of the ancestor of this category (until the axis).- Parameters:
cat- the category- Returns:
- a String containing the ancestors concatenation.
-