]> git.mxchange.org Git - pizzaservice-war.git/commitdiff
Continued with rewrites: (please cherry-pick)
authorRoland Häder <roland@mxchange.org>
Sat, 6 Aug 2016 10:26:59 +0000 (12:26 +0200)
committerRoland Haeder <roland@mxchange.org>
Sat, 6 Aug 2016 20:08:31 +0000 (22:08 +0200)
- the contact phone controller becomes a generic phone controller (see jcontacts-business-core)
- marked contact-related stuff in it as deprecated
- renamed it's JSF name to adminPhoneController
- all phone instances are being set by beanHelper's copyUserToController() method
- private method setPhoneInstances() introduced
- rewrote all parameters that cannot be auto-completed by IDE to beanHelper and phone controller
- added missing i18n string(s)

Signed-off-by: Roland Häder <roland@mxchange.org>
17 files changed:
src/java/org/mxchange/localization/bundle_de_DE.properties
src/java/org/mxchange/localization/bundle_en_US.properties
src/java/org/mxchange/pizzaapplication/beans/helper/PizzaWebRequestHelper.java
src/java/org/mxchange/pizzaapplication/beans/phone/PizzaAdminContactPhoneWebRequestBean.java
src/java/org/mxchange/pizzaapplication/beans/phone/PizzaAdminContactPhoneWebRequestController.java
web/WEB-INF/faces-config.xml
web/WEB-INF/templates/admin/cellphone/admin_cellphone_add_show.tpl
web/WEB-INF/templates/admin/cellphone/admin_cellphone_data.tpl
web/WEB-INF/templates/admin/cellphone/admin_cellphone_links.tpl
web/WEB-INF/templates/admin/cellphone/admin_form_contact_cellphone.tpl
web/WEB-INF/templates/admin/contact/admin_contact_links.tpl
web/admin/cellphone/admin_contact_cellphone_delete.xhtml
web/admin/cellphone/admin_contact_cellphone_edit.xhtml
web/admin/cellphone/admin_contact_cellphone_show.xhtml
web/admin/cellphone/admin_contact_cellphone_unlink.xhtml
web/admin/contact/admin_contact_show.xhtml
web/admin/user/admin_user_show.xhtml

index d752f5895bf4f70ef1739f52c488909a4b53f9b0..d9c36f5f82469e2f7ac052a56939f4a33db1eab8 100644 (file)
@@ -603,3 +603,5 @@ ERROR_CANNOT_UN_LOCK_USER_ACCOUNT_UNCONFIRMED=Unbest\u00e4tigte Benutzeraccounts
 PAGE_TITLE_ADMIN_LOCK_USER=Benutzeraccount sperren
 CONTENT_TITLE_ADMIN_LOCK_USER=Benutzeraccount sperren:
 ERROR_BEAN_HELPER_USER_NOT_SET=Fehler: Instanz 'user' im Bean-Helper nicht gesetzt.
+ERROR_BEAN_HELPER_CONTACT_NOT_SET=Fehler: Instanz 'contact' im Bean-Helper nicht gesetzt.
+ERROR_ADMIN_BEAN_CELLPHONE_NUMBER_NOT_SET=Fehler: Instanz 'cellPhone' in administrativer Bean nicht gesetzt.
index 2bbc5d37091a7f9d2d5a36f27a1a6f6b903bb334..a4ba31988a7b073d9cc989dba665f4ff09d16db6 100644 (file)
@@ -586,3 +586,5 @@ ERROR_CANNOT_UN_LOCK_USER_ACCOUNT_UNCONFIRMED=Unconfirmed user accounts cannot b
 PAGE_TITLE_ADMIN_LOCK_USER=Lock user account
 CONTENT_TITLE_ADMIN_LOCK_USER=Lock user account:
 ERROR_BEAN_HELPER_USER_NOT_SET=Error: Instance 'user' not set in bean helper.
+ERROR_BEAN_HELPER_CONTACT_NOT_SET=Error: Instance 'contact' not set in bean helper.
+ERROR_ADMIN_BEAN_CELLPHONE_NUMBER_NOT_SET=Error: Instance 'cellPhone' in administrative bean not set.
index 9873bbaca3e7bc3b9c9d28dff44dd912a6ec2e84..11090b116eae72dc8faf10ceba7b1f6a88e74acd 100644 (file)
@@ -22,10 +22,14 @@ import javax.inject.Inject;
 import javax.inject.Named;
 import org.mxchange.jcontacts.contact.Contact;
 import org.mxchange.jcustomercore.model.customer.Customer;
+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.pizzaapplication.beans.contact.PizzaAdminContactWebRequestController;
 import org.mxchange.pizzaapplication.beans.customer.PizzaAdminCustomerWebRequestController;
 import org.mxchange.pizzaapplication.beans.customer.PizzaCustomerWebSessionController;
+import org.mxchange.pizzaapplication.beans.phone.PizzaAdminContactPhoneWebRequestController;
 import org.mxchange.pizzaapplication.beans.user.PizzaUserWebSessionController;
 
 /**
@@ -43,7 +47,7 @@ public class PizzaWebRequestHelper implements PizzaWebRequestController {
        private static final long serialVersionUID = 17_258_793_567_145_701L;
 
        /**
-        * Regular contact controller
+        * Administrative contact controller
         */
        @Inject
        private PizzaAdminContactWebRequestController adminContactController;
@@ -54,6 +58,12 @@ public class PizzaWebRequestHelper implements PizzaWebRequestController {
        @Inject
        private PizzaAdminCustomerWebRequestController adminCustomerController;
 
+       /**
+        * Administrative phone controller
+        */
+       @Inject
+       private PizzaAdminContactPhoneWebRequestController adminPhoneController;
+
        /**
         * Contact instance
         */
@@ -104,6 +114,9 @@ public class PizzaWebRequestHelper implements PizzaWebRequestController {
                        throw new IllegalStateException(MessageFormat.format("this.contact.contactId={0} is not valid.", this.getContact().getContactId())); //NOI18N
                }
 
+               // Set all phone instances
+               this.setPhoneInstances(this.getContact());
+
                // Set all fields: user
                this.adminContactController.copyContactToController(this.getContact());
 
@@ -152,6 +165,15 @@ public class PizzaWebRequestHelper implements PizzaWebRequestController {
                        throw new IllegalStateException(MessageFormat.format("this.user.userId={0} is not valid.", this.getUser().getUserId())); //NOI18N
                }
 
+               // Get contact
+               Contact userContact = this.getUser().getUserContact();
+
+               // Set contact here, too. This avoids parameters that cannot auto-complete in IDEs.
+               this.setContact(userContact);
+
+               // Set all phone instances
+               this.setPhoneInstances(userContact);
+
                // Set all fields: user
                this.userController.setUserName(this.getUser().getUserName());
 
@@ -226,4 +248,41 @@ public class PizzaWebRequestHelper implements PizzaWebRequestController {
                this.user = user;
        }
 
+       /**
+        * Set's all given contact's phone instances: land-line, cellphone and fax
+        * <p>
+        * @param contact Contact to set phone instances for
+        */
+       private void setPhoneInstances (final Contact contact) {
+               // The contact must be valid
+               if (null == contact) {
+                       // Throw NPE
+                       throw new NullPointerException("contact is null"); //NOI18N
+               } else if (contact.getContactId() == null) {
+                       // Throw again ...
+                       throw new NullPointerException("contact.contactId is null"); //NOI18N
+               } else if (contact.getContactId() < 1) {
+                       // Not valid
+                       throw new IllegalArgumentException(MessageFormat.format("contact.contactId={0} is not valid", contact.getContactId())); //NOI18N
+               }
+
+               // Is cellphone set?
+               if (contact.getContactCellphoneNumber() instanceof DialableCellphoneNumber) {
+                       // Yes, then set it in admin controller
+                       this.adminPhoneController.setCellPhone(contact.getContactCellphoneNumber());
+               }
+
+               // Is land-line set?
+               if (contact.getContactLandLineNumber() instanceof DialableLandLineNumber) {
+                       // Yes, then set it in admin controller
+                       this.adminPhoneController.setLandLine(contact.getContactLandLineNumber());
+               }
+
+               // Is fax set?
+               if (contact.getContactFaxNumber() instanceof DialableFaxNumber) {
+                       // Yes, then set it in admin controller
+                       this.adminPhoneController.setFax(contact.getContactFaxNumber());
+               }
+       }
+
 }
index 4853e1fc29bc7fc033b8648ff37a074a65f4a1ae..ef934fcd48d3726a4c1c13f5d3e406305657ebc5 100644 (file)
@@ -33,11 +33,11 @@ import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
 import org.mxchange.pizzaapplication.beans.BasePizzaController;
 
 /**
- * Administrative bean (controller) for contact's phone numbers
+ * Administrative bean (controller) for phone numbers
  * <p>
  * @author Roland Haeder<roland@mxchange.org>
  */
-@Named ("adminContactPhoneController")
+@Named ("adminPhoneController")
 @RequestScoped
 public class PizzaAdminContactPhoneWebRequestBean extends BasePizzaController implements PizzaAdminContactPhoneWebRequestController {
 
@@ -58,13 +58,19 @@ public class PizzaAdminContactPhoneWebRequestBean extends BasePizzaController im
 
        /**
         * Instance of linked contact account
+        * <p>
+        * @deprecated This is a generic phone controller, not just for contact data
         */
+       @Deprecated
        private Contact contact;
 
        /**
         * "Cache" for contact lists, mostly only one is assigned. So this cache
         * shouldn't grow beyond control.
+        * <p>
+        * @deprecated This is a generic phone controller, not just for contact data
         */
+       @Deprecated
        private final Map<Long, List<Contact>> contacts;
 
        /**
@@ -98,6 +104,7 @@ public class PizzaAdminContactPhoneWebRequestBean extends BasePizzaController im
        }
 
        @Override
+       @Deprecated
        public List<Contact> allCellphoneContacts () {
                // Get id
                Long phoneId = this.getCellPhone().getPhoneId();
@@ -129,11 +136,13 @@ public class PizzaAdminContactPhoneWebRequestBean extends BasePizzaController im
        }
 
        @Override
+       @Deprecated
        public Contact getContact () {
                return this.contact;
        }
 
        @Override
+       @Deprecated
        public void setContact (final Contact contact) {
                this.contact = contact;
        }
index 400e97d38372ee280c59419882d4427dc9414473..e3266f6c8ff47e3397a466db1ad84039faa4a261 100644 (file)
@@ -36,6 +36,7 @@ public interface PizzaAdminContactPhoneWebRequestController extends Serializable
         * <p>
         * @return List of all linked contacts
         */
+       @Deprecated
        List<Contact> allCellphoneContacts ();
 
        /**
@@ -85,6 +86,7 @@ public interface PizzaAdminContactPhoneWebRequestController extends Serializable
         * <p>
         * @return Linked contact account
         */
+       @Deprecated
        Contact getContact ();
 
        /**
@@ -92,6 +94,7 @@ public interface PizzaAdminContactPhoneWebRequestController extends Serializable
         * <p>
         * @param contact Linked contact account
         */
+       @Deprecated
        void setContact (final Contact contact);
 
 }
index 2bfc1191585a7b8fd2ca58ff029e1624899d465b..118b40787797caf16f273ea0d1b70f55087e5db7 100644 (file)
                        <to-view-id>/admin/mobile_provider/admin_mobile_provider_show.xhtml</to-view-id>
                </navigation-case>
                <navigation-case>
-                       <from-outcome>admin_show_contact_cellphone</from-outcome>
+                       <from-outcome>admin_show_cellphone</from-outcome>
                        <to-view-id>/admin/cellphone/admin_contact_cellphone_show.xhtml</to-view-id>
                </navigation-case>
                <navigation-case>
-                       <from-outcome>admin_edit_contact_cellphone</from-outcome>
+                       <from-outcome>admin_edit_cellphone</from-outcome>
                        <to-view-id>/admin/cellphone/admin_contact_cellphone_edit.xhtml</to-view-id>
                </navigation-case>
                <navigation-case>
                        <to-view-id>/admin/cellphone/admin_contact_cellphone_unlink.xhtml</to-view-id>
                </navigation-case>
                <navigation-case>
-                       <from-outcome>admin_delete_contact_cellphone</from-outcome>
+                       <from-outcome>admin_delete_cellphone</from-outcome>
                        <to-view-id>/admin/cellphone/admin_contact_cellphone_delete.xhtml</to-view-id>
                </navigation-case>
                <navigation-case>
                        <to-view-id>/admin/mobile_provider/admin_mobile_provider_show.xhtml</to-view-id>
                </navigation-case>
                <navigation-case>
-                       <from-outcome>admin_edit_contact_cellphone</from-outcome>
+                       <from-outcome>admin_edit_cellphone</from-outcome>
                        <to-view-id>/admin/cellphone/admin_contact_cellphone_edit.xhtml</to-view-id>
                </navigation-case>
                <navigation-case>
-                       <from-outcome>admin_delete_contact_cellphone</from-outcome>
+                       <from-outcome>admin_delete_cellphone</from-outcome>
                        <to-view-id>/admin/cellphone/admin_contact_cellphone_delete.xhtml</to-view-id>
                </navigation-case>
                <navigation-case>
                        <to-view-id>/admin/cellphone/admin_contact_cellphone_unlink.xhtml</to-view-id>
                </navigation-case>
                <navigation-case>
-                       <from-outcome>admin_show_contact_cellphone</from-outcome>
+                       <from-outcome>admin_show_cellphone</from-outcome>
                        <to-view-id>/admin/cellphone/admin_contact_cellphone_show.xhtml</to-view-id>
                </navigation-case>
        </navigation-rule>
        <navigation-rule>
                <from-view-id>/admin/cellphone/admin_contact_cellphone_list.xhtml</from-view-id>
                <navigation-case>
-                       <from-outcome>admin_show_contact_cellphone</from-outcome>
+                       <from-outcome>admin_show_cellphone</from-outcome>
                        <to-view-id>/admin/cellphone/admin_contact_cellphone_show.xhtml</to-view-id>
                </navigation-case>
                <navigation-case>
-                       <from-outcome>admin_edit_contact_cellphone</from-outcome>
+                       <from-outcome>admin_edit_cellphone</from-outcome>
                        <to-view-id>/admin/cellphone/admin_contact_cellphone_edit.xhtml</to-view-id>
                </navigation-case>
                <navigation-case>
-                       <from-outcome>admin_delete_contact_cellphone</from-outcome>
+                       <from-outcome>admin_delete_cellphone</from-outcome>
                        <to-view-id>/admin/cellphone/admin_contact_cellphone_delete.xhtml</to-view-id>
                </navigation-case>
        </navigation-rule>
                        <to-view-id>/admin/mobile_provider/admin_mobile_provider_show.xhtml</to-view-id>
                </navigation-case>
                <navigation-case>
-                       <from-outcome>admin_edit_contact_cellphone</from-outcome>
+                       <from-outcome>admin_edit_cellphone</from-outcome>
                        <to-view-id>/admin/cellphone/admin_contact_cellphone_edit.xhtml</to-view-id>
                </navigation-case>
                <navigation-case>
-                       <from-outcome>admin_delete_contact_cellphone</from-outcome>
+                       <from-outcome>admin_delete_cellphone</from-outcome>
                        <to-view-id>/admin/cellphone/admin_contact_cellphone_delete.xhtml</to-view-id>
                </navigation-case>
                <navigation-case>
index 1f27e7dbeaac6dcd8e8cc248388afe37d1c609f1..4f1273405fa0623e8f9a274ab34f6a3ae142b931 100644 (file)
@@ -5,20 +5,13 @@
        xmlns:h="http://xmlns.jcp.org/jsf/html"
        xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
 
-       <ui:fragment rendered="#{empty cellphoneNumber and empty contact}">
-               <h:outputText styleClass="errors" value="#{msg.ERROR_PARAMETER_CELLPHONE_NUMBER_CONTACT_NOT_SET}" />
-       </ui:fragment>
+       <h:outputText styleClass="errors" value="#{msg.ERROR_BEAN_HELPER_CONTACT_NOT_SET}" rendered="#{empty beanHelper.contact}" />
 
-       <ui:fragment rendered="#{empty cellphoneNumber and not empty contact}">
-               <ui:include src="/WEB-INF/templates/admin/cellphone/admin_form_contact_cellphone.tpl">
-                       <ui:param name="contact" value="#{contact}" />
-               </ui:include>
+       <ui:fragment rendered="#{empty beanHelper.contact.contactCellphoneNumber and not empty beanHelper.contact}">
+               <ui:include src="/WEB-INF/templates/admin/cellphone/admin_form_contact_cellphone.tpl" />
        </ui:fragment>
 
-       <ui:fragment rendered="#{not empty cellphoneNumber and not empty contact}">
-               <ui:include src="/WEB-INF/templates/admin/cellphone/admin_cellphone_data.tpl">
-                       <ui:param name="cellphoneNumber" value="#{cellphoneNumber}" />
-                       <ui:param name="contact" value="#{contact}" />
-               </ui:include>
+       <ui:fragment rendered="#{not empty beanHelper.contact.contactCellphoneNumber and not empty beanHelper.contact}">
+               <ui:include src="/WEB-INF/templates/admin/cellphone/admin_cellphone_data.tpl" />
        </ui:fragment>
 </ui:composition>
index db480479e7e4026e041663b3ccac65ad46c9e117..a7a3b9251ba58d3e552f8bb5e858051cdc165343 100644 (file)
@@ -5,9 +5,9 @@
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
 
-       <h:outputText styleClass="errors" value="#{msg.ERROR_PARAMETER_CELLPHONE_NUMBER_NOT_SET}" rendered="#{empty cellphoneNumber}" />
+       <h:outputText styleClass="errors" value="#{msg.ERROR_ADMIN_BEAN_CELLPHONE_NUMBER_NOT_SET}" rendered="#{empty adminPhoneController.cellPhone}" />
 
-       <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 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.cellPhone}">
                <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="#{cellphoneNumber.phoneId}" />
+                       <h:outputText id="cellphoneId" styleClass="data_field" value="#{adminPhoneController.cellPhone.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="#{cellphoneNumber.cellphoneProvider.providerId}" />
-                               <h:outputText id="cellphoneProvider" styleClass="data_field" value="#{cellphoneNumber.cellphoneProvider.providerName}" />
+                               <f:param name="providerId" value="#{adminPhoneController.cellPhone.cellphoneProvider.providerId}" />
+                               <h:outputText id="cellphoneProvider" styleClass="data_field" value="#{adminPhoneController.cellPhone.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="#{cellphoneNumber.cellphoneProvider.providerCountry.countryExternalDialPrefix}#{cellphoneNumber.cellphoneProvider.providerDialPrefix}-#{cellphoneNumber.phoneNumber}" />
+                       <h:outputText id="cellphoneNumber" styleClass="data_field" value="#{adminPhoneController.cellPhone.cellphoneProvider.providerCountry.countryExternalDialPrefix}#{adminPhoneController.cellPhone.cellphoneProvider.providerDialPrefix}-#{adminPhoneController.cellPhone.phoneNumber}" />
                </h:column>
 
                <h:column>
                        <h:outputLabel styleClass="data_label" value="#{msg.ADMIN_SHOW_CELLPHONE_LINKS}" />
 
                        <div class="data_field">
-                               <ui:fragment rendered="#{not empty contact}">
-                                       <ui:include src="/WEB-INF/templates/admin/cellphone/admin_cellphone_links.tpl">
-                                               <ui:param name="cellphoneNumber" value="#{cellphoneNumber}" />
-                                               <ui:param name="contact" value="#{contact}" />
-                                               <ui:param name="isShowPage" value="#{isShowPage}" />
-                                       </ui:include>
-                               </ui:fragment>
-
-                               <ui:fragment rendered="#{empty contact}">
-                                       <ui:include src="/WEB-INF/templates/admin/cellphone/admin_cellphone_links.tpl">
-                                               <ui:param name="cellphoneNumber" value="#{cellphoneNumber}" />
-                                               <ui:param name="isShowPage" value="#{isShowPage}" />
-                                       </ui:include>
-                               </ui:fragment>
+                               <ui:include src="/WEB-INF/templates/admin/cellphone/admin_cellphone_links.tpl">
+                                       <ui:param name="isShowPage" value="#{isShowPage}" />
+                               </ui:include>
                        </div>
                </h:column>
        </h:panelGrid>
index 100bed17ee87066eaa037c61481362b45635228e..60540ceacca397423c400bdae0c96c4edea2f237 100644 (file)
@@ -5,40 +5,40 @@
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
 
-       <h:outputText styleClass="errors" value="#{msg.ERROR_PARAMETER_CELLPHONE_NUMBER_NOT_SET}" rendered="#{empty cellphoneNumber}" />
+       <h:outputText styleClass="errors" value="#{msg.ERROR_ADMIN_BEAN_CELLPHONE_NUMBER_NOT_SET}" rendered="#{empty adminPhoneController.cellPhone}" />
 
-       <ui:fragment rendered="#{not empty cellphoneNumber}">
+       <ui:fragment rendered="#{not empty adminPhoneController.cellPhone}">
                <ul class="mini_nav">
                        <ui:fragment rendered="#{empty isShowPage or not isShowPage}">
                                <li class="mini_link">
-                                       <h:link outcome="admin_show_contact_cellphone">
+                                       <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="#{cellphoneNumber.phoneId}" />
+                                               <f:param name="phoneId" value="#{adminPhoneController.cellPhone.phoneId}" />
                                        </h:link>
                                </li>
                        </ui:fragment>
 
                        <li class="mini_link">
-                               <h:link outcome="admin_edit_contact_cellphone">
+                               <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="#{cellphoneNumber.phoneId}" />
+                                       <f:param name="phoneId" value="#{adminPhoneController.cellPhone.phoneId}" />
                                </h:link>
                        </li>
 
-                       <ui:fragment rendered="#{not empty contact}">
+                       <ui:fragment rendered="#{not empty beanHelper.contact}">
                                <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="#{cellphoneNumber.phoneId}" />
-                                               <f:param name="contactId" value="#{contact.contactId}" />
+                                               <f:param name="phoneId" value="#{adminPhoneController.cellPhone.phoneId}" />
+                                               <f:param name="contactId" value="#{beanHelper.contact.contactId}" />
                                        </h:link>
                                </li>
                        </ui:fragment>
 
                        <li class="mini_link">
-                               <h:link outcome="admin_delete_contact_cellphone">
+                               <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="#{cellphoneNumber.phoneId}" />
+                                       <f:param name="phoneId" value="#{adminPhoneController.cellPhone.phoneId}" />
                                </h:link>
                        </li>
                </ul>
index 914e968340c751a6946744ac211cf3511e5d6d2f..06e96e2172392997dba54c94fc26286174816429 100644 (file)
@@ -5,6 +5,8 @@
        xmlns:h="http://xmlns.jcp.org/jsf/html"
        xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
 
+       <h:outputText styleClass="errors" value="#{msg.ERROR_BEAN_HELPER_CONTACT_NOT_SET}" rendered="#{empty beanHelper.contact}" />
+
        <h:form id="form_add_contact_cellphone">
        </h:form>
 </ui:composition>
index 26f287c14ba2ddbe8bca8d3ac5ef08394163e6c6..175474e2342095fb2c11a095a845ce8a53c09ac8 100644 (file)
@@ -5,9 +5,9 @@
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
 
-       <h:outputText styleClass="errors" value="#{msg.ERROR_PARAMETER_CONTACT_NOT_SET}" rendered="#{empty contact}" />
+       <h:outputText styleClass="errors" value="#{msg.ERROR_BEAN_HELPER_CONTACT_NOT_SET}" rendered="#{empty beanHelper.contact}" />
 
-       <ui:fragment rendered="#{not empty contact}">
+       <ui:fragment rendered="#{not empty beanHelper.contact}">
                <div class="table">
                        <div class="table_header">
                                <h:outputText value="#{msg.ADMIN_LINKS_HEADER}" />
                                <ul>
                                        <li>
                                                <h:link outcome="admin_edit_contact" value="#{msg.ADMIN_LINK_EDIT_CONTACT}" title="#{msg.ADMIN_LINK_EDIT_CONTACT_TITLE}">
-                                                       <f:param name="contactId" value="#{contact.contactId}" />
+                                                       <f:param name="contactId" value="#{beanHelper.contact.contactId}" />
                                                </h:link>
                                        </li>
 
                                        <li>
                                                <h:link outcome="admin_delete_contact" title="#{msg.ADMIN_LINK_DELETE_CONTACT_TITLE}">
                                                        <h:outputText styleClass="delete_link" value="#{msg.ADMIN_LINK_DELETE_CONTACT}" />
-                                                       <f:param name="contactId" value="#{contact.contactId}" />
+                                                       <f:param name="contactId" value="#{beanHelper.contact.contactId}" />
                                                </h:link>
                                        </li>
                                </ul>
index 605ec9fe1b54e34fe23ea72c69d545af3774b2e2..2261c4e09bd45f85f579412abc20e986096c20f5 100644 (file)
@@ -8,7 +8,7 @@
        >
 
        <f:metadata>
-               <f:viewParam name="phoneId" value="#{adminContactPhoneController.cellPhone}" converter="CellphoneConverter" required="true" requiredMessage="#{msg.ERROR_PARAMETER_PHONE_ID_NOT_SET}" />
+               <f:viewParam name="phoneId" value="#{adminPhoneController.cellPhone}" converter="CellphoneConverter" required="true" requiredMessage="#{msg.ERROR_PARAMETER_PHONE_ID_NOT_SET}" />
        </f:metadata>
 
        <ui:composition template="/WEB-INF/templates/admin/admin_base.tpl">
index eb3d93cd37c25af7e2c1b8bcd5d1965ac0711369..95939c289addd43cb08e2620524d20ae9f0741a4 100644 (file)
@@ -8,7 +8,7 @@
        >
 
        <f:metadata>
-               <f:viewParam name="phoneId" value="#{adminContactPhoneController.cellPhone}" converter="CellphoneConverter" required="true" requiredMessage="#{msg.ERROR_PARAMETER_PHONE_ID_NOT_SET}" />
+               <f:viewParam name="phoneId" value="#{adminPhoneController.cellPhone}" converter="CellphoneConverter" required="true" requiredMessage="#{msg.ERROR_PARAMETER_PHONE_ID_NOT_SET}" />
        </f:metadata>
 
        <ui:composition template="/WEB-INF/templates/admin/admin_base.tpl">
index 7d0e1af44e5f42deacef0dc336300710e0d6d5d9..0c43374363f28632f11cc7d9b0b2e68619e54272 100644 (file)
@@ -8,7 +8,7 @@
        >
 
        <f:metadata>
-               <f:viewParam name="phoneId" value="#{adminContactPhoneController.cellPhone}" converter="CellphoneConverter" required="true" requiredMessage="#{msg.ERROR_PARAMETER_PHONE_ID_NOT_SET}" />
+               <f:viewParam name="phoneId" value="#{adminPhoneController.cellPhone}" converter="CellphoneConverter" required="true" requiredMessage="#{msg.ERROR_PARAMETER_PHONE_ID_NOT_SET}" />
        </f:metadata>
 
        <ui:composition template="/WEB-INF/templates/admin/admin_base.tpl">
 
                <ui:define name="content">
                        <ui:include src="/WEB-INF/templates/admin/cellphone/admin_cellphone_data.tpl">
-                               <ui:param name="cellphoneNumber" value="#{adminContactPhoneController.cellPhone}" />
                                <ui:param name="isShowPage" value="#{true}" />
                        </ui:include>
 
-                       <h:dataTable id="contact_cellphone_link" var="contact" value="#{adminContactPhoneController.allCellphoneContacts()}" summary="#{msg.TABLE_SUMMARY_ADMIN_SHOW_CONTACT_CELLPHONE_LINKS}" headerClass="table_header_column" styleClass="table_medium">
+                       <h:dataTable id="contact_cellphone_link" var="contact" value="#{adminPhoneController.allCellphoneContacts()}" summary="#{msg.TABLE_SUMMARY_ADMIN_SHOW_CONTACT_CELLPHONE_LINKS}" headerClass="table_header_column" styleClass="table_medium">
                                <f:facet name="header">
                                        <h:outputFormat value="#{msg.ADMIN_HEADER_SHOW_CONTACT_CELLPHONE_LINKS}">
-                                               <f:param value="#{adminContactPhoneController.cellPhone.phoneId}" />
+                                               <f:param value="#{adminPhoneController.cellPhone.phoneId}" />
                                        </h:outputFormat>
                                </f:facet>
 
@@ -80,7 +79,7 @@
                                                        <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="#{adminContactPhoneController.cellPhone.phoneId}" />
+                                                                       <f:param name="phoneId" value="#{adminPhoneController.cellPhone.phoneId}" />
                                                                        <f:param name="contactId" value="#{contact.contactId}" />
                                                                </h:link>
                                                        </li>
index b6f7e4ed28833e1688582d06d04a381662d62640..0b71610b9e48335d301cd46f7fb30f6fe8b57629 100644 (file)
@@ -8,8 +8,8 @@
        >
 
        <f:metadata>
-               <f:viewParam name="phoneId" value="#{adminContactPhoneController.cellPhone}" converter="CellphoneConverter" required="true" requiredMessage="#{msg.ERROR_PARAMETER_PHONE_ID_NOT_SET}" />
-               <f:viewParam name="contactId" value="#{adminContactPhoneController.contact}" converter="ContactConverter" required="true" requiredMessage="#{msg.ERROR_PARAMETER_CONTACT_ID_NOT_SET}" />
+               <f:viewParam name="phoneId" value="#{adminPhoneController.cellPhone}" converter="CellphoneConverter" required="true" requiredMessage="#{msg.ERROR_PARAMETER_PHONE_ID_NOT_SET}" />
+               <f:viewParam name="contactId" value="#{adminPhoneController.contact}" converter="ContactConverter" required="true" requiredMessage="#{msg.ERROR_PARAMETER_CONTACT_ID_NOT_SET}" />
        </f:metadata>
 
        <ui:composition template="/WEB-INF/templates/admin/admin_base.tpl">
index b2fd1ffd14c8b5071289012797dd1231bb231929..4b3ecb30ea6cf318a565dc239e014f7a8620975f 100644 (file)
                        <ui:include src="/WEB-INF/templates/admin/contact/admin_contact_data.tpl" />
 
                        <div>
-                               <ui:include src="/WEB-INF/templates/admin/contact/admin_contact_links.tpl">
-                                       <ui:param name="contact" value="#{beanHelper.contact}" />
-                               </ui:include>
+                               <ui:include src="/WEB-INF/templates/admin/contact/admin_contact_links.tpl" />
                        </div>
 
                        <div>
-                               <ui:include src="/WEB-INF/templates/admin/cellphone/admin_cellphone_add_show.tpl">
-                                       <ui:param name="cellphoneNumber" value="#{beanHelper.contact.contactCellphoneNumber}" />
-                                       <ui:param name="contact" value="#{beanHelper.contact}" />
-                               </ui:include>
+                               <ui:include src="/WEB-INF/templates/admin/cellphone/admin_cellphone_add_show.tpl" />
                        </div>
                </ui:define>
        </ui:composition>
index f9c9b9cd93359cc4e77cc648e399d4b832d5cbf7..ca7e8ddaf5342162ed3ce9f27ae94b758e2bb5f3 100644 (file)
                        </div>
 
                        <div>
-                               <ui:include src="/WEB-INF/templates/admin/cellphone/admin_cellphone_add_show.tpl">
-                                       <ui:param name="cellphoneNumber" value="#{beanHelper.user.userContact.contactCellphoneNumber}" />
-                                       <ui:param name="contact" value="#{beanHelper.user.userContact}" />
-                               </ui:include>
+                               <ui:include src="/WEB-INF/templates/admin/cellphone/admin_cellphone_add_show.tpl" />
                        </div>
                </ui:define>
        </ui:composition>