import java.text.MessageFormat;
import java.util.Date;
+import java.util.List;
import javax.annotation.PostConstruct;
import javax.enterprise.context.RequestScoped;
import javax.enterprise.event.Event;
*/
private final ContactSessionBeanRemote contactBean;
+ /**
+ * General contact controller
+ */
+ @Inject
+ private RateCalcContactWebSessionController contactController;
+
/**
* Contact id
*/
}
}
+ @Override
+ public List<Contact> allContacts () {
+ return this.contactController.allContacts();
+ }
+
@Override
public String changeContactData () {
// Get contact instance
this.zipCode = zipCode;
}
+ @Override
+ public boolean hasContacts () {
+ return (!this.allContacts().isEmpty());
+ }
+
/**
* Post-initialization of this class
*/
import java.io.Serializable;
import java.util.Date;
+import java.util.List;
import org.mxchange.jcontacts.contact.Contact;
import org.mxchange.jcontacts.contact.gender.Gender;
import org.mxchange.jcountry.data.Country;
*/
public interface PizzaAdminContactWebRequestController extends Serializable {
+ /**
+ * Returns a list of all found contacts
+ * <p>
+ * @return A list of all contacts.
+ */
+ List<Contact> allContacts();
+
+ /**
+ * Checks whether there are contacts.
+ * <p>
+ * @return Whether contacts are there
+ */
+ boolean hasContacts ();
+
/**
* Creates an instance from contact data
* <p>
System.out.println("ContactWebBean:afterUserLogin - EXIT!"); //NOI18N
}
+ @Override
+ public List<Contact> allContacts () {
+ return this.contactList;
+ }
+
/**
* Clears this bean
*/
import java.io.Serializable;
import java.util.Date;
+import java.util.List;
import org.mxchange.jcontacts.contact.Contact;
import org.mxchange.jcontacts.contact.gender.Gender;
import org.mxchange.jcontacts.events.contact.update.AdminUpdatedContactEvent;
*/
public static final Integer MINIMUM_PASSWORD_LENGTH = 5;
+ /**
+ * Returns a list of all found contacts
+ * <p>
+ * @return A list of all contacts.
+ */
+ List<Contact> allContacts();
+
/**
* Updates all data from bean in given contact instance
* <p>
<to-view-id>/admin/user/admin_customer_unlock.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
+ <navigation-rule>
+ <from-view-id>/admin/contact/admin_contact_list.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>admin_delete_contact</from-outcome>
+ <to-view-id>/admin/contact/admin_contact_delete.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>admin_edit_contact</from-outcome>
+ <to-view-id>/admin/contact/admin_contact_edit.xhtml</to-view-id>
+ </navigation-case>
+ <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>
<!--
<factory>
<exception-handler-factory>
-_<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html
lang="#{localizationController.language}" xml:lang="#{localizationController.language}"
</ui:define>
<ui:define name="content">
- Here goes your content.
+ <h:dataTable id="table_list_contacts" var="contact" value="#{adminContactController.allContacts()}" styleClass="table_big" headerClass="table_header_column" summary="#{msg.TABLE_SUMMARY_ADMIN_LIST_CONTACT}" rendered="#{adminContactController.hasContacts()}">
+ <h:column>
+ <f:facet name="header">#{msg.ADMIN_LIST_CONTACT_ID}</f:facet>
+
+ <h:link outcome="admin_show_contact" title="#{msg.ADMIN_LINK_SHOW_CONTACT_TITLE}" value="#{contact.contactId}">
+ <f:param name="contactId" value="#{contact.contactId}" />
+ </h:link>
+ </h:column>
+
+ <h:column>
+ <f:facet name="header">#{msg.ADMIN_LIST_CONTACT_GENDER}</f:facet>
+
+ <h:outputText value="#{msg[contact.contactGender.messageKey]}" />
+ </h:column>
+
+ <h:column>
+ <f:facet name="header">#{msg.ADMIN_LIST_CONTACT_FIRST_NAME}</f:facet>
+
+ <h:outputText value="#{contact.contactFirstName}" />
+ </h:column>
+
+ <h:column>
+ <f:facet name="header">#{msg.ADMIN_LIST_CONTACT_FAMILY_NAME}</f:facet>
+
+ <h:outputText value="#{contact.contactFamilyName}" />
+ </h:column>
+
+ <h:column>
+ <f:facet name="header">#{msg.ADMIN_LIST_CONTACT_CREATED}</f:facet>
+
+ <h:outputText id="contactCreated" value="#{contact.contactCreated.time}">
+ <f:convertDateTime for="contactCreated" type="both" timeStyle="short" dateStyle="short" />
+ </h:outputText>
+ </h:column>
+ </h:dataTable>
+
+ <div class="table_medium">
+ <h:form id="admin_add_contact">
+ <div class="table_header">
+ #{msg.ADMIN_ADD_CONTACT_TITLE}
+ </div>
+
+ <ui:include src="/WEB-INF/templates/admin/contact/admin_form_contact_data.tpl" />
+
+ <div class="table_footer">
+ <h:commandButton class="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
+ <h:commandButton class="submit" type="submit" id="register" value="#{msg.BUTTON_ADMIN_ADD_CONTACT}" action="#{adminContactController.addContact()}" />
+ </div>
+ </h:form>
+ </div>
</ui:define>
</ui:composition>
</html>
<h:column>
<f:facet name="header">#{msg.ADMIN_LIST_CUSTOMER_ID}</f:facet>
- <h:link outcome="admin_show_customer" title="#{msg.ADMIN_LINK_SHOW__CUSTOMER_TITLE}" value="#{customer.customerId}">
+ <h:link outcome="admin_show_customer" title="#{msg.ADMIN_LINK_SHOW_CUSTOMER_TITLE}" value="#{customer.customerId}">
<f:param name="customerId" value="#{customer.customerId}" />
</h:link>
</h:column>