diff --git a/browser/flash/configure.zcml b/browser/flash/configure.zcml index 47735d2..1809a80 100644 --- a/browser/flash/configure.zcml +++ b/browser/flash/configure.zcml @@ -12,7 +12,7 @@ for="loops.interfaces.ILoopsObject" class="loops.browser.flash.flash.FlashView" template="flash.pt" - permission="zope.ManageContent" + permission="loops.xmlrpc.ManageConcepts" /> diff --git a/configure.zcml b/configure.zcml index 7806751..16c3ecf 100644 --- a/configure.zcml +++ b/configure.zcml @@ -7,6 +7,23 @@ + + + + + + + + >> xrf = LoopsMethods(loopsRoot, TestRequest()) >>> startObj = xrf.getStartObject() >>> sorted(startObj.keys()) - ['children', 'description', 'id', 'name', 'options', 'parents', 'resources', - 'title', 'type', 'typeInterface', 'viewName'] + ['children', 'description', 'id', 'name', 'parents', 'resources', + 'title', 'type', 'viewName'] >>> startObj['id'], startObj['name'], startObj['title'], startObj['type'] ('1', u'domain', u'Domain', '0') diff --git a/xmlrpc/common.py b/xmlrpc/common.py index aa6ba22..fe20d18 100644 --- a/xmlrpc/common.py +++ b/xmlrpc/common.py @@ -28,6 +28,7 @@ from zope.lifecycleevent import ObjectCreatedEvent, ObjectModifiedEvent from zope.app.publisher.xmlrpc import XMLRPCView from zope.app.publisher.xmlrpc import MethodPublisher from zope.traversing.api import getName +from zope.schema.interfaces import ITextLine from zope.security.proxy import removeSecurityProxy from zope.cachedescriptors.property import Lazy @@ -134,6 +135,7 @@ class LoopsMethods(MethodPublisher): ti = IType(obj).typeInterface if ti is not None: obj = ti(obj) + # TODO: provide conversion if necessary setattr(obj, attr, toUnicode(value)) notify(ObjectModifiedEvent(obj)) return 'OK' @@ -147,15 +149,17 @@ def objectAsDict(obj): ti = objType.typeInterface if ti is not None: adapter = ti(obj) - for attr in (list(adapter._adapterAttributes) + list(ti)): + #for attr in (list(adapter._adapterAttributes) + list(ti)): + for attr in list(ti): if attr not in ('__parent__', 'context', 'id', 'name', 'title', 'description', 'type', 'data'): value = getattr(adapter, attr) - # TODO: better selection and conversion - if value is None or type(value) in (str, unicode): + # TODO: provide conversion and schema information + #if value is None or type(value) in (str, unicode): + if ITextLine.providedBy(ti[attr]): mapping[attr] = value or u'' - elif type(value) is list: - mapping[attr] = ' | '.join(value) + #elif type(value) is list: + # mapping[attr] = ' | '.join(value) return mapping def formatRelations(rels, useSecond=True): diff --git a/xmlrpc/configure.zcml b/xmlrpc/configure.zcml index 3c2f12f..d409a3e 100644 --- a/xmlrpc/configure.zcml +++ b/xmlrpc/configure.zcml @@ -5,23 +5,6 @@ xmlns="http://namespaces.zope.org/xmlrpc" i18n_domain="zope"> - - - - - - - -