26 Nov 22:48
Re: Portal remote controller and CPS Image Field
Daniel de la Cuesta a écrit : > Hi, > > I am using portal_remote_controler to create documents from a java > xmlrpc client. > > Here is my schema: > > > height > <http://www.informarseessalud.org/sm/portal_schemas/thumb/f__height/manage_workspace> > > > CPS Int Field > > image > <http://www.informarseessalud.org/sm/portal_schemas/thumb/f__image/manage_workspace> > > > CPS Image Field > > video_index > <http://www.informarseessalud.org/sm/portal_schemas/thumb/f__video_index/manage_workspace> > > > CPS Int Field > > video_length > <http://www.informarseessalud.org/sm/portal_schemas/thumb/f__video_length/manage_workspace> > > > CPS Int Field > > width > <http://www.informarseessalud.org/sm/portal_schemas/thumb/f__width/manage_workspace> > > > CPS Int Field > > > > > As you can see, my document has a CPS Image Field in its schema, I can > asign values to all the fields except the CPS Image Field. > > I am using the Apache WS-XMLRPC for the client, I read the image file, I > encode it to base64 but when I execute the "createDocument" method with > that field I get the following exception: > > org.apache.xmlrpc.XmlRpcException: Unexpected Zope exception: > exceptions.IndexError - list index out of range > at > org.apache.xmlrpc.client.XmlRpcStreamTransport.readResponse(XmlRpcStreamTransport.java:197) > > Any idea? > I suggest to try to simplify the problem to find where the problem is. 1. First could you please validate if creating a File field works for you? If this works that could mean that the encoding of binary data is not the cause of the problem. 2. Another try would be to test the creation of your document from pure Python code as is specified in the CPSRemoteController doc: from xmlrpclib import ServerProxy, Binary f = open('MyImage.png', 'r') binary = Binary(f.read()) p.createDocument('MySpecialZipFile', {'Title': "The report from Monday meeting", 'Description': "Another boring report"}, 'file_name': "MyImage.png", 'file_key': 'file_zip', 'file': binary, }, 'workspaces') And please when having an error, could you please also send the stacktrace from the server, as there should be one. Cheers, -- -- Marc-Aurèle DARCHE AFUL http://www.aful.org/ Association Francophone des Utilisateurs de Logiciels Libres French speaking Libre Software Users' Association _______________________________________________ cps-devel mailing list http://lists.nuxeo.com/mailman/listinfo/cps-devel
RSS Feed