/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016 - 2024 Free Software Foundation
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
package org.mxchange.addressbook.beans.profile;
import java.text.MessageFormat;
-import javax.annotation.PostConstruct;
import javax.enterprise.context.RequestScoped;
-import javax.faces.view.facelets.FaceletException;
+import javax.faces.FacesException;
import javax.inject.Inject;
import javax.inject.Named;
-import org.mxchange.addressbook.beans.BaseAddressbookController;
-import org.mxchange.addressbook.beans.login.AddressbookUserLoginWebSessionController;
-import org.mxchange.addressbook.beans.user.AddressbookUserWebSessionController;
+import org.mxchange.addressbook.beans.BaseAddressbookBean;
+import org.mxchange.addressbook.beans.user.list.AddressbookUserListWebViewController;
+import org.mxchange.addressbook.beans.user.login.AddressbookUserLoginWebSessionController;
import org.mxchange.jusercore.exceptions.UserNotFoundException;
import org.mxchange.jusercore.model.user.User;
import org.mxchange.jusercore.model.user.profilemodes.ProfileMode;
*/
@Named (value = "profileController")
@RequestScoped
-public class AddressbookUserProfileWebRequestBean extends BaseAddressbookController implements AddressbookUserProfileWebRequestController {
+public class AddressbookUserProfileWebRequestBean extends BaseAddressbookBean implements AddressbookUserProfileWebRequestController {
/**
* Serial number
private static final long serialVersionUID = 187_687_145_286_710L;
/**
- * User controller
+ * User list controller
*/
@Inject
- private AddressbookUserWebSessionController userController;
+ private AddressbookUserListWebViewController userListController;
/**
* Login controller
* Default constructor
*/
public AddressbookUserProfileWebRequestBean () {
- }
-
- /**
- * Post-construction method
- */
- @PostConstruct
- public void init () {
+ // Call super constructor
+ super();
}
@Override
try {
// Try to get it
- user = this.userController.lookupUserById(userId);
+ user = this.userListController.lookupUserById(userId);
} catch (final UserNotFoundException ex) {
// Throw again
- throw new FaceletException(ex);
+ throw new FacesException(ex);
}
// Is it null?
}
// Get profile mode from user instance (safe now)
- ProfileMode profileMode = user.getUserProfileMode();
+ final ProfileMode profileMode = user.getUserProfileMode();
// Check all conditions (except for admin)
return ((profileMode.equals(ProfileMode.PUBLIC)) ||