Package org.alfresco.repo.rating
Class RatingSchemeImpl
- java.lang.Object
-
- org.alfresco.repo.rating.RatingSchemeImpl
-
- All Implemented Interfaces:
java.lang.Comparable<RatingScheme>,RatingScheme,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.InitializingBean
public class RatingSchemeImpl extends java.lang.Object implements RatingScheme, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean
-
-
Constructor Summary
Constructors Constructor Description RatingSchemeImpl(RatingSchemeRegistry registry)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()intcompareTo(RatingScheme otherScheme)This method can be used to sort RatingSchemes by name.floatgetMaxRating()This method returns the maximum rating defined for this scheme.floatgetMinRating()This method returns the minimum rating defined for this scheme.java.lang.StringgetModelPrefix()This method returns the namespace (prefix e.g.java.lang.StringgetName()This method returns the name which uniquely identifies the rating scheme.java.util.List<AbstractRatingRollupAlgorithm>getPropertyRollups()This method returns a List ofproperty rollup algorithmswhich are used in order to calculate rating totals, counts etc for a rated node.voidinit()booleanisSelfRatingAllowed()This method returnstrueif the cm:creator of the node is allowed to apply a rating to it, elsefalse.voidsetBeanName(java.lang.String name)voidsetMaxRating(float maxRating)voidsetMinRating(float minRating)voidsetModelPrefix(java.lang.String prefix)voidsetPropertyRollups(java.util.List<AbstractRatingRollupAlgorithm> rollupAlgorithms)voidsetSelfRatingAllowed(boolean selfRatingAllowed)java.lang.StringtoString()
-
-
-
Constructor Detail
-
RatingSchemeImpl
public RatingSchemeImpl(RatingSchemeRegistry registry)
-
-
Method Detail
-
setPropertyRollups
public void setPropertyRollups(java.util.List<AbstractRatingRollupAlgorithm> rollupAlgorithms)
-
setModelPrefix
public void setModelPrefix(java.lang.String prefix)
-
init
public void init()
-
getPropertyRollups
public java.util.List<AbstractRatingRollupAlgorithm> getPropertyRollups()
Description copied from interface:RatingSchemeThis method returns a List ofproperty rollup algorithmswhich are used in order to calculate rating totals, counts etc for a rated node.- Specified by:
getPropertyRollupsin interfaceRatingScheme- Returns:
- an unmodifiable list of property rollup algorithms.
-
getModelPrefix
public java.lang.String getModelPrefix()
Description copied from interface:RatingSchemeThis method returns the namespace (prefix e.g. "cm") of the Alfresco content model containing the definitions of the rollup aspect and properties.- Specified by:
getModelPrefixin interfaceRatingScheme- See Also:
RatingNamingConventionsUtil
-
setBeanName
public void setBeanName(java.lang.String name)
- Specified by:
setBeanNamein interfaceorg.springframework.beans.factory.BeanNameAware
-
setMinRating
public void setMinRating(float minRating)
-
setMaxRating
public void setMaxRating(float maxRating)
-
setSelfRatingAllowed
public void setSelfRatingAllowed(boolean selfRatingAllowed)
-
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.Exception- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
java.lang.Exception
-
getMaxRating
public float getMaxRating()
Description copied from interface:RatingSchemeThis method returns the maximum rating defined for this scheme.- Specified by:
getMaxRatingin interfaceRatingScheme- Returns:
- the maximum rating.
-
getMinRating
public float getMinRating()
Description copied from interface:RatingSchemeThis method returns the minimum rating defined for this scheme.- Specified by:
getMinRatingin interfaceRatingScheme- Returns:
- the minimum rating.
-
isSelfRatingAllowed
public boolean isSelfRatingAllowed()
Description copied from interface:RatingSchemeThis method returnstrueif the cm:creator of the node is allowed to apply a rating to it, elsefalse.- Specified by:
isSelfRatingAllowedin interfaceRatingScheme- Returns:
- whether or not the cm:creator of the node can apply a rating in this scheme.
-
getName
public java.lang.String getName()
Description copied from interface:RatingSchemeThis method returns the name which uniquely identifies the rating scheme.- Specified by:
getNamein interfaceRatingScheme- Returns:
- the name.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
compareTo
public int compareTo(RatingScheme otherScheme)
This method can be used to sort RatingSchemes by name.- Specified by:
compareToin interfacejava.lang.Comparable<RatingScheme>- Since:
- 4.1.5
-
-