Olivier Grisel a écrit : > Juan Lago Cabrera a écrit : >> Hi list, >>
Hello, >> >> I'm trying to create some documents in a CPS Default Site (3.4) from a >> client python application using CPSRemoteController. I have problems >> when creating a "News Item" with a photo (photo field in schema). I've >> used the xmlrpc Binary object (like File document examples in >> "Understanding and using the CPS Remote Controller") but when I access >> the News Item created in CPS it appears a blinking "!!!". If I try to >> edit the document created, there's an AttributeError: Binary instance >> has no attribute 'size'. > > This is a bug. Can you please open a ticket in trac? > > https://svn.nuxeo.org/trac/pub/newticket (tracguest/tracguest) > Actually this is not a bug since adding a photo to a News Item has never been considered for the implementation. I would rather call it this request an enhancement request. The situation is that the "file" key in the doc_def structure is a special key the RemoteControllerTool knows about. And it treats this key in a special manner. To have an understanding of how it works, just search for BINARY_FILE_KEY in https://svn.nuxeo.org/trac/pub/file/CPSRemoteController/trunk/RemoteControllerTool.py So Juan, there are different solutions to your problem: 1. You customize the RemoteControllerTool to add a specific method to be able to modify a News Item, that is adding a "editNewsItem" method. Surely the easier solution. 2. You customize the RemoteControllerTool to modify the current "_editDocument" method with yet another specific key. 3. You propose/or wait that Nuxeo implements a more generic way to modify Binary attributes of CPS documents through XML-RPC. Cheers, -- Marc-Aurèle DARCHE NUXEO (Paris, France) http://nuxeo.com/ Nuxeo Collaborative Portal Server (CPS) http://www.cps-project.org/ Gestion de contenu web / portail collaboratif / logiciel libre _______________________________________________ cps-devel mailing list http://lists.nuxeo.com/mailman/listinfo/cps-devel
