]> git.mxchange.org Git - jjobs-war.git/commitdiff
Continued with adding features:
authorRoland Haeder <roland@mxchange.org>
Thu, 14 Apr 2016 13:36:04 +0000 (15:36 +0200)
committerRoland Haeder <roland@mxchange.org>
Thu, 14 Apr 2016 14:44:07 +0000 (16:44 +0200)
- merged add_user into list_user as other admin pages are constructed same way
- introduced mobile selection "box" template with target controller to not have the same form all over again
- added both regular and administrative controller with interface for administrative functionality for mobile providers
- rewrote try-catch block: only the actual method call that throws the checked exception should be included in the try block
- return actual list and not an unmodifiable version
- added templates for list/edit/delete mobile providers (admin area)
- listing of mobile providers should be okay now ("basicly finished")
- renamed variable to make it more clear (mobile provider)
- adding new mobile providers "basicly finished", still some improvements (avoid ugly exception output) may be required
- added a lot new language strings + removed "add_user" from merger

Signed-off-by: Roland Häder <roland@mxchange.org>
19 files changed:
nbproject/faces-config.NavData
src/java/org/mxchange/jjobs/beans/country/JobsAdminCountryWebApplicationBean.java
src/java/org/mxchange/jjobs/beans/country/JobsCountryWebApplicationBean.java
src/java/org/mxchange/jjobs/converter/mobileprovider/JobsMobileProviderConverter.java
src/java/org/mxchange/localization/bundle_de_DE.properties
src/java/org/mxchange/localization/bundle_en_US.properties
src/java/org/mxchange/pizzaapplication/beans/mobileprovider/PizzaAdminMobileProviderWebRequestBean.java [new file with mode: 0644]
src/java/org/mxchange/pizzaapplication/beans/mobileprovider/PizzaAdminMobileProviderWebRequestController.java [new file with mode: 0644]
src/java/org/mxchange/pizzaapplication/beans/mobileprovider/PizzaMobileProviderWebRequestBean.java [new file with mode: 0644]
src/java/org/mxchange/pizzaapplication/beans/mobileprovider/PizzaMobileProviderWebRequestController.java [new file with mode: 0644]
web/WEB-INF/faces-config.xml
web/WEB-INF/templates/admin/admin_form_mobile_provider.tpl [new file with mode: 0644]
web/WEB-INF/templates/admin/admin_form_personal_data.tpl
web/WEB-INF/templates/admin/admin_menu.tpl
web/WEB-INF/templates/generic/form_personal_data.tpl
web/WEB-INF/templates/generic/mobile_selection_box.tpl [new file with mode: 0644]
web/admin/admin_mobile_provider_delete.xhtml [new file with mode: 0644]
web/admin/admin_mobile_provider_edit.xhtml [new file with mode: 0644]
web/admin/admin_mobile_provider_list.xhtml [new file with mode: 0644]

index 4fbac893df3ff30b9b4267dd972b5a8e8a17b912..820dd593326fc4b137160efe4966dd601c3c3bdf 100644 (file)
@@ -2,41 +2,44 @@
 <Scene Scope="Project" version="2">
     <Scope Scope="Faces Configuration Only"/>
     <Scope Scope="Project">
-        <Node id="admin/admin_country_list.xhtml" x="1900" y="150" zoom="true"/>
-        <Node id="admin/admin_user_delete.xhtml" x="900" y="450" zoom="true"/>
-        <Node id="login/login_change_password.xhtml" x="900" y="150" zoom="true"/>
-        <Node id="privacy.xhtml" x="400" y="300" zoom="true"/>
-        <Node id="admin/index.xhtml" x="900" y="750" zoom="true"/>
-        <Node id="login/login_data_saved.xhtml" x="150" y="150" zoom="true"/>
-        <Node id="exception.xhtml" x="400" y="1050" zoom="true"/>
-        <Node id="admin/admin_country_delete.xhtml" x="900" y="600" zoom="true"/>
-        <Node id="user/register.xhtml" x="1400" y="450" zoom="true"/>
-        <Node id="admin/admin_country_edit.xhtml" x="1400" y="300" zoom="true"/>
-        <Node id="login/login_index.xhtml" x="1150" y="600" zoom="true"/>
-        <Node id="login/login_add_addressbook.xhtml" x="650" y="300" zoom="true"/>
-        <Node id="user/resend_link.xhtml" x="650" y="900" zoom="true"/>
-        <Node id="login/login_own_addressbooks.xhtml" x="1150" y="450" zoom="true"/>
-        <Node id="admin/admin_user_list.xhtml" x="650" y="600" zoom="true"/>
-        <Node id="admin/admin_logout.xhtml" x="150" y="750" zoom="true"/>
-        <Node id="terms.xhtml" x="400" y="750" zoom="true"/>
-        <Node id="admin/admin_user_edit.xhtml" x="150" y="900" zoom="true"/>
-        <Node id="admin/admin_user_add.xhtml" x="400" y="900" zoom="true"/>
-        <Node id="user/user_list.xhtml" x="1150" y="300" zoom="true"/>
-        <Node id="index.xhtml" x="1650" y="150" zoom="true"/>
-        <Node id="logout.xhtml" x="400" y="450" zoom="true"/>
-        <Node id="user/register_done.xhtml" x="400" y="600" zoom="true"/>
-        <Node id="user/user_profile.xhtml" x="150" y="600" zoom="true"/>
-        <Node id="login/login_change_personal_data.xhtml" x="1150" y="150" zoom="true"/>
-        <Node id="admin/admin_user_unlock.xhtml" x="150" y="450" zoom="true"/>
-        <Node id="imprint.xhtml" x="400" y="150" zoom="true"/>
-        <Node id="*" x="1650" y="300" zoom="true"/>
-        <Node id="user/show_addressbook.xhtml" x="650" y="150" zoom="true"/>
-        <Node id="user/login_error.xhtml" x="150" y="300" zoom="true"/>
-        <Node id="user/show_addressbook_entries.xhtml" x="150" y="1050" zoom="true"/>
-        <Node id="login/login_change_email_address.xhtml" x="900" y="300" zoom="true"/>
-        <Node id="user/lost_passwd.xhtml" x="650" y="750" zoom="true"/>
-        <Node id="user/login.xhtml" x="650" y="450" zoom="true"/>
-        <Node id="login/login_edit_user_data.xhtml" x="1400" y="150" zoom="true"/>
+        <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_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"/>
     </Scope>
     <Scope Scope="All Faces Configurations"/>
 </Scene>
index b54d3cb4b76ee830a3b137d2b7243ff47c818627..c6f4f684a3795a0d09f14b267d6c7444dff57f90 100644 (file)
@@ -133,19 +133,22 @@ public class JobsAdminCountryWebApplicationBean implements JobsAdminCountryWebAp
                        throw new FaceletException(new CountryAlreadyAddedException(country));
                }
 
+               // Init variable
+               Country updatedCountry = null;
+
                try {
                        // Send country to bean
-                       Country updatedCountry = this.countryBean.addCountry(country);
-
-                       // Fire event
-                       this.addedCountryEvent.fire(new AdminEventCountryAdded(updatedCountry));
-
-                       // Clear bean
-                       this.clear();
+                       updatedCountry = this.countryBean.addCountry(country);
                } catch (final CountryAlreadyAddedException ex) {
                        // Throw again
                        throw new FaceletException(ex);
                }
+
+               // Fire event
+               this.addedCountryEvent.fire(new AdminEventCountryAdded(updatedCountry));
+
+               // Clear bean
+               this.clear();
        }
 
        @Override
index d52d26850cdb201405e0d9bf920d5c63df56a20f..93cd4fdc1afcb82b09d23de62cd45921db4ea6f8 100644 (file)
@@ -17,7 +17,6 @@
 package org.mxchange.jjobs.beans.country;
 
 import java.text.MessageFormat;
-import java.util.Collections;
 import java.util.List;
 import javax.annotation.PostConstruct;
 import javax.enterprise.context.ApplicationScoped;
@@ -94,9 +93,10 @@ public class JobsCountryWebApplicationBean implements JobsCountryWebApplicationC
        }
 
        @Override
+       @SuppressWarnings ("ReturnOfCollectionOrArrayField")
        public List<Country> allCountries () {
                // Return "cached" version
-               return Collections.unmodifiableList(this.countryList);
+               return this.countryList;
        }
 
        /**
index 6cebf1da3984f1a36e4d5ef2a9c56ab6dde9ed3f..536b3cdd62367190004b79d6532ddd4fca9b4bb1 100644 (file)
@@ -46,9 +46,9 @@ public class JobsMobileProviderConverter implements Converter {
        private LoggerBeanLocal loggerBeanLocal;
 
        /**
-        * SMS provider bean
+        * Mobile provider bean
         */
-       private MobileProviderSingletonBeanRemote providerController;
+       private MobileProviderSingletonBeanRemote mobileRemoteBean;
 
        /**
         * Initialization of this converter
@@ -85,7 +85,7 @@ public class JobsMobileProviderConverter implements Converter {
                }
 
                // Get full list
-               List<MobileProvider> providerList = this.providerController.allMobileProvider();
+               List<MobileProvider> providerList = this.mobileRemoteBean.allMobileProvider();
 
                // Init value
                MobileProvider provider = null;
index 17ae1be3057e8e4caf031c942e91645f032971b3..562866542c7cb616f0c6f58426f93dd7fbde10f9 100644 (file)
@@ -292,10 +292,6 @@ EN_US=English (US)
 CONTENT_PAGE_INDEX_PARA1=Text fuer 1. Absatz.
 CONTENT_PAGE_INDEX_PARA2=Text fuer 2. Absatz.
 CONTENT_PAGE_INDEX_PARA3=Text fuer 3. Absatz.
-# @TODO Fix German umlaut!
-LINK_ADMIN_ADD_USER=Benutzeraccount hinzufuegen
-# @TODO Fix German umlaut!
-LINK_ADMIN_ADD_USER_TITLE=Hier koennen Sie einen weiteren Benutzer hinzufuegen.
 LINK_ADMIN_LIST_USER=Benuzteraccounts auflisten
 LINK_ADMIN_LIST_USER_TITLE=Alle bestehenden Benutzeraccounts auflisten.
 LINK_ADMIN_EDIT_USER=Benuzteraccount editieren
@@ -345,7 +341,7 @@ ADMIN_ADD_USER_EMAIL_LEGEND_TITLE=Vergeben Sie hier den Benutzernamen und geben
 ADMIN_ADD_USER_ENTER_USER_NAME=Benutzername (*1):
 ADMIN_ADD_USER_ENTER_EMAIL=Email-Adresse (*2):
 ADMIN_ADD_USER_USER_NAME_NOTICE=*1: Der Benutzername darf nur einmal vorhanden sein, das System prueft dies fuer Sie.
-ADMIN_ADD_USER_PASSWORD_NOTICE=Das Passwort wird dem Benutzer nach Erstellung des Zugangs an die Email-Adresse gesendet.
+ADMIN_ADD_USER_PASSWORD_NOTICE=Lassen Sie beide Passwortfelder leer und es wird ein Passwort per Zufall generiert. Das Passwort wird dem Benutzer nach Erstellung des Zugangs an die Email-Adresse gesendet.
 ADMIN_ADD_USER_EMAIL_ADDRESS_NOTICE=*2: Die Email-Adresse darf nur einmal vorhanden sein.
 ADMIN_ADD_USER_CUSTOMER_NUMBER_NOTICE=Eine Kundennummer wird automatisch beim Erstellen des Accounts erzeugt.
 #@TODO Please fix German umlauts!
@@ -395,5 +391,51 @@ ADMIN_LIST_COUNTRY_DATA_COUNTRY_EXTERNAL_DIAL_PREFIX=Vorwahl ausserorts:
 ADMIN_LIST_COUNTRY_DATA_COUNTRY_NAME=Land:
 #@TODO Please fix German umlauts!
 ADMIN_LINK_EDIT_DELETE_COUNTRY_TITLE=Aendern oder loeschen der Laenderdaten
+#@TODO Please fix German umlauts!
+TABLE_SUMMARY_ADMIN_LIST_COUNTRIES=Listet alle bereits angelegten Laenderdaten auf.
 COUNTRY_GERMANY=Deutschland
 ERROR_TARGET_CONTROLLER_PARAMETER_NOT_SET=Fehler: Der Parameter 'targetController' ist nicht gesetzt.
+ADMIN_MENU_MOBILE_PROVIDER_TITLE=Handyanbieter verwalten
+#@TODO Please fix German umlauts!
+LINK_ADMIN_LIST_MOBILE_PROVIDER_TITLE=Hinzufuegen, auflisten, aendern und loeschen von Handyanbietern.
+PAGE_TITLE_ADMIN_MOBILE_PROVIDER_LIST=Handyanbieter verwalten
+CONTENT_TITLE_ADMIN_MOBILE_PROVIDER_LIST=Verwalten von Handyanbietern:
+#@TODO Please fix German umlauts!
+PAGE_TITLE_ADMIN_MOBILE_PROVIDER_EDIT=Handyanbieter aendern
+#@TODO Please fix German umlauts!
+CONTENT_TITLE_ADMIN_MOBILE_PROVIDER_EDIT=Aendern des Handyanbieters:
+#@TODO Please fix German umlauts!
+PAGE_TITLE_ADMIN_MOBILE_PROVIDER_DELETE=Handyanbieter loeschen
+#@TODO Please fix German umlauts!
+CONTENT_TITLE_ADMIN_MOBILE_PROVIDER_DELETE=Loeschen des Handyanbieters:
+#@TODO Please fix German umlauts!
+ADMIN_ADD_MOBILE_PROVIDER_TITLE=Handyanbieter hinzufuegen
+#@TODO Please fix German umlauts!
+ADMIN_MOBILE_PROVIDER_MINIMUM_NOTICE=Es muessen alle Fehler ausgefuellt werden.
+ADMIN_MOBILE_PROVIDER_LEGEND=Daten des Handyanbieters eingeben:
+ADMIN_MOBILE_PROVIDER_LEGEND_TITLE=Geben Sie hier alle Daten des Handyanbieters ein.
+LINK_ADMIN_LIST_MOBILE_PROVIDER=Verwalten ...
+TABLE_SUMMARY_ADMIN_LIST_MOBILE_PROVIDERS=Listet alle bereits angelegten Handyanbieter auf.
+#@TODO Please fix German umlauts!
+ADMIN_ENTER_MOBILE_PROVIDER_DIAL_PREFIX=Vorwahl des Anbieters (keine fuehrende Null):
+#@TODO Please fix German umlauts!
+ADMIN_ENTER_MOBILE_PROVIDER_PATTERN=Regulaerer Ausdruck fuer Mails:
+ADMIN_ENTER_MOBILE_PROVIDER_NAME=Name des Anbieters:
+#@TODO Please fix German umlauts!
+ADMIN_SELECT_MOBILE_PROVIDER_COUNTRY=Land auswaehlen:
+#@TODO Please fix German umlauts!
+BUTTON_ADMIN_ADD_MOBILE_PROVIDER=Handyanbieter hinzufuegen
+#@TODO Please fix German umlauts!
+ADMIN_ADD_MOBILE_PROVIDER_NOTICES=Hinweise zum Hinzufuegen von Handyanbietern:
+#@TODO Please fix German umlauts!
+ADMIN_ADD_MOBILE_PROVIDER_PATTERN=Der regulaere Ausdruck darf nur ein %s enthalten und dies muss die komplette Handynummer sein. Z.B. %s@smsmail.anbieter.example
+ADMIN_ENTER_MOBILE_PROVIDER_PATTERN_EXAMPLE=(Beispiel: %s@smsmail.anbieter.example)
+ADMIN_LIST_MOBILE_PRROVIDER_ID=Id-Nummer:
+ADMIN_LIST_MOBILE_PRROVIDER_NAME=Name:
+ADMIN_LIST_MOBILE_PRROVIDER_DIAL_PREFIX=Vorwahl:
+ADMIN_LIST_MOBILE_PRROVIDER_COUNTRY=Land:
+ADMIN_LIST_MOBILE_PRROVIDER_ENTRY_CREATED=Erstellt:
+#@TODO Please fix German umlauts!
+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:
index 65bff98d114a3dc13dfbe2c5716f77b8a25b54fe..94f073aa9bb40df6c43ebcbd47b1b100950c34c3 100644 (file)
@@ -266,8 +266,6 @@ EN_US=English (US)
 CONTENT_PAGE_INDEX_PARA1=Text for 1st paragraph.
 CONTENT_PAGE_INDEX_PARA2=Text for 2nd paragraph.
 CONTENT_PAGE_INDEX_PARA3=Text for 3rd paragraph.
-LINK_ADMIN_ADD_USER=Add user account
-LINK_ADMIN_ADD_USER_TITLE=Here you can add a new user account.
 LINK_ADMIN_LIST_USER=List user accounts
 LINK_ADMIN_LIST_USER_TITLE=List all existing user accounts.
 LINK_ADMIN_EDIT_USER=Edit user account
@@ -306,7 +304,7 @@ ADMIN_ADD_USER_EMAIL_LEGEND_TITLE=Enter here a user name and email address.
 ADMIN_ADD_USER_ENTER_USER_NAME=User name (*1):
 ADMIN_ADD_USER_ENTER_EMAIL=Email address (*2):
 ADMIN_ADD_USER_USER_NAME_NOTICE=*1: The user name must be unique which is checked by the system for you.
-ADMIN_ADD_USER_PASSWORD_NOTICE=The password is being sent to the user's email address after creation of the account.
+ADMIN_ADD_USER_PASSWORD_NOTICE=Keep both password fields empty to create a random password. The password is being sent to the user's email address after creation of the account.
 ADMIN_ADD_USER_EMAIL_ADDRESS_NOTICE=*2: The email address must be unique.
 ADMIN_ADD_USER_CUSTOMER_NUMBER_NOTICE=A customer number is being automatically created on creation of the account.
 BUTTON_ADMIN_ADD_USER=Add new user account
@@ -335,5 +333,36 @@ 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:
 ADMIN_LINK_EDIT_DELETE_COUNTRY_TITLE=Edit or delete country
+TABLE_SUMMARY_ADMIN_LIST_COUNTRIES=List of all already added countries.
 COUNTRY_GERMANY=Germany
 ERROR_TARGET_CONTROLLER_PARAMETER_NOT_SET=Error: The parameter 'targetController' is not set.
+ADMIN_MENU_MOBILE_PROVIDER_TITLE=Mobile providers
+LINK_ADMIN_LIST_MOBILE_PROVIDER=Manage ...
+LINK_ADMIN_LIST_MOBILE_PROVIDER_TITLE=Add, list, edit and delete mobile providers.
+PAGE_TITLE_ADMIN_MOBILE_PROVIDER_LIST=Manage mobile providers
+CONTENT_TITLE_ADMIN_MOBILE_PROVIDER_LIST=Manage mobile providers:
+PAGE_TITLE_ADMIN_MOBILE_PROVIDER_EDIT=Edit mobile provider
+ADMIN_ADD_MOBILE_PROVIDER_TITLE=Add mobile provider
+ADMIN_MOBILE_PROVIDER_MINIMUM_NOTICE=All fields must be filled out.
+ADMIN_MOBILE_PROVIDER_LEGEND=Enter data of mobile provider:
+ADMIN_MOBILE_PROVIDER_LEGEND_TITLE=Here you can enter all data of the mobile provider.
+CONTENT_TITLE_ADMIN_MOBILE_PROVIDER_DELETE=Delete mobile provider:
+CONTENT_TITLE_ADMIN_MOBILE_PROVIDER_EDIT=Edit mobile provider:
+PAGE_TITLE_ADMIN_MOBILE_PROVIDER_DELETE=Delete mobile provider
+TABLE_SUMMARY_ADMIN_LIST_MOBILE_PROVIDERS=Lists all already added mobile providers.
+ADMIN_ENTER_MOBILE_PROVIDER_DIAL_PREFIX=Dial prefix of provider (no leading zero):
+ADMIN_ENTER_MOBILE_PROVIDER_PATTERN=Pattern for mails:
+ADMIN_ENTER_MOBILE_PROVIDER_NAME=Name of provider:
+ADMIN_SELECT_MOBILE_PROVIDER_COUNTRY=Choose country:
+BUTTON_ADMIN_ADD_MOBILE_PROVIDER=Add mobile provider
+ADMIN_ADD_MOBILE_PROVIDER_NOTICES=Notices for adding mobile provider:
+ADMIN_ADD_MOBILE_PROVIDER_PATTERN=The pattern should only contain one %s which must be the full mobile number. Example: %s@smsmail.provider.example
+ADMIN_ENTER_MOBILE_PROVIDER_PATTERN_EXAMPLE=(Example: %s@smsmail.provider.example)
+ADMIN_LIST_MOBILE_PRROVIDER_ID=Id number:
+ADMIN_LIST_MOBILE_PRROVIDER_NAME=Name:
+ADMIN_LIST_MOBILE_PRROVIDER_DIAL_PREFIX=Dial prefix:
+ADMIN_LIST_MOBILE_PRROVIDER_COUNTRY=Country:
+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:
diff --git a/src/java/org/mxchange/pizzaapplication/beans/mobileprovider/PizzaAdminMobileProviderWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/mobileprovider/PizzaAdminMobileProviderWebRequestBean.java
new file mode 100644 (file)
index 0000000..02aae75
--- /dev/null
@@ -0,0 +1,233 @@
+/*
+ * Copyright (C) 2016 Roland Haeder
+ *
+ * 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.pizzaapplication.beans.mobileprovider;
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.Objects;
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.event.Event;
+import javax.enterprise.inject.Any;
+import javax.faces.view.facelets.FaceletException;
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import org.mxchange.jcountry.data.Country;
+import org.mxchange.jphone.events.AdminAddedMobileProviderEvent;
+import org.mxchange.jphone.events.AdminMobileProviderAddedEvent;
+import org.mxchange.jphone.exceptions.MobileProviderAlreadyAddedException;
+import org.mxchange.jphone.phonenumbers.mobileprovider.AdminMobileProviderSingletonBeanRemote;
+import org.mxchange.jphone.phonenumbers.mobileprovider.CellphoneProvider;
+import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider;
+
+/**
+ * Administrative bean (controller) for mobile provider
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+@Named ("adminMobileController")
+@RequestScoped
+public class PizzaAdminMobileProviderWebRequestBean implements PizzaAdminMobileProviderWebRequestController {
+
+       /**
+        * Serial number
+        */
+       private static final long serialVersionUID = 184_598_175_371_269_016L;
+
+       /**
+        * Remote EJB for mobile providers (administrative)
+        */
+       private AdminMobileProviderSingletonBeanRemote adminRemoteBean;
+
+       /**
+        * Regular bean
+        */
+       @Inject
+       private PizzaMobileProviderWebRequestController mobileController;
+
+       /**
+        * Event being fired when the mobile provider was added
+        */
+       @Inject
+       @Any
+       private Event<AdminAddedMobileProviderEvent> providerAddedEvent;
+
+       /**
+        * Country instance ('s dial data)
+        */
+       private Country providerCountry;
+
+       /**
+        * Provider dial prefix (example: 0177 for German E+)
+        */
+       private Long providerDialPrefix;
+
+       /**
+        * Pattern for mail gateway
+        */
+       private String providerMailPattern;
+
+       /**
+        * Name of the provider
+        */
+       private String providerName;
+
+       /**
+        * Default constructor
+        */
+       public PizzaAdminMobileProviderWebRequestBean () {
+               // Try it
+               try {
+                       // Get initial context
+                       Context context = new InitialContext();
+
+                       // Try to lookup the beans
+                       this.adminRemoteBean = (AdminMobileProviderSingletonBeanRemote) context.lookup("java:global/PizzaService-ejb/adminmobileprovider!org.mxchange.jphone.phonenumbers.mobileprovider.AdminMobileProviderSingletonBeanRemote"); //NOI18N
+               } catch (final NamingException e) {
+                       // Throw it again
+                       throw new FaceletException(e);
+               }
+       }
+
+       @Override
+       public void addMobileProvider () {
+               // Create mobile provider instance
+               MobileProvider mobileProvider = new CellphoneProvider(this.getProviderDialPrefix(), this.getProviderName(), this.getProviderCountry(), this.getProviderMailPattern());
+
+               // Is the provider already created?
+               if (this.isMobileProviderCreated(mobileProvider)) {
+                       // Then throw exception
+                       throw new FaceletException(new MobileProviderAlreadyAddedException(mobileProvider));
+               }
+
+               // Init variable
+               MobileProvider updatedProvider = null;
+
+               try {
+                       // Call remote EJB and get back an updated instance
+                       updatedProvider = this.adminRemoteBean.addMobileProvider(mobileProvider);
+               } catch (final MobileProviderAlreadyAddedException ex) {
+                       // Throw again
+                       throw new FaceletException(ex);
+               }
+
+               // Fire event
+               this.providerAddedEvent.fire(new AdminMobileProviderAddedEvent(updatedProvider));
+
+               // Clear this bean
+               this.clear();
+       }
+
+       @Override
+       public List<MobileProvider> allMobileProvider () {
+               return this.mobileController.allMobileProvider();
+       }
+
+       @Override
+       public Country getProviderCountry () {
+               return this.providerCountry;
+       }
+
+       @Override
+       public void setProviderCountry (final Country providerCountry) {
+               this.providerCountry = providerCountry;
+       }
+
+       @Override
+       public Long getProviderDialPrefix () {
+               return this.providerDialPrefix;
+       }
+
+       @Override
+       public void setProviderDialPrefix (final Long providerDialPrefix) {
+               this.providerDialPrefix = providerDialPrefix;
+       }
+
+       @Override
+       public String getProviderMailPattern () {
+               return this.providerMailPattern;
+       }
+
+       @Override
+       public void setProviderMailPattern (final String providerMailPattern) {
+               this.providerMailPattern = providerMailPattern;
+       }
+
+       @Override
+       public String getProviderName () {
+               return this.providerName;
+       }
+
+       @Override
+       public void setProviderName (final String providerName) {
+               this.providerName = providerName;
+       }
+
+       @Override
+       public boolean hasMobileProvider () {
+               return (!this.allMobileProvider().isEmpty());
+       }
+
+       /**
+        * Clears this bean
+        */
+       private void clear () {
+               // Clear all fields
+               this.setProviderCountry(null);
+               this.setProviderDialPrefix(null);
+               this.setProviderMailPattern(null);
+               this.setProviderName(null);
+       }
+
+       /**
+        * Checks whether if the given mobile provider is already created by
+        * checking both dial prefix and country.
+        * <p>
+        * @param mobileProvider Mobile provider instance to check
+        * <p>
+        * @return Whether the given mobile provider instance is found
+        */
+       private boolean isMobileProviderCreated (final MobileProvider mobileProvider) {
+               // Default is not found
+               boolean isFound = false;
+
+               // Get list of all providers
+               List<MobileProvider> providers = this.allMobileProvider();
+
+               // Get iterator from it
+               Iterator<MobileProvider> iterator = providers.iterator();
+
+               // Loop through all
+               while (iterator.hasNext()) {
+                       // Get next element
+                       MobileProvider next = iterator.next();
+
+                       // Is the provider's dial prefix and country the same?
+                       if ((Objects.equals(mobileProvider.getProviderDialPrefix(), next.getProviderDialPrefix())) && (Objects.equals(mobileProvider.getProviderCountry(), next.getProviderCountry()))) {
+                               // Is the same, abort loop
+                               isFound = true;
+                               break;
+                       }
+               }
+
+               // Return result
+               return isFound;
+       }
+
+}
diff --git a/src/java/org/mxchange/pizzaapplication/beans/mobileprovider/PizzaAdminMobileProviderWebRequestController.java b/src/java/org/mxchange/pizzaapplication/beans/mobileprovider/PizzaAdminMobileProviderWebRequestController.java
new file mode 100644 (file)
index 0000000..558de55
--- /dev/null
@@ -0,0 +1,109 @@
+/*
+ * Copyright (C) 2016 Roland Haeder
+ *
+ * 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.pizzaapplication.beans.mobileprovider;
+
+import java.io.Serializable;
+import java.util.List;
+import org.mxchange.jcountry.data.Country;
+import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider;
+
+/**
+ * An interface for a request web controller (bean) for administrative mobile
+ * provider purposes.
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+public interface PizzaAdminMobileProviderWebRequestController extends Serializable {
+
+       /**
+        * Adds a mobile provider to database by calling the EJB. A pre-check on
+        * dial-prefix and country combination is done, if found, an exception is
+        * thrown.
+        */
+       void addMobileProvider ();
+
+       /**
+        * Returns a list of all mobile providers
+        * <p>
+        * @return A list of all mobile providers
+        */
+       List<MobileProvider> allMobileProvider ();
+
+       /**
+        * Checks whether mobile providers are registered
+        * <p>
+        * @return Whether mobile providers are registered
+        */
+       boolean hasMobileProvider ();
+
+       /**
+        * Getter for provider dial prefix
+        * <p>
+        * @return Provider dial prefix
+        */
+       Long getProviderDialPrefix ();
+
+       /**
+        * Setter for provider dial prefix
+        * <p>
+        * @param providerDialPrefix Provider dial prefix
+        */
+       void setProviderDialPrefix (final Long providerDialPrefix);
+
+       /**
+        * Getter for provider name
+        * <p>
+        * @return Provider name
+        */
+       String getProviderName ();
+
+       /**
+        * Setter for provider name
+        * <p>
+        * @param providerName Provider name
+        */
+       void setProviderName (final String providerName);
+
+       /**
+        * Getter for country instance ('s dial data)
+        * <p>
+        * @return Country instance
+        */
+       Country getProviderCountry ();
+
+       /**
+        * Setter for country instance ('s dial data)
+        * <p>
+        * @param country Country instance
+        */
+       void setProviderCountry (final Country country);
+
+       /**
+        * Getter for pattern for mail gateway
+        * <p>
+        * @return Pattern for mail gateway
+        */
+       String getProviderMailPattern ();
+
+       /**
+        * Setter for pattern for mail gateway
+        * <p>
+        * @param providerMailRegex Pattern for mail gateway
+        */
+       void setProviderMailPattern (final String providerMailRegex);
+
+}
diff --git a/src/java/org/mxchange/pizzaapplication/beans/mobileprovider/PizzaMobileProviderWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/mobileprovider/PizzaMobileProviderWebRequestBean.java
new file mode 100644 (file)
index 0000000..32656b2
--- /dev/null
@@ -0,0 +1,110 @@
+/*
+ * Copyright (C) 2016 Roland Haeder<roland@mxchange.org>
+ *
+ * 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.pizzaapplication.beans.mobileprovider;
+
+import java.text.MessageFormat;
+import java.util.List;
+import javax.annotation.PostConstruct;
+import javax.enterprise.context.SessionScoped;
+import javax.enterprise.event.Observes;
+import javax.faces.view.facelets.FaceletException;
+import javax.inject.Named;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import org.mxchange.jphone.events.AdminAddedMobileProviderEvent;
+import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider;
+import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProviderSingletonBeanRemote;
+
+/**
+ * A general bean for mobile providers
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+@Named ("mobileController")
+@SessionScoped
+public class PizzaMobileProviderWebRequestBean implements PizzaMobileProviderWebRequestController {
+
+       /**
+        * Serial number
+        */
+       private static final long serialVersionUID = 15_869_423_671_950_276L;
+
+       /**
+        * "Cached" list of mobile providers
+        */
+       private List<MobileProvider> mobileProviders;
+
+       /**
+        * Remote EJB for mobile providers (regular)
+        */
+       private MobileProviderSingletonBeanRemote mobileRemoteBean;
+
+       /**
+        * Default constructor
+        */
+       public PizzaMobileProviderWebRequestBean () {
+               // Try it
+               try {
+                       // Get initial context
+                       Context context = new InitialContext();
+
+                       // Try to lookup the beans
+                       this.mobileRemoteBean = (MobileProviderSingletonBeanRemote) context.lookup("java:global/PizzaService-ejb/mobileprovider!org.mxchange.jphone.phonenumbers.mobileprovider.MobileProviderSingletonBeanRemote"); //NOI18N
+               } catch (final NamingException e) {
+                       // Throw it again
+                       throw new FaceletException(e);
+               }
+       }
+
+       @Override
+       public void afterAdminAddedMobileProvider (@Observes final AdminAddedMobileProviderEvent event) {
+               // Is all valid?
+               if (null == event) {
+                       // Throw NPE
+                       throw new NullPointerException("event is null"); //NOI18N
+               } else if (event.getAddedMobileProvider()== null) {
+                       // Throw again ...
+                       throw new NullPointerException("event.addedMobileProvider is null"); //NOI18N
+               } else if (event.getAddedMobileProvider().getProviderId()== null) {
+                       // And again ...
+                       throw new NullPointerException("event.addedMobileProvider.providerId is null"); //NOI18N
+               } else if (event.getAddedMobileProvider().getProviderId() < 1) {
+                       // Id is invalid
+                       throw new IllegalArgumentException(MessageFormat.format("event.addedMobileProvider.providerId={0} is not valid.", event.getAddedMobileProvider().getProviderId())); //NOI18N
+               }
+
+               // Add it to the list
+               this.mobileProviders.add(event.getAddedMobileProvider());
+       }
+
+       @Override
+       @SuppressWarnings ("ReturnOfCollectionOrArrayField")
+       public List<MobileProvider> allMobileProvider () {
+               return this.mobileProviders;
+       }
+
+       /**
+        * Initializer method
+        */
+       @PostConstruct
+       public void init () {
+               // Init list of mobile providers
+               this.mobileProviders = this.mobileRemoteBean.allMobileProvider();
+       }
+
+}
diff --git a/src/java/org/mxchange/pizzaapplication/beans/mobileprovider/PizzaMobileProviderWebRequestController.java b/src/java/org/mxchange/pizzaapplication/beans/mobileprovider/PizzaMobileProviderWebRequestController.java
new file mode 100644 (file)
index 0000000..ba780e5
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2016 Roland Haeder<roland@mxchange.org>
+ *
+ * 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.pizzaapplication.beans.mobileprovider;
+
+import java.io.Serializable;
+import java.util.List;
+import org.mxchange.jphone.events.AdminAddedMobileProviderEvent;
+import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider;
+
+/**
+ * An interface for general mobile provider controller
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+public interface PizzaMobileProviderWebRequestController extends Serializable {
+
+       /**
+        * Returns a list of all mobile providers
+        * <p>
+        * @return A list of all mobile providers
+        */
+       List<MobileProvider> allMobileProvider ();
+
+       /**
+        * Observes events being fired after the administrator has added a new
+        * mobile provider
+        * <p>
+        * @param event Event being fired
+        */
+       void afterAdminAddedMobileProvider (final AdminAddedMobileProviderEvent event);
+
+}
index e01330bfcce8dcd8444088e0859d74bbac41fe84..423709c87b06b44279963677de8feae426cd8a05 100644 (file)
                        <from-outcome>admin_unlock_user</from-outcome>
                        <to-view-id>/admin/admin_user_unlock.xhtml</to-view-id>
                </navigation-case>
-               <navigation-case>
-                       <from-outcome>admin_add_user</from-outcome>
-                       <to-view-id>/admin/admin_user_add.xhtml</to-view-id>
-               </navigation-case>
                <navigation-case>
                        <from-outcome>admin_list_countries</from-outcome>
                        <to-view-id>/admin/admin_country_list.xhtml</to-view-id>
                </navigation-case>
+               <navigation-case>
+                       <from-outcome>admin_list_mobile_provider</from-outcome>
+                       <to-view-id>/admin/admin_mobile_provider_list.xhtml</to-view-id>
+               </navigation-case>
        </navigation-rule>
        <navigation-rule>
                <from-view-id>/user/register.xhtml</from-view-id>
                </exception-handler-factory>
        </factory>
        //-->
+    <navigation-rule>
+        <from-view-id>/admin/admin_mobile_provider_list.xhtml</from-view-id>
+        <navigation-case>
+            <from-outcome>admin_edit_mobile_provider</from-outcome>
+            <to-view-id>/admin/admin_mobile_provider_edit.xhtml</to-view-id>
+        </navigation-case>
+    </navigation-rule>
 </faces-config>
diff --git a/web/WEB-INF/templates/admin/admin_form_mobile_provider.tpl b/web/WEB-INF/templates/admin/admin_form_mobile_provider.tpl
new file mode 100644 (file)
index 0000000..7d2232c
--- /dev/null
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ui:composition
+       xmlns="http://www.w3.org/1999/xhtml"
+       xmlns:f="http://java.sun.com/jsf/core"
+       xmlns:h="http://java.sun.com/jsf/html"
+       xmlns:ui="http://java.sun.com/jsf/facelets">
+
+       <div class="para notice">
+               #{msg.ADMIN_MOBILE_PROVIDER_MINIMUM_NOTICE}
+       </div>
+
+       <div class="para">
+               <fieldset id="mobile_provider">
+                       <legend title="#{msg.ADMIN_MOBILE_PROVIDER_LEGEND_TITLE}">#{msg.ADMIN_MOBILE_PROVIDER_LEGEND}</legend>
+
+                       <div class="table_row">
+                               <div class="table_left_medium">
+                                       <h:outputLabel for="providerDialPrefix" value="#{msg.ADMIN_ENTER_MOBILE_PROVIDER_DIAL_PREFIX}" />
+                               </div>
+
+                               <div class="table_right_medium">
+                                       <h:inputText class="input" id="providerDialPrefix" size="5" maxlength="20" value="#{adminMobileController.providerDialPrefix}" required="true">
+                                               <f:validateLongRange for="providerDialPrefix" minimum="0" maximum="9999" />
+                                       </h:inputText>
+                               </div>
+
+                               <div class="clear"></div>
+                       </div>
+
+                       <div class="table_row">
+                               <div class="table_left_medium">
+                                       <h:outputLabel for="providerMailRegex" value="#{msg.ADMIN_ENTER_MOBILE_PROVIDER_PATTERN}" />
+                               </div>
+
+                               <div class="table_right_medium">
+                                       <h:inputText class="input" id="providerMailRegex" size="10" maxlength="30" value="#{adminMobileController.providerMailPattern}" required="true" />
+
+                                       <h:outputText class="small notice" value="#{msg.ADMIN_ENTER_MOBILE_PROVIDER_PATTERN_EXAMPLE}" />
+                               </div>
+
+                               <div class="clear"></div>
+                       </div>
+
+                       <div class="table_row">
+                               <div class="table_left_medium">
+                                       <h:outputLabel for="providerName" value="#{msg.ADMIN_ENTER_MOBILE_PROVIDER_NAME}" />
+                               </div>
+
+                               <div class="table_right_medium">
+                                       <h:inputText class="input" id="providerName" size="20" maxlength="100" value="#{adminMobileController.providerName}" required="true" />
+                               </div>
+
+                               <div class="clear"></div>
+                       </div>
+
+                       <div class="table_row">
+                               <div class="table_left_medium">
+                                       <h:outputLabel for="providerCountry" value="#{msg.ADMIN_SELECT_MOBILE_PROVIDER_COUNTRY}" />
+                               </div>
+
+                               <div class="table_right_medium">
+                                       <h:selectOneMenu class="select" id="providerCountry" value="#{adminMobileController.providerCountry}" converter="country">
+                                               <f:selectItems value="#{countryController.allCountries()}" var="c" itemValue="#{c}" itemLabel="#{c.countryCode} (#{msg[c.countryI18nkey]})" />
+                                       </h:selectOneMenu>
+                               </div>
+
+                               <div class="clear"></div>
+                       </div>
+               </fieldset>
+       </div>
+</ui:composition>
index 3f98abadf73de1dc8bf2ff6f3d84127f73f97702..87d709e30c88d3de49ba6317b527a993df0739c7 100644 (file)
                                </div>
 
                                <div class="table_right">
-                                       <h:selectOneMenu class="select" id="cellphoneCarrier" value="#{adminUserController.cellphoneCarrier}" converter="CellphoneCarrierConverter">
-                                               <f:selectItem itemValue="" itemLabel="#{msg.NONE_SELECTED}" />
-                                               <f:selectItems value="#{cellphone.allSmsProvider()}" var="p" itemValue="#{p}" itemLabel="#{p.providerCountry.countryExternalDialPrefix}#{p.providerDialPrefix} (#{p.providerName})" />
-                                       </h:selectOneMenu>
-
-                                       <h:inputText class="input" id="cellphoneNumber" size="10" maxlength="20" value="#{adminUserController.cellphoneNumber}">
-                                               <f:validator for="cellphoneNumber" validatorId="PhoneNumberValidator" />
-                                       </h:inputText>
+                                       <ui:include src="/WEB-INF/templates/generic/mobile_selection_box.tpl">
+                                               <ui:param name="targetController" value="#{adminUserController}" />
+                                       </ui:include>
                                </div>
 
                                <div class="clear"></div>
 
                        <div class="para"></div>
 
+                       <div class="table_row">
+                               <div class="table_left">
+                                       <h:outputLabel for="password1" value="#{msg.ADMIN_ADD_USER_ENTER_PASSWORD1}" />
+                               </div>
+
+                               <div class="table_right">
+                                       <h:inputSecret class="input" id="password1" size="10" maxlength="255" value="#{adminUserController.userPassword}" required="true" />
+                               </div>
+
+                               <div class="clear"></div>
+                       </div>
+
+                       <div class="table_row">
+                               <div class="table_left">
+                                       <h:outputLabel for="password2" value="#{msg.ADMIN_ADD_USER_ENTER_PASSWORD2}" />
+                               </div>
+
+                               <div class="table_right">
+                                       <h:inputSecret class="input" id="password2" size="10" maxlength="255" value="#{adminUserController.userPasswordRepeat}" required="true" />
+                               </div>
+
+                               <div class="clear"></div>
+                       </div>
+
                        <div class="para notice">
                                <ul>
                                        <li>#{msg.ADMIN_ADD_USER_USER_NAME_NOTICE}</li>
index 0463ea64b35abcbd2a5c685b8e4760c8fde13839..60095a667138e16d191b40db406773a313419aa6 100644 (file)
@@ -19,7 +19,6 @@
                        </div>
 
                        <ul>
-                               <li><h:link title="#{msg.LINK_ADMIN_ADD_USER_TITLE}" outcome="admin_add_user" value="#{msg.LINK_ADMIN_ADD_USER}" /></li>
                                <li><h:link title="#{msg.LINK_ADMIN_LIST_USER_TITLE}" outcome="admin_list_user" value="#{msg.LINK_ADMIN_LIST_USER}" /></li>
                                <li><h:link title="#{msg.LINK_ADMIN_EDIT_USER_TITLE}" outcome="admin_edit_user" value="#{msg.LINK_ADMIN_EDIT_USER}" /></li>
                                <li><h:link title="#{msg.LINK_ADMIN_DELETE_USER_TITLE}" outcome="admin_delete_user" value="#{msg.LINK_ADMIN_DELETE_USER}" /></li>
                                <li><h:link title="#{msg.LINK_ADMIN_LIST_COUNTRIES_TITLE}" outcome="admin_list_countries" value="#{msg.LINK_ADMIN_LIST_COUNTRIES}" /></li>
                        </ul>
 
+                       <div class="menu_header">
+                               #{msg.ADMIN_MENU_MOBILE_PROVIDER_TITLE}
+                       </div>
+
+                       <ul>
+                               <li><h:link title="#{msg.LINK_ADMIN_LIST_MOBILE_PROVIDER_TITLE}" outcome="admin_list_mobile_provider" value="#{msg.LINK_ADMIN_LIST_MOBILE_PROVIDER}" /></li>
+                       </ul>
+
                        <div class="menu_header">
                                #{msg.ADMIN_MENU_LOGOUT_TITLE}
                        </div>
index f5f1fcdc3451ce76c154c7b6d7520d498be9958f..8771740a6ccf6e8763fd6bce663b26fd078edd59 100644 (file)
                                </div>
 
                                <div class="table_right">
-                                       <h:selectOneMenu class="select" id="cellphoneCarrier" value="#{userController.cellphoneCarrier}" converter="cellphoneCarrier">
-                                               <f:selectItem itemValue="" itemLabel="#{msg.NONE_SELECTED}" />
-                                               <f:selectItems value="#{cellphone.allSmsProvider()}" var="p" itemValue="#{p}" itemLabel="#{p.providerCountry.countryExternalDialPrefix}#{p.providerDialPrefix} (#{p.providerName})" />
-                                       </h:selectOneMenu>
-
-                                       <h:inputText class="input" id="cellphoneNumber" size="10" maxlength="20" value="#{userController.cellphoneNumber}">
-                                               <f:validator for="cellphoneNumber" validatorId="PhoneNumberValidator" />
-                                       </h:inputText>
+                                       <ui:include src="/WEB-INF/templates/generic/mobile_selection_box.tpl">
+                                               <ui:param name="targetController" value="#{userController}" />
+                                       </ui:include>
                                </div>
 
                                <div class="clear"></div>
diff --git a/web/WEB-INF/templates/generic/mobile_selection_box.tpl b/web/WEB-INF/templates/generic/mobile_selection_box.tpl
new file mode 100644 (file)
index 0000000..3852130
--- /dev/null
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ui:composition
+       xmlns="http://www.w3.org/1999/xhtml"
+       xmlns:f="http://java.sun.com/jsf/core"
+       xmlns:h="http://java.sun.com/jsf/html"
+       xmlns:ui="http://java.sun.com/jsf/facelets">
+
+       <ui:fragment rendered="#{not empty targetController}">
+               <h:selectOneMenu class="select" id="cellphoneCarrier" value="#{targetController.cellphoneCarrier}" converter="MobileProviderConverter">
+                       <f:selectItem itemValue="" itemLabel="#{msg.NONE_SELECTED}" />
+                       <f:selectItems value="#{mobileController.allMobileProvider()}" var="p" itemValue="#{p}" itemLabel="#{p.providerCountry.countryExternalDialPrefix}#{p.providerDialPrefix} (#{p.providerName})" />
+               </h:selectOneMenu>
+
+               <h:inputText class="input" id="cellphoneNumber" size="10" maxlength="20" value="#{targetController.cellphoneNumber}">
+                       <f:validator for="cellphoneNumber" validatorId="PhoneNumberValidator" />
+               </h:inputText>
+       </ui:fragment>
+
+       <ui:fragment rendered="#{empty targetController}">
+               <h:outputText class="errors" value="#{msg.ERROR_TARGET_CONTROLLER_PARAMETER_NOT_SET}" />
+       </ui:fragment>
+</ui:composition>
diff --git a/web/admin/admin_mobile_provider_delete.xhtml b/web/admin/admin_mobile_provider_delete.xhtml
new file mode 100644 (file)
index 0000000..25ac615
--- /dev/null
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+         xmlns:ui="http://java.sun.com/jsf/facelets"
+         xmlns:h="http://xmlns.jcp.org/jsf/html"
+         xmlns:f="http://xmlns.jcp.org/jsf/core"
+         >
+
+       <ui:composition template="/WEB-INF/templates/admin/admin_base.tpl">
+               <ui:define name="admin_title">#{msg.PAGE_TITLE_ADMIN_MOBILE_PROVIDER_DELETE}</ui:define>
+
+               <ui:define name="content_header">
+                       #{msg.CONTENT_TITLE_ADMIN_MOBILE_PROVIDER_DELETE}
+               </ui:define>
+
+               <ui:define name="content">
+                       Here goes your content.
+               </ui:define>
+       </ui:composition>
+</html>
diff --git a/web/admin/admin_mobile_provider_edit.xhtml b/web/admin/admin_mobile_provider_edit.xhtml
new file mode 100644 (file)
index 0000000..f7c3658
--- /dev/null
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+         xmlns:ui="http://java.sun.com/jsf/facelets"
+         xmlns:h="http://xmlns.jcp.org/jsf/html"
+         xmlns:f="http://xmlns.jcp.org/jsf/core"
+         >
+
+       <ui:composition template="/WEB-INF/templates/admin/admin_base.tpl">
+               <ui:define name="admin_title">#{msg.PAGE_TITLE_ADMIN_MOBILE_PROVIDER_EDIT}</ui:define>
+
+               <ui:define name="content_header">
+                       #{msg.CONTENT_TITLE_ADMIN_MOBILE_PROVIDER_EDIT}
+               </ui:define>
+
+               <ui:define name="content">
+                       Here goes your content.
+               </ui:define>
+       </ui:composition>
+</html>
diff --git a/web/admin/admin_mobile_provider_list.xhtml b/web/admin/admin_mobile_provider_list.xhtml
new file mode 100644 (file)
index 0000000..214e5f4
--- /dev/null
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+         xmlns:ui="http://java.sun.com/jsf/facelets"
+         xmlns:h="http://xmlns.jcp.org/jsf/html"
+         xmlns:f="http://xmlns.jcp.org/jsf/core"
+         >
+
+       <ui:composition template="/WEB-INF/templates/admin/admin_base.tpl">
+               <ui:define name="admin_title">#{msg.PAGE_TITLE_ADMIN_MOBILE_PROVIDER_LIST}</ui:define>
+
+               <ui:define name="content_header">
+                       #{msg.CONTENT_TITLE_ADMIN_MOBILE_PROVIDER_LIST}
+               </ui:define>
+
+               <ui:define name="content">
+                       <h:dataTable id="table_list_mobile" var="mobile" value="#{adminMobileController.allMobileProvider()}" styleClass="table_medium" headerClass="table_header_column" summary="#{msg.TABLE_SUMMARY_ADMIN_LIST_MOBILE_PROVIDERS}" rendered="#{adminMobileController.hasMobileProvider()}">
+                               <h:column>
+                                       <f:facet name="header">#{msg.ADMIN_LIST_MOBILE_PRROVIDER_ID}</f:facet>
+
+                                       <h:link outcome="admin_edit_mobile_provider" title="#{msg.ADMIN_LINK_EDIT_DELETE_MOBILE_PROVIDER_TITLE}" value="#{mobile.providerId}">
+                                               <f:param name="providerId" value="#{mobile.providerId}" />
+                                       </h:link>
+                               </h:column>
+
+                               <h:column>
+                                       <f:facet name="header">#{msg.ADMIN_LIST_MOBILE_PRROVIDER_NAME}</f:facet>
+
+                                       <h:outputText value="#{mobile.providerName}" />
+                               </h:column>
+
+                               <h:column>
+                                       <f:facet name="header">#{msg.ADMIN_LIST_MOBILE_PRROVIDER_DIAL_PREFIX}</f:facet>
+
+                                       <h:outputText value="#{mobile.providerDialPrefix}" />
+                               </h:column>
+
+                               <h:column>
+                                       <f:facet name="header">#{msg.ADMIN_LIST_MOBILE_PRROVIDER_COUNTRY}</f:facet>
+
+                                       <h:outputText value="#{msg[mobile.providerCountry.countryI18nkey]}" />
+                               </h:column>
+
+                               <h:column>
+                                       <f:facet name="header">#{msg.ADMIN_LIST_MOBILE_PRROVIDER_ENTRY_CREATED}</f:facet>
+
+                                       <h:outputText id="providerEntryCreated" value="#{mobile.providerEntryCreated.time}" title="#{msg.ADMIN_MOBILE_PROVIDER_ENTRY_CREATED_TITLE}">
+                                               <f:convertDateTime for="providerEntryCreated" type="both" timeStyle="short" dateStyle="short" />
+                                       </h:outputText>
+                               </h:column>
+                       </h:dataTable>
+
+                       <h:form id="add_provider">
+                               <div class="table_medium">
+                                       <div class="table_header">
+                                               #{msg.ADMIN_ADD_MOBILE_PROVIDER_TITLE}
+                                       </div>
+
+                                       <ui:include src="/WEB-INF/templates/admin/admin_form_mobile_provider.tpl" />
+
+                                       <div class="table_footer">
+                                               <h:commandButton class="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
+                                               <h:commandButton class="submit" type="submit" id="register" value="#{msg.BUTTON_ADMIN_ADD_MOBILE_PROVIDER}" action="#{adminMobileController.addMobileProvider()}" />
+                                       </div>
+                               </div>
+
+                               <div class="para notice">
+                                       #{msg.ADMIN_ADD_MOBILE_PROVIDER_NOTICES}
+                                       <ul>
+                                               <li>#{msg.ADMIN_ADD_MOBILE_PROVIDER_PATTERN}</li>
+                                       </ul>
+                               </div>
+                       </h:form>
+               </ui:define>
+       </ui:composition>
+</html>