*/
private List<User> publicUserList;
+ /**
+ * Whether the user wants a public profile
+ */
+ private Boolean userProfilePublic;
+
/**
* Default constructor
*/
// Clear all data
// - personal data
this.setUserId(null);
+ this.setUserProfilePublic(null);
this.setGender(Gender.UNKNOWN);
this.setFirstName(null);
this.setFamilyName(null);
// Copy all fields:
// - base data
this.setUserId(user.getUserId());
+ this.setUserProfilePublic(user.getUserPublicProfile());
this.setGender(user.getUserContact().getContactGender());
this.setFirstName(user.getUserContact().getContactFirstName());
this.setFamilyName(user.getUserContact().getContactFamilyName());
// Create new user instance
User user = new LoginUser();
user.setUserName(this.getUserName());
+ user.setUserPublicProfile(this.getUserProfilePublic());
+ user.setUserCreated(new GregorianCalendar());
// Generate phone number
DialableLandLineNumber phone = new LandLineNumber(this.getPhoneCountry(), this.getPhoneAreaCode(), this.getPhoneNumber());
// Set contact in user
user.setUserContact(contact);
- user.setUserCreated(new GregorianCalendar());
// Trace message
//this.getLogger().logTrace(MessageFormat.format("createUserInstance: user={0} - EXIT!", user));
this.userPasswordRepeat = userPasswordRepeat;
}
+ @Override
+ public Boolean getUserProfilePublic () {
+ return this.userProfilePublic;
+ }
+
+ @Override
+ public void setUserProfilePublic (final Boolean userProfilePublic) {
+ this.userProfilePublic = userProfilePublic;
+ }
+
@Override
public Integer getZipCode () {
return this.zipCode;
@Override
public boolean isRequiredPersonalDataSet () {
return ((this.getUserName() != null)
+ && (this.getUserProfilePublic() != null)
&& (this.getGender() != null)
&& (this.getFirstName() != null)
&& (this.getFamilyName() != null)
*/
public void setZipCode (final Integer zipCode);
+ /**
+ * Getter for user public profile flag
+ * <p>
+ * @return User public profile flag
+ */
+ public Boolean getUserProfilePublic ();
+
+ /**
+ * Setter for user public profile flag
+ * <p>
+ * @param userProfilePublic User public profile flag
+ */
+ public void setUserProfilePublic (final Boolean userProfilePublic);
+
/**
* Checks whether user instance's email address is used
* <p>
+++ /dev/null
-/*
- * Copyright (C) 2015 Roland Haeder
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.addressbook.converter;
-
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.convert.Converter;
-import javax.faces.convert.FacesConverter;
-
-/**
- * A converter to convert "true" to boolean true and "false" to boolean false
- * <p>
- * @author Roland Haeder
- */
-@FacesConverter(value = "trueFalse")
-public class TrueFalseToBooleanConverter implements Converter {
-
- @Override
- public Object getAsObject (final FacesContext context, final UIComponent component, final String value) {
- return Boolean.valueOf(value);
- }
-
- @Override
- public String getAsString (final FacesContext context, final UIComponent component, final Object value) {
- return Boolean.toString((Boolean) value);
- }
-}
</div>
<div class="table_right">
- <h:selectOneMenu class="select" id="publicUserProfileFlag" required="true" requiredMessage="#{msg.PUBLIC_USER_PROFILE_NOT_CHOOSEN_MESSAGE}">
+ <h:selectOneMenu class="select" id="publicUserProfileFlag" value="#{userController.userProfilePublic}" required="true" requiredMessage="#{msg.PUBLIC_USER_PROFILE_NOT_CHOOSEN_MESSAGE}">
<f:selectItem class="option" itemValue="true" itemLabel="#{msg.PUBLIC_PROFILE_ENABLED}" />
<f:selectItem class="option" itemValue="false" itemLabel="#{msg.PUBLIC_PROFILE_DISABLED}" />
- <f:converter for="publicUserProfileFlag" converterId="trueFalse" />
+ <!-- <f:converter for="publicUserProfileFlag" converterId="trueFalse" /> //-->
<f:validator for="publicUserProfileFlag" validatorId="UserProfileVisibilityValidator" />
</h:selectOneMenu>
</div>