import org.mxchange.jusercore.events.user.add.AdminAddedUserEvent;
/**
- * Regular bean (controller) for phone numbers
+ * Regular controller (bean) for phone numbers
* <p>
* @author Roland Haeder<rhaeder@cho-time.de>
*/
import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider;
/**
- * An administrative user bean (controller)
+ * An administrative user controller (bean)
* <p>
* @author Roland Haeder<roland@mxchange.org>
*/
import org.mxchange.jusercore.model.user.User;
/**
- * A general contact bean (controller)
+ * A general contact controller (bean)
* <p>
* @author Roland Haeder<roland@mxchange.org>
*/
private JobsUserWebSessionController userController;
/**
- * Login bean (controller)
+ * Login controller (bean)
*/
@Inject
private JobsUserLoginWebSessionController userLoginController;
@Local
public interface JobsContactWebSessionController extends Serializable {
- /**
- * Minimum password length
- */
- public static final Integer MINIMUM_PASSWORD_LENGTH = 5;
-
/**
* Returns a list of all found contacts
* <p>
--- /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.contact.phone;
+
+import java.text.MessageFormat;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.event.Observes;
+import javax.inject.Inject;
+import javax.inject.Named;
+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.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.jusercore.events.user.add.AdminAddedUserEvent;
+
+/**
+ * An administrative contact phone controller (bean)
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+@Named ("contactPhoneController")
+@RequestScoped
+public class JobsContactPhoneWebRequestBean extends BaseJobsController implements JobsContactPhoneWebRequestController {
+
+ /**
+ * Serial number
+ */
+ private static final long serialVersionUID = 542_145_347_916L;
+
+ /**
+ * <<<<<<<
+ * HEAD:src/java/org/mxchange/jjobs/beans/contact/phone/JobsContactPhoneWebRequestBean.java
+ * Administrative phone controller
+ */
+ @Inject
+ private JobsAdminPhoneWebRequestController adminPhoneController;
+
+ /**
+ * ======= >>>>>>> 2a40d73... Continued with cell phone unlink: (please
+ * cherry-pick):src/java/de/chotime/landingpage/beans/contact/phone/LandingContactPhoneWebSessionBean.java
+ * Admin helper instance
+ */
+ @Inject
+ private JobsWebRequestController beanHelper;
+
+ /**
+ * General contact controller
+ */
+ @Inject
+ private JobsContactWebSessionController contactController;
+
+ /**
+ * "Cache" for contact lists, mostly only one is assigned. So this cache
+ * shouldn't grow beyond control.
+ */
+ private final Map<Long, List<Contact>> contacts;
+
+ /**
+ * Default constructor
+ */
+ public JobsContactPhoneWebRequestBean () {
+ // Init lists/maps
+ this.contacts = new HashMap<>(10);
+ }
+
+ @Override
+ public void afterAdminAddedContact (@Observes final AdminAddedContactEvent event) {
+ // The event must be valid
+ if (null == event) {
+ // Throw NPE
+ throw new NullPointerException("event is null"); //NOI18N
+ } else if (event.getAddedContact() == null) {
+ // Throw again ...
+ throw new NullPointerException("event.addedContact is null"); //NOI18N
+ } else if (event.getAddedContact().getContactId() == null) {
+ // ... and again
+ throw new NullPointerException("event.addedContact.contactId is null"); //NOI18N
+ } else if (event.getAddedContact().getContactId() < 1) {
+ // Not valid
+ throw new IllegalArgumentException(MessageFormat.format("event.addedContact.contactId={0} is not valid", event.getAddedContact().getContactId())); //NOI18N //NOI18N
+ }
+
+ // Clear this bean
+ this.clear();
+ }
+
+ @Override
+ public void afterAdminAddedUserEvent (@Observes final AdminAddedUserEvent event) {
+ // event should not be null
+ if (null == event) {
+ // Throw NPE
+ throw new NullPointerException("event is null"); //NOI18N
+ } else if (event.getAddedUser() == null) {
+ // Throw NPE again
+ throw new NullPointerException("event.addedUser is null"); //NOI18N
+ } else if (event.getAddedUser().getUserId() == null) {
+ // userId is null
+ throw new NullPointerException("event.addedUser.userId is null"); //NOI18N
+ } else if (event.getAddedUser().getUserId() < 1) {
+ // Not avalid id
+ throw new IllegalArgumentException(MessageFormat.format("userId of user={0} is not valid: {1}", event.getAddedUser(), event.getAddedUser().getUserId())); //NOI18N
+ }
+
+ // Clear all data
+ this.clear();
+ }
+
+ @Override
+ public void afterAdminUpdatedContactDataEvent (@Observes final AdminUpdatedContactEvent event) {
+ // event should not be null
+ if (null == event) {
+ // Throw NPE
+ throw new NullPointerException("event is null"); //NOI18N
+ } else if (event.getUpdatedContact() == null) {
+ // Throw NPE again
+ throw new NullPointerException("event.updatedContact is null"); //NOI18N
+ } else if (event.getUpdatedContact().getContactId() == null) {
+ // userId is null
+ throw new NullPointerException("event.updatedContact.contactId is null"); //NOI18N
+ } else if (event.getUpdatedContact().getContactId() < 1) {
+ // Not avalid id
+ throw new IllegalArgumentException(MessageFormat.format("contactId of contact={0} is not valid: {1}", event.getUpdatedContact(), event.getUpdatedContact().getContactId())); //NOI18N
+ }
+
+ // Clear all data
+ this.clear();
+ }
+
+ @Override
+ public List<Contact> allCellphoneContacts () {
+ // Get id
+ Long phoneId = this.beanHelper.getCellPhoneNumber().getPhoneId();
+
+ // Is cache there?
+ if (this.contacts.containsKey(phoneId)) {
+ // Return cached version
+ return this.contacts.get(phoneId);
+ } else {
+ // Ask bean
+ List<Contact> list = new LinkedList<>();
+
+ // "Walk" through all contacts
+ for (final Contact contact : this.contactController.allContacts()) {
+ // Is cellphone instance the same?
+ if (Objects.equals(contact.getContactCellphoneNumber(), this.beanHelper.getCellPhoneNumber())) {
+ // Found one
+ list.add(contact);
+ }
+ }
+
+ // Store result in cache
+ this.contacts.put(phoneId, list);
+
+ // Return now-cached list
+ return list;
+ }
+ }
+
+ /**
+ * Clears this bean
+ */
+ private void clear () {
+ // Clear all data
+ }
+
+}
--- /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.contact.phone;
+
+import java.io.Serializable;
+import java.util.List;
+import javax.ejb.Local;
+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.jusercore.events.user.add.AdminAddedUserEvent;
+
+/**
+ * An interface for user beans
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+@Local
+public interface JobsContactPhoneWebRequestController extends Serializable {
+
+ /**
+ * Getter for all contacts having current cellphone instance linked
+ * <p>
+ * @return List of all linked contacts
+ */
+ List<Contact> allCellphoneContacts ();
+
+ /**
+ * Event observer for newly added users by adminstrator
+ * <p>
+ * @param event Event being fired
+ */
+ void afterAdminAddedUserEvent (final AdminAddedUserEvent event);
+
+ /**
+ * 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 updated contact data by administrators
+ * <p>
+ * @param event Updated contact data event
+ */
+ void afterAdminUpdatedContactDataEvent (final AdminUpdatedContactEvent event);
+
+}
+++ /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.contact.phone;
-
-import java.text.MessageFormat;
-import java.util.HashMap;
-import java.util.LinkedList;
-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 javax.inject.Inject;
-import javax.inject.Named;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-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.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;
-
-/**
- * A general contact phone bean (controller)
- * <p>
- * @author Roland Haeder<roland@mxchange.org>
- */
-@Named ("contactPhoneController")
-@SessionScoped
-public class JobsContactPhoneWebSessionBean extends BaseJobsController implements JobsContactPhoneWebSessionController {
-
- /**
- * Serial number
- */
- private static final long serialVersionUID = 542_145_347_916L;
-
- /**
- * Administrative phone controller
- */
- @Inject
- private JobsAdminPhoneWebRequestController adminPhoneController;
-
- /**
- * Admin helper instance
- */
- @Inject
- private JobsWebRequestController beanHelper;
-
- /**
- * General contact controller
- */
- @Inject
- private JobsContactWebSessionController contactController;
-
- /**
- * "Cache" for contact lists, mostly only one is assigned. So this cache
- * shouldn't grow beyond control.
- */
- private final Map<Long, List<Contact>> contacts;
-
- /**
- * Remote EJB for phone number (administrative)
- */
- private PhoneSessionBeanRemote phoneBean;
-
- /**
- * Default constructor
- */
- public JobsContactPhoneWebSessionBean () {
- // Try it
- try {
- // Get initial context
- Context context = new InitialContext();
-
- // Try to lookup the beans
- this.phoneBean = (PhoneSessionBeanRemote) context.lookup("java:global/jlandingpage-ejb/phone!org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote"); //NOI18N
- } catch (final NamingException e) {
- // Throw again
- throw new FaceletException(e);
- }
-
- // Init lists/maps
- this.contacts = new HashMap<>(10);
- }
-
- @Override
- public void afterAdminAddedContact (@Observes final AdminAddedContactEvent event) {
- // The event must be valid
- if (null == event) {
- // Throw NPE
- throw new NullPointerException("event is null"); //NOI18N
- } else if (event.getAddedContact() == null) {
- // Throw again ...
- throw new NullPointerException("event.addedContact is null"); //NOI18N
- } else if (event.getAddedContact().getContactId() == null) {
- // ... and again
- throw new NullPointerException("event.addedContact.contactId is null"); //NOI18N
- } else if (event.getAddedContact().getContactId() < 1) {
- // Not valid
- throw new IllegalArgumentException(MessageFormat.format("event.addedContact.contactId={0} is not valid", event.getAddedContact().getContactId())); //NOI18N //NOI18N
- }
-
- // Clear this bean
- this.clear();
- }
-
- @Override
- public void afterAdminAddedUserEvent (@Observes final AdminAddedUserEvent event) {
- // event should not be null
- if (null == event) {
- // Throw NPE
- throw new NullPointerException("event is null"); //NOI18N
- } else if (event.getAddedUser() == null) {
- // Throw NPE again
- throw new NullPointerException("event.addedUser is null"); //NOI18N
- } else if (event.getAddedUser().getUserId() == null) {
- // userId is null
- throw new NullPointerException("event.addedUser.userId is null"); //NOI18N
- } else if (event.getAddedUser().getUserId() < 1) {
- // Not avalid id
- throw new IllegalArgumentException(MessageFormat.format("userId of user={0} is not valid: {1}", event.getAddedUser(), event.getAddedUser().getUserId())); //NOI18N
- }
-
- // Clear all data
- this.clear();
- }
-
- @Override
- public void afterAdminUpdatedContactDataEvent (@Observes final AdminUpdatedContactEvent event) {
- // event should not be null
- if (null == event) {
- // Throw NPE
- throw new NullPointerException("event is null"); //NOI18N
- } else if (event.getUpdatedContact() == null) {
- // Throw NPE again
- throw new NullPointerException("event.updatedContact is null"); //NOI18N
- } else if (event.getUpdatedContact().getContactId() == null) {
- // userId is null
- throw new NullPointerException("event.updatedContact.contactId is null"); //NOI18N
- } else if (event.getUpdatedContact().getContactId() < 1) {
- // Not avalid id
- throw new IllegalArgumentException(MessageFormat.format("contactId of contact={0} is not valid: {1}", event.getUpdatedContact(), event.getUpdatedContact().getContactId())); //NOI18N
- }
-
- // Clear all data
- this.clear();
- }
-
- @Override
- public List<Contact> allCellphoneContacts () {
- // Get id
- Long phoneId = this.beanHelper.getCellPhoneNumber().getPhoneId();
-
- // Is cache there?
- if (this.contacts.containsKey(phoneId)) {
- // Return cached version
- return this.contacts.get(phoneId);
- } else {
- // Ask bean
- List<Contact> list = new LinkedList<>();
-
- // "Walk" through all contacts
- for (final Contact contact : this.contactController.allContacts()) {
- // Is cellphone instance the same?
- if (Objects.equals(contact.getContactCellphoneNumber(), this.beanHelper.getCellPhoneNumber())) {
- // Found one
- list.add(contact);
- }
- }
-
- // Store result in cache
- this.contacts.put(phoneId, list);
-
- // Return now-cached list
- return list;
- }
- }
-
- /**
- * Post-initialization of this class
- */
- @PostConstruct
- public void init () {
- }
-
- /**
- * Clears this bean
- */
- private void clear () {
- // Clear all data
- }
-
-}
+++ /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.contact.phone;
-
-import java.io.Serializable;
-import java.util.List;
-import javax.ejb.Local;
-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.jusercore.events.user.add.AdminAddedUserEvent;
-
-/**
- * An interface for user beans
- * <p>
- * @author Roland Haeder<roland@mxchange.org>
- */
-@Local
-public interface JobsContactPhoneWebSessionController extends Serializable {
-
- /**
- * Minimum password length
- */
- public static final Integer MINIMUM_PASSWORD_LENGTH = 5;
-
- /**
- * Getter for all contacts having current cellphone instance linked
- * <p>
- * @return List of all linked contacts
- */
- List<Contact> allCellphoneContacts ();
-
- /**
- * Event observer for newly added users by adminstrator
- * <p>
- * @param event Event being fired
- */
- void afterAdminAddedUserEvent (final AdminAddedUserEvent event);
-
- /**
- * 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 updated contact data by administrators
- * <p>
- * @param event Updated contact data event
- */
- void afterAdminUpdatedContactDataEvent (final AdminUpdatedContactEvent event);
-
-}
private JobsFeaturesWebApplicationController featureController;
/**
- * Login bean (controller)
+ * Login controller (bean)
*/
@Inject
private JobsUserLoginWebSessionController userLoginController;
import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider;
/**
- * Administrative bean (controller) for mobile provider
+ * Administrative controller (bean) for mobile provider
* <p>
* @author Roland Haeder<roland@mxchange.org>
*/
import org.mxchange.jphone.phonenumbers.phone.AdminPhoneSessionBeanRemote;
/**
- * Administrative bean (controller) for phone numbers
+ * Administrative controller (bean) for phone numbers
* <p>
* @author Roland Haeder<roland@mxchange.org>
*/
// Is all data set
if (this.beanHelper.getCellPhoneNumber() == null) {
// Not set, throw NPE
- throw new NullPointerException("this.cellphoneNumber is null"); //NOI18N
+ throw new NullPointerException("this.beanHelper.cellphoneNumber is null"); //NOI18N
} else if (this.beanHelper.getCellPhoneNumber().getPhoneId() == null) {
// Throw NPE again
- throw new NullPointerException("this.cellphoneNumber.phoneId is null"); //NOI18N
+ throw new NullPointerException("this.beanHelper.cellphoneNumber.phoneId is null"); //NOI18N
} else if (this.beanHelper.getCellPhoneNumber().getPhoneId() < 1) {
// Invalid number
- throw new IllegalArgumentException(MessageFormat.format("this.cellphoneNumber.phoneId={0} is not valid", this.beanHelper.getCellPhoneNumber().getPhoneId())); //NOI18N
+ throw new IllegalArgumentException(MessageFormat.format("this.beanHelper.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
+ throw new NullPointerException("this.beanHelper.cellphoneNumber.cellphoneProvider is null"); //NOI18N
} else if (this.beanHelper.getCellPhoneNumber().getCellphoneProvider().getProviderId() == null) {
// ... throw again
- throw new NullPointerException("this.cellphoneNumber.cellphoneProvider.providerId is null"); //NOI18N
+ throw new NullPointerException("this.beanHelper.cellphoneNumber.cellphoneProvider.providerId is null"); //NOI18N
} 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.beanHelper.getCellPhoneNumber().getCellphoneProvider().getProviderId())); //NOI18N
+ throw new IllegalArgumentException(MessageFormat.format("this.beanHelper.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
+ throw new NullPointerException("this.beanHelper.cellphoneNumber.phoneNumber is null"); //NOI18N
} else if (this.beanHelper.getCellPhoneNumber().getPhoneNumber() < 1) {
// Throw NPE again
- throw new NullPointerException(MessageFormat.format("this.cellphoneNumber.phoneNumber={0} is not valid.", this.beanHelper.getCellPhoneNumber().getPhoneNumber())); //NOI18N
+ throw new NullPointerException(MessageFormat.format("this.beanHelper.cellphoneNumber.phoneNumber={0} is not valid.", this.beanHelper.getCellPhoneNumber().getPhoneNumber())); //NOI18N
}
// Call EJB
// Is all data set
if (this.beanHelper.getCellPhoneNumber() == null) {
// Not set, throw NPE
- throw new NullPointerException("this.cellphoneNumber is null"); //NOI18N
+ throw new NullPointerException("this.beanHelper.cellphoneNumber is null"); //NOI18N
} else if (this.beanHelper.getCellPhoneNumber().getPhoneId() == null) {
// Throw NPE again
- throw new NullPointerException("this.cellphoneNumber.phoneId is null"); //NOI18N
+ throw new NullPointerException("this.beanHelper.cellphoneNumber.phoneId is null"); //NOI18N
} else if (this.beanHelper.getCellPhoneNumber().getPhoneId() < 1) {
// Invalid number
- throw new IllegalArgumentException(MessageFormat.format("this.cellphoneNumber.phoneId={0} is not valid", this.beanHelper.getCellPhoneNumber().getPhoneId())); //NOI18N
+ throw new IllegalArgumentException(MessageFormat.format("this.beanHelper.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
+ throw new NullPointerException("this.beanHelper.cellphoneNumber.cellphoneProvider is null"); //NOI18N
} else if (this.beanHelper.getCellPhoneNumber().getCellphoneProvider().getProviderId() == null) {
// ... throw again
- throw new NullPointerException("this.cellphoneNumber.cellphoneProvider.providerId is null"); //NOI18N
+ throw new NullPointerException("this.beanHelper.cellphoneNumber.cellphoneProvider.providerId is null"); //NOI18N
} 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.beanHelper.getCellPhoneNumber().getCellphoneProvider().getProviderId())); //NOI18N
+ throw new IllegalArgumentException(MessageFormat.format("this.beanHelper.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
+ throw new NullPointerException("this.beanHelper.cellphoneNumber.phoneNumber is null"); //NOI18N
} else if (this.beanHelper.getCellPhoneNumber().getPhoneNumber() < 1) {
// Throw NPE again
- throw new NullPointerException(MessageFormat.format("this.cellphoneNumber.phoneNumber={0} is not valid.", this.beanHelper.getCellPhoneNumber().getPhoneNumber())); //NOI18N
+ throw new NullPointerException(MessageFormat.format("this.beanHelper.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
import org.mxchange.jusercore.model.user.status.UserAccountStatus;
/**
- * A user bean (controller)
+ * A user controller (bean)
* <p>
* @author Roland Haeder<roland@mxchange.org>
*/
import org.mxchange.jusercore.model.user.profilemodes.ProfileMode;
/**
- * A user bean (controller)
+ * A user controller (bean)
* <p>
* @author Roland Haeder<roland@mxchange.org>
*/
private List<User> userList;
/**
- * Login bean (controller)
+ * Login controller (bean)
*/
@Inject
private JobsUserLoginWebSessionController userLoginController;
import org.mxchange.jusercore.model.user.password_history.PasswordHistory;
/**
- * A user password (change) bean (controller)
+ * A user password (change) controller (bean)
* <p>
* @author Roland Haeder<roland@mxchange.org>
*/
private String userCurrentPassword;
/**
- * Login bean (controller)
+ * Login controller (bean)
*/
@Inject
private JobsUserLoginWebSessionController userLoginController;
BUTTON_ADMIN_DELETE_CELLPHONE=Mobilfunknummer l\u00f6schen
ADMIN_DELETE_CELLPHONE_DATA_NOTICE=Wenn Sie die Mobilfunknummer l\u00f6schen, steht diese nicht mehr im System zur Verf\u00fcgung. Bitte \u00fcberlegen Sie genau, ob Sie dies wollen.
ADMIN_DELETE_CELLPHONE_TITLE=Wollen Sie die Mobilfunknummer wirklich l\u00f6schen?
+ADMIN_TABLE_SUMMARY_SHOW_CONTACT_MINI=Die Tabelle enth\u00e4lt die wichtigsten Daten zum Konakt (minimalisierte Ansicht).
+ADMIN_SHOW_FULL_CONTACT_DATA=Gesamte Kontaktdaten anzeigen
+ADMIN_UNLINK_CONTACT_CELLPHONE_TITLE=Wollen Sie wirklich die Mobilfunknummer vom Kontakt abtrennen?
+BUTTON_ADMIN_UNLINK_CONTACT_CELLPHONE=Mobilfunknummer vom Kontakt abtrennen
BUTTON_ADMIN_DELETE_CELLPHONE=Delete cell phone number
ADMIN_DELETE_CELLPHONE_DATA_NOTICE=If you delete the cell phone number, it won't be available anymore for anything. Please consider carefully if you really want this.
ADMIN_DELETE_CELLPHONE_TITLE=Do you really want to delete the cell phone number?
+ADMIN_TABLE_SUMMARY_SHOW_CONTACT_MINI=The table contains the most important data from contact (minimalized view).
+ADMIN_SHOW_FULL_CONTACT_DATA=Show all contact data
+ADMIN_UNLINK_CONTACT_CELLPHONE_TITLE=Do you really want to unlink the shown cell phone number from the contact?
+BUTTON_ADMIN_UNLINK_CONTACT_CELLPHONE=Unlink cell phone number from contact
<to-view-id>/admin/contact/admin_contact_show.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
+ <navigation-rule>
+ <from-view-id>/admin/cellphone/admin_contact_cellphone_unlink.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>admin_show_contact</from-outcome>
+ <to-view-id>/admin/contact/admin_contact_show.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
<navigation-rule>
<from-view-id>/admin/contact/admin_contact_list.xhtml</from-view-id>
<navigation-case>
--- /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:panelGrid id="show_contact" summary="#{msg.ADMIN_TABLE_SUMMARY_SHOW_CONTACT_MINI}" headerClass="table_header_column" styleClass="table_big" columns="3" rendered="#{not empty beanHelper.contact}">
+ <f:facet name="header">
+ <h:outputFormat value="#{msg.ADMIN_HEADER_SHOW_CONTACT}">
+ <f:param value="#{beanHelper.contact.contactId}" />
+ </h:outputFormat>
+ </f:facet>
+
+ <h:column>
+ <h:outputLabel for="contactId" styleClass="data_label" value="#{msg.ADMIN_CONTACT_ID}" />
+
+ <h:outputText id="contactId" styleClass="data_field" value="#{beanHelper.contact.contactId}" />
+ </h:column>
+
+ <h:column>
+ <h:outputLabel for="contactGender" styleClass="data_label" value="#{msg.ADMIN_CONTACT_GENDER}" />
+
+ <h:outputText id="contactGender" styleClass="data_field" value="#{msg[beanHelper.contact.contactGender.messageKey]}" />
+ </h:column>
+
+ <h:column>
+ <h:outputLabel for="contactTitle" styleClass="data_label" value="#{msg.ADMIN_CONTACT_TITLE}" />
+
+ <h:outputText id="contactTitle" styleClass="data_field" value="#{beanHelper.contact.contactTitle}" />
+ </h:column>
+
+ <h:column>
+ <h:outputLabel for="contactFirstName" styleClass="data_label" value="#{msg.ADMIN_CONTACT_FIRST_NAME}" />
+
+ <h:outputText id="contactFirstName" styleClass="data_field" value="#{beanHelper.contact.contactFirstName}" />
+ </h:column>
+
+ <h:column>
+ <h:outputLabel for="contactFamilyName" styleClass="data_label" value="#{msg.ADMIN_CONTACT_FAMILY_NAME}" />
+
+ <h:outputText id="contactFamilyName" styleClass="data_field" value="#{beanHelper.contact.contactFamilyName}" />
+ </h:column>
+
+ <h:column>
+ <h:outputLabel for="contactEmailAddress" styleClass="data_label" value="#{msg.ADMIN_CONTACT_EMAIL_ADDRESS}" />
+
+ <h:outputLink id="contactEmailAddress" styleClass="data_field" value="mailto:#{beanHelper.contact.contactEmailAddress}">
+ <h:outputText value="#{beanHelper.contact.contactEmailAddress}" />
+ </h:outputLink>
+ </h:column>
+ </h:panelGrid>
+</ui:composition>
</ui:define>
<ui:define name="content">
- Here goes your content.
+ <h:form id="form_unlink_contact_cellphone" rendered="#{not empty beanHelper.cellPhoneNumber and not empty beanHelper.contact}">
+ <div class="table">
+ <div class="table_header">
+ <h:outputText value="#{msg.ADMIN_UNLINK_CONTACT_CELLPHONE_TITLE}" />
+ </div>
+
+ <div class="para">
+ <ui:include src="/WEB-INF/templates/admin/contact/admin_contact_data_mini.tpl" />
+ </div>
+
+ <div class="para">
+ <h:link outcome="admin_show_contact">
+ <h:outputText value="#{msg.ADMIN_SHOW_FULL_CONTACT_DATA}" />
+ <f:param name="contactId" value="#{beanHelper.contact.contactId}" />
+ </h:link>
+ </div>
+
+ <div class="para">
+ <ui:include src="/WEB-INF/templates/admin/cellphone/admin_cellphone_data.tpl">
+ <ui:param name="isShowPage" value="#{false}" />
+ <ui:param name="showAdminLinks" value="#{false}" />
+ </ui:include>
+ </div>
+
+ <div class="table_footer">
+ <h:commandButton styleClass="unlink_button" type="submit" id="unlink_cellphone" value="#{msg.BUTTON_ADMIN_UNLINK_CONTACT_CELLPHONE}" action="#{adminContactPhoneController.unlinkCellphoneContactData()}" />
+ </div>
+ </div>
+ </h:form>
+
+ <h:outputText styleClass="errors" value="#{msg.ERROR_ADMIN_BEAN_CELLPHONE_NUMBER_NOT_SET}" rendered="#{empty beanHelper.cellPhoneNumber}" />
+
+ <h:outputText styleClass="errors" value="#{msg.ERROR_BEAN_HELPER_CONTACT_NOT_SET}" rendered="#{empty beanHelper.contact}" />
</ui:define>
</ui:composition>
</html>
}
.delete_button {
- border: #ff0000 1px groove;
+ border: #ee0000 1px groove;
background-color: #880000;
color: #ffffff;
}
+
+.unlink_button {
+ border: #eeee00 1px groove;
+ background-color: #aaaa00;
+ color: #ffffff;
+}