com.jalios.jcms
Class ReviewManager

java.lang.Object
  extended by com.jalios.jcms.ReviewManager
All Implemented Interfaces:
DBConstants

public class ReviewManager
extends Object
implements DBConstants


Field Summary
static String REVIEWED_PUBLICATION_ID_FIELD
           
 
Fields inherited from interface com.jalios.jcms.db.DBConstants
ALL_CATEGORIES_SET_FIELD, AUTH_GRP_SET_FIELD, AUTH_MBR_SET_FIELD, AUTHOR_ID_FIELD, CATEGORIES_SET_FIELD, CDATE_FIELD, CHANNEL_JCMSDB_PROP, DBDATA_URID, HAS_NO_READ_RIGHTS, HIBERNATE_MAPPING_ADATE, HIBERNATE_MAPPING_AUTHOR, HIBERNATE_MAPPING_CDATE, HIBERNATE_MAPPING_EDATE, HIBERNATE_MAPPING_MDATE, HIBERNATE_MAPPING_PDATE, HIBERNATE_MAPPING_PSTATUS, HIBERNATE_MAPPING_TITLE, HIBERNATE_MAPPING_WORKFLOW_ID, HIBERNATE_MAPPING_WORKSPACE_ID, MDATE_FIELD, PSTATUS_FIELD, REVISION, ROW_ID_FIELD, SCROLL_FETCH_SIZE, WORKFLOW_ID_FIELD, WORKSPACE_ID_FIELD
 
Method Summary
 int getDefaultRating()
          Returns the default review rating get from the property review.default-rating
static ReviewManager getInstance()
           
 int getMaxReviewRating()
          Returns the maximum review rating value.
 AbstractReview getReview(Publication pub, Member author)
          Returns the review written by the given author and bound to the given publication.
 int getReviewCount(Publication pub)
          Returns how many reviews are attached to the given publication.
 List<AbstractReview> getReviewList(Publication pub)
          Returns all the reviews bound to the given publication.
 List<AbstractReview> getReviewList(Publication pub, Member mbr)
          Returns all the reviews bound to the given publication the given member can access.
 int getReviewRating(Publication pub)
          Returns the average rating for the given publication.
 void invalidatePublicationReviewInfo(Publication pub)
          Invalidate the statistics (avg.
 void removeAllReviews(Publication pub)
          Removes all the Reviews bound to the given publication.
 void updatePublicationReviewInfo(Publication pub)
          Recompute the statistics (avg.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REVIEWED_PUBLICATION_ID_FIELD

public static String REVIEWED_PUBLICATION_ID_FIELD
Method Detail

getInstance

public static ReviewManager getInstance()

getReviewList

public List<AbstractReview> getReviewList(Publication pub)
Returns all the reviews bound to the given publication.

Parameters:
pub - the publication
Returns:
all the reviews bound to the given publication.
Since:
jcms-6.0.0

getReviewList

public List<AbstractReview> getReviewList(Publication pub,
                                          Member mbr)
Returns all the reviews bound to the given publication the given member can access.

Parameters:
pub - the publication
mbr - the member
Returns:
a List of Review
Since:
jcms-6.0.0

getReview

public AbstractReview getReview(Publication pub,
                                Member author)
Returns the review written by the given author and bound to the given publication.

Parameters:
pub - the publication
author - the author
Returns:
the review written by the given author and bound to the given publication.
Since:
jcms-6.0.0

removeAllReviews

public void removeAllReviews(Publication pub)
Removes all the Reviews bound to the given publication.

Parameters:
pub - the publication
Since:
jcms-6.0.0

getReviewRating

public int getReviewRating(Publication pub)
Returns the average rating for the given publication.

Parameters:
pub - the publication
Returns:
the average rating for the given publication.
Since:
jcms-6.0.0

getReviewCount

public int getReviewCount(Publication pub)
Returns how many reviews are attached to the given publication.

Parameters:
pub - the publication
Returns:
how many reviews are attached to the given publication.
Since:
jcms-6.0.0

invalidatePublicationReviewInfo

public void invalidatePublicationReviewInfo(Publication pub)
Invalidate the statistics (avg. rating, count) on the review of the given publication.

Parameters:
pub - the publication
Since:
jcms-6.1.3

updatePublicationReviewInfo

public void updatePublicationReviewInfo(Publication pub)
Recompute the statistics (avg. rating, count) on the review of the given publication.

Parameters:
pub - the publication
Since:
jcms-6.0.0

getMaxReviewRating

public int getMaxReviewRating()
Returns the maximum review rating value. This value is equal to property tag.rating.count - 1. Note: Minimum rating value is equal to 0.

Returns:
the max rating value

getDefaultRating

public int getDefaultRating()
Returns the default review rating get from the property review.default-rating

Returns:
the default rating
Since:
jcms-3.0


Copyright © 2001-2010 Jalios SA. All Rights Reserved.