com.konakart.blif
Interface ReviewMgrIf

All Known Implementing Classes:
ReviewMgr

public interface ReviewMgrIf

ReviewMgrIf Interface which an implementation of this manager must adhere to.


Method Summary
 Reviews getAllReviews(DataDescriptorIf dataDesc)
          Calls the getReviewsPerProduct method with a negative productId value so that it is not included in the Where clause of the query
 Review getReview(int reviewId)
          Returns a review for the given reviewId
 Reviews getReviewsPerProduct(DataDescriptorIf dataDesc, int productId)
          Returns an array of reviews for the given productId
 int writeReview(java.lang.String sessionId, ReviewIf review)
          A new customer review is added to the system.
 

Method Detail

getAllReviews

Reviews getAllReviews(DataDescriptorIf dataDesc)
                      throws org.apache.torque.TorqueException,
                             com.workingdogs.village.DataSetException,
                             KKException
Calls the getReviewsPerProduct method with a negative productId value so that it is not included in the Where clause of the query

Parameters:
dataDesc -
Returns:
Returns all reviews
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKException

getReviewsPerProduct

Reviews getReviewsPerProduct(DataDescriptorIf dataDesc,
                             int productId)
                             throws org.apache.torque.TorqueException,
                                    com.workingdogs.village.DataSetException,
                                    KKException
Returns an array of reviews for the given productId

Parameters:
dataDesc -
productId -
Returns:
Returns a Reviews object
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKException

getReview

Review getReview(int reviewId)
                 throws org.apache.torque.TorqueException,
                        com.workingdogs.village.DataSetException,
                        KKException
Returns a review for the given reviewId

Parameters:
reviewId -
Returns:
Returns a Review object
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKException

writeReview

int writeReview(java.lang.String sessionId,
                ReviewIf review)
                throws java.lang.Exception
A new customer review is added to the system. The process for adding a new review is to :
  1. Get the customer's id from the session
  2. Get the customer's name from the CustomerMgr
  3. Write into the reviews table followed by the reviews description table in one transaction
All of the above actions are performed as a transaction. In the case of MySQL, the transaction doesn't work unless the tables are defined as using the InnoDB or BDB engines. A table can be transformed using the following syntax : Alter table t Engine = InnoDB;. The standard engine seems to be MyIsam which doesn't support transactions.

Parameters:
sessionId -
review -
Returns:
int : Review Primary Key or a negative value for an error
Throws:
java.lang.Exception


Copyright © 2011 DS Data Systems UK Ltd.