]> git.mxchange.org Git - addressbook-war.git/commitdiff
Continued:
authorRoland Haeder <roland@mxchange.org>
Sun, 11 Oct 2015 19:57:34 +0000 (21:57 +0200)
committerRoland Haeder <roland@mxchange.org>
Sun, 11 Oct 2015 19:57:34 +0000 (21:57 +0200)
- removed jcountry-lib as this is not working
- implemented method to get all countries

lib/jcountry-lib.jar [deleted file]
nbproject/build-impl.xml
nbproject/genfiles.properties
nbproject/project.properties
nbproject/project.xml
src/java/org/mxchange/addressbook/beans/country/CountryWebBean.java
src/java/org/mxchange/addressbook/beans/gender/GenderWebBean.java

diff --git a/lib/jcountry-lib.jar b/lib/jcountry-lib.jar
deleted file mode 100644 (file)
index 7f61f69..0000000
Binary files a/lib/jcountry-lib.jar and /dev/null differ
index 3afa43c826901bc69a1ccb1d2f867d6c57f0736b..3240e9692b48ecf251fb4d1953eaf72117657fca 100644 (file)
@@ -1034,7 +1034,6 @@ exists or setup the property manually. For example like this:
         <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"/>
@@ -1052,7 +1051,6 @@ exists or setup the property manually. For example like this:
         <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"/>
index 61bd5aed6a2c69f869b7f413a0d09cf4f8389546..bddbeed8802ffb1ae2e25e11072fa0d39f85aca3 100644 (file)
@@ -3,6 +3,6 @@ build.xml.script.CRC32=be5f34f7
 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
index f0edbd561f5b0bf06c23e18a5ee000500bd44ef8..73110f8a8491792b2bd9a302dc2fda858727404b 100644 (file)
@@ -44,7 +44,6 @@ file.reference.jcore-logger-lib.jar=lib/jcore-logger-lib.jar
 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
@@ -66,7 +65,6 @@ javac.classpath=\
     ${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}:\
@@ -122,7 +120,6 @@ source.reference.jcore-logger-lib.jar=../jcore-logger-lib/src/
 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/
index a34b45f14b4afe55eb3bcd1293a459cf534c5a5e..75f2f1bb8d12c3b6cfad86a16bdbda570ddeda94 100644 (file)
                     <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>
index 158abc05d39a223e9fc524a0d1fc61aacfc18a6c..2657c3bf24ced1a11c57e182f5650c7f53bb2339 100644 (file)
@@ -3,23 +3,28 @@ package org.mxchange.addressbook.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 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;
 
 /**
@@ -36,14 +41,41 @@ public class CountryWebBean implements CountryWebController {
         */
        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();
        }
 }
index f35f460387043c35568473a0f73cc9b279a6faa6..a315d4a8ccb88388953c98794638eb818339d30a 100644 (file)
@@ -51,7 +51,6 @@ public class GenderWebBean implements GenderWebController {
        @Override
        public List<Gender> getSelectableGenders () {
                // Init array
-               // TODO Call EJB here?
                List<Gender> genders = GenderUtils.selectableGenders();
 
                // Return it