001 package net.databinder.auth.components.hib;
002
003 import net.databinder.auth.AuthApplication;
004 import net.databinder.auth.components.DataProfilePanelBase;
005 import net.databinder.auth.components.DataSignInPageBase.ReturnPage;
006 import net.databinder.components.hib.DataForm;
007 import net.databinder.models.hib.HibernateObjectModel;
008
009 import org.apache.wicket.markup.html.form.Form;
010 import org.apache.wicket.model.IModel;
011
012 /**
013 * Registration with username, password, and password confirmation.
014 * Replaceable String resources: <pre>
015 * data.auth.username
016 * data.auth.password
017 * data.auth.passwordConfirm
018 * data.auth.remember
019 * data.auth.register
020 * data.auth.update
021 * data.auth.username.taken * </pre> * Must be overriden in a containing page
022 * or a subclass of this panel.
023 */
024 public class DataProfilePanel extends DataProfilePanelBase {
025 public DataProfilePanel(String id, ReturnPage returnPage) {
026 super(id, returnPage);
027 }
028
029 @Override
030 protected Form profileForm(String id, IModel userModel) {
031 if (userModel == null)
032 userModel = new HibernateObjectModel(((AuthApplication)getApplication()).getUserClass());
033
034 return new DataForm(id, (HibernateObjectModel) userModel) {
035 @Override
036 protected void onSubmit() {
037 super.onSubmit();
038 DataProfilePanel.this.afterSubmit();
039 }
040 };
041 }
042
043 }