Zope Plone 3.1.2 - export all users with email addresses
I have been running zope / plone site for about a year now - it seemed to be a pretty fast way of getting a CMS up and running and it's a great job for this - it's running 3.1.2 of plone. I am in now way a zope or plone expert (in fact the more I read about it - the less I know I know!) , but I am handy at python.
I have tried to export the users as xml - it fails with the unicode / id bug. I have tried export as a zexp file, but I can't actually find out how to read this file (I have tried import zope etc but I don't know what to do next !
I have found scripts that run li开发者_开发知识库sting all users, but these are for zope2 and, if I am honest, I wouldn't actually know how to install them anyway.
Can someone please either
1) tell me how to fix the id / unicode xml export bug? And please tell me in ways I can do directly on the site ? or 2) show me how to read and zope zexp file and do something simple like put it into a dict ?
I didn't know so many people were going to sign up for using my site and now I wish to move the email list management to another system - hence the requirement for the export.
Thanks in advance,
Richard.
Another way of extracting the email addresses of the users:
- Go to the root of the Plone site in the ZMI.
- Add a "Script (Python)".
- Come up with a nice id e.g. "export_email".
- Click on "Add and edit".
- Replace the code in the text field with the code listed below.
- Don't forget to save your changes.
- Go to the "test tab".
The code for the script:
for member in context.portal_membership.listMembers():
print member.getProperty('email')
return printed
OK - I'm going to put an answer here anyway, just in case anybody else ever gets stuck with this issue.
It's a cheat really, but I edited the /portal_skins/custom/prefs_users_overview and changed the line below from :20 to :2000 and then just did a simple user search, and then I HTML scraped the mailto: addresses.
b_size request/b_size | python:2000;
If anybody else finds this useful, let me know !
精彩评论