tags:

views:

112

answers:

2

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 listing 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.

A: 

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 !

Richard Green
+1  A: 

Another way of extracting the email addresses of the users:

  1. Go to the root of the Plone site in the ZMI.
  2. Add a "Script (Python)".
    1. Come up with a nice id e.g. "export_email".
    2. Click on "Add and edit".
    3. Replace the code in the text field with the code listed below.
    4. Don't forget to save your changes.
  3. Go to the "test tab".

The code for the script:

for member in context.portal_membership.listMembers():
    print member.getProperty('email')
return printed
Mark van Lent
Thanks ! Will give this a go. I have zero knowledge of plone / ZMI etc so the step-by-step instructions are a real help.
Richard Green
Brilliant. Works a treat. Although I should have specified this at the beginning, can you tell me the fieldname I should refer to in order to get either joining date or last logged in date ( or a reference to documentation where I can get all of the fields for member objects). Thanks again!
Richard Green
Ok.. last reply! I found the member get property stuff and just printed out all fields, narrowed down to the ones I needed and am now displaying those. You've saved me a costly trip to odesk ! Thanks!
Richard Green
Glad I could still be of assistence. :)
Mark van Lent