From: Roland Haeder Date: Fri, 9 Oct 2015 08:02:19 +0000 (+0200) Subject: Initial creation of first addressbook bean (controller) added JSF tag for handling... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=119f7aa62b9beb389f7985afe095788f92df4b28;p=jfinancials-war.git Initial creation of first addressbook bean (controller) added JSF tag for handling user's own address books Signed-off-by:Roland Häder --- diff --git a/lib/jcontacts-lib.jar b/lib/jcontacts-lib.jar index 378afb04..c0031977 100644 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 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} +
+ + +