<?xml version="1.0" encoding="UTF-8"?>
<Scene Scope="Project" version="2">
<Scope Scope="Faces Configuration Only"/>
- <Scope Scope="Project"/>
+ <Scope Scope="Project">
+ <Node id="login/login_shared_addressbooks.xhtml" x="1150" y="450" zoom="true"/>
+ <Node id="login/login_edit_address.xhtml" x="150" y="750" zoom="true"/>
+ <Node id="privacy.xhtml" x="400" y="900" zoom="true"/>
+ <Node id="login/login_start_sharing_addressbook.xhtml" x="650" y="750" zoom="true"/>
+ <Node id="user/register.xhtml" x="150" y="150" zoom="true"/>
+ <Node id="login/login_add_addressbook.xhtml" x="650" y="150" zoom="true"/>
+ <Node id="login/login_index.xhtml" x="900" y="300" zoom="true"/>
+ <Node id="user/resend_link.xhtml" x="150" y="600" zoom="true"/>
+ <Node id="login/login_own_addressbooks.xhtml" x="400" y="450" zoom="true"/>
+ <Node id="admin/admin_logout.xhtml" x="150" y="300" zoom="true"/>
+ <Node id="terms.xhtml" x="1400" y="300" zoom="true"/>
+ <Node id="user/user_list.xhtml" x="150" y="900" zoom="true"/>
+ <Node id="bye.xhtml" x="650" y="300" zoom="true"/>
+ <Node id="index.xhtml" x="650" y="450" zoom="true"/>
+ <Node id="user/register_done.xhtml" x="400" y="150" zoom="true"/>
+ <Node id="user/user_profile.xhtml" x="400" y="750" zoom="true"/>
+ <Node id="*" x="400" y="300" zoom="true"/>
+ <Node id="user/show_addressbook.xhtml" x="900" y="150" zoom="true"/>
+ <Node id="imprint.xhtml" x="650" y="600" zoom="true"/>
+ <Node id="user/login_error.xhtml" x="900" y="600" zoom="true"/>
+ <Node id="login/login_other_addressbooks.xhtml" x="900" y="450" zoom="true"/>
+ <Node id="user/show_addressbook_entries.xhtml" x="1150" y="150" zoom="true"/>
+ <Node id="admin/admin_index.xhtml" x="400" y="600" zoom="true"/>
+ <Node id="user/lost_passwd.xhtml" x="1400" y="150" zoom="true"/>
+ <Node id="user/login.xhtml" x="150" y="450" zoom="true"/>
+ <Node id="login/login_list_sharing_addressbooks.xhtml" x="1650" y="150" zoom="true"/>
+ <Node id="login/login_edit_user_data.xhtml" x="1150" y="300" zoom="true"/>
+ </Scope>
<Scope Scope="All Faces Configurations"/>
</Scene>
import java.util.LinkedList;
import java.util.List;
import java.util.Objects;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
import javax.annotation.PostConstruct;
import javax.enterprise.context.SessionScoped;
import javax.enterprise.event.Event;
@SessionScoped
public class AddressbookWebSessionBean implements AddressbookWebSessionController {
- /**
- * Map for count of user's shared addresses
- */
- private static ConcurrentMap<User, Integer> countSharesList;
-
/**
* Serial number
*/
// Throw again
throw new FaceletException(e);
}
-
- // Init list
- AddressbookWebSessionBean.countSharesList = new ConcurrentHashMap<>(0);
}
@Override
return this.addressbookBean.allUsersNotSharing(this.loginController.getLoggedInUser(), this.getAddressbook());
}
- @Override
- public Integer countAllUserSharedAddressbooks (final User user) {
- // Is there cache?
- if (AddressbookWebSessionBean.countSharesList.containsKey(user)) {
- // Return it instead
- return AddressbookWebSessionBean.countSharesList.get(user);
- }
-
- // Call EJB ("expensive")
- Integer count = this.addressbookBean.countAllUserSharedAddressbooks(user);
-
- // Add to list
- AddressbookWebSessionBean.countSharesList.put(user, count);
-
- // Return it
- return count;
- }
-
@Override
public Addressbook getAddressbook () {
return this.addressbook;
*/
void afterAddressbookLoadedEvent (final AddressbookLoadedEvent event);
- /**
- * Count all shared address books by given user id
- * <p>
- * @param user User instance to look for
- * <p>
- * @return Count of user's shared address books
- */
- Integer countAllUserSharedAddressbooks (final User user);
-
/**
* This method is called when a user has successfully logged in his/her
* account.
+++ /dev/null
-/*
- * Copyright (C) 2016 Roland Haeder
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jjobs.beans.shares;
-
-import java.text.MessageFormat;
-import java.util.Collections;
-import java.util.List;
-import java.util.Objects;
-import javax.annotation.PostConstruct;
-import javax.enterprise.context.SessionScoped;
-import javax.enterprise.event.Event;
-import javax.enterprise.event.Observes;
-import javax.enterprise.inject.Any;
-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.events.sharing.AddressbookSharingEvent;
-import org.mxchange.addressbook.events.sharing.StartedAddressbookSharingEvent;
-import org.mxchange.addressbook.events.sharing.type.SharingType;
-import org.mxchange.addressbook.exceptions.UserAlreadySharingAddressbookException;
-import org.mxchange.addressbook.model.addressbook.Addressbook;
-import org.mxchange.addressbook.model.addressbook.shared.ShareableAddressbook;
-import org.mxchange.addressbook.model.shared.SharedAddressbooksSessionBeanRemote;
-import org.mxchange.jjobs.beans.login.UserLoginWebSessionController;
-import org.mxchange.jusercore.events.login.UserLoggedInEvent;
-import org.mxchange.jusercore.model.user.User;
-import org.mxchange.jusercore.model.user.profilemodes.ProfileMode;
-
-/**
- * A bean for sharing address books with other users
- * <p>
- * @author Roland Haeder
- */
-@Named (value = "shareController")
-@SessionScoped
-public class SharesWebSessionBean implements SharesWebSessionController {
-
- /**
- * Serial number
- */
- private static final long serialVersionUID = 19_868_976_871_976_780L;
-
- /**
- * Cached flag whether the user is sharing address books
- */
- private Boolean isUserSharing = null;
-
- /**
- * Login controller injection
- */
- @Inject
- private UserLoginWebSessionController loginController;
-
- /**
- * Share instance
- */
- private ShareableAddressbook share;
-
- /**
- * Remote bean for sharing address books
- */
- private SharedAddressbooksSessionBeanRemote shareBean;
-
- /**
- * A list of all user's shared (with others) address books
- */
- private List<ShareableAddressbook> sharedAddressbooks;
-
- /**
- * User id of sharee
- */
- private Long shareeUserId;
-
- /**
- * An event triggered when address book sharing starts or ends
- */
- @Inject
- @Any
- private Event<AddressbookSharingEvent> sharingEvent;
-
- /**
- * Default constructor
- */
- public SharesWebSessionBean () {
- // Try it
- try {
- // Get initial context
- Context context = new InitialContext();
-
- // Look up bean
- this.shareBean = (SharedAddressbooksSessionBeanRemote) context.lookup("ejb/stateless-share"); //NOI18N
- } catch (final NamingException ex) {
- // Continue to throw
- throw new FaceletException(ex);
- }
- }
-
- @Override
- public void afterAdressbookShareEnded (final @Observes AddressbookSharingEvent event) {
- // Validate parameter
- if (null == event) {
- // Throw NPE
- throw new NullPointerException("event is null"); //NOI18N
- } else if (event.getSharingType() == null) {
- // Throw NPE
- throw new NullPointerException("event.sharingType is null"); //NOI18N
- } else if (event.getSharingType() != SharingType.ENDED) {
- // Wrong event
- return;
- }
-
- // Validate event
- this.validateEvent(event);
-
- // Add it to list
- this.sharedAddressbooks.remove(event.getShareableAddressbook());
- }
-
- @Override
- public void afterAdressbookShareStarted (final @Observes AddressbookSharingEvent event) {
- // Validate parameter
- if (null == event) {
- // Throw NPE
- throw new NullPointerException("event is null"); //NOI18N
- } else if (event.getSharingType() == null) {
- // Throw NPE
- throw new NullPointerException("event.sharingType is null"); //NOI18N
- } else if (event.getSharingType() != SharingType.STARTED) {
- // Wrong event
- return;
- }
-
- // Validate event
- this.validateEvent(event);
-
- // Add it to list
- this.sharedAddressbooks.add(event.getShareableAddressbook());
- }
-
- @Override
- public void afterLoginEvent (final @Observes UserLoggedInEvent event) {
- // Is the user logged in?
- if (null == event) {
- // Is null
- throw new NullPointerException("event is null"); //NOI18N
- } else if (event.getUser() == null) {
- // user is null
- throw new NullPointerException("event.user is null"); //NOI18N
- }
-
- // Init share list
- this.sharedAddressbooks = this.shareBean.allSharedAddressbooks(event.getUser());
- }
-
- @Override
- public List<ShareableAddressbook> allShares () {
- // 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
- }
-
- return Collections.unmodifiableList(this.sharedAddressbooks);
- }
-
- @Override
- public ShareableAddressbook getShare () {
- return this.share;
- }
-
- @Override
- public void setShare (final ShareableAddressbook share) {
- this.share = share;
- }
-
- @Override
- public Long getShareeUserId () {
- return this.shareeUserId;
- }
-
- @Override
- public void setShareeUserId (final Long shareeUserId) {
- this.shareeUserId = shareeUserId;
- }
-
- @PostConstruct
- public void init () {
- }
-
- @Override
- public boolean isShareeUserIdEmpty () {
- return (!this.isShareeUserIdSet());
- }
-
- @Override
- public boolean isShareeUserIdSet () {
- return ((this.getShareeUserId() instanceof Long) && (this.getShareeUserId() > 0));
- }
-
- @Override
- public boolean isSharingAddressbooks () {
- // Only to be called for logged-in users
- if (!this.loginController.isUserLoggedIn()) {
- // Not logged in
- throw new FaceletException("This method can only be called as logged-in user."); //NOI18N
- } else if (this.isUserSharing instanceof Boolean) {
- // Return cached value
- return this.isUserSharing;
- }
-
- // Call the proper bean
- this.isUserSharing = this.shareBean.isUserSharingAddressbooks(this.loginController.getLoggedInUser());
-
- // Return it
- return this.isUserSharing;
- }
-
- @Override
- public String startSharing (final User user, final Addressbook addressbook) {
- // Check conditions
- if (!this.loginController.isUserLoggedIn()) {
- // No, then throw exception
- throw new FaceletException("This method can only be called as logged-in user."); //NOI18N
- } else if (null == user) {
- // Throw NPE
- throw new NullPointerException("user is null"); //NOI18N
- } else if (user.getUserId() == null) {
- // Throw NPE again
- throw new NullPointerException("user.userId is null"); //NOI18N
- } else if (user.getUserId() < 1) {
- // Invalid id number
- throw new IllegalStateException(MessageFormat.format("user.userId={0} is invalid", user.getUserId())); //NOI18N
- } else if (Objects.equals(user, this.loginController.getLoggedInUser())) {
- // Sharing with yourself!
- throw new IllegalStateException("User tries to share with himself."); //NOI18N
- } else if (null == addressbook) {
- // Throw NPE again
- throw new NullPointerException("addressbook is null"); //NOI18N
- } else if (addressbook.getAddressbookId() == null) {
- // Throw NPE again
- throw new NullPointerException("addressbook.addressbookId is null"); //NOI18N
- } else if (addressbook.getAddressbookId() < 1) {
- // Invalid id number
- throw new IllegalArgumentException(MessageFormat.format("addressbook.addressbookId={0} is invalid.", addressbook.getAddressbookId())); //NOI18N
- } 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 {
- // Init sharing
- ShareableAddressbook shared = this.shareBean.startSharing(user, addressbook);
-
- // TODO Set it here
- this.setShare(shared);
-
- /// Trigger event
- this.sharingEvent.fire(new StartedAddressbookSharingEvent(shared));
- } catch (final UserAlreadySharingAddressbookException ex) {
- // Throw again
- throw new FaceletException(ex);
- }
-
- // TODO Unfinished
- return null;
- }
-
- /**
- * Validates given event for all values and throws exceptions
- * <p>
- * @param event Event to validate
- */
- private void validateEvent (final AddressbookSharingEvent event) {
- if (null == event) {
- // Throw NPE
- throw new NullPointerException("event is null"); //NOI18N
- } else if (event.getSharingType() == null) {
- // Throw NPE
- throw new NullPointerException("event.sharingType is null"); //NOI18N
- } else if (event.getShareableAddressbook() == null) {
- // Throw NPE again
- throw new NullPointerException("event.shareableAddressbook is null"); //NOI18N
- } else if (event.getShareableAddressbook().getShareId() == null) {
- // Throw NPE again
- throw new NullPointerException("event.shareableAddressbook.shareId is null"); //NOI18N
- } else if (event.getShareableAddressbook().getShareId() < 1) {
- // Throw NPE again
- throw new IllegalArgumentException(MessageFormat.format("event.shareableAddressbook.shareId={0} is invalid", event.getShareableAddressbook().getShareId())); //NOI18N
- } else if (event.getShareableAddressbook().getShareAddressbook() == null) {
- // Throw NPE again
- throw new NullPointerException("event.shareableAddressbook.shareAddressbook is null"); //NOI18N
- } else if (event.getShareableAddressbook().getShareAddressbook().getAddressbookId() == null) {
- // Throw NPE again
- throw new NullPointerException("event.shareableAddressbook.shareAddressbook.addressbookId is null"); //NOI18N
- } else if (event.getShareableAddressbook().getShareAddressbook().getAddressbookId() < 1) {
- // Throw NPE again
- throw new IllegalArgumentException(MessageFormat.format("event.shareableAddressbook.shareAddressbook.addressbookId={0} is invalid", event.getShareableAddressbook().getShareAddressbook().getAddressbookId())); //NOI18N
- } else if (event.getShareableAddressbook().getShareUserOwner() == null) {
- // Throw NPE again
- throw new NullPointerException("event.shareableAddressbook.shareUserOwner is null"); //NOI18N
- } else if (event.getShareableAddressbook().getShareUserOwner().getUserId() == null) {
- // Throw NPE again
- throw new NullPointerException("event.shareableAddressbook.shareUserOwner.userId is null"); //NOI18N
- } else if (event.getShareableAddressbook().getShareUserOwner().getUserId() < 1) {
- // Throw NPE again
- throw new IllegalArgumentException(MessageFormat.format("event.shareableAddressbook.shareUserOwner.userId={0} is invalid", event.getShareableAddressbook().getShareUserOwner().getUserId())); //NOI18N
- } else if (event.getShareableAddressbook().getShareUserSharee() == null) {
- // Throw NPE again
- throw new NullPointerException("event.shareableAddressbook.shareUserSharee is null"); //NOI18N
- } else if (event.getShareableAddressbook().getShareUserSharee().getUserId() == null) {
- // Throw NPE again
- throw new NullPointerException("event.shareableAddressbook.shareUserSharee.userId is null"); //NOI18N
- } else if (event.getShareableAddressbook().getShareUserSharee().getUserId() < 1) {
- // Throw NPE again
- throw new IllegalArgumentException(MessageFormat.format("event.shareableAddressbook.shareUserSharee.userId={0} is invalid", event.getShareableAddressbook().getShareUserOwner().getUserId())); //NOI18N
- }
- }
-}
+++ /dev/null
-/*
- * Copyright (C) 2016 Roland Haeder
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jjobs.beans.shares;
-
-import java.io.Serializable;
-import java.util.List;
-import org.mxchange.addressbook.events.sharing.AddressbookSharingEvent;
-import org.mxchange.addressbook.model.addressbook.Addressbook;
-import org.mxchange.addressbook.model.addressbook.shared.ShareableAddressbook;
-import org.mxchange.jusercore.events.login.UserLoggedInEvent;
-import org.mxchange.jusercore.model.user.User;
-
-/**
- * Controller interface sharing address books
- * <p>
- * @author Roland Haeder
- */
-public interface SharesWebSessionController extends Serializable {
-
- /**
- * Observer method for ended sharing events
- * <p>
- * @param event Event instance
- */
- void afterAdressbookShareEnded (final AddressbookSharingEvent event);
-
- /**
- * Observer method for started sharing events
- * <p>
- * @param event Event instance
- */
- void afterAdressbookShareStarted (final AddressbookSharingEvent event);
-
- /**
- * This method is called when a user has successfully logged in his/her
- * account.
- * <p>
- * @param event
- */
- void afterLoginEvent (final UserLoggedInEvent event);
-
- /**
- * Returns a list of all address books the user is sharing with others.
- * <p>
- * @return List of all shared address books
- */
- List<ShareableAddressbook> allShares ();
-
- /**
- * Getter for share instance
- * <p>
- * @return Share instance
- */
- ShareableAddressbook getShare ();
-
- /**
- * Setter for share instance
- * <p>
- * @param share Share instance
- */
- void setShare (final ShareableAddressbook share);
-
- /**
- * Getter for sharee's user id
- * <p>
- * @return Sharee's user id
- */
- Long getShareeUserId ();
-
- /**
- * Setter for sharee's user id
- * <p>
- * @param shareeUserId Sharee's user id
- */
- void setShareeUserId (final Long shareeUserId);
-
- /**
- * Checks if the sharee's user id is empty.
- * <p>
- * @return Whether the sharee's user id is empty.
- */
- boolean isShareeUserIdEmpty ();
-
- /**
- * Checks whether the sharee's user id is set
- * <p>
- * @return Whether the sharee's user id is set
- */
- boolean isShareeUserIdSet ();
-
- /**
- * Checks wether the current user is sharing address books with others
- * <p>
- * @return Whether the current user is sharing address books
- */
- boolean isSharingAddressbooks ();
-
- /**
- * Starts an address book share between currently logged-in user and
- * assigned user for current address book.
- * <p>
- * @param user User instance
- * @param addressbook Address book instance
- * @return Redirect target
- */
- String startSharing (final User user, final Addressbook addressbook);
-}
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
-import org.mxchange.jjobs.beans.login.UserLoginWebSessionController;
import org.mxchange.jcontacts.contact.Contact;
import org.mxchange.jcontacts.contact.UserContact;
import org.mxchange.jcontacts.contact.gender.Gender;
import org.mxchange.jcountry.data.Country;
+import org.mxchange.jjobs.beans.login.UserLoginWebSessionController;
import org.mxchange.jphone.phonenumbers.cellphone.CellphoneNumber;
import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber;
import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
*/
private Short houseNumber;
+ /**
+ * Login bean (controller)
+ */
+ @Inject
+ private UserLoginWebSessionController loginController;
+
/**
* Phone number area code
*/
*/
private ProfileMode userProfileMode;
- /**
- * ZIP code
- */
- private Integer zipCode;
-
/**
* A list of all public user profiles
*/
private List<User> visibleUserList;
/**
- * Login bean (controller)
+ * ZIP code
*/
- @Inject
- private UserLoginWebSessionController loginController;
+ private Integer zipCode;
/**
* Default constructor
}
}
- @Override
- public void afterUserLogin (final @Observes UserLoggedInEvent event) {
- // Trace message
- System.out.println(MessageFormat.format("UserWebBean:afterUserLogin: event={0} - CALLED!", event)); //NOI18N
-
- // event should not be null
- if (null == event) {
- // Throw NPE
- throw new NullPointerException("event is null"); //NOI18N
- } else if (event.getUser() == null) {
- // Throw NPE again
- throw new NullPointerException("event.user is null"); //NOI18N
- } else if (event.getUser().getUserId() == null) {
- // userId is null
- throw new NullPointerException("event.user.userId is null"); //NOI18N
- } else if (event.getUser().getUserId() < 1) {
- // Not avalid id
- throw new IllegalArgumentException(MessageFormat.format("userId of user={0} is not valid: {1}", event.getUser(), event.getUser().getUserId())); //NOI18N
- }
-
- // Re-initialize list
- this.visibleUserList = this.userBean.allMemberPublicVisibleUsers();
-
- // Trace message
- System.out.println(MessageFormat.format("UserWebBean:afterUserLogin: this.visibleUserList.size()={0} - EXIT!", this.visibleUserList.size())); //NOI18N
- }
-
@Override
public void afterRegistrationEvent (final @Observes UserRegisteredEvent event) {
// Trace message
System.out.println("UserWebBean:afterRegistration: EXIT!"); //NOI18N
}
+ @Override
+ public void afterUserLogin (final @Observes UserLoggedInEvent event) {
+ // Trace message
+ System.out.println(MessageFormat.format("UserWebBean:afterUserLogin: event={0} - CALLED!", event)); //NOI18N
+
+ // event should not be null
+ if (null == event) {
+ // Throw NPE
+ throw new NullPointerException("event is null"); //NOI18N
+ } else if (event.getUser() == null) {
+ // Throw NPE again
+ throw new NullPointerException("event.user is null"); //NOI18N
+ } else if (event.getUser().getUserId() == null) {
+ // userId is null
+ throw new NullPointerException("event.user.userId is null"); //NOI18N
+ } else if (event.getUser().getUserId() < 1) {
+ // Not avalid id
+ throw new IllegalArgumentException(MessageFormat.format("userId of user={0} is not valid: {1}", event.getUser(), event.getUser().getUserId())); //NOI18N
+ }
+
+ // Re-initialize list
+ this.visibleUserList = this.userBean.allMemberPublicVisibleUsers();
+
+ // Trace message
+ System.out.println(MessageFormat.format("UserWebBean:afterUserLogin: this.visibleUserList.size()={0} - EXIT!", this.visibleUserList.size())); //NOI18N
+ }
+
@Override
public List<User> allVisibleUsers () {
// Return it
return (Objects.equals(this.getUserPassword(), this.getUserPasswordRepeat()));
}
+ @Override
+ public boolean isUserIdEmpty () {
+ return ((this.getUserId() == null) || (this.getUserId() == 0));
+ }
+
@Override
public boolean isUserNameRegistered (final User user) {
return ((this.userNameList instanceof List) && (this.userNameList.contains(user.getUserName())));
this.setBirthday(user.getUserContact().getContactBirthday());
this.setComment(user.getUserContact().getContactComment());
}
-
- @Override
- public boolean isUserIdEmpty () {
- return ((this.getUserId() == null) || (this.getUserId() == 0));
- }
}
@Log
private LoggerBeanLocal loggerBeanLocal;
+ /**
+ * Initialization of this converter
+ */
+ public CountryConverter () {
+ // Try to get it
+ try {
+ // Get initial context
+ Context context = new InitialContext();
+
+ // Lookup logger
+ this.loggerBeanLocal = (LoggerBeanLocal) context.lookup("java:global/jcore-logger-ejb/logger!org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal"); //NOI18N
+
+ // ... and country controller
+ this.countryController = (AddressbookCountrySingletonBeanRemote) context.lookup("java:global/addressbook-ejb/country!org.mxchange.jcountry.data.AddressbookCountrySingletonBeanRemote"); //NOI18N
+ } catch (final NamingException ex) {
+ // Continue to throw it
+ throw new RuntimeException("context.lookup() failed.", ex); //NOI18N
+ }
+ }
+
@Override
public Object getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
// Trace message
// Return category id
return String.valueOf(((Country) value).getCountryId());
}
-
- /**
- * Initialization of this converter
- */
- public CountryConverter () {
- // Try to get it
- try {
- // Get initial context
- Context context = new InitialContext();
-
- // Lookup logger
- this.loggerBeanLocal = (LoggerBeanLocal) context.lookup("java:global/jcore-logger-ejb/logger!org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal"); //NOI18N
-
- // ... and country controller
- this.countryController = (AddressbookCountrySingletonBeanRemote) context.lookup("java:global/addressbook-ejb/country!org.mxchange.jcountry.data.AddressbookCountrySingletonBeanRemote"); //NOI18N
- } catch (final NamingException ex) {
- // Continue to throw it
- throw new RuntimeException("context.lookup() failed.", ex); //NOI18N
- }
- }
}
*/
private AddressbookSmsProviderSingletonBeanRemote providerController;
+ /**
+ * Initialization of this converter
+ */
+ public SmsProviderConverter () {
+ // Try to get it
+ try {
+ // Get initial context
+ Context context = new InitialContext();
+
+ // Lookup logger
+ this.loggerBeanLocal = (LoggerBeanLocal) context.lookup("java:global/jcore-logger-ejb/logger!org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal"); //NOI18N
+
+ /// and SMS provider controller
+ this.providerController = (AddressbookSmsProviderSingletonBeanRemote) context.lookup("java:global/addressbook-ejb/smsprovider!org.mxchange.jphone.phonenumbers.smsprovider.AddressbookSmsProviderSingletonBeanRemote"); //NOI18N
+ } catch (final NamingException ex) {
+ // Continue to throw it
+ throw new RuntimeException("context.lookup() failed.", ex); //NOI18N
+ }
+ }
+
@Override
public Object getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
// Trace message
// Return category id
return String.valueOf(((SmsProvider) value).getProviderId());
}
-
- /**
- * Initialization of this converter
- */
- public SmsProviderConverter () {
- // Try to get it
- try {
- // Get initial context
- Context context = new InitialContext();
-
- // Lookup logger
- this.loggerBeanLocal = (LoggerBeanLocal) context.lookup("java:global/jcore-logger-ejb/logger!org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal"); //NOI18N
-
- /// and SMS provider controller
- this.providerController = (AddressbookSmsProviderSingletonBeanRemote) context.lookup("java:global/addressbook-ejb/smsprovider!org.mxchange.jphone.phonenumbers.smsprovider.AddressbookSmsProviderSingletonBeanRemote"); //NOI18N
- } catch (final NamingException ex) {
- // Continue to throw it
- throw new RuntimeException("context.lookup() failed.", ex); //NOI18N
- }
- }
-
}
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
-import org.mxchange.jjobs.beans.user.UserWebSessionController;
import org.mxchange.jcoreeelogger.beans.local.logger.Log;
import org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal;
+import org.mxchange.jjobs.beans.user.UserWebSessionController;
import org.mxchange.jusercore.exceptions.UserNotFoundException;
import org.mxchange.jusercore.model.user.User;
@Inject
private UserWebSessionController userController;
+ /**
+ * Constructor of this converter
+ */
+ public UserConverter () {
+ // Try to get it
+ try {
+ // Get initial context
+ Context context = new InitialContext();
+
+ // Lookup logger
+ this.loggerBeanLocal = (LoggerBeanLocal) context.lookup("java:global/jcore-logger-ejb/logger!org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal"); //NOI18N
+
+ // ... and user controller
+ this.userController = (UserWebSessionController) context.lookup("java:global/juser-ejb/user!org.mxchange.jusercore.model.user.UserSessionBeanRemote"); //NOI18N
+ } catch (final NamingException ex) {
+ // Continue to throw it
+ throw new RuntimeException("context.lookup() failed.", ex); //NOI18N
+ }
+ }
+
@Override
public Object getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
// Trace message
// Return category id
return String.valueOf(((User) value).getUserId());
}
-
- /**
- * Initialization of this converter
- */
- public UserConverter () {
- // Try to get it
- try {
- // Get initial context
- Context context = new InitialContext();
-
- // Lookup logger
- this.loggerBeanLocal = (LoggerBeanLocal) context.lookup("java:global/jcore-logger-ejb/logger!org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal"); //NOI18N
-
- // ... and user controller
- this.userController = (UserWebSessionController) context.lookup("java:global/juser-ejb/user!org.mxchange.jusercore.model.user.UserSessionBeanRemote"); //NOI18N
- } catch (final NamingException ex) {
- // Continue to throw it
- throw new RuntimeException("context.lookup() failed.", ex); //NOI18N
- }
- }
}
LINK_LOGIN_OWN_ADDRESSBOOKS=Meine Adressb\u00fccher
LINK_LOGIN_LOGOUT_TITLE=Aus dem Benutzerbereich ausloggen
LINK_LOGIN_OWN_ADDRESSBOOKS_TITLE=Meine eigenen Adressb\u00fccher verwalten
-LINK_LOGIN_OTHER_ADDRESSBOOKS=Mit mir geteilt
-LINK_LOGIN_OTHER_ADDRESSBOOKS_TITLE=Von anderen Benutzern freigegebene Adressb\u00fccher
MENU_ADDRESSBOOKS_TITLE=Adressb\u00fccher verwalten
PAGE_TITLE_LOGIN_OWN_ADDRESSBOOKS=Meine Adressb\u00fccher verwalten
CONTENT_TITLE_LOGIN_OWN_ADDRESSBOOKS=Verwalten Sie Ihre eigenen Adressb\u00fccher:
ENTERED_HOUSE_NUMBER_INVALID=Die eingegebene Hausnummer ist ung\u00fcltig.
ENTERED_ZIP_CODE_INVALID=Die eingegebene Postleitzahl ist ung\u00fcltig.
PARAMETER_ADDRESSBOOK_ID_NOT_FOUND=Der angeklickte Link ist nicht mehr g\u00fcltig: Adressbuch mit der Id-Nummer nicht gefunden.
-LINK_LOGIN_SHARED_ADDRESS_BOOKS=Mit anderen geteilt
-LINK_LOGIN_SHARED_ADDRESS_BOOKS_TITLE=Mit anderen Benutzern geteilte Adressb\u00fccher
-PAGE_TITLE_LOGIN_SHARED_ADDRESSBOOKS=Mit anderen geteilte Adressb\u00fccher
-CONTENT_TITLE_LOGIN_SHARED_ADDRESSBOOKS=Meine mit anderen Benutzern geteilte Adressb\u00fccher:
-LINK_LOGIN_START_SHARING_ADDRESSBOOKS=Jetzt Ihre Adressb\u00fccher mit anderen Mitgliedern teilen!
-LOGIN_TABLE_HEADER_SHARED_ADDRESSBOOKS=Meine mit anderen Benutzern geteilte Adressb\u00fccher
-TABLE_SUMMARY_LOGIN_SHARED_ADDRESSBOOKS=Diese Tabelle listed alle von Ihnen mit anderen Benutzern geteilte Adressb\u00fccher auf.
-LOGIN_USER_HAS_NOT_SHARED_ADDRESSBOOKS=Derzeit teilen Sie keine Adressb\u00fccher mit anderen Benutzern.
TABLE_HEADER_USER_LIST=Alle Benutzer auflisten
TABLE_SUMMARY_USER_LIST=Diese Tabelle listet alle registrierten Benutzer aus, mit denen Sie Ihre Adressb\u00fccher teilen k\u00f6nnen.
USER_PROFILE_LEGEND=\u00d6ffentlich einsehbares Profil:
USER_NAME=Benutzername:
USER_CREATED=Beigetreten:
USER_CREATED_TITLE=Wann der Benutzer dieser Community beigetreten ist.
-USER_LIST_SHARING_ADDRESSBOOKS=Freigegebene Adressb\u00fccher:
-LINK_LOGIN_LIST_SHARING_ADDRESSBOOKS=Auflisten
-LINK_LOGIN_LIST_SHARING_ADDRESSBOOKS_TITLE=Listet alle mit dem Benutzer geteilte Adressb\u00fccher auf.
PAGE_TITLE_INDEX_USER_PROFILE=Benutzerprofil
CONTENT_TITLE_INDEX_USER_PROFILE=\u00d6ffentliches Profil des Benutzers:
-PAGE_TITLE_LOGIN_LIST_SHARING_ADDRESSBOOKS=Mit einem Benutzer geteilte Adressb\u00fccher
-CONTENT_TITLE_LOGIN_LIST_SHARING_ADDRESSBOOKS=Mit einem Benutzer geteilte Adressb\u00fccher auflisten:
PARAMETER_USER_ID_MISSING=Benutzernummer nicht angegeben.
PARAMETER_USER_ID_INVALID=Der angeklickte Link ist nicht mehr g\u00fcltig: Den Benutzer mit der Id-Nummer existiert nicht (mehr).
PARAMETER_USER_ID_NOT_FOUND=Benutzeraccount mit der Id-Nummer nicht gefunden.
TABLE_HEADER_ERROR_HANDLING_USER_ID=Fehler beim Verarbeiten der Benutzernummer:
TABLE_HEADER_SHOW_ADDRESSBOOK=Adressbuchdaten:
-LINK_LOGIN_START_SHARING_ADDRESSBOOK=Mit jemandem dieses Adressbuch teilen
-LINK_LOGIN_START_SHARING_ADDRESSBOOK_TITLE=Dieses Adresssbuch k\u00f6nnen Sie mit einem anderen Benutzer teilen. Dadurch kann er Ihre Kontakte sehen.
-PAGE_TITLE_LOGIN_START_SHARING_ADDRESSBOOK=Das Adressbuch mit anderen Benutzern teilen
-CONTENT_TITLE_LOGIN_START_SHARING_ADDRESSBOOK=Teilen Sie dieses Adressbuch mit anderen Benutzern:
-LOGIN_START_SHARING_TITLE=Teilen
-LOGIN_START_SHARING_BUTTON=Mit diesem Benutzer teilen
-LOGIN_START_SHARING_BUTTON_TITLE=Teilen Sie Ihr ausgew\u00e4hltes Adressbuch mit diesem Benutzer.
-TABLE_HEADER_CHOOSE_USER_FOR_SHARING=W\u00e4hlen Sie einen Benutzer zum Teilen Ihres Adressbuches aus.
-LOGIN_START_SHARING_NOTICE1=Damit werden Ihr gesamtes Adressbuch fuer den ausgewaehlten Benutzer sichtbar.
-LOGIN_START_SHARING_NOTICE2=Sie k\u00f6nnen dies jederzeit wiederrufen.
LINK_USER_PROFILE=Zum Benutzerprofil
LINK_USER_PROFILE_TITLE=Das Benutzerprofil in einem neuen Fenster aufrufen.
-LINK_LOGIN_START_SHARING_ADDRESSBOOKS_TITLE=Teilen Sie Ihre Adressb\u00fccher mit anderen Benutzern. Sie k\u00f6nnen den Schritt jederzeit zur\u00fccknehmen.
ADDRESSBOOK_STATUS_UNLOCKED=Freigegeben
ADDRESSBOOK_STATUS_LOCKED=Gesperrt
ADDRESSBOOK_STATUS_TITLE=Status des Adressbuches
-SHARED_ADDRESSBOOK=Adressbuch:
-SHAREE_USER_NAME=Geteilt mit:
-SHARE_CREATED=Wann gestartet:
-SHARE_CREATED_TITLE=Wann die Freigabe erfolgte
-SHARED_ADDRESSBOOK_TITLE=Welches Adressbuch freigegeben wurde
-SHAREE_USER_NAME_TITLE=Mit wem Sie Ihr Adressbuch teilen
ADDRESSBOOK_OWNER=Besitzer:
ADDRESSBOOK_STATUS=Status:
PAGE_TITLE_INDEX_SHOW_ADDRESSBOOK=\u00d6ffentlicher Teil des Adressbuchs anzeigen
LINK_LOGIN_OWN_ADDRESSBOOKS=My address books
LINK_LOGIN_LOGOUT_TITLE=Logout from user area
LINK_LOGIN_OWN_ADDRESSBOOKS_TITLE=Manage my own address books
-LINK_LOGIN_OTHER_ADDRESSBOOKS=Shared with me
-LINK_LOGIN_OTHER_ADDRESSBOOKS_TITLE=From other users shared address books
MENU_ADDRESSBOOKS_TITLE=Manage address books
PAGE_TITLE_LOGIN_OWN_ADDRESSBOOKS=Manage my address books
CONTENT_TITLE_LOGIN_OWN_ADDRESSBOOKS=Manage your own address books:
ENTERED_HOUSE_NUMBER_INVALID=The entered house number is invalid.
ENTERED_ZIP_CODE_INVALID=The entered ZIP code is invalid.
PARAMETER_ADDRESSBOOK_ID_NOT_FOUND=The clicked link is no longer valid: Address book with entered id number does not exist (anymore).
-LINK_LOGIN_SHARED_ADDRESS_BOOKS=Shared with others
-LINK_LOGIN_SHARED_ADDRESS_BOOKS_TITLE=With other users shared address books
-PAGE_TITLE_LOGIN_SHARED_ADDRESSBOOKS=With others shared address books
-CONTENT_TITLE_LOGIN_SHARED_ADDRESSBOOKS=Mine with other users shared address books:
-LINK_LOGIN_START_SHARING_ADDRESSBOOKS=Start now sharing your address books with other users!
-LOGIN_TABLE_HEADER_SHARED_ADDRESSBOOKS=My with other users shared address books
-TABLE_SUMMARY_LOGIN_SHARED_ADDRESSBOOKS=This table lists all your with other users shared address books.
-LOGIN_USER_HAS_NOT_SHARED_ADDRESSBOOKS=Currently you don't share any address books with other users.
TABLE_HEADER_USER_LIST=List all users
TABLE_SUMMARY_USER_LIST=This table lists all registered users you can share your address books with.
USER_PROFILE_LEGEND=Publicly visible profile:
USER_NAME=User name:
USER_CREATED=Joined:
USER_CREATED_TITLE=When the user has joined this community.
-USER_LIST_SHARING_ADDRESSBOOKS=Shared address books:
-LINK_LOGIN_LIST_SHARING_ADDRESSBOOKS=List
-LINK_LOGIN_LIST_SHARING_ADDRESSBOOKS_TITLE=Lists all with this user shared address books.
PAGE_TITLE_INDEX_USER_PROFILE=User profile
CONTENT_TITLE_INDEX_USER_PROFILE=Public profile of the user:
-PAGE_TITLE_LOGIN_LIST_SHARING_ADDRESSBOOKS=With a user shared address books
-CONTENT_TITLE_LOGIN_LIST_SHARING_ADDRESSBOOKS=List with a user shared address books:
PARAMETER_USER_ID_MISSING=No user id number provided
PARAMETER_USER_ID_INVALID=The clicked link is no longer valid: The user with provided id number does not exist (anymore).
PARAMETER_USER_ID_NOT_FOUND=User account with given id number not found.
TABLE_HEADER_ERROR_HANDLING_USER_ID=Error while handling user id:
TABLE_HEADER_SHOW_ADDRESSBOOK=Address book data:
-LINK_LOGIN_START_SHARING_ADDRESSBOOK=Start sharing this address book with another user
-LINK_LOGIN_START_SHARING_ADDRESSBOOK_TITLE=You can start sharing this address book with anther user. Then he cann see your contacts.
-PAGE_TITLE_LOGIN_START_SHARING_ADDRESSBOOK=Share the address book with other users
-CONTENT_TITLE_LOGIN_START_SHARING_ADDRESSBOOK=Start sharing this address book with other users:
-LOGIN_START_SHARING_TITLE=Share
-LOGIN_START_SHARING_BUTTON=Share with this user
-LOGIN_START_SHARING_BUTTON_TITLE=Share your choosen address book with this user.
-TABLE_HEADER_CHOOSE_USER_FOR_SHARING=Choose a user for sharing your address book with.
-LOGIN_START_SHARING_NOTICE1=With this your whole address book becomes visible to the other user.
-LOGIN_START_SHARING_NOTICE2=You can always revoke your choice.
LINK_USER_PROFILE=To user profile
LINK_USER_PROFILE_TITLE=Open the user profile in a new window.
-LINK_LOGIN_START_SHARING_ADDRESSBOOKS_TITLE=Start sharing your address books with other users. You can always revoke your decission.
ADDRESSBOOK_STATUS_UNLOCKED=Unlocked
ADDRESSBOOK_STATUS_LOCKED=Locked
ADDRESSBOOK_STATUS_TITLE=Status of the address book
-SHARED_ADDRESSBOOK=Address book:
-SHAREE_USER_NAME=Shared with:
-SHARE_CREATED=Started:
-SHARE_CREATED_TITLE=When the sharing has started.
-SHARED_ADDRESSBOOK_TITLE=Which address book is being shared
-SHAREE_USER_NAME_TITLE=With who you shared your address book
ADDRESSBOOK_OWNER=Owner:
ADDRESSBOOK_STATUS=Status:
PAGE_TITLE_INDEX_SHOW_ADDRESSBOOK=Show public part of address book
<from-outcome>login_own_addressbooks</from-outcome>
<to-view-id>/login/login_own_addressbooks.xhtml</to-view-id>
</navigation-case>
- <navigation-case>
- <from-outcome>login_other_addressbooks</from-outcome>
- <to-view-id>/login/login_other_addressbooks.xhtml</to-view-id>
- </navigation-case>
<navigation-case>
<from-outcome>user_list</from-outcome>
<to-view-id>/user/user_list.xhtml</to-view-id>
<from-outcome>login_edit_user_data</from-outcome>
<to-view-id>/login/login_edit_user_data.xhtml</to-view-id>
</navigation-case>
- <navigation-case>
- <from-outcome>login_shared_addressbooks</from-outcome>
- <to-view-id>/login/login_shared_addressbooks.xhtml</to-view-id>
- </navigation-case>
<navigation-case>
<from-outcome>user_profile</from-outcome>
<to-view-id>/user/user_profile.xhtml</to-view-id>
<to-view-id>/user/show_addressbook_entries.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
- <navigation-rule>
- <from-view-id>/user/user_list.xhtml</from-view-id>
- <navigation-case>
- <from-outcome>login_list_sharing_addressbooks</from-outcome>
- <to-view-id>/login/login_list_sharing_addressbooks.xhtml</to-view-id>
- </navigation-case>
- </navigation-rule>
- <navigation-rule>
- <from-view-id>/user/show_addressbook.xhtml</from-view-id>
- <navigation-case>
- <from-outcome>login_start_sharing_addressbook</from-outcome>
- <to-view-id>/login/login_start_sharing_addressbook.xhtml</to-view-id>
- </navigation-case>
- </navigation-rule>
- <navigation-rule>
- <from-view-id>/login/login_shared_addressbooks.xhtml</from-view-id>
- <navigation-case>
- <from-outcome>user_show_addressbook</from-outcome>
- <to-view-id>/user/show_addressbook.xhtml</to-view-id>
- </navigation-case>
- </navigation-rule>
</faces-config>
<li>
<h:link title="#{msg.LINK_LOGIN_OWN_ADDRESSBOOKS_TITLE}" outcome="login_own_addressbooks" value="#{msg.LINK_LOGIN_OWN_ADDRESSBOOKS}" />
</li>
- <li>
- <h:link title="#{msg.LINK_LOGIN_OTHER_ADDRESSBOOKS_TITLE}" outcome="login_other_addressbooks" value="#{msg.LINK_LOGIN_OTHER_ADDRESSBOOKS}" />
- </li>
- <li>
- <h:link title="#{msg.LINK_LOGIN_SHARED_ADDRESS_BOOKS_TITLE}" outcome="login_shared_addressbooks" value="#{msg.LINK_LOGIN_SHARED_ADDRESS_BOOKS}" />
- </li>
</ul>
<div class="menu_header">
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:h="http://xmlns.jcp.org/jsf/html"
- xmlns:f="http://xmlns.jcp.org/jsf/core"
- >
-
- <f:metadata>
- <f:viewParam id="userId" name="userId" value="#{shareController.shareeUserId}" required="true" requiredMessage="#{msg.PARAMETER_USER_ID_MISSING}" converterMessage="#{msg.PARAMETER_USER_ID_INVALID}" validatorMessage="#{msg.PARAMETER_USER_ID_NOT_FOUND}">
- <f:convertNumber for="userId" type="number" minIntegerDigits="1" maxIntegerDigits="20" />
- <f:validator for="userId" validatorId="UserIdValidator" />
- </f:viewParam>
- </f:metadata>
-
- <ui:composition template="/WEB-INF/templates/login/login_base.tpl">
- <ui:define name="login_title">#{msg.PAGE_TITLE_LOGIN_LIST_SHARING_ADDRESSBOOKS}</ui:define>
-
- <ui:define name="content_header">
- #{msg.CONTENT_TITLE_LOGIN_LIST_SHARING_ADDRESSBOOKS}
- </ui:define>
-
- <ui:define name="content">
- <ui:fragment rendered="#{shareController.isShareeUserIdSet()}">
- Here goes your content.
- </ui:fragment>
-
- <ui:fragment rendered="#{shareController.isShareeUserIdEmpty()}">
- <ui:include src="/WEB-INF/templates/generic/userid_error.tpl" />
- </ui:fragment>
- </ui:define>
- </ui:composition>
-</html>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:h="http://xmlns.jcp.org/jsf/html"
- xmlns:f="http://xmlns.jcp.org/jsf/core"
- >
-
- <ui:composition template="/WEB-INF/templates/login/login_base.tpl">
- <ui:define name="login_title">#{msg.PAGE_TITLE_LOGIN_OTHER_ADDRESSBOOKS}</ui:define>
-
- <ui:define name="content_header">
- #{msg.CONTENT_TITLE_LOGIN_OTHER_ADDRESSBOOKS}
- </ui:define>
-
- <ui:define name="content">
- Here goes your content.
- </ui:define>
- </ui:composition>
-</html>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:h="http://xmlns.jcp.org/jsf/html"
- xmlns:f="http://xmlns.jcp.org/jsf/core">
-
- <ui:composition template="/WEB-INF/templates/login/login_base.tpl">
- <ui:define name="login_title">#{msg.PAGE_TITLE_LOGIN_SHARED_ADDRESSBOOKS}</ui:define>
-
- <ui:define name="content_header">
- #{msg.CONTENT_TITLE_LOGIN_SHARED_ADDRESSBOOKS}
- </ui:define>
-
- <ui:define name="content">
- <div class="table">
- <div class="table_header">
- #{msg.LOGIN_TABLE_HEADER_SHARED_ADDRESSBOOKS}
- </div>
-
- <div class="para">
- <h:dataTable id="sharedAddressbooks" var="share" value="#{shareController.allShares()}" headerClass="table_data_column" summary="#{msg.TABLE_SUMMARY_LOGIN_SHARED_ADDRESSBOOKS}" rendered="#{shareController.isSharingAddressbooks()}">
- <h:column>
- <f:facet name="header">#{msg.SHARED_ADDRESSBOOK}</f:facet>
-
- <h:link outcome="user_show_addressbook" title="#{msg.LINK_SHOW_ADDRESSBOOK_TITLE}">
- <f:param name="addressbookId" value="#{share.shareAddressbook.addressbookId}" />
- <h:outputText id="addressbookName" value="#{share.shareAddressbook.addressbookName}" title="#{msg.SHARED_ADDRESSBOOK_TITLE}" />
- </h:link>
- </h:column>
-
- <h:column>
- <f:facet name="header">#{msg.SHAREE_USER_NAME}</f:facet>
- <ui:include src="/WEB-INF/templates/generic/user_profile_link.tpl">
- <ui:param name="user" value="#{share.shareUserSharee}" />
- </ui:include>
- </h:column>
-
- <h:column>
- <f:facet name="header">#{msg.SHARE_CREATED}</f:facet>
- <h:outputText id="shareCreated" value="#{share.shareCreated.time}" title="#{msg.SHARE_CREATED_TITLE}">
- <f:convertDateTime for="shareCreated" type="both" timeStyle="short" dateStyle="medium" />
- </h:outputText>
- </h:column>
- </h:dataTable>
- </div>
-
- <div class="para">
- <h:outputText class="notice" value="#{msg.LOGIN_USER_HAS_NOT_SHARED_ADDRESSBOOKS}" rendered="#{not shareController.isSharingAddressbooks()}" />
- </div>
-
- <div class="table_footer">
- <h:link id="shareAddressbook" outcome="user_list" title="#{msg.LINK_LOGIN_START_SHARING_ADDRESSBOOKS_TITLE}" value="#{msg.LINK_LOGIN_START_SHARING_ADDRESSBOOKS}" />
- </div>
- </div>
- </ui:define>
- </ui:composition>
-</html>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:h="http://xmlns.jcp.org/jsf/html"
- xmlns:f="http://xmlns.jcp.org/jsf/core">
-
- <ui:composition template="/WEB-INF/templates/#{loginController.templateType}/#{loginController.templateType}_base.tpl">
- <ui:define name="login_title">#{msg.PAGE_TITLE_LOGIN_START_SHARING_ADDRESSBOOK}</ui:define>
-
- <ui:define name="content_header">
- #{msg.CONTENT_TITLE_LOGIN_START_SHARING_ADDRESSBOOK}
- </ui:define>
-
- <ui:define name="content">
- <div class="table_big">
-
- <div class="table_header">
- #{msg.TABLE_HEADER_CHOOSE_USER_FOR_SHARING}
- </div>
-
- <div class="para">
- <h:outputText id="userNotLoggedIn" class="notice" value="#{msg.USER_NOT_LOGGED_IN}" rendered="#{not loginController.isUserLoggedIn()}" />
-
- <h:dataTable id="userList" headerClass="table_header_column" var="user" value="#{addressbookController.allUsersNotSharing()}" rendered="#{loginController.isUserLoggedIn() and not empty addressbookController.addressbook and not loginController.isInvisible()}">
-
- <h:column>
- <f:facet name="header">#{msg.USER_ID}</f:facet>
- <h:outputText value="#{user.userId}" />
- </h:column>
-
- <h:column>
- <f:facet name="header">#{msg.USER_NAME}</f:facet>
- <ui:include src="/WEB-INF/templates/generic/user_profile_link.tpl">
- <ui:param name="user" value="#{user}" />
- </ui:include>
- </h:column>
-
- <h:column>
- <f:facet name="header">#{msg.LOGIN_START_SHARING_TITLE}</f:facet>
- <h:form acceptcharset="utf-8" id="startSharing" rendered="#{profileController.isProfileLinkVisibleByUser(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>
- </h:dataTable>
-
- <h:outputText id="addressbokUnset" class="notice" value="#{msg.LOGIN_ADDRESSBOOK_NOT_SET}" rendered="#{empty addressbookController.addressbook}" />
-
- <h:outputText id="ownProfileInvisible" class="notice" value="#{msg.LOGIN_OWN_PROFILE_INVISIBLE}" rendered="#{loginController.isUserLoggedIn() and not empty addressbookController.addressbook and not loginController.isInvisible()}" />
- </div>
-
- <div class="table_footer">
- <ul>
- <li>#{msg.LOGIN_START_SHARING_NOTICE1}</li>
- <li>#{msg.LOGIN_START_SHARING_NOTICE2}</li>
- </ul>
- </div>
- </div>
- </ui:define>
- </ui:composition>
-</html>
<h:outputText id="ownProfileInvible" class="notice" value="#{msg.LOGIN_OWN_PROFILE_INVISIBLE}" rendered="#{loginController.isUserLoggedIn() and loginController.isInvisible()}" />
<ui:fragment rendered="#{loginController.isUserLoggedIn() and not loginController.isInvisible()}">
- <h:link id="startSharing" outcome="login_start_sharing_addressbook" value="#{msg.LINK_LOGIN_START_SHARING_ADDRESSBOOK}" title="#{msg.LINK_LOGIN_START_SHARING_ADDRESSBOOK_TITLE}" rendered="#{addressbookController.isOwnAddressbook()}" />
-
<h:outputText value="Bla bla" rendered="#{addressbookController.isOtherAddressbook()}" />
</ui:fragment>
</f:facet>
<f:facet name="header">#{msg.USER_CREATED}</f:facet>
<h:outputFormat id="userCreated" value="#{user.userCreated.time}" title="#{msg.USER_CREATED_TITLE}" />
</h:column>
-
- <h:column>
- <f:facet name="header">#{msg.USER_LIST_SHARING_ADDRESSBOOKS}</f:facet>
- <ui:fragment rendered="#{loginController.isUserLoggedIn()}">
- <h:link outcome="login_list_sharing_addressbooks" value="#{msg.LINK_LOGIN_LIST_SHARING_ADDRESSBOOKS}" title="#{msg.LINK_LOGIN_LIST_SHARING_ADDRESSBOOKS_TITLE}">
- <f:param name="userId" value="#{user.userId}" />
- </h:link>
- </ui:fragment>
- <ui:fragment rendered="#{loginController.isGuest()}">
- <h:outputText id="userShared" value="#{addressbookController.countAllUserSharedAddressbooks(user)}" />
- </ui:fragment>
- </h:column>
</h:dataTable>
</div>
</ui:define>