From 119f7aa62b9beb389f7985afe095788f92df4b28 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Fri, 9 Oct 2015 10:02:19 +0200 Subject: [PATCH] =?utf8?q?Initial=20creation=20of=20first=20addressbook=20?= =?utf8?q?bean=20(controller)=20added=20JSF=20tag=20for=20handling=20user'?= =?utf8?q?s=20own=20address=20books=20Signed-off-by:Roland=20H=C3=A4der=20?= =?utf8?q??= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- lib/jcontacts-lib.jar | Bin 372 -> 363 bytes .../beans/addressbook/AddressbookWebBean.java | 72 ++++++++++++++++++ .../addressbook/AddressbookWebController.java | 27 +++++++ .../localization/bundle_de_DE.properties | 2 + .../localization/bundle_en_US.properties | 2 + web/login/login_own_addressbooks.xhtml | 7 +- 6 files changed, 109 insertions(+), 1 deletion(-) create mode 100644 src/java/org/mxchange/addressbook/beans/addressbook/AddressbookWebBean.java create mode 100644 src/java/org/mxchange/addressbook/beans/addressbook/AddressbookWebController.java diff --git a/lib/jcontacts-lib.jar b/lib/jcontacts-lib.jar index 378afb049db7f9401e104eff50d88c82acef2e67..c0031977e59005cec6fc99a66adf6670bf0cb737 100644 GIT binary patch delta 137 zcmeyu^qPq`z?+$ci-CcIf#HC!=R{r&)4jf)?uSLv=cY3-Fo3WK5c;}?IO=-(x#{~l z`gyv!28ZbRx-l{cfaQTo7}6(ZS&5tQayb{JCYGe8=sHzeDH!UR>lwtGnNK{T$qX|3 Tg9R^&(UVOXE!l2>bTa?|$IT(h delta 130 zcmaFO^o5Bxz?+$ci-CcIfnjH#$3$KY;T?S*?zWpW9u+V!Fo3WKgUDnDMp0fy1_3Z1 zD8x`OG0RH9jF-!~C^fMpHAUB{(n`Tl&qB{2-poulGp{7IC@(Q*;%-f5keSadcu~xp Ntix!@_7G$Y0{|!DA_4#a 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 index 00000000..c14ef081 --- /dev/null +++ b/src/java/org/mxchange/addressbook/beans/addressbook/AddressbookWebBean.java @@ -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 . + */ +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) + *

+ * @author Roland Haeder + */ +@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 index 00000000..d041136d --- /dev/null +++ b/src/java/org/mxchange/addressbook/beans/addressbook/AddressbookWebController.java @@ -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 . + */ +package org.mxchange.addressbook.beans.addressbook; + +import java.io.Serializable; + +/** + * An interface for user beans + *

+ * @author Roland Haeder + */ +public interface AddressbookWebController extends Serializable { +} diff --git a/src/java/org/mxchange/localization/bundle_de_DE.properties b/src/java/org/mxchange/localization/bundle_de_DE.properties index 155cc221..a1127e95 100644 --- a/src/java/org/mxchange/localization/bundle_de_DE.properties +++ b/src/java/org/mxchange/localization/bundle_de_DE.properties @@ -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. diff --git a/src/java/org/mxchange/localization/bundle_en_US.properties b/src/java/org/mxchange/localization/bundle_en_US.properties index f01d2fd8..9a1a8071 100644 --- a/src/java/org/mxchange/localization/bundle_en_US.properties +++ b/src/java/org/mxchange/localization/bundle_en_US.properties @@ -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. diff --git a/web/login/login_own_addressbooks.xhtml b/web/login/login_own_addressbooks.xhtml index 1a122103..7f2e1242 100644 --- a/web/login/login_own_addressbooks.xhtml +++ b/web/login/login_own_addressbooks.xhtml @@ -14,7 +14,12 @@ - Here goes your content. +

+ #{msg.TABLE_HEADER_LIST_OWN_ADDRESSBOOKS} +
+ + + -- 2.39.5