Reputation:
I'm currently trying to extend the Liferay create account process so the user gets asked to provide his or hers telephone number and address during registration.
I know that Liferay supports the concepts of custom fields and I have managed to add them to the registration form and persist them to the database. However, out of the box, Liferay has support for phone numbers and addresses to be associated with an user account. I don't think it is a sound development technique to use custom fields for something that is already there.
Anyways my question is, what is the preferred technique to ask for an address and/or a phone number during registration? I tried hooking to the Struts registration action but I don't think that is the solution, in order to use the PhoneLocalService ot AddressLocalService I need a user ID and I get the user ID after I add the user to the database.
I admit hooking and extending Liferay is a bit of a mess for me right now, so any advice will be appreciated.
Upvotes: 2
Views: 1749
Reputation: 10606
Unfortunately, the standard customization is quite limited (with a few properties you can turn on-off some features, like the captcha, or the prefix-postfix titles, etc., but nothing complicated).
The only way to customize registration JSP and the contacts JSP, mix them up and put it into the hook as the registration form.
I have done the exactly same thing as you need here, and I must say the handling of addresses and phones is a complete mess on first sight (it is done with auto forms, because you can have multiple ones). After throwing out the unnecessary code though it is quite straightforward to include a fix number of phone/address on the registration form.
Upvotes: 0