|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.konakart.al.BaseMgr
com.konakart.al.ReviewMgr
public class ReviewMgr
Contains methods to read and write product reviews.
| Field Summary |
|---|
| Fields inherited from class com.konakart.al.BaseMgr |
|---|
eng, kkAppEng, log |
| Constructor Summary | |
|---|---|
protected |
ReviewMgr(com.konakart.appif.KKEngIf eng,
KKAppEng kkAppEng)
Constructor |
| Method Summary | |
|---|---|
int |
fetchAllReviews()
The reviews are fetched from the engine and put in the currentReviews array. |
void |
fetchRandomReviewDetails()
For the case of the random review, it exists in the randomReviews array. |
void |
fetchReviewDetails(int revId)
Sets selectedReview by finding it within the currentReviews array. |
int |
fetchReviewsPerProduct(int prodId)
The reviews are fetched from the engine and put in the currentReviews array. |
int |
getCurrentOffset()
Returns the currentOffset in the review array. |
com.konakart.appif.ReviewIf[] |
getCurrentReviews()
Returns an array of currentReviews. |
int |
getMaxRows()
Maximum number of reviews to show in a list. |
java.lang.String |
getNavBack()
Static string - navigate backwards. |
java.lang.String |
getNavNext()
Static string - navigate forwards. |
java.lang.String |
getNavStart()
Static string - navigate to the start. |
int |
getNumberOfReviews()
Returns the number of reviews currently retrieved. |
int |
getNumRandomReviews()
Returns the number of random reviews |
ExtendedReview |
getRandomReview()
Pick out a review at random, by indexing the randomReviewArray with a counter that increments by 1 every time the function is called. |
com.konakart.appif.ReviewIf |
getSelectedReview()
Returns the selectedReview. |
int |
getShowBack()
Show the back button if set to 1. |
int |
getShowNext()
Show the next button if set to 1. |
int |
getTotalNumberOfReviews()
Returns the totalNumberOfReviews. |
void |
navigateCurrentReviews(java.lang.String navDir,
boolean all)
This method is called to navigate through a list of reviews when the list is longer than maxRows. navDir can take the following values which are retrieved using getter methods
on the ReviewMgr instance:
getNavNext()
getNavBack()
getNavStart()
|
void |
refreshCaches()
Refreshes the Random review list. |
void |
refreshConfigs()
Refresh the configuration variables. |
void |
reset()
Puts the ReviewContainer object back into it's original state with no reviews selected. |
java.lang.String |
truncateDesc(java.lang.String desc,
int wordLength,
int stringLength)
Format the description in order to truncate it and to split up very long words which could ruin the page formatting. |
int |
writeReview(java.lang.String reviewText,
int rating,
int customerId)
Save a review in the database. |
| Methods inherited from class com.konakart.al.BaseMgr |
|---|
getEng, getKkAppEng, setEng, setKkAppEng |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected ReviewMgr(com.konakart.appif.KKEngIf eng,
KKAppEng kkAppEng)
throws com.konakart.app.KKException
eng - kkAppEng -
com.konakart.app.KKException| Method Detail |
|---|
public void refreshConfigs()
throws com.konakart.app.KKException
com.konakart.app.KKException
public void reset()
throws com.konakart.app.KKException
com.konakart.app.KKException
public void refreshCaches()
throws com.konakart.app.KKException
com.konakart.app.KKException
public int fetchReviewsPerProduct(int prodId)
throws com.konakart.app.KKException,
KKAppException
prodId - The id of the product for which we are fetching reviews
com.konakart.app.KKException
KKAppException
public int fetchAllReviews()
throws com.konakart.app.KKException,
KKAppException
com.konakart.app.KKException
KKAppException
public void navigateCurrentReviews(java.lang.String navDir,
boolean all)
throws com.konakart.app.KKException,
KKAppException
navDir can take the following values which are retrieved using getter methods
on the ReviewMgr instance:
navDir - The navigation directionall - If set to true, it gets all reviews and doesn't filter them by product
com.konakart.app.KKException
KKAppException
public void fetchReviewDetails(int revId)
throws com.konakart.app.KKException,
KKAppException
revId - The id of the selected review
com.konakart.app.KKException
KKAppException
public void fetchRandomReviewDetails()
throws com.konakart.app.KKException,
KKAppException
com.konakart.app.KKException
KKAppExceptionpublic ExtendedReview getRandomReview()
public int getNumRandomReviews()
public java.lang.String truncateDesc(java.lang.String desc,
int wordLength,
int stringLength)
desc - The description to be formattedwordLength - The maximum word lengthstringLength - The maximum string length
public int getNumberOfReviews()
public int writeReview(java.lang.String reviewText,
int rating,
int customerId)
throws com.konakart.app.KKException
reviewText - the text to put into the reviewrating - the rating for the reviewcustomerId - id of the customer writing the review
com.konakart.app.KKExceptionpublic int getCurrentOffset()
public com.konakart.appif.ReviewIf[] getCurrentReviews()
public int getMaxRows()
public int getShowBack()
public int getShowNext()
public com.konakart.appif.ReviewIf getSelectedReview()
public java.lang.String getNavBack()
navdir attribute when navigating backwards.
public java.lang.String getNavNext()
navdir attribute when navigating forwards.
public java.lang.String getNavStart()
navdir attribute when navigating to the start.
public int getTotalNumberOfReviews()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||