roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agillil...@apache.org
Subject svn commit: r538658 - in /roller/trunk: src/org/apache/roller/ui/admin/struts2/ src/org/apache/roller/ui/core/struts2/ web/WEB-INF/ web/WEB-INF/classes/ web/WEB-INF/jsps/authoring/struts2/ web/WEB-INF/jsps/core/struts2/
Date Wed, 16 May 2007 17:33:25 GMT
Author: agilliland
Date: Wed May 16 10:33:22 2007
New Revision: 538658

URL: http://svn.apache.org/viewvc?view=rev&rev=538658
Log:
a quick pass at struts2 cleanup work on core ui actions.

1. renamed a few classes to provide shorter and more concise names.

2. removed some unnecessary code.

3. moved code for sending activation email from Register action to MailUtil.

4. a bit of cleanup on some of the jsps to fix formatting or other little bugs.


Added:
    roller/trunk/src/org/apache/roller/ui/core/struts2/CreateWeblog.java
      - copied, changed from r538326, roller/trunk/src/org/apache/roller/ui/core/struts2/CreateWeblogForm.java
    roller/trunk/src/org/apache/roller/ui/core/struts2/CreateWeblogBean.java
      - copied, changed from r538326, roller/trunk/src/org/apache/roller/ui/core/struts2/CreateWeblogFormBean.java
    roller/trunk/src/org/apache/roller/ui/core/struts2/Profile.java
      - copied, changed from r538326, roller/trunk/src/org/apache/roller/ui/core/struts2/ProfileForm.java
    roller/trunk/src/org/apache/roller/ui/core/struts2/ProfileBean.java
      - copied, changed from r538326, roller/trunk/src/org/apache/roller/ui/core/struts2/RegisterFormBean.java
    roller/trunk/src/org/apache/roller/ui/core/struts2/Register.java
      - copied, changed from r538326, roller/trunk/src/org/apache/roller/ui/core/struts2/RegisterForm.java
    roller/trunk/web/WEB-INF/jsps/core/struts2/CreateWeblog.jsp
      - copied unchanged from r538326, roller/trunk/web/WEB-INF/jsps/core/struts2/CreateWeblogForm.jsp
    roller/trunk/web/WEB-INF/jsps/core/struts2/Profile.jsp
      - copied, changed from r538326, roller/trunk/web/WEB-INF/jsps/core/struts2/ProfileForm.jsp
    roller/trunk/web/WEB-INF/jsps/core/struts2/Register.jsp
      - copied, changed from r538326, roller/trunk/web/WEB-INF/jsps/core/struts2/RegisterForm.jsp
Removed:
    roller/trunk/src/org/apache/roller/ui/core/struts2/CreateWeblogForm.java
    roller/trunk/src/org/apache/roller/ui/core/struts2/CreateWeblogFormBean.java
    roller/trunk/src/org/apache/roller/ui/core/struts2/ProfileForm.java
    roller/trunk/src/org/apache/roller/ui/core/struts2/RegisterForm.java
    roller/trunk/src/org/apache/roller/ui/core/struts2/RegisterFormBean.java
    roller/trunk/web/WEB-INF/jsps/core/struts2/CreateWeblogForm.jsp
    roller/trunk/web/WEB-INF/jsps/core/struts2/ProfileForm.jsp
    roller/trunk/web/WEB-INF/jsps/core/struts2/RegisterForm.jsp
Modified:
    roller/trunk/src/org/apache/roller/ui/admin/struts2/CreateUser.java
    roller/trunk/src/org/apache/roller/ui/admin/struts2/CreateUserBean.java
    roller/trunk/src/org/apache/roller/ui/core/struts2/MainMenu.java
    roller/trunk/web/WEB-INF/classes/struts.xml
    roller/trunk/web/WEB-INF/jsps/authoring/struts2/Comments.jsp
    roller/trunk/web/WEB-INF/jsps/core/struts2/MainMenu.jsp
    roller/trunk/web/WEB-INF/jsps/core/struts2/MainMenuSidebar.jsp
    roller/trunk/web/WEB-INF/tiles.xml

Modified: roller/trunk/src/org/apache/roller/ui/admin/struts2/CreateUser.java
URL: http://svn.apache.org/viewvc/roller/trunk/src/org/apache/roller/ui/admin/struts2/CreateUser.java?view=diff&rev=538658&r1=538657&r2=538658
==============================================================================
--- roller/trunk/src/org/apache/roller/ui/admin/struts2/CreateUser.java (original)
+++ roller/trunk/src/org/apache/roller/ui/admin/struts2/CreateUser.java Wed May 16 10:33:22
2007
@@ -29,7 +29,7 @@
 import org.apache.roller.business.UserManager;
 import org.apache.roller.config.RollerConfig;
 import org.apache.roller.pojos.UserData;
-import org.apache.roller.ui.core.struts2.RegisterForm;
+import org.apache.roller.ui.core.struts2.Register;
 import org.apache.roller.ui.core.util.struts2.UIAction;
 
 
@@ -131,7 +131,7 @@
         
         String allowed = RollerConfig.getProperty("username.allowedChars");
         if(allowed == null || allowed.trim().length() == 0) {
-            allowed = RegisterForm.DEFAULT_ALLOWED_CHARS;
+            allowed = Register.DEFAULT_ALLOWED_CHARS;
         }
         String safe = CharSetUtils.keep(getBean().getUserName(), allowed);
         

Modified: roller/trunk/src/org/apache/roller/ui/admin/struts2/CreateUserBean.java
URL: http://svn.apache.org/viewvc/roller/trunk/src/org/apache/roller/ui/admin/struts2/CreateUserBean.java?view=diff&rev=538658&r1=538657&r2=538658
==============================================================================
--- roller/trunk/src/org/apache/roller/ui/admin/struts2/CreateUserBean.java (original)
+++ roller/trunk/src/org/apache/roller/ui/admin/struts2/CreateUserBean.java Wed May 16 10:33:22
2007
@@ -20,7 +20,6 @@
 
 import java.util.Locale;
 import org.apache.roller.pojos.UserData;
-import org.apache.roller.ui.core.struts2.RegisterFormBean;
 
 
 /**

Copied: roller/trunk/src/org/apache/roller/ui/core/struts2/CreateWeblog.java (from r538326,
roller/trunk/src/org/apache/roller/ui/core/struts2/CreateWeblogForm.java)
URL: http://svn.apache.org/viewvc/roller/trunk/src/org/apache/roller/ui/core/struts2/CreateWeblog.java?view=diff&rev=538658&p1=roller/trunk/src/org/apache/roller/ui/core/struts2/CreateWeblogForm.java&r1=538326&p2=roller/trunk/src/org/apache/roller/ui/core/struts2/CreateWeblog.java&r2=538658
==============================================================================
--- roller/trunk/src/org/apache/roller/ui/core/struts2/CreateWeblogForm.java (original)
+++ roller/trunk/src/org/apache/roller/ui/core/struts2/CreateWeblog.java Wed May 16 10:33:22
2007
@@ -26,13 +26,11 @@
 import org.apache.roller.RollerException;
 import org.apache.roller.config.RollerConfig;
 import org.apache.roller.config.RollerRuntimeConfig;
-import org.apache.roller.business.Roller;
 import org.apache.roller.business.RollerFactory;
 import org.apache.roller.business.themes.ThemeManager;
 import org.apache.roller.business.UserManager;
 import org.apache.roller.pojos.UserData;
 import org.apache.roller.pojos.WebsiteData;
-import org.apache.roller.ui.core.struts.actions.CreateWebsiteAction.CreateWebsitePageModel;
 import org.apache.roller.ui.core.util.struts2.UIAction;
 import org.apache.roller.util.Utilities;
 
@@ -40,14 +38,14 @@
 /**
  * Allows user to create a new website.
  */
-public class CreateWeblogForm extends UIAction {
+public class CreateWeblog extends UIAction {
     
-    private static Log log = LogFactory.getLog(CreateWeblogForm.class);
+    private static Log log = LogFactory.getLog(CreateWeblog.class);
     
-    private CreateWeblogFormBean bean = new CreateWeblogFormBean();
+    private CreateWeblogBean bean = new CreateWeblogBean();
     
 
-    public CreateWeblogForm() {
+    public CreateWeblog() {
         this.pageTitle = "createWebsite.title";
     }
     
@@ -138,16 +136,17 @@
                 UserManager mgr = RollerFactory.getRoller().getUserManager();
                 mgr.addWebsite(wd);
                 RollerFactory.getRoller().flush();
+                
+                // tell the user their weblog was created
+                addMessage("createWebsite.created", getBean().getHandle());
+                
+                return SUCCESS;
+                
             } catch (RollerException e) {
                 log.error("ERROR adding weblog", e);
                 // TODO: error handling
                 addError(e.getMessage());
             }
-
-            // tell the user their weblog was created
-            addMessage("createWebsite.created", getBean().getHandle());
-            
-            return SUCCESS;
             
         }
         
@@ -160,7 +159,7 @@
         
         String allowed = RollerConfig.getProperty("username.allowedChars");
         if(allowed == null || allowed.trim().length() == 0) {
-            allowed = RegisterForm.DEFAULT_ALLOWED_CHARS;
+            allowed = Register.DEFAULT_ALLOWED_CHARS;
         }
         String safe = CharSetUtils.keep(getBean().getHandle(), allowed);
         
@@ -178,7 +177,7 @@
             addError("createWeblog.error.missingEmailAddress");
         }
         
-        try {
+        if(!StringUtils.isEmpty(getBean().getHandle())) try {
             UserManager mgr = RollerFactory.getRoller().getUserManager();
             if (mgr.getWebsiteByHandle(getBean().getHandle()) != null) {
                 addError("createWeblog.error.handleExists");
@@ -199,11 +198,11 @@
     }
     
     
-    public CreateWeblogFormBean getBean() {
+    public CreateWeblogBean getBean() {
         return bean;
     }
 
-    public void setBean(CreateWeblogFormBean bean) {
+    public void setBean(CreateWeblogBean bean) {
         this.bean = bean;
     }
     

Copied: roller/trunk/src/org/apache/roller/ui/core/struts2/CreateWeblogBean.java (from r538326,
roller/trunk/src/org/apache/roller/ui/core/struts2/CreateWeblogFormBean.java)
URL: http://svn.apache.org/viewvc/roller/trunk/src/org/apache/roller/ui/core/struts2/CreateWeblogBean.java?view=diff&rev=538658&p1=roller/trunk/src/org/apache/roller/ui/core/struts2/CreateWeblogFormBean.java&r1=538326&p2=roller/trunk/src/org/apache/roller/ui/core/struts2/CreateWeblogBean.java&r2=538658
==============================================================================
--- roller/trunk/src/org/apache/roller/ui/core/struts2/CreateWeblogFormBean.java (original)
+++ roller/trunk/src/org/apache/roller/ui/core/struts2/CreateWeblogBean.java Wed May 16 10:33:22
2007
@@ -25,7 +25,7 @@
 /**
  * form bean use by CreateWeblogForm.
  */
-public class CreateWeblogFormBean {
+public class CreateWeblogBean {
     
     private String handle;
     private String name;
@@ -90,15 +90,6 @@
     
     public void setTimeZone(String timeZone) {
         this.timeZone = timeZone;
-    }
-    
-    
-    public void copyTo(WebsiteData wd, Locale locale) {
-        wd.setHandle(handle);
-        wd.setName(name);
-        wd.setDescription(description);
-        wd.setLocale(this.locale);
-        wd.setTimeZone(timeZone);
     }
     
 }

Modified: roller/trunk/src/org/apache/roller/ui/core/struts2/MainMenu.java
URL: http://svn.apache.org/viewvc/roller/trunk/src/org/apache/roller/ui/core/struts2/MainMenu.java?view=diff&rev=538658&r1=538657&r2=538658
==============================================================================
--- roller/trunk/src/org/apache/roller/ui/core/struts2/MainMenu.java (original)
+++ roller/trunk/src/org/apache/roller/ui/core/struts2/MainMenu.java Wed May 16 10:33:22 2007
@@ -159,18 +159,6 @@
         }
     }
     
-    public boolean isGroupBloggingEnabled() {
-        return RollerConfig.getBooleanProperty("groupblogging.enabled");
-    }
-    
-    public boolean isPlanetAggregated() {
-        return RollerConfig.getBooleanProperty("planet.aggregator.enabled");
-    }
-    
-    public boolean isUserAdmin() {
-        return getAuthenticatedUser().hasRole("admin");
-    }
-    
 
     public String getWebsiteId() {
         return websiteId;

Copied: roller/trunk/src/org/apache/roller/ui/core/struts2/Profile.java (from r538326, roller/trunk/src/org/apache/roller/ui/core/struts2/ProfileForm.java)
URL: http://svn.apache.org/viewvc/roller/trunk/src/org/apache/roller/ui/core/struts2/Profile.java?view=diff&rev=538658&p1=roller/trunk/src/org/apache/roller/ui/core/struts2/ProfileForm.java&r1=538326&p2=roller/trunk/src/org/apache/roller/ui/core/struts2/Profile.java&r2=538658
==============================================================================
--- roller/trunk/src/org/apache/roller/ui/core/struts2/ProfileForm.java (original)
+++ roller/trunk/src/org/apache/roller/ui/core/struts2/Profile.java Wed May 16 10:33:22 2007
@@ -18,14 +18,12 @@
 
 package org.apache.roller.ui.core.struts2;
 
-import org.apache.commons.lang.CharSetUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.roller.RollerException;
 import org.apache.roller.business.RollerFactory;
 import org.apache.roller.business.UserManager;
-import org.apache.roller.config.RollerConfig;
 import org.apache.roller.pojos.UserData;
 import org.apache.roller.ui.core.util.struts2.UIAction;
 
@@ -35,14 +33,14 @@
  *
  * TODO: check on the impact of deleting that cookieLogin stuff
  */
-public class ProfileForm extends UIAction {
+public class Profile extends UIAction {
     
-    private static Log log = LogFactory.getLog(ProfileForm.class);
+    private static Log log = LogFactory.getLog(Profile.class);
     
-    private RegisterFormBean bean = new RegisterFormBean();
+    private ProfileBean bean = new ProfileBean();
     
     
-    public ProfileForm() {
+    public Profile() {
         this.pageTitle = "yourProfile.title";
     }
     
@@ -57,7 +55,7 @@
         UserData ud = getAuthenticatedUser();
         
         // load up the form from the users existing profile data
-        getBean().copyFrom(ud, getLocale());
+        getBean().copyFrom(ud);
         getBean().setPasswordText(null);
         getBean().setPasswordConfirm(null);
         getBean().setLocale(ud.getLocale());
@@ -132,11 +130,11 @@
     }
     
     
-    public RegisterFormBean getBean() {
+    public ProfileBean getBean() {
         return bean;
     }
 
-    public void setBean(RegisterFormBean bean) {
+    public void setBean(ProfileBean bean) {
         this.bean = bean;
     }
     

Copied: roller/trunk/src/org/apache/roller/ui/core/struts2/ProfileBean.java (from r538326,
roller/trunk/src/org/apache/roller/ui/core/struts2/RegisterFormBean.java)
URL: http://svn.apache.org/viewvc/roller/trunk/src/org/apache/roller/ui/core/struts2/ProfileBean.java?view=diff&rev=538658&p1=roller/trunk/src/org/apache/roller/ui/core/struts2/RegisterFormBean.java&r1=538326&p2=roller/trunk/src/org/apache/roller/ui/core/struts2/ProfileBean.java&r2=538658
==============================================================================
--- roller/trunk/src/org/apache/roller/ui/core/struts2/RegisterFormBean.java (original)
+++ roller/trunk/src/org/apache/roller/ui/core/struts2/ProfileBean.java Wed May 16 10:33:22
2007
@@ -18,16 +18,13 @@
 
 package org.apache.roller.ui.core.struts2;
 
-import java.util.Date;
-import java.util.Locale;
-import org.apache.roller.RollerException;
 import org.apache.roller.pojos.UserData;
 
 
 /**
  * A simple bean for managing the form data used by the RegisterForm.
  */
-public class RegisterFormBean {
+public class ProfileBean {
     
     private String id = null;
     private String userName = null;
@@ -123,7 +120,7 @@
     }
     
     
-    public void copyTo(UserData dataHolder, Locale locale) {
+    public void copyTo(UserData dataHolder) {
         
         dataHolder.setScreenName(this.screenName);
         dataHolder.setFullName(this.fullName);
@@ -133,7 +130,7 @@
     }
     
     
-    public void copyFrom(UserData dataHolder, Locale locale) {
+    public void copyFrom(UserData dataHolder) {
         
         this.id = dataHolder.getId();
         this.userName = dataHolder.getUserName();

Copied: roller/trunk/src/org/apache/roller/ui/core/struts2/Register.java (from r538326, roller/trunk/src/org/apache/roller/ui/core/struts2/RegisterForm.java)
URL: http://svn.apache.org/viewvc/roller/trunk/src/org/apache/roller/ui/core/struts2/Register.java?view=diff&rev=538658&p1=roller/trunk/src/org/apache/roller/ui/core/struts2/RegisterForm.java&r1=538326&p2=roller/trunk/src/org/apache/roller/ui/core/struts2/Register.java&r2=538658
==============================================================================
--- roller/trunk/src/org/apache/roller/ui/core/struts2/RegisterForm.java (original)
+++ roller/trunk/src/org/apache/roller/ui/core/struts2/Register.java Wed May 16 10:33:22 2007
@@ -18,15 +18,9 @@
 
 package org.apache.roller.ui.core.struts2;
 
-import java.text.MessageFormat;
 import java.util.Locale;
-import java.util.ResourceBundle;
 import java.util.TimeZone;
 import java.util.UUID;
-import javax.mail.MessagingException;
-import javax.mail.Session;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
 import javax.servlet.http.HttpServletRequest;
 import org.apache.commons.lang.CharSetUtils;
 import org.apache.commons.lang.StringUtils;
@@ -47,9 +41,9 @@
 /**
  * Actions for registering a new user.
  */
-public class RegisterForm extends UIAction implements ServletRequestAware {
+public class Register extends UIAction implements ServletRequestAware {
     
-    private static Log log = LogFactory.getLog(RegisterForm.class);
+    private static Log log = LogFactory.getLog(Register.class);
     
     public static String DEFAULT_ALLOWED_CHARS = "A-Za-z0-9";
     
@@ -60,10 +54,10 @@
     private String activationStatus = null;
     
     private String activationCode = null;
-    private RegisterFormBean bean = new RegisterFormBean();
+    private ProfileBean bean = new ProfileBean();
     
     
-    public RegisterForm() {
+    public Register() {
         this.pageTitle = "newUser.addNewUser";
     }
     
@@ -85,24 +79,25 @@
             return "disabled";
         }
         
-        try {
-            getBean().setLocale(Locale.getDefault().toString());
-            getBean().setTimeZone(TimeZone.getDefault().getID());
+        // set some defaults
+        getBean().setLocale(Locale.getDefault().toString());
+        getBean().setTimeZone(TimeZone.getDefault().getID());
             
+        try {
             // Let's see if there's any user-authentication available from Acegi
             // and retrieve custom user data to pre-populate form.
             boolean usingSSO = RollerConfig.getBooleanProperty("users.sso.enabled");
             if(usingSSO) {
                 UserData fromSSO = CustomUserRegistry.getUserDetailsFromAuthentication();
                 if(fromSSO != null) {
-                    getBean().copyFrom(fromSSO, getLocale());
+                    getBean().copyFrom(fromSSO);
                     setFromSS0(true);
                 }
             }
             
-        } catch (Exception e) {
-            addError("error.editing.user", e.toString());
-            log.error("ERROR in newUser", e);
+        } catch (Exception ex) {
+            log.error("Error reading SSO user data", ex);
+            addError("error.editing.user", ex.toString());
         }
         
         return INPUT;
@@ -129,7 +124,7 @@
             
             // copy form data into new user pojo
             UserData ud = new UserData();
-            getBean().copyTo(ud, getLocale()); // doesn't copy password
+            getBean().copyTo(ud); // doesn't copy password
             ud.setId(null);
             ud.setDateCreated(new java.util.Date());
             ud.setEnabled(Boolean.TRUE);
@@ -178,8 +173,12 @@
             
             // now send activation email if necessary
             if (activationEnabled && ud.getActivationCode() != null) {
-                // send activation mail to the user
-                sendActivationMail(ud);
+                try {
+                    // send activation mail to the user
+                    MailUtil.sendUserActivationEmail(ud);
+                } catch (RollerException ex) {
+                    log.error("Error sending activation email to - "+ud.getEmailAddress(),
ex);
+                }
                 
                 setActivationStatus("pending");
             }
@@ -194,9 +193,10 @@
             
             return SUCCESS;
             
-        } catch (RollerException e) {
-            addError(e.getMessage());
-            log.error("ERROR in addUser", e);
+        } catch (RollerException ex) {
+            log.error("Error adding new user", ex);
+            // TODO: i18n
+            addError("Error adding new user");
         }
         
         return INPUT;
@@ -287,86 +287,6 @@
     }
     
     
-    /**
-     * Send activation mail
-     */
-    private void sendActivationMail(UserData user) {
-        
-        try {
-            javax.naming.Context ctx = (javax.naming.Context)
-            new InitialContext().lookup("java:comp/env");
-            Session mailSession = (Session) ctx.lookup("mail/Session");
-            if (mailSession != null) {
-                ResourceBundle resources = ResourceBundle.getBundle(
-                        "ApplicationResources", getLocaleInstance(user.getLocale()));
-                
-                String from = RollerRuntimeConfig.getProperty(
-                        "user.account.activation.mail.from");
-                
-                String cc[] = new String[0];
-                String bcc[] = new String[0];
-                String to[] = new String[] { user.getEmailAddress() };
-                String subject = resources.getString(
-                        "user.account.activation.mail.subject");
-                String content;
-                
-                String rootURL = RollerRuntimeConfig.getAbsoluteContextURL();
-                
-                StringBuffer sb = new StringBuffer();
-                
-                // activationURL=
-                String activationURL = rootURL
-                        + "/roller-ui/register!activate.rol?activationCode="
-                        + user.getActivationCode();
-                sb.append(MessageFormat.format(
-                        resources.getString("user.account.activation.mail.content"),
-                        new Object[] { user.getFullName(), user.getUserName(),
-                        activationURL }));
-                content = sb.toString();
-                
-                MailUtil.sendHTMLMessage(mailSession, from, to, cc, bcc, subject, content);
-            }
-            
-        } catch (MessagingException me) {
-            addError("error.add.user.mailSendException");
-            log.debug("ERROR sending email", me);
-        } catch (NamingException ne) {
-            addError("error.add.user.mailSetupException");
-            log.error("ERROR in mail setup?", ne);
-        }
-    }
-    
-    
-    /**
-     * Copied from WebsiteData.java by sedat
-     */
-    private Locale getLocaleInstance(String locale) {
-        if (locale != null) {
-            String[] localeStr = StringUtils.split(locale, "_");
-            if (localeStr.length == 1) {
-                if (localeStr[0] == null)
-                    localeStr[0] = "";
-                return new Locale(localeStr[0]);
-            } else if (localeStr.length == 2) {
-                if (localeStr[0] == null)
-                    localeStr[0] = "";
-                if (localeStr[1] == null)
-                    localeStr[1] = "";
-                return new Locale(localeStr[0], localeStr[1]);
-            } else if (localeStr.length == 3) {
-                if (localeStr[0] == null)
-                    localeStr[0] = "";
-                if (localeStr[1] == null)
-                    localeStr[1] = "";
-                if (localeStr[2] == null)
-                    localeStr[2] = "";
-                return new Locale(localeStr[0], localeStr[1], localeStr[2]);
-            }
-        }
-        return Locale.getDefault();
-    }
-    
-    
     public HttpServletRequest getServletRequest() {
         return servletRequest;
     }
@@ -375,11 +295,11 @@
         this.servletRequest = servletRequest;
     }
     
-    public RegisterFormBean getBean() {
+    public ProfileBean getBean() {
         return bean;
     }
 
-    public void setBean(RegisterFormBean bean) {
+    public void setBean(ProfileBean bean) {
         this.bean = bean;
     }
 

Modified: roller/trunk/web/WEB-INF/classes/struts.xml
URL: http://svn.apache.org/viewvc/roller/trunk/web/WEB-INF/classes/struts.xml?view=diff&rev=538658&r1=538657&r2=538658
==============================================================================
--- roller/trunk/web/WEB-INF/classes/struts.xml (original)
+++ roller/trunk/web/WEB-INF/classes/struts.xml Wed May 16 10:33:22 2007
@@ -90,22 +90,22 @@
         </action>
         
         <action name="register!*" method="{1}"
-                class="org.apache.roller.ui.core.struts2.RegisterForm">
-            <result name="input" type="tiles">.RegisterForm</result>
+                class="org.apache.roller.ui.core.struts2.Register">
+            <result name="input" type="tiles">.Register</result>
             <result name="cancel" type="redirect">/</result>
             <result name="success" type="tiles">.Welcome</result>
         </action>
         
         <action name="profile!*" method="{1}"
-                class="org.apache.roller.ui.core.struts2.ProfileForm">
-            <result name="input" type="tiles">.ProfileForm</result>
+                class="org.apache.roller.ui.core.struts2.Profile">
+            <result name="input" type="tiles">.Profile</result>
             <result name="cancel" type="redirect-action">menu</result>
-            <result name="success" type="tiles">.ProfileForm</result>
+            <result name="success" type="tiles">.Profile</result>
         </action>
         
         <action name="createWeblog!*" method="{1}"
-                class="org.apache.roller.ui.core.struts2.CreateWeblogForm">
-            <result name="input" type="tiles">.CreateWeblogForm</result>
+                class="org.apache.roller.ui.core.struts2.CreateWeblog">
+            <result name="input" type="tiles">.CreateWeblog</result>
             <result name="cancel" type="redirect-action">menu</result>
             <result name="success" type="chain">menu</result>
         </action>

Modified: roller/trunk/web/WEB-INF/jsps/authoring/struts2/Comments.jsp
URL: http://svn.apache.org/viewvc/roller/trunk/web/WEB-INF/jsps/authoring/struts2/Comments.jsp?view=diff&rev=538658&r1=538657&r2=538658
==============================================================================
--- roller/trunk/web/WEB-INF/jsps/authoring/struts2/Comments.jsp (original)
+++ roller/trunk/web/WEB-INF/jsps/authoring/struts2/Comments.jsp Wed May 16 10:33:22 2007
@@ -345,8 +345,6 @@
 <%-- ========================================================= --%>
             
 <s:submit key="commentManagement.update" />
-&nbsp;
-<s:submit key="application.cancel" action="comments" />
 
 </s:form>
 

Modified: roller/trunk/web/WEB-INF/jsps/core/struts2/MainMenu.jsp
URL: http://svn.apache.org/viewvc/roller/trunk/web/WEB-INF/jsps/core/struts2/MainMenu.jsp?view=diff&rev=538658&r1=538657&r2=538658
==============================================================================
--- roller/trunk/web/WEB-INF/jsps/core/struts2/MainMenu.jsp (original)
+++ roller/trunk/web/WEB-INF/jsps/core/struts2/MainMenu.jsp Wed May 16 10:33:22 2007
@@ -29,18 +29,18 @@
     
     <s:iterator id="invite" value="pendingPermissions">
         <s:text name="yourWebsites.youAreInvited" >
-            <s:param value="invite.website.handle" />
+            <s:param value="#invite.website.handle" />
         </s:text>
         
         <s:url action="menu!accept" id="acceptInvite">
-            <s:param name="inviteId" value="invite.id" />
+            <s:param name="inviteId" value="#invite.id" />
         </s:url>
         <a href='<s:property value="acceptInvite" />'>
             <s:text name="yourWebsites.accept" />
         </a> 
         &nbsp;|&nbsp;
         <s:url action="menu!decline" id="declineInvite">
-            <s:param name="inviteId" value="invite.id" />
+            <s:param name="inviteId" value="#invite.id" />
         </s:url>
         <a href='<s:property value="declineInvite" />'>
             <s:text name="yourWebsites.decline" />
@@ -104,33 +104,27 @@
                
                <td class="mm_table_actions" width="20%" align="left" >
 
-                       <s:url action="weblog" id="newEntry">
-                           <s:param name="method" value="create" />
+                       <s:url action="entryAdd" namespace="/roller-ui/authoring" id="newEntry">
                            <s:param name="weblog" value="#perms.website.handle" />
                        </s:url>
                        <img src='<s:url value="/images/table_edit.png"/>' />
-                       <a href='<s:property value="newEntry" />'>
-                           <s:text name="yourWebsites.newEntry" /></a>
+                       <s:a href="%{newEntry}"><s:text name="yourWebsites.newEntry"
/></s:a>
                        <br />
 
                        <%-- Show Entries link with count, TODO: show N/M where N is draft,
M is published --%>
-                       <s:url action="weblogEntryManagement" id="editEntries">
-                           <s:param name="method" value="query" />
+                       <s:url action="entries" namespace="/roller-ui/authoring" id="editEntries">
                            <s:param name="weblog" value="#perms.website.handle" />
                        </s:url>
                        <img src='<s:url value="/images/table_multiple.png"/>' />
-                       <a href='<s:property value="editEntries" />'>
-                           <s:text name="yourWebsites.editEntries" /> (<s:property
value="#perms.website.entryCount" />)</a> 
+                       <s:a href="%{editEntries}"><s:text name="yourWebsites.editEntries"
/> (<s:property value="#perms.website.entryCount" />)</s:a> 
                        <br />
 
                        <%-- Show Comments link with count, TODO: show N/M where N is pending,
M is approved --%>
-                       <s:url action="commentManagement" id="manageComments">
-                           <s:param name="method" value="query" />
+                       <s:url action="comments" namespace="/roller-ui/authoring" id="manageComments">
                            <s:param name="weblog" value="#perms.website.handle" />
                        </s:url>
                        <img src='<s:url value="/images/page_white_edit.png"/>' />
-                       <a href='<s:property value="manageComments" />'>
-                           <s:text name="yourWebsites.manageComments" /> (<s:property
value="#perms.website.commentCount" />)</a> 
+                       <s:a href="%{manageComments}"><s:text name="yourWebsites.manageComments"
/> (<s:property value="#perms.website.commentCount" />)</s:a> 
                        <br />
                        
                        <s:if test="#perms.permissionMask == 3">
@@ -146,8 +140,8 @@
                        <%-- authors and limited bloggers can resign, but admin cannot
resign if he/she is the last admin in the blog --%>
                        <s:if test="#perms.permissionMask == 0 || #perms.permissionMask
== 1 || #perms.website.adminUserCount > 1">
                           <img src='<c:url value="/images/delete.png"/>' />
-                          <s:url value="menu!resign" id="resignWeblog">
-                               <s:param name="weblog" value="#perms.website.handle" />
+                          <s:url action="menu!resign" id="resignWeblog">
+                               <s:param name="websiteId" value="#perms.website.id" />
                           </s:url>
                           <a href='<s:property value="resignWeblog" />'>
                               <s:text name='yourWebsites.resign' />

Modified: roller/trunk/web/WEB-INF/jsps/core/struts2/MainMenuSidebar.jsp
URL: http://svn.apache.org/viewvc/roller/trunk/web/WEB-INF/jsps/core/struts2/MainMenuSidebar.jsp?view=diff&rev=538658&r1=538657&r2=538658
==============================================================================
--- roller/trunk/web/WEB-INF/jsps/core/struts2/MainMenuSidebar.jsp (original)
+++ roller/trunk/web/WEB-INF/jsps/core/struts2/MainMenuSidebar.jsp Wed May 16 10:33:22 2007
@@ -26,7 +26,7 @@
                 
                 <hr size="1" noshade="noshade" />
                 
-                <s:if test="groupBloggingEnabled || (existingPermissions.isEmpty &&
pendingPermissions.isEmpty)">
+                <s:if test="getBooleanProp('groupblogging.enabled') || (existingPermissions.isEmpty
&& pendingPermissions.isEmpty)">
                     <h3><a href="<s:url action="createWeblog" />"><s:text
name="yourWebsites.createWeblog" /></a></h3>
                     <p><s:text name="yourWebsites.createWeblog.desc" /></p>
                 </s:if>
@@ -34,11 +34,11 @@
                 <h3><a href="<s:url action="profile"/>"><s:text name="yourWebsites.editProfile"
/></a></h3>
                 <p><s:text name="yourWebsites.editProfile.desc" /></p>
                 
-                <s:if test="userAdmin">               
+                <s:if test="userIsAdmin">               
                     <h3><a href="<s:url action="globalConfig" namespace="/roller-ui/admin"
/>"><s:text name="yourWebsites.globalAdmin" /></a></h3>          
                     <p><s:text name="yourWebsites.globalAdmin.desc" /></p>
                     
-                    <s:if test="planetAggregated">               
+                    <s:if test="getBooleanProp('planet.aggregator.enabled')">     
         
                         <h3><a href="<s:url action="planetConfig" namespace="/roller-ui/admin"
/>"><s:text name="yourWebsites.planetAdmin" /></a></h3>
                         <p><s:text name="yourWebsites.planetAdmin.desc" /></p>
                     </s:if>

Copied: roller/trunk/web/WEB-INF/jsps/core/struts2/Profile.jsp (from r538326, roller/trunk/web/WEB-INF/jsps/core/struts2/ProfileForm.jsp)
URL: http://svn.apache.org/viewvc/roller/trunk/web/WEB-INF/jsps/core/struts2/Profile.jsp?view=diff&rev=538658&p1=roller/trunk/web/WEB-INF/jsps/core/struts2/ProfileForm.jsp&r1=538326&p2=roller/trunk/web/WEB-INF/jsps/core/struts2/Profile.jsp&r2=538658
==============================================================================
--- roller/trunk/web/WEB-INF/jsps/core/struts2/ProfileForm.jsp (original)
+++ roller/trunk/web/WEB-INF/jsps/core/struts2/Profile.jsp Wed May 16 10:33:22 2007
@@ -31,18 +31,6 @@
 </tr>
 
 <tr>
-    <td class="label"><label for="screenName" /><s:text name="userSettings.screenname"
/></label></td>
-    <td class="field"><s:textfield name="bean.screenName" size="30" maxlength="30"
/></td>
-    <td class="description"><s:text name="userRegister.tip.screenName" /></td>
-</tr>
-
-<tr>
-    <td class="label"><label for="fullName" /><s:text name="userSettings.fullname"
/></label></td>
-    <td class="field"><s:textfield name="bean.fullName" size="30" maxlength="30"
/></td>
-    <td class="description"><s:text name="userRegister.tip.fullName" /></td>
-</tr>
-
-<tr>
     <td class="label"><label for="passwordText" /><s:text name="userSettings.password"
/></label></td>
     <td class="field">
         <s:password name="bean.passwordText" size="20" maxlength="20" />
@@ -54,6 +42,18 @@
     <td class="label"><label for="passwordConfirm" /><s:text name="userSettings.passwordConfirm"
/></label></td>
     <td class="field"><s:password name="bean.passwordConfirm" size="20" maxlength="20"
/></td>
     <td class="description"><s:text name="userRegister.tip.passwordConfirm" /></td>
+</tr>
+
+<tr>
+    <td class="label"><label for="screenName" /><s:text name="userSettings.screenname"
/></label></td>
+    <td class="field"><s:textfield name="bean.screenName" size="30" maxlength="30"
/></td>
+    <td class="description"><s:text name="userRegister.tip.screenName" /></td>
+</tr>
+
+<tr>
+    <td class="label"><label for="fullName" /><s:text name="userSettings.fullname"
/></label></td>
+    <td class="field"><s:textfield name="bean.fullName" size="30" maxlength="30"
/></td>
+    <td class="description"><s:text name="userRegister.tip.fullName" /></td>
 </tr>
     
 <tr>

Copied: roller/trunk/web/WEB-INF/jsps/core/struts2/Register.jsp (from r538326, roller/trunk/web/WEB-INF/jsps/core/struts2/RegisterForm.jsp)
URL: http://svn.apache.org/viewvc/roller/trunk/web/WEB-INF/jsps/core/struts2/Register.jsp?view=diff&rev=538658&p1=roller/trunk/web/WEB-INF/jsps/core/struts2/RegisterForm.jsp&r1=538326&p2=roller/trunk/web/WEB-INF/jsps/core/struts2/Register.jsp&r2=538658
==============================================================================
--- roller/trunk/web/WEB-INF/jsps/core/struts2/RegisterForm.jsp (original)
+++ roller/trunk/web/WEB-INF/jsps/core/struts2/Register.jsp Wed May 16 10:33:22 2007
@@ -25,19 +25,7 @@
 
 <table class="formtable">
 
-<tr>
-    <td class="label"><label for="screenName" /><s:text name="userSettings.screenname"
/></label></td>
-    <td class="field"><s:textfield name="bean.screenName" size="30" maxlength="30"
/></td>
-    <td class="description"><s:text name="userRegister.tip.screenName" /></td>
-</tr>
-
-<tr>
-    <td class="label"><label for="fullName" /><s:text name="userSettings.fullname"
/></label></td>
-    <td class="field"><s:textfield name="bean.fullName" size="30" maxlength="30"
/></td>
-    <td class="description"><s:text name="userRegister.tip.fullName" /></td>
-</tr>
-
-<s:if test="fromSSO">
+    <s:if test="fromSSO">
 <tr>
     <td class="label"><label for="userName" /><s:text name="userSettings.username"
/></label></td>
     <td class="field"><strong><s:property value="bean.userName" /></strong></td>
@@ -66,6 +54,18 @@
     <td class="description"><s:text name="userRegister.tip.passwordConfirm" /></td>
 </tr>
 </s:else>
+
+<tr>
+    <td class="label"><label for="screenName" /><s:text name="userSettings.screenname"
/></label></td>
+    <td class="field"><s:textfield name="bean.screenName" size="30" maxlength="30"
/></td>
+    <td class="description"><s:text name="userRegister.tip.screenName" /></td>
+</tr>
+
+<tr>
+    <td class="label"><label for="fullName" /><s:text name="userSettings.fullname"
/></label></td>
+    <td class="field"><s:textfield name="bean.fullName" size="30" maxlength="30"
/></td>
+    <td class="description"><s:text name="userRegister.tip.fullName" /></td>
+</tr>
 
 <tr>
     <td class="label"><label for="emailAddress" /><s:text name="userSettings.email"
/></label></td>

Modified: roller/trunk/web/WEB-INF/tiles.xml
URL: http://svn.apache.org/viewvc/roller/trunk/web/WEB-INF/tiles.xml?view=diff&rev=538658&r1=538657&r2=538658
==============================================================================
--- roller/trunk/web/WEB-INF/tiles.xml (original)
+++ roller/trunk/web/WEB-INF/tiles.xml Wed May 16 10:33:22 2007
@@ -58,20 +58,20 @@
         <put name="content" value="/WEB-INF/jsps/core/struts2/Login.jsp" />
     </definition>
     
-    <definition name=".RegisterForm" extends=".tiles-simplepage" >
-        <put name="content" value="/WEB-INF/jsps/core/struts2/RegisterForm.jsp" />
+    <definition name=".Register" extends=".tiles-simplepage" >
+        <put name="content" value="/WEB-INF/jsps/core/struts2/Register.jsp" />
     </definition>
     
     <definition name=".Welcome" extends=".tiles-simplepage" >
         <put name="content" value="/WEB-INF/jsps/core/struts2/Welcome.jsp" />
     </definition>
     
-    <definition name=".ProfileForm" extends=".tiles-simplepage" >
-        <put name="content" value="/WEB-INF/jsps/core/struts2/ProfileForm.jsp" />
+    <definition name=".Profile" extends=".tiles-simplepage" >
+        <put name="content" value="/WEB-INF/jsps/core/struts2/Profile.jsp" />
     </definition>
     
-    <definition name=".CreateWeblogForm" extends=".tiles-simplepage" >
-        <put name="content" value="/WEB-INF/jsps/core/struts2/CreateWeblogForm.jsp" />
+    <definition name=".CreateWeblog" extends=".tiles-simplepage" >
+        <put name="content" value="/WEB-INF/jsps/core/struts2/CreateWeblog.jsp" />
     </definition>
     
     <definition name=".MainMenu" extends=".tiles-mainmenupage" >



Mime
View raw message