]> git.mxchange.org Git - jfinancials-war.git/commitdiff
Continued a bit:
authorRoland Haeder <roland@mxchange.org>
Thu, 14 Apr 2016 19:49:43 +0000 (21:49 +0200)
committerRoland Haeder <roland@mxchange.org>
Thu, 14 Apr 2016 20:15:17 +0000 (22:15 +0200)
- user list is now "basicly finished"
- added monitoring script for cron-job based monitoring

Signed-off-by: Roland Häder <roland@mxchange.org>
monitor/.monitor-cron.sh [new file with mode: 0644]
monitor/README.txt [new file with mode: 0644]
monitor/monitor-cron.sh [new file with mode: 0755]
nbproject/faces-config.NavData
src/java/org/mxchange/localization/bundle_de_DE.properties
src/java/org/mxchange/localization/bundle_en_US.properties
web/admin/admin_user_list.xhtml
web/resources/css/cssLayout.css

diff --git a/monitor/.monitor-cron.sh b/monitor/.monitor-cron.sh
new file mode 100644 (file)
index 0000000..fb44aba
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+# URL based on project name may sometimes fail, so you have to set it "statically" here:
+PROJECT_URL="http://glassfish-base-url.invalid/${PROJECT_NAME}/"
+PROJECT_USER="user"
+PROJECT_PASSWORD="password"
diff --git a/monitor/README.txt b/monitor/README.txt
new file mode 100644 (file)
index 0000000..6527106
--- /dev/null
@@ -0,0 +1,24 @@
+How to use this monitoring scripts:
+-----------------------------------
+
+1) Copy .monitor-config.sh to ${HOME}/.monitor-pizzaservice-war-cron.sh
+   Please note that your clone path must be 'pizzaservice-war' then.
+
+2) Execute "crontab -e" as same user
+
+3) Add line such as:
+
+PATH="/bla/foo/bin:/bar/bin"
+SHELL="/bin/bash"
+
+*/10 * * * * cd ${HOME}/checkouts/pizzaservice-war/monitor/ && ./monitor-cron.sh
+
+Please make sure PATH and SHELL are set (maybe prevents some problems).
+
+4) Save the file and let it install it.
+
+5) You are done.
+
+Now every 10 minutes the connection to your glassfish is tested by a HEAD
+request. Please don't set it to high as this may cause huge load on your server
+even when it is only a HEAD request.
diff --git a/monitor/monitor-cron.sh b/monitor/monitor-cron.sh
new file mode 100755 (executable)
index 0000000..8596595
--- /dev/null
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+# Find project name
+PROJECT_NAME="${PWD%/*}"
+PROJECT_NAME="${PROJECT_NAME##*/}"
+
+# FQFN for temporary file
+MONITOR_TEMP_FILE="/tmp/${PROJECT_NAME}.down"
+
+# Construct FQFN for configuration file
+CONFIG_FILE="${HOME}/.monitor-${PROJECT_NAME}-cron.sh"
+
+. "${CONFIG_FILE}"  || exit 255
+
+MONITOR_OUTPUT=`lynx -dump -head "${PROJECT_URL}" -auth="${PROJECT_USER}:${PROJECT_PASSWORD}" | head -n 1`
+
+if [ "${MONITOR_OUTPUT}" != "HTTP/1.1 200 OK" ]
+then
+       if [ ! -f "${MONITOR_TEMP_FILE}" ]
+       then
+               echo "$0: ${PROJECT_NAME} is DOWN, status: '${MONITOR_OUTPUT}'"
+               echo "${MONITOR_OUTPUT}" > ${MONITOR_TEMP_FILE}
+               exit 1
+       fi
+elif [ -f "${MONITOR_TEMP_FILE}" ]
+then
+       PREVIOUS_STATUS=`cat "${MONITOR_TEMP_FILE}"`
+       echo "$0: ${PROJECT_NAME} is UP again, old status was: '${PREVIOUS_STATUS}'"
+       rm -f "${MONITOR_TEMP_FILE}"
+fi
+
+# All fine
+exit 0
index d619b0a284ee7972bf3cdb97132839879522873b..4841e9ad12b79114bb5b0a147481200dbe7c0bbb 100644 (file)
@@ -2,48 +2,48 @@
 <Scene Scope="Project" version="2">
     <Scope Scope="Faces Configuration Only"/>
     <Scope Scope="Project">
-        <Node id="login/login_shared_addressbooks.xhtml" x="150" y="600" zoom="true"/>
-        <Node id="admin/admin_country_list.xhtml" x="1900" y="150" zoom="true"/>
-        <Node id="admin/admin_user_delete.xhtml" x="900" y="300" zoom="true"/>
-        <Node id="login/login_change_password.xhtml" x="400" y="900" zoom="true"/>
-        <Node id="privacy.xhtml" x="1150" y="600" zoom="true"/>
-        <Node id="admin/index.xhtml" x="1400" y="150" zoom="true"/>
-        <Node id="basket.xhtml" x="1150" y="150" zoom="true"/>
-        <Node id="login/login_data_saved.xhtml" x="150" y="450" zoom="true"/>
-        <Node id="exception.xhtml" x="900" y="600" zoom="true"/>
-        <Node id="admin/admin_country_delete.xhtml" x="400" y="300" zoom="true"/>
-        <Node id="login/login_start_sharing_addressbook.xhtml" x="650" y="600" zoom="true"/>
-        <Node id="user/register.xhtml" x="1650" y="450" zoom="true"/>
-        <Node id="admin/admin_mobile_provider_edit.xhtml" x="150" y="750" zoom="true"/>
-        <Node id="admin/admin_country_edit.xhtml" x="1650" y="300" zoom="true"/>
-        <Node id="login/login_index.xhtml" x="1650" y="150" zoom="true"/>
-        <Node id="user/resend_link.xhtml" x="1150" y="450" zoom="true"/>
-        <Node id="login/login_add_addressbook.xhtml" x="900" y="750" zoom="true"/>
-        <Node id="login/login_own_addressbooks.xhtml" x="900" y="150" zoom="true"/>
-        <Node id="admin/admin_user_list.xhtml" x="1400" y="450" zoom="true"/>
-        <Node id="admin/admin_mobile_provider_delete.xhtml" x="900" y="900" zoom="true"/>
-        <Node id="admin/admin_logout.xhtml" x="150" y="900" zoom="true"/>
-        <Node id="terms.xhtml" x="650" y="900" zoom="true"/>
-        <Node id="admin/admin_user_edit.xhtml" x="150" y="1200" zoom="true"/>
-        <Node id="user/user_list.xhtml" x="400" y="600" zoom="true"/>
-        <Node id="admin/admin_mobile_provider_list.xhtml" x="400" y="450" zoom="true"/>
-        <Node id="index.xhtml" x="400" y="150" zoom="true"/>
-        <Node id="logout.xhtml" x="1150" y="750" zoom="true"/>
-        <Node id="user/register_done.xhtml" x="150" y="300" zoom="true"/>
-        <Node id="login/login_change_personal_data.xhtml" x="650" y="150" zoom="true"/>
-        <Node id="user/user_profile.xhtml" x="650" y="300" zoom="true"/>
-        <Node id="admin/admin_user_unlock.xhtml" x="1400" y="300" zoom="true"/>
-        <Node id="imprint.xhtml" x="650" y="450" zoom="true"/>
-        <Node id="user/show_addressbook.xhtml" x="900" y="450" zoom="true"/>
-        <Node id="*" x="400" y="750" zoom="true"/>
-        <Node id="user/login_error.xhtml" x="150" y="1050" zoom="true"/>
-        <Node id="login/login_other_addressbooks.xhtml" x="650" y="750" zoom="true"/>
-        <Node id="user/show_addressbook_entries.xhtml" x="1400" y="600" zoom="true"/>
-        <Node id="login/login_change_email_address.xhtml" x="150" y="150" zoom="true"/>
-        <Node id="user/lost_passwd.xhtml" x="1900" y="300" zoom="true"/>
-        <Node id="login/login_list_sharing_addressbooks.xhtml" x="400" y="1050" zoom="true"/>
-        <Node id="user/login.xhtml" x="2150" y="150" zoom="true"/>
-        <Node id="login/login_edit_user_data.xhtml" x="1150" y="300" zoom="true"/>
+        <Node id="login/login_shared_addressbooks.xhtml" x="1150" y="600" zoom="true"/>
+        <Node id="admin/admin_country_list.xhtml" x="400" y="300" zoom="true"/>
+        <Node id="admin/admin_user_delete.xhtml" x="400" y="900" zoom="true"/>
+        <Node id="privacy.xhtml" x="1650" y="150" zoom="true"/>
+        <Node id="login/login_change_password.xhtml" x="1400" y="300" zoom="true"/>
+        <Node id="admin/index.xhtml" x="900" y="300" zoom="true"/>
+        <Node id="basket.xhtml" x="1150" y="300" zoom="true"/>
+        <Node id="login/login_data_saved.xhtml" x="650" y="300" zoom="true"/>
+        <Node id="exception.xhtml" x="400" y="1050" zoom="true"/>
+        <Node id="admin/admin_country_delete.xhtml" x="150" y="300" zoom="true"/>
+        <Node id="login/login_start_sharing_addressbook.xhtml" x="150" y="1200" zoom="true"/>
+        <Node id="user/register.xhtml" x="400" y="150" zoom="true"/>
+        <Node id="admin/admin_mobile_provider_edit.xhtml" x="150" y="450" zoom="true"/>
+        <Node id="admin/admin_country_edit.xhtml" x="1400" y="150" zoom="true"/>
+        <Node id="user/resend_link.xhtml" x="150" y="900" zoom="true"/>
+        <Node id="login/login_index.xhtml" x="900" y="750" zoom="true"/>
+        <Node id="login/login_add_addressbook.xhtml" x="900" y="900" zoom="true"/>
+        <Node id="login/login_own_addressbooks.xhtml" x="650" y="750" zoom="true"/>
+        <Node id="admin/admin_mobile_provider_delete.xhtml" x="1150" y="450" zoom="true"/>
+        <Node id="admin/admin_user_list.xhtml" x="1400" y="600" zoom="true"/>
+        <Node id="terms.xhtml" x="150" y="600" zoom="true"/>
+        <Node id="admin/admin_logout.xhtml" x="400" y="600" zoom="true"/>
+        <Node id="admin/admin_user_edit.xhtml" x="1150" y="750" zoom="true"/>
+        <Node id="user/user_list.xhtml" x="900" y="600" zoom="true"/>
+        <Node id="admin/admin_mobile_provider_list.xhtml" x="650" y="150" zoom="true"/>
+        <Node id="index.xhtml" x="150" y="150" zoom="true"/>
+        <Node id="logout.xhtml" x="1900" y="300" zoom="true"/>
+        <Node id="user/register_done.xhtml" x="1150" y="150" zoom="true"/>
+        <Node id="login/login_change_personal_data.xhtml" x="400" y="450" zoom="true"/>
+        <Node id="user/user_profile.xhtml" x="1900" y="150" zoom="true"/>
+        <Node id="admin/admin_user_unlock.xhtml" x="400" y="750" zoom="true"/>
+        <Node id="*" x="900" y="450" zoom="true"/>
+        <Node id="user/show_addressbook.xhtml" x="150" y="1050" zoom="true"/>
+        <Node id="imprint.xhtml" x="650" y="900" zoom="true"/>
+        <Node id="user/login_error.xhtml" x="650" y="600" zoom="true"/>
+        <Node id="login/login_other_addressbooks.xhtml" x="1650" y="300" zoom="true"/>
+        <Node id="user/show_addressbook_entries.xhtml" x="1650" y="450" zoom="true"/>
+        <Node id="login/login_change_email_address.xhtml" x="2150" y="150" zoom="true"/>
+        <Node id="user/lost_passwd.xhtml" x="150" y="750" zoom="true"/>
+        <Node id="login/login_list_sharing_addressbooks.xhtml" x="900" y="150" zoom="true"/>
+        <Node id="user/login.xhtml" x="650" y="450" zoom="true"/>
+        <Node id="login/login_edit_user_data.xhtml" x="1400" y="450" zoom="true"/>
     </Scope>
     <Scope Scope="All Faces Configurations"/>
 </Scene>
index 04072982d3594eb7ac22a16e39c857ee02e899d4..24c0f8b0b7f1bf3ef789613558dfba2751f8b27d 100644 (file)
@@ -469,3 +469,20 @@ ADMIN_LIST_MOBILE_PROVIDER_ENTRY_CREATED=Erstellt:
 ADMIN_LINK_EDIT_DELETE_MOBILE_PROVIDER_TITLE=Aendern oder loeschen des Handyanbieters
 ADMIN_ADD_USER_ENTER_PASSWORD1=Passwort eingeben:
 ADMIN_ADD_USER_ENTER_PASSWORD2=Passwort wiederholen:
+ADMIN_LIST_USER_ID=Benutzer-Id:
+ADMIN_LIST_USER_NAME=Benutzername:
+ADMIN_LIST_USER_GENDER=Anrede:
+ADMIN_LIST_USER_FIRST_NAME=Vorname:
+ADMIN_LIST_USER_FAMILY_NAME=Nachname:
+ADMIN_LIST_USER_ACCOUNT_STATUS=Account-Status:
+ADMIN_LIST_USER_PROFILE_MODE=Profilsichtbarkeit:
+ADMIN_LIST_USER_CREATED=Angemeldet seit:
+#@TODO Please fix German umlauts!
+USER_ACCOUNT_STATUS_CONFIRMED=Bestaetigt
+#@TODO Please fix German umlauts!
+USER_ACCOUNT_STATUS_UNCONFIRMED=Unbestaetigt
+USER_ACCOUNT_STATUS_LOCKED=Gesperrt
+USER_PROFILE_MODE_INVISIBLE=Durchsichtig
+USER_PROFILE_MODE_MEMBERS=Nur Mitglieder
+#@TODO Please fix German umlauts!
+USER_PROFILE_MODE_PUBLIC=Oeffentlich
index b6b35d6429ab9c6234c9fbae6f4e25410bf8e045..a1ca514053a19c8fc863a0bebbe436c442059f0b 100644 (file)
@@ -396,3 +396,17 @@ ADMIN_LIST_MOBILE_PROVIDER_ENTRY_CREATED=Created:
 ADMIN_LINK_EDIT_DELETE_MOBILE_PROVIDER_TITLE=Edit or delete mobile provider
 ADMIN_ADD_USER_ENTER_PASSWORD1=Enter password:
 ADMIN_ADD_USER_ENTER_PASSWORD2=Repeat password:
+ADMIN_LIST_USER_ID=User id:
+ADMIN_LIST_USER_NAME=User name:
+ADMIN_LIST_USER_GENDER=Gender:
+ADMIN_LIST_USER_FIRST_NAME=First name:
+ADMIN_LIST_USER_FAMILY_NAME=Family name:
+ADMIN_LIST_USER_ACCOUNT_STATUS=Account status:
+ADMIN_LIST_USER_PROFILE_MODE=Profile visibility:
+ADMIN_LIST_USER_CREATED=Registered:
+USER_ACCOUNT_STATUS_CONFIRMED=Confirmed
+USER_ACCOUNT_STATUS_UNCONFIRMED=Unconfirmed
+USER_ACCOUNT_STATUS_LOCKED=Locked
+USER_PROFILE_MODE_INVISIBLE=Invisible
+USER_PROFILE_MODE_MEMBERS=Only members
+USER_PROFILE_MODE_PUBLIC=Public
index b8b0e3530744289c93bcf5d604648c8159381e25..e8bc9179eff6d68d9891628ffc75d316b89828cf 100644 (file)
                </ui:define>
 
                <ui:define name="content">
-                       <h:dataTable id="table_list_users" var="user" value="#{adminUserController.allUsers()}" styleClass="table" headerClass="table_header_column" summary="#{msg.TABLE_SUMMARY_ADMIN_LIST_USERS}" rendered="#{adminUserController.hasUsers()}">
+                       <h:dataTable id="table_list_users" var="user" value="#{adminUserController.allUsers()}" styleClass="table_big" headerClass="table_header_column" summary="#{msg.TABLE_SUMMARY_ADMIN_LIST_USERS}" rendered="#{adminUserController.hasUsers()}">
+                               <h:column>
+                                       <f:facet name="header">#{msg.ADMIN_LIST_USER_ID}</f:facet>
+
+                                       <h:link outcome="admin_edit_user" title="#{msg.ADMIN_LINK_EDIT_DELETE_USER_TITLE}" value="#{user.userId}">
+                                               <f:param name="userId" value="#{user.userId}" />
+                                       </h:link>
+                               </h:column>
+
+                               <h:column>
+                                       <f:facet name="header">#{msg.ADMIN_LIST_USER_NAME}</f:facet>
+
+                                       <h:outputText value="#{user.userName}" />
+                               </h:column>
+
+                               <h:column>
+                                       <f:facet name="header">#{msg.ADMIN_LIST_USER_GENDER}</f:facet>
+
+                                       <h:outputText value="#{msg[user.userContact.contactGender.messageKey]}" />
+                               </h:column>
+
+                               <h:column>
+                                       <f:facet name="header">#{msg.ADMIN_LIST_USER_FIRST_NAME}</f:facet>
+
+                                       <h:outputText value="#{user.userContact.contactFirstName}" />
+                               </h:column>
+
+                               <h:column>
+                                       <f:facet name="header">#{msg.ADMIN_LIST_USER_FAMILY_NAME}</f:facet>
+
+                                       <h:outputText value="#{user.userContact.contactFamilyName}" />
+                               </h:column>
+
+                               <h:column>
+                                       <f:facet name="header">#{msg.ADMIN_LIST_USER_ACCOUNT_STATUS}</f:facet>
+
+                                       <h:outputText styleClass="#{user.userAccountStatus.styleClass}" value="#{msg[user.userAccountStatus.messageKey]}" />
+                               </h:column>
+
+                               <h:column>
+                                       <f:facet name="header">#{msg.ADMIN_LIST_USER_PROFILE_MODE}</f:facet>
+
+                                       <h:outputText value="#{msg[user.userProfileMode.messageKey]}" />
+                               </h:column>
+
+                               <h:column>
+                                       <f:facet name="header">#{msg.ADMIN_LIST_USER_CREATED}</f:facet>
+
+                                       <h:outputText id="userCreated" value="#{user.userCreated.time}" title="#{msg.ADMIN_USER_CREATED_TITLE}">
+                                               <f:convertDateTime for="userCreated" type="both" timeStyle="short" dateStyle="short" />
+                                       </h:outputText>
+                               </h:column>
                        </h:dataTable>
 
                        <div class="table">
index dbc9c59dc214ade97eaf4c573affbb18ac99b4dd..bf62f151c30f4246d112306b175013644052c8aa 100644 (file)
@@ -201,3 +201,15 @@ ul.footer_nav li.footer_copyright {
 .okay {
        color: #00aa00;
 }
+
+.user_status_confirmed {
+       color: #00aa00;
+}
+
+.user_status_unconfirmed {
+       color: #00aaaa;
+}
+
+.user_status_unconfirmed {
+       color: #aa0000;
+}