<copyfiles files="${file.reference.jcore-logger-lib.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.jcoreee.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.jcountry-core.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
+ <copyfiles files="${file.reference.jcountry-lib.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.jphone-core.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.jcontacts-core.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.jshop-core.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.jcore-logger-lib.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.jcoreee.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.jcountry-core.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
+ <copyfiles files="${file.reference.jcountry-lib.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.jphone-core.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.jcontacts-core.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.jshop-core.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
build.xml.stylesheet.CRC32=651128d4@1.68.1.1
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
-nbproject/build-impl.xml.data.CRC32=2f309951
-nbproject/build-impl.xml.script.CRC32=fc9d2f6b
+nbproject/build-impl.xml.data.CRC32=3d4ee603
+nbproject/build-impl.xml.script.CRC32=1aff867f
nbproject/build-impl.xml.stylesheet.CRC32=99ea4b56@1.68.1.1
<file>${file.reference.jcountry-core.jar}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
+ <library dirs="200">
+ <file>${file.reference.jcountry-lib.jar}</file>
+ <path-in-war>WEB-INF/lib</path-in-war>
+ </library>
<library dirs="200">
<file>${file.reference.jphone-core.jar}</file>
<path-in-war>WEB-INF/lib</path-in-war>
--- /dev/null
+package org.mxchange.pizzaapplication.beans.country;
+
+/*
+ * Copyright (C) 2015 Roland Haeder
+ *
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU 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 General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+import java.util.Collections;
+import java.util.List;
+import javax.annotation.PostConstruct;
+import javax.enterprise.context.ApplicationScoped;
+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.jcountry.data.Country;
+import org.mxchange.jcountry.data.CountrySingletonBeanRemote;
+
+/**
+ * A country bean
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+@Named ("country")
+@ApplicationScoped
+public class CountryWebBean implements CountryWebController {
+
+ /**
+ * Serial number
+ */
+ private static final long serialVersionUID = 176_985_298_681_742_960L;
+
+ /**
+ * Remote country EJB
+ */
+ private final CountrySingletonBeanRemote countryBean;
+
+ /**
+ * List of all countries
+ */
+ private List<Country> countryList;
+
+ /**
+ * Default constructor
+ */
+ public CountryWebBean () {
+ // Try this
+ try {
+ // Get initial context
+ Context context = new InitialContext();
+
+ // Try to lookup the bean
+ this.countryBean = (CountrySingletonBeanRemote) context.lookup("ejb/addressbook-singleton-country"); //NOI18N
+ } catch (final NamingException ex) {
+ // Continue to throw
+ throw new FaceletException(ex);
+ }
+ }
+
+ @Override
+ public List<Country> allCountries () {
+ // Return "cached" version
+ return Collections.unmodifiableList(this.countryList);
+ }
+
+ @PostConstruct
+ public void init () {
+ this.countryList = this.countryBean.allCountries();
+ }
+}
--- /dev/null
+package org.mxchange.pizzaapplication.beans.country;
+
+/*
+ * Copyright (C) 2015 Roland Haeder
+ *
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU 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 General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+import java.io.Serializable;
+import java.util.List;
+import org.mxchange.jcountry.data.Country;
+
+/**
+ * An interface for country beans
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+public interface CountryWebController extends Serializable {
+
+ /**
+ * A list of all countries
+ * <p>
+ * @return All countries
+ */
+ public List<Country> allCountries ();
+}
<div class="clear"></div>
</div>
+ <div class="table_row">
+ <div class="table_left">
+ <h:outputLabel for="country" value="#{msg.PERSONAL_DATA_COUNTRY_CODE}" />
+ </div>
+
+ <div class="table_right">
+ <h:selectOneMenu class="select" id="country" value="#{userController.country}">
+ <f:selectItems value="#{country.allCountries()}" var="c" itemValue="#{c}" itemLabel="#{msg[c.countryI18nkey]}" />
+ </h:selectOneMenu>
+ </div>
+
+ <div class="clear"></div>
+ </div>
+
<div class="table_row">
<div class="table_left">
<h:outputLabel for="phoneNumber" value="#{msg.PERSONAL_DATA_PHONE_NUMBER}" />