Class ProfilingManager

    • Method Detail

      • 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
      • addFirstStepProfileFilter

        public void addFirstStepProfileFilter​(QueryHandler qh,
                                              java.util.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,
                                                         java.util.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
      • getProfilingAxes

        public java.util.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 java.util.Set<Category> getMemberProfilingUnexactCategories​(Member mbr,
                                                                           java.util.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 java.util.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 java.util.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,
                                                              java.lang.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,
                                        java.util.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 java.util.Set<Category> getCommonCategories​(java.util.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 java.lang.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.