+++ /dev/null
-/*
- * Copyright (C) 2016 Roland Häder
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jfinancials.converter.contact;
-
-import java.text.MessageFormat;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.convert.Converter;
-import javax.faces.convert.ConverterException;
-import javax.faces.convert.FacesConverter;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import org.mxchange.jcontacts.contact.Contact;
-import org.mxchange.jcontacts.contact.ContactSessionBeanRemote;
-import org.mxchange.jcontacts.exceptions.ContactNotFoundException;
-import org.mxchange.jcoreeelogger.beans.local.logger.Log;
-import org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal;
-
-/**
- * Converter for contact id <-> valid contact instance
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-@FacesConverter (value = "ContactConverter")
-public class AddressbookContactConverter implements Converter {
-
- /**
- * User EJB
- */
- private ContactSessionBeanRemote contactBean;
-
- /**
- * Logger instance
- */
- @Log
- private LoggerBeanLocal loggerBeanLocal;
-
- /**
- * Initialization of this converter
- */
- public AddressbookContactConverter () {
- // Try to get it
- try {
- // Get initial context
- Context context = new InitialContext();
-
- // Lookup logger
- this.loggerBeanLocal = (LoggerBeanLocal) context.lookup("java:global/jcore-logger-ejb/logger!org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal"); //NOI18N
-
- // ... and user controller
- this.contactBean = (ContactSessionBeanRemote) context.lookup("java:global/jfinancials-ejb/contact!org.mxchange.jcontacts.contact.ContactSessionBeanRemote"); //NOI18N
- } catch (final NamingException ex) {
- // Continue to throw it
- throw new RuntimeException(MessageFormat.format("context.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N
- }
- }
-
- @Override
- public Object getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
- // Trace message
- // NOISY-DEBUG: this.loggerBeanLocal.logTrace(MessageFormat.format("getAsObject: context={0},component={1},submittedValue={2} - CALLED!", context, component, submittedValue)); //NOI18N
-
- // Is the value null or empty?
- if ((null == submittedValue) || (submittedValue.trim().isEmpty())) {
- // Warning message
- this.loggerBeanLocal.logWarning(MessageFormat.format("{0}.getAsObject(): submittedValue is null or empty - EXIT!", this.getClass().getSimpleName())); //NOI18N
-
- // Return null
- return null;
- }
-
- // Init instance
- Contact contact = null;
-
- try {
- // Try to parse the value as long
- Long contactId = Long.valueOf(submittedValue);
-
- // Debug message
- // NOISY-DEBUG: this.loggerBeanLocal.logDebug(MessageFormat.format("getAsObject: contactId{0}", contactId)); //NOI18N
-
- // Try to get user instance from it
- contact = this.contactBean.findContactById(contactId);
-
- // Debug message
- // NOISY-DEBUG: this.loggerBeanLocal.logDebug(MessageFormat.format("getAsObject: contact={0}", contact)); //NOI18N
- } catch (final NumberFormatException ex) {
- // Throw again
- throw new ConverterException(ex);
- } catch (final ContactNotFoundException ex) {
- // Debug message
- this.loggerBeanLocal.logDebug(MessageFormat.format("{0}.getAsObject(): Exception: {1} - Returning null ...", this.getClass().getSimpleName(), ex)); //NOI18N
- }
-
- // Trace message
- // NOISY-DEBUG: this.loggerBeanLocal.logTrace(MessageFormat.format("getAsObject: contact={0} - EXIT!", contact)); //NOI18N
-
- // Return it
- return contact;
- }
-
- @Override
- public String getAsString (final FacesContext context, final UIComponent component, final Object value) {
- // Is the object null?
- if ((null == value) || ((String.valueOf(value)).isEmpty())) {
- // Is null
- return ""; //NOI18N
- } else if (!(value instanceof Contact)) {
- // Not same interface
- throw new IllegalArgumentException(MessageFormat.format("value {0} does not implement Contact.", value)); //NOI18N
- }
-
- // Return category id
- return String.valueOf(((Contact) value).getContactId());
- }
-
-}
--- /dev/null
+/*
+ * Copyright (C) 2016 Roland Häder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jfinancials.converter.contact;
+
+import java.text.MessageFormat;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+import javax.faces.convert.ConverterException;
+import javax.faces.convert.FacesConverter;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import org.mxchange.jcontacts.contact.Contact;
+import org.mxchange.jcontacts.contact.ContactSessionBeanRemote;
+import org.mxchange.jcontacts.exceptions.ContactNotFoundException;
+import org.mxchange.jcoreeelogger.beans.local.logger.Log;
+import org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal;
+
+/**
+ * Converter for contact id <-> valid contact instance
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@FacesConverter (value = "ContactConverter")
+public class FinancialsContactConverter implements Converter {
+
+ /**
+ * User EJB
+ */
+ private ContactSessionBeanRemote contactBean;
+
+ /**
+ * Logger instance
+ */
+ @Log
+ private LoggerBeanLocal loggerBeanLocal;
+
+ /**
+ * Initialization of this converter
+ */
+ public FinancialsContactConverter () {
+ // Try to get it
+ try {
+ // Get initial context
+ Context context = new InitialContext();
+
+ // Lookup logger
+ this.loggerBeanLocal = (LoggerBeanLocal) context.lookup("java:global/jcore-logger-ejb/logger!org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal"); //NOI18N
+
+ // ... and user controller
+ this.contactBean = (ContactSessionBeanRemote) context.lookup("java:global/jfinancials-ejb/contact!org.mxchange.jcontacts.contact.ContactSessionBeanRemote"); //NOI18N
+ } catch (final NamingException ex) {
+ // Continue to throw it
+ throw new RuntimeException(MessageFormat.format("context.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N
+ }
+ }
+
+ @Override
+ public Object getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
+ // Trace message
+ // NOISY-DEBUG: this.loggerBeanLocal.logTrace(MessageFormat.format("getAsObject: context={0},component={1},submittedValue={2} - CALLED!", context, component, submittedValue)); //NOI18N
+
+ // Is the value null or empty?
+ if ((null == submittedValue) || (submittedValue.trim().isEmpty())) {
+ // Warning message
+ this.loggerBeanLocal.logWarning(MessageFormat.format("{0}.getAsObject(): submittedValue is null or empty - EXIT!", this.getClass().getSimpleName())); //NOI18N
+
+ // Return null
+ return null;
+ }
+
+ // Init instance
+ Contact contact = null;
+
+ try {
+ // Try to parse the value as long
+ Long contactId = Long.valueOf(submittedValue);
+
+ // Debug message
+ // NOISY-DEBUG: this.loggerBeanLocal.logDebug(MessageFormat.format("getAsObject: contactId{0}", contactId)); //NOI18N
+
+ // Try to get user instance from it
+ contact = this.contactBean.findContactById(contactId);
+
+ // Debug message
+ // NOISY-DEBUG: this.loggerBeanLocal.logDebug(MessageFormat.format("getAsObject: contact={0}", contact)); //NOI18N
+ } catch (final NumberFormatException ex) {
+ // Throw again
+ throw new ConverterException(ex);
+ } catch (final ContactNotFoundException ex) {
+ // Debug message
+ this.loggerBeanLocal.logDebug(MessageFormat.format("{0}.getAsObject(): Exception: {1} - Returning null ...", this.getClass().getSimpleName(), ex)); //NOI18N
+ }
+
+ // Trace message
+ // NOISY-DEBUG: this.loggerBeanLocal.logTrace(MessageFormat.format("getAsObject: contact={0} - EXIT!", contact)); //NOI18N
+
+ // Return it
+ return contact;
+ }
+
+ @Override
+ public String getAsString (final FacesContext context, final UIComponent component, final Object value) {
+ // Is the object null?
+ if ((null == value) || ((String.valueOf(value)).isEmpty())) {
+ // Is null
+ return ""; //NOI18N
+ } else if (!(value instanceof Contact)) {
+ // Not same interface
+ throw new IllegalArgumentException(MessageFormat.format("value {0} does not implement Contact.", value)); //NOI18N
+ }
+
+ // Return category id
+ return String.valueOf(((Contact) value).getContactId());
+ }
+
+}
+++ /dev/null
-/*
- * Copyright (C) 2016 Roland Häder
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jfinancials.converter.country;
-
-import java.text.MessageFormat;
-import java.util.List;
-import java.util.Objects;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.convert.Converter;
-import javax.faces.convert.FacesConverter;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import org.mxchange.jcoreeelogger.beans.local.logger.Log;
-import org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal;
-import org.mxchange.jcountry.data.Country;
-import org.mxchange.jcountry.data.CountrySingletonBeanRemote;
-
-/**
- * Converter for country instance
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-@FacesConverter (value = "CountryConverter")
-public class AddressbookCountryConverter implements Converter {
-
- /**
- * Country bean
- */
- private CountrySingletonBeanRemote countryBean;
-
- /**
- * Logger instance
- */
- @Log
- private LoggerBeanLocal loggerBeanLocal;
-
- /**
- * Initialization of this converter
- */
- public AddressbookCountryConverter () {
- // Try to get it
- try {
- // Get initial context
- Context context = new InitialContext();
-
- // Lookup logger
- this.loggerBeanLocal = (LoggerBeanLocal) context.lookup("java:global/jcore-logger-ejb/logger!org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal"); //NOI18N
-
- // ... and country bean
- this.countryBean = (CountrySingletonBeanRemote) context.lookup("java:global/jfinancials-ejb/country!org.mxchange.jcountry.data.CountrySingletonBeanRemote"); //NOI18N
- } catch (final NamingException ex) {
- // Continue to throw it
- throw new RuntimeException(MessageFormat.format("context.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N
- }
- }
-
- @Override
- public Object getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
- // Trace message
- // NOISY-DEBUG: this.loggerBeanLocal.logTrace(MessageFormat.format("getAsObject: context={0},component={1},submittedValue={2},this.countryBean={3} - CALLED!", context, component, submittedValue, this.countryBean)); //NOI18N
-
- // Is the value null or empty?
- if ((null == submittedValue) || (submittedValue.trim().isEmpty())) {
- // Warning message
- this.loggerBeanLocal.logWarning(MessageFormat.format("{0}.getAsObject(): submittedValue is null or empty - EXIT!", this.getClass().getSimpleName())); //NOI18N
-
- // Return null
- return null;
- }
-
- // Get full list
- List<Country> countryList = this.countryBean.allCountries();
-
- // Init value
- Country country = null;
-
- // Try this better
- try {
- // Convert it to long
- Long countryId = Long.parseLong(submittedValue);
-
- // Category id should not be below 1
- assert (countryId > 0) : "countryId is smaller than one: " + countryId; //NOI18N
-
- // Debug message
- // NOISY-DEBUG: this.loggerBeanLocal.logDebug(MessageFormat.format("getAsObject: countryId={0}", countryId)); //NOI18N
-
- // Try to find it
- for (final Country cntry : countryList) {
- // Is the id the same? (null-safe)
- if (Objects.equals(cntry.getCountryId(), countryId)) {
- // Found it
- country = cntry;
- break;
- }
- }
- } catch (final NumberFormatException ex) {
- // Log exception (maybe to much?)
- this.loggerBeanLocal.logException(ex);
- }
-
- // Trace message
- // NOISY-DEBUG: this.loggerBeanLocal.logTrace(MessageFormat.format("getAsObject: country={0} - EXIT!", country)); //NOI18N
-
- // Return it
- return country;
- }
-
- @Override
- public String getAsString (final FacesContext context, final UIComponent component, final Object value) {
- // Is the object null?
- if ((null == value) || ((String.valueOf(value)).isEmpty())) {
- // Is null
- return ""; //NOI18N
- } else if (!(value instanceof Country)) {
- // Not same interface
- throw new IllegalArgumentException(MessageFormat.format("value {0} does not implement Country.", value)); //NOI18N
- }
-
- // Return category id
- return String.valueOf(((Country) value).getCountryId());
- }
-
-}
--- /dev/null
+/*
+ * Copyright (C) 2016 Roland Häder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jfinancials.converter.country;
+
+import java.text.MessageFormat;
+import java.util.List;
+import java.util.Objects;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+import javax.faces.convert.FacesConverter;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import org.mxchange.jcoreeelogger.beans.local.logger.Log;
+import org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal;
+import org.mxchange.jcountry.data.Country;
+import org.mxchange.jcountry.data.CountrySingletonBeanRemote;
+
+/**
+ * Converter for country instance
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@FacesConverter (value = "CountryConverter")
+public class FinancialsCountryConverter implements Converter {
+
+ /**
+ * Country bean
+ */
+ private CountrySingletonBeanRemote countryBean;
+
+ /**
+ * Logger instance
+ */
+ @Log
+ private LoggerBeanLocal loggerBeanLocal;
+
+ /**
+ * Initialization of this converter
+ */
+ public FinancialsCountryConverter () {
+ // Try to get it
+ try {
+ // Get initial context
+ Context context = new InitialContext();
+
+ // Lookup logger
+ this.loggerBeanLocal = (LoggerBeanLocal) context.lookup("java:global/jcore-logger-ejb/logger!org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal"); //NOI18N
+
+ // ... and country bean
+ this.countryBean = (CountrySingletonBeanRemote) context.lookup("java:global/jfinancials-ejb/country!org.mxchange.jcountry.data.CountrySingletonBeanRemote"); //NOI18N
+ } catch (final NamingException ex) {
+ // Continue to throw it
+ throw new RuntimeException(MessageFormat.format("context.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N
+ }
+ }
+
+ @Override
+ public Object getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
+ // Trace message
+ // NOISY-DEBUG: this.loggerBeanLocal.logTrace(MessageFormat.format("getAsObject: context={0},component={1},submittedValue={2},this.countryBean={3} - CALLED!", context, component, submittedValue, this.countryBean)); //NOI18N
+
+ // Is the value null or empty?
+ if ((null == submittedValue) || (submittedValue.trim().isEmpty())) {
+ // Warning message
+ this.loggerBeanLocal.logWarning(MessageFormat.format("{0}.getAsObject(): submittedValue is null or empty - EXIT!", this.getClass().getSimpleName())); //NOI18N
+
+ // Return null
+ return null;
+ }
+
+ // Get full list
+ List<Country> countryList = this.countryBean.allCountries();
+
+ // Init value
+ Country country = null;
+
+ // Try this better
+ try {
+ // Convert it to long
+ Long countryId = Long.parseLong(submittedValue);
+
+ // Category id should not be below 1
+ assert (countryId > 0) : "countryId is smaller than one: " + countryId; //NOI18N
+
+ // Debug message
+ // NOISY-DEBUG: this.loggerBeanLocal.logDebug(MessageFormat.format("getAsObject: countryId={0}", countryId)); //NOI18N
+
+ // Try to find it
+ for (final Country cntry : countryList) {
+ // Is the id the same? (null-safe)
+ if (Objects.equals(cntry.getCountryId(), countryId)) {
+ // Found it
+ country = cntry;
+ break;
+ }
+ }
+ } catch (final NumberFormatException ex) {
+ // Log exception (maybe to much?)
+ this.loggerBeanLocal.logException(ex);
+ }
+
+ // Trace message
+ // NOISY-DEBUG: this.loggerBeanLocal.logTrace(MessageFormat.format("getAsObject: country={0} - EXIT!", country)); //NOI18N
+
+ // Return it
+ return country;
+ }
+
+ @Override
+ public String getAsString (final FacesContext context, final UIComponent component, final Object value) {
+ // Is the object null?
+ if ((null == value) || ((String.valueOf(value)).isEmpty())) {
+ // Is null
+ return ""; //NOI18N
+ } else if (!(value instanceof Country)) {
+ // Not same interface
+ throw new IllegalArgumentException(MessageFormat.format("value {0} does not implement Country.", value)); //NOI18N
+ }
+
+ // Return category id
+ return String.valueOf(((Country) value).getCountryId());
+ }
+
+}
CHOICE_YES=Ja
CHOICE_NO=Nein
PAGE_TITLE_INDEX_WELCOME=Willkommen!
-CONTENT_TITLE_INDEX_WELCOME=Willkommen zum Addressbook:
+CONTENT_TITLE_INDEX_WELCOME=Willkommen zu JFinancials
PAGE_TITLE_ADMIN_WELCOME=Willkommen zum Administrationsbereich
CONTENT_TITLE_ADMIN_WELCOME=Willkommen zur Administration:
PAGE_TITLE_ADMIN_LOGOUT=Ausloggen
CHOICE_YES=Yes
CHOICE_NO=No
PAGE_TITLE_INDEX_WELCOME=Welcome!
-CONTENT_TITLE_INDEX_WELCOME=Welcome to Addressbook
+CONTENT_TITLE_INDEX_WELCOME=Welcome to JFinancials
PAGE_TITLE_ADMIN_WELCOME=Welcome to administration area
CONTENT_TITLE_ADMIN_WELCOME=Welcome to website administration:
PAGE_TITLE_ADMIN_LOGOUT=Logout
<h:outputStylesheet name="/css/default.css" />
<h:outputStylesheet name="/css/cssLayout.css" />
- <title>Addressbook - <ui:insert name="title">Default title</ui:insert></title>
+ <title>JFinancials - <ui:insert name="title">Default title</ui:insert></title>
</h:head>
<h:body>
<div id="top">
<div id="header">
<div id="title">
- <h1>Addressbook - <ui:insert name="title">Default title</ui:insert></h1>
+ <h1>JFinancials - <ui:insert name="title">Default title</ui:insert></h1>
</div>
</div>
</div>
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">
- <description>An online address book application to share private and business memebers between all members. It is also possible that the user's profile can be made visible to outside.</description>
- <display-name>Addressbook Application v1.0</display-name>
+ <description>An application to handle all your receipts and do some calculation with it</description>
+ <display-name>JFinancials Application v1.0</display-name>
<context-param>
<description>Whether the multi-page registration page or a single registration page is active</description>
<param-name>is_feature_user_register_multiple_page_enabled</param-name>