From b51d3c1e77a44aac92fe115e87c5da85531fe039 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Mon, 12 Oct 2015 18:23:08 +0200 Subject: [PATCH] Continued: - added login_show_addressbook.xhtml - added missing language elements - listing of created address books should be "basicly finished" - updated jar(s) --- lib/jcontacts-core.jar | Bin 20648 -> 20639 bytes .../beans/addressbook/AddressbookWebBean.java | 64 ++++++++++-------- .../addressbook/AddressbookWebController.java | 9 +++ .../localization/bundle_de_DE.properties | 10 +++ .../localization/bundle_en_US.properties | 9 +++ web/WEB-INF/faces-config.xml | 4 ++ web/login/login_own_addressbooks.xhtml | 24 ++++++- web/login/login_show_addressbook.xhtml | 20 ++++++ 8 files changed, 110 insertions(+), 30 deletions(-) create mode 100644 web/login/login_show_addressbook.xhtml diff --git a/lib/jcontacts-core.jar b/lib/jcontacts-core.jar index 2cb80f4a3a16213629a0ee5d9ffe7d52260f25d7..f0cd6d5ddcb0b3ca18c1f908c8b87c98084f5dee 100644 GIT binary patch delta 383 zcmZ3nka7M(M(zM_W)?061`Y;>z=_;iya7Ev?q#$3nbR2<7}6&?`7xSIoG8j_pqpf5 zK5>gOQ$Wwen+hQEw$44kw5{vw(A1hQ#Ctvq51GsKxdDF;pQe&hC+VYv%*0MHis$zJ}lAO)E~F$rU^Njj6a`U`=?P6EaF h?Vw_!0pcJry#N`eweFMa{Zu9w1Q@YZ`2c;z004jzYuo?; delta 582 zcmbQgka5LAM(zM_W)?061`Y-WhKbx-f`7Yx+-)~$JSqV4L0Dw+10V5;vBr#M6DNxD zndxTcm82HsCFbZR85mAnt<3bdd*THJ5cx?HNKTezGzL*YjMgBkpV0|KU1qccQk#XD zu5f_pmt2+_AX>%vD;J2CwwuEVqIbHVWnpBP-0ow=i{gsO=X^}-K_WoszyS-KCBX33 z@hp&+UzDyN;LXS+!VK{ax(;3x9q*w!ax0QE67$ki@oE)kfNKWXCN){nPipc?UmkgM zJLFO9@CT|>(#Gc|H5BzdK=r1;keD3dC&PFFY)QYLI7ncHpA3@#(_{sI#mRDF?33U5 z34yKN%XMP*TXhBo5H^4t#lWzn@!4c~e|wP51b-POMPsne07u@*Yy5>kq6dJY5_WJ= vo&a$LkXPoHmeytiLl%TxP|VxrK6!$#(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. + + + -- 2.39.5