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:[EMAIL PROTECTED]: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

Reply via email to