From: Roland Haeder Date: Mon, 12 Oct 2015 16:23:08 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b51d3c1e77a44aac92fe115e87c5da85531fe039;p=jfinancials-war.git Continued: - added login_show_addressbook.xhtml - added missing language elements - listing of created address books should be "basicly finished" - updated jar(s) --- diff --git a/lib/jcontacts-core.jar b/lib/jcontacts-core.jar index 2cb80f4a..f0cd6d5d 100644 Binary files a/lib/jcontacts-core.jar and b/lib/jcontacts-core.jar differ diff --git a/src/java/org/mxchange/addressbook/beans/addressbook/AddressbookWebBean.java b/src/java/org/mxchange/addressbook/beans/addressbook/AddressbookWebBean.java index 2232b33c..237876dd 100644 --- a/src/java/org/mxchange/addressbook/beans/addressbook/AddressbookWebBean.java +++ b/src/java/org/mxchange/addressbook/beans/addressbook/AddressbookWebBean.java @@ -18,6 +18,7 @@ package org.mxchange.addressbook.beans.addressbook; import java.text.MessageFormat; import java.util.ArrayList; +import java.util.Collections; import java.util.GregorianCalendar; import java.util.List; import javax.annotation.PostConstruct; @@ -49,6 +50,11 @@ public class AddressbookWebBean implements AddressbookWebController { */ private static final long serialVersionUID = 185_781_756_712_969L; + /** + * Remote address book bean + */ + private AddressbookSessionBeanRemote addressbookBean; + /////////////////////// Properties ///////////////////// /** * A list of all user's address books @@ -60,11 +66,6 @@ public class AddressbookWebBean implements AddressbookWebController { */ private String addressbookName; - /** - * Remote address book bean - */ - private AddressbookSessionBeanRemote addressbookBean; - /** * Login controller */ @@ -88,30 +89,6 @@ public class AddressbookWebBean implements AddressbookWebController { } } - @PostConstruct - public void init () { - // Init list - this.addressbookList = new ArrayList<>(0); - - // Is the user logged-in? - if (this.loginController.isUserLoggedIn()) { - // Fill list with entries - this.addressbookList = this.addressbookBean.getUsersList(this.loginController.getLoggedInUser()); - } - } - - @Override - public boolean hasCreatedAddressbooks () { - // Is the user logged in? - if (!this.loginController.isUserLoggedIn()) { - // Not logged in - throw new FaceletException("This method can only be called as logged-in user."); //NOI18N - } - - // Check if the list is filled - return (!this.addressbookList.isEmpty()); - } - @Override public void addAddressbook () { // Is this name already used? @@ -152,6 +129,11 @@ public class AddressbookWebBean implements AddressbookWebController { } } + @Override + public List allAddressbooks () { + return Collections.unmodifiableList(this.addressbookList); + } + @Override public String getAddressbookName () { return this.addressbookName; @@ -162,6 +144,30 @@ public class AddressbookWebBean implements AddressbookWebController { this.addressbookName = addressbookName; } + @Override + public boolean hasCreatedAddressbooks () { + // Is the user logged in? + if (!this.loginController.isUserLoggedIn()) { + // Not logged in + throw new FaceletException("This method can only be called as logged-in user."); //NOI18N + } + + // Check if the list is filled + return (!this.addressbookList.isEmpty()); + } + + @PostConstruct + public void init () { + // Init list + this.addressbookList = new ArrayList<>(0); + + // Is the user logged-in? + if (this.loginController.isUserLoggedIn()) { + // Fill list with entries + this.addressbookList = this.addressbookBean.getUsersList(this.loginController.getLoggedInUser()); + } + } + @Override public boolean isAddressbookNameUsed (final String addressbookName) { // Is it zero size? diff --git a/src/java/org/mxchange/addressbook/beans/addressbook/AddressbookWebController.java b/src/java/org/mxchange/addressbook/beans/addressbook/AddressbookWebController.java index 3d5a8154..6a60b22a 100644 --- a/src/java/org/mxchange/addressbook/beans/addressbook/AddressbookWebController.java +++ b/src/java/org/mxchange/addressbook/beans/addressbook/AddressbookWebController.java @@ -17,6 +17,8 @@ package org.mxchange.addressbook.beans.addressbook; import java.io.Serializable; +import java.util.List; +import org.mxchange.addressbook.model.addressbook.Addressbook; /** * An interface for user beans @@ -61,4 +63,11 @@ public interface AddressbookWebController extends Serializable { * @return Whether the name has already been used by the user */ public boolean isAddressbookNameUsed (final String addressbookName); + + /** + * Returns all address books with this user + *

+ * @return A list of all address books by this user + */ + public List allAddressbooks (); } diff --git a/src/java/org/mxchange/localization/bundle_de_DE.properties b/src/java/org/mxchange/localization/bundle_de_DE.properties index 531219f3..d60fb749 100644 --- a/src/java/org/mxchange/localization/bundle_de_DE.properties +++ b/src/java/org/mxchange/localization/bundle_de_DE.properties @@ -172,3 +172,13 @@ LOGIN_ENTER_ADDRESSBOOK_NAME=Names des Adressbuches: COUNTRY_GERMANY=Deutschland COUNTRY_PHILIPPINES=Philippinen NONE_SELECTED=k.A. +ADDRESSBOOK_ID=Id-Nummer: +ADDRESSBOOK_ID_TITLE=Identifizierende, eindeutige Nummer +ADDRESSBOOK_NAME=Addressbuchname: +ADDRESSBOOK_NAME_TITLE=Name des Adressbuches +ADDRESSBOOK_CREATED=Erstellt: +ADDRESSBOOK_CREATED_TITLE=Wann das Adressbuch erstellt wurde. +LINK_LOGIN_SHOW_ADDRESS_BOOK_TITLE=Adressbuch anzeigen +PAGE_TITLE_LOGIN_SHOW_ADDRESSBOOK=Adressbuch anzeigen +#Please fix German "umlaut" +CONTENT_TITLE_LOGIN_SHOW_ADDRESSBOOK=Anzeigen des ausgewaehlten Adressbuchs: diff --git a/src/java/org/mxchange/localization/bundle_en_US.properties b/src/java/org/mxchange/localization/bundle_en_US.properties index 59f80a45..869815e4 100644 --- a/src/java/org/mxchange/localization/bundle_en_US.properties +++ b/src/java/org/mxchange/localization/bundle_en_US.properties @@ -172,3 +172,12 @@ LOGIN_ENTER_ADDRESSBOOK_NAME=Name of address book: COUNTRY_GERMANY=Germany COUNTRY_PHILIPPINES=Philippines NONE_SELECTED=Empty +ADDRESSBOOK_ID=Id number: +ADDRESSBOOK_ID_TITLE=Identifying unique number +ADDRESSBOOK_NAME=Address book name: +ADDRESSBOOK_NAME_TITLE=Name of the address book +ADDRESSBOOK_CREATED=Created: +ADDRESSBOOK_CREATED_TITLE=When the address book was created. +LINK_LOGIN_SHOW_ADDRESS_BOOK_TITLE=Show address book +PAGE_TITLE_LOGIN_SHOW_ADDRESSBOOK=Show address book +CONTENT_TITLE_LOGIN_SHOW_ADDRESSBOOK=Show selected address book: diff --git a/web/WEB-INF/faces-config.xml b/web/WEB-INF/faces-config.xml index d03e8b35..ed980d6b 100644 --- a/web/WEB-INF/faces-config.xml +++ b/web/WEB-INF/faces-config.xml @@ -117,6 +117,10 @@ login_add_addressbook /login/login_add_addressbook.xhtml + + login_show_addressbook + /login/login_show_addressbook.xhtml + diff --git a/web/login/login_own_addressbooks.xhtml b/web/login/login_own_addressbooks.xhtml index 561a1c79..7938ed5d 100644 --- a/web/login/login_own_addressbooks.xhtml +++ b/web/login/login_own_addressbooks.xhtml @@ -19,7 +19,29 @@

- + + + #{msg.ADDRESSBOOK_ID} + + + + + + #{msg.ADDRESSBOOK_NAME} + + + + + + + + + #{msg.ADDRESSBOOK_CREATED} + + + + +
diff --git a/web/login/login_show_addressbook.xhtml b/web/login/login_show_addressbook.xhtml new file mode 100644 index 00000000..d2a8d1e4 --- /dev/null +++ b/web/login/login_show_addressbook.xhtml @@ -0,0 +1,20 @@ + + + + + + #{msg.PAGE_TITLE_LOGIN_SHOW_ADDRESSBOOK} + + + #{msg.CONTENT_TITLE_LOGIN_SHOW_ADDRESSBOOK} + + + + Here goes your content. + + +