roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agillil...@apache.org
Subject svn commit: r529793 [1/2] - in /roller/trunk: metadata/xdoclet/ src/org/apache/roller/ui/core/struts2/ src/org/apache/roller/ui/core/util/ src/org/apache/roller/ui/core/util/struts2/ web/WEB-INF/ web/WEB-INF/classes/ web/WEB-INF/jsps/ web/WEB-INF/jsps/...
Date Tue, 17 Apr 2007 22:23:55 GMT
Author: agilliland
Date: Tue Apr 17 15:23:45 2007
New Revision: 529793

URL: http://svn.apache.org/viewvc?view=rev&rev=529793
Log:
First workings of a migration from Struts1 -> Struts2.  This commit lays down a decent amount of the ground work for a struts migration and provides new struts2 versions for the 5 "core" actions.

Some things to note:
  * this commit does not modify or disable any of the traditional Struts1 code, it simply adds new struts2 code which can work side by side with struts1.
  * this is a preliminary commit and there are some known bugs which will be fixed in due time.  the bugs are mostly superficial, so functionality should still work fine.



Added:
    roller/trunk/src/org/apache/roller/ui/core/struts2/
    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/Login.java
    roller/trunk/src/org/apache/roller/ui/core/struts2/MainMenu.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/src/org/apache/roller/ui/core/util/UIUtils.java
    roller/trunk/src/org/apache/roller/ui/core/util/struts2/
    roller/trunk/src/org/apache/roller/ui/core/util/struts2/UIAction.java
    roller/trunk/src/org/apache/roller/ui/core/util/struts2/UIActionInterceptor.java
    roller/trunk/src/org/apache/roller/ui/core/util/struts2/UISecurityEnforced.java
    roller/trunk/src/org/apache/roller/ui/core/util/struts2/UISecurityInterceptor.java
    roller/trunk/web/WEB-INF/classes/struts.properties
    roller/trunk/web/WEB-INF/classes/struts.xml
    roller/trunk/web/WEB-INF/jsps/core/struts2/
    roller/trunk/web/WEB-INF/jsps/core/struts2/CreateWeblogForm.jsp
    roller/trunk/web/WEB-INF/jsps/core/struts2/Login.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/jsps/core/struts2/ProfileForm.jsp
    roller/trunk/web/WEB-INF/jsps/core/struts2/RegisterForm.jsp
    roller/trunk/web/WEB-INF/jsps/core/struts2/Welcome.jsp
    roller/trunk/web/WEB-INF/jsps/taglibs-struts2.jsp
    roller/trunk/web/WEB-INF/jsps/tiles/struts2/
    roller/trunk/web/WEB-INF/jsps/tiles/struts2/banner.jsp
    roller/trunk/web/WEB-INF/jsps/tiles/struts2/bannerStatus.jsp
    roller/trunk/web/WEB-INF/jsps/tiles/struts2/css-nosidebar.jsp
    roller/trunk/web/WEB-INF/jsps/tiles/struts2/css-sidebar.jsp
    roller/trunk/web/WEB-INF/jsps/tiles/struts2/empty.jsp
    roller/trunk/web/WEB-INF/jsps/tiles/struts2/footer.jsp
    roller/trunk/web/WEB-INF/jsps/tiles/struts2/head.jsp
    roller/trunk/web/WEB-INF/jsps/tiles/struts2/menu-admin.jsp
    roller/trunk/web/WEB-INF/jsps/tiles/struts2/menu-editor.jsp
    roller/trunk/web/WEB-INF/jsps/tiles/struts2/messages.jsp
    roller/trunk/web/WEB-INF/jsps/tiles/struts2/search.jsp
    roller/trunk/web/WEB-INF/jsps/tiles/struts2/tiles-errorpage.jsp
    roller/trunk/web/WEB-INF/jsps/tiles/struts2/tiles-mainmenupage.jsp
    roller/trunk/web/WEB-INF/jsps/tiles/struts2/tiles-simplepage.jsp
    roller/trunk/web/WEB-INF/jsps/tiles/struts2/tiles-tabbedpage.jsp
    roller/trunk/web/WEB-INF/jsps/tiles/struts2/title.jsp
    roller/trunk/web/WEB-INF/tiles.xml
Modified:
    roller/trunk/metadata/xdoclet/filter-mappings.xml
    roller/trunk/metadata/xdoclet/filters.xml
    roller/trunk/metadata/xdoclet/servlet-mappings.xml
    roller/trunk/web/WEB-INF/classes/roller.properties
    roller/trunk/web/WEB-INF/security.xml

Modified: roller/trunk/metadata/xdoclet/filter-mappings.xml
URL: http://svn.apache.org/viewvc/roller/trunk/metadata/xdoclet/filter-mappings.xml?view=diff&rev=529793&r1=529792&r2=529793
==============================================================================
--- roller/trunk/metadata/xdoclet/filter-mappings.xml (original)
+++ roller/trunk/metadata/xdoclet/filter-mappings.xml Tue Apr 17 15:23:45 2007
@@ -98,6 +98,14 @@
 </filter-mapping>
 
 
+<!-- Struts2 -->
+<filter-mapping>
+    <filter-name>struts2</filter-name>
+    <url-pattern>/*</url-pattern>
+    <dispatcher>REQUEST</dispatcher>
+    <dispatcher>FORWARD</dispatcher>
+</filter-mapping>
+
 <!-- Do we still need the RequestFilter? -->
 <filter-mapping>
     <filter-name>RequestFilter</filter-name>

Modified: roller/trunk/metadata/xdoclet/filters.xml
URL: http://svn.apache.org/viewvc/roller/trunk/metadata/xdoclet/filters.xml?view=diff&rev=529793&r1=529792&r2=529793
==============================================================================
--- roller/trunk/metadata/xdoclet/filters.xml (original)
+++ roller/trunk/metadata/xdoclet/filters.xml Tue Apr 17 15:23:45 2007
@@ -1,3 +1,8 @@
+    <filter>
+        <filter-name>struts2</filter-name>
+        <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
+    </filter>
+
 <filter>
     <filter-name>securityFilter</filter-name>
     <filter-class>org.acegisecurity.util.FilterToBeanProxy</filter-class>

Modified: roller/trunk/metadata/xdoclet/servlet-mappings.xml
URL: http://svn.apache.org/viewvc/roller/trunk/metadata/xdoclet/servlet-mappings.xml?view=diff&rev=529793&r1=529792&r2=529793
==============================================================================
--- roller/trunk/metadata/xdoclet/servlet-mappings.xml (original)
+++ roller/trunk/metadata/xdoclet/servlet-mappings.xml Tue Apr 17 15:23:45 2007
@@ -8,3 +8,7 @@
         <servlet-name>XmlRpcServlet</servlet-name>
         <url-pattern>/roller-services/xmlrpc</url-pattern>
     </servlet-mapping>
+
+    <listener>
+  <listener-class>org.apache.tiles.listener.TilesListener</listener-class>
+</listener>
\ No newline at end of file

Added: 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/CreateWeblogForm.java?view=auto&rev=529793
==============================================================================
--- roller/trunk/src/org/apache/roller/ui/core/struts2/CreateWeblogForm.java (added)
+++ roller/trunk/src/org/apache/roller/ui/core/struts2/CreateWeblogForm.java Tue Apr 17 15:23:45 2007
@@ -0,0 +1,210 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+
+package org.apache.roller.ui.core.struts2;
+
+import java.util.List;
+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.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;
+
+
+/**
+ * Allows user to create a new website.
+ */
+public class CreateWeblogForm extends UIAction {
+    
+    private static Log log = LogFactory.getLog(CreateWeblogForm.class);
+    
+    private CreateWeblogFormBean bean = new CreateWeblogFormBean();
+    
+
+    public CreateWeblogForm() {
+        this.pageTitle = "createWebsite.title";
+    }
+    
+    
+    // override default security, we do not require an action weblog
+    public boolean isWeblogRequired() {
+        return false;
+    }
+    
+    
+    public String execute() {
+        
+        UserData user = getAuthenticatedUser();
+        
+        try {
+            if (!RollerConfig.getBooleanProperty("groupblogging.enabled")) {
+                UserManager mgr = RollerFactory.getRoller().getUserManager();
+                List permissions = mgr.getAllPermissions(user);
+                if (permissions.size() > 0) {
+                    // sneaky user trying to get around 1 blog limit that applies
+                    // only when group blogging is disabled
+                    // TODO: i18n
+                    addError("Sorry, you are only allowed to have 1 weblog.");
+                    return "menu";
+                }
+            }
+        } catch (RollerException ex) {
+            log.error("error checking for existing weblogs count", ex);
+        }
+        
+        // pre-populate with some logical defaults
+        getBean().setLocale(user.getLocale());
+        getBean().setTimeZone(user.getTimeZone());
+        getBean().setEmailAddress(user.getEmailAddress());
+        
+        return INPUT;
+    }
+    
+    
+    public String cancel() {
+        return "cancel";
+    }
+    
+    
+    public String save() {
+        
+        UserData user = getAuthenticatedUser();
+        
+        try {
+            if (!RollerConfig.getBooleanProperty("groupblogging.enabled")) {
+                UserManager mgr = RollerFactory.getRoller().getUserManager();
+                List permissions = mgr.getAllPermissions(user);
+                if (permissions.size() > 0) {
+                    // sneaky user trying to get around 1 blog limit that applies
+                    // only when group blogging is disabled
+                    // TODO: i18n
+                    addError("Sorry, you are only allowed to have 1 weblog.");
+                    return "menu";
+                }
+            }
+        } catch (RollerException ex) {
+            log.error("error checking for existing weblogs count", ex);
+        }
+        
+        // custom validation
+        myValidate();
+        
+        if(!hasActionErrors()) {
+            
+            WebsiteData wd = new WebsiteData(
+                    getBean().getHandle(),
+                    user,
+                    getBean().getName(),
+                    getBean().getDescription(),
+                    getBean().getEmailAddress(),
+                    getBean().getEmailAddress(),
+                    getBean().getTheme(),
+                    getBean().getLocale(),
+                    getBean().getTimeZone());
+            
+            // pick a weblog editor for this weblog
+            String def = RollerRuntimeConfig.getProperty("users.editor.pages");
+            String[] defs = Utilities.stringToStringArray(def,",");
+            wd.setEditorPage(defs[0]);
+            
+            try {
+                // add weblog and flush
+                UserManager mgr = RollerFactory.getRoller().getUserManager();
+                mgr.addWebsite(wd);
+                RollerFactory.getRoller().flush();
+            } 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;
+            
+        }
+        
+        return INPUT;
+    }
+    
+    
+    // TODO: replace with struts2 validation
+    private void myValidate()  {
+        
+        String allowed = RollerConfig.getProperty("username.allowedChars");
+        if(allowed == null || allowed.trim().length() == 0) {
+            allowed = RegisterForm.DEFAULT_ALLOWED_CHARS;
+        }
+        String safe = CharSetUtils.keep(getBean().getHandle(), allowed);
+        
+        if (StringUtils.isEmpty(getBean().getName())) {
+            addError("createWeblog.error.missingName");
+        }
+        
+        if (StringUtils.isEmpty(getBean().getHandle())) {
+            addError("createWeblog.error.missingHandle");
+        } else if (!safe.equals(getBean().getHandle()) ) {
+            addError("createWeblog.error.invalidHandle");
+        }
+        
+        if (StringUtils.isEmpty(getBean().getEmailAddress())) {
+            addError("createWeblog.error.missingEmailAddress");
+        }
+        
+        try {
+            UserManager mgr = RollerFactory.getRoller().getUserManager();
+            if (mgr.getWebsiteByHandle(getBean().getHandle()) != null) {
+                addError("createWeblog.error.handleExists");
+                // reset handle
+                getBean().setHandle(null);
+            }
+        } catch (RollerException ex) {
+            log.error("error checking for weblog", ex);
+            // TODO: i18n
+            addError("unexpected error");
+        }
+    }
+    
+    
+    public List getThemes() {
+        ThemeManager themeMgr = RollerFactory.getRoller().getThemeManager();
+        return themeMgr.getEnabledThemesList();
+    }
+    
+    
+    public CreateWeblogFormBean getBean() {
+        return bean;
+    }
+
+    public void setBean(CreateWeblogFormBean bean) {
+        this.bean = bean;
+    }
+    
+}

Added: 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/CreateWeblogFormBean.java?view=auto&rev=529793
==============================================================================
--- roller/trunk/src/org/apache/roller/ui/core/struts2/CreateWeblogFormBean.java (added)
+++ roller/trunk/src/org/apache/roller/ui/core/struts2/CreateWeblogFormBean.java Tue Apr 17 15:23:45 2007
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+
+package org.apache.roller.ui.core.struts2;
+
+import java.util.Locale;
+import org.apache.roller.pojos.WebsiteData;
+
+
+/**
+ * form bean use by CreateWeblogForm.
+ */
+public class CreateWeblogFormBean {
+    
+    private String handle;
+    private String name;
+    private String description;
+    private String emailAddress;
+    private String locale;
+    private String timeZone;
+    private String theme;
+    
+    
+    public String getDescription() {
+        return description;
+    }
+    
+    public void setDescription(String description) {
+        this.description = description;
+    }
+    
+    public String getEmailAddress() {
+        return emailAddress;
+    }
+    
+    public void setEmailAddress(String emailAddress) {
+        this.emailAddress = emailAddress;
+    }
+    
+    public String getHandle() {
+        return handle;
+    }
+    
+    public void setHandle(String handle) {
+        this.handle = handle;
+    }
+    
+    public String getLocale() {
+        return locale;
+    }
+    
+    public void setLocale(String locale) {
+        this.locale = locale;
+    }
+    
+    public String getName() {
+        return name;
+    }
+    
+    public void setName(String name) {
+        this.name = name;
+    }
+    
+    public String getTheme() {
+        return theme;
+    }
+    
+    public void setTheme(String theme) {
+        this.theme = theme;
+    }
+    
+    public String getTimeZone() {
+        return timeZone;
+    }
+    
+    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);
+    }
+    
+}

Added: roller/trunk/src/org/apache/roller/ui/core/struts2/Login.java
URL: http://svn.apache.org/viewvc/roller/trunk/src/org/apache/roller/ui/core/struts2/Login.java?view=auto&rev=529793
==============================================================================
--- roller/trunk/src/org/apache/roller/ui/core/struts2/Login.java (added)
+++ roller/trunk/src/org/apache/roller/ui/core/struts2/Login.java Tue Apr 17 15:23:45 2007
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+
+package org.apache.roller.ui.core.struts2;
+
+import org.apache.roller.ui.core.util.struts2.UIAction;
+
+
+/**
+ * Handle user logins.
+ */
+public class Login extends UIAction {
+    
+    private String error = null;
+    
+    
+    public Login() {
+        this.pageTitle = "loginPage.title";
+    }
+    
+    
+    // override default security, we do not require an authenticated user
+    public boolean isUserRequired() {
+        return false;
+    }
+    
+    // override default security, we do not require an action weblog
+    public boolean isWeblogRequired() {
+        return false;
+    }
+    
+    
+    public String execute() {
+        
+        // set action error message if there was login error
+        if(getError() != null) {
+            addError("error.password.mismatch");
+        }
+        
+        return SUCCESS;
+    }
+
+    
+    public String getError() {
+        return error;
+    }
+
+    public void setError(String error) {
+        this.error = error;
+    }
+    
+}

Added: 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=auto&rev=529793
==============================================================================
--- roller/trunk/src/org/apache/roller/ui/core/struts2/MainMenu.java (added)
+++ roller/trunk/src/org/apache/roller/ui/core/struts2/MainMenu.java Tue Apr 17 15:23:45 2007
@@ -0,0 +1,191 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+
+package org.apache.roller.ui.core.struts2;
+
+import java.util.Collections;
+import java.util.List;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.roller.RollerException;
+import org.apache.roller.config.RollerConfig;
+import org.apache.roller.business.RollerFactory;
+import org.apache.roller.business.UserManager;
+import org.apache.roller.pojos.PermissionsData;
+import org.apache.roller.pojos.UserData;
+import org.apache.roller.pojos.WebsiteData;
+import org.apache.roller.ui.core.struts.actions.YourWebsitesAction.YourWebsitesPageModel;
+import org.apache.roller.ui.core.util.struts2.UIAction;
+
+
+/**
+ * Allows user to view and pick from list of his/her websites.
+ */
+public class MainMenu extends UIAction {
+    
+    private static Log log = LogFactory.getLog(MainMenu.class);
+    
+    private String websiteId = null;
+    private String inviteId = null;
+    
+    
+    public MainMenu() {
+        this.pageTitle = "yourWebsites.title";
+    }
+    
+    
+    // override default security, we do not require an action weblog
+    public boolean isWeblogRequired() {
+        return false;
+    }
+    
+    
+    public String execute() {
+        
+        return SUCCESS;
+    }
+    
+    
+    public String accept() {
+        
+        try {
+            UserManager userMgr = RollerFactory.getRoller().getUserManager();
+            PermissionsData perms = userMgr.getPermissions(getInviteId());
+            if (perms != null) {        
+                // TODO ROLLER_2.0: notify inviter that invitee has accepted invitation
+                // TODO EXCEPTIONS: better exception handling
+                perms.setPending(false);
+                userMgr.savePermissions(perms);
+                RollerFactory.getRoller().flush();
+
+                addMessage("yourWebsites.accepted", perms.getWebsite().getHandle());
+            } else {
+                addError("yourWebsites.permNotFound");
+            }
+        } catch (RollerException ex) {
+            log.error("Error handling invitation accept - "+getInviteId(), ex);
+            // TODO: i18n
+            addError("invite accept failed.");
+        }
+        
+        return SUCCESS;
+    }
+    
+    
+    public String decline() {
+        
+        try {
+            UserManager userMgr = RollerFactory.getRoller().getUserManager();
+            PermissionsData perms = userMgr.getPermissions(getInviteId());
+            if (perms != null) {
+                // TODO ROLLER_2.0: notify inviter that invitee has declined invitation
+                // TODO EXCEPTIONS: better exception handling here
+                userMgr.removePermissions(perms);
+                RollerFactory.getRoller().flush();
+
+                addMessage("yourWebsites.declined", perms.getWebsite().getHandle());
+            } else {
+                addError("yourWebsites.permNotFound");
+            }
+        } catch (RollerException ex) {
+            log.error("Error handling invitation decline - "+getInviteId(), ex);
+            // TODO: i18n
+            addError("invite decline failed.");
+        }
+        
+        return SUCCESS;
+    }
+    
+    
+    public String resign() {
+        
+        UserData user = getAuthenticatedUser();
+        
+        try {
+            UserManager mgr = RollerFactory.getRoller().getUserManager();
+            WebsiteData website = mgr.getWebsite(getWebsiteId());
+            
+            UserManager userMgr = RollerFactory.getRoller().getUserManager();
+            PermissionsData perms = userMgr.getPermissions(website, user);
+            
+            if (perms != null) {
+                // TODO ROLLER_2.0: notify website members that user has resigned
+                // TODO EXCEPTIONS: better exception handling
+                userMgr.removePermissions(perms);
+                RollerFactory.getRoller().flush();
+            }
+            
+            addMessage("yourWebsites.resigned", perms.getWebsite().getHandle());
+        } catch (RollerException ex) {
+            log.error("Error doing weblog resign - "+getWebsiteId(), ex);
+            // TODO: i18n
+            addError("resignation failed.");
+        }
+        
+        return SUCCESS;
+    }
+    
+    
+    public List getExistingPermissions() {
+        try {
+            UserManager mgr = RollerFactory.getRoller().getUserManager();
+            return mgr.getAllPermissions(getAuthenticatedUser());
+        } catch(Exception e) {
+            return Collections.EMPTY_LIST;
+        }
+    }
+    
+    public List getPendingPermissions() {
+        try {
+            UserManager mgr = RollerFactory.getRoller().getUserManager();
+            return mgr.getPendingPermissions(getAuthenticatedUser());
+        } catch(Exception e) {
+            return Collections.EMPTY_LIST;
+        }
+    }
+    
+    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;
+    }
+
+    public void setWebsiteId(String websiteId) {
+        this.websiteId = websiteId;
+    }
+
+    public String getInviteId() {
+        return inviteId;
+    }
+
+    public void setInviteId(String inviteId) {
+        this.inviteId = inviteId;
+    }
+    
+}

Added: 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/ProfileForm.java?view=auto&rev=529793
==============================================================================
--- roller/trunk/src/org/apache/roller/ui/core/struts2/ProfileForm.java (added)
+++ roller/trunk/src/org/apache/roller/ui/core/struts2/ProfileForm.java Tue Apr 17 15:23:45 2007
@@ -0,0 +1,153 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+
+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;
+
+
+/**
+ * Allows user to edit his/her profile.
+ *
+ * TODO: check on the impact of deleting that cookieLogin stuff
+ */
+public class ProfileForm extends UIAction {
+    
+    private static Log log = LogFactory.getLog(ProfileForm.class);
+    
+    private RegisterFormBean bean = new RegisterFormBean();
+    
+    
+    public ProfileForm() {
+        this.pageTitle = "yourProfile.title";
+    }
+    
+    // override default security, we do not require an action weblog
+    public boolean isWeblogRequired() {
+        return false;
+    }
+    
+    
+    public String execute() {
+        
+        UserData ud = getAuthenticatedUser();
+        
+        // load up the form from the users existing profile data
+        getBean().copyFrom(ud, getLocale());
+        getBean().setPasswordText(null);
+        getBean().setPasswordConfirm(null);
+        getBean().setLocale(ud.getLocale());
+        getBean().setTimeZone(ud.getTimeZone());
+
+        return INPUT;
+    }
+    
+    
+    public String cancel() {
+        return "cancel";
+    }
+    
+    
+    public String save() {
+        
+        // custom validation
+        myValidate();
+        
+        if (!hasActionErrors()) {
+            // We ONLY modify the user currently logged in
+            UserData existingUser = getAuthenticatedUser();
+            
+            // We want to be VERY selective about what data gets updated
+            existingUser.setFullName(getBean().getFullName());
+            existingUser.setEmailAddress(getBean().getEmailAddress());
+            existingUser.setLocale(getBean().getLocale());
+            existingUser.setTimeZone(getBean().getTimeZone());
+            
+            // If user set both password and passwordConfirm then reset password
+            if (!StringUtils.isEmpty(getBean().getPasswordText()) && 
+                    !StringUtils.isEmpty(getBean().getPasswordConfirm())) {
+                try {
+                    existingUser.resetPassword(RollerFactory.getRoller(),
+                            getBean().getPasswordText(),
+                            getBean().getPasswordConfirm());
+                } catch (RollerException e) {
+                    addMessage("yourProfile.passwordResetError");
+                }
+            }
+            
+            try {
+                // save the updated profile
+                UserManager mgr = RollerFactory.getRoller().getUserManager();
+                mgr.saveUser(existingUser);
+                RollerFactory.getRoller().flush();
+                
+                // TODO: i18n
+                addMessage("profile updated.");
+                
+                return SUCCESS;
+                
+            } catch (RollerException ex) {
+                log.error("ERROR in action", ex);
+                // TODO: i18n
+                addError("unexpected error doing profile save");
+            }
+            
+        }
+        
+        return INPUT;
+    }
+    
+    
+    // TODO: replace with struts2 validation
+    private void myValidate() {
+        String allowed = RollerConfig.getProperty("username.allowedChars");
+        if(allowed == null || allowed.trim().length() == 0) {
+            allowed = RegisterForm.DEFAULT_ALLOWED_CHARS;
+        }
+        String safe = CharSetUtils.keep(getBean().getUserName(), allowed);
+        
+        if (StringUtils.isEmpty(getBean().getUserName())) {
+            addError("error.add.user.missingUserName");
+        } else if (!safe.equals(getBean().getUserName()) ) {
+            addError("error.add.user.badUserName");
+        }
+        
+        if (StringUtils.isEmpty(getBean().getEmailAddress())) {
+            addError("error.add.user.missingEmailAddress");
+        }
+    }
+    
+    
+    public RegisterFormBean getBean() {
+        return bean;
+    }
+
+    public void setBean(RegisterFormBean bean) {
+        this.bean = bean;
+    }
+    
+}

Added: 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/RegisterForm.java?view=auto&rev=529793
==============================================================================
--- roller/trunk/src/org/apache/roller/ui/core/struts2/RegisterForm.java (added)
+++ roller/trunk/src/org/apache/roller/ui/core/struts2/RegisterForm.java Tue Apr 17 15:23:45 2007
@@ -0,0 +1,411 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+
+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;
+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.config.RollerRuntimeConfig;
+import org.apache.roller.pojos.UserData;
+import org.apache.roller.ui.core.security.CustomUserRegistry;
+import org.apache.roller.ui.core.util.struts2.UIAction;
+import org.apache.roller.util.MailUtil;
+import org.apache.struts2.interceptor.ServletRequestAware;
+
+
+/**
+ * Actions for registering a new user.
+ */
+public class RegisterForm extends UIAction implements ServletRequestAware {
+    
+    private static Log log = LogFactory.getLog(RegisterForm.class);
+    
+    protected static String DEFAULT_ALLOWED_CHARS = "A-Za-z0-9";
+    
+    // this is a no-no, we should not need this
+    private HttpServletRequest servletRequest = null;
+    
+    private boolean fromSS0 = false;
+    private String activationStatus = null;
+    
+    private String activationCode = null;
+    private RegisterFormBean bean = new RegisterFormBean();
+    
+    
+    public RegisterForm() {
+        this.pageTitle = "newUser.addNewUser";
+    }
+    
+    
+    // override default security, we do not require an authenticated user
+    public boolean isUserRequired() {
+        return false;
+    }
+    
+    // override default security, we do not require an action weblog
+    public boolean isWeblogRequired() {
+        return false;
+    }
+    
+    
+    public String execute() {
+        
+        try {
+            getBean().setPasswordText(null);
+            getBean().setPasswordConfirm(null);
+            getBean().setLocale(Locale.getDefault().toString());
+            getBean().setTimeZone(TimeZone.getDefault().getID());
+            
+            // 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());
+                    setFromSS0(true);
+                }
+            }
+            
+        } catch (Exception e) {
+            addError("error.editing.user", e.toString());
+            log.error("ERROR in newUser", e);
+        }
+        
+        return INPUT;
+    }
+    
+    
+    public String cancel() {
+        return "cancel";
+    }
+    
+    
+    public String save() {
+        
+        boolean reg_allowed =
+                RollerRuntimeConfig.getBooleanProperty("users.registration.enabled");
+        
+        if ( !reg_allowed ) {
+            return "disabled";
+        }
+        
+        // run some validation
+        myValidate();
+        
+        if (!hasActionErrors()) try {
+            
+            UserManager mgr = RollerFactory.getRoller().getUserManager();
+            
+            // copy form data into new user pojo
+            UserData ud = new UserData();
+            getBean().copyTo(ud, getLocale()); // doesn't copy password
+            ud.setId(null);
+            ud.setDateCreated(new java.util.Date());
+            ud.setEnabled(Boolean.TRUE);
+            
+            // If user set both password and passwordConfirm then reset password
+            if (!StringUtils.isEmpty(getBean().getPasswordText()) && 
+                    !StringUtils.isEmpty(getBean().getPasswordConfirm())) {
+                ud.resetPassword(RollerFactory.getRoller(),
+                        getBean().getPasswordText(), getBean().getPasswordConfirm());
+            }
+            
+            // are we using email activation?
+            boolean activationEnabled = RollerRuntimeConfig.getBooleanProperty(
+                    "user.account.activation.enabled");
+            if (activationEnabled) {
+                // User account will be enabled after the activation process
+                ud.setEnabled(Boolean.FALSE);
+                
+                // Create & save the activation data
+                String activationCode = UUID.randomUUID().toString();
+                
+                if (mgr.getUserByActivationCode(activationCode) != null) {
+                    // In the *extremely* unlikely event that we generate an
+                    // activation code that is already use, we'll retry 3 times.
+                    int numOfRetries = 3;
+                    if (numOfRetries < 1) numOfRetries = 1;
+                    for (int i = 0; i < numOfRetries; i++) {
+                        activationCode = UUID.randomUUID().toString();
+                        if (mgr.getUserByActivationCode(activationCode) == null) {
+                            break;
+                        } else {
+                            activationCode = null;
+                        }
+                    }
+                    // In more unlikely event that three retries isn't enough
+                    if (activationCode == null){
+                        throw new RollerException("error.add.user.activationCodeInUse");
+                    }
+                }
+                ud.setActivationCode(activationCode);
+            }
+            
+            // save new user
+            mgr.addUser(ud);
+            RollerFactory.getRoller().flush();
+            
+            // now send activation email if necessary
+            if (activationEnabled && ud.getActivationCode() != null) {
+                // send activation mail to the user
+                sendActivationMail(ud);
+                
+                setActivationStatus("pending");
+            }
+             
+            // Invalidate session, otherwise new user who was originally
+            // authenticated via LDAP/SSO will remain logged in with
+            // a but without a valid Roller role.
+            getServletRequest().getSession().invalidate();
+            
+            // set a special page title
+            setPageTitle("welcome.title");
+            
+            return SUCCESS;
+            
+        } catch (RollerException e) {
+            addError(e.getMessage());
+            log.error("ERROR in addUser", e);
+        }
+        
+        return INPUT;
+    }
+    
+    
+    public String activate() {
+        
+        try {
+            UserManager mgr = RollerFactory.getRoller().getUserManager();
+            
+            if (getActivationCode() == null) {
+                addError("error.activate.user.missingActivationCode");
+            } else {
+                UserData user = mgr.getUserByActivationCode(getActivationCode());
+                
+                if (user != null) {
+                    // enable user account
+                    user.setEnabled(Boolean.TRUE);
+                    user.setActivationCode(null);
+                    mgr.saveUser(user);
+                    RollerFactory.getRoller().flush();
+                    
+                    setActivationStatus("active");
+                    
+                } else {
+                    addError("error.activate.user.invalidActivationCode");
+                }
+            }
+            
+        } catch (RollerException e) {
+            addError(e.getMessage());
+            log.error("ERROR in activateUser", e);
+        }
+        
+        if (hasActionErrors()) {
+            setActivationStatus("error");
+        }
+        
+        // set a special page title
+        setPageTitle("welcome.title");
+            
+        return SUCCESS;
+    }
+    
+    
+    // TODO: replace with struts2 validation
+    private void myValidate() {
+        
+        // if usingSSO, we don't want to error on empty password/username from HTML form.
+        setFromSS0(false);
+        boolean usingSSO = RollerConfig.getBooleanProperty("users.sso.enabled");
+        if(usingSSO) {
+            boolean storePassword = RollerConfig.getBooleanProperty("users.sso.passwords.saveInRollerDb");
+            UserData fromSSO = CustomUserRegistry.getUserDetailsFromAuthentication();
+            if(fromSSO != null) {
+                String password = RollerConfig.getProperty("users.sso.passwords.defaultValue", "<unknown>");
+                if(storePassword) {
+                    password = fromSSO.getPassword();
+                }
+                getBean().setPasswordText(password);
+                getBean().setPasswordConfirm(password);
+                getBean().setUserName(fromSSO.getUserName());
+                setFromSS0(true);
+            }
+        }
+        
+        String allowed = RollerConfig.getProperty("username.allowedChars");
+        if(allowed == null || allowed.trim().length() == 0) {
+            allowed = DEFAULT_ALLOWED_CHARS;
+        }
+        String safe = CharSetUtils.keep(getBean().getUserName(), allowed);
+        
+        if (StringUtils.isEmpty(getBean().getUserName())) {
+            addError("error.add.user.missingUserName");
+        } else if (!safe.equals(getBean().getUserName()) ) {
+            addError("error.add.user.badUserName");
+        }
+        
+        if (StringUtils.isEmpty(getBean().getEmailAddress())) {
+            addError("error.add.user.missingEmailAddress");
+        }
+        
+        if (StringUtils.isEmpty(getBean().getPasswordText()) && 
+                StringUtils.isEmpty(getBean().getPasswordConfirm())) {
+            addError("error.add.user.missingPassword");
+        }
+    }
+    
+    
+    /**
+     * 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;
+    }
+
+    public void setServletRequest(HttpServletRequest servletRequest) {
+        this.servletRequest = servletRequest;
+    }
+    
+    public RegisterFormBean getBean() {
+        return bean;
+    }
+
+    public void setBean(RegisterFormBean bean) {
+        this.bean = bean;
+    }
+
+    public boolean isFromSS0() {
+        return fromSS0;
+    }
+
+    public void setFromSS0(boolean fromSS0) {
+        this.fromSS0 = fromSS0;
+    }
+
+    public String getActivationStatus() {
+        return activationStatus;
+    }
+
+    public void setActivationStatus(String activationStatus) {
+        this.activationStatus = activationStatus;
+    }
+
+    public String getActivationCode() {
+        return activationCode;
+    }
+
+    public void setActivationCode(String activationCode) {
+        this.activationCode = activationCode;
+    }
+    
+}

Added: 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/RegisterFormBean.java?view=auto&rev=529793
==============================================================================
--- roller/trunk/src/org/apache/roller/ui/core/struts2/RegisterFormBean.java (added)
+++ roller/trunk/src/org/apache/roller/ui/core/struts2/RegisterFormBean.java Tue Apr 17 15:23:45 2007
@@ -0,0 +1,220 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+
+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 {
+    
+    protected java.lang.Boolean enabled;
+    protected java.lang.String id;
+    protected java.lang.String userName;
+    protected java.lang.String password;
+    protected java.lang.String fullName;
+    protected java.lang.String emailAddress;
+    protected java.lang.String locale;
+    protected java.lang.String timeZone;
+    protected java.lang.String activationCode;
+    private String mPasswordText = null;
+    private String mPasswordConfirm = null;
+    
+    
+    public java.lang.Boolean getEnabled() {
+        return this.enabled;
+    }
+    
+    /**
+     */
+    public void setEnabled( java.lang.Boolean enabled ) {
+        this.enabled = enabled;
+    }
+    
+    public java.lang.String getId() {
+        return this.id;
+    }
+    
+    /**
+     * @struts.validator type="required" msgkey="errors.required"
+     */
+    public void setId( java.lang.String id ) {
+        this.id = id;
+    }
+    
+    public java.lang.String getUserName() {
+        return this.userName;
+    }
+    
+    /**
+     */
+    public void setUserName( java.lang.String userName ) {
+        this.userName = userName;
+    }
+    
+    public java.lang.String getPassword() {
+        return this.password;
+    }
+    
+    /**
+     */
+    public void setPassword( java.lang.String password ) {
+        this.password = password;
+    }
+    
+    public java.lang.String getFullName() {
+        return this.fullName;
+    }
+    
+    /**
+     */
+    public void setFullName( java.lang.String fullName ) {
+        this.fullName = fullName;
+    }
+    
+    public java.lang.String getEmailAddress() {
+        return this.emailAddress;
+    }
+    
+    /**
+     */
+    public void setEmailAddress( java.lang.String emailAddress ) {
+        this.emailAddress = emailAddress;
+    }
+    
+    public java.lang.String getLocale() {
+        return this.locale;
+    }
+    
+    /**
+     */
+    public void setLocale( java.lang.String locale ) {
+        this.locale = locale;
+    }
+    
+    public java.lang.String getTimeZone() {
+        return this.timeZone;
+    }
+    
+    /**
+     */
+    public void setTimeZone( java.lang.String timeZone ) {
+        this.timeZone = timeZone;
+    }
+    
+    public java.lang.String getActivationCode() {
+        return this.activationCode;
+    }
+    
+    /**
+     */
+    public void setActivationCode( java.lang.String activationCode ) {
+        this.activationCode = activationCode;
+    }
+    
+    /**
+     * Don't call it "password" because browser will autofill.
+     * @return Returns the passwordText.
+     */
+    public String getPasswordText() {
+        return mPasswordText;
+    }
+    
+    /**
+     * Don't call it "password" because browser will autofill.
+     * @param passwordText The passwordText to set.
+     */
+    public void setPasswordText(String passwordText) {
+        mPasswordText = passwordText;
+    }
+    
+    /**
+     * @return Returns the passwordConfirm.
+     */
+    public String getPasswordConfirm() {
+        return mPasswordConfirm;
+    }
+    
+    /**
+     * @param passwordConfirm The passwordConfirm to set.
+     */
+    public void setPasswordConfirm(String passwordConfirm) {
+        mPasswordConfirm = passwordConfirm;
+    }
+    
+    
+    /**
+     * Copy values from this form bean to the specified data object.
+     * Only copies primitive types (Boolean, boolean, String, Integer, int, Timestamp, Date)
+     */
+    public void copyTo(UserData dataHolder, Locale locale) {
+        
+        dataHolder.setEnabled(this.enabled);
+        dataHolder.setId(this.id);
+        dataHolder.setUserName(this.userName);
+        dataHolder.setFullName(this.fullName);
+        dataHolder.setEmailAddress(this.emailAddress);
+        dataHolder.setLocale(this.locale);
+        dataHolder.setTimeZone(this.timeZone);
+        
+        dataHolder.setActivationCode(this.activationCode);
+    }
+    
+    
+    /**
+     * Copy values from specified data object to this form bean.
+     * Includes all types.
+     */
+    public void copyFrom(UserData dataHolder, Locale locale) {
+        
+        this.enabled = dataHolder.getEnabled();
+        this.id = dataHolder.getId();
+        this.userName = dataHolder.getUserName();
+        this.password = dataHolder.getPassword();
+        this.fullName = dataHolder.getFullName();
+        this.emailAddress = dataHolder.getEmailAddress();
+        this.locale = dataHolder.getLocale();
+        this.timeZone = dataHolder.getTimeZone();
+        
+        this.activationCode = dataHolder.getActivationCode();
+        
+    }
+    
+    
+    public void doReset() {
+        
+        this.enabled = null;
+        this.id = null;
+        this.userName = null;
+        this.password = null;
+        this.fullName = null;
+        this.emailAddress = null;
+        this.locale = null;
+        this.timeZone = null;
+        
+        this.activationCode = null;
+        
+    }
+    
+}

Added: roller/trunk/src/org/apache/roller/ui/core/util/UIUtils.java
URL: http://svn.apache.org/viewvc/roller/trunk/src/org/apache/roller/ui/core/util/UIUtils.java?view=auto&rev=529793
==============================================================================
--- roller/trunk/src/org/apache/roller/ui/core/util/UIUtils.java (added)
+++ roller/trunk/src/org/apache/roller/ui/core/util/UIUtils.java Tue Apr 17 15:23:45 2007
@@ -0,0 +1,86 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+
+package org.apache.roller.ui.core.util;
+
+import java.util.Arrays;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Map;
+import java.util.TimeZone;
+import java.util.TreeMap;
+import org.apache.roller.util.LocaleComparator;
+
+
+/**
+ * A utilities class used by the Weblogger UI.
+ */
+public class UIUtils {
+    
+    public static Map allLocales = null;
+    public static Map allTimeZones = null;
+    
+    
+    // load up the locales and time zones maps
+    static {
+        // build locales Map
+        allLocales = new HashMap(); 
+        Locale[] localeArray = Locale.getAvailableLocales();
+        Arrays.sort(localeArray, new LocaleComparator());
+        for (int i=0; i < localeArray.length; i++) {
+            allLocales.put(localeArray[i].toString(),
+                           localeArray[i].getDisplayName());
+        }
+        
+        // build time zones Map
+        allTimeZones = new TreeMap();
+        String[] zoneArray = TimeZone.getAvailableIDs();
+        
+        Date today = new Date();
+        TimeZone zone = null;
+        for (int i=0; i < zoneArray.length; i++) {
+            zone = TimeZone.getTimeZone(zoneArray[i]);
+            
+            // build a display key
+            StringBuffer sb = new StringBuffer();
+            sb.append(zone.getDisplayName(zone.inDaylightTime(today), TimeZone.SHORT));
+            sb.append(" - ");
+            sb.append(zone.getID());
+            
+            allTimeZones.put(zone.getID(), sb.toString());
+        }
+    }
+    
+    
+    /**
+     * A Map of locales supported by Roller.
+     */
+    public static Map getLocalesMap() {
+        return allLocales;
+    }
+    
+    
+    /**
+     * A Map of time zones supported by Roller.
+     */
+    public static Map getTimeZonesMap() {
+        return allTimeZones;
+    }
+    
+}

Added: roller/trunk/src/org/apache/roller/ui/core/util/struts2/UIAction.java
URL: http://svn.apache.org/viewvc/roller/trunk/src/org/apache/roller/ui/core/util/struts2/UIAction.java?view=auto&rev=529793
==============================================================================
--- roller/trunk/src/org/apache/roller/ui/core/util/struts2/UIAction.java (added)
+++ roller/trunk/src/org/apache/roller/ui/core/util/struts2/UIAction.java Tue Apr 17 15:23:45 2007
@@ -0,0 +1,160 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+
+package org.apache.roller.ui.core.util.struts2;
+
+import com.opensymphony.xwork2.ActionSupport;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Map;
+import org.apache.roller.pojos.UserData;
+import org.apache.roller.pojos.WebsiteData;
+import org.apache.roller.ui.core.util.UIUtils;
+
+
+/**
+ * Extends the Struts2 ActionSupport class to add in support for handling an
+ * error and status success.  Other actions extending this one only need to
+ * calle setError() and setSuccess() accordingly.
+ * 
+ * NOTE: as a small convenience, all errors and messages are assumed to be keys
+ * which point to a success in a resource bundle, so we automatically call
+ * getText(key) on the param passed into setError() and setSuccess().
+ */
+public abstract class UIAction extends ActionSupport 
+        implements UISecurityEnforced {
+    
+    // the authenticated user accessing this action, or null if client is not logged in
+    private UserData authenticatedUser = null;
+    
+    // the weblog this action is intended to work on, or null if no weblog specified
+    private WebsiteData actionWeblog = null;
+    
+    // page title
+    protected String pageTitle = null;
+    
+    
+    // default action permissions, user is required
+    public boolean isUserRequired() {
+        return true;
+    }
+    
+    // default action permissions, weblog is required
+    public boolean isWeblogRequired() {
+        return true;
+    }
+    
+    // default action permissions, no role required
+    public String requiredUserRole() {
+        return null;
+    }
+    
+    // default action permissions, no weblog permissions required
+    public short requiredWeblogPermissions() {
+        return -1;
+    }
+    
+    
+    public void addError(String errorKey) {
+        addActionError(getText(errorKey));
+    }
+    
+    public void addError(String errorKey, String param) {
+        addActionError(getText(errorKey, errorKey, param));
+    }
+    
+    /**
+     * This simply returns the result of hasActionErrors() but we need it
+     * because without it you can't easily check if there were errors since
+     * you can't call a hasXXX() method via OGNL.
+     */
+    public boolean errorsExist() {
+        return hasActionErrors();
+    }
+    
+    
+    public void addMessage(String msgKey) {
+        addActionMessage(getText(msgKey));
+    }
+    
+    public void addMessage(String msgKey, String param) {
+        addActionMessage(getText(msgKey, msgKey, param));
+    }
+    
+    /**
+     * This simply returns the result of hasActionMessages() but we need it
+     * because without it you can't easily check if there were messages since
+     * you can't call a hasXXX() method via OGNL.
+     */
+    public boolean messagesExist() {
+        return hasActionMessages();
+    }
+    
+
+    public UserData getAuthenticatedUser() {
+        return authenticatedUser;
+    }
+
+    public void setAuthenticatedUser(UserData authenticatedUser) {
+        this.authenticatedUser = authenticatedUser;
+    }
+
+    public WebsiteData getActionWeblog() {
+        return actionWeblog;
+    }
+
+    public void setActionWeblog(WebsiteData workingWeblog) {
+        this.actionWeblog = workingWeblog;
+    }
+
+    public String getPageTitle() {
+        return getText(pageTitle);
+    }
+
+    public void setPageTitle(String pageTitle) {
+        this.pageTitle = pageTitle;
+    }
+    
+    
+    public String getShortDateFormat() {
+        DateFormat sdf = DateFormat.getDateInstance(
+                DateFormat.SHORT, getLocale());
+        if (sdf instanceof SimpleDateFormat) {
+            return ((SimpleDateFormat)sdf).toPattern();
+        }
+        return "yyyy/MM/dd";
+    }
+    
+    public String getMediumDateFormat() {
+        DateFormat sdf = DateFormat.getDateInstance(
+                DateFormat.MEDIUM, getLocale());
+        if (sdf instanceof SimpleDateFormat) {
+            return ((SimpleDateFormat)sdf).toPattern();
+        }
+        return "MMM dd, yyyy";
+    }
+    
+    public Map getLocalesMap() {
+        return UIUtils.getLocalesMap();
+    }
+    
+    public Map getTimeZonesMap() {
+        return UIUtils.getTimeZonesMap();
+    }
+    
+}

Added: roller/trunk/src/org/apache/roller/ui/core/util/struts2/UIActionInterceptor.java
URL: http://svn.apache.org/viewvc/roller/trunk/src/org/apache/roller/ui/core/util/struts2/UIActionInterceptor.java?view=auto&rev=529793
==============================================================================
--- roller/trunk/src/org/apache/roller/ui/core/util/struts2/UIActionInterceptor.java (added)
+++ roller/trunk/src/org/apache/roller/ui/core/util/struts2/UIActionInterceptor.java Tue Apr 17 15:23:45 2007
@@ -0,0 +1,73 @@
+/*
+ * UIActionInterceptor.java
+ *
+ * Created on April 16, 2007, 5:30 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package org.apache.roller.ui.core.util.struts2;
+
+import com.opensymphony.xwork2.ActionContext;
+import com.opensymphony.xwork2.ActionInvocation;
+import com.opensymphony.xwork2.interceptor.AbstractInterceptor;
+import javax.servlet.http.HttpServletRequest;
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.roller.business.RollerFactory;
+import org.apache.roller.business.UserManager;
+import org.apache.roller.pojos.WebsiteData;
+import org.apache.roller.ui.core.RequestConstants;
+import org.apache.roller.ui.core.RollerSession;
+import org.apache.struts2.StrutsStatics;
+
+
+/**
+ * A struts2 interceptor for configuring specifics of the weblogger ui.
+ */
+public class UIActionInterceptor extends AbstractInterceptor 
+        implements StrutsStatics {
+    
+    private static Log log = LogFactory.getLog(UIActionInterceptor.class);
+    
+    
+    public String intercept(ActionInvocation invocation) throws Exception {
+        
+        log.debug("Entering UIActionInterceptor");
+        
+        final Object action = invocation.getAction();
+        final ActionContext context = invocation.getInvocationContext();
+        
+        HttpServletRequest request = (HttpServletRequest) context.get(HTTP_REQUEST);
+        
+        // is this one of our own UIAction classes?
+        if (action instanceof UIAction) {
+            
+            log.debug("action is a UIAction, setting relevant attributes");
+            
+            UIAction theAction = (UIAction) action;
+            
+            // extract the authenticated user and set it
+            RollerSession rses = RollerSession.getRollerSession(request);
+            theAction.setAuthenticatedUser(rses.getAuthenticatedUser());
+            
+            // extract the work weblog and set it
+            String weblogHandle = request.getParameter(RequestConstants.WEBLOG_ID);
+            if(!StringUtils.isEmpty(weblogHandle)) {
+                WebsiteData weblog = null;
+                try {
+                    UserManager mgr = RollerFactory.getRoller().getUserManager();
+                    weblog = mgr.getWebsiteByHandle(weblogHandle);
+                } catch(Exception e) {
+                    
+                }
+                theAction.setActionWeblog(weblog);
+            }
+        }
+        
+        return invocation.invoke();
+    }
+    
+}

Added: roller/trunk/src/org/apache/roller/ui/core/util/struts2/UISecurityEnforced.java
URL: http://svn.apache.org/viewvc/roller/trunk/src/org/apache/roller/ui/core/util/struts2/UISecurityEnforced.java?view=auto&rev=529793
==============================================================================
--- roller/trunk/src/org/apache/roller/ui/core/util/struts2/UISecurityEnforced.java (added)
+++ roller/trunk/src/org/apache/roller/ui/core/util/struts2/UISecurityEnforced.java Tue Apr 17 15:23:45 2007
@@ -0,0 +1,64 @@
+/*
+ * UISecurityEnforced.java
+ *
+ * Created on April 17, 2007, 8:24 AM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package org.apache.roller.ui.core.util.struts2;
+
+
+/**
+ * Implemented by struts2 actions which want to enforce some level of security
+ * protection on their action.
+ * 
+ * Available enforcements are ...
+ *   - require a logged in user
+ *   - reguire a valid weblog to work on
+ *   - require a specific user role, such as "admin"
+ *   - require a specific weblog permission
+ *
+ */
+public interface UISecurityEnforced {
+    
+    /**
+     * Does the action require an authenticated user?
+     *
+     * @return boolean True if authenticated user is required, false otherwise.
+     */
+    public boolean isUserRequired();
+    
+    
+    /**
+     * Does the action require a valid weblog to work on?
+     *
+     * This only takes effect if isUserRequired() is 'true'.
+     *
+     * @return boolean True if action weblog is required, false otherwise.
+     */
+    public boolean isWeblogRequired();
+    
+    
+    /**
+     * What is the required user role, if any?
+     *
+     * This method only takes effect if isUserRequired() is 'true'.
+     *
+     * @return String The required user role, or null if no role required.
+     */
+    public String requiredUserRole();
+    
+    
+    /**
+     * What are the required weblog permissions for this action, if any?
+     *
+     * This method only takes effect if both isUserRequired() and isWeblogRequired()
+     * are 'true'.
+     *
+     * @return short The required weblog permissions, or -1 if no permissions required.
+     */
+    public short requiredWeblogPermissions();
+    
+}

Added: roller/trunk/src/org/apache/roller/ui/core/util/struts2/UISecurityInterceptor.java
URL: http://svn.apache.org/viewvc/roller/trunk/src/org/apache/roller/ui/core/util/struts2/UISecurityInterceptor.java?view=auto&rev=529793
==============================================================================
--- roller/trunk/src/org/apache/roller/ui/core/util/struts2/UISecurityInterceptor.java (added)
+++ roller/trunk/src/org/apache/roller/ui/core/util/struts2/UISecurityInterceptor.java Tue Apr 17 15:23:45 2007
@@ -0,0 +1,91 @@
+/*
+ * UIActionInterceptor.java
+ *
+ * Created on April 16, 2007, 5:30 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package org.apache.roller.ui.core.util.struts2;
+
+import com.opensymphony.xwork2.ActionInvocation;
+import com.opensymphony.xwork2.interceptor.AbstractInterceptor;
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.roller.business.RollerFactory;
+import org.apache.roller.business.UserManager;
+import org.apache.roller.pojos.UserData;
+import org.apache.roller.pojos.WebsiteData;
+import org.apache.roller.ui.core.RequestConstants;
+import org.apache.roller.ui.core.RollerSession;
+
+/**
+ * A struts2 interceptor for configuring specifics of the weblogger ui.
+ */
+public class UISecurityInterceptor extends AbstractInterceptor {
+    
+    private static Log log = LogFactory.getLog(UISecurityInterceptor.class);
+    
+    
+    public String intercept(ActionInvocation invocation) throws Exception {
+        
+        log.debug("Entering UISecurityInterceptor");
+        
+        final Object action = invocation.getAction();
+        
+        // is this one of our own UIAction classes?
+        if (action instanceof UISecurityEnforced &&
+                action instanceof UIAction) {
+            
+            log.debug("action is UISecurityEnforced ... enforcing security rules");
+            
+            final UISecurityEnforced theAction = (UISecurityEnforced) action;
+            
+            // are we requiring an authenticated user?
+            if(theAction.isUserRequired()) {
+                
+                UserData authenticatedUser = ((UIAction)theAction).getAuthenticatedUser();
+                if(authenticatedUser == null) {
+                    log.debug("DENIED: required user not found");
+                    return "access-denied";
+                }
+                
+                // are we also enforcing a specific role?
+                if(theAction.requiredUserRole() != null) {
+                    log.debug("DENIED: user does not have role = "+theAction.requiredUserRole());
+                    if(!authenticatedUser.hasRole(theAction.requiredUserRole())) {
+                        return "access-denied";
+                    }
+                }
+                
+                // are we requiring a valid action weblog?
+                if(theAction.isWeblogRequired()) {
+                    
+                    WebsiteData actionWeblog = ((UIAction)theAction).getActionWeblog();
+                    if(actionWeblog == null) {
+                        log.debug("DENIED: required action weblog not found");
+                        return "access-denied";
+                    }
+                    
+                    // are we also enforcing a specific weblog permission?
+                    if(theAction.requiredWeblogPermissions() > -1) {
+                        
+                        if(!actionWeblog.hasUserPermissions(authenticatedUser,
+                                theAction.requiredWeblogPermissions())) {
+                            log.debug("DENIED: user does not have required weblog permissions = "+
+                                    theAction.requiredWeblogPermissions());
+                            return "access-denied";
+                        }
+                    }
+                }
+                
+            }
+            
+        }
+        
+        return invocation.invoke();
+    }
+    
+}

Modified: roller/trunk/web/WEB-INF/classes/roller.properties
URL: http://svn.apache.org/viewvc/roller/trunk/web/WEB-INF/classes/roller.properties?view=diff&rev=529793&r1=529792&r2=529793
==============================================================================
--- roller/trunk/web/WEB-INF/classes/roller.properties (original)
+++ roller/trunk/web/WEB-INF/classes/roller.properties Tue Apr 17 15:23:45 2007
@@ -237,7 +237,11 @@
 /roller-ui/user.do,\
 /roller-ui/yourProfile.do,\
 /roller-ui/admin/user.do,\
-/roller-ui/authoring/userdata
+/roller-ui/authoring/userdata,\
+/roller-ui/login,\
+/roller-ui/register,\
+/roller-ui/profile,\
+/roller-ui/login-redirect
 
 # Password security settings
 passwds.encryption.enabled=false

Added: roller/trunk/web/WEB-INF/classes/struts.properties
URL: http://svn.apache.org/viewvc/roller/trunk/web/WEB-INF/classes/struts.properties?view=auto&rev=529793
==============================================================================
--- roller/trunk/web/WEB-INF/classes/struts.properties (added)
+++ roller/trunk/web/WEB-INF/classes/struts.properties Tue Apr 17 15:23:45 2007
@@ -0,0 +1,26 @@
+
+# use spring as the object factory
+struts.objectFactory=spring
+
+# use the simple theme
+struts.ui.theme=simple
+
+# set the struts action extension to 'rol'
+struts.action.extension=rol
+
+# dev mode options
+struts.devMode=true
+struts.configuration.xml.reload=true
+struts.i18n.reload=false
+
+# this enables the translation of action="foo!method" to work nicely
+struts.enable.DynamicMethodInvocation=true
+
+# prevent the damn s:url calls from including undesired query params by default
+struts.url.includeParams=none
+
+# this tells struts2 what the special name is for our global resource bundle
+# eventually we should remove this when the struts2 migration is mostly complete
+# and use the highly preferred way of splitting the resource bundles into
+# smaller pieces per package or class
+struts.custom.i18n.resources=ApplicationResources

Added: roller/trunk/web/WEB-INF/classes/struts.xml
URL: http://svn.apache.org/viewvc/roller/trunk/web/WEB-INF/classes/struts.xml?view=auto&rev=529793
==============================================================================
--- roller/trunk/web/WEB-INF/classes/struts.xml (added)
+++ roller/trunk/web/WEB-INF/classes/struts.xml Tue Apr 17 15:23:45 2007
@@ -0,0 +1,274 @@
+<!DOCTYPE struts PUBLIC
+    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
+    "http://struts.apache.org/dtds/struts-2.0.dtd">
+<struts>
+    
+    <!-- Weblogger default package -->
+    <package name="weblogger" namespace="/roller-ui" extends="struts-default">
+        
+        <!-- Define Tiles result type -->
+        <result-types>
+            <result-type name="tiles" class="org.apache.struts2.views.tiles.TilesResult" />
+        </result-types>
+        
+        <!-- define our own interceptors and a custom interceptor stack -->
+        <interceptors>
+            <interceptor name="UIActionInterceptor" 
+                         class="org.apache.roller.ui.core.util.struts2.UIActionInterceptor" />
+            <interceptor name="UISecurityInterceptor" 
+                         class="org.apache.roller.ui.core.util.struts2.UISecurityInterceptor" />
+            <interceptor-stack name="rollerStack">
+                <interceptor-ref name="defaultStack"/>
+                <interceptor-ref name="UIActionInterceptor"/>
+                <interceptor-ref name="UISecurityInterceptor"/>
+            </interceptor-stack>
+        </interceptors>
+        
+        <!-- use our own interceptor stack which extends the default stack -->
+        <default-interceptor-ref name="rollerStack"/>
+        
+        <global-results>
+            <result name="access-denied" type="tiles">.denied</result>
+            <result name="error">/error.jsp</result>
+        </global-results>
+        
+        
+        <!-- Simple actions which basically just replace the global-forwards from
+             the old struts 1 config.  this is the only way to do it in struts 2 -->
+        <action name="home">
+            <result type="redirect">/</result>
+        </action>
+        
+        <action name="login-redirect">
+            <result>/roller-ui/login-redirect.jsp</result>
+        </action>
+        
+        <action name="logout">
+            <result>/roller-ui/logout-redirect.jsp</result>
+        </action>
+        
+        
+        <action name="login"
+                class="org.apache.roller.ui.core.struts2.Login">
+            <result type="tiles">.Login</result>
+        </action>
+        
+        <action name="register!*" method="{1}"
+                class="org.apache.roller.ui.core.struts2.RegisterForm">
+            <result name="input" type="tiles">.RegisterForm</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>
+            <result name="cancel" type="redirect-action">menu</result>
+            <result name="success" type="tiles">.ProfileForm</result>
+        </action>
+        
+        <action name="createWeblog!*" method="{1}"
+                class="org.apache.roller.ui.core.struts2.CreateWeblogForm">
+            <result name="input" type="tiles">.CreateWeblogForm</result>
+            <result name="cancel" type="redirect-action">menu</result>
+            <result name="success" type="chain">menu</result>
+        </action>
+        
+        <action name="menu!*" method="{1}"
+                class="org.apache.roller.ui.core.struts2.MainMenu">
+            <result type="tiles">.MainMenu</result>
+        </action>
+        
+    </package>
+    
+    
+    <!-- Weblogger Admin UI (includes planet) -->
+    <!--
+    <package name="weblogger-admin" namespace="/roller-ui/admin" extends="weblogger">
+        
+        <action name="rollerConfig!*" method="{1}"
+                class="org.apache.roller.ui.admin.struts2.RollerPropertiesAction">
+            <result name="rollerProperties.page">.rollerProperties</result>
+        </action>
+        
+        <action name="user!*" method="{1}"
+                class="org.apache.roller.ui.admin.struts2.UserAdminAction">
+            <result name="adminUser.page">.UserAdmin</result>
+        </action>
+        
+        <action name="commentManagement!*" method="{1}"
+                class="org.apache.roller.ui.authoring.struts2.CommentManagementAction">
+            <result name="commentManagement.page">.CommentManagement</result>
+            <result name="commentManagementGlobal.page">.CommentManagementGlobal</result>
+        </action>
+        
+        <action name="commentQuery!*" method="{1}"
+                class="org.apache.roller.ui.authoring.struts2.CommentManagementAction">
+            <result name="commentManagement.page">.CommentManagement</result>
+            <result name="commentManagementGlobal.page">.CommentManagementGlobal</result>
+        </action>
+        
+        <action name="commonPingTargets!*" method="{1}"
+                class="org.apache.roller.ui.admin.struts2.CommonPingTargetsAction">
+            <result name="pingTargets.page">.CommonPingTargets</result>
+            <result name="pingTargetEdit.page">.CommonPingTargetEdit</result>
+            <result name="pingTargetDeleteOK.page">.CommonPingTargetDeleteOK</result>
+        </action>
+        
+        <action name="cacheInfo!*" method="{1}"
+                class="org.apache.roller.ui.admin.struts2.CacheInfoAction">
+            <result name="cacheInfo.page">.cacheInfo</result>
+        </action>
+        
+        <action name="planetConfig!*" method="{1}"
+                class="org.apache.roller.planet.ui.admin.struts2.PlanetConfigAction">
+            <result name="planetConfig.page">.PlanetConfig</result>
+        </action>
+        
+        <action name="planetSubscriptions!*" method="{1}"
+                class="org.apache.roller.planet.ui.admin.struts2.PlanetSubscriptionsAction">
+            <result name="planetSubscriptions.page">.PlanetSubscriptions</result>
+        </action>
+        
+        <action name="planetGroups!*" method="{1}"
+                class="org.apache.roller.planet.ui.admin.struts2.PlanetGroupsAction">
+            <result name="planetGroups.page">.PlanetGroups</result>
+        </action>
+        
+    </package>
+    -->
+    
+    <!-- Weblogger Authoring UI -->
+    <!--
+    <package name="weblogger-authoring" namespace="/roller-ui/authoring" extends="weblogger">
+        
+        <action name="pingSetup!*" method="{1}"
+                class="org.apache.roller.ui.authoring.struts2.PingSetupAction">
+            <result name="pingSetup.page">.Pings</result>
+            <result name="pingResult.page">.PingResult</result>
+        </action>
+        <action name="customPingTargets!*" method="{1}"
+                class="org.apache.roller.ui.authoring.struts2.CustomPingTargetsAction">
+            <result name="pingTargets.page">.CustomPingTargets</result>
+            <result name="pingTargetEdit.page">.CustomPingTargetEdit</result>
+            <result name="pingTargetDeleteOK.page">.CustomPingTargetDeleteOK</result>
+        </action>
+        <action name="categories!*" method="{1}"
+                class="org.apache.roller.ui.authoring.struts2.CategoriesAction">
+            <result name="CategoriesForm">.CategoriesForm</result>
+        </action>
+        <action name="importBookmarks!*" method="{1}"
+                class="org.apache.roller.ui.authoring.struts2.ImportBookmarksFormAction">
+            <result name="importBookmarks.page">.import</result>
+        </action>
+        <action name="importEntries!*" method="{1}"
+                class="org.apache.roller.ui.authoring.struts2.ImportEntriesAction">
+            <result name="importEntries.page">.import-entries</result>
+        </action>
+        
+        <action name="categoryDelete!*" method="{1}"
+                class="org.apache.roller.ui.authoring.struts2.CategoryDeleteAction">
+            <result name="CategoryDeleteOK">.CategoryDeleteOK</result>
+        </action>
+        <action name="categoryEdit!*" method="{1}"
+                class="org.apache.roller.ui.authoring.struts2.CategoryEditAction">
+            <result name="CategoryForm">.CategoryForm</result>
+        </action>
+        <action name="maintenance!*" method="{1}"
+                class="org.apache.roller.ui.authoring.struts2.MaintenanceAction">
+            <result name="maintenance.page">.Maintenance</result>
+        </action>
+        <action name="bookmarkEdit!*" method="{1}"
+                class="org.apache.roller.ui.authoring.struts2.BookmarkEditAction">
+            <result name="BookmarkForm">.BookmarkForm</result>
+        </action>
+        
+        <action name="bookmarks!*" method="{1}"
+                class="org.apache.roller.ui.authoring.struts2.BookmarksAction">
+            <result name="BookmarksForm">.BookmarksForm</result>
+        </action>
+        
+        <action name="categorySave!*" method="{1}"
+                class="org.apache.roller.ui.authoring.struts2.CategorySaveAction">
+        </action>
+        <action name="inviteMember!*" method="{1}"
+                class="org.apache.roller.ui.authoring.struts2.InviteMemberAction">
+            <result name="inviteMember.page">.InviteMember</result>
+        </action>
+        <action name="weblog!*" method="{1}"
+                class="org.apache.roller.ui.authoring.struts2.WeblogEntryFormAction">
+            <result name="weblogEdit.page">.WeblogEdit</result>
+            <result name="weblogEntryRemove.page">.WeblogEntryRemove</result>
+        </action>
+        
+        <action name="weblogEntryManagement!*" method="{1}"
+                class="org.apache.roller.ui.authoring.struts2.WeblogEntryManagementAction">
+            <result name="weblogEntryManagement.page">.WeblogEntryManagement</result>
+        </action>
+        <action name="themeEditor!*" method="{1}"
+                class="org.apache.roller.ui.authoring.struts2.ThemeEditorAction">
+            <result name="editTheme.page">.theme-editor</result>
+        </action>
+        
+        <action name="memberPermissions!*" method="{1}"
+                class="org.apache.roller.ui.authoring.struts2.MemberPermissionsAction">
+            <result name="memberPermissions.page">.MemberPermissions</result>
+        </action>
+        
+        <action name="referers!*" method="{1}"
+                class="org.apache.roller.ui.authoring.struts2.ReferersAction">
+            <result name="referers.page">.referers</result>
+        </action>
+        
+        <action name="folderEdit!*" method="{1}"
+                class="org.apache.roller.ui.authoring.struts2.FolderEditAction">
+            <result name="FolderForm">.FolderForm</result>
+        </action>
+        <action name="page!*" method="{1}"
+                class="org.apache.roller.ui.authoring.struts2.WeblogTemplateFormAction">
+            <result name="removePage.page">.remove-page</result>
+            <result name="editPage.page">.edit-page</result>
+            <result name="editPages.page">.edit-pages</result>
+        </action>
+        
+        <action name="folderSave!*" method="{1}"
+                class="org.apache.roller.ui.authoring.struts2.FolderSaveAction">
+            <result name="Bookmarks" type="dispatcher">/roller-ui/authoring/bookmarks.action!selectFolder</result>
+        </action>
+        <action name="invitations!*" method="{1}"
+                class="org.apache.roller.ui.authoring.struts2.InvitationsAction">
+            <result name="invitations.page">.Invitations</result>
+        </action>
+        <action name="toggleLinkback!*" method="{1}"
+                class="org.apache.roller.ui.authoring.struts2.ToggleLinkbackDisplayAction">
+        </action>
+        <action name="bookmarkSave!*" method="{1}"
+                class="org.apache.roller.ui.authoring.struts2.BookmarkSaveAction">
+            <result name="Bookmarks" type="dispatcher">/roller-ui/authoring/bookmarks.action!selectFolder</result>
+            <result name="BookmarkEdit" type="dispatcher">/roller-ui/authoring/bookmarkEdit.action</result>
+        </action>
+        <action name="commentManagement!*" method="{1}"
+                class="org.apache.roller.ui.authoring.struts2.CommentManagementAction">
+            <result name="commentManagement.page">.CommentManagement</result>
+            <result name="commentManagementGlobal.page">.CommentManagementGlobal</result>
+        </action>
+        <action name="commentQuery!*" method="{1}"
+                class="org.apache.roller.ui.authoring.struts2.CommentManagementAction">
+            <result name="commentManagement.page">.CommentManagement</result>
+            <result name="commentManagementGlobal.page">.CommentManagementGlobal</result>
+        </action>
+        
+        <action name="website!*" method="{1}"
+                class="org.apache.roller.ui.authoring.struts2.WebsiteFormAction">
+            <result name="editWebsite.page">.edit-website</result>
+            <result name="removeWebsite.page">.WebsiteRemove</result>
+        </action>
+        <action name="uploadFiles!*" method="{1}"
+                class="org.apache.roller.ui.authoring.struts2.UploadFileFormAction">
+            <result name="uploadFiles.page">.upload-file</result>
+        </action>
+    </package>
+    -->
+    
+</struts>
+



Mime
View raw message