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 |
|
|
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) |
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 |
# --------------------------------------------------------------------------- |
# --------------------------------------------------------------------------- |
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 |
# --------------------------------------------------------------------------- |
# --------------------------------------------------------------------------- |