Question

I must create a conference site, this conference occurred every year once.

Users have to register, fill out ~10 questions and upload 2 files. In the following year the users should be able to login and correct their data.

planned to use:
plone.app.forms
dexterity.membrane

Any ideas are welcome.

Was it helpful?

Solution

you can use an alternative approach based on a feature provided by the portal membership. Create your own object UserFolder object and tells the portal membership to use it as a user folder type. To do so you'll have just to change the portal membership settings at install time and enable the "my folder action":

def setup_membership(self, site):
    portal_membership = getToolByName(site, 'portal_membership')
    workflow = getMultiAdapter((site, site.REQUEST), name=u'plone_tools').workflow()

    # setup member area
    if not site.hasObject(USERS_FOLDER_ID):
        site.invokeFactory('Folder', USERS_FOLDER_ID, **{'title':'Users'})

    users_folder = site[USERS_FOLDER_ID]
    users_folder.processForm()

    # publish the users folder
    ...

    users_folder.setExcludeFromNav(True)
    users_folder.reindexObject()

    # set members area folder
    portal_membership.setMembersFolderById(USERS_FOLDER_ID)

    # setup member area type
    portal_membership.manage_setMemberAreaType('UserProfile')

    # enable members memberarea creation
    portal_membership.memberareaCreationFlag = 1

    # enable the 'my folder' user action, etc...
    ...

This way you'll still use the standard plone user and you'll gain a complete control of your application, you also may choose where put UserFolder objects (maybe into a /users folder), workflows, add new profile fields, etc. No membrane is needed so.

I had also a similar requirement for allowing to upload N and only max N attachments (or other objects). I suggest you to add an event handler for added UserProfile objects. This way you can force the creation of two or more file attachments and give the user just the edit permission. He will not able to add other attachments and you still use standard file or image objects, without having to deal with blob storage.

This worked very well for me with an archetypes-based project, but it should be the same for dexterity.

Hope it might help :)

OTHER TIPS

I suggest you to avoid touching the user schema. You can create a custom content type with your questions and files and share it with your users.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top