--- /dev/null
+#!/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"
--- /dev/null
+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.
--- /dev/null
+#!/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
<Scene Scope="Project" version="2">
<Scope Scope="Faces Configuration Only"/>
<Scope Scope="Project">
- <Node id="admin/admin_country_list.xhtml" x="650" y="300" zoom="true"/>
- <Node id="admin/admin_user_delete.xhtml" x="900" y="750" zoom="true"/>
- <Node id="privacy.xhtml" x="400" y="900" zoom="true"/>
- <Node id="login/login_change_password.xhtml" x="1650" y="300" zoom="true"/>
- <Node id="admin/index.xhtml" x="900" y="150" zoom="true"/>
- <Node id="login/login_data_saved.xhtml" x="150" y="600" zoom="true"/>
- <Node id="exception.xhtml" x="1650" y="150" zoom="true"/>
- <Node id="admin/admin_country_delete.xhtml" x="150" y="900" zoom="true"/>
- <Node id="user/register.xhtml" x="1150" y="300" zoom="true"/>
+ <Node id="admin/admin_country_list.xhtml" x="650" y="600" zoom="true"/>
+ <Node id="admin/admin_user_delete.xhtml" x="1650" y="150" zoom="true"/>
+ <Node id="login/login_change_password.xhtml" x="650" y="450" zoom="true"/>
+ <Node id="privacy.xhtml" x="1900" y="300" zoom="true"/>
+ <Node id="admin/index.xhtml" x="650" y="750" zoom="true"/>
+ <Node id="exception.xhtml" x="150" y="750" zoom="true"/>
+ <Node id="login/login_data_saved.xhtml" x="400" y="1050" zoom="true"/>
+ <Node id="admin/admin_country_delete.xhtml" x="1400" y="300" zoom="true"/>
+ <Node id="user/register.xhtml" x="400" y="600" zoom="true"/>
<Node id="admin/admin_mobile_provider_edit.xhtml" x="1400" y="150" zoom="true"/>
- <Node id="admin/admin_country_edit.xhtml" x="400" y="750" zoom="true"/>
- <Node id="user/resend_link.xhtml" x="650" y="450" zoom="true"/>
- <Node id="login/login_index.xhtml" x="900" y="450" zoom="true"/>
- <Node id="login/login_add_addressbook.xhtml" x="2150" y="150" zoom="true"/>
- <Node id="login/login_own_addressbooks.xhtml" x="650" y="900" zoom="true"/>
- <Node id="admin/admin_user_list.xhtml" x="1150" y="450" zoom="true"/>
- <Node id="admin/admin_mobile_provider_delete.xhtml" x="400" y="1050" zoom="true"/>
- <Node id="admin/admin_logout.xhtml" x="400" y="300" zoom="true"/>
- <Node id="terms.xhtml" x="1900" y="300" zoom="true"/>
- <Node id="admin/admin_user_edit.xhtml" x="400" y="150" zoom="true"/>
- <Node id="admin/admin_user_add.xhtml" x="400" y="450" zoom="true"/>
- <Node id="user/user_list.xhtml" x="150" y="450" zoom="true"/>
- <Node id="admin/admin_mobile_provider_list.xhtml" x="1150" y="600" zoom="true"/>
- <Node id="index.xhtml" x="1400" y="450" zoom="true"/>
- <Node id="logout.xhtml" x="900" y="300" zoom="true"/>
- <Node id="user/register_done.xhtml" x="150" y="1200" zoom="true"/>
- <Node id="login/login_change_personal_data.xhtml" x="150" y="150" zoom="true"/>
- <Node id="user/user_profile.xhtml" x="1900" y="150" zoom="true"/>
- <Node id="admin/admin_user_unlock.xhtml" x="150" y="300" zoom="true"/>
- <Node id="user/show_addressbook.xhtml" x="150" y="750" zoom="true"/>
- <Node id="*" x="1400" y="300" zoom="true"/>
- <Node id="imprint.xhtml" x="150" y="1050" zoom="true"/>
- <Node id="user/login_error.xhtml" x="650" y="750" zoom="true"/>
- <Node id="user/show_addressbook_entries.xhtml" x="900" y="600" zoom="true"/>
- <Node id="login/login_change_email_address.xhtml" x="650" y="600" zoom="true"/>
- <Node id="user/lost_passwd.xhtml" x="1150" y="150" zoom="true"/>
- <Node id="user/login.xhtml" x="400" y="600" zoom="true"/>
- <Node id="login/login_edit_user_data.xhtml" x="650" y="150" zoom="true"/>
+ <Node id="admin/admin_country_edit.xhtml" x="1150" y="450" zoom="true"/>
+ <Node id="login/login_index.xhtml" x="900" y="300" zoom="true"/>
+ <Node id="login/login_add_addressbook.xhtml" x="900" y="600" zoom="true"/>
+ <Node id="user/resend_link.xhtml" x="650" y="900" zoom="true"/>
+ <Node id="login/login_own_addressbooks.xhtml" x="1150" y="600" zoom="true"/>
+ <Node id="admin/admin_mobile_provider_delete.xhtml" x="650" y="300" zoom="true"/>
+ <Node id="admin/admin_user_list.xhtml" x="1900" y="150" zoom="true"/>
+ <Node id="terms.xhtml" x="150" y="300" zoom="true"/>
+ <Node id="admin/admin_logout.xhtml" x="1150" y="150" zoom="true"/>
+ <Node id="admin/admin_user_add.xhtml" x="900" y="150" zoom="true"/>
+ <Node id="admin/admin_user_edit.xhtml" x="400" y="900" zoom="true"/>
+ <Node id="user/user_list.xhtml" x="650" y="150" zoom="true"/>
+ <Node id="admin/admin_mobile_provider_list.xhtml" x="900" y="750" zoom="true"/>
+ <Node id="index.xhtml" x="150" y="600" zoom="true"/>
+ <Node id="logout.xhtml" x="2150" y="150" zoom="true"/>
+ <Node id="user/register_done.xhtml" x="150" y="1050" zoom="true"/>
+ <Node id="user/user_profile.xhtml" x="400" y="300" zoom="true"/>
+ <Node id="login/login_change_personal_data.xhtml" x="150" y="900" zoom="true"/>
+ <Node id="admin/admin_user_unlock.xhtml" x="1650" y="300" zoom="true"/>
+ <Node id="*" x="900" y="450" zoom="true"/>
+ <Node id="user/show_addressbook.xhtml" x="400" y="750" zoom="true"/>
+ <Node id="imprint.xhtml" x="150" y="1200" zoom="true"/>
+ <Node id="user/login_error.xhtml" x="400" y="150" zoom="true"/>
+ <Node id="user/show_addressbook_entries.xhtml" x="1400" y="450" zoom="true"/>
+ <Node id="login/login_change_email_address.xhtml" x="150" y="450" zoom="true"/>
+ <Node id="user/lost_passwd.xhtml" x="1150" y="300" zoom="true"/>
+ <Node id="user/login.xhtml" x="150" y="150" zoom="true"/>
+ <Node id="login/login_edit_user_data.xhtml" x="400" y="450" zoom="true"/>
</Scope>
<Scope Scope="All Faces Configurations"/>
</Scene>
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
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
</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">
.okay {
color: #00aa00;
}
+
+.user_status_confirmed {
+ color: #00aa00;
+}
+
+.user_status_unconfirmed {
+ color: #00aaaa;
+}
+
+.user_status_unconfirmed {
+ color: #aa0000;
+}