<?xml version="1.0" encoding="UTF-8"?>
<Scene Scope="Project" version="2">
<Scope Scope="Faces Configuration Only">
+ <Node id="admin/admin_logout.xhtml" x="650" y="150" zoom="true"/>
+ <Node id="user/login.xhtml" x="150" y="300" zoom="true"/>
+ <Node id="admin/index.xhtml" x="400" y="300" zoom="true"/>
+ <Node id="user/lost_passwd.xhtml" x="400" y="450" zoom="true"/>
+ <Node id="*" x="1150" y="150" zoom="true"/>
+ <Node id="terms.xhtml" x="400" y="150" zoom="true"/>
<Node id="bye.xhtml" x="150" y="450" zoom="true"/>
- <Node id="index.xhtml" x="900" y="150" zoom="true"/>
<Node id="privacy.xhtml" x="650" y="300" zoom="true"/>
- <Node id="*" x="1150" y="150" zoom="true"/>
+ <Node id="index.xhtml" x="900" y="150" zoom="true"/>
<Node id="imprint.xhtml" x="150" y="600" zoom="true"/>
<Node id="admin/category.xhtml" x="650" y="450" zoom="true"/>
- <Node id="admin/index.xhtml" x="400" y="300" zoom="true"/>
<Node id="user/register.xhtml" x="150" y="150" zoom="true"/>
- <Node id="admin/admin_logout.xhtml" x="650" y="150" zoom="true"/>
- <Node id="terms.xhtml" x="400" y="150" zoom="true"/>
<Node id="admin/product.xhtml" x="900" y="300" zoom="true"/>
- <Node id="user/lost_passwd.xhtml" x="400" y="450" zoom="true"/>
- <Node id="user/login.xhtml" x="150" y="300" zoom="true"/>
</Scope>
<Scope Scope="Project">
- <Node id="login/login_shared_addressbooks.xhtml" x="400" y="150" zoom="true"/>
- <Node id="login/login_edit_address.xhtml" x="1400" y="300" zoom="true"/>
+ <Node id="user/user_list.xhtml" x="900" y="450" zoom="true"/>
+ <Node id="user/login.xhtml" x="900" y="600" zoom="true"/>
+ <Node id="login/login_other_addressbooks.xhtml" x="1150" y="300" zoom="true"/>
+ <Node id="user/login_error.xhtml" x="150" y="450" zoom="true"/>
<Node id="privacy.xhtml" x="1400" y="150" zoom="true"/>
+ <Node id="admin/admin_index.xhtml" x="400" y="300" zoom="true"/>
<Node id="login/login_start_sharing_addressbook.xhtml" x="400" y="450" zoom="true"/>
- <Node id="user/register.xhtml" x="900" y="300" zoom="true"/>
- <Node id="login/login_index.xhtml" x="150" y="150" zoom="true"/>
+ <Node id="user/user_profile.xhtml" x="150" y="900" zoom="true"/>
+ <Node id="login/login_list_sharing_addressbooks.xhtml" x="150" y="600" zoom="true"/>
+ <Node id="admin/admin_logout.xhtml" x="400" y="750" zoom="true"/>
<Node id="login/login_add_addressbook.xhtml" x="1150" y="150" zoom="true"/>
- <Node id="user/resend_link.xhtml" x="1150" y="450" zoom="true"/>
+ <Node id="login/login_edit_address.xhtml" x="1400" y="300" zoom="true"/>
+ <Node id="login/login_edit_user_data.xhtml" x="1650" y="150" zoom="true"/>
+ <Node id="user/lost_passwd.xhtml" x="400" y="900" zoom="true"/>
+ <Node id="*" x="900" y="150" zoom="true"/>
<Node id="login/login_own_addressbooks.xhtml" x="650" y="450" zoom="true"/>
- <Node id="admin/admin_logout.xhtml" x="400" y="750" zoom="true"/>
<Node id="terms.xhtml" x="400" y="600" zoom="true"/>
- <Node id="user/user_list.xhtml" x="900" y="450" zoom="true"/>
+ <Node id="user/register_done.xhtml" x="150" y="300" zoom="true"/>
+ <Node id="login/login_shared_addressbooks.xhtml" x="400" y="150" zoom="true"/>
<Node id="bye.xhtml" x="650" y="600" zoom="true"/>
<Node id="index.xhtml" x="650" y="150" zoom="true"/>
- <Node id="user/register_done.xhtml" x="150" y="300" zoom="true"/>
- <Node id="user/user_profile.xhtml" x="150" y="900" zoom="true"/>
<Node id="imprint.xhtml" x="650" y="750" zoom="true"/>
- <Node id="*" x="900" y="150" zoom="true"/>
- <Node id="user/login_error.xhtml" x="150" y="450" zoom="true"/>
- <Node id="login/login_other_addressbooks.xhtml" x="1150" y="300" zoom="true"/>
- <Node id="admin/admin_index.xhtml" x="400" y="300" zoom="true"/>
- <Node id="user/lost_passwd.xhtml" x="400" y="900" zoom="true"/>
- <Node id="user/login.xhtml" x="900" y="600" zoom="true"/>
- <Node id="login/login_list_sharing_addressbooks.xhtml" x="150" y="600" zoom="true"/>
- <Node id="login/login_edit_user_data.xhtml" x="1650" y="150" zoom="true"/>
+ <Node id="login/login_index.xhtml" x="150" y="150" zoom="true"/>
+ <Node id="user/register.xhtml" x="900" y="300" zoom="true"/>
+ <Node id="user/resend_link.xhtml" x="1150" y="450" zoom="true"/>
</Scope>
<Scope Scope="All Faces Configurations">
+ <Node id="admin/admin_logout.xhtml" x="650" y="150" zoom="true"/>
+ <Node id="user/login.xhtml" x="150" y="300" zoom="true"/>
+ <Node id="admin/index.xhtml" x="400" y="300" zoom="true"/>
+ <Node id="user/lost_passwd.xhtml" x="400" y="450" zoom="true"/>
+ <Node id="*" x="1150" y="150" zoom="true"/>
+ <Node id="terms.xhtml" x="400" y="150" zoom="true"/>
<Node id="bye.xhtml" x="150" y="450" zoom="true"/>
- <Node id="index.xhtml" x="900" y="150" zoom="true"/>
<Node id="privacy.xhtml" x="650" y="300" zoom="true"/>
- <Node id="*" x="1150" y="150" zoom="true"/>
+ <Node id="index.xhtml" x="900" y="150" zoom="true"/>
<Node id="imprint.xhtml" x="150" y="600" zoom="true"/>
<Node id="admin/category.xhtml" x="650" y="450" zoom="true"/>
- <Node id="admin/index.xhtml" x="400" y="300" zoom="true"/>
<Node id="user/register.xhtml" x="150" y="150" zoom="true"/>
- <Node id="admin/admin_logout.xhtml" x="650" y="150" zoom="true"/>
- <Node id="terms.xhtml" x="400" y="150" zoom="true"/>
<Node id="admin/product.xhtml" x="900" y="300" zoom="true"/>
- <Node id="user/lost_passwd.xhtml" x="400" y="450" zoom="true"/>
- <Node id="user/login.xhtml" x="150" y="300" zoom="true"/>
</Scope>
</Scene>
@Override
public boolean isAddressbookLoaded () {
- return (this.getAddressbookId() instanceof Long);
+ return ((this.getAddressbookId() instanceof Long)
+ && (this.getAddressbookName() instanceof String)
+ && (!this.getAddressbookName().isEmpty())
+ && (this.getAddressbookUser() instanceof User));
}
/**
import org.mxchange.jusercore.exceptions.UserStatusUnconfirmedException;
import org.mxchange.jusercore.model.login.UserLoginSessionBeanRemote;
import org.mxchange.jusercore.model.user.User;
+import org.mxchange.jusercore.model.user.profilemodes.ProfileMode;
import org.mxchange.jusercore.model.user.status.UserAccountStatus;
/**
// Trace message
// NOISY: System.out.println(MessageFormat.format("UserLoginWebSessionBean:isUserLoggedIn: this.userLoggedIn={0} - EXIT!", this.userLoggedIn));
+
// Return it
return this.userLoggedIn;
}
+
+ @Override
+ public boolean isNotInvisible () {
+ // Check logged-in first, then invisibility
+ return ((this.isUserLoggedIn()) && (!Objects.equals(this.getLoggedInUser().getUserProfileMode(), ProfileMode.INVISIBLE)));
+ }
}
* @return Whether the user is truly a guest
*/
boolean isGuest ();
+
+ /**
+ * Whether the currently logged-in user is not invisible
+ * <p>
+ * @return Whether the currently logged-in user is not invisible
+ */
+ boolean isNotInvisible ();
}
import org.mxchange.addressbook.model.addressbook.shared.ShareableAddressbook;
import org.mxchange.addressbook.model.shared.SharedAddressbooksSessionBeanRemote;
import org.mxchange.jusercore.model.user.User;
+import org.mxchange.jusercore.model.user.profilemodes.ProfileMode;
/**
* A bean for sharing address books with other users
} else if (!Objects.equals(addressbook.getAddressbookUser(), this.loginController.getLoggedInUser())) {
// Not the same user!
throw new IllegalStateException(MessageFormat.format("Address book id {0} owner id {1} mismatching logged-in user id {2}", addressbook.getAddressbookId(), addressbook.getAddressbookUser().getUserId(), this.loginController.getLoggedInUser().getUserId())); //NOI18N
+ } else if (this.loginController.getLoggedInUser().getUserProfileMode() == ProfileMode.INVISIBLE) {
+ // User is invisible
+ throw new FaceletException(MessageFormat.format("user {0} is invisible and cannot start sharing address books.", this.loginController.getLoggedInUser().getUserId())); //NOI18N
+ } else if (user.getUserProfileMode() == ProfileMode.INVISIBLE) {
+ // User is invisible
+ throw new FaceletException(MessageFormat.format("user {0} is invisible and cannot be selected for sharing.", user.getUserId())); //NOI18N
}
try {
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core">
<c:choose>
- <c:when test="#{profileController.isProfileLinkVisible(user)}">
+ <c:when test="#{user != null and profileController.isProfileLinkVisible(user)}">
<h:link id="userProfileLink" outcome="user_profile" title="#{msg.LINK_USER_PROFILE_TITLE}">
<h:outputText id="userName" value="#{user.userName}" />
<f:param name="userId" value="#{user.userId}" />
</div>
<div class="para">
- <h:dataTable id="userList" headerClass="table_header_column" var="user" value="#{addressbookController.allUsersNotSharing()}">
+ <h:dataTable id="userList" headerClass="table_header_column" var="user" value="#{addressbookController.allUsersNotSharing()}" rendered="#{loginController.isNotInvisible()}">
<h:column>
<f:facet name="header">#{msg.USER_ID}</f:facet>
<h:outputText value="#{user.userId}" />
<h:column>
<f:facet name="header">#{msg.LOGIN_START_SHARING_TITLE}</f:facet>
- <h:form acceptcharset="utf-8" id="startSharing">
+ <h:form acceptcharset="utf-8" id="startSharing" rendered="#{profileController.isProfileLinkVisible(user)}">
<h:commandButton class="submit" id="submit" value="#{msg.LOGIN_START_SHARING_BUTTON}" action="#{shareController.startSharing(user, addressbookController.addressbook)}" title="#{msg.LOGIN_START_SHARING_BUTTON_TITLE}" />
</h:form>
</h:column>
</ui:define>
<ui:define name="content">
- <ui:fragment rendered="#{addressbookController.isAddressbookLoaded()}">
- <h:panelGrid headerClass="table_header" styleClass="table" columns="2">
- <f:facet name="header">#{msg.TABLE_HEADER_SHOW_ADDRESSBOOK}</f:facet>
-
- <h:outputLabel for="addressbookId" class="table_label">#{msg.ADDRESSBOOK_ID}</h:outputLabel>
- <h:outputText id="addressbookId" value="#{addressbookController.addressbookId}" />
-
- <h:outputLabel for="addressbookName" class="table_label">#{msg.ADDRESSBOOK_NAME}</h:outputLabel>
- <h:outputText id="addressbookName" value="#{addressbookController.addressbookName}" />
-
- <h:outputLabel for="userProfileLink" class="table_label">#{msg.ADDRESSBOOK_OWNER}</h:outputLabel>
- <ui:include src="/WEB-INF/templates/generic/user_profile_link.tpl">
- <ui:param name="user" value="#{addressbookController.addressbookUser}" />
- </ui:include>
-
- <h:outputLabel for="addressbookCreated" class="table_label">#{msg.ADDRESSBOOK_CREATED}</h:outputLabel>
- <h:outputFormat id="addressbookCreated" value="#{addressbookController.addressbook.addressbookCreated.time}" title="#{msg.ADDRESSBOOK_CREATED_TITLE}">
- <f:convertDateTime for="addressbookCreated" type="both" timeStyle="short" dateStyle="medium" />
- </h:outputFormat>
-
- <h:outputLabel for="addressbookStatus" class="table_label">#{msg.ADDRESSBOOK_STATUS}</h:outputLabel>
- <h:outputText id="addressbookStatus" value="#{msg[addressbookController.addressbook.addressbookStatus.messageKey]}" title="#{msg.ADDRESSBOOK_STATUS_TITLE}" />
-
- <f:facet name="footer">
- <ui:fragment rendered="#{loginController.isUserLoggedIn()}">
- <ui:fragment rendered="#{addressbookController.isOwnAddressbook()}">
- <h:link id="startSharing" outcome="login_start_sharing_addressbook" value="#{msg.LINK_LOGIN_START_SHARING_ADDRESSBOOK}" title="#{msg.LINK_LOGIN_START_SHARING_ADDRESSBOOK_TITLE}" />
- </ui:fragment>
-
- <ui:fragment rendered="#{addressbookController.isOtherAddressbook()}">
- Bla bla
- </ui:fragment>
+ <h:panelGrid headerClass="table_header" styleClass="table" columns="2" rendered="#{addressbookController.isAddressbookLoaded()}">
+ <f:facet name="header">#{msg.TABLE_HEADER_SHOW_ADDRESSBOOK}</f:facet>
+
+ <h:outputLabel for="addressbookId" class="table_label">#{msg.ADDRESSBOOK_ID}</h:outputLabel>
+ <h:outputText id="addressbookId" value="#{addressbookController.addressbookId}" />
+
+ <h:outputLabel for="addressbookName" class="table_label">#{msg.ADDRESSBOOK_NAME}</h:outputLabel>
+ <h:outputText id="addressbookName" value="#{addressbookController.addressbookName}" />
+
+ <h:outputLabel for="userProfileLink" class="table_label">#{msg.ADDRESSBOOK_OWNER}</h:outputLabel>
+ <ui:include src="/WEB-INF/templates/generic/user_profile_link.tpl">
+ <ui:param name="user" value="#{addressbookController.addressbookUser}" />
+ </ui:include>
+
+ <h:outputLabel for="addressbookCreated" class="table_label">#{msg.ADDRESSBOOK_CREATED}</h:outputLabel>
+ <h:outputFormat id="addressbookCreated" value="#{addressbookController.addressbook.addressbookCreated.time}" title="#{msg.ADDRESSBOOK_CREATED_TITLE}">
+ <f:convertDateTime for="addressbookCreated" type="both" timeStyle="short" dateStyle="medium" />
+ </h:outputFormat>
+
+ <h:outputLabel for="addressbookStatus" class="table_label">#{msg.ADDRESSBOOK_STATUS}</h:outputLabel>
+ <h:outputText id="addressbookStatus" value="#{msg[addressbookController.addressbook.addressbookStatus.messageKey]}" title="#{msg.ADDRESSBOOK_STATUS_TITLE}" />
+
+ <f:facet name="footer">
+ <ui:fragment rendered="#{loginController.isUserLoggedIn()}">
+ <ui:fragment rendered="#{addressbookController.isOwnAddressbook()}">
+ <h:link id="startSharing" outcome="login_start_sharing_addressbook" value="#{msg.LINK_LOGIN_START_SHARING_ADDRESSBOOK}" title="#{msg.LINK_LOGIN_START_SHARING_ADDRESSBOOK_TITLE}" />
+ </ui:fragment>
+
+ <ui:fragment rendered="#{addressbookController.isOtherAddressbook()}">
+ Bla bla
</ui:fragment>
- </f:facet>
- </h:panelGrid>
- </ui:fragment>
+ </ui:fragment>
+ </f:facet>
+ </h:panelGrid>
</ui:define>
</ui:composition>
</html>