Hi Grégory, I already created the jira's as Philip suggested. Still some remarks from me here.
> -----Original Message----- > From: dev-list-ow...@magnolia-cms.com [mailto:dev-list-ow...@magnolia- > cms.com] On Behalf Of Grégory Joseph > Sent: donderdag 8 oktober 2009 13:54 > To: Magnolia Dev-List > Subject: Re: [magnolia-dev] making PUR module more flexible > > > Hi Bert, > > Before you open the jira issues, maybe a short discussion: > > On Oct 6, 2009, at 4:05 PM, Bert Leunis wrote: > > > Hello Magnolians, > > > > I see that you are starting work on the PUR module. On this moment I > > work with PUR on one of our projects. The client will use PUR in a > > slightly different way than the intended scenario. I have two ideas > > that, when applied, can make the module more flexible. Thus the code > > will serve more different scenarios, with little effort. I think > > this can be achieved very easily and will lead to less programming > > work when adapting/applying PUR, but instead configuration. > > > > 1. Add a new method to > > info.magnolia.module.publicuserregistration.strategy.Mail: public > > void validateRegistration(User user, Map<String, Object> > > templateValues). This way the process using that class can add their > > templateValues themselves. > > It's the UserRegistrar which calls this method; if you need more > parameters in your mail templates, you probably want to subclass > i.m.m.pur.strategy.Mail anyway? Where do these parameters come from? > Why would you allow arbitrary parameters to be passed there, what's > the actual usecase? (as a side note, if this ends up being really > necessary, i'd rather change the method than add one) You can have extra parameters in your mail template, e.g. ${generatedPassword}. The EnableByUUID class will send the user a mail with that password, so that class adds all necessary params to the Map<String, Object>. No need to create your own strategy, all fields in Mail are oke, all I want is to fill the context with my own specific values. > > > > > 2. When you need an extra strategy, you have to adapt the > > PublicUserRegistrationConfig class. > > Uh? How so? As far as I know, you only need to configure it in / > modules/pur/config/registrationStrategy or ../passwordRetrievalStrategy > > > Instead of having a fixed set of 3 strategies, a list of strategies > > could be present in the config. > > Unless i missed something, it's not a fixed set and was indeed meant > so that one can have their custom strategies > My point is: I want to ADD another strategy (sendPasswordStrategy). The flow I need for my case here is different than the flow that is now 'dictated' by PUR. As far as I can see, it is a fixed set now. The class PublicUserRegistrationConfig has two strategies-properties. If they are stored in a map, I do not have to write any code, just add some config. > > Probably a module class has to be created that loads the strategies > > in a Map<String, Strategy>. From the module instance the strategy > > can then be retrieved by name. (I created a sendPasswordStrategy). > > I'm not sure what you mean, but then again, see above comments. I don't think the content2bean utils will convert a list of strategies in a Map<String, Strategy> automatically. That can be done in the module class (like it is done in the DataModule). > > > Some other issue I have is with the tree Public Users. All folders > > appear twice, in two shades. I didn't change the config of that. > > What's wrong here? > > Like Philipp said, this is something we know about and should be fixed > by now. > > > If you're interested I may apply a small patch for these changes. > > > Still interesting, of course :) > > Cheers, > > -g > ---------------------------------------------------------------- > For list details see > http://www.magnolia-cms.com/home/community/mailing-lists.html > To unsubscribe, E-mail to: <dev-list-unsubscr...@magnolia-cms.com> > ---------------------------------------------------------------- Hope this make my thoughts a bit more clear. Best of luck, Bert ---------------------------------------------------------------- For list details see http://www.magnolia-cms.com/home/community/mailing-lists.html To unsubscribe, E-mail to: <dev-list-unsubscr...@magnolia-cms.com> ----------------------------------------------------------------