[gen] Created param config.groupsForGlobalRoles that disabled by default creation of a group for every global role. On a appy class it is now possible to define a static method 'generateUid' that generates a UID for every instance of this class, instead of using the standard Appy way to produce such UIDs. [shared] dav.Resource: allow to retrieve the result encoded or not in utf8.

This commit is contained in:
Gaetan Delannay 2013-07-23 17:07:27 +02:00
parent d385b8514e
commit 88bd5e5bce
9 changed files with 42 additions and 20 deletions

View file

@ -57,7 +57,15 @@ class BaseMixin:
if created and rq:
# Create the final object and put it at the right place.
tool = self.getTool()
id = tool.generateUid(obj.portal_type)
# The app may define a method klass.generateUid for producing an UID
# for instance of this class. If no such method is found, we use the
# standard Appy method to produce an UID.
id = None
klass = tool.getAppyClass(obj.portal_type)
if hasattr(klass, 'generateUid'):
id = klass.generateUid(obj.REQUEST)
if not id:
id = tool.generateUid(obj.portal_type)
if not initiator:
folder = tool.getPath('/data')
else: