import javax.naming.NamingException;
import org.mxchange.addressbook.beans.BaseAddressbookController;
import org.mxchange.addressbook.beans.helper.AddressbookWebRequestController;
+import org.mxchange.jcontacts.contact.AdminContactSessionBeanRemote;
import org.mxchange.jcontacts.contact.Contact;
import org.mxchange.jcontacts.contact.ContactSessionBeanRemote;
import org.mxchange.jcontacts.contact.UserContact;
import org.mxchange.jcontacts.exceptions.ContactAlreadyAddedException;
import org.mxchange.jcountry.data.Country;
import org.mxchange.jphone.phonenumbers.DialableNumber;
-import org.mxchange.jphone.phonenumbers.cellphone.CellphoneNumber;
-import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber;
import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
import org.mxchange.jphone.phonenumbers.fax.FaxNumber;
import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
import org.mxchange.jphone.phonenumbers.landline.LandLineNumber;
+import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
+import org.mxchange.jphone.phonenumbers.mobile.MobileNumber;
import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider;
/**
@Any
private Event<AdminAddedContactEvent> addedContactEvent;
+ /**
+ * Administrative contact EJB
+ */
+ private AdminContactSessionBeanRemote adminContactBean;
+
/**
* Admin helper instance
*/
*/
private Date birthday;
- /**
- * Cellphone number's carrier
- */
- private MobileProvider cellphoneCarrier;
-
- /**
- * Cellphone id number
- */
- private Long cellphoneId;
-
- /**
- * Cellphone number
- */
- private Long cellphoneNumber;
-
/**
* City
*/
*/
private String houseNumberExtension;
- /**
- * Whether a cellphone entry has been unlinked
- */
- private boolean isCellphoneUnlinked;
-
/**
* Whether a fax entry has been unlinked
*/
*/
private boolean isLandLineUnlinked;
+ /**
+ * Whether a mobile entry has been unlinked
+ */
+ private boolean isMobileUnlinked;
+
/**
* Land-line id number
*/
private Long landLineId;
+ /**
+ * Mobile number's carrier
+ */
+ private MobileProvider mobileCarrier;
+
+ /**
+ * Mobile id number
+ */
+ private Long mobileId;
+
+ /**
+ * Mobile number
+ */
+ private Long mobileNumber;
+
/**
* Phone number area code
*/
// Try to call EJB
try {
// Call EJB
- updatedContact = this.contactBean.addContact(contact);
+ updatedContact = this.adminContactBean.addContact(contact);
} catch (final ContactAlreadyAddedException ex) {
// Throw again
throw new FaceletException(ex);
this.setStreet(contact.getContactStreet());
this.setZipCode(contact.getContactZipCode());
- // ... cellphone data
- if (contact.getContactCellphoneNumber() instanceof DialableCellphoneNumber) {
- this.setCellphoneId(contact.getContactCellphoneNumber().getPhoneId());
- this.setCellphoneCarrier(contact.getContactCellphoneNumber().getCellphoneProvider());
- this.setCellphoneNumber(contact.getContactCellphoneNumber().getPhoneNumber());
+ // ... mobile data
+ if (contact.getContactMobileNumber() instanceof DialableMobileNumber) {
+ this.setMobileId(contact.getContactMobileNumber().getPhoneId());
+ this.setMobileCarrier(contact.getContactMobileNumber().getMobileProvider());
+ this.setMobileNumber(contact.getContactMobileNumber().getPhoneNumber());
}
// ... fax data
public Contact createContactInstance () {
// Generate phone number
DialableLandLineNumber phone = new LandLineNumber(this.getPhoneCountry(), this.getPhoneAreaCode(), this.getPhoneNumber());
- DialableCellphoneNumber cellphone = new CellphoneNumber(this.getCellphoneCarrier(), this.getCellphoneNumber());
+ DialableMobileNumber mobile = new MobileNumber(this.getMobileCarrier(), this.getMobileNumber());
DialableFaxNumber fax = new FaxNumber(this.getFaxCountry(), this.getFaxAreaCode(), this.getFaxNumber());
// Create new instance
this.updateContactData(contact);
// Call EJB for updating contact data
- Contact updatedContact = this.contactBean.updateContactData(contact, this.isCellphoneUnlinked, this.isLandLineUnlinked, this.isFaxUnlinked);
+ Contact updatedContact = this.contactBean.updateContactData(contact, this.isMobileUnlinked, this.isLandLineUnlinked, this.isFaxUnlinked);
// Fire event
this.updatedContactEvent.fire(new AdminContactUpdatedEvent(updatedContact));
this.updateContactData(contact);
// Call EJB for updating contact data
- Contact updatedContact = this.contactBean.updateContactData(contact, this.isCellphoneUnlinked, this.isLandLineUnlinked, this.isFaxUnlinked);
+ Contact updatedContact = this.contactBean.updateContactData(contact, this.isMobileUnlinked, this.isLandLineUnlinked, this.isFaxUnlinked);
// Fire event
this.updatedContactEvent.fire(new AdminContactUpdatedEvent(updatedContact));
}
@Override
- public String generateCellphoneNumber (final DialableCellphoneNumber cellphoneNumber) {
+ public String generateMobileNumber (final DialableMobileNumber mobileNumber) {
// Is it null?
- if (null == cellphoneNumber) {
+ if (null == mobileNumber) {
// Return null
return null;
}
// Get all data
String number = String.format(
"%s%d%d", //NOI18N
- cellphoneNumber.getCellphoneProvider().getProviderCountry().getCountryExternalDialPrefix(),
- cellphoneNumber.getCellphoneProvider().getProviderDialPrefix(),
- cellphoneNumber.getPhoneNumber()
+ mobileNumber.getMobileProvider().getProviderCountry().getCountryExternalDialPrefix(),
+ mobileNumber.getMobileProvider().getProviderDialPrefix(),
+ mobileNumber.getPhoneNumber()
);
// Return it
this.birthday = birthday;
}
- @Override
- public MobileProvider getCellphoneCarrier () {
- return this.cellphoneCarrier;
- }
-
- @Override
- public void setCellphoneCarrier (final MobileProvider cellphoneCarrier) {
- this.cellphoneCarrier = cellphoneCarrier;
- }
-
- @Override
- public Long getCellphoneId () {
- return this.cellphoneId;
- }
-
- @Override
- public void setCellphoneId (final Long cellphoneId) {
- this.cellphoneId = cellphoneId;
- }
-
- @Override
- public Long getCellphoneNumber () {
- return this.cellphoneNumber;
- }
-
- @Override
- public void setCellphoneNumber (Long cellphoneNumber) {
- this.cellphoneNumber = cellphoneNumber;
- }
-
@Override
public String getCity () {
return this.city;
this.landLineId = landLineId;
}
+ @Override
+ public MobileProvider getMobileCarrier () {
+ return this.mobileCarrier;
+ }
+
+ @Override
+ public void setMobileCarrier (final MobileProvider mobileCarrier) {
+ this.mobileCarrier = mobileCarrier;
+ }
+
+ @Override
+ public Long getMobileId () {
+ return this.mobileId;
+ }
+
+ @Override
+ public void setMobileId (final Long mobileId) {
+ this.mobileId = mobileId;
+ }
+
+ @Override
+ public Long getMobileNumber () {
+ return this.mobileNumber;
+ }
+
+ @Override
+ public void setMobileNumber (Long mobileNumber) {
+ this.mobileNumber = mobileNumber;
+ }
+
@Override
public Integer getPhoneAreaCode () {
return this.phoneAreaCode;
this.setPhoneCountry(null);
this.setPhoneAreaCode(null);
this.setPhoneNumber(null);
- this.setCellphoneCarrier(null);
- this.setCellphoneNumber(null);
+ this.setMobileCarrier(null);
+ this.setMobileNumber(null);
this.setFaxCountry(null);
this.setFaxAreaCode(null);
this.setFaxNumber(null);
contact.setContactCity(this.getCity());
contact.setContactCountry(this.getCountry());
- // Update contact's cellphone number
- this.isCellphoneUnlinked = ContactUtils.updateCellPhoneNumber(contact, this.getCellphoneCarrier(), this.getCellphoneNumber());
+ // Update contact's mobile number
+ this.isMobileUnlinked = ContactUtils.updateCellPhoneNumber(contact, this.getMobileCarrier(), this.getMobileNumber());
// Update contact's land-line number
this.isLandLineUnlinked = ContactUtils.updateLandLineNumber(contact, this.getPhoneCountry(), this.getPhoneAreaCode(), this.getPhoneNumber());
import org.mxchange.jcontacts.contact.gender.Gender;
import org.mxchange.jcountry.data.Country;
import org.mxchange.jphone.phonenumbers.DialableNumber;
-import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber;
+import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider;
/**
void copyContactToController (final Contact contact);
/**
- * Edits cuirrently loaded contact's data in database.
+ * Edits currently loaded contact's data in database.
* <p>
* @return Redirect outcome
*/
String editContactData ();
/**
- * Getter for cellphone id
+ * Getter for mobile id
* <p>
- * @return Cellphone id
+ * @return Mobile id
*/
- Long getCellphoneId ();
+ Long getMobileId ();
/**
- * Setter for cellphone id
+ * Setter for mobile id
* <p>
- * @param cellphoneId Cellphone id
+ * @param mobileId Mobile id
*/
- void setCellphoneId (final Long cellphoneId);
+ void setMobileId (final Long mobileId);
/**
* Getter for fax id
void setBirthday (final Date birthday);
/**
- * Getter for ellphone number's carrier
+ * Getter for mobile number's carrier
* <p>
- * @return Cellphone number's carrier
+ * @return Mobile number's carrier
*/
- MobileProvider getCellphoneCarrier ();
+ MobileProvider getMobileCarrier ();
/**
- * Setter for cellphone number's carrier prefix
+ * Setter for mobile number's carrier prefix
* <p>
- * @param cellphoneCarrier Cellphone number's carrier prefix
+ * @param mobileCarrier Mobile number's carrier prefix
*/
- void setCellphoneCarrier (final MobileProvider cellphoneCarrier);
+ void setMobileCarrier (final MobileProvider mobileCarrier);
/**
- * Getter for ellphone number
+ * Getter for mobile number
* <p>
- * @return Cellphone number
+ * @return Mobile number
*/
- Long getCellphoneNumber ();
+ Long getMobileNumber ();
/**
- * Setter for ellphone number
+ * Setter for mobile number
* <p>
- * @param cellphoneNumber Cellphone number
+ * @param mobileNumber Mobile number
*/
- void setCellphoneNumber (final Long cellphoneNumber);
+ void setMobileNumber (final Long mobileNumber);
/**
* City
String generatePhoneNumber (final DialableNumber phoneNumber);
/**
- * Returns a text representation of given cellphone number or null if not
+ * Returns a text representation of given mobile number or null if not
* set.
* <p>
- * @param cellphoneNumber Cellphone number
+ * @param mobileNumber Mobile number
* <p>
* @return Text respresentation or null
*/
- String generateCellphoneNumber (final DialableCellphoneNumber cellphoneNumber);
+ String generateMobileNumber (final DialableMobileNumber mobileNumber);
/**
* Checks/returns whether the gender/salutation is required for this
import org.mxchange.jcontacts.events.contact.update.AdminUpdatedContactEvent;
import org.mxchange.jcontacts.exceptions.ContactNotFoundException;
import org.mxchange.jcountry.data.Country;
-import org.mxchange.jphone.phonenumbers.cellphone.CellphoneNumber;
-import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber;
import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
import org.mxchange.jphone.phonenumbers.fax.FaxNumber;
import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
import org.mxchange.jphone.phonenumbers.landline.LandLineNumber;
+import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
+import org.mxchange.jphone.phonenumbers.mobile.MobileNumber;
import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider;
import org.mxchange.jusercore.events.confirmation.UserConfirmedAccountEvent;
import org.mxchange.jusercore.events.login.UserLoggedInEvent;
private Date birthday;
/**
- * Cellphone number's carrier
+ * Mobile number's carrier
*/
- private MobileProvider cellphoneCarrier;
+ private MobileProvider mobileCarrier;
/**
- * Cellphone number
+ * Mobile number
*/
- private Long cellphoneNumber;
+ private Long mobileNumber;
/**
* City
private String houseNumberExtension;
/**
- * Whether a cellphone entry has been unlinked
+ * Whether a mobile entry has been unlinked
*/
- private boolean isCellphoneUnlinked;
+ private boolean isMobileUnlinked;
/**
* Whether a fax entry has been unlinked
// Generate phone number
DialableLandLineNumber phone = new LandLineNumber(this.getPhoneCountry(), this.getPhoneAreaCode(), this.getPhoneNumber());
- DialableCellphoneNumber cellphone = new CellphoneNumber(this.getCellphoneCarrier(), this.getCellphoneNumber());
+ DialableMobileNumber mobile = new MobileNumber(this.getMobileCarrier(), this.getMobileNumber());
DialableFaxNumber fax = new FaxNumber(this.getFaxCountry(), this.getFaxAreaCode(), this.getFaxNumber());
// Create new contact
}
// Is the provider set?
- if ((cellphone instanceof DialableCellphoneNumber) && (this.getCellphoneCarrier() instanceof MobileProvider) && (this.getCellphoneNumber() != null) && (this.getCellphoneNumber() > 0)) {
+ if ((mobile instanceof DialableMobileNumber) && (this.getMobileCarrier() instanceof MobileProvider) && (this.getMobileNumber() != null) && (this.getMobileNumber() > 0)) {
// Is the number set?
- if (cellphone.getPhoneNumber() == null) {
+ if (mobile.getPhoneNumber() == null) {
// Is null
- throw new NullPointerException("cellphone.phoneNumber is null"); //NOI18N
- } else if (cellphone.getPhoneNumber() < 1) {
+ throw new NullPointerException("mobile.phoneNumber is null"); //NOI18N
+ } else if (mobile.getPhoneNumber() < 1) {
// Abort here
- throw new IllegalArgumentException("cellphone.phoneNumber is zero or below."); //NOI18N
+ throw new IllegalArgumentException("mobile.phoneNumber is zero or below."); //NOI18N
}
- // Set cellphone number
- contact.setContactCellphoneNumber(cellphone);
+ // Set mobile number
+ contact.setContactMobileNumber(mobile);
}
// Trace message
contact.setContactCity(this.getCity());
contact.setContactCountry(this.getCountry());
- // Update contact's cellphone number
- this.isCellphoneUnlinked = ContactUtils.updateCellPhoneNumber(contact, this.getCellphoneCarrier(), this.getCellphoneNumber());
+ // Update contact's mobile number
+ this.isMobileUnlinked = ContactUtils.updateCellPhoneNumber(contact, this.getMobileCarrier(), this.getMobileNumber());
// Update contact's land-line number
this.isLandLineUnlinked = ContactUtils.updateLandLineNumber(contact, this.getPhoneCountry(), this.getPhoneAreaCode(), this.getPhoneNumber());
this.isFaxUnlinked = ContactUtils.updateFaxNumber(contact, this.getFaxCountry(), this.getFaxAreaCode(), this.getFaxNumber());
// Send it to the EJB
- this.contactBean.updateContactData(contact, this.isCellphoneUnlinked, this.isLandLineUnlinked, this.isFaxUnlinked);
+ this.contactBean.updateContactData(contact, this.isMobileUnlinked, this.isLandLineUnlinked, this.isFaxUnlinked);
// All fine
return "contact_data_saved"; //NOI18N
}
@Override
- public MobileProvider getCellphoneCarrier () {
- return this.cellphoneCarrier;
+ public MobileProvider getMobileCarrier () {
+ return this.mobileCarrier;
}
@Override
- public void setCellphoneCarrier (final MobileProvider cellphoneCarrier) {
- this.cellphoneCarrier = cellphoneCarrier;
+ public void setMobileCarrier (final MobileProvider mobileCarrier) {
+ this.mobileCarrier = mobileCarrier;
}
@Override
- public Long getCellphoneNumber () {
- return this.cellphoneNumber;
+ public Long getMobileNumber () {
+ return this.mobileNumber;
}
@Override
- public void setCellphoneNumber (Long cellphoneNumber) {
- this.cellphoneNumber = cellphoneNumber;
+ public void setMobileNumber (final Long mobileNumber) {
+ this.mobileNumber = mobileNumber;
}
@Override
this.setPhoneAreaCode(null);
this.setPhoneCountry(null);
this.setPhoneNumber(null);
- this.setCellphoneCarrier(null);
- this.setCellphoneNumber(null);
+ this.setMobileCarrier(null);
+ this.setMobileNumber(null);
this.setFaxAreaCode(null);
this.setFaxCountry(null);
this.setFaxNumber(null);
this.setBirthday(contact.getContactBirthday());
this.setComment(contact.getContactComment());
- // Get cellphone, phone and fax instance
- DialableCellphoneNumber cellphone = contact.getContactCellphoneNumber();
+ // Get mobile, phone and fax instance
+ DialableMobileNumber mobile = contact.getContactMobileNumber();
DialableFaxNumber fax = contact.getContactFaxNumber();
DialableLandLineNumber phone = contact.getContactLandLineNumber();
this.setPhoneNumber(phone.getPhoneNumber());
}
- if ((cellphone instanceof DialableCellphoneNumber) && (cellphone.getCellphoneProvider() instanceof MobileProvider)) {
- this.setCellphoneCarrier(cellphone.getCellphoneProvider());
- this.setCellphoneNumber(cellphone.getPhoneNumber());
+ if ((mobile instanceof DialableMobileNumber) && (mobile.getMobileProvider() instanceof MobileProvider)) {
+ this.setMobileCarrier(mobile.getMobileProvider());
+ this.setMobileNumber(mobile.getPhoneNumber());
}
if ((fax instanceof DialableFaxNumber) && (fax.getPhoneAreaCode() > 0)) {
void setBirthday (final Date birthday);
/**
- * Getter for ellphone number's carrier
+ * Getter for mobile number's carrier
* <p>
- * @return Cellphone number's carrier
+ * @return Mobile number's carrier
*/
- MobileProvider getCellphoneCarrier ();
+ MobileProvider getMobileCarrier ();
/**
- * Setter for cellphone number's carrier prefix
+ * Setter for mobile number's carrier prefix
* <p>
- * @param cellphoneCarrier Cellphone number's carrier prefix
+ * @param mobileCarrier Mobile number's carrier prefix
*/
- void setCellphoneCarrier (final MobileProvider cellphoneCarrier);
+ void setMobileCarrier (final MobileProvider mobileCarrier);
/**
- * Getter for ellphone number
+ * Getter for mobile number
* <p>
- * @return Cellphone number
+ * @return Mobile number
*/
- Long getCellphoneNumber ();
+ Long getMobileNumber ();
/**
- * Setter for ellphone number
+ * Setter for mobile number
* <p>
- * @param cellphoneNumber Cellphone number
+ * @param mobileNumber Mobile number
*/
- void setCellphoneNumber (final Long cellphoneNumber);
+ void setMobileNumber (final Long mobileNumber);
/**
* City
import java.util.List;
import java.util.Map;
import java.util.Objects;
-import javax.annotation.PostConstruct;
import javax.enterprise.context.SessionScoped;
import javax.enterprise.event.Observes;
import javax.faces.view.facelets.FaceletException;
import org.mxchange.jcontacts.contact.Contact;
import org.mxchange.jcontacts.events.contact.add.AdminAddedContactEvent;
import org.mxchange.jcontacts.events.contact.update.AdminUpdatedContactEvent;
-import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber;
import org.mxchange.jphone.phonenumbers.phone.AdminPhoneSessionBeanRemote;
import org.mxchange.jusercore.events.user.add.AdminAddedUserEvent;
@Inject
private AddressbookAdminPhoneWebRequestController adminPhoneController;
- /**
- * All cell phone numbers
- */
- private final List<DialableCellphoneNumber> cellphoneNumbers;
-
/**
* General contact controller
*/
}
// Init lists/maps
- this.cellphoneNumbers = new LinkedList<>();
this.contacts = new HashMap<>(10);
}
throw new IllegalArgumentException(MessageFormat.format("event.addedContact.contactId={0} is not valid", event.getAddedContact().getContactId())); //NOI18N //NOI18N
}
- // Get contact
- Contact contact = event.getAddedContact();
-
- // Is cellphone set?
- if (contact.getContactCellphoneNumber() instanceof DialableCellphoneNumber) {
- // Unique-add it
- this.uniqueAddCellphoneNumber(contact.getContactCellphoneNumber());
- }
-
// Clear this bean
this.clear();
}
}
@Override
- public List<Contact> allCellphoneContacts () {
+ public List<Contact> allMobileContacts () {
// Get id
- Long phoneId = this.adminPhoneController.getCellPhone().getPhoneId();
+ Long phoneId = this.adminPhoneController.getMobileNumber().getPhoneId();
// Is cache there?
if (this.contacts.containsKey(phoneId)) {
// "Walk" through all contacts
for (final Contact contact : this.contactController.allContacts()) {
- // Is cellphone instance the same?
- if (Objects.equals(contact.getContactCellphoneNumber(), this.adminPhoneController.getCellPhone())) {
+ // Is mobile instance the same?
+ if (Objects.equals(contact.getContactMobileNumber(), this.adminPhoneController.getMobileNumber())) {
// Found one
list.add(contact);
}
}
}
- /**
- * Post-initialization of this class
- */
- @PostConstruct
- public void init () {
- // All phone numbers
- this.cellphoneNumbers.addAll(this.adminPhoneBean.allCellphoneNumbers());
- }
-
/**
* Clears this bean
*/
* <p>
* @return List of all linked contacts
*/
- List<Contact> allCellphoneContacts ();
+ List<Contact> allMobileContacts ();
/**
* Event observer for newly added users by adminstrator
import org.mxchange.addressbook.beans.contact.AddressbookAdminContactWebRequestController;
import org.mxchange.addressbook.beans.user.AddressbookUserWebSessionController;
import org.mxchange.jcontacts.contact.Contact;
-import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber;
+import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
import org.mxchange.jusercore.model.user.User;
}
// Is cellphone set?
- if (contact.getContactCellphoneNumber() instanceof DialableCellphoneNumber) {
+ if (contact.getContactMobileNumber() instanceof DialableMobileNumber) {
// Yes, then set it in admin controller
- this.adminPhoneController.setCellPhone(contact.getContactCellphoneNumber());
+ this.adminPhoneController.setCellPhone(contact.getContactMobileNumber());
}
// Is land-line set?
import javax.naming.NamingException;
import org.mxchange.addressbook.beans.BaseAddressbookController;
import org.mxchange.jcontacts.phone.AdminContactsPhoneSessionBeanRemote;
-import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber;
+import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
/**
* Cell phone number
*/
- private DialableCellphoneNumber cellPhone;
+ private DialableMobileNumber cellPhone;
/**
* Fax number
}
@Override
- public DialableCellphoneNumber getCellPhone () {
+ public DialableMobileNumber getMobileNumber () {
return this.cellPhone;
}
@Override
- public void setCellPhone (final DialableCellphoneNumber cellPhone) {
+ public void setCellPhone (final DialableMobileNumber cellPhone) {
this.cellPhone = cellPhone;
}
import java.io.Serializable;
import javax.ejb.Local;
-import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber;
import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
+import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
/**
* An interface for a request web controller (bean) for administrative phone
@Local
public interface AddressbookAdminPhoneWebRequestController extends Serializable {
+ /**
+ * Setter for dialable cellphone number instance
+ * <p>
+ * @param cellPhone Dialable cellphone number instance
+ */
+ void setCellPhone (final DialableMobileNumber cellPhone);
+
/**
* Getter for dialable cellphone number instance
* <p>
* @return Dialable cellphone number instance
*/
- DialableCellphoneNumber getCellPhone ();
+ DialableMobileNumber getMobileNumber ();
/**
* Setter for dialable land-line number instance
*/
DialableFaxNumber getFax ();
- /**
- * Setter for dialable cellphone number instance
- * <p>
- * @param cellPhone Dialable cellphone number instance
- */
- void setCellPhone (final DialableCellphoneNumber cellPhone);
-
}
String addUser ();
/**
- * Edits cuirrently loaded user's data in database.
+ * Edits currently loaded user's data in database.
* <p>
* @return Redirect outcome
*/
import org.mxchange.addressbook.beans.BaseAddressbookController;
import org.mxchange.addressbook.beans.features.AddressbookFeaturesWebApplicationController;
import org.mxchange.addressbook.beans.login.AddressbookUserLoginWebSessionController;
+import org.mxchange.jcoreee.utils.FacesUtils;
import org.mxchange.jusercore.events.user.password_change.UpdatedUserPasswordEvent;
import org.mxchange.jusercore.events.user.password_change.UserUpdatedPasswordEvent;
import org.mxchange.jusercore.exceptions.UserNotFoundException;
user.setUserEncryptedPassword(encryptedPassword);
try {
+ // Get base URL
+ String baseUrl = FacesUtils.generateBaseUrl();
+
// All is set, then update password
- PasswordHistory passwordHistory = this.userBean.updateUserPassword(user);
+ PasswordHistory passwordHistory = this.userBean.updateUserPassword(user, baseUrl);
// Fire event
this.userUpdatedPasswordEvent.fire(new UserUpdatedPasswordEvent(passwordHistory));
import org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal;
import org.mxchange.jphone.exceptions.PhoneEntityNotFoundException;
import org.mxchange.jphone.phonenumbers.DialableNumber;
-import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber;
+import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
import org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote;
/**
}
// Init instance
- DialableCellphoneNumber cellphone = null;
+ DialableMobileNumber cellphone = null;
try {
// Try to parse the value as long
// NOISY-DEBUG: this.loggerBeanLocal.logDebug(MessageFormat.format("getAsObject: userId{0}", userId)); //NOI18N
// Try to get cellphone instance from it
- cellphone = this.phoneBean.findCellphoneById(cellphoneId);
+ cellphone = this.phoneBean.findMobileNumberById(cellphoneId);
// Debug message
// NOISY-DEBUG: this.loggerBeanLocal.logDebug(MessageFormat.format("getAsObject: cellphone={0}", cellphone)); //NOI18N
<ui:param name="isShowPage" value="#{true}" />
</ui:include>
- <h:dataTable id="contact_cellphone_link" var="contact" value="#{contactPhoneController.allCellphoneContacts()}" summary="#{msg.TABLE_SUMMARY_ADMIN_SHOW_CELLPHONE_LINKS}" headerClass="table_header_column" styleClass="table_medium">
+ <h:dataTable id="contact_cellphone_link" var="contact" value="#{contactPhoneController.allMobileContacts()}" summary="#{msg.TABLE_SUMMARY_ADMIN_SHOW_CELLPHONE_LINKS}" headerClass="table_header_column" styleClass="table_medium">
<f:facet name="header">
<h:outputFormat value="#{msg.ADMIN_HEADER_SHOW_CELLPHONE_LINKS}">
<f:param value="#{adminPhoneController.cellPhone.phoneId}" />