]> git.mxchange.org Git - jjobs-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>
Sun, 7 Aug 2016 10:31:40 +0000 (12:31 +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/jjobs/beans/helper/JobsWebRequestHelper.java
src/java/org/mxchange/jjobs/beans/phone/JobsAdminContactPhoneWebSessionBean.java
src/java/org/mxchange/jjobs/beans/phone/JobsAdminContactPhoneWebSessionController.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 99d676d80fa804bfc04903642e2c86df3314cc31..3cf2f5585445d1e320e6d3e5a344eac5b54943be 100644 (file)
@@ -23,6 +23,9 @@ import javax.inject.Named;
 import org.mxchange.jcontacts.contact.Contact;
 import org.mxchange.jjobs.beans.contact.JobsAdminContactWebRequestController;
 import org.mxchange.jjobs.beans.user.JobsUserWebSessionController;
+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 +43,17 @@ public class JobsWebRequestHelper implements JobsWebRequestController {
        private static final long serialVersionUID = 17_258_793_567_145_701L;
 
        /**
-        * Regular contact controller
+        * Administrative contact controller
         */
        @Inject
        private JobsAdminContactWebRequestController adminContactController;
 
+       /**
+        * Administrative phone controller
+        */
+       @Inject
+       private JobsAdminContactPhoneWebRequestController adminPhoneController;
+
        /**
         * Contact instance
         */
@@ -84,6 +93,9 @@ public class JobsWebRequestHelper implements JobsWebRequestController {
                        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 +120,15 @@ public class JobsWebRequestHelper implements JobsWebRequestController {
                        throw new IllegalStateException(MessageFormat.format("this.user.userId={0} is not valid.", this.getUser().getUserId()));
                }
 
+               // 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 +186,41 @@ public class JobsWebRequestHelper implements JobsWebRequestController {
                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 4b6a92459c2fa7d7cceeeb72ccf6b36f496f5e80..80a426996e138a32fb1fe465938c1403d31368b0 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 JobsAdminContactPhoneWebSessionBean extends BaseJobsController implements JobsAdminContactPhoneWebSessionController {
 
@@ -58,13 +58,19 @@ public class JobsAdminContactPhoneWebSessionBean extends BaseJobsController impl
 
        /**
         * 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 JobsAdminContactPhoneWebSessionBean extends BaseJobsController impl
        }
 
        @Override
+       @Deprecated
        public List<Contact> allCellphoneContacts () {
                // Get id
                Long phoneId = this.getCellPhone().getPhoneId();
@@ -129,11 +136,13 @@ public class JobsAdminContactPhoneWebSessionBean extends BaseJobsController impl
        }
 
        @Override
+       @Deprecated
        public Contact getContact () {
                return this.contact;
        }
 
        @Override
+       @Deprecated
        public void setContact (final Contact contact) {
                this.contact = contact;
        }
index b0e7e9cd07913a23bc1e801fee532204c012265f..989f9894c192a69396d995b946c22f2a4d67669b 100644 (file)
@@ -36,6 +36,7 @@ public interface JobsAdminContactPhoneWebSessionController extends Serializable
         * <p>
         * @return List of all linked contacts
         */
+       @Deprecated
        List<Contact> allCellphoneContacts ();
 
        /**
@@ -85,6 +86,7 @@ public interface JobsAdminContactPhoneWebSessionController extends Serializable
         * <p>
         * @return Linked contact account
         */
+       @Deprecated
        Contact getContact ();
 
        /**
@@ -92,6 +94,7 @@ public interface JobsAdminContactPhoneWebSessionController extends Serializable
         * <p>
         * @param contact Linked contact account
         */
+       @Deprecated
        void setContact (final Contact contact);
 
 }
index 927f25a6f59b552863dff1492b5ba836ecf34e85..7749593d2752d4b214eae76e60e5596ce7027112 100644 (file)
@@ -598,3 +598,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 937559a184295de297e2cda8c9d5aaad0a018ead..340e5951716691da04aff9d102f04327be2cb067 100644 (file)
@@ -598,3 +598,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 6abcbe2f3a411af3faf9fcbabf0ba5a0792efff0..0f7c58db05edddacaff8aa6ffebcd479771deb67 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 abd24354063aa6cdec21b40c444f927ced8ae3ad..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 id="cellphoneLinks" 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 823263f849b9175bfc0e2701e0211ed228cae3fe..7a8be2ad624f15fa17a5d4ff299bbbca1aa48929 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 646e9f6b7f7eb7e08640cdb18d22ebc2bc4b8883..0d33f603d12fb0d5fb7a1fb83552663da23e0dd9 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>