I use xmlrpclib, wsapi4plone to upload stuff to plone.
Say I’m going to create a folder:
client = xmlrpclib.ServerProxy('http://user:password@blah.com/plone')
f = {'blah.com/plone/folder':
[
{'title': folder},
'Folder', None,
]
}
print 'Creating...', client.post_object(f)
then upload a page in that folder:
page = {'blah.com/plone/filename':
[
{'title':filename, 'text':file.read()},
'Document',None,
]
}
client.post_object(page)
How do I set the folder to use this page for its default view through python?
Also, I am not the admin, just a normal user just so you know..
Could you please help? Thank you
The method you are looking for is
setDefaultPageon the folder. If you have the right to set the default page through the web with your user, you have the same right via XML-RPC, access control is method agnostic.setDefaultPagetakes the id of the page object as an argument.setDefaultPageis part of theISelectableBrowserDefaultinterface, take a look at that for more details.