CPS 3.4.3 portal_remote_controller - adding document content

"Daniel Frings" <frings-FJH3MN/[email protected]>
Newsgroups gmane.comp.web.zope.cps.devel
Message-ID <[email protected]>
Hey all,
i'm trying to add some content to an CPS workspace with an external
python script and the portal_remote_controler.

My problem is that the document is created with a text block but the
textblock remains empty.

can anybody help me?
Here the code:

-----------------------------------------
from xmlrpclib import ServerProxy
import datetime
import time

date = datetime.datetime.utcfromtimestamp(time.time())
title='Daniel_Test_Document'
description='Test Description %s' % date

constr = 'http://XXX:YYY@localhost:8080/cps_test/portal_remote_controller'
p = ServerProxy(constr)


def test_createDocument(title, description):
   content_template ='''\
Content:

- Title: %s

- Description: %s
'''
   content = content_template % (title, description, )

   doc_def = {
       'Title': title,
       'Description': description,
       'content': content,
       'content_format': 'text',
   }
   doc_rpath = 'workspaces/kram'
   result = p.createDocument('Document', doc_def, doc_rpath)
   print 'result: "%s"\n \n %s' % (result,content)

if __name__ == '__main__':
 test_createDocument(title, description)
-----------------------------------------


The result is:
-----------------------------------------
wserv02:/z # python addDoc.py
result: "workspaces/kram/daniel_test_document"

 Content:

- Title: Daniel_Test_Document

- Description: Test Description 2007-03-15 11:24:20.348167
-----------------------------------------
but there is NO content inside the document...


Thanks,
Daniel Frings
_______________________________________________
cps-devel mailing list
http://lists.nuxeo.com/mailman/listinfo/cps-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.