]> git.mxchange.org Git - addressbook-war.git/commitdiff
Initial creation of first addressbook bean (controller) added JSF tag for handling...
authorRoland Haeder <roland@mxchange.org>
Fri, 9 Oct 2015 08:02:19 +0000 (10:02 +0200)
committerRoland Haeder <roland@mxchange.org>
Fri, 9 Oct 2015 08:02:19 +0000 (10:02 +0200)
Signed-off-by:Roland Häder <roland@mxchange.org>

lib/jcontacts-lib.jar
src/java/org/mxchange/addressbook/beans/addressbook/AddressbookWebBean.java [new file with mode: 0644]
src/java/org/mxchange/addressbook/beans/addressbook/AddressbookWebController.java [new file with mode: 0644]
src/java/org/mxchange/localization/bundle_de_DE.properties
src/java/org/mxchange/localization/bundle_en_US.properties
web/login/login_own_addressbooks.xhtml

index 378afb049db7f9401e104eff50d88c82acef2e67..c0031977e59005cec6fc99a66adf6670bf0cb737 100644 (file)
Binary files a/lib/jcontacts-lib.jar and b/lib/jcontacts-lib.jar differ
diff --git a/src/java/org/mxchange/addressbook/beans/addressbook/AddressbookWebBean.java b/src/java/org/mxchange/addressbook/beans/addressbook/AddressbookWebBean.java
new file mode 100644 (file)
index 0000000..c14ef08
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+ * 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/>.
+ */
+package org.mxchange.addressbook.beans.addressbook;
+
+import javax.ejb.EJB;
+import javax.enterprise.context.SessionScoped;
+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.addressbook.beans.login.UserLoginWebController;
+import org.mxchange.addressbook.model.addressbooks.AddressbookSessionBeanRemote;
+
+/**
+ * A user bean (controller)
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+@Named ("addressbookController")
+@SessionScoped
+public class AddressbookWebBean implements AddressbookWebController {
+
+       /**
+        * Serial number
+        */
+       private static final long serialVersionUID = 185_781_756_712_969L;
+
+       /////////////////////// Properties /////////////////////
+
+       /**
+        * Remote addressbook bean
+        */
+       private final AddressbookSessionBeanRemote addressbookBean;
+
+       /**
+        * Login controller
+        */
+       @EJB
+       private UserLoginWebController loginController;
+
+       /**
+        * Default constructor
+        */
+       public AddressbookWebBean () {
+               // Try it
+               try {
+                       // Get initial context
+                       Context context = new InitialContext();
+
+                       // Try to lookup
+                       this.addressbookBean = (AddressbookSessionBeanRemote) context.lookup("ejb/stateless-addressbook"); //NOI18N
+               } catch (final NamingException e) {
+                       // Throw again
+                       throw new FaceletException(e);
+               }
+       }
+}
diff --git a/src/java/org/mxchange/addressbook/beans/addressbook/AddressbookWebController.java b/src/java/org/mxchange/addressbook/beans/addressbook/AddressbookWebController.java
new file mode 100644 (file)
index 0000000..d041136
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ * 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/>.
+ */
+package org.mxchange.addressbook.beans.addressbook;
+
+import java.io.Serializable;
+
+/**
+ * An interface for user beans
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+public interface AddressbookWebController extends Serializable {
+}
index 155cc221b6521d26c55bbc6fc9c385f8d345129d..a1127e95ccc71b84b199566aa9abec6c952c90d3 100644 (file)
@@ -156,3 +156,5 @@ GUEST_YES_READ_TERMS_CONDITIONS_1=Ja, ich habe die
 GUEST_YES_READ_TERMS_CONDITIONS_2=gelesen und verstanden und nehme sie hiermit an.
 TERMS_CONDITIONS=Allgemeine Gesch\u00e4ftsbestimmungen
 PAGE_TITLE_LOGIN_AREA=Benuzterbereich
+TABLE_HEADER_LIST_OWN_ADDRESSBOOKS=Meine eigenen Adressb\u00fccher:
+TABLE_SUMMARY_LIST_OWN_ADDRESSBOOKS=Diese Tabelle listet alle von Ihnen angelegten Adressb\u00fccher sortiert nach Id-Nummer auf.
index f01d2fd814e992449d411de6c11db1f6e7fc71e8..9a1a80713c9a52934864dc58d37d6b32c9bcb210 100644 (file)
@@ -156,3 +156,5 @@ GUEST_YES_READ_TERMS_CONDITIONS_1=Yes, I have read and understand the
 GUEST_YES_READ_TERMS_CONDITIONS_2=and I accept them with this.
 TERMS_CONDITIONS=Terms & Conditions
 PAGE_TITLE_LOGIN_AREA=User area
+TABLE_HEADER_LIST_OWN_ADDRESSBOOKS=My own address books:
+TABLE_SUMMARY_LIST_OWN_ADDRESSBOOKS=This table lists all of your created address books sorted by id nummer.
index 1a122103bcbb5dde176ab7afce5baa6c9f269e45..7f2e124222eee724f38d722965f7bf7c7a6e1719 100644 (file)
                </ui:define>
 
                <ui:define name="content">
-                       Here goes your content.
+                       <div class="table_header">
+                               #{msg.TABLE_HEADER_LIST_OWN_ADDRESSBOOKS}
+                       </div>
+
+                       <h:dataTable id="table_own_addressbooks" var="addressbook" value="#{addressbookController.allAddressbooks}" styleClass="table" summary="#{msg.TABLE_SUMMARY_LIST_OWN_ADDRESSBOOKS}" rendered="#{addressbookController.hasCreatedAddressbooks()}">
+                       </h:dataTable>
                </ui:define>
        </ui:composition>
 </html>