]> git.mxchange.org Git - jjobs-war.git/commitdiff
Continued a bit: (please cherry-pick)
authorRoland Häder <roland@mxchange.org>
Sat, 6 Aug 2016 07:55:12 +0000 (09:55 +0200)
committerRoland Haeder <roland@mxchange.org>
Sun, 7 Aug 2016 10:29:48 +0000 (12:29 +0200)
- don't wrap command buttons in rendered="" conditions and not with ui:fragment (please name me a full replacement for all the other cases where I'm using it)
- this makes it impossible for the button's action (controller method) being executed as this depends on the life-cycle of the JSF
- it may work in viewing the JSF page but not when you submit it.
- rewrote parameter 'user' to beanHelper.user as this was already being used
- show proper lock/unlock link depending on user's account status
- added navigation rule for new user lock JSF page

Signed-off-by: Roland Häder <roland@mxchange.org>
nbproject/faces-config.NavData
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/user/admin_user_links.tpl
web/admin/user/admin_user_lock.xhtml
web/admin/user/admin_user_show.xhtml
web/admin/user/admin_user_unlock.xhtml

index 00c68c878797b8c07893fa6ff8c0b41f4efd1a05..29c8a39e11a1b3523c8ee158478f3a021d46126a 100644 (file)
@@ -2,70 +2,71 @@
 <Scene Scope="Project" version="2">
     <Scope Scope="Faces Configuration Only"/>
     <Scope Scope="Project">
-        <Node id="admin/cellphone/admin_contact_cellphone_list.xhtml" x="150" y="1050" zoom="true"/>
-        <Node id="user/login_logout.xhtml" x="1650" y="300" zoom="true"/>
-        <Node id="admin/contact/admin_contact_show.xhtml" x="400" y="750" zoom="true"/>
-        <Node id="privacy.xhtml" x="650" y="900" zoom="true"/>
-        <Node id="admin/mobile_provider/admin_mobile_provider_show.xhtml" x="650" y="750" zoom="true"/>
-        <Node id="guest/user/show_addressbook.xhtml" x="650" y="1350" zoom="true"/>
-        <Node id="admin/user/admin_user_show.xhtml" x="900" y="600" zoom="true"/>
-        <Node id="admin/index.xhtml" x="1150" y="450" zoom="true"/>
-        <Node id="user/login_own_addressbooks.xhtml" x="900" y="300" zoom="true"/>
-        <Node id="user/login_user_data_saved.xhtml" x="400" y="900" zoom="true"/>
-        <Node id="admin/admin_logout.xhtml" x="400" y="1200" zoom="true"/>
-        <Node id="user/login_data_saved.xhtml" x="150" y="450" zoom="true"/>
-        <Node id="admin/user/admin_user_unlock.xhtml" x="1400" y="750" zoom="true"/>
-        <Node id="guest/user/user_list.xhtml" x="1150" y="750" zoom="true"/>
+        <Node id="user/login_logout.xhtml" x="400" y="750" zoom="true"/>
+        <Node id="admin/cellphone/admin_contact_cellphone_list.xhtml" x="1650" y="600" zoom="true"/>
+        <Node id="admin/contact/admin_contact_show.xhtml" x="1150" y="750" zoom="true"/>
+        <Node id="privacy.xhtml" x="650" y="600" zoom="true"/>
+        <Node id="admin/mobile_provider/admin_mobile_provider_show.xhtml" x="400" y="450" zoom="true"/>
+        <Node id="guest/user/show_addressbook.xhtml" x="900" y="300" zoom="true"/>
+        <Node id="admin/user/admin_user_show.xhtml" x="900" y="150" zoom="true"/>
+        <Node id="admin/index.xhtml" x="2400" y="150" zoom="true"/>
+        <Node id="user/login_own_addressbooks.xhtml" x="1150" y="450" zoom="true"/>
+        <Node id="user/login_user_data_saved.xhtml" x="1650" y="150" zoom="true"/>
+        <Node id="admin/admin_logout.xhtml" x="1400" y="300" zoom="true"/>
+        <Node id="user/login_data_saved.xhtml" x="150" y="750" zoom="true"/>
+        <Node id="admin/user/admin_user_unlock.xhtml" x="2650" y="150" zoom="true"/>
+        <Node id="guest/user/user_list.xhtml" x="900" y="750" zoom="true"/>
         <Node id="index.xhtml" x="1150" y="900" zoom="true"/>
-        <Node id="user/login_edit_user_data.xhtml" x="1900" y="150" zoom="true"/>
-        <Node id="*" x="650" y="450" zoom="true"/>
-        <Node id="admin/admin_category_delete.xhtml" x="900" y="750" zoom="true"/>
-        <Node id="admin/cellphone/admin_contact_cellphone_edit.xhtml" x="1150" y="600" zoom="true"/>
-        <Node id="user/login_index.xhtml" x="1650" y="450" zoom="true"/>
-        <Node id="guest/user/lost_passwd.xhtml" x="1900" y="450" zoom="true"/>
-        <Node id="guest/user/register_done.xhtml" x="1650" y="150" zoom="true"/>
-        <Node id="guest/user/show_addressbook_entries.xhtml" x="400" y="1350" zoom="true"/>
-        <Node id="user/login.xhtml" x="150" y="1350" zoom="true"/>
-        <Node id="login/login_edit_user_data.xhtml" x="150" y="300" zoom="true"/>
-        <Node id="admin/cellphone/admin_contact_cellphone_unlink.xhtml" x="2400" y="150" zoom="true"/>
-        <Node id="admin/country/admin_country_list.xhtml" x="1900" y="600" zoom="true"/>
-        <Node id="guest/user/login_error.xhtml" x="650" y="150" zoom="true"/>
-        <Node id="admin/user/admin_user_export.xhtml" x="900" y="1050" zoom="true"/>
-        <Node id="admin/mobile_provider/admin_mobile_provider_delete.xhtml" x="400" y="300" zoom="true"/>
-        <Node id="guest/user/resend_done.xhtml" x="1150" y="300" zoom="true"/>
-        <Node id="user/login_change_password.xhtml" x="1400" y="600" zoom="true"/>
-        <Node id="admin/mobile_provider/admin_mobile_provider_list.xhtml" x="150" y="750" zoom="true"/>
-        <Node id="admin/contact/admin_contact_export.xhtml" x="1900" y="300" zoom="true"/>
-        <Node id="guest/user/user_profile.xhtml" x="1150" y="1050" zoom="true"/>
-        <Node id="guest/user/confirm_account.xhtml" x="2150" y="150" zoom="true"/>
-        <Node id="exception.xhtml" x="650" y="600" zoom="true"/>
-        <Node id="admin/user/admin_user_delete.xhtml" x="1650" y="750" zoom="true"/>
-        <Node id="admin/cellphone/admin_contact_cellphone_delete.xhtml" x="900" y="1200" zoom="true"/>
-        <Node id="login/login_index.xhtml" x="2150" y="300" zoom="true"/>
-        <Node id="guest/user/register_page2.xhtml" x="1150" y="150" zoom="true"/>
-        <Node id="admin/user/admin_user_edit.xhtml" x="900" y="900" zoom="true"/>
-        <Node id="terms.xhtml" x="900" y="150" zoom="true"/>
-        <Node id="admin/contact/admin_contact_list.xhtml" x="400" y="450" zoom="true"/>
-        <Node id="admin/contact/admin_contact_edit.xhtml" x="150" y="600" zoom="true"/>
-        <Node id="admin/user/admin_user_list.xhtml" x="1400" y="450" zoom="true"/>
-        <Node id="admin/admin_user_add.xhtml" x="650" y="1050" zoom="true"/>
-        <Node id="admin/country/admin_country_delete.xhtml" x="2400" y="300" zoom="true"/>
-        <Node id="user/login_change_personal_data.xhtml" x="1400" y="300" zoom="true"/>
-        <Node id="logout.xhtml" x="400" y="150" zoom="true"/>
-        <Node id="admin/country/admin_country_edit.xhtml" x="400" y="1050" zoom="true"/>
-        <Node id="guest/user/resend_link.xhtml" x="150" y="150" zoom="true"/>
-        <Node id="user/login_add_addressbook.xhtml" x="1400" y="150" zoom="true"/>
-        <Node id="user/login_contact_data_saved.xhtml" x="400" y="600" zoom="true"/>
-        <Node id="user/user_profile.xhtml" x="150" y="1200" zoom="true"/>
-        <Node id="admin/contact/admin_contact_delete.xhtml" x="1400" y="900" zoom="true"/>
-        <Node id="imprint.xhtml" x="1650" y="600" zoom="true"/>
-        <Node id="admin/mobile_provider/admin_mobile_provider_edit.xhtml" x="2150" y="450" zoom="true"/>
-        <Node id="admin/cellphone/admin_contact_cellphone_show.xhtml" x="2650" y="150" zoom="true"/>
-        <Node id="admin/admin_product_delete.xhtml" x="650" y="1200" zoom="true"/>
-        <Node id="guest/user/login.xhtml" x="150" y="1500" zoom="true"/>
-        <Node id="guest/user/register.xhtml" x="900" y="450" zoom="true"/>
-        <Node id="user/login_change_email_address.xhtml" x="150" y="900" zoom="true"/>
-        <Node id="user/login/login_data_saved.xhtml" x="650" y="300" zoom="true"/>
+        <Node id="user/login_edit_user_data.xhtml" x="650" y="1050" zoom="true"/>
+        <Node id="admin/admin_category_delete.xhtml" x="150" y="1350" zoom="true"/>
+        <Node id="*" x="2150" y="300" zoom="true"/>
+        <Node id="admin/cellphone/admin_contact_cellphone_edit.xhtml" x="1400" y="450" zoom="true"/>
+        <Node id="user/login_index.xhtml" x="1900" y="600" zoom="true"/>
+        <Node id="guest/user/lost_passwd.xhtml" x="150" y="600" zoom="true"/>
+        <Node id="guest/user/register_done.xhtml" x="1900" y="150" zoom="true"/>
+        <Node id="guest/user/show_addressbook_entries.xhtml" x="2150" y="450" zoom="true"/>
+        <Node id="user/login.xhtml" x="1900" y="450" zoom="true"/>
+        <Node id="login/login_edit_user_data.xhtml" x="1150" y="600" zoom="true"/>
+        <Node id="admin/cellphone/admin_contact_cellphone_unlink.xhtml" x="1650" y="450" zoom="true"/>
+        <Node id="admin/country/admin_country_list.xhtml" x="900" y="900" zoom="true"/>
+        <Node id="guest/user/login_error.xhtml" x="150" y="900" zoom="true"/>
+        <Node id="admin/user/admin_user_export.xhtml" x="650" y="450" zoom="true"/>
+        <Node id="admin/mobile_provider/admin_mobile_provider_delete.xhtml" x="400" y="150" zoom="true"/>
+        <Node id="guest/user/resend_done.xhtml" x="2400" y="300" zoom="true"/>
+        <Node id="user/login_change_password.xhtml" x="150" y="1050" zoom="true"/>
+        <Node id="admin/mobile_provider/admin_mobile_provider_list.xhtml" x="650" y="900" zoom="true"/>
+        <Node id="admin/contact/admin_contact_export.xhtml" x="400" y="1500" zoom="true"/>
+        <Node id="guest/user/user_profile.xhtml" x="400" y="300" zoom="true"/>
+        <Node id="guest/user/confirm_account.xhtml" x="650" y="750" zoom="true"/>
+        <Node id="admin/cellphone/admin_contact_cellphone_delete.xhtml" x="150" y="150" zoom="true"/>
+        <Node id="admin/user/admin_user_delete.xhtml" x="900" y="600" zoom="true"/>
+        <Node id="exception.xhtml" x="650" y="1350" zoom="true"/>
+        <Node id="login/login_index.xhtml" x="150" y="450" zoom="true"/>
+        <Node id="admin/user/admin_user_edit.xhtml" x="1650" y="300" zoom="true"/>
+        <Node id="guest/user/register_page2.xhtml" x="1900" y="300" zoom="true"/>
+        <Node id="terms.xhtml" x="1400" y="150" zoom="true"/>
+        <Node id="admin/contact/admin_contact_edit.xhtml" x="400" y="600" zoom="true"/>
+        <Node id="admin/contact/admin_contact_list.xhtml" x="1400" y="900" zoom="true"/>
+        <Node id="admin/user/admin_user_lock.xhtml" x="1150" y="150" zoom="true"/>
+        <Node id="admin/user/admin_user_list.xhtml" x="150" y="300" zoom="true"/>
+        <Node id="admin/admin_user_add.xhtml" x="1400" y="750" zoom="true"/>
+        <Node id="admin/country/admin_country_delete.xhtml" x="150" y="1500" zoom="true"/>
+        <Node id="user/login_change_personal_data.xhtml" x="2150" y="150" zoom="true"/>
+        <Node id="admin/country/admin_country_edit.xhtml" x="900" y="1050" zoom="true"/>
+        <Node id="logout.xhtml" x="400" y="1350" zoom="true"/>
+        <Node id="guest/user/resend_link.xhtml" x="650" y="300" zoom="true"/>
+        <Node id="user/login_add_addressbook.xhtml" x="400" y="900" zoom="true"/>
+        <Node id="user/login_contact_data_saved.xhtml" x="1150" y="1050" zoom="true"/>
+        <Node id="user/user_profile.xhtml" x="1400" y="600" zoom="true"/>
+        <Node id="admin/contact/admin_contact_delete.xhtml" x="1650" y="750" zoom="true"/>
+        <Node id="imprint.xhtml" x="400" y="1050" zoom="true"/>
+        <Node id="admin/mobile_provider/admin_mobile_provider_edit.xhtml" x="900" y="1200" zoom="true"/>
+        <Node id="admin/cellphone/admin_contact_cellphone_show.xhtml" x="150" y="1200" zoom="true"/>
+        <Node id="guest/user/login.xhtml" x="1150" y="300" zoom="true"/>
+        <Node id="admin/admin_product_delete.xhtml" x="400" y="1200" zoom="true"/>
+        <Node id="guest/user/register.xhtml" x="650" y="1200" zoom="true"/>
+        <Node id="user/login_change_email_address.xhtml" x="650" y="150" zoom="true"/>
+        <Node id="user/login/login_data_saved.xhtml" x="900" y="450" zoom="true"/>
     </Scope>
     <Scope Scope="All Faces Configurations"/>
 </Scene>
index 3866017e0b7458bd20b01164a4728c919f3b7aaf..927f25a6f59b552863dff1492b5ba836ecf34e85 100644 (file)
@@ -597,3 +597,4 @@ BUTTON_ADMIN_UNLOCK_USER_ACCOUNT=Benutzeraccount entsperren
 ERROR_CANNOT_UN_LOCK_USER_ACCOUNT_UNCONFIRMED=Unbest\u00e4tigte Benutzeraccounts k\u00f6nnen nicht gesperrt werden.
 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.
index 5ffce6714f6bd4cd968e47625ffd38f22783803f..937559a184295de297e2cda8c9d5aaad0a018ead 100644 (file)
@@ -597,3 +597,4 @@ BUTTON_ADMIN_UNLOCK_USER_ACCOUNT=Unlock user account
 ERROR_CANNOT_UN_LOCK_USER_ACCOUNT_UNCONFIRMED=Unconfirmed user accounts cannot be locked.
 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.
index b2ccac40723b6bdbcdf482385f68f91743736aef..6abcbe2f3a411af3faf9fcbabf0ba5a0792efff0 100644 (file)
                        <from-outcome>admin_delete_user</from-outcome>
                        <to-view-id>/admin/user/admin_user_delete.xhtml</to-view-id>
                </navigation-case>
+               <navigation-case>
+                       <from-outcome>admin_lock_user</from-outcome>
+                       <to-view-id>/admin/user/admin_user_lock.xhtml</to-view-id>
+               </navigation-case>
                <navigation-case>
                        <from-outcome>admin_unlock_user</from-outcome>
                        <to-view-id>/admin/user/admin_user_unlock.xhtml</to-view-id>
index 0c66c5868533ad8f907ff653614120c47e61324d..ef30a7698a6d0bc6b01d4f1e8edf6ffaa909d51d 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_USER_NOT_SET}" rendered="#{empty user}" />
+       <h:outputText styleClass="errors" value="#{msg.ERROR_BEAN_HELPER_USER_NOT_SET}" rendered="#{empty beanHelper.user}" />
 
-       <ui:fragment rendered="#{not empty user}">
+       <ui:fragment rendered="#{not empty beanHelper.user}">
                <div class="table">
                        <div class="table_header">
                                <h:outputText value="#{msg.ADMIN_LINKS_HEADER}" />
                                <ul>
                                        <li>
                                                <h:link outcome="admin_edit_user" value="#{msg.ADMIN_LINK_EDIT_USER}" title="#{msg.ADMIN_LINK_EDIT_USER_TITLE}">
-                                                       <f:param name="userId" value="#{user.userId}" />
+                                                       <f:param name="userId" value="#{beanHelper.user.userId}" />
                                                </h:link>
                                        </li>
 
                                        <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="#{user.userContact.contactId}" />
+                                                       <f:param name="contactId" value="#{beanHelper.user.userContact.contactId}" />
                                                </h:link>
                                        </li>
 
                                        <li>
-                                               <h:link outcome="admin_unlock_user" value="#{msg.ADMIN_LINK_UNLOCK_USER}" title="#{msg.ADMIN_LINK_UNLOCK_USER_TITLE}">
-                                                       <f:param name="userId" value="#{user.userId}" />
+                                               <h:link outcome="admin_unlock_user" value="#{msg.ADMIN_LINK_UNLOCK_USER}" title="#{msg.ADMIN_LINK_UNLOCK_USER_TITLE}" rendered="#{beanHelper.user.userAccountStatus == 'LOCKED'}">
+                                                       <f:param name="userId" value="#{beanHelper.user.userId}" />
+                                               </h:link>
+
+                                               <h:link outcome="admin_lock_user" value="#{msg.ADMIN_LINK_LOCK_USER}" title="#{msg.ADMIN_LINK_LOCK_USER_TITLE}" rendered="#{beanHelper.user.userAccountStatus == 'CONFIRMED'}">
+                                                       <f:param name="userId" value="#{beanHelper.user.userId}" />
                                                </h:link>
                                        </li>
 
                                        <li>
                                                <h:link outcome="admin_delete_user" title="#{msg.ADMIN_LINK_DELETE_USER_TITLE}">
                                                        <h:outputText styleClass="delete_link" value="#{msg.ADMIN_LINK_DELETE_USER}" />
-                                                       <f:param name="userId" value="#{user.userId}" />
+                                                       <f:param name="userId" value="#{beanHelper.user.userId}" />
                                                </h:link>
                                        </li>
                                </ul>
index f08c7d82a050211f9cf9a3724f023fbc96dc2827..e074bcb755e299ab7a23f3fb2bb813c4a7f76393 100644 (file)
@@ -23,7 +23,7 @@
                <ui:define name="content">
                        <h:outputText styleClass="errors" value="#{msg.ERROR_USER_ID_NOT_FOUND}" rendered="#{empty beanHelper.user}" />
 
-                       <h:form id="form_admin_user_unlock" rendered="#{not empty beanHelper.user}">
+                       <h:form id="form_admin_user_unlock" rendered="#{not empty beanHelper.user and beanHelper.user.userAccountStatus == 'CONFIRMED'}">
                                <div class="table_medium">
                                        <div class="table_header">
                                                <h:outputFormat value="#{msg.ADMIN_LOCK_USER_TITLE}">
                                        <div class="table_footer">
                                                <h:commandButton styleClass="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
 
-                                               <ui:fragment rendered="#{beanHelper.user.userAccountStatus == 'CONFIRMED'}">
-                                                       <h:commandButton styleClass="submit" type="submit" action="#{adminUserController.lockUserAccount(beanHelper.user)}" value="#{msg.BUTTON_ADMIN_LOCK_USER_ACCOUNT}" />
-                                               </ui:fragment>
-
-                                               <h:outputText styleClass="errors" value="#{msg.ERROR_CANNOT_UN_LOCK_USER_ACCOUNT_UNCONFIRMED}" rendered="#{beanHelper.user.userAccountStatus == 'UNCONFIRMED'}" />
+                                               <h:commandButton styleClass="submit" type="submit" action="#{adminUserController.lockUserAccount(beanHelper.user)}" value="#{msg.BUTTON_ADMIN_LOCK_USER_ACCOUNT}" />
                                        </div>
                                </div>
                        </h:form>
+
+                       <h:outputText styleClass="errors" value="#{msg.ERROR_CANNOT_UN_LOCK_USER_ACCOUNT_UNCONFIRMED}" rendered="#{beanHelper.user.userAccountStatus == 'UNCONFIRMED'}" />
                </ui:define>
        </ui:composition>
 </html>
index 52f447d32b3c745aee7c238236fc1114bc6b6ec2..646e9f6b7f7eb7e08640cdb18d22ebc2bc4b8883 100644 (file)
                        </h:panelGrid>
 
                        <div>
-                               <ui:include src="/WEB-INF/templates/admin/user/admin_user_links.tpl">
-                                       <ui:param name="user" value="#{beanHelper.user}" />
-                               </ui:include>
+                               <ui:include src="/WEB-INF/templates/admin/user/admin_user_links.tpl" />
                        </div>
 
                        <div>
index 8c9e71f0ce443a49b9f999d6395d4fe68c7414f1..fe8dc18238332d2b8b1a97f19952e2f8cedde417 100644 (file)
@@ -22,7 +22,7 @@
                <ui:define name="content">
                        <h:outputText styleClass="errors" value="#{msg.ERROR_USER_ID_NOT_FOUND}" rendered="#{empty beanHelper.user}" />
 
-                       <h:form id="form_admin_user_unlock" rendered="#{not empty beanHelper.user}">
+                       <h:form id="form_admin_user_unlock" rendered="#{not empty beanHelper.user and beanHelper.user.userAccountStatus == 'LOCKED'}">
                                <div class="table_medium">
                                        <div class="table_header">
                                                <h:outputFormat value="#{msg.ADMIN_UNLOCK_USER_TITLE}">
                                        <div class="table_footer">
                                                <h:commandButton styleClass="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
 
-                                               <ui:fragment rendered="#{beanHelper.user.userAccountStatus == 'LOCKED'}">
-                                                       <h:commandButton styleClass="submit" type="submit" action="#{adminUserController.unlockUserAccount(beanHelper.user)}" value="#{msg.BUTTON_ADMIN_UNLOCK_USER_ACCOUNT}" />
-                                               </ui:fragment>
-
-                                               <h:outputText styleClass="errors" value="#{msg.ERROR_CANNOT_UN_LOCK_USER_ACCOUNT_UNCONFIRMED}" rendered="#{beanHelper.user.userAccountStatus == 'UNCONFIRMED'}" />
+                                               <h:commandButton styleClass="submit" type="submit" action="#{adminUserController.unlockUserAccount(beanHelper.user)}" value="#{msg.BUTTON_ADMIN_UNLOCK_USER_ACCOUNT}" />
                                        </div>
                                </div>
                        </h:form>
+
+                       <h:outputText styleClass="errors" value="#{msg.ERROR_CANNOT_UN_LOCK_USER_ACCOUNT_UNCONFIRMED}" rendered="#{beanHelper.user.userAccountStatus == 'UNCONFIRMED'}" />
                </ui:define>
        </ui:composition>
 </html>