roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agillil...@apache.org
Subject svn commit: r533435 [1/2] - in /roller/trunk: src/org/apache/roller/ui/admin/struts2/ src/org/apache/roller/ui/authoring/struts2/ web/WEB-INF/ web/WEB-INF/classes/ web/WEB-INF/jsps/admin/struts2/ web/WEB-INF/jsps/authoring/struts2/
Date Sat, 28 Apr 2007 22:20:03 GMT
Author: agilliland
Date: Sat Apr 28 15:20:00 2007
New Revision: 533435

URL: http://svn.apache.org/viewvc?view=rev&rev=533435
Log:
struts2 versions for some authoring and admin actions.


Added:
    roller/trunk/src/org/apache/roller/ui/admin/struts2/
    roller/trunk/src/org/apache/roller/ui/admin/struts2/CacheInfo.java
    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/admin/struts2/GlobalConfig.java
    roller/trunk/src/org/apache/roller/ui/admin/struts2/ModifyUser.java
    roller/trunk/src/org/apache/roller/ui/admin/struts2/UserAdmin.java
    roller/trunk/src/org/apache/roller/ui/admin/struts2/admin-menu.xml
    roller/trunk/src/org/apache/roller/ui/authoring/struts2/
    roller/trunk/src/org/apache/roller/ui/authoring/struts2/TemplateAdd.java
    roller/trunk/src/org/apache/roller/ui/authoring/struts2/TemplateEdit.java
    roller/trunk/src/org/apache/roller/ui/authoring/struts2/TemplateEditBean.java
    roller/trunk/src/org/apache/roller/ui/authoring/struts2/Templates.java
    roller/trunk/src/org/apache/roller/ui/authoring/struts2/ThemeEdit.java
    roller/trunk/src/org/apache/roller/ui/authoring/struts2/editor-menu.xml
    roller/trunk/web/WEB-INF/jsps/admin/struts2/
    roller/trunk/web/WEB-INF/jsps/admin/struts2/CacheInfo.jsp
    roller/trunk/web/WEB-INF/jsps/admin/struts2/CreateUser.jsp
    roller/trunk/web/WEB-INF/jsps/admin/struts2/GlobalConfig.jsp
    roller/trunk/web/WEB-INF/jsps/admin/struts2/ModifyUser.jsp
    roller/trunk/web/WEB-INF/jsps/admin/struts2/UserAdmin.jsp
    roller/trunk/web/WEB-INF/jsps/authoring/struts2/
    roller/trunk/web/WEB-INF/jsps/authoring/struts2/TemplateAdd-form-ajax.jsp
    roller/trunk/web/WEB-INF/jsps/authoring/struts2/TemplateAdd-success-ajax.jsp
    roller/trunk/web/WEB-INF/jsps/authoring/struts2/TemplateEdit.jsp
    roller/trunk/web/WEB-INF/jsps/authoring/struts2/Templates-list-ajax.jsp
    roller/trunk/web/WEB-INF/jsps/authoring/struts2/Templates.jsp
    roller/trunk/web/WEB-INF/jsps/authoring/struts2/ThemeEdit.jsp
Modified:
    roller/trunk/web/WEB-INF/classes/struts.xml
    roller/trunk/web/WEB-INF/tiles.xml

Added: roller/trunk/src/org/apache/roller/ui/admin/struts2/CacheInfo.java
URL: http://svn.apache.org/viewvc/roller/trunk/src/org/apache/roller/ui/admin/struts2/CacheInfo.java?view=auto&rev=533435
==============================================================================
--- roller/trunk/src/org/apache/roller/ui/admin/struts2/CacheInfo.java (added)
+++ roller/trunk/src/org/apache/roller/ui/admin/struts2/CacheInfo.java Sat Apr 28 15:20:00 2007
@@ -0,0 +1,109 @@
+/*
+ * 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.admin.struts2;
+
+import java.util.Collections;
+import java.util.Map;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.roller.ui.core.util.struts2.UIAction;
+import org.apache.roller.util.cache.CacheManager;
+
+
+/**
+ * Action for displaying rendering cache info.
+ */
+public class CacheInfo extends UIAction {
+    
+    private static Log log = LogFactory.getLog(CacheInfo.class);
+    
+    // map of stats to display
+    private Map stats = Collections.EMPTY_MAP;
+    
+    // cache which we would clear when clear() is called
+    private String cache = null;
+    
+    
+    public CacheInfo() {
+        this.actionName = "cacheInfo";
+        this.desiredMenu = "admin";
+        this.pageTitle = "";
+    }
+    
+    
+    public String requiredUserRole() {
+        return "admin";
+    }
+    
+    public boolean isWeblogRequired() {
+        return false;
+    }
+    
+    
+    public void myPrepare() {
+        Map cacheStats = CacheManager.getStats();
+        setStats(cacheStats);
+    }
+    
+    
+    public String execute() {
+        return SUCCESS;
+    }
+
+    
+    /**
+     * clear action.
+     *
+     * this is triggered when someone has indicated that they want to clear
+     * one or all of the caches.
+     */
+    public String clear() {
+        
+        // see if a specific cache was specified
+        String handlerClass = getCache();
+        if(handlerClass != null && handlerClass.length() > 0) {
+            CacheManager.clear(handlerClass);
+        } else {
+            CacheManager.clear();
+        }
+        
+        // update stats after clear
+        myPrepare();
+        
+        return SUCCESS;
+    }
+
+    
+    public Map getStats() {
+        return stats;
+    }
+
+    public void setStats(Map stats) {
+        this.stats = stats;
+    }
+
+    public String getCache() {
+        return cache;
+    }
+
+    public void setCache(String cache) {
+        this.cache = cache;
+    }
+
+}

Added: 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=auto&rev=533435
==============================================================================
--- roller/trunk/src/org/apache/roller/ui/admin/struts2/CreateUser.java (added)
+++ roller/trunk/src/org/apache/roller/ui/admin/struts2/CreateUser.java Sat Apr 28 15:20:00 2007
@@ -0,0 +1,163 @@
+/*
+ * 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.admin.struts2;
+
+import java.util.Locale;
+import java.util.TimeZone;
+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.struts2.RegisterForm;
+import org.apache.roller.ui.core.util.struts2.UIAction;
+
+
+/**
+ * Action for admins to manually create new user accounts.
+ */
+public class CreateUser extends UIAction {
+    
+    private static Log log = LogFactory.getLog(CreateUser.class);
+    
+    // a bean to store our form data
+    private CreateUserBean bean = new CreateUserBean();
+    
+    
+    public CreateUser() {
+        this.actionName = "createUser";
+        this.desiredMenu = "admin";
+        this.pageTitle = "userAdmin.title.createNewUser";
+    }
+    
+    
+    // admin role required
+    public String requiredUserRole() {
+        return "admin";
+    }
+    
+    // no weblog required
+    public boolean isWeblogRequired() {
+        return false;
+    }
+    
+    
+    /**
+     * Show admin user creation form.
+     */
+    public String execute() {
+        
+        // defaults for locale and timezone
+        getBean().setLocale(Locale.getDefault().toString());
+        getBean().setTimeZone(TimeZone.getDefault().getID());
+        
+        return INPUT;
+    }
+    
+    
+    /**
+     * Create a new user.
+     */
+    public String save() {
+        
+        // run some validation
+        myValidate();
+        
+        if (!hasActionErrors()) try {
+            
+            UserManager mgr = RollerFactory.getRoller().getUserManager();
+            
+            // copy form data into new user pojo
+            UserData newUser = new UserData();
+            getBean().copyTo(newUser, getLocale()); // doesn't copy password
+            newUser.setDateCreated(new java.util.Date());
+            
+            // set username and password
+            newUser.setUserName(getBean().getUserName());
+            newUser.resetPassword(RollerFactory.getRoller(),
+                    getBean().getPassword(), getBean().getPassword());
+            
+            // are we granting the user admin rights?
+            if(((CreateUserBean)getBean()).isAdministrator()) {
+                newUser.grantRole("admin");
+            }
+            
+            // save new user
+            mgr.addUser(newUser);
+            RollerFactory.getRoller().flush();
+            
+            // TODO: i18n
+            addMessage("New user created");
+            
+            return INPUT;
+            
+        } catch (RollerException e) {
+            log.error("Error adding new user", e);
+            // TODO: i18n
+            addError("Error creating user");
+        }
+        
+        return INPUT;
+    }
+    
+    
+    public String cancel() {
+        return "cancel";
+    }
+    
+    
+    // TODO: replace with struts2 validation
+    protected 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");
+        }
+        
+        if (StringUtils.isEmpty(getBean().getPassword()) && 
+                StringUtils.isEmpty(getBean().getPassword())) {
+            addError("error.add.user.missingPassword");
+        }
+    }
+    
+    
+    public CreateUserBean getBean() {
+        return bean;
+    }
+
+    public void setBean(CreateUserBean bean) {
+        this.bean = bean;
+    }
+    
+}

Added: 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=auto&rev=533435
==============================================================================
--- roller/trunk/src/org/apache/roller/ui/admin/struts2/CreateUserBean.java (added)
+++ roller/trunk/src/org/apache/roller/ui/admin/struts2/CreateUserBean.java Sat Apr 28 15:20:00 2007
@@ -0,0 +1,151 @@
+/*
+ * 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.admin.struts2;
+
+import java.util.Locale;
+import org.apache.roller.pojos.UserData;
+import org.apache.roller.ui.core.struts2.RegisterFormBean;
+
+
+/**
+ * Bean used by CreateUser action.
+ */
+public class CreateUserBean {
+    
+    private String id = null;
+    private String userName = null;
+    private String password = null;
+    private String fullName = null;
+    private String emailAddress = null;
+    private String locale = null;
+    private String timeZone = null;
+    private Boolean enabled = Boolean.TRUE;
+    private String activationCode = null;
+    
+    private boolean administrator = false;
+    
+    
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
+    public String getFullName() {
+        return fullName;
+    }
+
+    public void setFullName(String fullName) {
+        this.fullName = fullName;
+    }
+
+    public String getEmailAddress() {
+        return emailAddress;
+    }
+
+    public void setEmailAddress(String emailAddress) {
+        this.emailAddress = emailAddress;
+    }
+
+    public String getLocale() {
+        return locale;
+    }
+
+    public void setLocale(String locale) {
+        this.locale = locale;
+    }
+
+    public String getTimeZone() {
+        return timeZone;
+    }
+
+    public void setTimeZone(String timeZone) {
+        this.timeZone = timeZone;
+    }
+    
+    public Boolean getEnabled() {
+        return enabled;
+    }
+
+    public void setEnabled(Boolean enabled) {
+        this.enabled = enabled;
+    }
+
+    public String getActivationCode() {
+        return activationCode;
+    }
+
+    public void setActivationCode(String activationCode) {
+        this.activationCode = activationCode;
+    }
+    
+    public boolean isAdministrator() {
+        return administrator;
+    }
+
+    public void setAdministrator(boolean administrator) {
+        this.administrator = administrator;
+    }
+    
+    
+    public void copyTo(UserData dataHolder, Locale locale) {
+        
+        dataHolder.setFullName(this.fullName);
+        dataHolder.setEmailAddress(this.emailAddress);
+        dataHolder.setLocale(this.locale);
+        dataHolder.setTimeZone(this.timeZone);
+        dataHolder.setEnabled(new Boolean(this.enabled));
+        dataHolder.setActivationCode(this.activationCode);
+    }
+    
+    
+    public void copyFrom(UserData dataHolder, Locale locale) {
+        
+        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.enabled = dataHolder.getEnabled();
+        this.activationCode = dataHolder.getActivationCode();
+        
+        this.administrator = dataHolder.hasRole("admin");
+    }
+    
+}

Added: roller/trunk/src/org/apache/roller/ui/admin/struts2/GlobalConfig.java
URL: http://svn.apache.org/viewvc/roller/trunk/src/org/apache/roller/ui/admin/struts2/GlobalConfig.java?view=auto&rev=533435
==============================================================================
--- roller/trunk/src/org/apache/roller/ui/admin/struts2/GlobalConfig.java (added)
+++ roller/trunk/src/org/apache/roller/ui/admin/struts2/GlobalConfig.java Sat Apr 28 15:20:00 2007
@@ -0,0 +1,203 @@
+/*
+ * 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.admin.struts2;
+
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.roller.RollerException;
+import org.apache.roller.business.PropertiesManager;
+import org.apache.roller.business.RollerFactory;
+import org.apache.roller.config.RollerRuntimeConfig;
+import org.apache.roller.config.runtime.ConfigDef;
+import org.apache.roller.config.runtime.RuntimeConfigDefs;
+import org.apache.roller.pojos.RollerPropertyData;
+import org.apache.roller.ui.core.util.struts2.UIAction;
+import org.apache.struts2.interceptor.ParameterAware;
+
+
+/**
+ * Action which handles editing of global configuration.
+ */
+public class GlobalConfig extends UIAction implements ParameterAware {
+    
+    private static Log log = LogFactory.getLog(GlobalConfig.class);
+    
+    // the request parameters as <String, String[]>
+    private Map params = Collections.EMPTY_MAP;
+    
+    // map of config properties
+    private Map properties = Collections.EMPTY_MAP;
+    
+    // the runtime config def used to populate the display
+    private ConfigDef globalConfigDef = null;
+    
+    
+    public GlobalConfig() {
+        this.actionName = "globalConfig";
+        this.desiredMenu = "admin";
+        this.pageTitle = "configForm.title";
+    }
+    
+    
+    public boolean isWeblogRequired() {
+        return false;
+    }
+    
+    public String requiredUserRole() {
+        return "admin";
+    }
+    
+    
+    /**
+     * Prepare action by loading runtime properties map.
+     */
+    public void myPrepare() {
+        try {
+            // just grab our properties map and make it available to the action
+            PropertiesManager mgr = RollerFactory.getRoller().getPropertiesManager();
+            setProperties(mgr.getProperties());
+        } catch (RollerException ex) {
+            log.error("Error getting runtime properties map", ex);
+            // TODO: i18n
+            addError("Unexpected error accessing Roller properties");
+        }
+        
+        // set config def used to draw the view
+        RuntimeConfigDefs defs = RollerRuntimeConfig.getRuntimeConfigDefs();
+        List<ConfigDef> configDefs = defs.getConfigDefs();
+        for(ConfigDef configDef : configDefs) {
+            if("global-properties".equals(configDef.getName())) {
+                setGlobalConfigDef(configDef);
+            }
+        }
+    }
+    
+    
+    /**
+     * Display global properties editor form.
+     */
+    public String execute() {
+        return SUCCESS;
+    }
+    
+    
+    /**
+     * Save global properties.
+     */
+    public String save() {
+        
+        // only set values for properties that are already defined
+        String propName = null;
+        RollerPropertyData updProp = null;
+        String incomingProp = null;
+        Iterator propsIT = getProperties().keySet().iterator();
+        while(propsIT.hasNext()) {
+            propName = (String) propsIT.next();
+            updProp = (RollerPropertyData) getProperties().get(propName);
+            incomingProp = this.getParameter(updProp.getName());
+            
+            log.debug("Checking property ["+propName+"]");
+            log.debug("Request value is ["+incomingProp+"]");
+            
+            // some special treatment for booleans
+            // this is a bit hacky since we are assuming that any prop
+            // with a value of "true" or "false" is meant to be a boolean
+            // it may not always be the case, but we should be okay for now
+            if( updProp.getValue() != null // null check needed w/Oracle
+                    && (updProp.getValue().equals("true") || updProp.getValue().equals("false"))) {
+                
+                if(incomingProp == null || !incomingProp.equals("on"))
+                    incomingProp = "false";
+                else
+                    incomingProp = "true";
+            }
+            
+            // only work on props that were submitted with the request
+            if(incomingProp != null) {
+                log.debug("Setting new value for ["+propName+"]");
+                
+                // NOTE: the old way had some locale sensitive way to do this??
+                updProp.setValue(incomingProp.trim());
+            }
+        }
+        
+        try {
+            // save 'em and flush
+            PropertiesManager mgr = RollerFactory.getRoller().getPropertiesManager();
+            mgr.saveProperties(getProperties());
+            RollerFactory.getRoller().flush();
+            
+            // notify user of our success
+            addMessage("weblogEdit.changesSaved");
+            
+        } catch (RollerException ex) {
+            log.error("Error saving roller properties", ex);
+            // TODO: i18n
+            addError("error.update.rollerConfig");
+        }
+                
+        return SUCCESS;
+    }
+    
+    
+    public void setParameters(Map parameters) {
+        this.params = parameters;
+        
+        if(log.isDebugEnabled()) {
+            log.debug("Parameter map:");
+            Set<String> keys = parameters.keySet();
+            for(String key : keys) {
+                log.debug(key+" = "+parameters.get(key));
+            }
+        }
+    }
+    
+    // convenience method for getting a single parameter as a String
+    private String getParameter(String key) {
+        
+        String[] p = (String[]) this.params.get(key);
+        if(p != null && p.length > 0) {
+            return p[0];
+        }
+        return null;
+    }
+    
+    
+    public Map getProperties() {
+        return properties;
+    }
+
+    public void setProperties(Map properties) {
+        this.properties = properties;
+    }
+
+    public ConfigDef getGlobalConfigDef() {
+        return globalConfigDef;
+    }
+
+    public void setGlobalConfigDef(ConfigDef globalConfigDef) {
+        this.globalConfigDef = globalConfigDef;
+    }
+    
+}

Added: roller/trunk/src/org/apache/roller/ui/admin/struts2/ModifyUser.java
URL: http://svn.apache.org/viewvc/roller/trunk/src/org/apache/roller/ui/admin/struts2/ModifyUser.java?view=auto&rev=533435
==============================================================================
--- roller/trunk/src/org/apache/roller/ui/admin/struts2/ModifyUser.java (added)
+++ roller/trunk/src/org/apache/roller/ui/admin/struts2/ModifyUser.java Sat Apr 28 15:20:00 2007
@@ -0,0 +1,202 @@
+/*
+ * 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.admin.struts2;
+
+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.pojos.UserData;
+import org.apache.roller.ui.core.util.struts2.UIAction;
+
+
+/**
+ * Action that allows an admin to modify a users profile.
+ */
+public class ModifyUser extends UIAction {
+    
+    private static Log log = LogFactory.getLog(ModifyUser.class);
+    
+    // user we are modifying
+    private UserData user = new UserData();
+    
+    // a bean to store our form data
+    private CreateUserBean bean = new CreateUserBean();
+    
+    private String userName = null;
+    
+    
+    public ModifyUser() {
+        this.actionName = "modifyUser";
+        this.desiredMenu = "admin";
+        this.pageTitle = "userAdmin.title.editUser";
+    }
+    
+    
+    // admin role required
+    public String requiredUserRole() {
+        return "admin";
+    }
+    
+    // no weblog required
+    public boolean isWeblogRequired() {
+        return false;
+    }
+    
+    
+    // prepare for action by loading user object we are modifying
+    public void myPrepare() {
+        
+        // load the user object we are modifying
+        if(getUserName() != null) {
+            try {
+                UserManager mgr = RollerFactory.getRoller().getUserManager();
+                setUser(mgr.getUserByUserName(getUserName()));
+            } catch(Exception e) {
+                log.error("Error looking up user - "+getUserName(), e);
+            }
+        } else if(getBean().getId() != null) {
+            try {
+                UserManager mgr = RollerFactory.getRoller().getUserManager();
+                setUser(mgr.getUser(getBean().getId()));
+            } catch(Exception e) {
+                log.error("Error looking up user - "+getBean().getId(), e);
+            }
+        }
+    }
+    
+    
+    /**
+     * Show admin user edit page.
+     */
+    public String execute() {
+        
+        if(getUser().getId() != null) {
+            // populate form data from user profile data
+            getBean().copyFrom(getUser(), getLocale());
+        } else {
+            // TODO: i18n
+            addError("No user specified");
+        }
+
+        return INPUT;
+    }
+    
+    
+    /**
+     * Save modified user profile.
+     */
+    public String save() {
+        
+        // custom validation
+        myValidate();
+        
+        if (!hasActionErrors()) {
+            
+            getBean().copyTo(getUser(), getLocale());
+            
+            // reset password if set
+            if (!StringUtils.isEmpty(getBean().getPassword())) {
+                try {
+                    getUser().resetPassword(RollerFactory.getRoller(),
+                            getBean().getPassword(),
+                            getBean().getPassword());
+                } catch (RollerException e) {
+                    addMessage("yourProfile.passwordResetError");
+                }
+            }
+            
+            try {
+                UserManager mgr = RollerFactory.getRoller().getUserManager();
+                
+                // grant/revoke admin role if needed
+                if(getUser().hasRole("admin") && !getBean().isAdministrator()) {
+                    // revoke role
+                    mgr.revokeRole("admin", getUser());
+                } else if(!getUser().hasRole("admin") && getBean().isAdministrator()) {
+                    // grant role
+                    getUser().grantRole("admin");
+                }
+            
+                // save the updated profile
+                mgr.saveUser(getUser());
+                RollerFactory.getRoller().flush();
+                
+                // TODO: i18n
+                addMessage("user updated.");
+                
+                return INPUT;
+                
+            } catch (RollerException ex) {
+                log.error("ERROR in action", ex);
+                // TODO: i18n
+                addError("unexpected error doing profile save");
+            }
+            
+        }
+        
+        return INPUT;
+    }
+    
+    
+    public String cancel() {
+        return "cancel";
+    }
+    
+    
+    // TODO: replace with struts2 validation
+    private void myValidate() {
+        
+        if(getUser().getId() == null) {
+            // TODO: i18n
+            addError("user not found");
+        }
+        if (StringUtils.isEmpty(getBean().getEmailAddress())) {
+            addError("error.add.user.missingEmailAddress");
+        }
+    }
+    
+    
+    public CreateUserBean getBean() {
+        return bean;
+    }
+
+    public void setBean(CreateUserBean bean) {
+        this.bean = bean;
+    }
+
+    public UserData getUser() {
+        return user;
+    }
+
+    public void setUser(UserData user) {
+        this.user = user;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+    
+}

Added: roller/trunk/src/org/apache/roller/ui/admin/struts2/UserAdmin.java
URL: http://svn.apache.org/viewvc/roller/trunk/src/org/apache/roller/ui/admin/struts2/UserAdmin.java?view=auto&rev=533435
==============================================================================
--- roller/trunk/src/org/apache/roller/ui/admin/struts2/UserAdmin.java (added)
+++ roller/trunk/src/org/apache/roller/ui/admin/struts2/UserAdmin.java Sat Apr 28 15:20:00 2007
@@ -0,0 +1,55 @@
+/*
+ * 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.admin.struts2;
+
+import org.apache.roller.ui.core.util.struts2.UIAction;
+
+
+/**
+ * Action which displays user admin search page.
+ */
+public class UserAdmin extends UIAction {
+    
+    
+    public UserAdmin() {
+        this.actionName = "userAdmin";
+        this.desiredMenu = "admin";
+        this.pageTitle = "userAdmin.title.searchUser";
+    }
+    
+    
+    // admin role required
+    public String requiredUserRole() {
+        return "admin";
+    }
+    
+    // no weblog required
+    public boolean isWeblogRequired() {
+        return false;
+    }
+    
+    
+    /**
+     * Show user admin search page.
+     */
+    public String execute() {
+        return SUCCESS;
+    }
+    
+}

Added: roller/trunk/src/org/apache/roller/ui/admin/struts2/admin-menu.xml
URL: http://svn.apache.org/viewvc/roller/trunk/src/org/apache/roller/ui/admin/struts2/admin-menu.xml?view=auto&rev=533435
==============================================================================
--- roller/trunk/src/org/apache/roller/ui/admin/struts2/admin-menu.xml (added)
+++ roller/trunk/src/org/apache/roller/ui/admin/struts2/admin-menu.xml Sat Apr 28 15:20:00 2007
@@ -0,0 +1,49 @@
+<!-- 
+Defines the Roller Global Admin UI menu and roles allowed to use each menu. 
+Each menu or menu item is governed by four attrbibutes:
+
+See comments in editor-menu.xml for info about attributes.
+-->
+<menu-bar>
+    
+    <menu name="tabbedmenu.admin" roles="admin">
+        
+        <menu-item action="globalConfig"       
+                   name="tabbedmenu.admin.config" 
+                   roles="admin" />
+        
+        <menu-item action="userAdmin"          
+                   name="tabbedmenu.admin.userAdmin" 
+                   roles="admin"
+                   subactions="createUser,modifyUser" />
+        
+        <menu-item action="commentManagementGlobal" 
+                   name="tabbedmenu.admin.commentManagement" 
+                   roles="admin" 
+                   subactions="commentQueryGlobal" />
+        
+        <menu-item action="commonPingTargets"  
+                   name="tabbedmenu.admin.pingTargets"
+                   roles="admin" />
+        
+        <menu-item action="cacheInfo"          
+                   name="tabbedmenu.admin.cacheInfo"
+                   roles="admin" />
+    </menu>
+    
+    <menu name="tabbedmenu.planet" roles="admin" enabledProperty="planet.aggregator.enabled">
+        
+        <menu-item action="planetConfig"       
+                   name="tabbedmenu.admin.planetConfig" 
+                   roles="admin" />
+        
+        <menu-item action="planetSubscriptions" 
+                   name="tabbedmenu.admin.planetSubscriptions" 
+                   roles="admin" />
+        
+        <menu-item action="planetGroups"        
+                   name="tabbedmenu.admin.planetGroups" 
+                   roles="admin" />
+    </menu>
+    
+</menu-bar>

Added: roller/trunk/src/org/apache/roller/ui/authoring/struts2/TemplateAdd.java
URL: http://svn.apache.org/viewvc/roller/trunk/src/org/apache/roller/ui/authoring/struts2/TemplateAdd.java?view=auto&rev=533435
==============================================================================
--- roller/trunk/src/org/apache/roller/ui/authoring/struts2/TemplateAdd.java (added)
+++ roller/trunk/src/org/apache/roller/ui/authoring/struts2/TemplateAdd.java Sat Apr 28 15:20:00 2007
@@ -0,0 +1,209 @@
+/*
+ * 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.authoring.struts2;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Date;
+import java.util.Iterator;
+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.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.WeblogTemplate;
+import org.apache.roller.pojos.WeblogTheme;
+import org.apache.roller.pojos.WebsiteData;
+import org.apache.roller.ui.core.util.menu.Menu;
+import org.apache.roller.ui.core.util.menu.MenuHelper;
+import org.apache.roller.ui.core.util.struts2.UIAction;
+import org.apache.roller.util.cache.CacheManager;
+
+
+/**
+ * Action used for adding a new template.
+ */
+public class TemplateAdd extends UIAction {
+    
+    private static Log log = LogFactory.getLog(TemplateAdd.class);
+    
+    // list of actions available for creation
+    private List availableActions = Collections.EMPTY_LIST;
+    
+    // type of template being added, used by showAdd() method
+    private String addType = null;
+    
+    // name and action of new template if we are adding a template
+    private String newTmplName = null;
+    private String newTmplAction = null;
+    
+    
+    public TemplateAdd() {
+        this.actionName = "templateAdd";
+        this.desiredMenu = "editor";
+        this.pageTitle = "pagesForm.title";
+    }
+    
+    
+    // must be a weblog admin to use this action
+    public short requiredWeblogPermissions() {
+        return PermissionsData.ADMIN;
+    }
+    
+    
+    /**
+     * Display the add template form.
+     */
+    public String execute() {
+        
+        try {
+            List actions = new ArrayList();
+            if(WeblogTheme.CUSTOM.equals(getActionWeblog().getEditorTheme())) {
+                // if the weblog is using a custom theme then determine which
+                // action templates are still available to be created
+                actions.add(WeblogTemplate.ACTION_PERMALINK);
+                actions.add(WeblogTemplate.ACTION_SEARCH);
+                actions.add(WeblogTemplate.ACTION_WEBLOG);
+                actions.add(WeblogTemplate.ACTION_TAGSINDEX);
+                
+                UserManager mgr = RollerFactory.getRoller().getUserManager();
+                List<WeblogTemplate> templates = mgr.getPages(getActionWeblog());
+                for(WeblogTemplate tmpPage : templates) {
+                    if(!WeblogTemplate.ACTION_CUSTOM.equals(tmpPage.getAction())) {
+                        actions.remove(tmpPage.getAction());
+                    }
+                }
+            }
+            
+            setAvailableActions(actions);
+        } catch (RollerException ex) {
+            log.error("Error accessing templates for weblog -"+getActionWeblog().getHandle(), ex);
+        }
+
+        return SUCCESS;
+    }
+    
+    
+    /**
+     * Save a new template.
+     */
+    public String save() {
+        
+        WebsiteData weblog = getActionWeblog();
+        
+        // validation
+        myValidate();
+        
+        WeblogTemplate page = new WeblogTemplate();
+        page.setWebsite(weblog);
+        page.setAction(getNewTmplAction());
+        page.setName(getNewTmplName());
+        page.setDescription(page.getName());
+        page.setContents(getText("pageForm.newTemplateContent"));
+        page.setHidden(false);
+        page.setNavbar(false);
+        page.setLastModified( new Date() );
+        
+        // all templates start out as velocity templates
+        page.setTemplateLanguage("velocity");
+        
+        // for now, all templates just use _decorator
+        if(!"_decorator".equals(page.getName())) {
+            page.setDecoratorName("_decorator");
+        }
+        
+        try {
+            // save the page
+            UserManager mgr = RollerFactory.getRoller().getUserManager();
+            mgr.savePage( page );
+            
+            // if this person happened to create a Weblog template from
+            // scratch then make sure and set the defaultPageId
+            if(WeblogTemplate.DEFAULT_PAGE.equals(page.getName())) {
+                weblog.setDefaultPageId(page.getId());
+                mgr.saveWebsite(weblog);
+            }
+            
+            // flush results to db
+            RollerFactory.getRoller().flush();
+            
+            return "addSuccess-ajax";
+            
+        } catch (RollerException ex) {
+            log.error("Error adding new page for weblog - "+weblog.getHandle(), ex);
+            // TODO: i18n
+            addError("Error adding new page");
+        }
+        
+        return "addForm-ajax";
+    }
+    
+    
+    private void myValidate() {
+        
+        // make sure that we have an appropriate name value
+        
+        // make sure that we have an appropriate action value
+        
+        // first off, check if template already exists
+//        WeblogTemplate existingPage = mgr.getPageByName(website, getNewTmplName());
+//        if(existingPage != null) {
+//            addError("pagesForm.error.alreadyExists", getNewTmplName());
+//            return INPUT;
+//        }
+        
+    }
+    
+
+    public List getAvailableActions() {
+        return availableActions;
+    }
+
+    public void setAvailableActions(List availableActions) {
+        this.availableActions = availableActions;
+    }
+
+    public String getNewTmplName() {
+        return newTmplName;
+    }
+
+    public void setNewTmplName(String newTmplName) {
+        this.newTmplName = newTmplName;
+    }
+
+    public String getNewTmplAction() {
+        return newTmplAction;
+    }
+
+    public void setNewTmplAction(String newTmplAction) {
+        this.newTmplAction = newTmplAction;
+    }
+
+    public String getAddType() {
+        return addType;
+    }
+
+    public void setAddType(String addType) {
+        this.addType = addType;
+    }
+    
+}

Added: roller/trunk/src/org/apache/roller/ui/authoring/struts2/TemplateEdit.java
URL: http://svn.apache.org/viewvc/roller/trunk/src/org/apache/roller/ui/authoring/struts2/TemplateEdit.java?view=auto&rev=533435
==============================================================================
--- roller/trunk/src/org/apache/roller/ui/authoring/struts2/TemplateEdit.java (added)
+++ roller/trunk/src/org/apache/roller/ui/authoring/struts2/TemplateEdit.java Sat Apr 28 15:20:00 2007
@@ -0,0 +1,166 @@
+/*
+ * TemplateEdit.java
+ *
+ * Created on April 23, 2007, 2:54 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package org.apache.roller.ui.authoring.struts2;
+
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+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.PermissionsData;
+import org.apache.roller.pojos.UserData;
+import org.apache.roller.pojos.WeblogTemplate;
+import org.apache.roller.pojos.WebsiteData;
+import org.apache.roller.ui.core.util.menu.Menu;
+import org.apache.roller.ui.core.util.menu.MenuHelper;
+import org.apache.roller.ui.core.util.struts2.UIAction;
+import org.apache.roller.util.Utilities;
+import org.apache.roller.util.cache.CacheManager;
+
+
+/**
+ * Action which handles editing for a single WeblogTemplate.
+ */
+public class TemplateEdit extends UIAction {
+    
+    private static Log log = LogFactory.getLog(Templates.class);
+    
+    // form bean for collection all template properties
+    private TemplateEditBean bean = new TemplateEditBean();
+    
+    
+    public TemplateEdit() {
+        this.actionName = "template";
+        this.desiredMenu = "editor";
+        this.pageTitle = "pagesForm.title";
+    }
+    
+    
+    // must be a weblog admin to use this action
+    public short requiredWeblogPermissions() {
+        return PermissionsData.ADMIN;
+    }
+    
+    
+    public String execute() {
+        
+        try {
+            UserManager mgr = RollerFactory.getRoller().getUserManager();
+            WeblogTemplate page = mgr.getPage(getBean().getId());
+            if(page == null) {
+                throw new RollerException("page not found");
+            }
+            
+            getBean().copyFrom(page);
+            
+            // empty content-type indicates that page uses auto content-type detection
+            if (StringUtils.isEmpty(page.getOutputContentType())) {
+                getBean().setAutoContentType(Boolean.TRUE);
+            } else {
+                getBean().setAutoContentType(Boolean.FALSE);
+                getBean().setManualContentType(page.getOutputContentType());
+            }
+            
+        } catch (RollerException ex) {
+            log.error("Error loading page to edit - "+getBean().getId(), ex);
+            // TODO: i18n
+            addError("Couldn't find specified page to edit");
+            return "list";
+        }
+        
+        return SUCCESS;
+    }
+    
+    
+    public String save() {
+        
+        // validation
+        myValidate();
+        
+        if(!hasActionErrors()) try {
+            
+            UserManager mgr = RollerFactory.getRoller().getUserManager();
+            WeblogTemplate page = mgr.getPage(getBean().getId());
+            if(page == null) {
+                throw new RollerException("page not found");
+            }
+            
+            getBean().copyTo(page);
+            page.setLastModified( new Date() );
+            
+            if (getBean().getAutoContentType() == null ||
+                    !getBean().getAutoContentType().booleanValue()) {
+                page.setOutputContentType(getBean().getManualContentType());
+            } else {
+                // empty content-type indicates that page uses auto content-type detection
+                page.setOutputContentType(null);
+            }
+            
+            // save template and flush
+            mgr.savePage( page );
+            RollerFactory.getRoller().flush();
+            
+            CacheManager.invalidate(page);
+            
+            // success message
+            addMessage("pageForm.save.success", page.getName());
+            
+        } catch (RollerException ex) {
+            log.error("Error updating page - "+getBean().getId(), ex);
+            // TODO: i18n
+            addError("Error saving template");
+        }
+        
+        return SUCCESS;
+    }
+    
+    
+    public String cancel() {
+        return "cancel";
+    }
+    
+    
+    private void myValidate() {
+        
+        // make sure that we have an appropriate name value
+        
+        // make sure that we have an appropriate action value
+        
+        // first off, check if template already exists
+//        WeblogTemplate existingPage = mgr.getPageByName(website, getNewTmplName());
+//        if(existingPage != null) {
+//            addError("pagesForm.error.alreadyExists", getNewTmplName());
+//            return INPUT;
+//        }
+        
+    }
+    
+    
+    public List getTemplateLanguages() {
+        String langs = RollerConfig.getProperty("rendering.templateLanguages","velocity");
+        String[] langsArray = Utilities.stringToStringArray(langs, ",");
+        return Arrays.asList(langsArray);
+    }
+    
+    
+    public TemplateEditBean getBean() {
+        return bean;
+    }
+
+    public void setBean(TemplateEditBean bean) {
+        this.bean = bean;
+    }
+    
+}

Added: roller/trunk/src/org/apache/roller/ui/authoring/struts2/TemplateEditBean.java
URL: http://svn.apache.org/viewvc/roller/trunk/src/org/apache/roller/ui/authoring/struts2/TemplateEditBean.java?view=auto&rev=533435
==============================================================================
--- roller/trunk/src/org/apache/roller/ui/authoring/struts2/TemplateEditBean.java (added)
+++ roller/trunk/src/org/apache/roller/ui/authoring/struts2/TemplateEditBean.java Sat Apr 28 15:20:00 2007
@@ -0,0 +1,203 @@
+/*
+ * TemplateEditBean.java
+ *
+ * Created on April 23, 2007, 3:24 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package org.apache.roller.ui.authoring.struts2;
+
+import java.util.Locale;
+import org.apache.roller.RollerException;
+import org.apache.roller.pojos.WeblogTemplate;
+
+
+/**
+ * Form bean for TemplateEdit action.
+ */
+public class TemplateEditBean {
+    
+    private String id;
+    private String action;
+    private String name;
+    private String description;
+    private String link;
+    private String contents;
+    private java.util.Date lastModified;
+    private String templateLanguage;
+    private boolean navbar;
+    private boolean hidden;
+    private String decoratorName;
+    private String outputContentType;
+    private Boolean autoContentType = Boolean.TRUE;
+    private String manualContentType = null;
+    private boolean required = false;
+    
+    
+    public String getId() {
+        return this.id;
+    }
+    
+    public void setId( String id ) {
+        this.id = id;
+    }
+    
+    public String getAction() {
+        return this.action;
+    }
+    
+    public void setAction( String action ) {
+        this.action = action;
+    }
+    
+    public String getName() {
+        return this.name;
+    }
+    
+    public void setName( String name ) {
+        this.name = name;
+    }
+    
+    public String getDescription() {
+        return this.description;
+    }
+    
+    public void setDescription( String description ) {
+        this.description = description;
+    }
+    
+    public String getLink() {
+        return this.link;
+    }
+    
+    public void setLink( String link ) {
+        this.link = link;
+    }
+    
+    public String getContents() {
+        return this.contents;
+    }
+    
+    public void setContents( String contents ) {
+        this.contents = contents;
+    }
+    
+    public java.util.Date getLastModified() {
+        return this.lastModified;
+    }
+    
+    public void setLastModified( java.util.Date lastModified ) {
+        this.lastModified = lastModified;
+    }
+    
+    public String getTemplateLanguage() {
+        return this.templateLanguage;
+    }
+    
+    public void setTemplateLanguage( String templateLanguage ) {
+        this.templateLanguage = templateLanguage;
+    }
+    
+    public boolean isNavbar() {
+        return this.navbar;
+    }
+    
+    public void setNavbar( boolean navbar ) {
+        this.navbar = navbar;
+    }
+    
+    public boolean isHidden() {
+        return this.hidden;
+    }
+    
+    public void setHidden( boolean hidden ) {
+        this.hidden = hidden;
+    }
+    
+    public String getDecoratorName() {
+        return this.decoratorName;
+    }
+    
+    public void setDecoratorName( String decoratorName ) {
+        this.decoratorName = decoratorName;
+    }
+    
+    public String getOutputContentType() {
+        return this.outputContentType;
+    }
+    
+    public void setOutputContentType( String outputContentType ) {
+        this.outputContentType = outputContentType;
+    }
+    
+    public Boolean getAutoContentType() {
+        return autoContentType;
+    }
+    
+    public void setAutoContentType(Boolean autoContentType) {
+        this.autoContentType = autoContentType;
+    }
+    
+    public String getManualContentType() {
+        return manualContentType;
+    }
+    
+    public void setManualContentType(String manualContentType) {
+        this.manualContentType = manualContentType;
+    }
+    
+    public boolean isRequired() {
+        return required;
+    }
+
+    public void setRequired(boolean required) {
+        this.required = required;
+    }
+    
+    
+    /**
+     * Copy values from this form bean to the specified data object.
+     */
+    public void copyTo(WeblogTemplate dataHolder) {
+        
+        // only custom templates get to modify name, description, and link
+        if(WeblogTemplate.ACTION_CUSTOM.equals(dataHolder.getAction())) {
+            dataHolder.setName(this.name);
+            dataHolder.setDescription(this.description);
+            dataHolder.setLink(this.link);
+        }
+        
+        dataHolder.setContents(this.contents);
+        dataHolder.setLastModified(this.lastModified);
+        dataHolder.setTemplateLanguage(this.templateLanguage);
+        dataHolder.setNavbar(this.navbar);
+        dataHolder.setHidden(this.hidden);
+        dataHolder.setDecoratorName(this.decoratorName);
+        dataHolder.setOutputContentType(this.outputContentType);
+    }
+    
+    
+    /**
+     * Copy values from specified data object to this form bean.
+     * Includes all types.
+     */
+    public void copyFrom(WeblogTemplate dataHolder) {
+        
+        this.id = dataHolder.getId();
+        this.action = dataHolder.getAction();
+        this.name = dataHolder.getName();
+        this.description = dataHolder.getDescription();
+        this.link = dataHolder.getLink();
+        this.contents = dataHolder.getContents();
+        this.lastModified = dataHolder.getLastModified();
+        this.templateLanguage = dataHolder.getTemplateLanguage();
+        this.navbar = dataHolder.isNavbar();
+        this.hidden = dataHolder.isHidden();
+        this.decoratorName = dataHolder.getDecoratorName();
+        this.outputContentType = dataHolder.getOutputContentType();
+        this.required = dataHolder.isRequired();
+    }
+    
+}

Added: roller/trunk/src/org/apache/roller/ui/authoring/struts2/Templates.java
URL: http://svn.apache.org/viewvc/roller/trunk/src/org/apache/roller/ui/authoring/struts2/Templates.java?view=auto&rev=533435
==============================================================================
--- roller/trunk/src/org/apache/roller/ui/authoring/struts2/Templates.java (added)
+++ roller/trunk/src/org/apache/roller/ui/authoring/struts2/Templates.java Sat Apr 28 15:20:00 2007
@@ -0,0 +1,141 @@
+/*
+ * 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.authoring.struts2;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Date;
+import java.util.Iterator;
+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.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.WeblogTemplate;
+import org.apache.roller.pojos.WeblogTheme;
+import org.apache.roller.pojos.WebsiteData;
+import org.apache.roller.ui.core.util.menu.Menu;
+import org.apache.roller.ui.core.util.menu.MenuHelper;
+import org.apache.roller.ui.core.util.struts2.UIAction;
+import org.apache.roller.util.cache.CacheManager;
+
+
+/**
+ * Templates listing page.
+ */
+public class Templates extends UIAction {
+    
+    private static Log log = LogFactory.getLog(Templates.class);
+    
+    // list of templates to display
+    private List templates = Collections.EMPTY_LIST;
+    
+    // template id to remove
+    private String removeId = null;
+    
+    
+    public Templates() {
+        this.actionName = "templates";
+        this.desiredMenu = "editor";
+        this.pageTitle = "pagesForm.title";
+    }
+    
+    
+    // must be a weblog admin to use this action
+    public short requiredWeblogPermissions() {
+        return PermissionsData.ADMIN;
+    }
+    
+    
+    public String execute() {
+        return SUCCESS;
+    }
+    
+    
+    /**
+     * This action method is called by an ajax enabled 'div' tag on the page
+     * and is used to list the templates available for the given weblog.
+     */
+    public String list() {
+        
+        // query for templates list
+        try {
+            UserManager mgr = RollerFactory.getRoller().getUserManager();
+            setTemplates(mgr.getPages(getActionWeblog()));
+            
+        } catch (RollerException ex) {
+            log.error("Error getting pages for weblog - "+getActionWeblog().getHandle(), ex);
+            // TODO: i18n
+            addError("Error getting template list");
+        }
+        
+        return "list-ajax";
+    }
+    
+    
+    public String remove() {
+        
+        try {
+            UserManager mgr = RollerFactory.getRoller().getUserManager();
+            WeblogTemplate template = mgr.getPage(getRemoveId());
+            
+            if(!template.isRequired()) {
+                
+                // remove it and flush
+                mgr.removePage(template);
+                RollerFactory.getRoller().flush();
+                
+                // notify cache
+                CacheManager.invalidate(template);
+                
+                return execute();
+            } else {
+                // TODO: i18n
+                addError("Cannot remove required template");
+            }
+            
+        } catch (RollerException e) {
+            log.error("Error removing template", e);
+            addError("error.internationalized", e.getRootCauseMessage());
+        }
+        
+        return "remove-fail";
+    }
+    
+    
+    public List getTemplates() {
+        return templates;
+    }
+
+    public void setTemplates(List templates) {
+        this.templates = templates;
+    }
+
+    public String getRemoveId() {
+        return removeId;
+    }
+
+    public void setRemoveId(String removeId) {
+        this.removeId = removeId;
+    }
+    
+}

Added: roller/trunk/src/org/apache/roller/ui/authoring/struts2/ThemeEdit.java
URL: http://svn.apache.org/viewvc/roller/trunk/src/org/apache/roller/ui/authoring/struts2/ThemeEdit.java?view=auto&rev=533435
==============================================================================
--- roller/trunk/src/org/apache/roller/ui/authoring/struts2/ThemeEdit.java (added)
+++ roller/trunk/src/org/apache/roller/ui/authoring/struts2/ThemeEdit.java Sat Apr 28 15:20:00 2007
@@ -0,0 +1,243 @@
+/*
+ * 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.authoring.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.business.Roller;
+import org.apache.roller.business.RollerFactory;
+import org.apache.roller.business.UserManager;
+import org.apache.roller.business.themes.SharedTheme;
+import org.apache.roller.business.themes.ThemeManager;
+import org.apache.roller.business.themes.ThemeNotFoundException;
+import org.apache.roller.config.RollerRuntimeConfig;
+import org.apache.roller.pojos.PermissionsData;
+import org.apache.roller.pojos.Theme;
+import org.apache.roller.pojos.WeblogTheme;
+import org.apache.roller.pojos.WebsiteData;
+import org.apache.roller.ui.core.util.struts2.UIAction;
+import org.apache.roller.util.cache.CacheManager;
+import org.apache.struts.action.ActionMessage;
+
+
+/**
+ * Action for controlling theme selection.
+ */
+public class ThemeEdit extends UIAction {
+    
+    private static Log log = LogFactory.getLog(Templates.class);
+    
+    private static TmpCustomTheme customThemeOption = new TmpCustomTheme();
+    
+    // list of available themes
+    private List themes = Collections.EMPTY_LIST;
+    
+    // the chosen theme on a save() or customize()
+    private String themeId = null;
+    
+    
+    public ThemeEdit() {
+        this.actionName = "themeEdit";
+        this.desiredMenu = "editor";
+        this.pageTitle = "themeEditor.title";
+    }
+    
+    
+    // must be a weblog admin to use this action
+    public short requiredWeblogPermissions() {
+        return PermissionsData.ADMIN;
+    }
+    
+    
+    // prepare list of themes based on action weblog
+    public void myPrepare() {
+        
+        ThemeManager themeMgr = RollerFactory.getRoller().getThemeManager();
+        List themes = themeMgr.getEnabledThemesList();
+        
+        // should we also include the CUSTOM theme?
+        boolean allowCustomTheme = false;
+        if(getActionWeblog().getDefaultPageId() != null
+                && !getActionWeblog().getDefaultPageId().equals("dummy")
+                && !getActionWeblog().getDefaultPageId().trim().equals("")) {
+            allowCustomTheme = true;
+        }
+        
+        // if we allow custom themes then add it to the end of the list
+        if(allowCustomTheme &&
+                RollerRuntimeConfig.getBooleanProperty("themes.customtheme.allowed")) {
+            
+            themes.add(customThemeOption);
+        }
+        
+        setThemes(themes);
+    }
+    
+    
+    public String execute() {
+        try {
+            // set theme to current value
+            setThemeId(getActionWeblog().getTheme().getId());
+        } catch (RollerException ex) {
+            log.error("Error getting theme for weblog - "+getActionWeblog().getHandle(), ex);
+        }
+        
+        return SUCCESS;
+    }
+
+    
+    /**
+     * Update chosen theme.
+     */
+    public String save() {
+        
+        // validation
+        myValidate();
+        
+        // update theme for weblog and save
+        if(!hasActionErrors()) {
+            try {
+                WebsiteData weblog = getActionWeblog();
+                
+                weblog.setEditorTheme(getThemeId());
+                
+                UserManager userMgr = RollerFactory.getRoller().getUserManager();
+                userMgr.saveWebsite(weblog);
+                RollerFactory.getRoller().flush();
+                
+                log.debug("Saved theme "+getThemeId()+" for weblog "+weblog.getHandle());
+                
+                // make sure to flush the page cache so ppl can see the change
+                CacheManager.invalidate(weblog);
+                
+            } catch(RollerException re) {
+                log.error("Error saving weblog - "+getActionWeblog().getHandle(), re);
+                addError("Error setting theme");
+            }
+        }
+        
+        return SUCCESS;
+    }
+    
+    
+    /**
+     * Customize a theme by copying it's templates.
+     */
+    public String customize() {
+        
+        ThemeManager themeMgr = RollerFactory.getRoller().getThemeManager();
+        
+        // only if custom themes are allowed
+        if(RollerRuntimeConfig.getBooleanProperty("themes.customtheme.allowed")) {
+            try {
+                SharedTheme usersTheme = themeMgr.getTheme(getActionWeblog().getEditorTheme());
+                themeMgr.importTheme(getActionWeblog(), usersTheme);
+                RollerFactory.getRoller().flush();
+                
+                // make sure to flush the page cache so ppl can see the change
+                //PageCacheFilter.removeFromCache(request, weblog);
+                CacheManager.invalidate(getActionWeblog());
+                
+            } catch(ThemeNotFoundException tnfe) {
+                // this catches the potential case where someone customizes
+                // a theme and has their theme as "custom" but then hits the
+                // browser back button and presses the button again, so
+                // they are basically trying to customize a "custom" theme
+                
+                // log this as a warning just in case
+                log.warn(tnfe);
+                
+                // TODO: i18n
+                addError("Oops!  You already have a custom theme.");
+            } catch(RollerException re) {
+                log.error("Error customizing theme for weblog - "+getActionWeblog().getHandle(), re);
+                // TODO: i18n
+                addError("Error customizing theme");
+            }
+        } else {
+            // TODO: i18n
+            addError("Sorry, custom themes are not allowed");
+        }
+            
+        return SUCCESS;
+    }
+    
+    
+    // validation
+    private void myValidate() {
+        
+        String newTheme = getThemeId();
+        
+        // make sure theme is valid and enabled
+        if(newTheme == null) {
+            // TODO: i18n
+            addError("No theme specified");
+            
+        } else if(WeblogTheme.CUSTOM.equals(newTheme)) {
+            if(!RollerRuntimeConfig.getBooleanProperty("themes.customtheme.allowed")) {
+                // TODO: i18n
+                addError("Sorry, custom themes are not allowed");
+            }
+            
+        } else {
+            try {
+                Roller roller = RollerFactory.getRoller();
+                ThemeManager themeMgr = roller.getThemeManager();
+                Theme newThemeObj = themeMgr.getTheme(getThemeId());
+                
+                if(!newThemeObj.isEnabled()) {
+                    // TODO: i18n
+                    addError("Theme not enabled");
+                }
+                
+            } catch(Exception ex) {
+                log.warn(ex);
+                // TODO: i18n
+                addError("Theme not found");
+            }
+        }
+    }
+    
+    
+    public List getThemes() {
+        return themes;
+    }
+
+    public void setThemes(List themes) {
+        this.themes = themes;
+    }
+
+    public String getThemeId() {
+        return themeId;
+    }
+
+    public void setThemeId(String theme) {
+        this.themeId = theme;
+    }
+    
+    
+    static class TmpCustomTheme {
+        public String getId() { return WeblogTheme.CUSTOM; }
+        public String getName() { return WeblogTheme.CUSTOM; }
+    }
+    
+}

Added: roller/trunk/src/org/apache/roller/ui/authoring/struts2/editor-menu.xml
URL: http://svn.apache.org/viewvc/roller/trunk/src/org/apache/roller/ui/authoring/struts2/editor-menu.xml?view=auto&rev=533435
==============================================================================
--- roller/trunk/src/org/apache/roller/ui/authoring/struts2/editor-menu.xml (added)
+++ roller/trunk/src/org/apache/roller/ui/authoring/struts2/editor-menu.xml Sat Apr 28 15:20:00 2007
@@ -0,0 +1,110 @@
+<!-- 
+Defines the Roller Weblog Editor/Admin UI menu and roles allowed to use each 
+menu. See also, admin-menu.xml, which defines the Global Admin menu.
+Each menu or menu item is governed by four attrbibutes:
+
+    1) roles: these are the global roles the are allowed to view item
+       - admin:  the Roller site-wide admin role
+       - editor: the normal Roller user role
+       Default is roles="admin,editor"
+       Use "any" to indicate that role is not required to view ite
+       
+    2) perms: these are the website specific permissions required to view item
+       - editor:  author and allowed to manage current website
+       - author:  allowed to edit any part of the current website, except users
+       - limited: allowed only to post drafts in current website
+       Default is perms="admin,author"
+       Use "any" to indicate that website perms are not required to view item
+       
+    3) enable property: if true, show this menu
+
+    4) disable property: if true, don't show this menu
+-->
+<menu-bar>
+    
+    <menu name="tabbedmenu.weblog" perms="limited" roles="editor">
+        
+        <menu-item action="postEntry" 
+                   name="tabbedmenu.weblog.newEntry" 
+                   roles="editor"
+                   perms="limited" />
+        
+        <menu-item action="entries" 
+                   name="tabbedmenu.weblog.archives" 
+                   roles="editor"
+                   perms="limited" />
+        
+        <menu-item action="comments" 
+                   name="tabbedmenu.admin.commentManagement" 
+                   roles="editor"
+                   perms="admin" 
+                   subactions="commentQuery" />
+        
+        <menu-item action="categories"   
+                   name="tabbedmenu.weblog.categories" 
+                   roles="editor"
+                   perms="author"
+                   subactions="categoryEdit,categoryDelete" />
+        
+        <menu-item action="bookmarks"    
+                   name="tabbedmenu.bookmarks.allFolders" 
+                   roles="editor"
+                   perms="author"
+                   subactions="importBookmarks,bookmarkEdit,folderEdit" />
+        
+        <menu-item action="resources"  
+                   name="tabbedmenu.website.files" 
+                   roles="editor"
+                   perms="author"/>
+        
+        <menu-item action="referrers"     
+                   name="tabbedmenu.weblog.referers" 
+                   roles="editor"
+                   perms="author" 
+                   enabledProperty="referrers.processing.enabled" />
+    </menu>
+    
+    <menu name="tabbedmenu.website" perms="admin" roles="editor">
+        
+        <menu-item action="settings"       
+                   name="tabbedmenu.website.settings" 
+                   roles="editor"
+                   perms="admin" />
+        
+        <menu-item action="themeEdit"         
+                   name="tabbedmenu.website.themes" 
+                   roles="editor"
+                   perms="admin" />
+        
+        <menu-item action="templates"         
+                   name="tabbedmenu.website.pages" 
+                   roles="editor"
+                   perms="admin" 
+                   subactions="template" />
+        
+        <menu-item action="members" 
+                   name="tabbedmenu.website.members" 
+                   roles="editor"
+                   perms="admin" 
+                   subactions="inviteMember,invitations" 
+                   enabledProperty="groupblogging.enabled"/>
+        
+        <menu-item action="pingSetup"         
+                   name="tabbedmenu.weblog.pingSetup" 
+                   roles="editor"
+                   perms="admin" 
+                   disabledProperty="pings.disablePingUsage" />
+        
+        <menu-item action="pingTargets" 
+                   name="tabbedmenu.weblog.customPingTargets" 
+                   roles="editor"
+                   perms="admin" 
+                   disabledProperty="pings.disallowCustomTargets" />        
+        
+        <menu-item action="maintenance"      
+                   name="tabbedmenu.website.maintenance" 
+                   roles="editor"
+                   perms="admin" />
+    </menu>
+    
+</menu-bar>

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=533435&r1=533434&r2=533435
==============================================================================
--- roller/trunk/web/WEB-INF/classes/struts.xml (original)
+++ roller/trunk/web/WEB-INF/classes/struts.xml Sat Apr 28 15:20:00 2007
@@ -17,10 +17,14 @@
                          class="org.apache.roller.ui.core.util.struts2.UIActionInterceptor" />
             <interceptor name="UISecurityInterceptor" 
                          class="org.apache.roller.ui.core.util.struts2.UISecurityInterceptor" />
+            <interceptor name="UIActionPrepareInterceptor" 
+                         class="org.apache.roller.ui.core.util.struts2.UIActionPrepareInterceptor" />
+                         
             <interceptor-stack name="rollerStack">
                 <interceptor-ref name="defaultStack"/>
                 <interceptor-ref name="UIActionInterceptor"/>
                 <interceptor-ref name="UISecurityInterceptor"/>
+                <interceptor-ref name="UIActionPrepareInterceptor"/>
             </interceptor-stack>
         </interceptors>
         
@@ -83,19 +87,37 @@
     
     
     <!-- 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 name="globalConfig!*" method="{1}"
+                class="org.apache.roller.ui.admin.struts2.GlobalConfig">
+            <result name="success" type="tiles">.GlobalConfig</result>
         </action>
         
-        <action name="user!*" method="{1}"
-                class="org.apache.roller.ui.admin.struts2.UserAdminAction">
-            <result name="adminUser.page">.UserAdmin</result>
+        <action name="userAdmin"
+                class="org.apache.roller.ui.admin.struts2.UserAdmin">
+            <result name="success" type="tiles">.UserAdmin</result>
         </action>
         
+        <action name="createUser!*" method="{1}"
+                class="org.apache.roller.ui.admin.struts2.CreateUser">
+            <result name="input" type="tiles">.CreateUser</result>
+            <result name="cancel" type="redirect-action">userAdmin</result>
+        </action>
+        
+        <action name="modifyUser!*" method="{1}"
+                class="org.apache.roller.ui.admin.struts2.ModifyUser">
+            <result name="input" type="tiles">.ModifyUser</result>
+            <result name="cancel" type="redirect-action">userAdmin</result>
+        </action>
+        
+        <action name="cacheInfo!*" method="{1}"
+                class="org.apache.roller.ui.admin.struts2.CacheInfo">
+            <result name="success" type="tiles">.CacheInfo</result>
+        </action>
+        
+        
+        <!--
         <action name="commentManagement!*" method="{1}"
                 class="org.apache.roller.ui.authoring.struts2.CommentManagementAction">
             <result name="commentManagement.page">.CommentManagement</result>
@@ -115,11 +137,6 @@
             <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>
@@ -134,14 +151,91 @@
                 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="templates!*" method="{1}"
+                class="org.apache.roller.ui.authoring.struts2.Templates">
+            <result name="success" type="tiles">.Templates</result>
+            <result name="list-ajax">/WEB-INF/jsps/authoring/struts2/Templates-list-ajax.jsp</result>
+            <result name="remove-success" type="tiles">.Templates</result>
+            <result name="remove-fail" type="tiles">.Templates</result>
+        </action>
+        
+        <action name="templateAdd!*" method="{1}"
+                class="org.apache.roller.ui.authoring.struts2.TemplateAdd">
+            <result name="success">/WEB-INF/jsps/authoring/struts2/TemplateAdd-form-ajax.jsp</result>
+            <result name="addSuccess-ajax">/WEB-INF/jsps/authoring/struts2/TemplateAdd-success-ajax.jsp</result>
+        </action>
+        
+        <action name="template!*" method="{1}"
+                class="org.apache.roller.ui.authoring.struts2.TemplateEdit">
+            <result name="list" type="chain">templates</result>
+            <result name="success" type="tiles">.TemplateEditForm</result>
+            <result name="cancel" type="redirect-action">templates</result>
+        </action>
+        
+        
+        <action name="postEntry">
+            <result>/roller-ui/authoring/weblog.do?method=create</result>
+        </action>
+        
+        <action name="entries">
+            <result>/roller-ui/authoring/weblogEntryManagement.do?method=query</result>
+        </action>
+        
+        <action name="comments">
+            <result>/roller-ui/authoring/commentManagement.do?method=query</result>
+        </action>
+        
+        <action name="categories">
+            <result>/roller-ui/authoring/categories.do?method=selectCategory</result>
+        </action>
+        
+        <action name="bookmarks">
+            <result>/roller-ui/authoring/bookmarks.do?method=selectFolder</result>
+        </action>
+        
+        <action name="resources">
+            <result>/roller-ui/authoring/uploadFiles.do</result>
+        </action>
+        
+        <action name="referrers">
+            <result>/roller-ui/authoring/referers.do</result>
+        </action>
+        
+        
+        <action name="settings">
+            <result>/roller-ui/authoring/website.do?method=edit</result>
+        </action>
+        
+        <action name="themeEdit!*" method="{1}"
+                class="org.apache.roller.ui.authoring.struts2.ThemeEdit">
+            <result name="success" type="tiles">.ThemeEdit</result>
+        </action>
+        
+        <action name="members">
+            <result>/roller-ui/authoring/memberPermissions.do</result>
+        </action>
+        
+        <action name="pingSetup">
+            <result>/roller-ui/authoring/pingSetup.do</result>
+        </action>
+        
+        <action name="pingTargets">
+            <result>/roller-ui/authoring/customPingTargets.do</result>
+        </action>
+        
+        <action name="maintenance">
+            <result>/roller-ui/authoring/maintenance.do</result>
+        </action>
+        
+        
+        <!--
         <action name="pingSetup!*" method="{1}"
                 class="org.apache.roller.ui.authoring.struts2.PingSetupAction">
             <result name="pingSetup.page">.Pings</result>
@@ -153,10 +247,7 @@
             <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>
@@ -224,12 +315,6 @@
                 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">
@@ -267,8 +352,8 @@
                 class="org.apache.roller.ui.authoring.struts2.UploadFileFormAction">
             <result name="uploadFiles.page">.upload-file</result>
         </action>
+        -->
     </package>
-    -->
     
 </struts>
 

Added: roller/trunk/web/WEB-INF/jsps/admin/struts2/CacheInfo.jsp
URL: http://svn.apache.org/viewvc/roller/trunk/web/WEB-INF/jsps/admin/struts2/CacheInfo.jsp?view=auto&rev=533435
==============================================================================
--- roller/trunk/web/WEB-INF/jsps/admin/struts2/CacheInfo.jsp (added)
+++ roller/trunk/web/WEB-INF/jsps/admin/struts2/CacheInfo.jsp Sat Apr 28 15:20:00 2007
@@ -0,0 +1,50 @@
+<%--
+  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.
+--%>
+<%@ include file="/WEB-INF/jsps/taglibs-struts2.jsp" %>
+
+<p class="subtitle"><s:text name="cacheInfo.subtitle" />
+<p><s:text name="cacheInfo.prompt" />
+
+<s:iterator id="cache" value="stats">
+    <s:if test="#cache != null && !#cache.value.isEmpty">
+        <table cellspacing="3" border="1">
+            <tr>
+                <th colspan="2"><s:property value="#cache.key"/></th>
+            </tr>
+
+            <s:iterator id="prop" value="#cache.value">
+                <tr>
+                    <td><s:property value="#prop.key"/></td>
+                    <td><s:property value="#prop.value"/></td>
+                </tr>
+            </s:iterator>
+
+            <tr>
+                <td colspan="2">
+                    <s:form action="cacheInfo!clear">
+                        <s:hidden name="cache" value="%{#cache.key}" />
+                        <s:submit key="cacheInfo.clear" />
+                    </s:form>
+                </td>
+            </tr>
+            
+        </table>
+        
+        <br>
+    </s:if>
+</s:iterator>

Added: roller/trunk/web/WEB-INF/jsps/admin/struts2/CreateUser.jsp
URL: http://svn.apache.org/viewvc/roller/trunk/web/WEB-INF/jsps/admin/struts2/CreateUser.jsp?view=auto&rev=533435
==============================================================================
--- roller/trunk/web/WEB-INF/jsps/admin/struts2/CreateUser.jsp (added)
+++ roller/trunk/web/WEB-INF/jsps/admin/struts2/CreateUser.jsp Sat Apr 28 15:20:00 2007
@@ -0,0 +1,91 @@
+<%--
+  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.
+--%>
+<%@ include file="/WEB-INF/jsps/taglibs-struts2.jsp" %>
+
+<p class="subtitle"><s:text name="userAdmin.subtitle.createNewUser" /></p>
+
+<s:form action="createUser!save">
+    
+    <table class="formtable">
+        <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="userAdmin.tip.fullName" /></td>
+        </tr>
+        
+        <tr>
+            <td class="label"><label for="userName" /><s:text name="userSettings.username" /></label></td>
+            <td class="field"><s:textfield name="bean.userName" size="30" maxlength="30" /></td>
+            <td class="description"><s:text name="userAdmin.tip.userName" /></td>
+        </tr>
+        
+        <tr>
+            <td class="label"><label for="passwordText" /><s:text name="userSettings.password" /></label></td>
+            <td class="field"><s:password name="bean.password" size="20" maxlength="20" /></td>
+            <td class="description"><s:text name="userAdmin.tip.password" /></td>
+        </tr>
+        
+        <tr>
+            <td class="label"><label for="emailAddress" /><s:text name="userSettings.email" /></label></td>
+            <td class="field"><s:textfield name="bean.emailAddress" size="40" maxlength="40" /></td>
+            <td class="description"><s:text name="userAdmin.tip.email" /></td>
+        </tr>
+        
+        <tr>
+            <td class="label"><label for="locale" /><s:text name="userSettings.locale" /></label></td>
+            <td class="field">
+                <s:select name="bean.locale" size="1" list="localesList" listValue="displayName" />
+            </td>
+            <td class="description"><s:text name="userAdmin.tip.locale" /></td>
+        </tr>
+        
+        <tr>
+            <td class="label"><label for="timeZone" /><s:text name="userSettings.timeZone" /></label></td>
+            <td class="field">
+                <s:select name="bean.timeZone" size="1" list="timeZonesList" />
+            </td>
+            <td class="description"><s:text name="userAdmin.tip.timeZone" /></td>
+        </tr>
+        
+        <tr>
+            <td class="label"><label for="userEnabled" /><s:text name="userAdmin.enabled" /></label></td>
+            <td class="field">
+                <s:checkbox name="bean.enabled" />
+            </td>
+            <td class="description"><s:text name="userAdmin.tip.enabled" /></td>
+        </tr>
+        
+        <tr>
+            <td class="label"><label for="userAdmin" /><s:text name="userAdmin.userAdmin" /></label></td>
+            <td class="field">
+                <s:checkbox name="bean.administrator" />
+            </td>
+            <td class="description"><s:text name="userAdmin.tip.userAdmin" /></td>
+        </tr>
+        
+    </table>
+    
+    <br />
+    <br />
+    
+    <div class="control">
+        <s:submit key="userAdmin.save" />
+        <s:submit key="application.cancel" action="createUser!cancel" />
+    </div>
+    
+</s:form>



Mime
View raw message