From 7d4e6e46cc2a7a72912a9331a1b1f605dcf9e254 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Mon, 19 Oct 2015 12:53:52 +0200 Subject: [PATCH] =?utf8?q?Continued:=20-=20renamed=20isNotInvisible()=20to?= =?utf8?q?=20isInvisible()=20-=20added=20message=20on=20case=20if=20the=20?= =?utf8?q?user=20is=20invisible=20-=20rewrote=20ui:fragment-abuse=20to=20c?= =?utf8?q?:choose,=20still=20a=20bit=20abusive=20to=20JSF,=20but=20better?= =?utf8?q?=20than=20ui:fragment=20-=20added=20missing=20i18n=20strings=20S?= =?utf8?q?igned-off-by:Roland=20H=C3=A4der=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../beans/login/UserLoginWebSessionBean.java | 10 +++- .../login/UserLoginWebSessionController.java | 6 +-- .../localization/bundle_de_DE.properties | 2 + .../localization/bundle_en_US.properties | 2 + .../login_start_sharing_addressbook.xhtml | 53 +++++++++++-------- web/user/show_addressbook.xhtml | 30 +++++++---- 6 files changed, 67 insertions(+), 36 deletions(-) diff --git a/src/java/org/mxchange/addressbook/beans/login/UserLoginWebSessionBean.java b/src/java/org/mxchange/addressbook/beans/login/UserLoginWebSessionBean.java index 8854311a..ca8874f7 100644 --- a/src/java/org/mxchange/addressbook/beans/login/UserLoginWebSessionBean.java +++ b/src/java/org/mxchange/addressbook/beans/login/UserLoginWebSessionBean.java @@ -174,8 +174,14 @@ public class UserLoginWebSessionBean implements UserLoginWebSessionController { } @Override - public boolean isNotInvisible () { + public boolean isInvisible () { + // Check on login + if (!this.isUserLoggedIn()) { + // Not logged in! + throw new IllegalStateException("isInvisible() was called for guest."); //NOI18N + } + // Check logged-in first, then invisibility - return ((this.isUserLoggedIn()) && (!Objects.equals(this.getLoggedInUser().getUserProfileMode(), ProfileMode.INVISIBLE))); + return ((Objects.equals(this.getLoggedInUser().getUserProfileMode(), ProfileMode.INVISIBLE))); } } diff --git a/src/java/org/mxchange/addressbook/beans/login/UserLoginWebSessionController.java b/src/java/org/mxchange/addressbook/beans/login/UserLoginWebSessionController.java index 680cdf2e..89ae8d2e 100644 --- a/src/java/org/mxchange/addressbook/beans/login/UserLoginWebSessionController.java +++ b/src/java/org/mxchange/addressbook/beans/login/UserLoginWebSessionController.java @@ -76,9 +76,9 @@ public interface UserLoginWebSessionController extends Serializable { boolean isGuest (); /** - * Whether the currently logged-in user is not invisible + * Whether the currently logged-in user is invisible *

- * @return Whether the currently logged-in user is not invisible + * @return Whether the currently logged-in user is invisible */ - boolean isNotInvisible (); + boolean isInvisible (); } diff --git a/src/java/org/mxchange/localization/bundle_de_DE.properties b/src/java/org/mxchange/localization/bundle_de_DE.properties index 303ee878..e5935a8f 100644 --- a/src/java/org/mxchange/localization/bundle_de_DE.properties +++ b/src/java/org/mxchange/localization/bundle_de_DE.properties @@ -263,3 +263,5 @@ USER_PROFILE_MODE_SELECTION_NOTICE2=Stellen Sie auf "Nur Mitglieder", koennen an USER_PROFILE_MODE_SELECTION_NOTICE3=Stellen Sie auf "Alle", ist Ihr Profil im gesamten Internet sichtbar, auch Bots. LOGIN_NO_PASSWORD_MESSAGE=Sie haben kein Passwort eingegeben. LOGIN_NO_USER_NAME_MESSAGE=Sie haben keinen Benutzernamen eingegeben. +USER_NOT_LOGGED_IN=Sie sind nicht angemeldet. +LOGIN_OWN_PROFILE_INVISIBLE=Ihr Profil ist auf "durchsichtig" gestellt. diff --git a/src/java/org/mxchange/localization/bundle_en_US.properties b/src/java/org/mxchange/localization/bundle_en_US.properties index 366ec33f..1bbe0411 100644 --- a/src/java/org/mxchange/localization/bundle_en_US.properties +++ b/src/java/org/mxchange/localization/bundle_en_US.properties @@ -258,3 +258,5 @@ USER_PROFILE_MODE_SELECTION_NOTICE2=If you choose "Only members", other users ca USER_PROFILE_MODE_SELECTION_NOTICE3=If you choose "All" the whole Internet can view your profile, including bots. LOGIN_NO_PASSWORD_MESSAGE=You have entered no password. LOGIN_NO_USER_NAME_MESSAGE=You have entered no user name. +USER_NOT_LOGGED_IN=You are not signed in. +LOGIN_OWN_PROFILE_INVISIBLE=Your profile is set to "invisible". diff --git a/web/login/login_start_sharing_addressbook.xhtml b/web/login/login_start_sharing_addressbook.xhtml index ec61e50d..d9c930b2 100644 --- a/web/login/login_start_sharing_addressbook.xhtml +++ b/web/login/login_start_sharing_addressbook.xhtml @@ -4,7 +4,8 @@ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:f="http://xmlns.jcp.org/jsf/core" - > + + xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"> #{msg.PAGE_TITLE_LOGIN_START_SHARING_ADDRESSBOOK} @@ -21,26 +22,36 @@

- - - #{msg.USER_ID} - - - - - #{msg.USER_NAME} - - - - - - - #{msg.LOGIN_START_SHARING_TITLE} - - - - - + + + + + #{msg.USER_ID} + + + + + #{msg.USER_NAME} + + + + + + + #{msg.LOGIN_START_SHARING_TITLE} + + + + + + + + + + + + +