*/
private final ContactSessionBeanRemote contactBean;
+ /**
+ * General contact controller
+ */
+ @Inject
+ private AddressbookContactWebSessionController contactController;
+
/**
* Contact id
*/
return this.contactController.allContacts();
}
- @Override
- public String changeContactData () {
- // Get contact instance
- Contact contact = this.adminHelper.getContact();
-
- // Default is not same contact
- if (this.isSameContactFound(contact)) {
- // Already registered
- throw new FaceletException(new ContactAlreadyAddedException(contact));
- }
-
- // Init contact
- Contact updatedContact;
-
- // Try to call EJB
- try {
- // Call EJB
- updatedContact = this.contactBean.addContact(contact);
- } catch (final ContactAlreadyAddedException ex) {
- // Throw again
- throw new FaceletException(ex);
- }
-
- // Fire event
- this.addedContactEvent.fire(new AdminContactAddedEvent(updatedContact));
-
- // Clear this bean
- this.clear();
-
- // Return outcome
- return "admin_list_contact"; //NOI18N
- }
-
@Override
public void copyContactToController (final Contact contact) {
// The contact instance must be valid
this.zipCode = zipCode;
}
+ @Override
+ public boolean hasContacts () {
+ return (!this.allContacts().isEmpty());
+ }
+
/**
* Post-initialization of this class
*/