<Scene Scope="Project" version="2">
<Scope Scope="Faces Configuration Only"/>
<Scope Scope="Project">
- <Node id="user/login_logout.xhtml" x="400" y="150" zoom="true"/>
- <Node id="admin/cellphone/admin_contact_cellphone_list.xhtml" x="1150" y="900" zoom="true"/>
- <Node id="admin/cellphone/admin_cellphone_delete.xhtml" x="400" y="1050" zoom="true"/>
- <Node id="admin/contact/admin_contact_show.xhtml" x="2650" y="300" zoom="true"/>
- <Node id="privacy.xhtml" x="1900" y="300" zoom="true"/>
- <Node id="guest/user/show_addressbook.xhtml" x="1400" y="150" zoom="true"/>
- <Node id="admin/mobile_provider/admin_mobile_provider_show.xhtml" x="900" y="450" zoom="true"/>
- <Node id="admin/user/admin_user_show.xhtml" x="400" y="1500" zoom="true"/>
- <Node id="admin/index.xhtml" x="650" y="450" zoom="true"/>
- <Node id="user/login_own_addressbooks.xhtml" x="1150" y="450" zoom="true"/>
- <Node id="user/login_user_data_saved.xhtml" x="650" y="1050" zoom="true"/>
- <Node id="admin/cellphone/admin_cellphone_show.xhtml" x="900" y="900" zoom="true"/>
- <Node id="admin/admin_logout.xhtml" x="1900" y="600" zoom="true"/>
- <Node id="user/login_data_saved.xhtml" x="1400" y="450" zoom="true"/>
- <Node id="admin/user/admin_user_unlock.xhtml" x="400" y="450" zoom="true"/>
- <Node id="admin/cellphone/admin_cellphone_edit.xhtml" x="650" y="1350" zoom="true"/>
- <Node id="index.xhtml" x="900" y="300" zoom="true"/>
- <Node id="guest/user/user_list.xhtml" x="150" y="1500" zoom="true"/>
- <Node id="user/login_edit_user_data.xhtml" x="1150" y="150" zoom="true"/>
- <Node id="*" x="150" y="300" zoom="true"/>
- <Node id="admin/admin_category_delete.xhtml" x="1650" y="150" zoom="true"/>
- <Node id="user/login_index.xhtml" x="650" y="900" zoom="true"/>
- <Node id="admin/cellphone/admin_contact_cellphone_edit.xhtml" x="2400" y="300" zoom="true"/>
- <Node id="guest/user/lost_passwd.xhtml" x="900" y="750" zoom="true"/>
- <Node id="guest/user/register_done.xhtml" x="150" y="1350" zoom="true"/>
- <Node id="guest/user/show_addressbook_entries.xhtml" x="2900" y="150" zoom="true"/>
- <Node id="user/login.xhtml" x="2150" y="150" zoom="true"/>
- <Node id="login/login_edit_user_data.xhtml" x="150" y="150" zoom="true"/>
- <Node id="admin/country/admin_country_list.xhtml" x="400" y="1200" zoom="true"/>
- <Node id="admin/cellphone/admin_contact_cellphone_unlink.xhtml" x="2150" y="450" zoom="true"/>
- <Node id="guest/user/login_error.xhtml" x="150" y="1200" zoom="true"/>
- <Node id="admin/user/admin_user_export.xhtml" x="1650" y="750" zoom="true"/>
- <Node id="admin/mobile_provider/admin_mobile_provider_delete.xhtml" x="650" y="300" zoom="true"/>
+ <Node id="user/login_logout.xhtml" x="1650" y="450" zoom="true"/>
+ <Node id="admin/cellphone/admin_contact_cellphone_list.xhtml" x="400" y="1200" zoom="true"/>
+ <Node id="admin/cellphone/admin_cellphone_delete.xhtml" x="650" y="150" zoom="true"/>
+ <Node id="admin/contact/admin_contact_show.xhtml" x="150" y="1500" zoom="true"/>
+ <Node id="privacy.xhtml" x="1150" y="750" zoom="true"/>
+ <Node id="guest/user/show_addressbook.xhtml" x="150" y="600" zoom="true"/>
+ <Node id="admin/mobile_provider/admin_mobile_provider_show.xhtml" x="2400" y="150" zoom="true"/>
+ <Node id="admin/user/admin_user_show.xhtml" x="1900" y="150" zoom="true"/>
+ <Node id="admin/index.xhtml" x="400" y="1050" zoom="true"/>
+ <Node id="user/login_own_addressbooks.xhtml" x="2400" y="450" zoom="true"/>
+ <Node id="user/login_user_data_saved.xhtml" x="1150" y="150" zoom="true"/>
+ <Node id="admin/cellphone/admin_cellphone_show.xhtml" x="150" y="1350" zoom="true"/>
+ <Node id="admin/admin_logout.xhtml" x="1400" y="450" zoom="true"/>
+ <Node id="user/login_data_saved.xhtml" x="150" y="900" zoom="true"/>
+ <Node id="admin/user/admin_user_unlock.xhtml" x="650" y="450" zoom="true"/>
+ <Node id="admin/cellphone/admin_cellphone_edit.xhtml" x="1400" y="900" zoom="true"/>
+ <Node id="index.xhtml" x="1150" y="300" zoom="true"/>
+ <Node id="guest/user/user_list.xhtml" x="1650" y="300" zoom="true"/>
+ <Node id="user/login_edit_user_data.xhtml" x="900" y="1050" zoom="true"/>
+ <Node id="admin/admin_category_delete.xhtml" x="1900" y="600" zoom="true"/>
+ <Node id="*" x="1650" y="750" zoom="true"/>
+ <Node id="user/login_index.xhtml" x="900" y="1200" zoom="true"/>
+ <Node id="admin/cellphone/admin_contact_cellphone_edit.xhtml" x="650" y="1350" zoom="true"/>
+ <Node id="guest/user/lost_passwd.xhtml" x="400" y="900" zoom="true"/>
+ <Node id="guest/user/register_done.xhtml" x="1400" y="600" zoom="true"/>
+ <Node id="guest/user/show_addressbook_entries.xhtml" x="2150" y="450" zoom="true"/>
+ <Node id="user/login.xhtml" x="400" y="450" zoom="true"/>
+ <Node id="login/login_edit_user_data.xhtml" x="900" y="450" zoom="true"/>
+ <Node id="admin/cellphone/admin_contact_cellphone_unlink.xhtml" x="1900" y="450" zoom="true"/>
+ <Node id="admin/country/admin_country_list.xhtml" x="2650" y="300" zoom="true"/>
+ <Node id="guest/user/login_error.xhtml" x="2150" y="150" zoom="true"/>
+ <Node id="admin/user/admin_user_export.xhtml" x="400" y="600" zoom="true"/>
+ <Node id="admin/mobile_provider/admin_mobile_provider_delete.xhtml" x="1400" y="750" zoom="true"/>
<Node id="guest/user/resend_done.xhtml" x="900" y="600" zoom="true"/>
- <Node id="user/login_change_password.xhtml" x="2650" y="150" zoom="true"/>
- <Node id="admin/mobile_provider/admin_mobile_provider_list.xhtml" x="1400" y="300" zoom="true"/>
- <Node id="admin/contact/admin_contact_export.xhtml" x="2400" y="450" zoom="true"/>
- <Node id="guest/user/user_profile.xhtml" x="400" y="600" zoom="true"/>
- <Node id="guest/user/confirm_account.xhtml" x="1150" y="300" zoom="true"/>
- <Node id="admin/cellphone/admin_contact_cellphone_delete.xhtml" x="900" y="150" zoom="true"/>
- <Node id="exception.xhtml" x="1650" y="600" zoom="true"/>
- <Node id="admin/user/admin_user_delete.xhtml" x="900" y="1050" zoom="true"/>
- <Node id="login/login_index.xhtml" x="150" y="1050" zoom="true"/>
- <Node id="admin/user/admin_user_edit.xhtml" x="650" y="150" zoom="true"/>
- <Node id="guest/user/register_page2.xhtml" x="1400" y="600" zoom="true"/>
- <Node id="terms.xhtml" x="650" y="600" zoom="true"/>
- <Node id="admin/contact/admin_contact_list.xhtml" x="150" y="750" zoom="true"/>
- <Node id="admin/contact/admin_contact_edit.xhtml" x="1400" y="750" zoom="true"/>
- <Node id="admin/user/admin_user_lock.xhtml" x="1650" y="450" zoom="true"/>
- <Node id="admin/user/admin_user_list.xhtml" x="1150" y="600" zoom="true"/>
- <Node id="admin/admin_user_add.xhtml" x="1900" y="450" zoom="true"/>
- <Node id="admin/country/admin_country_delete.xhtml" x="400" y="300" zoom="true"/>
- <Node id="user/login_change_personal_data.xhtml" x="1400" y="900" zoom="true"/>
- <Node id="logout.xhtml" x="2150" y="300" zoom="true"/>
- <Node id="admin/country/admin_country_edit.xhtml" x="650" y="1200" zoom="true"/>
- <Node id="guest/user/resend_link.xhtml" x="400" y="900" zoom="true"/>
- <Node id="user/login_add_addressbook.xhtml" x="1650" y="300" zoom="true"/>
- <Node id="admin/cellphone/admin_cellphone_list.xhtml" x="150" y="600" zoom="true"/>
- <Node id="user/login_contact_data_saved.xhtml" x="150" y="1650" zoom="true"/>
- <Node id="user/user_profile.xhtml" x="1150" y="1050" zoom="true"/>
- <Node id="admin/contact/admin_contact_delete.xhtml" x="900" y="1200" zoom="true"/>
- <Node id="imprint.xhtml" x="150" y="900" zoom="true"/>
+ <Node id="user/login_change_password.xhtml" x="900" y="150" zoom="true"/>
+ <Node id="admin/mobile_provider/admin_mobile_provider_list.xhtml" x="150" y="750" zoom="true"/>
+ <Node id="admin/contact/admin_contact_export.xhtml" x="400" y="1500" zoom="true"/>
+ <Node id="guest/user/user_profile.xhtml" x="1150" y="450" zoom="true"/>
+ <Node id="guest/user/confirm_account.xhtml" x="2900" y="150" zoom="true"/>
+ <Node id="exception.xhtml" x="400" y="150" zoom="true"/>
+ <Node id="admin/user/admin_user_delete.xhtml" x="150" y="300" zoom="true"/>
+ <Node id="admin/cellphone/admin_contact_cellphone_delete.xhtml" x="650" y="300" zoom="true"/>
+ <Node id="login/login_index.xhtml" x="1900" y="300" zoom="true"/>
+ <Node id="admin/user/admin_user_edit.xhtml" x="900" y="300" zoom="true"/>
+ <Node id="guest/user/register_page2.xhtml" x="1400" y="150" zoom="true"/>
+ <Node id="terms.xhtml" x="2400" y="300" zoom="true"/>
+ <Node id="admin/contact/admin_contact_edit.xhtml" x="2150" y="300" zoom="true"/>
+ <Node id="admin/contact/admin_contact_list.xhtml" x="650" y="1200" zoom="true"/>
+ <Node id="admin/user/admin_user_lock.xhtml" x="1650" y="150" zoom="true"/>
+ <Node id="admin/admin_user_add.xhtml" x="150" y="450" 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="2650" y="150" zoom="true"/>
+ <Node id="user/login_change_personal_data.xhtml" x="1150" y="600" zoom="true"/>
+ <Node id="admin/country/admin_country_edit.xhtml" x="1400" y="300" zoom="true"/>
+ <Node id="logout.xhtml" x="1150" y="900" zoom="true"/>
+ <Node id="user/login_add_addressbook.xhtml" x="400" y="750" zoom="true"/>
+ <Node id="guest/user/resend_link.xhtml" x="900" y="900" zoom="true"/>
+ <Node id="admin/cellphone/admin_cellphone_list.xhtml" x="150" y="150" zoom="true"/>
+ <Node id="user/login_contact_data_saved.xhtml" x="150" y="1050" zoom="true"/>
+ <Node id="admin/contact/admin_contact_delete.xhtml" x="1150" y="1050" zoom="true"/>
+ <Node id="user/user_profile.xhtml" x="150" y="1650" zoom="true"/>
+ <Node id="imprint.xhtml" x="150" y="1200" zoom="true"/>
<Node id="admin/mobile_provider/admin_mobile_provider_edit.xhtml" x="400" y="1350" zoom="true"/>
- <Node id="admin/cellphone/admin_contact_cellphone_show.xhtml" x="1150" y="750" zoom="true"/>
- <Node id="admin/admin_product_delete.xhtml" x="650" y="750" zoom="true"/>
- <Node id="guest/user/login.xhtml" x="1900" y="150" zoom="true"/>
- <Node id="guest/user/register.xhtml" x="150" y="450" 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="750" zoom="true"/>
+ <Node id="admin/cellphone/admin_contact_cellphone_show.xhtml" x="400" y="300" zoom="true"/>
+ <Node id="guest/user/login.xhtml" x="650" y="750" zoom="true"/>
+ <Node id="admin/admin_product_delete.xhtml" x="650" y="1050" zoom="true"/>
+ <Node id="guest/user/register.xhtml" x="1650" y="600" zoom="true"/>
+ <Node id="user/login_change_email_address.xhtml" x="900" y="750" zoom="true"/>
+ <Node id="user/login/login_data_saved.xhtml" x="650" y="600" zoom="true"/>
</Scope>
<Scope Scope="All Faces Configurations"/>
</Scene>
import org.mxchange.jcontacts.events.contact.update.AdminUpdatedContactEvent;
import org.mxchange.jjobs.beans.BaseJobsController;
import org.mxchange.jjobs.beans.contact.JobsContactWebSessionController;
+import org.mxchange.jjobs.beans.helper.JobsWebRequestController;
import org.mxchange.jjobs.beans.phone.JobsAdminPhoneWebRequestController;
import org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote;
import org.mxchange.jusercore.events.user.add.AdminAddedUserEvent;
@Inject
private JobsAdminPhoneWebRequestController adminPhoneController;
+ /**
+ * Admin helper instance
+ */
+ @Inject
+ private JobsWebRequestController beanHelper;
+
/**
* General contact controller
*/
@Override
public List<Contact> allCellphoneContacts () {
// Get id
- Long phoneId = this.adminPhoneController.getCellPhoneNumber().getPhoneId();
+ Long phoneId = this.beanHelper.getCellPhoneNumber().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.getCellPhoneNumber())) {
+ if (Objects.equals(contact.getContactCellphoneNumber(), this.beanHelper.getCellPhoneNumber())) {
// Found one
list.add(contact);
}
import java.io.Serializable;
import org.mxchange.jcontacts.contact.Contact;
+import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber;
+import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
+import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
import org.mxchange.jusercore.model.user.User;
/**
public interface JobsWebRequestController extends Serializable {
/**
- * Getter for user instance
- * <p>
- * @return User instance
+ * Copies currently set cell phone instance's data to admin phone controller
*/
- User getUser ();
+ void copyCellphoneNumberToController ();
/**
- * Setter for user instance
- * <p>
- * @param user User instance
+ * Copies currently set contact instance's data to adminContactController
*/
- void setUser (final User user);
+ void copyContactToController ();
/**
* Copies currently set user instance's data to adminUserController
void setContact (final Contact contact);
/**
- * Copies currently set contact instance's data to adminContactController
+ * Getter for user instance
+ * <p>
+ * @return User instance
*/
- void copyContactToController ();
+ User getUser ();
+
+ /**
+ * Setter for user instance
+ * <p>
+ * @param user User instance
+ */
+ void setUser (final User user);
+
+ /**
+ * Getter for dialable cellphone number instance
+ * <p>
+ * @return Dialable cellphone number instance
+ */
+ DialableCellphoneNumber getCellPhoneNumber ();
+
+ /**
+ * Setter for dialable cellphone number instance
+ * <p>
+ * @param cellPhone Dialable cellphone number instance
+ */
+ void setCellPhoneNumber (final DialableCellphoneNumber cellPhone);
+
+ /**
+ * Getter for dialable land-line number instance
+ * <p>
+ * @return Dialable land-line number instance
+ */
+ DialableLandLineNumber getLandLine ();
+
+ /**
+ * Setter for dialable land-line number instance
+ * <p>
+ * @param landLine Dialable land-line number instance
+ */
+ void setLandLine (final DialableLandLineNumber landLine);
+
+ /**
+ * Getter for dialable fax number instance
+ * <p>
+ * @return Dialable fax number instance
+ */
+ DialableFaxNumber getFax ();
+
+ /**
+ * Setter for dialable fax number instance
+ * <p>
+ * @param fax Dialable fax number instance
+ */
+ void setFax (final DialableFaxNumber fax);
}
import javax.inject.Named;
import org.mxchange.jcontacts.contact.Contact;
import org.mxchange.jjobs.beans.contact.JobsAdminContactWebRequestController;
+import org.mxchange.jjobs.beans.phone.JobsAdminPhoneWebRequestController;
import org.mxchange.jjobs.beans.user.JobsUserWebSessionController;
import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber;
import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
import org.mxchange.jusercore.model.user.User;
-import org.mxchange.jjobs.beans.phone.JobsAdminPhoneWebRequestController;
/**
* A general helper for beans
@Inject
private JobsAdminPhoneWebRequestController adminPhoneController;
+ /**
+ * Cell phone number
+ */
+ private DialableCellphoneNumber cellPhoneNumber;
+
/**
* Contact instance
*/
private Contact contact;
+ /**
+ * Fax number
+ */
+ private DialableFaxNumber fax;
+
+ /**
+ * Land-line number
+ */
+ private DialableLandLineNumber landLine;
+
/**
* User instance
*/
}
@Override
- public void copyContactToController () {
- // Log message
- //* NOISY-DEBUG: */ System.out.println("AdminHelper::copyContactToController - CALLED!"); //NOI18N
+ public void copyCellphoneNumberToController () {
+ // Validate cellphone instance
+ if (this.getCellPhoneNumber() == null) {
+ // Throw NPE
+ throw new NullPointerException("this.cellPhoneNumber is null");
+ } else if (this.getCellPhoneNumber().getPhoneId() == null) {
+ // Throw again
+ throw new NullPointerException("this.cellPhoneNumber.phoneId is null");
+ } else if (this.getCellPhoneNumber().getPhoneId() < 1) {
+ // Invalid id number
+ throw new IllegalArgumentException(MessageFormat.format("this.cellPhoneNumber.phoneId={0} is not valid", this.getCellPhoneNumber().getPhoneId()));
+ } else if (this.getCellPhoneNumber().getCellphoneProvider() == null) {
+ // Throw NPE again
+ throw new NullPointerException("this.cellPhoneNumber.cellphoneProvider is null");
+ } else if (this.getCellPhoneNumber().getCellphoneProvider().getProviderId() == null) {
+ // ... throw again
+ throw new NullPointerException("this.cellPhoneNumber.cellphoneProvider.providerId is null");
+ } else if (this.getCellPhoneNumber().getCellphoneProvider().getProviderId() < 1) {
+ // Invalid id
+ throw new IllegalArgumentException(MessageFormat.format("this.cellPhoneNumber.cellphoneProvider.providerId={0} is invalid", this.getCellPhoneNumber().getCellphoneProvider().getProviderId()));
+ } else if (this.getCellPhoneNumber().getPhoneNumber() == null) {
+ // Throw NPE again ...
+ throw new NullPointerException("this.cellPhoneNumber.phoneNumber is null");
+ } else if (this.getCellPhoneNumber().getPhoneNumber() < 1) {
+ // Invalid id number
+ throw new IllegalArgumentException(MessageFormat.format("this.cellPhoneNumber.phoneNumber={0} is not valid", this.getCellPhoneNumber().getPhoneNumber()));
+ }
- // Validate user instance
+ // Copy all (changeable) data fields to admin controller
+ this.adminPhoneController.setCellphoneProvider(this.getCellPhoneNumber().getCellphoneProvider());
+ this.adminPhoneController.setPhoneNumber(this.getCellPhoneNumber().getPhoneNumber());
+ }
+
+ @Override
+ public void copyContactToController () {
+ // Validate contact instance
if (this.getContact() == null) {
// Throw NPE
throw new NullPointerException("this.contact is null"); //NOI18N
//* NOISY-DEBUG: */ System.out.println("AdminHelper::copyUserToController - EXIT!"); //NOI18N
}
+ @Override
+ public DialableCellphoneNumber getCellPhoneNumber () {
+ return this.cellPhoneNumber;
+ }
+
+ @Override
+ public void setCellPhoneNumber (final DialableCellphoneNumber cellPhoneNumber) {
+ this.cellPhoneNumber = cellPhoneNumber;
+ }
+
@Override
public Contact getContact () {
return this.contact;
return messageKey;
}
+ @Override
+ public DialableFaxNumber getFax () {
+ return this.fax;
+ }
+
+ @Override
+ public void setFax (final DialableFaxNumber fax) {
+ this.fax = fax;
+ }
+
+ @Override
+ public DialableLandLineNumber getLandLine () {
+ return this.landLine;
+ }
+
+ @Override
+ public void setLandLine (final DialableLandLineNumber landLine) {
+ this.landLine = landLine;
+ }
+
@Override
public User getUser () {
return this.user;
// Is cellphone set?
if (contact.getContactCellphoneNumber() instanceof DialableCellphoneNumber) {
// Yes, then set it in admin controller
- this.adminPhoneController.setCellPhoneNumber(contact.getContactCellphoneNumber());
+ this.setCellPhoneNumber(contact.getContactCellphoneNumber());
}
// Is land-line set?
if (contact.getContactLandLineNumber() instanceof DialableLandLineNumber) {
// Yes, then set it in admin controller
- this.adminPhoneController.setLandLine(contact.getContactLandLineNumber());
+ this.setLandLine(contact.getContactLandLineNumber());
}
// Is fax set?
if (contact.getContactFaxNumber() instanceof DialableFaxNumber) {
// Yes, then set it in admin controller
- this.adminPhoneController.setFax(contact.getContactFaxNumber());
+ this.setFax(contact.getContactFaxNumber());
}
}
import javax.naming.NamingException;
import org.mxchange.jcontacts.phone.AdminContactsPhoneSessionBeanRemote;
import org.mxchange.jjobs.beans.BaseJobsController;
+import org.mxchange.jjobs.beans.helper.JobsWebRequestController;
import org.mxchange.jphone.events.updated.AdminCellphoneNumberUpdatedEvent;
import org.mxchange.jphone.events.updated.AdminUpdatedCellphoneNumberEvent;
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.mobileprovider.MobileProvider;
/**
private AdminContactsPhoneSessionBeanRemote adminPhoneBean;
/**
- * Cell phone number
+ * Admin helper instance
*/
- private DialableCellphoneNumber cellPhoneNumber;
+ @Inject
+ private JobsWebRequestController beanHelper;
/**
* Event being fired when an administrator has updated cell phone number
*/
private MobileProvider cellphoneProvider;
- /**
- * Fax number
- */
- private DialableFaxNumber fax;
-
- /**
- * Land-line number
- */
- private DialableLandLineNumber landLine;
-
/**
* Phone number
*/
@Override
public String editCellphoneData () {
// Is all data set
- if (this.getCellPhoneNumber() == null) {
+ if (this.beanHelper.getCellPhoneNumber() == null) {
// Not set, throw NPE
throw new NullPointerException("this.cellphoneNumber is null"); //NOI18N
- } else if (this.getCellPhoneNumber().getPhoneId() == null) {
+ } else if (this.beanHelper.getCellPhoneNumber().getPhoneId() == null) {
// Throw NPE again
throw new NullPointerException("this.cellphoneNumber.phoneId is null"); //NOI18N
- } else if (this.getCellPhoneNumber().getPhoneId() < 1) {
+ } else if (this.beanHelper.getCellPhoneNumber().getPhoneId() < 1) {
// Invalid number
- throw new IllegalArgumentException(MessageFormat.format("this.cellphoneNumber.phoneId={0} is not valid", this.getCellPhoneNumber().getPhoneId())); //NOI18N
- } else if (this.getCellPhoneNumber().getCellphoneProvider() == null) {
+ throw new IllegalArgumentException(MessageFormat.format("this.cellphoneNumber.phoneId={0} is not valid", this.beanHelper.getCellPhoneNumber().getPhoneId())); //NOI18N
+ } else if (this.beanHelper.getCellPhoneNumber().getCellphoneProvider() == null) {
// Throw NPE
throw new NullPointerException("this.cellphoneNumber.cellphoneProvider is null"); //NOI18N
- } else if (this.getCellPhoneNumber().getCellphoneProvider().getProviderId() == null) {
+ } else if (this.beanHelper.getCellPhoneNumber().getCellphoneProvider().getProviderId() == null) {
// ... throw again
throw new NullPointerException("this.cellphoneNumber.cellphoneProvider.providerId is null"); //NOI18N
- } else if (this.getCellPhoneNumber().getCellphoneProvider().getProviderId() < 1) {
+ } else if (this.beanHelper.getCellPhoneNumber().getCellphoneProvider().getProviderId() < 1) {
// Id not valid
- throw new IllegalArgumentException(MessageFormat.format("this.cellphoneNumber.cellphoneProvider.providerId={0} is not valid.", this.getCellPhoneNumber().getCellphoneProvider().getProviderId())); //NOI18N
- } else if (this.getCellPhoneNumber().getPhoneNumber() == null) {
+ throw new IllegalArgumentException(MessageFormat.format("this.cellphoneNumber.cellphoneProvider.providerId={0} is not valid.", this.beanHelper.getCellPhoneNumber().getCellphoneProvider().getProviderId())); //NOI18N
+ } else if (this.beanHelper.getCellPhoneNumber().getPhoneNumber() == null) {
// Throw NPE again
throw new NullPointerException("this.cellphoneNumber.phoneNumber is null"); //NOI18N
- } else if (this.getCellPhoneNumber().getPhoneNumber() < 1) {
+ } else if (this.beanHelper.getCellPhoneNumber().getPhoneNumber() < 1) {
// Throw NPE again
- throw new NullPointerException(MessageFormat.format("this.cellphoneNumber.phoneNumber={0} is not valid.", this.getCellPhoneNumber().getPhoneNumber())); //NOI18N
+ throw new NullPointerException(MessageFormat.format("this.cellphoneNumber.phoneNumber={0} is not valid.", this.beanHelper.getCellPhoneNumber().getPhoneNumber())); //NOI18N
} else if (this.getCellphoneProvider() == null) {
// Not provided
this.showFacesMessage("form_edit_cellphone:cellphoneProvider", "No mobile provider selected"); //NOI18N
}
// Is the mobile provider and number the same?
- if ((Objects.equals(this.getCellphoneProvider(), this.getCellPhoneNumber().getCellphoneProvider())) && (Objects.equals(this.getPhoneNumber(), this.getCellPhoneNumber().getPhoneNumber()))) {
+ if ((Objects.equals(this.getCellphoneProvider(), this.beanHelper.getCellPhoneNumber().getCellphoneProvider())) && (Objects.equals(this.getPhoneNumber(), this.beanHelper.getCellPhoneNumber().getPhoneNumber()))) {
// No difference in both together, no need to edit
return ""; //NOI18N
}
// Set all data
- this.getCellPhoneNumber().setCellphoneProvider(this.getCellphoneProvider());
- this.getCellPhoneNumber().setPhoneNumber(this.getPhoneNumber());
+ this.beanHelper.getCellPhoneNumber().setCellphoneProvider(this.getCellphoneProvider());
+ this.beanHelper.getCellPhoneNumber().setPhoneNumber(this.getPhoneNumber());
// Send to bean
- DialableCellphoneNumber updatedNumber = this.adminPhoneBean.updateCellphoneData(this.getCellPhoneNumber());
+ DialableCellphoneNumber updatedNumber = this.adminPhoneBean.updateCellphoneData(this.beanHelper.getCellPhoneNumber());
// Fire event
this.cellPhoneNumberUpdatedEvent.fire(new AdminCellphoneNumberUpdatedEvent(updatedNumber));
return "admin_edit_cellphone?faces-redirect=true&includeViewParams=true"; //NOI18N
}
- @Override
- public DialableCellphoneNumber getCellPhoneNumber () {
- return this.cellPhoneNumber;
- }
-
- @Override
- public void setCellPhoneNumber (final DialableCellphoneNumber cellPhoneNumber) {
- this.cellPhoneNumber = cellPhoneNumber;
- }
-
@Override
public MobileProvider getCellphoneProvider () {
return this.cellphoneProvider;
this.cellphoneProvider = cellphoneProvider;
}
- @Override
- public DialableFaxNumber getFax () {
- return this.fax;
- }
-
- @Override
- public void setFax (final DialableFaxNumber fax) {
- this.fax = fax;
- }
-
- @Override
- public DialableLandLineNumber getLandLine () {
- return this.landLine;
- }
-
- @Override
- public void setLandLine (final DialableLandLineNumber landLine) {
- this.landLine = landLine;
- }
-
@Override
public Long getPhoneNumber () {
return this.phoneNumber;
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.mobileprovider.MobileProvider;
/**
*/
String editCellphoneData ();
- /**
- * Getter for dialable cellphone number instance
- * <p>
- * @return Dialable cellphone number instance
- */
- DialableCellphoneNumber getCellPhoneNumber ();
-
- /**
- * Setter for dialable cellphone number instance
- * <p>
- * @param cellPhone Dialable cellphone number instance
- */
- void setCellPhoneNumber (final DialableCellphoneNumber cellPhone);
-
- /**
- * Setter for dialable land-line number instance
- * <p>
- * @param landLine Dialable land-line number instance
- */
- void setLandLine (final DialableLandLineNumber landLine);
-
- /**
- * Getter for dialable land-line number instance
- * <p>
- * @return Dialable land-line number instance
- */
- DialableLandLineNumber getLandLine ();
-
- /**
- * Setter for dialable fax number instance
- * <p>
- * @param fax Dialable fax number instance
- */
- void setFax (final DialableFaxNumber fax);
-
- /**
- * Getter for dialable fax number instance
- * <p>
- * @return Dialable fax number instance
- */
- DialableFaxNumber getFax ();
-
/**
* Getter for cell phone provider
* <p>
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
- <h:outputText styleClass="errors" value="#{msg.ERROR_ADMIN_BEAN_CELLPHONE_NUMBER_NOT_SET}" rendered="#{empty adminPhoneController.cellPhoneNumber}" />
+ <h:outputText styleClass="errors" value="#{msg.ERROR_ADMIN_BEAN_CELLPHONE_NUMBER_NOT_SET}" rendered="#{empty beanHelper.cellPhoneNumber}" />
- <h:panelGrid id="cellphone_data" summary="#{msg.ADMIN_TABLE_SUMMARY_SHOW_CELLPHONE_DATA}" headerClass="table_header_column" styleClass="table_big" columns="2" rendered="#{not empty adminPhoneController.cellPhoneNumber}">
+ <h:panelGrid id="cellphone_data" summary="#{msg.ADMIN_TABLE_SUMMARY_SHOW_CELLPHONE_DATA}" headerClass="table_header_column" styleClass="table_big" columns="2" rendered="#{not empty beanHelper.cellPhoneNumber}">
<f:facet name="header">
<h:outputText value="#{msg.ADMIN_HEADER_SHOW_CELLPHONE_DATA}" />
</f:facet>
<h:column>
<h:outputLabel for="cellphoneId" styleClass="data_label" value="#{msg.ADMIN_SHOW_CELLPHONE_ID}" />
- <h:outputText id="cellphoneId" styleClass="data_field" value="#{adminPhoneController.cellPhoneNumber.phoneId}" />
+ <h:outputText id="cellphoneId" styleClass="data_field" value="#{beanHelper.cellPhoneNumber.phoneId}" />
</h:column>
<h:column>
<h:outputLabel for="cellphoneProvider" styleClass="data_label" value="#{msg.ADMIN_SHOW_CELLPHONE_PROVIDER_NAME}" />
<h:link outcome="admin_show_mobile_provider">
- <f:param name="providerId" value="#{adminPhoneController.cellPhoneNumber.cellphoneProvider.providerId}" />
- <h:outputText id="cellphoneProvider" styleClass="data_field" value="#{adminPhoneController.cellPhoneNumber.cellphoneProvider.providerName}" />
+ <f:param name="providerId" value="#{beanHelper.cellPhoneNumber.cellphoneProvider.providerId}" />
+ <h:outputText id="cellphoneProvider" styleClass="data_field" value="#{beanHelper.cellPhoneNumber.cellphoneProvider.providerName}" />
</h:link>
</h:column>
<h:column>
<h:outputLabel for="cellphoneNumber" styleClass="data_label" value="#{msg.ADMIN_SHOW_CELLPHONE_NUMBER_COMPLETE}" />
- <h:outputText id="cellphoneNumber" styleClass="data_field" value="#{adminPhoneController.cellPhoneNumber.cellphoneProvider.providerCountry.countryExternalDialPrefix}#{adminPhoneController.cellPhoneNumber.cellphoneProvider.providerDialPrefix}-#{adminPhoneController.cellPhoneNumber.phoneNumber}" />
+ <h:outputText id="cellphoneNumber" styleClass="data_field" value="#{beanHelper.cellPhoneNumber.cellphoneProvider.providerCountry.countryExternalDialPrefix}#{beanHelper.cellPhoneNumber.cellphoneProvider.providerDialPrefix}-#{beanHelper.cellPhoneNumber.phoneNumber}" />
</h:column>
<h:column>
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
- <h:outputText styleClass="errors" value="#{msg.ERROR_ADMIN_BEAN_CELLPHONE_NUMBER_NOT_SET}" rendered="#{empty adminPhoneController.cellPhoneNumber}" />
+ <h:outputText styleClass="errors" value="#{msg.ERROR_ADMIN_BEAN_CELLPHONE_NUMBER_NOT_SET}" rendered="#{empty beanHelper.cellPhoneNumber}" />
- <ui:fragment rendered="#{not empty adminPhoneController.cellPhoneNumber}">
+ <ui:fragment rendered="#{not empty beanHelper.cellPhoneNumber}">
<ul class="mini_nav">
<ui:fragment rendered="#{empty isShowPage or not isShowPage}">
<li class="mini_link">
<h:link outcome="admin_show_cellphone">
<h:outputText value="#{msg.ADMIN_LINK_SHOW_SHORT}" title="#{msg.ADMIN_LINK_SHOW_SHORT_TITLE}" />
- <f:param name="phoneId" value="#{adminPhoneController.cellPhoneNumber.phoneId}" />
+ <f:param name="phoneId" value="#{beanHelper.cellPhoneNumber.phoneId}" />
</h:link>
</li>
</ui:fragment>
<li class="mini_link">
<h:link outcome="admin_edit_cellphone">
<h:outputText value="#{msg.ADMIN_LINK_EDIT_SHORT}" title="#{msg.ADMIN_LINK_EDIT_SHORT_TITLE}" />
- <f:param name="phoneId" value="#{adminPhoneController.cellPhoneNumber.phoneId}" />
+ <f:param name="phoneId" value="#{beanHelper.cellPhoneNumber.phoneId}" />
</h:link>
</li>
<li class="mini_link">
<h:link outcome="admin_unlink_contact_cellphone">
<h:outputText styleClass="unlink_link" value="#{msg.ADMIN_LINK_UNLINK_SHORT}" title="#{msg.ADMIN_LINK_UNLINK_SHORT_TITLE}" />
- <f:param name="phoneId" value="#{adminPhoneController.cellPhoneNumber.phoneId}" />
+ <f:param name="phoneId" value="#{beanHelper.cellPhoneNumber.phoneId}" />
<f:param name="contactId" value="#{beanHelper.contact.contactId}" />
</h:link>
</li>
<li class="mini_link">
<h:link outcome="admin_delete_cellphone">
<h:outputText styleClass="delete_link" value="#{msg.ADMIN_LINK_DELETE_SHORT}" title="#{msg.ADMIN_LINK_DELETE_SHORT_TITLE}" />
- <f:param name="phoneId" value="#{adminPhoneController.cellPhoneNumber.phoneId}" />
+ <f:param name="phoneId" value="#{beanHelper.cellPhoneNumber.phoneId}" />
</h:link>
</li>
</ul>
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
- <h:outputText styleClass="errors" value="#{msg.ERROR_ADMIN_BEAN_CELLPHONE_NUMBER_NOT_SET}" rendered="#{empty adminPhoneController.cellPhoneNumber}" />
+ <h:outputText styleClass="errors" value="#{msg.ERROR_ADMIN_BEAN_CELLPHONE_NUMBER_NOT_SET}" rendered="#{empty beanHelper.cellPhoneNumber}" />
<div class="para">
<fieldset id="phone_data">
</div>
<div class="table_right_medium">
- <h:outputText id="cellphoneId" value="#{adminPhoneController.cellPhoneNumber.phoneId}" />
+ <h:outputText id="cellphoneId" value="#{beanHelper.cellPhoneNumber.phoneId}" />
</div>
<div class="clear"></div>
>
<f:metadata>
- <f:viewParam name="phoneId" value="#{adminPhoneController.cellPhoneNumber}" converter="CellphoneConverter" required="true" requiredMessage="#{msg.ERROR_PARAMETER_PHONE_ID_NOT_SET}" />
+ <f:viewParam name="phoneId" value="#{beanHelper.cellPhoneNumber}" converter="CellphoneConverter" required="true" requiredMessage="#{msg.ERROR_PARAMETER_PHONE_ID_NOT_SET}" />
</f:metadata>
<ui:composition template="/WEB-INF/templates/admin/admin_base.tpl">
>
<f:metadata>
- <f:viewParam name="phoneId" value="#{adminPhoneController.cellPhoneNumber}" converter="CellphoneConverter" required="true" requiredMessage="#{msg.ERROR_PARAMETER_PHONE_ID_NOT_SET}" />
+ <f:viewParam name="phoneId" value="#{beanHelper.cellPhoneNumber}" converter="CellphoneConverter" required="true" requiredMessage="#{msg.ERROR_PARAMETER_PHONE_ID_NOT_SET}" />
+ <f:viewAction action="#{beanHelper.copyCellphoneNumberToController()}" />
</f:metadata>
<ui:composition template="/WEB-INF/templates/admin/admin_base.tpl">
</ui:define>
<ui:define name="content">
- <h:form id="form_edit_cellphone" rendered="#{not empty adminPhoneController.cellPhoneNumber}">
+ <h:form id="form_edit_cellphone" rendered="#{not empty beanHelper.cellPhoneNumber}">
<div class="table_medium">
<div class="table_header">
#{msg.ADMIN_EDIT_CELLPHONE_TITLE}
</div>
</h:form>
- <h:outputText styleClass="errors" value="#{msg.ERROR_ADMIN_BEAN_CELLPHONE_NUMBER_NOT_SET}" rendered="#{empty adminPhoneController.cellPhoneNumber}" />
+ <h:outputText styleClass="errors" value="#{msg.ERROR_ADMIN_BEAN_CELLPHONE_NUMBER_NOT_SET}" rendered="#{empty beanHelper.cellPhoneNumber}" />
</ui:define>
</ui:composition>
</html>
>
<f:metadata>
- <f:viewParam name="phoneId" value="#{adminPhoneController.cellPhoneNumber}" converter="CellphoneConverter" required="true" requiredMessage="#{msg.ERROR_PARAMETER_PHONE_ID_NOT_SET}" />
+ <f:viewParam name="phoneId" value="#{beanHelper.cellPhoneNumber}" converter="CellphoneConverter" required="true" requiredMessage="#{msg.ERROR_PARAMETER_PHONE_ID_NOT_SET}" />
</f:metadata>
<ui:composition template="/WEB-INF/templates/admin/admin_base.tpl">
<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">
<f:facet name="header">
<h:outputFormat value="#{msg.ADMIN_HEADER_SHOW_CELLPHONE_LINKS}">
- <f:param value="#{adminPhoneController.cellPhoneNumber.phoneId}" />
+ <f:param value="#{beanHelper.cellPhoneNumber.phoneId}" />
</h:outputFormat>
</f:facet>
<li class="mini_link">
<h:link outcome="admin_unlink_contact_cellphone">
<h:outputText styleClass="unlink_link" value="#{msg.ADMIN_LINK_UNLINK_SHORT}" title="#{msg.ADMIN_LINK_UNLINK_SHORT_TITLE}" />
- <f:param name="phoneId" value="#{adminPhoneController.cellPhoneNumber.phoneId}" />
+ <f:param name="phoneId" value="#{beanHelper.cellPhoneNumber.phoneId}" />
<f:param name="contactId" value="#{contact.contactId}" />
</h:link>
</li>
>
<f:metadata>
- <f:viewParam name="phoneId" value="#{adminPhoneController.cellPhoneNumber}" converter="CellphoneConverter" required="true" requiredMessage="#{msg.ERROR_PARAMETER_PHONE_ID_NOT_SET}" />
+ <f:viewParam name="phoneId" value="#{beanHelper.cellPhoneNumber}" converter="CellphoneConverter" required="true" requiredMessage="#{msg.ERROR_PARAMETER_PHONE_ID_NOT_SET}" />
<f:viewParam name="contactId" value="#{beanHelper.contact}" converter="ContactConverter" required="true" requiredMessage="#{msg.ERROR_PARAMETER_CONTACT_ID_NOT_SET}" />
</f:metadata>