Class AbstractRatingRollupAlgorithm

  • All Implemented Interfaces:
    org.springframework.beans.factory.InitializingBean
    Direct Known Subclasses:
    RatingCountRollupAlgorithm, RatingTotalRollupAlgorithm

    @AlfrescoPublicApi
    public abstract class AbstractRatingRollupAlgorithm
    extends java.lang.Object
    implements org.springframework.beans.factory.InitializingBean
    This class provides the basic implementation of a rating property rollup. By providing an implementation of this class (or reusing an existing one), injecting the object into the RatingScheme and following the content model naming conventions, it should be possible to have new rating property rollups automatically calculated and persisted into the Alfresco content model, thereby enabling indexing, searching and sorting of rating-related properties.
    Since:
    3.5
    Author:
    Neil McErlean
    • Field Detail

      • ratingSchemeName

        protected java.lang.String ratingSchemeName
      • namespaceService

        protected org.alfresco.service.namespace.NamespaceService namespaceService
      • nodeService

        protected org.alfresco.service.cmr.repository.NodeService nodeService
      • rollupName

        protected final java.lang.String rollupName
    • Constructor Detail

      • AbstractRatingRollupAlgorithm

        public AbstractRatingRollupAlgorithm​(java.lang.String rollupName)
    • Method Detail

      • setRatingSchemeName

        public void setRatingSchemeName​(java.lang.String ratingScheme)
      • setNamespaceService

        public void setNamespaceService​(org.alfresco.service.namespace.NamespaceService namespaceService)
      • setNodeService

        public void setNodeService​(org.alfresco.service.cmr.repository.NodeService nodeService)
      • setRatingService

        public void setRatingService​(RatingService ratingService)
      • afterPropertiesSet

        public void afterPropertiesSet()
                                throws java.lang.Exception
        Specified by:
        afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
        Throws:
        java.lang.Exception
      • recalculate

        public abstract java.io.Serializable recalculate​(org.alfresco.service.cmr.repository.NodeRef ratedNode)
      • getRollupName

        public java.lang.String getRollupName()
        This method returns the rollup name, for example "Total" or "Count". This rollup name is used as part of the convention-based naming of content model property names.
        Returns:
        String