roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gma...@apache.org
Subject svn commit: r1553938 - /roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/admin/CreateUser.java
Date Sat, 28 Dec 2013 21:57:02 GMT
Author: gmazza
Date: Sat Dec 28 21:57:01 2013
New Revision: 1553938

URL: http://svn.apache.org/r1553938
Log:
ROL-1616 Use a new backing bean for each Create User so New User page is initialized cleanly
after each save.

Modified:
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/admin/CreateUser.java

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/admin/CreateUser.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/admin/CreateUser.java?rev=1553938&r1=1553937&r2=1553938&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/admin/CreateUser.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/admin/CreateUser.java
Sat Dec 28 21:57:01 2013
@@ -64,16 +64,19 @@ public class CreateUser extends UIAction
         return false;
     }
     
-    
+    private void initializeBean() {
+        // defaults for locale and timezone
+        getBean().setLocale(Locale.getDefault().toString());
+        getBean().setTimeZone(TimeZone.getDefault().getID());
+    }
+
+
     /**
      * Show admin user creation form.
      */
     public String execute() {
         
-        // defaults for locale and timezone
-        getBean().setLocale(Locale.getDefault().toString());
-        getBean().setTimeZone(TimeZone.getDefault().getID());
-        
+        initializeBean();
         return INPUT;
     }
     
@@ -111,10 +114,11 @@ public class CreateUser extends UIAction
                 WebloggerFactory.getWeblogger().flush();
 
                 // TODO: i18n
-                addMessage("New user created");
-
+                addMessage("User " + getBean().getUserName() + " created.  If desired, create
another new user below or" +
+                        " select Cancel to return to User Administration.");
+                setBean(new CreateUserBean());
+                initializeBean();
                 return INPUT;
-
             } catch (WebloggerException e) {
                 log.error("Error adding new user", e);
                 // TODO: i18n



Mime
View raw message