]> git.mxchange.org Git - pizzaservice-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 19:49:43 +0000 (21:49 +0200)
- user list is now "basicly finished"
- added monitoring script for cron-job based monitoring

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 0298ca523b558896cc6b419341364220702ad7ef..30f79d5a3ae603ae578f3ab9fa8063cb8aef5ac3 100644 (file)
         <Node id="basket.xhtml" x="400" y="1050" zoom="true"/>
         <Node id="exception.xhtml" x="1150" y="300" zoom="true"/>
         <Node id="admin/admin_country_delete.xhtml" x="1400" y="300" zoom="true"/>
-        <Node id="customer/register.xhtml" x="400" y="300" zoom="true"/>
-        <Node id="admin/admin_mobile_provider_edit.xhtml" x="900" y="450" zoom="true"/>
         <Node id="admin/admin_country_edit.xhtml" x="1400" y="450" zoom="true"/>
+        <Node id="admin/admin_mobile_provider_edit.xhtml" x="900" y="450" zoom="true"/>
+        <Node id="customer/register.xhtml" x="400" y="300" zoom="true"/>
         <Node id="item_added.xhtml" x="1150" y="600" zoom="true"/>
+        <Node id="admin/admin_user_list.xhtml" x="1036" y="973" zoom="true"/>
         <Node id="admin/admin_mobile_provider_delete.xhtml" x="400" y="600" zoom="true"/>
-        <Node id="admin/admin_user_list.xhtml" x="650" y="900" zoom="true"/>
         <Node id="admin/admin_logout.xhtml" x="650" y="150" zoom="true"/>
         <Node id="terms.xhtml" x="150" y="900" zoom="true"/>
         <Node id="customer/lost_passwd.xhtml" x="1400" y="150" zoom="true"/>
-        <Node id="admin/admin_user_edit.xhtml" x="650" y="750" zoom="true"/>
-        <Node id="admin/admin_user_add.xhtml" x="1900" y="150" zoom="true"/>
+        <Node id="admin/admin_user_edit.xhtml" x="830" y="841" zoom="true"/>
         <Node id="admin/admin_mobile_provider_list.xhtml" x="900" y="600" zoom="true"/>
         <Node id="index.xhtml" x="1150" y="450" zoom="true"/>
         <Node id="logout.xhtml" x="150" y="750" zoom="true"/>
         <Node id="admin/admin_category_list.xhtml" x="150" y="1050" zoom="true"/>
         <Node id="admin/admin_user_unlock.xhtml" x="1650" y="300" zoom="true"/>
         <Node id="admin/admin_category_delete.xhtml" x="150" y="150" zoom="true"/>
-        <Node id="imprint.xhtml" x="150" y="300" zoom="true"/>
         <Node id="customer/login.xhtml" x="900" y="150" zoom="true"/>
+        <Node id="imprint.xhtml" x="150" y="300" zoom="true"/>
         <Node id="*" x="400" y="900" zoom="true"/>
-        <Node id="admin/admin_product_edit.xhtml" x="650" y="300" zoom="true"/>
         <Node id="admin/admin_product_delete.xhtml" x="400" y="750" zoom="true"/>
+        <Node id="admin/admin_product_edit.xhtml" x="650" y="300" zoom="true"/>
         <Node id="admin/admin_category_edit.xhtml" x="400" y="450" zoom="true"/>
         <Node id="admin/admin_product_list.xhtml" x="400" y="150" zoom="true"/>
         <Node id="customer/empty_basket.xhtml" x="150" y="450" zoom="true"/>
index 76447c2ba6ef5a01f9e21c411eea718293d7f454..cd4bcc9e0102a6e6347ac78cd43cbbca46b10257 100644 (file)
@@ -381,3 +381,20 @@ ADMIN_LIST_MOBILE_PRROVIDER_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 8d7ff0026c9c84eb6d8c39162f96451c75607b23..56e1c8bffe2b83130edd50a7c26d261f61dab3a4 100644 (file)
@@ -327,3 +327,17 @@ ADMIN_LIST_MOBILE_PRROVIDER_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;
+}