*/
package org.mxchange.addressbook.beans.addressbook;
-import javax.ejb.EJB;
+import java.util.List;
import javax.enterprise.context.SessionScoped;
import javax.faces.view.facelets.FaceletException;
+import javax.inject.Inject;
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;
+import org.mxchange.addressbook.model.addressbook.Addressbook;
+import org.mxchange.addressbook.model.addressbook.AddressbookSessionBeanRemote;
/**
* A user bean (controller)
private static final long serialVersionUID = 185_781_756_712_969L;
/////////////////////// Properties /////////////////////
+ /**
+ * A list of all user's addressbooks
+ */
+ private List<Addressbook> addressbookList;
/**
* Remote addressbook bean
/**
* Login controller
*/
- @EJB
+ @Inject
private UserLoginWebController loginController;
/**
throw new FaceletException(e);
}
}
+
+ @Override
+ public boolean hasCreatedAddressbooks () {
+ throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
+ }
}
* @author Roland Haeder<roland@mxchange.org>
*/
public interface AddressbookWebController extends Serializable {
+
+ /**
+ * Checks whether the user has created addressbooks. For this method to work
+ * it is vital that the user is logged into his/her account.
+ * <p>
+ * @return Whether the user has created at least one addressbook
+ */
+ public boolean hasCreatedAddressbooks ();
}
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.
+LINK_LOGIN_ADD_ADDITIONAL_ADDRESSBOOK=Weiteres Adressbuch hinzuf\u00fcgen
+LINK_LOGIN_ADD_FIRST_ADDRESSBOOK=Erstes Adressbuch anlegen
+LINK_LOGIN_ADD_ADDITIONAL_ADDRESSBOOK_TITLE=Legen Sie ein weiteres Adressbuch an. So organisieren Sie Ihre Kontakte besser.
+LINK_LOGIN_ADD_FIRST_ADDRESSBOOK_TITLE=Legen Sie Ihr erstes Adressbuch an. Dies ist f\u00fcr das Verwalten von Kontakten erforderlich.
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.
+LINK_LOGIN_ADD_ADDITIONAL_ADDRESSBOOK=Add additional address book
+LINK_LOGIN_ADD_FIRST_ADDRESSBOOK=Create first address book
+LINK_LOGIN_ADD_ADDITIONAL_ADDRESSBOOK_TITLE=You can create an additional address book here. This way you can organize your contacts.
+LINK_LOGIN_ADD_FIRST_ADDRESSBOOK_TITLE=Create your first address book. This is required to manage your contacts.
#{msg.TABLE_HEADER_LIST_OWN_ADDRESSBOOKS}
</div>
- <h:dataTable id="table_own_addressbooks" var="addressbook" value="#{addressbookController.allAddressbooks}" styleClass="table" summary="#{msg.TABLE_SUMMARY_LIST_OWN_ADDRESSBOOKS}" rendered="#{addressbookController.hasCreatedAddressbooks()}">
- </h:dataTable>
+ <div class="para">
+ <h:dataTable id="table_own_addressbooks" var="addressbook" value="#{addressbookController.allAddressbooks}" styleClass="table" summary="#{msg.TABLE_SUMMARY_LIST_OWN_ADDRESSBOOKS}" rendered="#{addressbookController.hasCreatedAddressbooks()}">
+ </h:dataTable>
+ </div>
+
+ <div class="para">
+ <h:link id="add_first_addressbook" outcome="login_add_addressbook" value="#{msg.LINK_LOGIN_ADD_FIRST_ADDRESSBOOK}" title="#{msg.LINK_LOGIN_ADD_FIRST_ADDRESSBOOK_TITLE}" rendered="#{addressbookController.hasCreatedAddressbooks() == false}" />
+ <h:link id="add_additional_addressbook" outcome="login_add_addressbook" value="#{msg.LINK_LOGIN_ADD_ADDITIONAL_ADDRESSBOOK}" title="#{msg.LINK_LOGIN_ADD_ADDITIONAL_ADDRESSBOOK_TITLE}" rendered="#{addressbookController.hasCreatedAddressbooks()}" />
+ </div>
</ui:define>
</ui:composition>
</html>