]> git.mxchange.org Git - jfinancials-war.git/commitdiff
Added showing of address book entries and size
authorRoland Haeder <roland@mxchange.org>
Mon, 12 Oct 2015 17:03:18 +0000 (19:03 +0200)
committerRoland Haeder <roland@mxchange.org>
Mon, 12 Oct 2015 17:03:18 +0000 (19:03 +0200)
src/java/org/mxchange/addressbook/beans/addressbook/AddressbookWebBean.java
src/java/org/mxchange/addressbook/beans/addressbook/AddressbookWebController.java
web/login/login_own_addressbooks.xhtml

index 237876dd9cb5f8cb92fed39dc24531da19cd3a32..bf5e802e6af27662c896cc3ab66fc304bd5fca20 100644 (file)
@@ -34,6 +34,7 @@ import org.mxchange.addressbook.exceptions.AddressbookNameAlreadyUsedException;
 import org.mxchange.addressbook.model.addressbook.Addressbook;
 import org.mxchange.addressbook.model.addressbook.AddressbookSessionBeanRemote;
 import org.mxchange.addressbook.model.addressbook.UserAddressbook;
+import org.mxchange.addressbook.model.addressbook.entry.AddressbookEntry;
 import org.mxchange.addressbook.model.addressbook.status.AddressbokStatus;
 
 /**
@@ -134,6 +135,18 @@ public class AddressbookWebBean implements AddressbookWebController {
                return Collections.unmodifiableList(this.addressbookList);
        }
 
+       @Override
+       public List<AddressbookEntry> allEntries (final Addressbook addressbook) {
+               // Ask the bean
+               return this.addressbookBean.allEntries(addressbook);
+       }
+
+       @Override
+       public int allEntriesSize (final Addressbook addressbook) {
+               // Ask the bean
+               return this.allEntries(addressbook).size();
+       }
+
        @Override
        public String getAddressbookName () {
                return this.addressbookName;
index 6a60b22af93c38271bb00b4bd4bf3215252d16b4..998938a5048660397aaf62a50a66817ae116d415 100644 (file)
@@ -19,6 +19,7 @@ package org.mxchange.addressbook.beans.addressbook;
 import java.io.Serializable;
 import java.util.List;
 import org.mxchange.addressbook.model.addressbook.Addressbook;
+import org.mxchange.addressbook.model.addressbook.entry.AddressbookEntry;
 
 /**
  * An interface for user beans
@@ -70,4 +71,22 @@ public interface AddressbookWebController extends Serializable {
         * @return A list of all address books by this user
         */
        public List<Addressbook> allAddressbooks ();
+
+       /**
+        * Returns a list of all address book entries for given address book
+        * <p>
+        * @param addressbook Address book instance
+        * <p>
+        * @return List of all entries
+        */
+       public List<AddressbookEntry> allEntries (final Addressbook addressbook);
+
+       /**
+        * Size of all entries in given address book
+        * <p>
+        * @param addressbook Address book instance
+        * <p>
+        * @return Size of the entries in address book
+        */
+       public int allEntriesSize (final Addressbook addressbook);
 }
index 7938ed5dcdbafb6901a9e896e2116ac7cccd3705..25b34ae088eb2b3f84841e03be23eb9750b12f3b 100644 (file)
                                                </h:link>
                                        </h:column>
 
+                                       <h:column>
+                                               <f:facet name="header">#{msg.ADDRESSBOOK_TOTAL_ENTRIES}</f:facet>
+
+                                               <h:link outcome="login_show_addressbook_entries" title="#{msg.LINK_LOGIN_SHOW_ADDRESS_BOOK_ENTRIES_TITLE}">
+                                                       <f:param name="addressbook_id" value="#{addressbook.addressbookId}" />
+                                                       <h:outputText id="addressbookEntries" value="#{addressbookController.allEntriesSize(addressbook)}" title="#{msg.ADDRESSBOOK_NAME_TITLE}" />
+                                               </h:link>
+                                       </h:column>
+
                                        <h:column>
                                                <f:facet name="header">#{msg.ADDRESSBOOK_CREATED}</f:facet>