Package org.alfresco.repo.rating
Class RatingNamingConventionsUtil
- java.lang.Object
-
- org.alfresco.repo.rating.RatingNamingConventionsUtil
-
public class RatingNamingConventionsUtil extends java.lang.ObjectThis class encapsulates the naming conventions used in the RatingService. e.g. the naming conventions used for the aspect and for the properties in the content model. Each rating scheme which has one or more rating property rollups, will lead to the addition of an aspect on to the rated node. This aspect is named:"cm:" + <ratingSchemeName> + "Rollups" e.g. cm:likesRatingSchemeRollups
Then within that aspect, any rolled up property values will be persisted in a property named:"cm:" + <ratingSchemeName> + <rollupName> e.g. cm:likesRatingSchemeCount
The ratingSchemeName is the spring bean name of the rating scheme and the rollupName is the rollup name as defined in the algorithm class e.g.RatingCountRollupAlgorithm.ROLLUP_NAME. Since Alfresco 4.1.5, the "cm:" prefix is no longer required and any namespace can be used. These are provided via injection withRatingSchemeImpl.setModelPrefix(String)- Since:
- 3.5
- Author:
- Neil McErlean
-
-
Constructor Summary
Constructors Constructor Description RatingNamingConventionsUtil()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description org.alfresco.service.namespace.QNamegetRatingAssocNameFor(java.lang.String username, java.lang.String ratingSchemeName)This method returns theassociation namethat will be used to link a cm:rateable node to its cm:rating child for the specified username and ratingSchemeName.org.alfresco.service.namespace.QNamePatterngetRatingAssocPatternForUser(java.lang.String username, java.lang.String ratingSchemeName)This method returns a QNamePattern for the specified username and ratingSchemeName.org.alfresco.service.namespace.QNamegetRollupAspectNameFor(java.lang.String ratingSchemeName)Deprecated.UsegetRollupAspectNameFor(RatingScheme)instead.org.alfresco.service.namespace.QNamegetRollupAspectNameFor(RatingScheme ratingScheme)Given a ratingScheme, this method returns the aspect name which would by convention be used to store rating property rollups.org.alfresco.service.namespace.QNamegetRollupPropertyNameFor(java.lang.String ratingSchemeName, java.lang.String rollupName)Deprecated.UsegetRollupPropertyNameFor(RatingScheme, String)instead.org.alfresco.service.namespace.QNamegetRollupPropertyNameFor(RatingScheme ratingScheme, java.lang.String rollupName)Given a ratingScheme and a rollup name, this method returns the property name which would by convention be used to store the given rollup.voidsetNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService)
-
-
-
Method Detail
-
setNamespaceService
public void setNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService)
-
getRatingAssocNameFor
public org.alfresco.service.namespace.QName getRatingAssocNameFor(java.lang.String username, java.lang.String ratingSchemeName)This method returns theassociation namethat will be used to link a cm:rateable node to its cm:rating child for the specified username and ratingSchemeName.
-
getRatingAssocPatternForUser
public org.alfresco.service.namespace.QNamePattern getRatingAssocPatternForUser(java.lang.String username, java.lang.String ratingSchemeName)This method returns a QNamePattern for the specified username and ratingSchemeName. This pattern can be used when navigating child-associations looking for cm:rating nodes.- Parameters:
username- the username to match against ornullfor all usernames.ratingSchemeName- the ratingSchemeName to match against ornullfor all ratingSchemes.- Returns:
- QNamePattern
-
getRollupAspectNameFor
public org.alfresco.service.namespace.QName getRollupAspectNameFor(java.lang.String ratingSchemeName)
Deprecated.UsegetRollupAspectNameFor(RatingScheme)instead. This method assumes a "cm" prefix for the aspect.Given a ratingSchemeName, this method returns the aspect name which would by convention be used to store rating property rollups.- Parameters:
ratingSchemeName- the ratingSchemeName, which is the spring bean name.- Returns:
- the aspect name used to store all property rollups for that scheme.
-
getRollupAspectNameFor
public org.alfresco.service.namespace.QName getRollupAspectNameFor(RatingScheme ratingScheme)
Given a ratingScheme, this method returns the aspect name which would by convention be used to store rating property rollups.- Parameters:
ratingScheme- the ratingScheme.- Returns:
- the aspect name used to store all property rollups for that scheme.
-
getRollupPropertyNameFor
public org.alfresco.service.namespace.QName getRollupPropertyNameFor(java.lang.String ratingSchemeName, java.lang.String rollupName)Deprecated.UsegetRollupPropertyNameFor(RatingScheme, String)instead. This method assumes a "cm" prefix for the aspect.Given a ratingSchemeName and a rollup name, this method returns the property name which would by convention be used to store the given rollup.- Parameters:
ratingSchemeName- the ratingSchemeName, which is the spring bean name.rollupName- the name of the property rollup as given byAbstractRatingRollupAlgorithm.getRollupName().- Returns:
- the property name used to persist the given rollup in the given scheme.
-
getRollupPropertyNameFor
public org.alfresco.service.namespace.QName getRollupPropertyNameFor(RatingScheme ratingScheme, java.lang.String rollupName)
Given a ratingScheme and a rollup name, this method returns the property name which would by convention be used to store the given rollup.- Parameters:
ratingScheme- the ratingScheme.rollupName- the name of the property rollup as given byAbstractRatingRollupAlgorithm.getRollupName().- Returns:
- the property name used to persist the given rollup in the given scheme.
-
-