- introduced isUserNameRequired() which should make it sure to have registrations with no user name and password. This also includes no login area (not possible)
- the user then will get a random user name with format "userXXXXX" and a random password. So it is still possible that the "feature" login area for users can come back.
- so no "recover password" is possible, too. Therefore such links can be removed from the menu.
- introduced isMultiplePageEnabled() which is used as a "switch" between single-page and multiple-page registration
- introduced isPublicUserProfileEnabled() which is used to disabled/enable the feature "public user profiles" which is sometimes not wanted ...
- introduced isResendConfirmationLinkEnabled() which disabled the corresponding feature
- showing a "choose profile-mode" while no public user profile is enabled makes no sense ... So better "hide" this option.
- introduced general (abstract) controller Base<project-name>Controller which currently holds a method for checking if for a named controller debug mode is enabled
- renamed doRegister() to doFinishRegistration()
- removed no longer used i18n strings (they may have come back by cherry-picking)
- registration page 1/2 should be "basicly finished" now, single is also available
- index page is now jlandingpage-specific as registration page is in index.xhtml (careful, cherry-picking this!)
- added controller method doRegisterMultiPage1()
- added a lot more language strings
- renamed variables
- added context parameters for above new methods
- added needed navigation cases (careful with cherry-picking again)
- sorted imports (minor)
- fixed i18n string (usage)
Signed-off-by: Roland Häder <roland@haeder.net>
Signed-off-by: Roland Häder <roland@mxchange.org>
<Scene Scope="Project" version="2">
<Scope Scope="Faces Configuration Only"/>
<Scope Scope="Project">
- <Node id="admin/cellphone/admin_contact_cellphone_list.xhtml" x="400" y="150" zoom="true"/>
- <Node id="admin/contact/admin_contact_show.xhtml" x="400" y="450" zoom="true"/>
- <Node id="privacy.xhtml" x="1400" y="750" zoom="true"/>
- <Node id="admin/mobile_provider/admin_mobile_provider_show.xhtml" x="150" y="300" zoom="true"/>
- <Node id="guest/user/show_addressbook.xhtml" x="1150" y="450" zoom="true"/>
- <Node id="admin/user/admin_user_show.xhtml" x="400" y="1050" zoom="true"/>
- <Node id="admin/index.xhtml" x="900" y="900" zoom="true"/>
- <Node id="user/login_own_addressbooks.xhtml" x="400" y="750" zoom="true"/>
- <Node id="guest/recruiter/login.xhtml" x="2150" y="300" zoom="true"/>
- <Node id="user/login_user_data_saved.xhtml" x="150" y="900" zoom="true"/>
- <Node id="admin/admin_logout.xhtml" x="650" y="150" zoom="true"/>
- <Node id="user/login_data_saved.xhtml" x="650" y="450" zoom="true"/>
- <Node id="admin/user/admin_user_unlock.xhtml" x="2400" y="150" zoom="true"/>
- <Node id="guest/user/user_list.xhtml" x="650" y="600" zoom="true"/>
- <Node id="index.xhtml" x="400" y="1350" zoom="true"/>
- <Node id="user/login_edit_user_data.xhtml" x="400" y="900" zoom="true"/>
- <Node id="*" x="900" y="150" zoom="true"/>
- <Node id="admin/admin_category_delete.xhtml" x="2150" y="150" zoom="true"/>
- <Node id="admin/cellphone/admin_contact_cellphone_edit.xhtml" x="150" y="750" zoom="true"/>
- <Node id="user/login_index.xhtml" x="1150" y="900" zoom="true"/>
- <Node id="guest/user/lost_passwd.xhtml" x="1650" y="600" zoom="true"/>
- <Node id="guest/user/register_done.xhtml" x="650" y="1050" zoom="true"/>
- <Node id="guest/user/show_addressbook_entries.xhtml" x="400" y="600" zoom="true"/>
- <Node id="admin/cellphone/admin_contact_cellphone_unlink.xhtml" x="1900" y="150" zoom="true"/>
- <Node id="admin/country/admin_country_list.xhtml" x="1900" y="450" zoom="true"/>
- <Node id="guest/user/login_error.xhtml" x="1400" y="300" zoom="true"/>
- <Node id="admin/mobile_provider/admin_mobile_provider_delete.xhtml" x="1400" y="450" zoom="true"/>
- <Node id="user/login_change_password.xhtml" x="900" y="450" zoom="true"/>
- <Node id="admin/mobile_provider/admin_mobile_provider_list.xhtml" x="150" y="150" zoom="true"/>
- <Node id="guest/user/user_profile.xhtml" x="900" y="600" zoom="true"/>
- <Node id="admin/user/admin_user_delete.xhtml" x="650" y="900" zoom="true"/>
- <Node id="admin/cellphone/admin_contact_cellphone_delete.xhtml" x="150" y="1200" zoom="true"/>
- <Node id="exception.xhtml" x="150" y="1500" zoom="true"/>
- <Node id="admin/user/admin_user_edit.xhtml" x="150" y="450" zoom="true"/>
- <Node id="terms.xhtml" x="150" y="1350" zoom="true"/>
- <Node id="admin/contact/admin_contact_list.xhtml" x="1400" y="150" zoom="true"/>
- <Node id="admin/contact/admin_contact_edit.xhtml" x="1650" y="300" zoom="true"/>
- <Node id="admin/user/admin_user_list.xhtml" x="1150" y="150" zoom="true"/>
- <Node id="admin/admin_user_add.xhtml" x="650" y="750" zoom="true"/>
- <Node id="admin/country/admin_country_delete.xhtml" x="1900" y="300" zoom="true"/>
- <Node id="user/login_change_personal_data.xhtml" x="400" y="300" zoom="true"/>
+ <Node id="admin/cellphone/admin_contact_cellphone_list.xhtml" x="650" y="150" zoom="true"/>
+ <Node id="admin/contact/admin_contact_show.xhtml" x="650" y="1050" zoom="true"/>
+ <Node id="privacy.xhtml" x="900" y="600" zoom="true"/>
+ <Node id="guest/user/show_addressbook.xhtml" x="150" y="300" zoom="true"/>
+ <Node id="admin/mobile_provider/admin_mobile_provider_show.xhtml" x="400" y="1200" zoom="true"/>
+ <Node id="admin/user/admin_user_show.xhtml" x="650" y="450" zoom="true"/>
+ <Node id="admin/index.xhtml" x="1900" y="150" zoom="true"/>
+ <Node id="user/login_own_addressbooks.xhtml" x="2150" y="150" zoom="true"/>
+ <Node id="user/login_user_data_saved.xhtml" x="1150" y="300" zoom="true"/>
+ <Node id="admin/admin_logout.xhtml" x="900" y="450" zoom="true"/>
+ <Node id="user/login_data_saved.xhtml" x="1400" y="150" zoom="true"/>
+ <Node id="admin/user/admin_user_unlock.xhtml" x="900" y="750" zoom="true"/>
+ <Node id="guest/user/user_list.xhtml" x="150" y="1350" zoom="true"/>
+ <Node id="index.xhtml" x="650" y="1200" zoom="true"/>
+ <Node id="user/login_edit_user_data.xhtml" x="650" y="750" zoom="true"/>
+ <Node id="*" x="1650" y="150" zoom="true"/>
+ <Node id="admin/admin_category_delete.xhtml" x="1400" y="600" zoom="true"/>
+ <Node id="user/login_index.xhtml" x="1150" y="750" zoom="true"/>
+ <Node id="admin/cellphone/admin_contact_cellphone_edit.xhtml" x="1900" y="450" zoom="true"/>
+ <Node id="guest/user/lost_passwd.xhtml" x="1150" y="600" zoom="true"/>
+ <Node id="guest/user/register_done.xhtml" x="150" y="150" zoom="true"/>
+ <Node id="guest/user/show_addressbook_entries.xhtml" x="1650" y="450" zoom="true"/>
+ <Node id="admin/cellphone/admin_contact_cellphone_unlink.xhtml" x="400" y="1350" zoom="true"/>
+ <Node id="admin/country/admin_country_list.xhtml" x="150" y="1500" zoom="true"/>
+ <Node id="guest/user/login_error.xhtml" x="400" y="900" zoom="true"/>
+ <Node id="admin/mobile_provider/admin_mobile_provider_delete.xhtml" x="1400" y="300" zoom="true"/>
+ <Node id="user/login_change_password.xhtml" x="2150" y="300" zoom="true"/>
+ <Node id="admin/mobile_provider/admin_mobile_provider_list.xhtml" x="1650" y="300" zoom="true"/>
+ <Node id="guest/user/user_profile.xhtml" x="900" y="300" zoom="true"/>
+ <Node id="admin/user/admin_user_delete.xhtml" x="400" y="150" zoom="true"/>
+ <Node id="admin/cellphone/admin_contact_cellphone_delete.xhtml" x="400" y="300" zoom="true"/>
+ <Node id="exception.xhtml" x="1150" y="900" zoom="true"/>
+ <Node id="guest/user/register_page2.xhtml" x="150" y="750" zoom="true"/>
+ <Node id="admin/user/admin_user_edit.xhtml" x="900" y="1050" zoom="true"/>
+ <Node id="terms.xhtml" x="1400" y="750" zoom="true"/>
+ <Node id="admin/contact/admin_contact_edit.xhtml" x="1400" y="450" zoom="true"/>
+ <Node id="admin/contact/admin_contact_list.xhtml" x="1900" y="300" zoom="true"/>
+ <Node id="admin/admin_user_add.xhtml" x="150" y="600" zoom="true"/>
+ <Node id="admin/user/admin_user_list.xhtml" x="650" y="900" zoom="true"/>
+ <Node id="admin/country/admin_country_delete.xhtml" x="1150" y="150" zoom="true"/>
+ <Node id="user/login_change_personal_data.xhtml" x="150" y="450" zoom="true"/>
+ <Node id="logout.xhtml" x="150" y="900" zoom="true"/>
<Node id="admin/country/admin_country_edit.xhtml" x="150" y="1050" zoom="true"/>
- <Node id="logout.xhtml" x="900" y="1050" zoom="true"/>
- <Node id="guest/user/resend_link.xhtml" x="1150" y="600" zoom="true"/>
- <Node id="user/login_add_addressbook.xhtml" x="900" y="750" zoom="true"/>
- <Node id="user/login_contact_data_saved.xhtml" x="1150" y="750" zoom="true"/>
- <Node id="admin/contact/admin_contact_delete.xhtml" x="1650" y="150" zoom="true"/>
- <Node id="imprint.xhtml" x="150" y="600" zoom="true"/>
- <Node id="admin/mobile_provider/admin_mobile_provider_edit.xhtml" x="900" y="300" zoom="true"/>
- <Node id="admin/cellphone/admin_contact_cellphone_show.xhtml" x="1650" y="450" zoom="true"/>
- <Node id="guest/user/login.xhtml" x="1400" y="600" zoom="true"/>
- <Node id="admin/admin_product_delete.xhtml" x="400" y="1200" zoom="true"/>
- <Node id="guest/user/register.xhtml" x="1150" y="300" zoom="true"/>
- <Node id="user/login_change_email_address.xhtml" x="650" y="1200" zoom="true"/>
- <Node id="user/login/login_data_saved.xhtml" x="650" y="300" zoom="true"/>
+ <Node id="user/login_add_addressbook.xhtml" x="650" y="300" zoom="true"/>
+ <Node id="guest/user/resend_link.xhtml" x="650" y="600" zoom="true"/>
+ <Node id="user/login_contact_data_saved.xhtml" x="400" y="600" zoom="true"/>
+ <Node id="admin/contact/admin_contact_delete.xhtml" x="900" y="900" zoom="true"/>
+ <Node id="imprint.xhtml" x="900" y="150" zoom="true"/>
+ <Node id="admin/mobile_provider/admin_mobile_provider_edit.xhtml" x="1150" y="450" zoom="true"/>
+ <Node id="admin/cellphone/admin_contact_cellphone_show.xhtml" x="1650" y="600" zoom="true"/>
+ <Node id="admin/admin_product_delete.xhtml" x="400" y="750" zoom="true"/>
+ <Node id="guest/user/login.xhtml" x="400" y="1050" zoom="true"/>
+ <Node id="guest/user/register.xhtml" x="150" y="1200" zoom="true"/>
+ <Node id="user/login_change_email_address.xhtml" x="2400" y="150" zoom="true"/>
+ <Node id="user/login/login_data_saved.xhtml" x="400" y="450" zoom="true"/>
</Scope>
<Scope Scope="All Faces Configurations"/>
</Scene>
--- /dev/null
+/*
+ * Copyright (C) 2016 Roland Haeder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jjobs.beans;
+
+import java.io.Serializable;
+import javax.faces.context.FacesContext;
+
+/**
+ * A general controller
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+public abstract class BaseJobsController implements Serializable {
+
+ /**
+ * Serial number
+ */
+ private static final long serialVersionUID = 50_837_597_127_567_140L;
+
+ /**
+ * Checks whether debug mode is enabled for given controller
+ * <p>
+ * @param controllerName Name of controller
+ * <p>
+ * @return Whether debug mode is enabled
+ */
+ protected boolean isDebugModeEnabled (final String controllerName) {
+ // Parameters should be valid
+ if (null == controllerName) {
+ // Throw NPE
+ throw new NullPointerException("controllerName is null"); //NOI18N
+ } else if (controllerName.isEmpty()) {
+ // Is empty
+ throw new IllegalArgumentException("controllerName is empty"); //NOI18N
+ }
+
+ // Try to get context parameter
+ String contextParameter = FacesContext.getCurrentInstance().getExternalContext().getInitParameter(String.format("is_debug_%s_enabled", controllerName)); //NOI18N
+
+ // Is it set and true?
+ boolean isEnabled = ((contextParameter instanceof String) && (contextParameter.equals("true"))); //NOI18N
+
+ // Return it
+ return isEnabled;
+ }
+
+}
*/
@Named ("addressbookController")
@SessionScoped
-public class JobsAddressbookWebSessionBean implements JobsAddressbookWebSessionController {
+public class JobsAddressbookWebSessionBean extends BaseJobsController implements JobsAddressbookWebSessionController {
/**
* Serial number
import org.mxchange.jcontacts.events.contact.update.AdminUpdatedContactEvent;
import org.mxchange.jcontacts.exceptions.ContactAlreadyAddedException;
import org.mxchange.jcountry.data.Country;
+import org.mxchange.jjobs.beans.BaseJobsController;
import org.mxchange.jjobs.beans.helper.JobsAdminWebRequestController;
import org.mxchange.jphone.phonenumbers.cellphone.CellphoneNumber;
import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber;
*/
@Named ("adminContactController")
@RequestScoped
-public class JobsAdminContactWebRequestBean implements JobsAdminContactWebRequestController {
+public class JobsAdminContactWebRequestBean extends BaseJobsController implements JobsAdminContactWebRequestController {
/**
* Serial number
import org.mxchange.jcontacts.events.contact.update.AdminUpdatedContactEvent;
import org.mxchange.jcontacts.exceptions.ContactNotFoundException;
import org.mxchange.jcountry.data.Country;
+import org.mxchange.jjobs.beans.BaseJobsController;
import org.mxchange.jjobs.beans.login.JobsUserLoginWebSessionController;
import org.mxchange.jphone.phonenumbers.cellphone.CellphoneNumber;
import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber;
*/
@Named ("contactController")
@SessionScoped
-public class JobsContactWebSessionBean implements JobsContactWebSessionController {
+public class JobsContactWebSessionBean extends BaseJobsController implements JobsContactWebSessionController {
/**
* Serial number
import org.mxchange.jcountry.events.AdminAddedCountryEvent;
import org.mxchange.jcountry.events.AdminEventCountryAdded;
import org.mxchange.jcountry.exceptions.CountryAlreadyAddedException;
+import org.mxchange.jjobs.beans.BaseJobsController;
/**
* An administrative country bean
*/
@Named ("adminCountryController")
@RequestScoped
-public class JobsAdminCountryWebRequestBean implements JobsAdminCountryWebRequestController {
+public class JobsAdminCountryWebRequestBean extends BaseJobsController implements JobsAdminCountryWebRequestController {
/**
* Serial number
import org.mxchange.jcountry.data.Country;
import org.mxchange.jcountry.data.CountrySingletonBeanRemote;
import org.mxchange.jcountry.events.AdminAddedCountryEvent;
+import org.mxchange.jjobs.beans.BaseJobsController;
/**
* A country bean
*/
@Named ("country")
@ApplicationScoped
-public class JobsCountryWebApplicationBean implements JobsCountryWebApplicationController {
+public class JobsCountryWebApplicationBean extends BaseJobsController implements JobsCountryWebApplicationController {
/**
* Serial number
import javax.naming.InitialContext;
import javax.naming.NamingException;
import org.mxchange.jcontacts.contact.Contact;
+import org.mxchange.jjobs.beans.BaseJobsController;
import org.mxchange.jjobs.beans.login.JobsUserLoginWebSessionController;
import org.mxchange.jusercore.exceptions.UserPasswordMismatchException;
import org.mxchange.jusercore.model.email_address.ChangeableEmailAddress;
*/
@Named ("emailChangeController")
@SessionScoped
-public class JobsEmailChangeWebSessionBean implements JobsEmailChangeWebSessionController {
+public class JobsEmailChangeWebSessionBean extends BaseJobsController implements JobsEmailChangeWebSessionController {
/**
* Serial number
import javax.inject.Named;
import org.mxchange.jcontacts.contact.gender.Gender;
import org.mxchange.jcontacts.contact.gender.GenderUtils;
+import org.mxchange.jjobs.beans.BaseJobsController;
/**
* A gender bean
*/
@Named ("gender")
@ApplicationScoped
-public class JobsGenderWebApplicationBean implements JobsGenderWebApplicationController {
+public class JobsGenderWebApplicationBean extends BaseJobsController implements JobsGenderWebApplicationController {
/**
* Serial number
import javax.enterprise.context.SessionScoped;
import javax.faces.context.FacesContext;
import javax.inject.Named;
-import org.mxchange.jcoreee.database.BaseDatabaseBean;
+import org.mxchange.jjobs.beans.BaseJobsController;
/**
* A session bean for handling localization/internationalization changes. This
*/
@Named ("localizationController")
@SessionScoped
-public class JobsLocalizationSessionBean extends BaseDatabaseBean implements JobsLocalizationSessionController {
+public class JobsLocalizationSessionBean extends BaseJobsController implements JobsLocalizationSessionController {
/**
* Serial number
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
+import org.mxchange.jjobs.beans.BaseJobsController;
import org.mxchange.jjobs.beans.user.JobsUserWebSessionController;
import org.mxchange.jusercore.container.login.LoginContainer;
import org.mxchange.jusercore.container.login.UserLoginContainer;
*/
@Named ("loginController")
@SessionScoped
-public class JobsUserLoginWebSessionBean implements JobsUserLoginWebSessionController {
+public class JobsUserLoginWebSessionBean extends BaseJobsController implements JobsUserLoginWebSessionController {
/**
* Serial number
import javax.naming.InitialContext;
import javax.naming.NamingException;
import org.mxchange.jcountry.data.Country;
+import org.mxchange.jjobs.beans.BaseJobsController;
import org.mxchange.jphone.events.AdminAddedMobileProviderEvent;
import org.mxchange.jphone.events.AdminMobileProviderAddedEvent;
import org.mxchange.jphone.exceptions.MobileProviderAlreadyAddedException;
*/
@Named ("adminMobileProviderController")
@RequestScoped
-public class JobsAdminMobileProviderWebRequestBean implements JobsAdminMobileProviderWebRequestController {
+public class JobsAdminMobileProviderWebRequestBean extends BaseJobsController implements JobsAdminMobileProviderWebRequestController {
/**
* Serial number
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
+import org.mxchange.jjobs.beans.BaseJobsController;
import org.mxchange.jphone.events.AdminAddedMobileProviderEvent;
import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider;
import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProviderSingletonBeanRemote;
*/
@Named ("mobileProviderController")
@SessionScoped
-public class JobsMobileProviderWebRequestBean implements JobsMobileProviderWebRequestController {
+public class JobsMobileProviderWebRequestBean extends BaseJobsController implements JobsMobileProviderWebRequestController {
/**
* Serial number
import javax.naming.NamingException;
import org.mxchange.jcontacts.contact.Contact;
import org.mxchange.jcontacts.phone.AdminContactsPhoneSessionBeanRemote;
+import org.mxchange.jjobs.beans.BaseJobsController;
import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber;
import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
*/
@Named ("adminContactPhoneController")
@RequestScoped
-public class JobsAdminContactPhoneWebSessionBean implements JobsAdminContactPhoneWebSessionController {
+public class JobsAdminContactPhoneWebSessionBean extends BaseJobsController implements JobsAdminContactPhoneWebSessionController {
/**
* Serial number
import javax.faces.view.facelets.FaceletException;
import javax.inject.Inject;
import javax.inject.Named;
+import org.mxchange.jjobs.beans.BaseJobsController;
import org.mxchange.jjobs.beans.login.JobsUserLoginWebSessionController;
import org.mxchange.jjobs.beans.user.JobsUserWebSessionController;
import org.mxchange.jusercore.exceptions.UserNotFoundException;
*/
@Named (value = "profileController")
@RequestScoped
-public class JobsUserProfileWebRequestBean implements JobsUserProfileWebRequestController {
+public class JobsUserProfileWebRequestBean extends BaseJobsController implements JobsUserProfileWebRequestController {
/**
* Serial number
@Override
public boolean isProfileLinkVisibleById (final Long userId) {
// Init user instance
- User u = null;
+ User user = null;
try {
// Try to get it
- u = this.userController.lookupUserById(userId);
+ user = this.userController.lookupUserById(userId);
} catch (final UserNotFoundException ex) {
// Throw again
throw new FaceletException(ex);
}
// Is it null?
- if (null == u) {
+ if (null == user) {
// Not found, not visible.
return false;
}
// Ask other method
- return this.isProfileLinkVisibleByUser(u);
+ return this.isProfileLinkVisibleByUser(user);
}
@Override
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Named;
+import org.mxchange.jjobs.beans.BaseJobsController;
import org.mxchange.jusercore.model.user.profilemodes.ProfileMode;
/**
*/
@Named ("profileMode")
@ApplicationScoped
-public class JobsProfileModeWebApplicationBean implements JobsProfileModeWebApplicationController {
+public class JobsProfileModeWebApplicationBean extends BaseJobsController implements JobsProfileModeWebApplicationController {
/**
* Serial number
import javax.enterprise.context.SessionScoped;
import javax.enterprise.event.Event;
import javax.enterprise.inject.Any;
+import javax.faces.context.FacesContext;
import javax.faces.view.facelets.FaceletException;
import javax.inject.Inject;
import javax.inject.Named;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
+import org.mxchange.jjobs.beans.BaseJobsController;
import org.mxchange.jjobs.beans.contact.JobsContactWebSessionController;
import org.mxchange.jjobs.beans.user.JobsAdminUserWebRequestController;
import org.mxchange.jjobs.beans.user.JobsUserWebSessionController;
*/
@Named ("registerController")
@SessionScoped
-public class JobsUserRegisterWebSessionBean implements JobsUserRegisterWebSessionController {
+public class JobsUserRegisterWebSessionBean extends BaseJobsController implements JobsUserRegisterWebSessionController {
/**
* Serial number
}
@Override
- public String doRegister () {
+ public String doFinishRegistration () {
// Get user instance
User user = this.userController.createUserInstance();
// Is the user already used?
if (null == user) {
// user must be set
- throw new NullPointerException("user is null"); //NOI18N
+ throw new NullPointerException("user is null after createUserInstance() was called"); //NOI18N
} else if (!this.userController.isRequiredPersonalDataSet()) {
// Not all required fields are set
throw new FaceletException("Not all required fields are set."); //NOI18N
// Set it here
user.setUserEncryptedPassword(encryptedPassword);
- // For debugging/programming only:
- user.setUserAccountStatus(UserAccountStatus.CONFIRMED);
+ // Is developer mode?
+ if (this.isDebugModeEnabled("register")) { //NOI18N
+ // For debugging/programming only:
+ user.setUserAccountStatus(UserAccountStatus.CONFIRMED);
+ } else {
+ // No debugging of this part
+ user.setUserAccountStatus(UserAccountStatus.UNCONFIRMED);
+ }
try {
// Call bean
}
}
+ @Override
+ public String doRegisterMultiPage1 () {
+ // Now only redirect to next page as the JSF does it
+ return "register_page2"; //NOI18N
+ }
+
+ @Override
+ public boolean isMultiplePageEnabled () {
+ // Get context parameter
+ String contextParameter = FacesContext.getCurrentInstance().getExternalContext().getInitParameter("is_multi_register_page"); //NOI18N
+
+ // Is it set?
+ boolean isEnabled = ((contextParameter instanceof String) && (contextParameter.toLowerCase().equals("true"))); //NOI18N
+
+ // Return value
+ return isEnabled;
+ }
+
+ @Override
+ public boolean isResendConfirmationLinkEnabled () {
+ // Get context parameter
+ String contextParameter = FacesContext.getCurrentInstance().getExternalContext().getInitParameter("is_resend_confirm_link_enabled"); //NOI18N
+
+ // Is it set?
+ boolean isEnabled = ((contextParameter instanceof String) && (contextParameter.toLowerCase().equals("true"))); //NOI18N
+
+ // Return value
+ return isEnabled;
+ }
+
}
* <p>
* @return Redirection target
*/
- String doRegister ();
+ String doFinishRegistration ();
+
+ /**
+ * Handles registration request send from first page. The (maybe) entered
+ * user name and email address is not used and that privacy and T&C are
+ * accepted.
+ * <p>
+ * @return Redirect
+ */
+ String doRegisterMultiPage1 ();
+
+ /**
+ * Checks wether multi-page or single-page registration is active
+ * <p>
+ * @return Whether multi (true) or single page (false) is active
+ */
+ boolean isMultiplePageEnabled ();
+
+ /**
+ * Checks whether the "resend confirmation link" feature is enabled
+ * <p>
+ * @return Whether "resend confirmation link" is enabled
+ */
+ boolean isResendConfirmationLinkEnabled ();
}
import javax.naming.InitialContext;
import javax.naming.NamingException;
import org.mxchange.jcontacts.contact.Contact;
+import org.mxchange.jjobs.beans.BaseJobsController;
import org.mxchange.jjobs.beans.contact.JobsContactWebSessionController;
import org.mxchange.jjobs.beans.helper.JobsAdminWebRequestController;
import org.mxchange.jjobs.beans.login.JobsUserLoginWebSessionController;
*/
@Named ("adminUserController")
@RequestScoped
-public class JobsAdminUserWebRequestBean implements JobsAdminUserWebRequestController {
+public class JobsAdminUserWebRequestBean extends BaseJobsController implements JobsAdminUserWebRequestController {
/**
* Serial number
import javax.enterprise.event.Event;
import javax.enterprise.event.Observes;
import javax.enterprise.inject.Any;
+import javax.faces.context.FacesContext;
import javax.faces.view.facelets.FaceletException;
import javax.inject.Inject;
import javax.inject.Named;
import org.mxchange.jcontacts.contact.Contact;
import org.mxchange.jcontacts.contact.ContactSessionBeanRemote;
import org.mxchange.jcontacts.events.contact.add.AdminAddedContactEvent;
+import org.mxchange.jjobs.beans.BaseJobsController;
import org.mxchange.jjobs.beans.contact.JobsContactWebSessionController;
import org.mxchange.jjobs.beans.login.JobsUserLoginWebSessionController;
+import org.mxchange.jjobs.beans.register.JobsUserRegisterWebSessionController;
import org.mxchange.jusercore.events.login.UserLoggedInEvent;
import org.mxchange.jusercore.events.registration.UserRegisteredEvent;
import org.mxchange.jusercore.events.user.add.AdminAddedUserEvent;
import org.mxchange.jusercore.model.user.LoginUser;
import org.mxchange.jusercore.model.user.User;
import org.mxchange.jusercore.model.user.UserSessionBeanRemote;
+import org.mxchange.jusercore.model.user.UserUtils;
import org.mxchange.jusercore.model.user.profilemodes.ProfileMode;
/**
*/
@Named ("userController")
@SessionScoped
-public class JobsUserWebSessionBean implements JobsUserWebSessionController {
+public class JobsUserWebSessionBean extends BaseJobsController implements JobsUserWebSessionController {
/**
* Serial number
@Inject
private JobsContactWebSessionController contactController;
+ /**
+ * Registration controller
+ */
+ @Inject
+ private JobsUserRegisterWebSessionController registerController;
+
/**
* A list of all selectable contacts
*/
if (null == event) {
// Throw NPE
throw new NullPointerException("event is null"); //NOI18N
- } else if (event.getAddedContact()== null) {
+ } else if (event.getAddedContact() == null) {
// Throw again ...
throw new NullPointerException("event.addedContact is null"); //NOI18N
} else if (event.getAddedContact().getContactId() == null) {
// Create new user instance
User localUser = new LoginUser();
- // Update all data ...
+ // Is user name required?
+ if (!this.isUserNameRequired()) {
+ // Generate pseudo-random user name
+ String randomName = this.userBean.generateRandomUserName();
+
+ // Set it and inivisible profile
+ this.setUserName(randomName);
+ this.setUserProfileMode(ProfileMode.INVISIBLE);
+
+ // Generate random password
+ String randomPassword = UserUtils.createRandomPassword(JobsUserWebSessionController.MINIMUM_PASSWORD_LENGTH);
+
+ // Set random password
+ this.setUserPassword(randomPassword);
+ this.setUserPasswordRepeat(randomPassword);
+ }
+
+ // Set user name and mode
localUser.setUserName(this.getUserName());
localUser.setUserProfileMode(this.getUserProfileMode());
return isFound;
}
+ @Override
+ public boolean isPublicUserProfileEnabled () {
+ // Get context parameter
+ String contextParameter = FacesContext.getCurrentInstance().getExternalContext().getInitParameter("is_public_profile_enabled"); //NOI18N
+
+ // Is it set?
+ boolean isPublicUserProfileEnabled = ((contextParameter instanceof String) && (contextParameter.toLowerCase().equals("true"))); //NOI18N
+
+ // This requires user names being enabled, too.
+ if ((isPublicUserProfileEnabled) && (!this.isUserNameRequired())) {
+ // Not valid state, users must be able to modify their profile, especially when it is public
+ throw new IllegalStateException("Public user profiles are enabled but user name requirement is disabled, this is not possible."); //NOI18N
+ }
+
+ // Return value
+ return isPublicUserProfileEnabled;
+ }
+
@Override
public boolean isRequiredChangePersonalDataSet () {
return ((this.getUserProfileMode() != null) &&
@Override
public boolean isRequiredPersonalDataSet () {
- return ((this.getUserName() != null) &&
- (this.getUserProfileMode() != null) &&
- (this.contactController.isRequiredPersonalDataSet()) &&
- (this.getUserPassword() != null) &&
- (this.getUserPasswordRepeat() != null));
+ if (this.registerController.isMultiplePageEnabled()) {
+ // Multiple registration page
+ return this.contactController.isRequiredPersonalDataSet();
+ } else {
+ // Single registration page
+ return (((this.getUserName() != null) || (!this.isUserNameRequired())) &&
+ (this.getUserProfileMode() != null) &&
+ (this.contactController.isRequiredPersonalDataSet()) &&
+ (this.getUserPassword() != null) &&
+ (this.getUserPasswordRepeat() != null));
+ }
}
@Override
return ((this.userNameList instanceof List) && (this.userNameList.contains(user.getUserName())));
}
+ @Override
+ public boolean isUserNameRequired () {
+ // Get context parameter
+ String contextParameter = FacesContext.getCurrentInstance().getExternalContext().getInitParameter("is_user_name_required"); //NOI18N
+
+ // Is it set?
+ boolean isUserNameRequired = ((contextParameter instanceof String) && (contextParameter.toLowerCase().equals("true"))); //NOI18N
+
+ // Return value
+ return isUserNameRequired;
+ }
+
@Override
public boolean isVisibleUserFound () {
return ((this.visibleUserList instanceof List) && (this.visibleUserList.size() > 0));
*/
public static final Integer MINIMUM_PASSWORD_LENGTH = 5;
+ /**
+ * Observes events being fired when an administrator has added a new
+ * contact.
+ * <p>
+ * @param event Event being fired
+ */
+ void afterAdminAddedContact (final AdminAddedContactEvent event);
+
/**
* Event observer for newly added users by adminstrator
* <p>
*/
String doChangePersonalData ();
+ /**
+ * Checks whether this application requires a user name to be entered.
+ * Otherwise a random name like "userXXXXX" is generated
+ * <p>
+ * @return Whether this application requires a user name
+ */
+ boolean isUserNameRequired ();
+
+ /**
+ * Checks wether public user profiles are enabled. This requires that user
+ * names are also enabled.
+ * <p>
+ * @return Whether public user profiles are enabled
+ */
+ boolean isPublicUserProfileEnabled ();
+
}
ADMIN_ADD_OR_ENTER_CONTACT_DATA=... oder geben Sie die Kontaktdaten des Recruiters ein:
ADMIN_PERSONAL_DATA_EMAIL_ADDRESS=Email-Adresse:
ERROR_CONTACT_ID_NOT_FOUND=Fehler: Kontaktdaten nicht gefunden.
+GUEST_REGISTRATION_PAGE1_TITLE=Anmeldeseite 1
+GUEST_REGISTRATION_PAGE2_TITLE=Anmeldeseite 2
+BUTTON_CONTINUE_REGISTER_PAGE2=Weiter zur Anmeldeseite 2
+ERROR_GUEST_REGISTER_MULTIPLE_PAGE_NOT_ENABLED=Fehler: Mehrfach-Seite f\u00fcr Anmeldung nicht aktiv, bitte Link nicht aufrufen.
+PAGE_TITLE_USER_REGISTER_PAGE2=Anmeldeseite 2
+CONTENT_TITLE_USER_REGISTER_PAGE2=Anmeldeseite 2:
+ERROR_GUEST_USER_LOGIN_DEACTIVATED=Fehler: Der Benutzerbereich wurde administrativ deaktiviert (keine Benutzernamen bei Anmeldung).
+ERROR_GUEST_USER_RECOVER_PASSWORD_DEACTIVATED=Fehler: Wiederherstellen des Passwortes wurde administrativ deaktiviert.
+ERROR_GUEST_USER_RESEND_CONFIRMATION_DEACTIVATED=Fehler: Erneutes Aussenden des Best\u00e4tigungslinked ist administrativ deaktiviert.
+ERROR_GUEST_USER_PROFILE_DEACTIVATED=Fehler: \u00d6ffentliche Benutzerprofile sind administrativ deaktiviert.
ADMIN_ADD_OR_ENTER_CONTACT_DATA=... or enter the recruiter's contact data:
ADMIN_PERSONAL_DATA_EMAIL_ADDRESS=Email address:
ERROR_CONTACT_ID_NOT_FOUND=Error: contact data not found
+GUEST_REGISTRATION_PAGE1_TITLE=Registration page 1
+GUEST_REGISTRATION_PAGE2_TITLE=Registration page 2
+BUTTON_CONTINUE_REGISTER_PAGE2=Continue to registration page 2
+ERROR_GUEST_REGISTER_MULTIPLE_PAGE_NOT_ENABLED=Error: Multiple registration page not active, please don't call this page.
+PAGE_TITLE_USER_REGISTER_PAGE2=Register page 2
+CONTENT_TITLE_USER_REGISTER_PAGE2=Register page 2:
+ERROR_GUEST_USER_LOGIN_DEACTIVATED=Error: User area is deactivated by administrators, no user name while registration.
+ERROR_GUEST_USER_RECOVER_PASSWORD_DEACTIVATED=Error: password recovery is deactivated by administrators.
+ERROR_GUEST_USER_RESEND_CONFIRMATION_DEACTIVATED=Error: Resending confirmation link is deactivated by administrators.
+ERROR_GUEST_USER_PROFILE_DEACTIVATED=Error: Public user profiles are deactivated by administrators.
<from-outcome>register_done</from-outcome>
<to-view-id>/guest/user/register_done.xhtml</to-view-id>
</navigation-case>
+ <navigation-case>
+ <from-outcome>register_page2</from-outcome>
+ <to-view-id>/guest/user/register_page2.xhtml</to-view-id>
+ </navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/admin/admin_logout.xhtml</from-view-id>
</fieldset>
</div>
- <div class="para">
- <fieldset id="user_profile">
- <legend title="#{msg.USER_PROFILE_LEGEND_TITLE}">#{msg.USER_PROFILE_LEGEND}</legend>
-
- <div class="table_row">
- <div class="table_left">
- <h:outputLabel for="profileMode" value="#{msg.USER_PROFILE_MODE}" />
- </div>
-
- <div class="table_right">
- <ui:include src="/WEB-INF/templates/generic/profile_mode_selection_box.tpl" />
- </div>
-
- <div class="clear"></div>
- </div>
-
- <div class="table_row">
- <div class="para notice">
- <ul>
- <li>#{msg.SELECTION_NOTICE_USER_PROFILE_MODE_INVISIBLE}</li>
- <li>#{msg.SELECTION_NOTICE_USER_PROFILE_MODE_MEMBERS}</li>
- <li>#{msg.SELECTION_NOTICE_USER_PROFILE_MODE_PUBLIC}</li>
- </ul>
- </div>
- </div>
- </fieldset>
- </div>
+ <ui:fragment rendered="#{userController.isPublicUserProfileEnabled()}">
+ <div class="para">
+ <fieldset id="user_profile">
+ <legend title="#{msg.USER_PROFILE_LEGEND_TITLE}">#{msg.USER_PROFILE_LEGEND}</legend>
+
+ <div class="table_row">
+ <div class="table_left">
+ <h:outputLabel for="profileMode" value="#{msg.USER_PROFILE_MODE}" />
+ </div>
+
+ <div class="table_right">
+ <ui:include src="/WEB-INF/templates/generic/profile_mode_selection_box.tpl" />
+ </div>
+
+ <div class="clear"></div>
+ </div>
+
+ <div class="table_row">
+ <div class="para notice">
+ <ul>
+ <li>#{msg.SELECTION_NOTICE_USER_PROFILE_MODE_INVISIBLE}</li>
+ <li>#{msg.SELECTION_NOTICE_USER_PROFILE_MODE_MEMBERS}</li>
+ <li>#{msg.SELECTION_NOTICE_USER_PROFILE_MODE_PUBLIC}</li>
+ </ul>
+ </div>
+ </div>
+ </fieldset>
+ </div>
+ </ui:fragment>
</ui:composition>
</div>
<ul>
- <li>
- <h:link title="#{msg.LINK_GUEST_LOGIN_TITLE}" outcome="user_login" value="#{msg.LINK_GUEST_LOGIN}" />
- </li>
+ <ui:fragment rendered="#{userController.isUserNameRequired()}">
+ <li>
+ <h:link title="#{msg.LINK_GUEST_LOGIN_TITLE}" outcome="user_login" value="#{msg.LINK_GUEST_LOGIN}" />
+ </li>
+ </ui:fragment>
<li>
<h:link title="#{msg.LINK_GUEST_REGISTER_TITLE}" outcome="user_register" value="#{msg.LINK_GUEST_REGISTER}" />
</li>
+<<<<<<< HEAD
<li>
<h:link title="#{msg.LINK_GUEST_PASSWORD_TITLE}" outcome="user_lost_passwd" value="#{msg.LINK_GUEST_PASSWORD}" />
</li>
<li>
<h:link title="#{msg.LINK_GUEST_RESEND_LINK_TITLE}" outcome="user_resend_link" value="#{msg.LINK_GUEST_RESEND_LINK}" />
</li>
+=======
+ <ui:fragment rendered="#{userController.isUserNameRequired()}">
+ <li>
+ <h:link title="#{msg.LINK_GUEST_PASSWORD_TITLE}" outcome="user_lost_passwd" value="#{msg.LINK_GUEST_PASSWORD}" />
+ </li>
+ </ui:fragment>
+
+ <ui:fragment rendered="#{registerController.isResendConfirmationLinkEnabled()}">
+ <li>
+ <h:link title="#{msg.LINK_GUEST_RESEND_LINK_TITLE}" outcome="user_resend_link" value="#{msg.LINK_GUEST_RESEND_LINK}" />
+ </li>
+ </ui:fragment>
+>>>>>>> 4a789c7... Rewritten a lot:
</ul>
</div>
</div>
<div class="table_right75">
#{msg.GUEST_AGREE_READ_TERMS_CONDITIONS_1}
- <h:link outcome="terms" target="_blank" value="#{msg.TERMS_CONDITIONS}" />
+ <h:link outcome="terms" target="_blank" value="#{msg.LINK_GUEST_TERMS_CONDITIONS}" />
#{msg.GUEST_AGREE_READ_TERMS_CONDITIONS_2}
</div>
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
-
- <h:form id="register_form">
+ <h:form id="register_page2_form">
<div class="table">
<div class="table_header">
- #{msg.GUEST_REGISTRATION_TITLE}
+ #{msg.GUEST_REGISTRATION_PAGE2_TITLE}
</div>
<ui:include src="/WEB-INF/templates/contact/form_contact_data.tpl" />
<div class="table_footer">
<h:commandButton styleClass="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
- <h:commandButton styleClass="submit" type="submit" id="register" value="#{msg.BUTTON_FINISH_REGISTRATION}" action="#{registerController.doRegister()}" />
+ <h:commandButton styleClass="submit" type="submit" id="register" value="#{msg.BUTTON_FINISH_REGISTRATION}" action="#{registerController.doFinishRegistration()}" />
</div>
</div>
</h:form>
xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
- <h:form id="register_form">
+ <h:form id="register_page1_form">
<div class="table">
<div class="table_header">
- #{msg.GUEST_REGISTRATION_TITLE}
+ #{msg.GUEST_REGISTRATION_PAGE1_TITLE}
</div>
- <ui:include src="/WEB-INF/templates/contact/form_contact_data.tpl" />
-
<div class="para">
<fieldset id="login_data">
<legend title="#{msg.GUEST_REGISTRATION_EMAIL_LEGEND_TITLE}">#{msg.GUEST_REGISTRATION_EMAIL_LEGEND}</legend>
- <div class="table_row">
- <div class="table_left">
- <h:outputLabel for="userName" value="#{msg.GUEST_REGISTRATION_ENTER_USER_NAME}" />
- </div>
+ <ui:fragment rendered="#{userController.isUserNameRequired()}">
+ <div class="table_row">
+ <div class="table_left">
+ <h:outputLabel for="userName" value="#{msg.GUEST_REGISTRATION_ENTER_USER_NAME}" />
+ </div>
- <div class="table_right">
- <h:inputText styleClass="input" id="userName" size="20" maxlength="255" value="#{userController.userName}" required="true" />
- </div>
+ <div class="table_right">
+ <h:inputText styleClass="input" id="userName" size="20" maxlength="255" value="#{userController.userName}" required="true" />
+ </div>
- <div class="clear"></div>
- </div>
+ <div class="clear"></div>
+ </div>
+ </ui:fragment>
<div class="table_row">
<div class="table_left">
<div class="clear"></div>
</div>
- <div class="para"></div>
+ <ui:fragment rendered="#{userController.isUserNameRequired()}">
+ <div class="para"></div>
- <div class="table_row">
- <div class="table_left">
- <h:outputLabel for="userPassword" value="#{msg.GUEST_REGISTRATION_ENTER_PASSWORD}" />
- </div>
+ <div class="table_row">
+ <div class="table_left">
+ <h:outputLabel for="userPassword" value="#{msg.GUEST_REGISTRATION_ENTER_PASSWORD}" />
+ </div>
- <div class="table_right">
- <h:inputSecret styleClass="input" id="userPassword" size="10" maxlength="255" value="#{userController.userPassword}" required="true" />
+ <div class="table_right">
+ <h:inputSecret styleClass="input" id="userPassword" size="10" maxlength="255" value="#{userController.userPassword}" required="true" />
+ </div>
+
+ <div class="clear"></div>
</div>
- <div class="clear"></div>
- </div>
+ <div class="table_row">
+ <div class="table_left">
+ <h:outputLabel for="userPasswordRepeat" value="#{msg.GUEST_REGISTRATION_ENTER_PASSWORD_REPEAT}" />
+ </div>
- <div class="table_row">
- <div class="table_left">
- <h:outputLabel for="userPasswordRepeat" value="#{msg.GUEST_REGISTRATION_ENTER_PASSWORD_REPEAT}" />
- </div>
+ <div class="table_right">
+ <h:inputSecret styleClass="input" id="userPasswordRepeat" size="10" maxlength="255" value="#{userController.userPasswordRepeat}" required="true" />
+ </div>
- <div class="table_right">
- <h:inputSecret styleClass="input" id="userPasswordRepeat" size="10" maxlength="255" value="#{userController.userPasswordRepeat}" required="true" />
+ <div class="clear"></div>
</div>
- <div class="clear"></div>
- </div>
-
- <div class="para notice">
- #{msg.GUEST_REGISTRATION_USER_NAME_NOTICE}
- </div>
+ <div class="para notice">
+ #{msg.GUEST_REGISTRATION_USER_NAME_NOTICE}
+ </div>
+ </ui:fragment>
</fieldset>
</div>
<div class="table_footer">
<h:commandButton styleClass="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
- <h:commandButton styleClass="submit" type="submit" id="register" value="#{msg.BUTTON_FINISH_REGISTRATION}" action="#{registerController.doRegister()}" />
+ <h:commandButton styleClass="submit" type="submit" id="continueRegisterPage1" value="#{msg.BUTTON_CONTINUE_REGISTER_PAGE2}" action="#{registerController.doRegisterMultiPage1()}" />
</div>
</div>
</h:form>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" ?>
+<ui:composition
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
+
+ <h:form id="register_single_form">
+ <div class="table">
+ <div class="table_header">
+ #{msg.GUEST_REGISTRATION_TITLE}
+ </div>
+
+ <ui:include src="/WEB-INF/templates/contact/form_contact_data.tpl" />
+
+ <div class="para">
+ <fieldset id="login_data">
+ <legend title="#{msg.GUEST_REGISTRATION_EMAIL_LEGEND_TITLE}">#{msg.GUEST_REGISTRATION_EMAIL_LEGEND}</legend>
+
+ <ui:fragment rendered="#{userController.isUserNameRequired()}">
+ <div class="table_row">
+ <div class="table_left">
+ <h:outputLabel for="userName" value="#{msg.GUEST_REGISTRATION_ENTER_USER_NAME}" />
+ </div>
+
+ <div class="table_right">
+ <h:inputText styleClass="input" id="userName" size="20" maxlength="255" value="#{userController.userName}" required="true" />
+ </div>
+
+ <div class="clear"></div>
+ </div>
+ </ui:fragment>
+
+ <div class="table_row">
+ <div class="table_left">
+ <h:outputLabel for="emailAddress" value="#{msg.GUEST_REGISTRATION_ENTER_EMAIL}" />
+ </div>
+
+ <div class="table_right">
+ <h:inputText styleClass="input" id="emailAddress" size="20" maxlength="255" value="#{contactController.emailAddress}" required="true" />
+ </div>
+
+ <div class="clear"></div>
+ </div>
+
+ <div class="table_row">
+ <div class="table_left">
+ <h:outputLabel for="emailAddressRepeat" value="#{msg.GUEST_REGISTRATION_ENTER_EMAIL_REPEAT}" />
+ </div>
+
+ <div class="table_right">
+ <h:inputText styleClass="input" id="emailAddressRepeat" size="20" maxlength="255" value="#{contactController.emailAddressRepeat}" required="true" />
+ </div>
+
+ <div class="clear"></div>
+ </div>
+
+ <ui:fragment rendered="#{userController.isUserNameRequired()}">
+ <div class="para"></div>
+
+ <div class="table_row">
+ <div class="table_left">
+ <h:outputLabel for="userPassword" value="#{msg.GUEST_REGISTRATION_ENTER_PASSWORD}" />
+ </div>
+
+ <div class="table_right">
+ <h:inputSecret styleClass="input" id="userPassword" size="10" maxlength="255" value="#{userController.userPassword}" required="true" />
+ </div>
+
+ <div class="clear"></div>
+ </div>
+
+ <div class="table_row">
+ <div class="table_left">
+ <h:outputLabel for="userPasswordRepeat" value="#{msg.GUEST_REGISTRATION_ENTER_PASSWORD_REPEAT}" />
+ </div>
+
+ <div class="table_right">
+ <h:inputSecret styleClass="input" id="userPasswordRepeat" size="10" maxlength="255" value="#{userController.userPasswordRepeat}" required="true" />
+ </div>
+
+ <div class="clear"></div>
+ </div>
+
+ <div class="para notice">
+ #{msg.GUEST_REGISTRATION_USER_NAME_NOTICE}
+ </div>
+ </ui:fragment>
+ </fieldset>
+ </div>
+
+ <ui:include src="/WEB-INF/templates/guest/guest_privacy_terms.tpl" />
+
+ <div class="table_footer">
+ <h:commandButton styleClass="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
+ <h:commandButton styleClass="submit" type="submit" id="register" value="#{msg.BUTTON_FINISH_REGISTRATION}" action="#{registerController.doFinishRegistration()}" />
+ </div>
+ </div>
+ </h:form>
+</ui:composition>
<description>An application for handling and sending out applications to companies.</description>
<display-name>JJobs v1.0</display-name>
<context-param>
- <param-name>javax.faces.PROJECT_STAGE</param-name>
- <param-value>Development</param-value>
+ <description>Whether debug mode is for registration controller enabled.</description>
+ <param-name>is_debug_register_enabled</param-name>
+ <param-value>false</param-value>
+ </context-param>
+ <context-param>
+ <description>Whether the multi-page registration page or a single registration page is active</description>
+ <param-name>is_multi_register_page</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <description>Whether a user name is required on registration</description>
+ <param-name>is_user_name_required</param-name>
+ <param-value>false</param-value>
+ </context-param>
+ <context-param>
+ <description>Whether the public user profile is enabled.</description>
+ <param-name>is_public_profile_enabled</param-name>
+ <param-value>false</param-value>
+ </context-param>
+ <context-param>
+ <description>Whether "resend confirmation link" ius enabled.</description>
+ <param-name>is_resend_confirm_link_enabled</param-name>
+ <param-value>false</param-value>
</context-param>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
</ui:define>
<ui:define name="content">
+<<<<<<< HEAD
<div class="para">
<!-- TODO Internatialize this somehow //-->
Noch kein Benutzerkonto? Einfach <h:link id="user_register" outcome="user_register" title="Als Benutzer anmelden">hier</h:link> anmelden.
<div class="para">
<h:link id="user_lost_password" outcome="user_lost_passwd" title="#{msg.LINK_TITLE_GUEST_LOGIN_LOST_PASSWORD}" value="#{msg.LINK_GUEST_LOGIN_LOST_PASSWORD}" />
</div>
+=======
+ <ui:fragment rendered="#{userController.isUserNameRequired()}">
+ <div class="para">
+ <!-- TODO Internatialize this somehow //-->
+ Noch kein Benutzerkonto? Einfach <h:link id="user_register" outcome="user_register" title="Als Benutzer anmelden">hier</h:link> anmelden.
+ </div>
+
+ <div class="para">
+ <ui:include src="/WEB-INF/templates/guest/user/guest_login_form.tpl" />
+ </div>
+
+ <div class="para">
+ <h:link id="user_lost_password" outcome="user_lost_passwd" title="#{msg.LINK_TITLE_GUEST_LOGIN_LOST_PASSWORD}" value="#{msg.LINK_GUEST_LOGIN_LOST_PASSWORD}" />
+ </div>
+ </ui:fragment>
+
+ <ui:fragment rendered="#{not userController.isUserNameRequired()}">
+ <h:outputText styleClass="errors" value="#{msg.ERROR_GUEST_USER_LOGIN_DEACTIVATED}" />
+ </ui:fragment>
+>>>>>>> 4a789c7... Rewritten a lot:
</ui:define>
</ui:composition>
</html>
</ui:define>
<ui:define name="content">
- <div class="para" id="user_lost_password_content">
- <h:form id="lost_password_form">
- <div class="table">
- <div class="table_header">
- #{msg.GUEST_LOST_PASSWORD_TITLE}
- </div>
+ <ui:fragment rendered="#{userController.isUserNameRequired()}">
+ <div class="para" id="user_lost_password_content">
+ <h:form id="lost_password_form">
+ <div class="table">
+ <div class="table_header">
+ #{msg.GUEST_LOST_PASSWORD_TITLE}
+ </div>
- <fieldset id="login_data">
- <legend title="#{msg.GUEST_LOST_PASSWORD_LEGEND_TITLE}">#{msg.GUEST_LOST_PASSWORD_LEGEND}</legend>
+ <fieldset id="login_data">
+ <legend title="#{msg.GUEST_LOST_PASSWORD_LEGEND_TITLE}">#{msg.GUEST_LOST_PASSWORD_LEGEND}</legend>
- <div class="table_row">
- <div class="table_left">
- <h:outputLabel for="id" value="#{msg.ENTER_USER_NAME}" />
+ <div class="table_row">
+ <div class="table_left">
+ <h:outputLabel for="id" value="#{msg.ENTER_USER_NAME}" />
+ </div>
+
+ <div class="table_right">
+ <h:inputText styleClass="input" id="id" size="10" maxlength="20" value="#{passwordRecoveryController.userId}" />
+ </div>
+
+ <div class="clear"></div>
</div>
- <div class="table_right">
- <h:inputText styleClass="input" id="id" size="10" maxlength="20" value="#{passwordRecoveryController.userId}" />
+ <div class="table_header">
+ #{msg.GUEST_LOST_PASSWORD_NUMBER_OR_EMAIL}
</div>
- <div class="clear"></div>
- </div>
+ <div class="table_row">
+ <div class="table_left">
+ <h:outputLabel for="email" value="#{msg.ENTER_EMAIL_ADDRESS}" />
+ </div>
- <div class="table_header">
- #{msg.GUEST_LOST_PASSWORD_NUMBER_OR_EMAIL}
- </div>
+ <div class="table_right">
+ <h:inputText styleClass="input" id="email" size="20" maxlength="255" value="#{passwordRecoveryController.emailAddress}" />
+ </div>
- <div class="table_row">
- <div class="table_left">
- <h:outputLabel for="email" value="#{msg.ENTER_EMAIL_ADDRESS}" />
+ <div class="clear"></div>
</div>
- <div class="table_right">
- <h:inputText styleClass="input" id="email" size="20" maxlength="255" value="#{passwordRecoveryController.emailAddress}" />
- </div>
+ </fieldset>
- <div class="clear"></div>
+ <div class="table_footer">
+ <h:commandButton styleClass="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
+ <h:commandButton styleClass="submit" type="submit" value="#{msg.BUTTON_CONTINUE_STEP_2}" action="#{passwordRecoveryController.doLostPasswordStep2()}" />
</div>
-
- </fieldset>
-
- <div class="table_footer">
- <h:commandButton styleClass="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
- <h:commandButton styleClass="submit" type="submit" value="#{msg.BUTTON_CONTINUE_STEP_2}" action="#{passwordRecoveryController.doLostPasswordStep2()}" />
</div>
- </div>
- </h:form>
- </div>
+ </h:form>
+ </div>
+ </ui:fragment>
+
+ <ui:fragment rendered="#{not userController.isUserNameRequired()}">
+ <h:outputText styleClass="errors" value="#{msg.ERROR_GUEST_USER_RECOVER_PASSWORD_DEACTIVATED}" />
+ </ui:fragment>
</ui:define>
</ui:composition>
</html>
<html
lang="#{localizationController.language}" xml:lang="#{localizationController.language}"
xmlns="http://www.w3.org/1999/xhtml"
- xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
- xmlns:h="http://xmlns.jcp.org/jsf/html"
- xmlns:f="http://xmlns.jcp.org/jsf/core"
- >
+ xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
+ xmlns:h="http://xmlns.jcp.org/jsf/html"
+ xmlns:f="http://xmlns.jcp.org/jsf/core"
+ >
<ui:composition template="/WEB-INF/templates/guest/guest_base.tpl">
<ui:define name="guest_title">#{msg.PAGE_TITLE_USER_REGISTER}</ui:define>
</ui:define>
<ui:define name="content">
- <div class="para">
- #{msg.GUEST_ALREADY_USER_CONTINUE_LOGIN_1}
- <h:link outcome="user_login" value="#{msg.CLICK_HERE}" />
- #{msg.GUEST_ALREADY_USER_CONTINUE_LOGIN_2}
- </div>
+ <ui:fragment rendered="#{userController.isUserNameRequired()}">
+ <div class="para">
+ #{msg.GUEST_ALREADY_USER_CONTINUE_LOGIN_1}
+ <h:link outcome="user_login" value="#{msg.CLICK_HERE}" />
+ #{msg.GUEST_ALREADY_USER_CONTINUE_LOGIN_2}
+ </div>
+ </ui:fragment>
<div class="registration_form">
- <ui:include src="/WEB-INF/templates/guest/user/guest_registration_form.tpl" />
+ <ui:fragment rendered="#{registerController.isMultiplePageEnabled()}">
+ <ui:include src="/WEB-INF/templates/guest/user/register/guest_form_register_page1.tpl" />
+ </ui:fragment>
+
+ <ui:fragment rendered="#{not registerController.isMultiplePageEnabled()}">
+ <ui:include src="/WEB-INF/templates/guest/user/register/guest_form_register_single.tpl" />
+ </ui:fragment>
</div>
</ui:define>
</ui:composition>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
+ lang="#{localizationController.language}" xml:lang="#{localizationController.language}"
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
+ xmlns:h="http://xmlns.jcp.org/jsf/html"
+ xmlns:f="http://xmlns.jcp.org/jsf/core"
+ >
+
+ <ui:composition template="/WEB-INF/templates/guest/guest_base.tpl">
+ <ui:define name="guest_title">#{msg.PAGE_TITLE_USER_REGISTER_PAGE2}</ui:define>
+
+ <ui:define name="content_header">
+ #{msg.CONTENT_TITLE_USER_REGISTER_PAGE2}
+ </ui:define>
+
+ <ui:define name="content">
+ <ui:fragment rendered="#{registerController.isMultiplePageEnabled()}">
+ <ui:fragment rendered="#{userController.isUserNameRequired()}">
+ <div class="para">
+ #{msg.GUEST_ALREADY_USER_CONTINUE_LOGIN_1}
+ <h:link outcome="user_login" value="#{msg.CLICK_HERE}" />
+ #{msg.GUEST_ALREADY_USER_CONTINUE_LOGIN_2}
+ </div>
+ </ui:fragment>
+
+ <div class="registration_form">
+ <ui:include src="/WEB-INF/templates/guest/user/register/guest_form_register_page2.tpl" />
+ </div>
+ </ui:fragment>
+
+ <ui:fragment rendered="#{not registerController.isMultiplePageEnabled()}">
+ <h:outputText styleClass="errors" value="#{msg.ERROR_GUEST_REGISTER_MULTIPLE_PAGE_NOT_ENABLED}" />
+ </ui:fragment>
+ </ui:define>
+ </ui:composition>
+</html>
</ui:define>
<ui:define name="content">
- Here goes your content.
+ <ui:fragment rendered="#{registerController.isResendConfirmationLinkEnabled()}">
+ Here goes your content.
+ </ui:fragment>
+
+ <ui:fragment rendered="#{not registerController.isResendConfirmationLinkEnabled()}">
+ <h:outputText styleClass="errors" value="#{msg.ERROR_GUEST_USER_RECOVER_PASSWORD_DEACTIVATED}" />
+ </ui:fragment>
</ui:define>
</ui:composition>
</html>
</ui:define>
<ui:define name="content">
- <ui:fragment rendered="#{userController.isUserIdEmpty()}">
- <ui:include src="/WEB-INF/templates/user/userid_error.tpl" />
- </ui:fragment>
+ <ui:fragment rendered="#{userController.isPublicUserProfileEnabled()}">
+ <ui:fragment rendered="#{userController.isUserIdEmpty()}">
+ <ui:include src="/WEB-INF/templates/user/userid_error.tpl" />
+ </ui:fragment>
+
+ <ui:fragment rendered="#{not profileController.isProfileLinkVisibleById(userController.userId)}">
+ #{msg.ERROR_PROFILE_NOT_VISIBLE}
+ </ui:fragment>
- <ui:fragment rendered="#{not profileController.isProfileLinkVisibleById(userController.userId)}">
- #{msg.ERROR_PROFILE_NOT_VISIBLE}
+ <ui:fragment rendered="#{profileController.isProfileLinkVisibleById(userController.userId)}">
+ <div align="center">
+ <h:panelGrid styleClass="table" headerClass="table_header" footerClass="table_footer">
+ <f:facet name="header">
+ #{msg.PUBLIC_USER_PROFILE}
+ </f:facet>
+ </h:panelGrid>
+ </div>
+ </ui:fragment>
</ui:fragment>
- <ui:fragment rendered="#{profileController.isProfileLinkVisibleById(userController.userId)}">
- <div align="center">
- <h:panelGrid styleClass="table" headerClass="table_header" footerClass="table_footer">
- <f:facet name="header">
- #{msg.PUBLIC_USER_PROFILE}
- </f:facet>
- </h:panelGrid>
- </div>
+ <ui:fragment rendered="#{not userController.isPublicUserProfileEnabled()}">
+ <h:outputText styleClass="errors" value="#{msg.ERROR_GUEST_USER_PROFILE_DEACTIVATED}" />
</ui:fragment>
</ui:define>
</ui:composition>