/[gnue]/gnue-appserver/src/geasSession.py
ViewVC logotype

Diff of /gnue-appserver/src/geasSession.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.36 by reinhard, Mon Sep 1 20:11:37 2003 UTC revision 1.37 by reinhard, Wed Sep 10 20:31:39 2003 UTC
# Line 67  class geasSession: Line 67  class geasSession:
67      self._dirtyLists = []      self._dirtyLists = []
68    
69    # ---------------------------------------------------------------------------    # ---------------------------------------------------------------------------
   # Get class definition from class name  
   # ---------------------------------------------------------------------------  
   
   def _getClassdef (self, classname):  
     return classrep.classes [classname]  
   
   # ---------------------------------------------------------------------------  
70    # Log into the application server    # Log into the application server
71    # ---------------------------------------------------------------------------    # ---------------------------------------------------------------------------
72    
# Line 101  class geasSession: Line 94  class geasSession:
94    
95      # check if user has access rights for this class      # check if user has access rights for this class
96      if not self._authAdapter.hasAccess (self, self._user, classname):      if not self._authAdapter.hasAccess (self, self._user, classname):
97        raise Exception, "Access to class %s denied" % classname        raise Exception, "Access to class '%s' denied" % classname
98    
99      classdef = self._getClassdef (classname)      classdef = classrep.classes [classname]
100    
101      # create new List      # create new List
102      return geasList.geasList (self, classdef, propertylist, sortorder)      return geasList.geasList (self, classdef, propertylist, sortorder)
# Line 145  class geasSession: Line 138  class geasSession:
138      return list_id;      return list_id;
139    
140    # ---------------------------------------------------------------------------    # ---------------------------------------------------------------------------
141      # Check list id and raise exception if invalid, return list otherwise
142      # ---------------------------------------------------------------------------
143    
144      def _getList (self, list_id):
145        if self._lists.has_key (list_id):
146          return self._lists [list_id]
147        else:
148          raise Exception, "Can't find a list with ID '%s'" % list_id
149    
150      # ---------------------------------------------------------------------------
151    # Count the number of objects in the list    # Count the number of objects in the list
152    # ---------------------------------------------------------------------------    # ---------------------------------------------------------------------------
153    
154    def count (self, list_id):    def count (self, list_id):
155      try:      list = self._getList (list_id)
        list = self._lists [list_id]  
     except:  
       raise Error, 'The list you are trying to access does not exist.'  
156      return list.count ();      return list.count ();
157    
158    # ---------------------------------------------------------------------------    # ---------------------------------------------------------------------------
# Line 160  class geasSession: Line 160  class geasSession:
160    # ---------------------------------------------------------------------------    # ---------------------------------------------------------------------------
161    
162    def fetch (self, list_id, start, count):    def fetch (self, list_id, start, count):
163      try:      list = self._getList (list_id)
       list = self._lists [list_id]  
     except:  
       raise Error, 'The list you are trying to access does not exist.'  
164      return list.fetch (start, count)      return list.fetch (start, count)
165    
166    # ---------------------------------------------------------------------------    # ---------------------------------------------------------------------------

Legend:
Removed from v.1.36  
changed lines
  Added in v.1.37

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26