Class ProfilingManager

java.lang.Object
com.jalios.jcms.profiling.ProfilingManager
All Implemented Interfaces:
JPropertiesListener

public class ProfilingManager extends Object implements JPropertiesListener
  • Field Details

  • Method Details

    • getInstance

      public static ProfilingManager getInstance()
    • propertiesChange

      public void propertiesChange(JProperties properties)
      Description copied from interface: JPropertiesListener
      Invoked 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.getProperties or channel.getProperty.

      Specified by:
      propertiesChange in interface JPropertiesListener
      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

      public void addFirstStepProfileFilter(QueryHandler qh, Map context)
      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 - the QueryHandler
      context - the map containing useful informations
    • addSecondStepProfileFilter

      public QueryResultSet addSecondStepProfileFilter(QueryResultSet set, Map context)
      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 - the QueryResultSet to filter
      context - the map containing useful informations
      Returns:
      the given set
    • profileFilter

      public boolean profileFilter(Publication pub, Map context)
      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 - the Publication to filter
      context - the map containing useful informations
      Returns:
      true if the result must be kept and false if it must be ignored.
    • getProfilingAxes

      public Set<Category> 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

      public Set<Category> getMemberProfilingUnexactCategories(Member mbr, Set<Category> axes)
      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 search
      axes - the profiling axes
      Returns:
      the profiling categories of the member
    • getMemberChosenProfilingCategories

      public Set<Category> getMemberChosenProfilingCategories(Member mbr)
      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

      public Set<Category> getMemberProfilingCategoriesFromGroups(Member mbr)
      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

      public ControllerStatus saveMemberProfilingCategories(Member author, Member mbr, String[] cids)
      The purpose of this method is to save profiling category ids for a given member, using MemberPreference.
      Parameters:
      author - the author of the operation
      mbr - the member for whom we do save
      cids - the category ids to save
      Returns:
      ControllerStatus
    • canUpdateMbrProfilingCategories

      public boolean canUpdateMbrProfilingCategories(Member author, Member mbr)
      Checks if the logged member can update the profiling categories of the given member.
      Parameters:
      author - the potential author of the update
      mbr - the potential member for whom we edit the categories
      Returns:
      boolean
    • getCategoryAxis

      public Category getCategoryAxis(Category cat, Set<Category> axes)
      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 axis
      axes - the axes
      Returns:
      the axis
    • getCommonCategories

      public Set<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.
      Parameters:
      catSet - the initial set of categories
      axis - the axis
      Returns:
      the common categories
    • showRefineWithProfilingCategories

      public boolean showRefineWithProfilingCategories()
    • isProfilingCategory

      public boolean isProfilingCategory(Category cat)
      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

      public String getProfilingCategoryAncestorString(Category cat)
      Returns a string representation of the ancestor of this category (until the axis).
      Parameters:
      cat - the category
      Returns:
      a String containing the ancestors concatenation.