bookbag retrieve functions added
authordrizea <danielrizea27@gmail.com>
Sun, 10 Jun 2012 17:41:02 +0000 (20:41 +0300)
committerdrizea <danielrizea27@gmail.com>
Sun, 10 Jun 2012 17:41:02 +0000 (20:41 +0300)
Open-ILS/src/Android/src/org/evergreen/android/accountAccess/AccountAccess.java

index 1360de0..fd55c14 100644 (file)
@@ -151,6 +151,8 @@ public class AccountAccess {
         */
        public static String METHOD_CREATE_HOLD = "     open-ils.circ.holds.create";
        
+       //Used for Fines 
+       
        /** The METHODS_FETCH_FINES_SUMMARY
         * description : 
         * @param : authToken, UserID
@@ -172,6 +174,27 @@ public class AccountAccess {
         */
        public static String METHOD_FETCH_MONEY_BILLING = "open-ils.circ.money.billing.retrieve.all";
        
+       
+       //Used for book bags
+       /** The METHOD_FLESH_CONTAINERS
+        * description : Retrieves all un-fleshed buckets by class assigned to a given user
+        * VIEW_CONTAINER permissions is requestID != owner ID
+        * @param : authtoken, UserID, "biblio", "bookbag"
+        * @returns : array of "cbreb" OSRFObjects
+        */
+       public static String METHOD_FLESH_CONTAINERS = "open-ils.actor.container.retrieve_by_class.authoritative";
+       
+       
+       /** The METHOD_FLESH_PUBLIC_CONTAINER
+        * description : array of contaoners correspondig to a id 
+        * @param : authtoken , "biblio" , boobkbag ID
+        * @returns : array of "crebi" OSRF objects (content of bookbag, id's of elements to get more info)
+        */
+       public static String METHOD_FLESH_PUBLIC_CONTAINER = "open-ils.actor.container.flesh";
+       
+       
+       
+       
        /** The conn. */
        public HttpConnection conn;
 
@@ -715,7 +738,7 @@ public class AccountAccess {
        
        //----------------------------Fines Summary------------------------------------//
        
-       private OSRFObject getFinesSummary(){
+       public OSRFObject getFinesSummary(){
                
                OSRFObject finesSummary = (OSRFObject) doRequest(SERVICE_ACTOR, METHOD_FETCH_FINES_SUMMARY, new Object[]{authToken,userID});
                
@@ -729,6 +752,26 @@ public class AccountAccess {
                return transactions;
        }
        
+       public Object getBookbags(){
+               
+               Object response = doRequest(SERVICE_ACTOR, METHOD_FLESH_CONTAINERS, new Object[]{authToken,userID,"biblio","bookbag"});
+       
+               List<OSRFObject> bookbags = (List<OSRFObject>)response;
+               
+               for(int i=0;i<bookbags.size();i++){
+                       
+                       getBookbagContent(bookbags.get(i).getInt("id"));
+               }
+               
+               
+               return bookbags;
+       }
+       
+       private Object getBookbagContent(Integer bookbagID){
+               
+               return doRequest(SERVICE_ACTOR, METHOD_FLESH_PUBLIC_CONTAINER, new Object[]{authToken,"biblio",bookbagID});
+       }
+       
        private Object doRequest(String service, String methodName, Object[] params){