]> git.mxchange.org Git - addressbook-war.git/commitdiff
switch to proper template base
authorRoland Haeder <roland@mxchange.org>
Wed, 14 Oct 2015 13:31:23 +0000 (15:31 +0200)
committerRoland Haeder <roland@mxchange.org>
Wed, 14 Oct 2015 13:31:23 +0000 (15:31 +0200)
Signed-off-by:Roland Häder <roland@mxchange.org>

src/java/org/mxchange/addressbook/beans/login/UserLoginWebBean.java
src/java/org/mxchange/addressbook/beans/login/UserLoginWebController.java
web/user/user_profile.xhtml

index a8ca092867dfeda94d0f626b0d4e29dd294686b1..580b57c31a2bbe348a0c287a48e3b5171cddd67e 100644 (file)
@@ -59,6 +59,12 @@ public class UserLoginWebBean implements UserLoginWebController {
         */
        private UserLoginSessionBeanRemote loginBean;
 
+       /**
+        * Template type for pages that might be displayed in guest area and login
+        * area. Default is guest area.
+        */
+       private String templateType = "guest";
+
        /**
         * User controller
         */
@@ -96,6 +102,9 @@ public class UserLoginWebBean implements UserLoginWebController {
                        // All fine here so set it here
                        this.setLoggedInUser(confirmedUser);
 
+                       // Set template to "login"
+                       this.setTemplateType("login"); //NOI18N
+
                        // All fine
                        return "login"; //NOI18N
                } catch (final UserNotFoundException | UserStatusLockedException | UserStatusUnconfirmedException | UserPasswordMismatchException ex) {
@@ -114,6 +123,16 @@ public class UserLoginWebBean implements UserLoginWebController {
                this.loggedInUser = loggedInUser;
        }
 
+       @Override
+       public String getTemplateType () {
+               return this.templateType;
+       }
+
+       @Override
+       public void setTemplateType (final String templateType) {
+               this.templateType = templateType;
+       }
+
        @Override
        public boolean isUserLoggedIn () {
                // Compare instance
index ff8adf557ab0018365f5d577687865f6bdfc8155..96e785c6fb608ea16eb5b576421c927967b2cd9c 100644 (file)
@@ -26,6 +26,20 @@ import org.mxchange.jusercore.model.user.User;
  */
 public interface UserLoginWebController extends Serializable {
 
+       /**
+        * Getter for template type
+        * <p>
+        * @return Template type
+        */
+       public String getTemplateType ();
+
+       /**
+        * Setter for template type
+        * <p>
+        * @param templateType Template type
+        */
+       public void setTemplateType (final String templateType);
+
        /**
         * Logins the user, if the account is found, confirmed and unlocked.
         * <p>
index 4866ab0fc37f01106918c1294c2541fd66b584a2..33db5830351d6d11fd29fef6c1783708da09e456 100644 (file)
@@ -6,7 +6,7 @@
          xmlns:f="http://xmlns.jcp.org/jsf/core"
          >
 
-       <ui:composition template="/WEB-INF/templates/guest/guest_base.tpl">
+       <ui:composition template="/WEB-INF/templates/#{loginController.templateType}/#{loginController.templateType}_base.tpl">
                <ui:define name="guest_title">#{msg.PAGE_TITLE_INDEX_USER_PROFILE}</ui:define>
 
                <ui:define name="content_header">