From: Roland Häder Date: Wed, 1 Apr 2020 18:24:20 +0000 (+0200) Subject: Please cherry-pick: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=18ba8f85ace2e63451c8c28e81f31097c85f255a;p=jfinancials-war.git Please cherry-pick: - rewrote admin-countries-list view to more modern approach with filters and sorting - rewrote many while(iterator) implementations to use for(item:List/Map.Entry) instead - added some missing i18n keys Signed-off-by: Roland Häder --- diff --git a/src/java/org/mxchange/jfinancials/beans/business/basicdata/list/FinancialsBasicDataListWebViewBean.java b/src/java/org/mxchange/jfinancials/beans/business/basicdata/list/FinancialsBasicDataListWebViewBean.java index 3205d098..41184b88 100644 --- a/src/java/org/mxchange/jfinancials/beans/business/basicdata/list/FinancialsBasicDataListWebViewBean.java +++ b/src/java/org/mxchange/jfinancials/beans/business/basicdata/list/FinancialsBasicDataListWebViewBean.java @@ -19,7 +19,6 @@ package org.mxchange.jfinancials.beans.business.basicdata.list; import fish.payara.cdi.jsr107.impl.NamedCache; import java.text.MessageFormat; import java.util.Comparator; -import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Objects; @@ -210,23 +209,17 @@ public class FinancialsBasicDataListWebViewBean extends BaseFinancialsBean imple // Is cache there and list is not full? if ((this.getAllBasicData().isEmpty()) && (this.basicDataCache.iterator().hasNext())) { - // Get iterator - final Iterator> iterator = this.basicDataCache.iterator(); - // Build up list - while (iterator.hasNext()) { - // GEt next element - final Cache.Entry next = iterator.next(); - + for (final Cache.Entry currentEntry : this.basicDataCache) { // Add to list - this.getAllBasicData().add(next.getValue()); + this.getAllBasicData().add(currentEntry.getValue()); } // Sort list this.getAllBasicData().sort(new Comparator() { @Override - public int compare (final BasicData o1, final BasicData o2) { - return o1.getBasicDataId() > o2.getBasicDataId() ? 1 : o1.getBasicDataId() < o2.getBasicDataId() ? -1 : 0; + public int compare (final BasicData basicData1, final BasicData basicData2) { + return basicData1.getBasicDataId() > basicData2.getBasicDataId() ? 1 : basicData1.getBasicDataId() < basicData2.getBasicDataId() ? -1 : 0; } }); diff --git a/src/java/org/mxchange/jfinancials/beans/business/branchoffice/list/FinancialsBranchOfficeListWebViewBean.java b/src/java/org/mxchange/jfinancials/beans/business/branchoffice/list/FinancialsBranchOfficeListWebViewBean.java index 138c0b1f..7a7fbc17 100644 --- a/src/java/org/mxchange/jfinancials/beans/business/branchoffice/list/FinancialsBranchOfficeListWebViewBean.java +++ b/src/java/org/mxchange/jfinancials/beans/business/branchoffice/list/FinancialsBranchOfficeListWebViewBean.java @@ -19,7 +19,6 @@ package org.mxchange.jfinancials.beans.business.branchoffice.list; import fish.payara.cdi.jsr107.impl.NamedCache; import java.text.MessageFormat; import java.util.Comparator; -import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Objects; @@ -203,23 +202,17 @@ public class FinancialsBranchOfficeListWebViewBean extends BaseFinancialsBean im // Is the list empty, but filled cache? if (this.allBranchOffices.isEmpty() && this.branchOfficeCache.iterator().hasNext()) { - // Get iterator - final Iterator> iterator = this.branchOfficeCache.iterator(); - // Build up list - while (iterator.hasNext()) { - // GEt next element - final Cache.Entry next = iterator.next(); - + for (final Cache.Entry currentEntry : this.branchOfficeCache) { // Add to list - this.allBranchOffices.add(next.getValue()); + this.allBranchOffices.add(currentEntry.getValue()); } // Sort list this.allBranchOffices.sort(new Comparator() { @Override - public int compare (final BranchOffice o1, final BranchOffice o2) { - return o1.getBranchId() > o2.getBranchId() ? 1 : o1.getBranchId() < o2.getBranchId() ? -1 : 0; + public int compare (final BranchOffice branchOffice1, final BranchOffice branchOffice2) { + return branchOffice1.getBranchId() > branchOffice2.getBranchId() ? 1 : branchOffice1.getBranchId() < branchOffice2.getBranchId() ? -1 : 0; } }); } diff --git a/src/java/org/mxchange/jfinancials/beans/business/department/FinancialsDepartmentWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/business/department/FinancialsDepartmentWebRequestBean.java index 426323f8..35884c8a 100644 --- a/src/java/org/mxchange/jfinancials/beans/business/department/FinancialsDepartmentWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/business/department/FinancialsDepartmentWebRequestBean.java @@ -19,7 +19,6 @@ package org.mxchange.jfinancials.beans.business.department; import fish.payara.cdi.jsr107.impl.NamedCache; import java.text.MessageFormat; import java.util.Comparator; -import java.util.Iterator; import java.util.LinkedList; import java.util.List; import javax.annotation.PostConstruct; @@ -179,23 +178,17 @@ public class FinancialsDepartmentWebRequestBean extends BaseFinancialsBean imple // Is the list empty, but filled cache? if (this.allDepartments.isEmpty() && this.departmentCache.iterator().hasNext()) { - // Get iterator - final Iterator> iterator = this.departmentCache.iterator(); - // Build up list - while (iterator.hasNext()) { - // GEt next element - final Cache.Entry next = iterator.next(); - + for (final Cache.Entry currentEntry : this.departmentCache) { // Add to list - this.allDepartments.add(next.getValue()); + this.allDepartments.add(currentEntry.getValue()); } // Sort list this.allDepartments.sort(new Comparator() { @Override - public int compare (final Department o1, final Department o2) { - return o1.getDepartmentId() > o2.getDepartmentId() ? 1 : o1.getDepartmentId() < o2.getDepartmentId() ? -1 : 0; + public int compare (final Department department1, final Department department2) { + return department1.getDepartmentId() > department2.getDepartmentId() ? 1 : department1.getDepartmentId() < department2.getDepartmentId() ? -1 : 0; } }); } diff --git a/src/java/org/mxchange/jfinancials/beans/business/employee/FinancialsEmployeeWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/business/employee/FinancialsEmployeeWebRequestBean.java index 4053fec4..84b6a29d 100644 --- a/src/java/org/mxchange/jfinancials/beans/business/employee/FinancialsEmployeeWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/business/employee/FinancialsEmployeeWebRequestBean.java @@ -19,7 +19,6 @@ package org.mxchange.jfinancials.beans.business.employee; import fish.payara.cdi.jsr107.impl.NamedCache; import java.text.MessageFormat; import java.util.Comparator; -import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Objects; @@ -176,23 +175,17 @@ public class FinancialsEmployeeWebRequestBean extends BaseFinancialsBean impleme // Is cache filled and list is empty if ((this.employeeCache.iterator().hasNext()) && (this.allEmployees.isEmpty())) { - // Get iterator - final Iterator> iterator = this.employeeCache.iterator(); - // Build up list - while (iterator.hasNext()) { - // GEt next element - final Cache.Entry next = iterator.next(); - + for (final Cache.Entry currentEntry : this.employeeCache) { // Add to list - this.allEmployees.add(next.getValue()); + this.allEmployees.add(currentEntry.getValue()); } // Sort list this.allEmployees.sort(new Comparator() { @Override - public int compare (final Employable o1, final Employable o2) { - return o1.getEmployeeId() > o2.getEmployeeId() ? 1 : o1.getEmployeeId() < o2.getEmployeeId() ? -1 : 0; + public int compare (final Employable employee1, final Employable employee2) { + return employee1.getEmployeeId() > employee2.getEmployeeId() ? 1 : employee1.getEmployeeId() < employee2.getEmployeeId() ? -1 : 0; } }); } diff --git a/src/java/org/mxchange/jfinancials/beans/business/headquarter/FinancialsHeadquarterWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/business/headquarter/FinancialsHeadquarterWebRequestBean.java index 0e6cd13c..15c9d8ff 100644 --- a/src/java/org/mxchange/jfinancials/beans/business/headquarter/FinancialsHeadquarterWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/business/headquarter/FinancialsHeadquarterWebRequestBean.java @@ -19,7 +19,6 @@ package org.mxchange.jfinancials.beans.business.headquarter; import fish.payara.cdi.jsr107.impl.NamedCache; import java.text.MessageFormat; import java.util.Comparator; -import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Objects; @@ -180,23 +179,17 @@ public class FinancialsHeadquarterWebRequestBean extends BaseFinancialsBean impl // Is the list empty, but filled cache? if (this.allHeadquarter.isEmpty() && this.headquarterCache.iterator().hasNext()) { - // Get iterator - final Iterator> iterator = this.headquarterCache.iterator(); - // Build up list - while (iterator.hasNext()) { - // GEt next element - final Cache.Entry next = iterator.next(); - + for (final Cache.Entry currentEntry : this.headquarterCache) { // Add to list - this.allHeadquarter.add(next.getValue()); + this.allHeadquarter.add(currentEntry.getValue()); } // Sort list this.allHeadquarter.sort(new Comparator() { @Override - public int compare (final Headquarter o1, final Headquarter o2) { - return o1.getHeadquarterId() > o2.getHeadquarterId() ? 1 : o1.getHeadquarterId() < o2.getHeadquarterId() ? -1 : 0; + public int compare (final Headquarter headquarter1, final Headquarter headquarter2) { + return headquarter1.getHeadquarterId() > headquarter2.getHeadquarterId() ? 1 : headquarter1.getHeadquarterId() < headquarter2.getHeadquarterId() ? -1 : 0; } }); } diff --git a/src/java/org/mxchange/jfinancials/beans/business/opening_time/FinancialsOpeningTimeWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/business/opening_time/FinancialsOpeningTimeWebRequestBean.java index b0972b13..7577eec1 100644 --- a/src/java/org/mxchange/jfinancials/beans/business/opening_time/FinancialsOpeningTimeWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/business/opening_time/FinancialsOpeningTimeWebRequestBean.java @@ -19,7 +19,6 @@ package org.mxchange.jfinancials.beans.business.opening_time; import fish.payara.cdi.jsr107.impl.NamedCache; import java.text.MessageFormat; import java.util.Comparator; -import java.util.Iterator; import java.util.LinkedList; import java.util.List; import javax.annotation.PostConstruct; @@ -175,23 +174,17 @@ public class FinancialsOpeningTimeWebRequestBean extends BaseFinancialsBean impl // Is the list empty, but filled cache? if (this.allOpeningTimes.isEmpty() && this.openingTimesCache.iterator().hasNext()) { - // Get iterator - final Iterator> iterator = this.openingTimesCache.iterator(); - // Build up list - while (iterator.hasNext()) { - // GEt next element - final Cache.Entry next = iterator.next(); - + for (final Cache.Entry currentEntry : this.openingTimesCache) { // Add to list - this.allOpeningTimes.add(next.getValue()); + this.allOpeningTimes.add(currentEntry.getValue()); } // Sort list this.allOpeningTimes.sort(new Comparator() { @Override - public int compare (final OpeningTime o1, final OpeningTime o2) { - return o1.getOpeningId() > o2.getOpeningId() ? 1 : o1.getOpeningId() < o2.getOpeningId() ? -1 : 0; + public int compare (final OpeningTime openingTime1, final OpeningTime openingTime2) { + return openingTime1.getOpeningId() > openingTime2.getOpeningId() ? 1 : openingTime1.getOpeningId() < openingTime2.getOpeningId() ? -1 : 0; } } ); diff --git a/src/java/org/mxchange/jfinancials/beans/contact/list/FinancialsContactListWebViewBean.java b/src/java/org/mxchange/jfinancials/beans/contact/list/FinancialsContactListWebViewBean.java index d4edde22..83f001cd 100644 --- a/src/java/org/mxchange/jfinancials/beans/contact/list/FinancialsContactListWebViewBean.java +++ b/src/java/org/mxchange/jfinancials/beans/contact/list/FinancialsContactListWebViewBean.java @@ -19,7 +19,6 @@ package org.mxchange.jfinancials.beans.contact.list; import fish.payara.cdi.jsr107.impl.NamedCache; import java.text.MessageFormat; import java.util.Comparator; -import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Objects; @@ -321,7 +320,7 @@ public class FinancialsContactListWebViewBean extends BaseFinancialsBean impleme * Post-construction method */ @PostConstruct - public void init () { + public void initializeList () { // Is cache there? if (!this.contactCache.iterator().hasNext()) { // Get whole list from EJB @@ -336,23 +335,17 @@ public class FinancialsContactListWebViewBean extends BaseFinancialsBean impleme // Is cache there and list is not full? if ((this.getAllContacts().isEmpty()) && (this.contactCache.iterator().hasNext())) { - // Get iterator - final Iterator> iterator = this.contactCache.iterator(); - // Build up list - while (iterator.hasNext()) { - // GEt next element - final Cache.Entry next = iterator.next(); - + for (final Cache.Entry currentEntry : this.contactCache) { // Add to list - this.getAllContacts().add(next.getValue()); + this.getAllContacts().add(currentEntry.getValue()); } // Sort list this.getAllContacts().sort(new Comparator() { @Override - public int compare (final Contact o1, final Contact o2) { - return o1.getContactId() > o2.getContactId() ? 1 : o1.getContactId() < o2.getContactId() ? -1 : 0; + public int compare (final Contact contact1, final Contact contact2) { + return contact1.getContactId() > contact2.getContactId() ? 1 : contact1.getContactId() < contact2.getContactId() ? -1 : 0; } }); @@ -366,16 +359,10 @@ public class FinancialsContactListWebViewBean extends BaseFinancialsBean impleme // Default is not found boolean IsFound = false; - // Get iterator - final Iterator iterator = this.getAllContacts().iterator(); - // Loop through all - while (iterator.hasNext()) { - // Get next contact - final Contact next = iterator.next(); - + for (final Contact currentContact : this.getAllContacts()) { // Is the same? - if (Contacts.isSameContact(contact, next)) { + if (Contacts.isSameContact(contact, currentContact)) { // Yes, then abort loop IsFound = false; break; @@ -393,10 +380,7 @@ public class FinancialsContactListWebViewBean extends BaseFinancialsBean impleme */ private void removeContact (final Contact contact) { // Remove from general list - if (!this.contactCache.remove(contact.getContactId())) { - // Did not remove contact - throw new IllegalStateException(MessageFormat.format("contact {0} was not removed.", contact.getContactId())); //NOI18N - } + this.contactCache.remove(contact.getContactId()); } /** @@ -406,18 +390,12 @@ public class FinancialsContactListWebViewBean extends BaseFinancialsBean impleme * @param contact Contact instance to add uniquely */ private void uniqueAddContact (final Contact contact) { - // Get iterator from list - final Iterator> iterator = this.contactCache.iterator(); - // "Walk" through all entries - while (iterator.hasNext()) { - // Get next element - final Cache.Entry next = iterator.next(); - + for (final Cache.Entry currentEntry : this.contactCache) { // Is id number the same? - if (Objects.equals(contact.getContactId(), next.getKey())) { + if (Objects.equals(contact.getContactId(), currentEntry.getKey())) { // Found entry, so remove it and abort - this.removeContact(next.getValue()); + this.removeContact(currentEntry.getValue()); break; } } diff --git a/src/java/org/mxchange/jfinancials/beans/country/FinancialsAdminCountryWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/country/FinancialsAdminCountryWebRequestBean.java index d83d3b6a..3f646f14 100644 --- a/src/java/org/mxchange/jfinancials/beans/country/FinancialsAdminCountryWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/country/FinancialsAdminCountryWebRequestBean.java @@ -16,8 +16,6 @@ */ package org.mxchange.jfinancials.beans.country; -import java.util.Iterator; -import java.util.List; import java.util.Objects; import javax.ejb.EJB; import javax.enterprise.context.RequestScoped; @@ -33,6 +31,7 @@ import org.mxchange.jcountry.model.data.AdminCountrySessionBeanRemote; import org.mxchange.jcountry.model.data.Country; import org.mxchange.jcountry.model.data.CountryData; import org.mxchange.jfinancials.beans.BaseFinancialsBean; +import org.mxchange.jfinancials.beans.country.list.FinancialsCountryListWebViewController; /** * An administrative country bean @@ -71,12 +70,6 @@ public class FinancialsAdminCountryWebRequestBean extends BaseFinancialsBean imp */ private String countryCode; - /** - * Regular country controller - */ - @Inject - private FinancialsCountryWebRequestController countryController; - /** * Local dial prefix */ @@ -92,6 +85,12 @@ public class FinancialsAdminCountryWebRequestBean extends BaseFinancialsBean imp */ private Boolean countryIsLocalPrefixRequired; + /** + * Regular country controller + */ + @Inject + private FinancialsCountryListWebViewController countryListController; + /** * Phone code */ @@ -282,19 +281,10 @@ public class FinancialsAdminCountryWebRequestBean extends BaseFinancialsBean imp // Default is not found boolean isAdded = false; - // Now get whole ist - final List countries = this.countryController.allCountries(); - - // Get iterator from it - final Iterator iterator = countries.iterator(); - // Check whole list - while (iterator.hasNext()) { - // Get next country - final Country next = iterator.next(); - + for (final Country currentCountry : this.countryListController.getAllCountries()) { // Is country code or i18n the same? - if ((Objects.equals(country.getCountryCode(), next.getCountryCode())) || (Objects.equals(country.getCountryI18nKey(), next.getCountryI18nKey()))) { + if ((Objects.equals(country.getCountryCode(), currentCountry.getCountryCode())) || (Objects.equals(country.getCountryI18nKey(), currentCountry.getCountryI18nKey()))) { // Yes, then abort search isAdded = true; break; diff --git a/src/java/org/mxchange/jfinancials/beans/country/FinancialsCountryWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/country/FinancialsCountryWebRequestBean.java index af457b88..ad40628e 100644 --- a/src/java/org/mxchange/jfinancials/beans/country/FinancialsCountryWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/country/FinancialsCountryWebRequestBean.java @@ -16,21 +16,9 @@ */ package org.mxchange.jfinancials.beans.country; -import fish.payara.cdi.jsr107.impl.NamedCache; -import java.text.MessageFormat; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import javax.annotation.PostConstruct; -import javax.cache.Cache; import javax.ejb.EJB; import javax.enterprise.context.RequestScoped; -import javax.enterprise.event.Observes; -import javax.inject.Inject; import javax.inject.Named; -import org.mxchange.jcountry.events.added.ObservableAdminAddedCountryEvent; -import org.mxchange.jcountry.exceptions.CountryNotFoundException; -import org.mxchange.jcountry.model.data.Country; import org.mxchange.jcountry.model.data.CountrySingletonBeanRemote; import org.mxchange.jfinancials.beans.BaseFinancialsBean; @@ -54,13 +42,6 @@ public class FinancialsCountryWebRequestBean extends BaseFinancialsBean implemen @EJB (lookup = "java:global/jfinancials-ejb/country!org.mxchange.jcountry.model.data.CountrySingletonBeanRemote") private CountrySingletonBeanRemote countryBean; - /** - * List of all countries - */ - @Inject - @NamedCache (cacheName = "countryCache") - private Cache countryCache; - /** * Default constructor */ @@ -69,91 +50,4 @@ public class FinancialsCountryWebRequestBean extends BaseFinancialsBean implemen super(); } - /** - * Observing method when the event is fired that an administrator added a - * new country - *

- * @param event Event instance - */ - public void afterAdminAddedCountryEvent (@Observes final ObservableAdminAddedCountryEvent event) { - // Is all valid? - if (null == event) { - // Throw NPE - throw new NullPointerException("event is null"); //NOI18N - } else if (event.getAddedCountry() == null) { - // Throw again ... - throw new NullPointerException("event.addedCountry is null"); //NOI18N - } else if (event.getAddedCountry().getCountryId() == null) { - // And again ... - throw new NullPointerException("event.addedCountry.countryId is null"); //NOI18N - } else if (event.getAddedCountry().getCountryId() < 1) { - // Id is invalid - throw new IllegalArgumentException(MessageFormat.format("event.addedCountry.countryId={0} is not valid.", event.getAddedCountry().getCountryId())); //NOI18N - } - - // Add the event - this.countryCache.put(event.getAddedCountry().getCountryId(), event.getAddedCountry()); - } - - @Override - @SuppressWarnings ("ReturnOfCollectionOrArrayField") - public List allCountries () { - // Init list - final List list = new LinkedList<>(); - - // Get iterator - final Iterator> iterator = this.countryCache.iterator(); - - // Loop over all - while (iterator.hasNext()) { - // Get next entry - final Cache.Entry next = iterator.next(); - - // Add value to list - list.add(next.getValue()); - } - - // Return it - return list; - } - - @Override - public Country findCountryById (final Long countryId) throws CountryNotFoundException { - // Validate parameter - if (null == countryId) { - // Throw NPE - throw new NullPointerException("countryId is null"); //NOI18N - } else if (countryId < 1) { - // Throw IAE - throw new IllegalArgumentException("countryId=" + countryId + " is invalid"); //NOI18N - } else if (!this.countryCache.containsKey(countryId)) { - // Not found - throw new CountryNotFoundException(countryId); - } - - // Get it from cache - final Country country = this.countryCache.get(countryId); - - // Return it - return country; - } - - /** - * Post-construction method - */ - @PostConstruct - public void init () { - // Is cache there? - if (!this.countryCache.iterator().hasNext()) { - // Get whole list from EJB - final List countries = this.countryBean.allCountries(); - - // Add all - for (final Country country : countries) { - // Add it to cache - this.countryCache.put(country.getCountryId(), country); - } - } - } - } diff --git a/src/java/org/mxchange/jfinancials/beans/country/FinancialsCountryWebRequestController.java b/src/java/org/mxchange/jfinancials/beans/country/FinancialsCountryWebRequestController.java index 779d84e8..d6246a26 100644 --- a/src/java/org/mxchange/jfinancials/beans/country/FinancialsCountryWebRequestController.java +++ b/src/java/org/mxchange/jfinancials/beans/country/FinancialsCountryWebRequestController.java @@ -17,9 +17,6 @@ package org.mxchange.jfinancials.beans.country; import java.io.Serializable; -import java.util.List; -import org.mxchange.jcountry.exceptions.CountryNotFoundException; -import org.mxchange.jcountry.model.data.Country; /** * An interface for country beans @@ -28,23 +25,4 @@ import org.mxchange.jcountry.model.data.Country; */ public interface FinancialsCountryWebRequestController extends Serializable { - /** - * A list of all countries - *

- * @return All countries - */ - List allCountries (); - - /** - * Returns a country instance found by given primary key. If not found, a - * proper exception is thrown. - *

- * @param countryId Primary key - *

- * @return Country data instance - *

- * @throws CountryNotFoundException If the primary key was not found - */ - public Country findCountryById (final Long countryId) throws CountryNotFoundException; - } diff --git a/src/java/org/mxchange/jfinancials/beans/country/list/FinancialsCountryListWebViewBean.java b/src/java/org/mxchange/jfinancials/beans/country/list/FinancialsCountryListWebViewBean.java new file mode 100644 index 00000000..19e00598 --- /dev/null +++ b/src/java/org/mxchange/jfinancials/beans/country/list/FinancialsCountryListWebViewBean.java @@ -0,0 +1,219 @@ +/* + * Copyright (C) 2016 - 2020 Free Software Foundation + * + * 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 . + */ +package org.mxchange.jfinancials.beans.country.list; + +import fish.payara.cdi.jsr107.impl.NamedCache; +import java.text.MessageFormat; +import java.util.Comparator; +import java.util.LinkedList; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.cache.Cache; +import javax.ejb.EJB; +import javax.enterprise.event.Observes; +import javax.faces.view.ViewScoped; +import javax.inject.Inject; +import javax.inject.Named; +import org.mxchange.jcountry.events.added.ObservableAdminAddedCountryEvent; +import org.mxchange.jcountry.exceptions.CountryNotFoundException; +import org.mxchange.jcountry.model.data.Country; +import org.mxchange.jcountry.model.data.CountrySingletonBeanRemote; +import org.mxchange.jfinancials.beans.BaseFinancialsBean; + +/** + * A country-list bean + *

+ * @author Roland Häder + */ +@Named ("countryListController") +@ViewScoped +public class FinancialsCountryListWebViewBean extends BaseFinancialsBean implements FinancialsCountryListWebViewController { + + /** + * Serial number + */ + private static final long serialVersionUID = 176_985_298_681_742_961L; + + /** + * A list of all countries + */ + private final List allCountries; + + /** + * Remote country EJB + */ + @EJB (lookup = "java:global/jfinancials-ejb/country!org.mxchange.jcountry.model.data.CountrySingletonBeanRemote") + private CountrySingletonBeanRemote countryBean; + + /** + * List of all countries + */ + @Inject + @NamedCache (cacheName = "countryCache") + private transient Cache countryCache; + + /** + * A list of filtered countries + */ + private List filteredCountries; + + /** + * Selected country + */ + private Country selectedCountry; + + /** + * Default constructor + */ + public FinancialsCountryListWebViewBean () { + // Call super constructor + super(); + + // Init list + this.allCountries = new LinkedList<>(); + } + + /** + * Observing method when the event is fired that an administrator added a + * new country + *

+ * @param event Event instance + */ + public void afterAdminAddedCountryEvent (@Observes final ObservableAdminAddedCountryEvent event) { + // Is all valid? + if (null == event) { + // Throw NPE + throw new NullPointerException("event is null"); //NOI18N + } else if (event.getAddedCountry() == null) { + // Throw again ... + throw new NullPointerException("event.addedCountry is null"); //NOI18N + } else if (event.getAddedCountry().getCountryId() == null) { + // And again ... + throw new NullPointerException("event.addedCountry.countryId is null"); //NOI18N + } else if (event.getAddedCountry().getCountryId() < 1) { + // Id is invalid + throw new IllegalArgumentException(MessageFormat.format("event.addedCountry.countryId={0} is not valid.", event.getAddedCountry().getCountryId())); //NOI18N + } + + // Add the event + this.countryCache.put(event.getAddedCountry().getCountryId(), event.getAddedCountry()); + } + + @Override + public Country findCountryById (final Long countryId) throws CountryNotFoundException { + // Validate parameter + if (null == countryId) { + // Throw NPE + throw new NullPointerException("countryId is null"); //NOI18N + } else if (countryId < 1) { + // Throw IAE + throw new IllegalArgumentException("countryId=" + countryId + " is invalid"); //NOI18N + } else if (!this.countryCache.containsKey(countryId)) { + // Not found + throw new CountryNotFoundException(countryId); + } + + // Get it from cache + final Country country = this.countryCache.get(countryId); + + // Return it + return country; + } + + @Override + @SuppressWarnings ("ReturnOfCollectionOrArrayField") + public List getAllCountries () { + return this.allCountries; + } + + /** + * Getter for filtered country list + *

+ * @return Filtered country list + */ + @SuppressWarnings ("ReturnOfCollectionOrArrayField") + public List getFilteredCountries () { + return this.filteredCountries; + } + + /** + * Setter for filtered countries list + *

+ * @param filteredCountries Filtered countries list + */ + @SuppressWarnings ("AssignmentToCollectionOrArrayFieldFromParameter") + public void setFilteredCountries (final List filteredCountries) { + this.filteredCountries = filteredCountries; + } + + /** + * Getter for selected country + *

+ * @return Selected country + */ + public Country getSelectedCountry () { + return this.selectedCountry; + } + + /** + * Setter for selected country + *

+ * @param selectedCountry Selected country + */ + public void setSelectedCountry (final Country selectedCountry) { + this.selectedCountry = selectedCountry; + } + + /** + * Post-construction method + */ + @PostConstruct + public void initializeList () { + // Is cache there? + if (!this.countryCache.iterator().hasNext()) { + // Get whole list from EJB + final List countrys = this.countryBean.allCountries(); + + // Add all + for (final Country country : countrys) { + // Add it to cache + this.countryCache.put(country.getCountryId(), country); + } + } + + // Is cache there and list is not full? + if ((this.getAllCountries().isEmpty()) && (this.countryCache.iterator().hasNext())) { + // Build up list + for (final Cache.Entry currentEntry : this.countryCache) { + // Add to list + this.getAllCountries().add(currentEntry.getValue()); + } + + // Sort list + this.getAllCountries().sort(new Comparator() { + @Override + public int compare (final Country country1, final Country country2) { + return country1.getCountryId() > country2.getCountryId() ? 1 : country1.getCountryId() < country2.getCountryId() ? -1 : 0; + } + }); + + // Set full list + this.setFilteredCountries(this.getAllCountries()); + } + } + +} diff --git a/src/java/org/mxchange/jfinancials/beans/country/list/FinancialsCountryListWebViewController.java b/src/java/org/mxchange/jfinancials/beans/country/list/FinancialsCountryListWebViewController.java new file mode 100644 index 00000000..e8197fb9 --- /dev/null +++ b/src/java/org/mxchange/jfinancials/beans/country/list/FinancialsCountryListWebViewController.java @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2016 - 2020 Free Software Foundation + * + * 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 . + */ +package org.mxchange.jfinancials.beans.country.list; + +import java.io.Serializable; +import java.util.List; +import org.mxchange.jcountry.exceptions.CountryNotFoundException; +import org.mxchange.jcountry.model.data.Country; + +/** + * An interface for country-list beans + *

+ * @author Roland Häder + */ +public interface FinancialsCountryListWebViewController extends Serializable { + + /** + * A list of all countries + *

+ * @return All countries + */ + List getAllCountries (); + + /** + * Returns a country instance found by given primary key. If not found, a + * proper exception is thrown. + *

+ * @param countryId Primary key + *

+ * @return Country data instance + *

+ * @throws CountryNotFoundException If the primary key was not found + */ + public Country findCountryById (final Long countryId) throws CountryNotFoundException; + +} diff --git a/src/java/org/mxchange/jfinancials/beans/mobileprovider/FinancialsMobileProviderWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/mobileprovider/FinancialsMobileProviderWebRequestBean.java index bdab3a7a..7d86d788 100644 --- a/src/java/org/mxchange/jfinancials/beans/mobileprovider/FinancialsMobileProviderWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/mobileprovider/FinancialsMobileProviderWebRequestBean.java @@ -19,7 +19,6 @@ package org.mxchange.jfinancials.beans.mobileprovider; import fish.payara.cdi.jsr107.impl.NamedCache; import java.text.MessageFormat; import java.util.Comparator; -import java.util.Iterator; import java.util.LinkedList; import java.util.List; import javax.annotation.PostConstruct; @@ -177,23 +176,17 @@ public class FinancialsMobileProviderWebRequestBean extends BaseFinancialsBean i // Is the list empty, but filled cache? if (this.allMobileProviders.isEmpty() && this.mobileProviderCache.iterator().hasNext()) { - // Get iterator - final Iterator> iterator = this.mobileProviderCache.iterator(); - // Build up list - while (iterator.hasNext()) { - // GEt next element - final Cache.Entry next = iterator.next(); - + for (final Cache.Entry currentEntry : this.mobileProviderCache) { // Add to list - this.allMobileProviders.add(next.getValue()); + this.allMobileProviders.add(currentEntry.getValue()); } // Sort list this.allMobileProviders.sort(new Comparator() { @Override - public int compare (final MobileProvider o1, final MobileProvider o2) { - return o1.getProviderId() > o2.getProviderId() ? 1 : o1.getProviderId() < o2.getProviderId() ? -1 : 0; + public int compare (final MobileProvider mobileProvider1, final MobileProvider mobileProvider2) { + return mobileProvider1.getProviderId() > mobileProvider2.getProviderId() ? 1 : mobileProvider1.getProviderId() < mobileProvider2.getProviderId() ? -1 : 0; } }); } diff --git a/src/java/org/mxchange/jfinancials/beans/phone/FinancialsPhoneWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/phone/FinancialsPhoneWebRequestBean.java index d54463e8..70a20c91 100644 --- a/src/java/org/mxchange/jfinancials/beans/phone/FinancialsPhoneWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/phone/FinancialsPhoneWebRequestBean.java @@ -18,7 +18,6 @@ package org.mxchange.jfinancials.beans.phone; import fish.payara.cdi.jsr107.impl.NamedCache; import java.text.MessageFormat; -import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Objects; @@ -487,16 +486,10 @@ public class FinancialsPhoneWebRequestBean extends BaseFinancialsBean implements // Init list final List list = new LinkedList<>(); - // Get iterator - final Iterator> iterator = this.faxNumberCache.iterator(); - // Loop over all - while (iterator.hasNext()) { - // Get next entry - final Cache.Entry next = iterator.next(); - + for (final Cache.Entry currentEntry : this.faxNumberCache) { // Add value to list - list.add(next.getValue()); + list.add(currentEntry.getValue()); } // Return it @@ -509,16 +502,10 @@ public class FinancialsPhoneWebRequestBean extends BaseFinancialsBean implements // Init list final List list = new LinkedList<>(); - // Get iterator - final Iterator> iterator = this.landLineNumberCache.iterator(); - // Loop over all - while (iterator.hasNext()) { - // Get next entry - final Cache.Entry next = iterator.next(); - + for (final Cache.Entry currentEntry : this.landLineNumberCache) { // Add value to list - list.add(next.getValue()); + list.add(currentEntry.getValue()); } // Return it @@ -531,16 +518,10 @@ public class FinancialsPhoneWebRequestBean extends BaseFinancialsBean implements // Init list final List list = new LinkedList<>(); - // Get iterator - final Iterator> iterator = this.mobileNumberCache.iterator(); - // Loop over all - while (iterator.hasNext()) { - // Get next entry - final Cache.Entry next = iterator.next(); - + for (final Cache.Entry currentEntry : this.mobileNumberCache) { // Add value to list - list.add(next.getValue()); + list.add(currentEntry.getValue()); } // Return it diff --git a/src/java/org/mxchange/jfinancials/beans/user/FinancialsUserWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/user/FinancialsUserWebRequestBean.java index 158a2261..96916310 100644 --- a/src/java/org/mxchange/jfinancials/beans/user/FinancialsUserWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/user/FinancialsUserWebRequestBean.java @@ -19,7 +19,6 @@ package org.mxchange.jfinancials.beans.user; import fish.payara.cdi.jsr107.impl.NamedCache; import java.text.MessageFormat; import java.util.Comparator; -import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Locale; @@ -142,13 +141,6 @@ public class FinancialsUserWebRequestBean extends BaseFinancialsBean implements */ private String userName; - /** - * User name list - */ - @Inject - @NamedCache (cacheName = "userNameCache") - private Cache userNameCache; - /** * User password (clear-text from web form) */ @@ -502,9 +494,6 @@ public class FinancialsUserWebRequestBean extends BaseFinancialsBean implements // Update user list this.updateList(registeredUser); - // Add user name - this.addUserName(registeredUser); - // Set user id again this.setUserId(registeredUser.getUserId()); } @@ -874,29 +863,22 @@ public class FinancialsUserWebRequestBean extends BaseFinancialsBean implements for (final User user : users) { // Add it to cache this.userCache.put(user.getUserId(), user); - this.userNameCache.put(user.getUserId(), user.getUserName()); } } // Is cache filled and list is empty if ((this.userCache.iterator().hasNext()) && (this.allUsers.isEmpty())) { - // Get iterator - final Iterator> iterator = this.userCache.iterator(); - // Build up list - while (iterator.hasNext()) { - // GEt next element - final Cache.Entry next = iterator.next(); - + for (final Cache.Entry currentEntry : this.userCache) { // Add to list - this.allUsers.add(next.getValue()); + this.allUsers.add(currentEntry.getValue()); } // Sort list this.allUsers.sort(new Comparator() { @Override - public int compare (final User o1, final User o2) { - return o1.getUserId() > o2.getUserId() ? 1 : o1.getUserId() < o2.getUserId() ? -1 : 0; + public int compare (final User user1, final User user2) { + return user1.getUserId() > user2.getUserId() ? 1 : user1.getUserId() < user2.getUserId() ? -1 : 0; } }); } @@ -919,16 +901,10 @@ public class FinancialsUserWebRequestBean extends BaseFinancialsBean implements // Default is not found boolean isFound = false; - // Get iterator - final Iterator iterator = this.allUsers().iterator(); - // Loop through all entries - while (iterator.hasNext()) { - // Get user - final User next = iterator.next(); - + for (final User currentUser : this.allUsers()) { // Compare both objects - if (Objects.equals(contact, next.getUserContact())) { + if (Objects.equals(contact, currentUser.getUserContact())) { // Found it isFound = true; break; @@ -973,7 +949,21 @@ public class FinancialsUserWebRequestBean extends BaseFinancialsBean implements @Override public boolean isUserNameRegistered (final User user) { - return ((this.userNameCache instanceof List) && (this.userNameCache.containsKey(user.getUserId()))); + // Default is not found + boolean isFound = false; + + // Determine it + for (final User currentUser : this.allUsers()) { + // Is same name found? + if (Objects.equals(user.getUserName(), currentUser.getUserName())) { + // Yes, then set flag and abort loop + isFound = true; + break; + } + } + + // Return flag + return isFound; } @Override @@ -1003,23 +993,20 @@ public class FinancialsUserWebRequestBean extends BaseFinancialsBean implements User user = null; // Try to lookup it in visible user list - for (final Iterator> iterator = this.userCache.iterator(); iterator.hasNext();) { - // Get next user - final Cache.Entry next = iterator.next(); - + for (final Cache.Entry currentUser : this.userCache) { // Contact should be set - if (next.getValue().getUserContact() == null) { + if (currentUser.getValue().getUserContact() == null) { // Contact is null - throw new NullPointerException(MessageFormat.format("next.userContact is null for user id {0}", next.getKey())); //NOI18N - } else if (next.getValue().getUserContact().getContactEmailAddress() == null) { + throw new NullPointerException(MessageFormat.format("currentUser.userContact is null for user id {0}", currentUser.getKey())); //NOI18N + } else if (currentUser.getValue().getUserContact().getContactEmailAddress() == null) { // Email address should be set - throw new NullPointerException(MessageFormat.format("next.userContact.contactEmailAddress is null for user id {0}", next.getKey())); //NOI18N + throw new NullPointerException(MessageFormat.format("currentUser.userContact.contactEmailAddress is null for user id {0}", currentUser.getKey())); //NOI18N } // Is the email address found? - if (Objects.equals(next.getValue().getUserContact().getContactEmailAddress(), emailAddress)) { + if (Objects.equals(currentUser.getValue().getUserContact().getContactEmailAddress(), emailAddress)) { // Copy to other variable - user = next.getValue(); + user = currentUser.getValue(); break; } } @@ -1049,14 +1036,11 @@ public class FinancialsUserWebRequestBean extends BaseFinancialsBean implements User user = null; // Try to lookup it in visible user list - for (final Iterator> iterator = this.userCache.iterator(); iterator.hasNext();) { - // Get next user - final Cache.Entry next = iterator.next(); - + for (final Cache.Entry currentUser : this.userCache) { // Is the user id found? - if (Objects.equals(next.getKey(), userId)) { + if (Objects.equals(currentUser.getKey(), userId)) { // Copy to other variable - user = next.getValue(); + user = currentUser.getValue(); break; } } @@ -1071,23 +1055,6 @@ public class FinancialsUserWebRequestBean extends BaseFinancialsBean implements return user; } - /** - * Adds user's name to bean's internal list. It also updates the public user - * list if the user has decided to have a public account, - *

- * @param user User instance - */ - private void addUserName (final User user) { - // Make sure the entry is not added yet - if (this.userNameCache.containsKey(user.getUserId())) { - // Abort here - throw new IllegalArgumentException(MessageFormat.format("User name {0} already added.", user.getUserName())); //NOI18N - } - - // Add user name - this.userNameCache.put(user.getUserId(), user.getUserName()); - } - /** * Clears this bean */ @@ -1178,11 +1145,8 @@ public class FinancialsUserWebRequestBean extends BaseFinancialsBean implements } // Remove it from lists + this.allUsers().remove(user); this.userCache.remove(user.getUserId()); - this.allUsers.remove(user); - - // Remove name from list - this.userNameCache.remove(user.getUserId()); } /** diff --git a/src/java/org/mxchange/jfinancials/beans/user/confirmlink/FinancialsConfirmationLinkWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/user/confirmlink/FinancialsConfirmationLinkWebRequestBean.java index 360389e0..fdbd7ddb 100644 --- a/src/java/org/mxchange/jfinancials/beans/user/confirmlink/FinancialsConfirmationLinkWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/user/confirmlink/FinancialsConfirmationLinkWebRequestBean.java @@ -17,8 +17,6 @@ package org.mxchange.jfinancials.beans.user.confirmlink; import java.text.MessageFormat; -import java.util.Iterator; -import java.util.List; import java.util.Objects; import javax.ejb.EJB; import javax.enterprise.context.RequestScoped; @@ -123,24 +121,15 @@ public class FinancialsConfirmationLinkWebRequestBean extends BaseFinancialsBean return; } - // Now try to find the user in user list, first get the whole list - final List users = this.userController.allUsers(); - - // Get iterator from it - final Iterator iterator = users.iterator(); - // Init instance User user = null; // Then loop through all - while (iterator.hasNext()) { - // Get next user - final User next = iterator.next(); - + for (final User currentUser : this.userController.allUsers()) { // Same confirmation key? - if (Objects.equals(this.getConfirmationKey(), next.getUserConfirmKey())) { + if (Objects.equals(this.getConfirmationKey(), currentUser.getUserConfirmKey())) { // Found it, then set it and abort loop - user = next; + user = currentUser; break; } } diff --git a/src/java/org/mxchange/jfinancials/beans/user/email_address/FinancialsEmailChangeWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/user/email_address/FinancialsEmailChangeWebRequestBean.java index 7ba89f45..c22c0863 100644 --- a/src/java/org/mxchange/jfinancials/beans/user/email_address/FinancialsEmailChangeWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/user/email_address/FinancialsEmailChangeWebRequestBean.java @@ -18,8 +18,6 @@ package org.mxchange.jfinancials.beans.user.email_address; import fish.payara.cdi.jsr107.impl.NamedCache; import java.text.MessageFormat; -import java.util.Iterator; -import java.util.List; import java.util.Objects; import javax.annotation.PostConstruct; import javax.cache.Cache; @@ -203,16 +201,10 @@ public class FinancialsEmailChangeWebRequestBean extends BaseFinancialsBean impl public void init () { // Is cache there? if (!this.queuedEmailCache.iterator().hasNext()) { - // Get whole list from EJB - final List list = this.emailChangeBean.allQueuedAddresses(); - // Add all - for (final Iterator iterator = list.iterator(); iterator.hasNext();) { - // Get next element - final String next = iterator.next(); - + for (final String currentEmailAddress : this.emailChangeBean.allQueuedAddresses()) { // Add it to cache - this.queuedEmailCache.put(next, Boolean.TRUE); + this.queuedEmailCache.put(currentEmailAddress, Boolean.TRUE); } } } diff --git a/src/java/org/mxchange/jfinancials/converter/country/FinancialsCountryConverter.java b/src/java/org/mxchange/jfinancials/converter/country/FinancialsCountryConverter.java index 2c9f2ad4..680c31fb 100644 --- a/src/java/org/mxchange/jfinancials/converter/country/FinancialsCountryConverter.java +++ b/src/java/org/mxchange/jfinancials/converter/country/FinancialsCountryConverter.java @@ -24,8 +24,8 @@ import javax.faces.convert.ConverterException; import javax.faces.convert.FacesConverter; import org.mxchange.jcountry.exceptions.CountryNotFoundException; import org.mxchange.jcountry.model.data.Country; -import org.mxchange.jfinancials.beans.country.FinancialsCountryWebRequestBean; -import org.mxchange.jfinancials.beans.country.FinancialsCountryWebRequestController; +import org.mxchange.jfinancials.beans.country.list.FinancialsCountryListWebViewBean; +import org.mxchange.jfinancials.beans.country.list.FinancialsCountryListWebViewController; /** * Converter for country instance @@ -38,16 +38,10 @@ public class FinancialsCountryConverter implements Converter { /** * Country backing bean */ - private static FinancialsCountryWebRequestController COUNTRY_CONTROLLER; + private static FinancialsCountryListWebViewController COUNTRY_LIST_CONTROLLER; @Override public Country getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) { - // Is the instance there? - if (null == COUNTRY_CONTROLLER) { - // Get bean from CDI directly - COUNTRY_CONTROLLER = CDI.current().select(FinancialsCountryWebRequestBean.class).get(); - } - // Is the value null or empty? if ((null == submittedValue) || (submittedValue.trim().isEmpty())) { // Warning message @@ -65,8 +59,14 @@ public class FinancialsCountryConverter implements Converter { // Convert it to long final Long countryId = Long.parseLong(submittedValue); + // Is the instance there? + if (null == COUNTRY_LIST_CONTROLLER) { + // Get bean from CDI directly + COUNTRY_LIST_CONTROLLER = CDI.current().select(FinancialsCountryListWebViewBean.class).get(); + } + // Try to find it - country = COUNTRY_CONTROLLER.findCountryById(countryId); + country = COUNTRY_LIST_CONTROLLER.findCountryById(countryId); } catch (final NumberFormatException ex) { // Throw again throw new ConverterException(ex); diff --git a/src/java/org/mxchange/localization/generic_de_DE.properties b/src/java/org/mxchange/localization/generic_de_DE.properties index ddfc9ef0..cea7dd9c 100644 --- a/src/java/org/mxchange/localization/generic_de_DE.properties +++ b/src/java/org/mxchange/localization/generic_de_DE.properties @@ -110,7 +110,6 @@ GUEST_REGISTRATION_ENTER_USER_NAME=Benutzernamen eingeben: GUEST_REGISTRATION_USER_NAME_NOTICE=Der Benutzername darf nur einmal vorkommen. GUEST_LINK_RESENT_CONFIRMATION_LINK=Nochmals den Best\u00e4tigungslink aussenden? GUEST_USER_REGISTRATION_COMPLETED=Die Anmeldung ist abgeschlossen und Ihr Account wartet auf Freischaltung. Es ist eine Email mit einem entsprechenden Best\u00e4tigungslink zu Ihnen unterwegs. Diesen m\u00fcssen Sie einmal anklicken oder in die Adresszeile des Browsers kopieren und dann aufrufen lassen. Danach ist Ihr Account freigegeben. -PERSONAL_DATA_COUNTRY_CODE=L\u00e4ndercode: PAGE_TITLE_USER_REGISTER_DONE=Anmeldung abgeschlossen CONTENT_TITLE_USER_REGISTER_DONE=Die Anmeldung ist abgeschlossen: PAGE_TITLE_INDEX_RESEND_LINK=Best\u00e4tigungslink erneut aussenden @@ -294,11 +293,13 @@ ADMIN_ENTER_COUNTRY_PHONE_CODE=Vorwahl f\u00fcr das Land: ADMIN_ENTER_COUNTRY_PHONE_CODE_EXAMPLE=(Beispiel: 49 f\u00fcr Deutschland) BUTTON_ADMIN_ADD_COUNTRY=L\u00e4nderdaten hinzuf\u00fcgen ID_HEADER=Id: -ADMIN_LIST_COUNTRY_DATA_COUNTRY_CODE=L\u00e4ndercode: -ADMIN_LIST_COUNTRY_DATA_COUNTRY_EXTERNAL_DIAL_PREFIX=Vorwahl ausserorts: -ADMIN_LIST_COUNTRY_DATA_COUNTRY_NAME=Land: +DATA_COUNTRY_EXTERNAL_DIAL_PREFIX=Vorwahl ausserorts: +DATA_COUNTRY_ABROAD_DIAL_PREFIX=Vorwahl in's Ausland: +DATA_COUNTRY_PHONE_CODE=Vorwahl vom Land: +DATA_COUNTRY_NAME=Land: +DATA_IS_REQUIRED=Wird ben\u00f6tigt? ADMIN_LINK_EDIT_DELETE_COUNTRY_TITLE=Editieren oder l\u00f6schen der L\u00e4nderdaten -TABLE_SUMMARY_ADMIN_LIST_COUNTRIES=Diese Tabelle listet alle bereits angelegten L\u00e4nderdaten auf. +TABLE_SUMMARY_ADMIN_LIST_COUNTRY=Diese Tabelle listet alle bereits angelegten L\u00e4nderdaten auf. ADMIN_MENU_MOBILE_PROVIDER_TITLE=Handyanbieter ADMIN_LINK_LIST_MOBILE_PROVIDER_TITLE=Hinzuf\u00fcgen, auflisten, \u00e4ndern und l\u00f6schen von Handyanbietern. PAGE_TITLE_ADMIN_MOBILE_PROVIDER_LIST=Handyanbieter verwalten @@ -480,7 +481,7 @@ BUTTON_GUEST_CONFIRM_USER_ACCOUNT=Account best\u00e4tigen ADMIN_MENU_CONTACT_TITLE=Kontaktdaten ADMIN_LINK_LIST_CONTACT=Kontaktdaten ADMIN_LINK_LIST_CONTACT_TITLE=Listet alle Kontaktdaten auf, egal wo her sie angelegt wurden. -ADMIN_CONTACT_COUNTRY_CODE=L\u00e4ndercode: +DATA_COUNTRY_CODE=L\u00e4ndercode: ADMIN_CONTACT_MOBILE_NUMBER=Handynummer: ADMIN_CONTACT_LAND_LINE_NUMBER=Telefonnummer: ADMIN_CONTACT_FAX_NUMBER=Faxnummer: diff --git a/src/java/org/mxchange/localization/generic_en_US.properties b/src/java/org/mxchange/localization/generic_en_US.properties index b5233dfd..4dbf9617 100644 --- a/src/java/org/mxchange/localization/generic_en_US.properties +++ b/src/java/org/mxchange/localization/generic_en_US.properties @@ -109,7 +109,6 @@ GUEST_REGISTRATION_ENTER_USER_NAME=Enter user name: GUEST_REGISTRATION_USER_NAME_NOTICE=The user name must only exist once. GUEST_LINK_RESENT_CONFIRMATION_LINK=Resend again the confirmation link? GUEST_USER_REGISTRATION_COMPLETED=The registration is completed and your account is pending confirmation. An email has been sent to you. There you will find a confirmation link which you have to click once or copy it into your browser's address bar and call it. -PERSONAL_DATA_COUNTRY_CODE=Country code: PAGE_TITLE_USER_REGISTER_DONE=Registration completed CONTENT_TITLE_USER_REGISTER_DONE=Registration is completed: PAGE_TITLE_INDEX_RESEND_LINK=Resend confirmation link @@ -277,11 +276,13 @@ ADMIN_ENTER_COUNTRY_PHONE_CODE=Dial prefix for this country: ADMIN_ENTER_COUNTRY_PHONE_CODE_EXAMPLE=(Example: 1 for U.S.A.) BUTTON_ADMIN_ADD_COUNTRY=Add country data ID_HEADER=Id: -ADMIN_LIST_COUNTRY_DATA_COUNTRY_CODE=Country code: -ADMIN_LIST_COUNTRY_DATA_COUNTRY_EXTERNAL_DIAL_PREFIX=Dial prefix outside: -ADMIN_LIST_COUNTRY_DATA_COUNTRY_NAME=Country: +DATA_COUNTRY_EXTERNAL_DIAL_PREFIX=Dial prefix outside: +DATA_COUNTRY_ABROAD_DIAL_PREFIX=Dial prefix abroad: +DATA_COUNTRY_PHONE_CODE=Dial prefix this country: +DATA_COUNTRY_NAME=Country: +DATA_IS_REQUIRED=Is required? ADMIN_LINK_EDIT_DELETE_COUNTRY_TITLE=Edit or delete country -TABLE_SUMMARY_ADMIN_LIST_COUNTRIES=This table lists all countries. +TABLE_SUMMARY_ADMIN_LIST_COUNTRY=This table lists all countries. ADMIN_MENU_MOBILE_PROVIDER_TITLE=Mobile providers ADMIN_LINK_LIST_MOBILE_PROVIDER=List mobile provider ADMIN_LINK_LIST_MOBILE_PROVIDER_TITLE=Add, list, edit and delete mobile providers. @@ -473,7 +474,7 @@ BUTTON_GUEST_CONFIRM_USER_ACCOUNT=Confirm account ADMIN_MENU_CONTACT_TITLE=Contact data ADMIN_LINK_LIST_CONTACT=Contact data ADMIN_LINK_LIST_CONTACT_TITLE=Lists all contact data regardless where they was created. -ADMIN_CONTACT_COUNTRY_CODE=Country code: +DATA_COUNTRY_CODE=Country code: ADMIN_CONTACT_MOBILE_NUMBER=Mobile number: ADMIN_CONTACT_LAND_LINE_NUMBER=Phone number: ADMIN_CONTACT_FAX_NUMBER=Fax number: diff --git a/web/WEB-INF/resources/tags/admin/columns/admin_contact_data_columns.tpl b/web/WEB-INF/resources/tags/admin/columns/admin_contact_data_columns.tpl index 94c88cc5..0099a771 100644 --- a/web/WEB-INF/resources/tags/admin/columns/admin_contact_data_columns.tpl +++ b/web/WEB-INF/resources/tags/admin/columns/admin_contact_data_columns.tpl @@ -79,7 +79,7 @@ - + diff --git a/web/WEB-INF/templates/contact/form_contact_data.tpl b/web/WEB-INF/templates/contact/form_contact_data.tpl index 93dc2349..f64ef0b7 100644 --- a/web/WEB-INF/templates/contact/form_contact_data.tpl +++ b/web/WEB-INF/templates/contact/form_contact_data.tpl @@ -153,7 +153,7 @@

- +
diff --git a/web/admin/basic_data/admin_basic_data_list.xhtml b/web/admin/basic_data/admin_basic_data_list.xhtml index 290dd9bf..45ce0bc8 100644 --- a/web/admin/basic_data/admin_basic_data_list.xhtml +++ b/web/admin/basic_data/admin_basic_data_list.xhtml @@ -264,8 +264,10 @@ - + diff --git a/web/admin/country/admin_country_list.xhtml b/web/admin/country/admin_country_list.xhtml index e394f038..99aa89eb 100644 --- a/web/admin/country/admin_country_list.xhtml +++ b/web/admin/country/admin_country_list.xhtml @@ -22,18 +22,68 @@ - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - + - - - - + + + + + + - - - - + - + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + +