public class ReviewMgr extends BaseMgr
Modifier and Type | Field and Description |
---|---|
static int |
PRODUCT_REVIEW
Product review
|
static int |
VENDOR_REVIEW
Vendor review
|
Modifier | Constructor and Description |
---|---|
protected |
ReviewMgr(com.konakart.appif.KKEngIf eng,
KKAppEng kkAppEng)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
fetchReviewDetails(int revId)
Sets selectedReview by finding it within the currentReviews array.
|
com.konakart.appif.ReviewsIf |
fetchReviews(com.konakart.appif.DataDescriptorIf dd,
com.konakart.appif.ReviewSearchIf rs)
Retrieves the reviews that match the criteria in a ReviewSearch object and puts them in the
currentReviews array. |
com.konakart.appif.ReviewsIf |
fetchVendorReviews(com.konakart.appif.DataDescriptorIf dd,
com.konakart.appif.ReviewSearchIf rs,
java.lang.String _vendorStoreId)
Retrieves the reviews that match the criteria in a ReviewSearch object and puts them in the
currentReviews array. |
void |
filterCurrentReviews(int rating,
long timestamp)
The current reviews are filtered by rating.
|
void |
filterCurrentVendorReviews(int rating,
long timestamp)
The current reviews are filtered by rating.
|
int |
getCurrentOffset()
Returns the currentOffset in the review array.
|
int |
getCurrentPage() |
com.konakart.appif.ReviewIf[] |
getCurrentReviews()
Returns an array of currentReviews.
|
com.konakart.appif.DataDescriptorIf |
getDataDesc() |
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 |
getNumPages() |
java.util.ArrayList<java.lang.Integer> |
getPageList() |
int |
getPageSize()
Used to get the maximum number of reviews to display.
|
int[] |
getRatingPercentage()
An array of 5 ints where index 0 contains the percentage of products for reviews with a 1
star rating and index 4 contains the percentage of products for reviews with a 5 star rating.
|
int[] |
getRatingQuantity()
An array of 5 ints where index 0 contains the number of products for reviews with a 1 star
rating and index 4 contains the number of products for reviews with a 5 star rating.
|
com.konakart.appif.ReviewSearchIf |
getRevSearch() |
long |
getRevTimestamp()
A timestamp for when the last review search was done.
|
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.
|
boolean |
isExpiredResultSet() |
boolean |
isMgrReady()
Is the Manager Ready?
|
boolean |
isShowTab() |
void |
navigateCurrentReviews(java.lang.String navDir,
long timestamp)
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 |
navigateCurrentVendorReviews(java.lang.String navDir,
long timestamp)
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 |
orderCurrentReviews(java.lang.String orderBy,
long timestamp)
This method is called to change the order of a list of reviews in the currentReviews array.
|
void |
orderCurrentVendorReviews(java.lang.String orderBy,
long timestamp)
This method is called to change the order of a list of reviews in the currentReviews array.
|
void |
refreshConfigs()
Refresh the configuration variables.
|
void |
reset()
Puts the ReviewContainer object back into it's original state with no reviews selected.
|
void |
saveNavigationForTimestamp()
Called from the JSP to the save the current navigation
|
void |
setCurrentPage(int currentPage) |
void |
setDataDesc(com.konakart.appif.DataDescriptorIf dataDesc) |
void |
setNumPages(int numPages) |
void |
setPageList(java.util.ArrayList<java.lang.Integer> pageList) |
void |
setPageSize(int num)
Used to set a user defined maximum number of reviews displayed on a page.
|
void |
setRatingPercentage(int[] ratingPercentage)
An array of 5 ints where index 0 contains the percentage of products for reviews with a 1
star rating and index 4 contains the percentage of products for reviews with a 5 star rating.
|
void |
setRatingQuantity(int[] ratingQuantity)
An array of 5 ints where index 0 contains the number of products for reviews with a 1 star
rating and index 4 contains the number of products for reviews with a 5 star rating.
|
void |
setRevSearch(com.konakart.appif.ReviewSearchIf revSearch) |
void |
setRevTimestamp(long revTimestamp)
A timestamp for when the last review search was done.
|
void |
setShowTab(boolean showTab) |
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,
int productId,
int vendorId)
Save a review in the database.
|
getEng, getKkAppEng, getPages, setEng, setKkAppEng
public static final int PRODUCT_REVIEW
public static final int VENDOR_REVIEW
protected ReviewMgr(com.konakart.appif.KKEngIf eng, KKAppEng kkAppEng) throws com.konakart.app.KKException
eng
- the engkkAppEng
- the kkAppEngcom.konakart.app.KKException
- an unexpected KKException exceptionpublic void refreshConfigs() throws com.konakart.app.KKException
com.konakart.app.KKException
- an unexpected KKException exceptionpublic void reset() throws com.konakart.app.KKException
com.konakart.app.KKException
- an unexpected KKException exceptionpublic boolean isMgrReady()
isMgrReady
in class BaseMgr
public com.konakart.appif.ReviewsIf fetchReviews(com.konakart.appif.DataDescriptorIf dd, com.konakart.appif.ReviewSearchIf rs) throws com.konakart.app.KKException, KKAppException
currentReviews
array.dd
- Used to control the data offset, limit the number of items returned and set the
sort orderrs
- Contains information used to search for reviewscom.konakart.app.KKException
- an unexpected KKException exceptionKKAppException
- an unexpected KKAppException exceptionpublic com.konakart.appif.ReviewsIf fetchVendorReviews(com.konakart.appif.DataDescriptorIf dd, com.konakart.appif.ReviewSearchIf rs, java.lang.String _vendorStoreId) throws com.konakart.app.KKException, KKAppException
currentReviews
array.dd
- Used to control the data offset, limit the number of items returned and set the
sort orderrs
- Contains information used to search for reviews_vendorStoreId
- the _vendorStoreIdcom.konakart.app.KKException
- an unexpected KKException exceptionKKAppException
- an unexpected KKAppException exceptionpublic void navigateCurrentReviews(java.lang.String navDir, long timestamp) 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 directiontimestamp
- Indicates when the result set was created.com.konakart.app.KKException
- an unexpected KKException exceptionKKAppException
- an unexpected KKAppException exceptionpublic void navigateCurrentVendorReviews(java.lang.String navDir, long timestamp) 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 directiontimestamp
- Indicates when the result set was created.com.konakart.app.KKException
- an unexpected KKException exceptionKKAppException
- an unexpected KKAppException exceptionpublic void orderCurrentReviews(java.lang.String orderBy, long timestamp) throws com.konakart.app.KKException, KKAppException
orderBy
- The order by parametertimestamp
- Indicates when the result set was created.com.konakart.app.KKException
- an unexpected KKException exceptionKKAppException
- an unexpected KKAppException exceptionpublic void orderCurrentVendorReviews(java.lang.String orderBy, long timestamp) throws com.konakart.app.KKException, KKAppException
orderBy
- The order by parametertimestamp
- Indicates when the result set was created.com.konakart.app.KKException
- an unexpected KKException exceptionKKAppException
- an unexpected KKAppException exceptionpublic void filterCurrentReviews(int rating, long timestamp) throws com.konakart.app.KKException, KKAppException
rating
- the ratingtimestamp
- the timestampcom.konakart.app.KKException
- an unexpected KKException exceptionKKAppException
- an unexpected KKAppException exceptionpublic void filterCurrentVendorReviews(int rating, long timestamp) throws com.konakart.app.KKException, KKAppException
rating
- the ratingtimestamp
- the timestampcom.konakart.app.KKException
- an unexpected KKException exceptionKKAppException
- an unexpected KKAppException exceptionpublic void fetchReviewDetails(int revId) throws com.konakart.app.KKException, KKAppException
revId
- The id of the selected reviewcom.konakart.app.KKException
- an unexpected KKException exceptionKKAppException
- an unexpected KKAppException exceptionpublic 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 lengthpublic int getNumberOfReviews()
public int writeReview(java.lang.String _reviewText, int rating, int customerId, int productId, int vendorId) throws com.konakart.app.KKException
_reviewText
- the text to put into the reviewrating
- the rating for the reviewcustomerId
- id of the customer writing the reviewproductId
- id of the productvendorId
- id of the vendorcom.konakart.app.KKException
- an unexpected KKException exceptionpublic 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()
public com.konakart.appif.DataDescriptorIf getDataDesc()
public void setDataDesc(com.konakart.appif.DataDescriptorIf dataDesc)
dataDesc
- the dataDesc to setpublic void setPageSize(int num)
num
- the numpublic int getPageSize()
public int getNumPages()
public void setNumPages(int numPages)
numPages
- the numPages to setpublic int getCurrentPage()
public void setCurrentPage(int currentPage)
currentPage
- the currentPage to setpublic java.util.ArrayList<java.lang.Integer> getPageList()
public void setPageList(java.util.ArrayList<java.lang.Integer> pageList)
pageList
- the pageList to setpublic com.konakart.appif.ReviewSearchIf getRevSearch()
public void setRevSearch(com.konakart.appif.ReviewSearchIf revSearch)
revSearch
- the revSearch to setpublic int[] getRatingQuantity()
public void setRatingQuantity(int[] ratingQuantity)
ratingQuantity
- the ratingQuantity to setpublic int[] getRatingPercentage()
public void setRatingPercentage(int[] ratingPercentage)
ratingPercentage
- the ratingPercentage to setpublic long getRevTimestamp()
public void setRevTimestamp(long revTimestamp)
revTimestamp
- the revTimestamp to setpublic boolean isExpiredResultSet()
public boolean isShowTab()
public void setShowTab(boolean showTab)
showTab
- the showTab to setpublic void saveNavigationForTimestamp()
Copyright © 2018 DS Data Systems UK Ltd.