]> git.mxchange.org Git - jfinancials-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 21:38:11 +0000 (23:38 +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/addressbook/beans/helper/AddressbookWebRequestHelper.java
src/java/org/mxchange/addressbook/beans/phone/AddressbookAdminContactPhoneWebRequestBean.java
src/java/org/mxchange/addressbook/beans/phone/AddressbookAdminContactPhoneWebRequestController.java
src/java/org/mxchange/localization/bundle_de_DE.properties
src/java/org/mxchange/localization/bundle_en_US.properties
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 f33ff629a4884db01c2cbdc7ee65ca023767a2c6..93c9f60d399661a665a1138b51e6028d7b72e882 100644 (file)
@@ -21,8 +21,12 @@ import javax.enterprise.context.RequestScoped;
 import javax.inject.Inject;
 import javax.inject.Named;
 import org.mxchange.addressbook.beans.contact.AddressbookAdminContactWebRequestController;
+import org.mxchange.addressbook.beans.phone.AddressbookAdminContactPhoneWebRequestController;
 import org.mxchange.addressbook.beans.user.AddressbookUserWebSessionController;
 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;
 
 /**
@@ -40,11 +44,17 @@ public class AddressbookWebRequestHelper implements AddressbookWebRequestControl
        private static final long serialVersionUID = 17_258_793_567_145_701L;
 
        /**
-        * Regular contact controller
+        * Administrative contact controller
         */
        @Inject
        private AddressbookAdminContactWebRequestController adminContactController;
 
+       /**
+        * Administrative phone controller
+        */
+       @Inject
+       private AddressbookAdminContactPhoneWebRequestController adminPhoneController;
+
        /**
         * Contact instance
         */
@@ -84,6 +94,9 @@ public class AddressbookWebRequestHelper implements AddressbookWebRequestControl
                        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());
 
@@ -108,6 +121,15 @@ public class AddressbookWebRequestHelper implements AddressbookWebRequestControl
                        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());
 
@@ -165,4 +187,41 @@ public class AddressbookWebRequestHelper implements AddressbookWebRequestControl
                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 fa26a625d23982c32aed8e78b92a028c8a88d3dc..3284465ac74030c55b5025469cc1a10159a769b4 100644 (file)
@@ -33,11 +33,11 @@ import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
 import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
 
 /**
- * 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 AddressbookAdminContactPhoneWebRequestBean extends BaseAddressbookController implements AddressbookAdminContactPhoneWebRequestController {
 
@@ -58,13 +58,19 @@ public class AddressbookAdminContactPhoneWebRequestBean extends BaseAddressbookC
 
        /**
         * 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 AddressbookAdminContactPhoneWebRequestBean extends BaseAddressbookC
        }
 
        @Override
+       @Deprecated
        public List<Contact> allCellphoneContacts () {
                // Get id
                Long phoneId = this.getCellPhone().getPhoneId();
@@ -129,11 +136,13 @@ public class AddressbookAdminContactPhoneWebRequestBean extends BaseAddressbookC
        }
 
        @Override
+       @Deprecated
        public Contact getContact () {
                return this.contact;
        }
 
        @Override
+       @Deprecated
        public void setContact (final Contact contact) {
                this.contact = contact;
        }
index 04af7f01188d1c6cf9eda34771848735a29e20f1..2ef40a6bff330a8a4c1399d0ea092db134d69008 100644 (file)
@@ -36,6 +36,7 @@ public interface AddressbookAdminContactPhoneWebRequestController extends Serial
         * <p>
         * @return List of all linked contacts
         */
+       @Deprecated
        List<Contact> allCellphoneContacts ();
 
        /**
@@ -85,6 +86,7 @@ public interface AddressbookAdminContactPhoneWebRequestController extends Serial
         * <p>
         * @return Linked contact account
         */
+       @Deprecated
        Contact getContact ();
 
        /**
@@ -92,6 +94,7 @@ public interface AddressbookAdminContactPhoneWebRequestController extends Serial
         * <p>
         * @param contact Linked contact account
         */
+       @Deprecated
        void setContact (final Contact contact);
 
 }
index 5dc86c491d687e1ee1b4b90b2edd1ca82812a4e6..1aadf3434313bb4eea0da247b860fb58f45d3e1c 100644 (file)
@@ -631,3 +631,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 cd9dee42f3dc99e02ca8329cf18860b7039f7be6..d2be3817288a3d940f77efe881f11895ede70cf9 100644 (file)
@@ -628,3 +628,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 5f435f730339b19592f1cdbc8d55ff3407ff73d3..74e005b6c1701a6d5a8ad2059614d829b93c5d72 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>