<copyfiles files="${file.reference.jcoreee.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.jcore-logger-lib.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.jcontacts-core.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.jcontacts-business-core.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.jcontacts-lib.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.jcoreee.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.jcore-logger-lib.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.jcontacts-core.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.jcontacts-business-core.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.jcontacts-lib.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=b91929ff
-nbproject/build-impl.xml.script.CRC32=b3fbd4a7
+nbproject/build-impl.xml.data.CRC32=794ded5f
+nbproject/build-impl.xml.script.CRC32=e6d84652
nbproject/build-impl.xml.stylesheet.CRC32=99ea4b56@1.68.1.1
file.reference.jcore.jar=lib/jcore.jar
file.reference.jcoreee.jar=lib/jcoreee.jar
file.reference.jcountry-core.jar=lib/jcountry-core.jar
-file.reference.jcountry-lib.jar=lib/jcountry-lib.jar
file.reference.jphone-core.jar=lib/jphone-core.jar
file.reference.juser-core.jar=lib/juser-core.jar
file.reference.juser-lib.jar=lib/juser-lib.jar
${file.reference.jcoreee.jar}:\
${file.reference.jcore-logger-lib.jar}:\
${file.reference.jcountry-core.jar}:\
- ${file.reference.jcountry-lib.jar}:\
${file.reference.jcontacts-core.jar}:\
${file.reference.jcontacts-business-core.jar}:\
${file.reference.jcontacts-lib.jar}:\
source.reference.jcore.jar=../jcore/src/
source.reference.jcoreee.jar=../jcoreee/src/
source.reference.jcountry-core.jar=../jcountry-core/src/
-source.reference.jcountry-lib.jar=../jcountry-lib/src/
source.reference.jphone-core.jar=../jphone-core/src/
source.reference.juser-core.jar=../juser-core/src/
source.reference.juser-lib.jar=../juser-lib/src/
<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.jcontacts-core.jar}</file>
<path-in-war>WEB-INF/lib</path-in-war>
/*
* 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 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.
+ * 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/>.
+ * 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.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.AddressbookCountrySingletonBeanRemote;
import org.mxchange.jcountry.data.Country;
/**
*/
private static final long serialVersionUID = 176_985_298_681_742_960L;
+ /**
+ * Remote country EJB
+ */
+ private AddressbookCountrySingletonBeanRemote 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 = (AddressbookCountrySingletonBeanRemote) context.lookup("ejb/singleton-country");
+ } catch (final NamingException ex) {
+ // Continue to throw
+ throw new FaceletException(ex);
+ }
}
@Override
public Country[] allCountries () {
- throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
+ // Return "cached" version
+ return (Country[]) this.countryList.toArray();
+ }
+
+ @PostConstruct
+ public void init () {
+ this.countryList = this.countryBean.allCountries();
}
}
@Override
public List<Gender> getSelectableGenders () {
// Init array
- // TODO Call EJB here?
List<Gender> genders = GenderUtils.selectableGenders();
// Return it