You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@roller.apache.org by ag...@apache.org on 2008/06/28 21:18:57 UTC

svn commit: r672574 [8/16] - in /roller/planet/core/trunk: ./ lib/ lib/buildtime/ lib/jakarta-taglibs-standard-1.1.2/ lib/jakarta-taglibs-standard-1.1.2/lib/ lib/jakarta-taglibs-standard-1.1.2/tld/ lib/openjpa-0.9.7/ lib/rome-0.9/ lib/spring-1.2/ lib/s...

Added: roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/core/Profile.java
URL: http://svn.apache.org/viewvc/roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/core/Profile.java?rev=672574&view=auto
==============================================================================
--- roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/core/Profile.java (added)
+++ roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/core/Profile.java Sat Jun 28 12:18:17 2008
@@ -0,0 +1,138 @@
+/*
+ * 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.planet.ui.struts2.core;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.roller.planet.PlanetException;
+import org.apache.roller.planet.business.AggregatorFactory;
+import org.apache.roller.planet.business.UserManager;
+import org.apache.roller.planet.pojos.User;
+import org.apache.roller.planet.ui.struts2.util.UIAction;
+import org.apache.struts2.interceptor.validation.SkipValidation;
+
+
+/**
+ * Allows user to edit his/her profile.
+ */
+public class Profile extends UIAction {
+    
+    private static Log log = LogFactory.getLog(Profile.class);
+    
+    private ProfileBean bean = new ProfileBean();
+    
+    
+    public Profile() {
+        this.pageTitle = "Profile.title";
+    }
+    
+    
+    @Override
+    public boolean isEnabled() {
+        return ( ! AggregatorFactory.getAggregator().getConfig().getBooleanProperty("userManagement.external.enabled") );
+    }
+    
+    // override default security, we do not require an action weblog
+    @Override
+    public boolean isPlanetRequired() {
+        return false;
+    }
+    
+    
+    @SkipValidation
+    @Override
+    public String execute() {
+        
+        User ud = getAuthenticatedUser();
+        
+        // load up the form from the users existing profile data
+        getBean().copyFrom(ud);
+        getBean().setPasswordText(null);
+        getBean().setPasswordConfirm(null);
+
+        return INPUT;
+    }
+    
+    
+    public String save() {
+        
+        myValidate();
+        
+        if (!hasActionErrors()) {
+            // We ONLY modify the user currently logged in
+            User existingUser = getAuthenticatedUser();
+            
+            // We want to be VERY selective about what data gets updated
+            existingUser.setFullName(getBean().getFullName());
+            existingUser.setEmailAddress(getBean().getEmailAddress());
+            
+            // If user set both password and passwordConfirm then reset password
+            if (!StringUtils.isEmpty(getBean().getPasswordText()) && 
+                    !StringUtils.isEmpty(getBean().getPasswordConfirm())) {
+                try {
+                    existingUser.resetPassword(getBean().getPasswordText());
+                } catch (Throwable e) {
+                    addMessage("yourProfile.passwordResetError");
+                }
+            }
+            
+            try {
+                // save the updated profile
+                UserManager mgr = AggregatorFactory.getAggregator().getUserManager();
+                mgr.saveUser(existingUser);
+                AggregatorFactory.getAggregator().flush();
+                
+                // TODO: i18n
+                addMessage("profile updated.");
+                
+                return SUCCESS;
+                
+            } catch (PlanetException ex) {
+                log.error("ERROR in action", ex);
+                // TODO: i18n
+                addError("unexpected error doing profile save");
+            }
+            
+        }
+        
+        return INPUT;
+    }
+    
+    
+    public void myValidate() {
+        
+        // check that passwords match if they were specified
+        if(!StringUtils.isEmpty(getBean().getPasswordText())) {
+            if(!getBean().getPasswordText().equals(getBean().getPasswordConfirm())) {
+                addError("Register.error.passowordMismatch");
+            }
+        }
+    }
+    
+    
+    public ProfileBean getBean() {
+        return bean;
+    }
+
+    public void setBean(ProfileBean bean) {
+        this.bean = bean;
+    }
+    
+}

Added: roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/core/ProfileBean.java
URL: http://svn.apache.org/viewvc/roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/core/ProfileBean.java?rev=672574&view=auto
==============================================================================
--- roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/core/ProfileBean.java (added)
+++ roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/core/ProfileBean.java Sat Jun 28 12:18:17 2008
@@ -0,0 +1,112 @@
+/*
+ * 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.planet.ui.struts2.core;
+
+import org.apache.roller.planet.pojos.User;
+
+
+/**
+ * A simple bean for managing the form data used by the RegisterForm.
+ */
+public class ProfileBean {
+    
+    private String id = null;
+    private String userName = null;
+    private String password = null;
+    private String fullName = null;
+    private String emailAddress = null;
+    
+    private String passwordText = null;
+    private String passwordConfirm = null;
+    
+    
+    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 getPasswordText() {
+        return passwordText;
+    }
+
+    public void setPasswordText(String passwordText) {
+        this.passwordText = passwordText;
+    }
+
+    public String getPasswordConfirm() {
+        return passwordConfirm;
+    }
+
+    public void setPasswordConfirm(String passwordConfirm) {
+        this.passwordConfirm = passwordConfirm;
+    }
+    
+    
+    public void copyTo(User dataHolder) {
+        
+        dataHolder.setFullName(this.fullName);
+        dataHolder.setEmailAddress(this.emailAddress);
+    }
+    
+    
+    public void copyFrom(User dataHolder) {
+        
+        this.id = dataHolder.getId();
+        this.userName = dataHolder.getUserName();
+        this.password = dataHolder.getPassword();
+        this.fullName = dataHolder.getFullName();
+        this.emailAddress = dataHolder.getEmailAddress();
+    }
+    
+}

Added: roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/core/Register-validation.xml
URL: http://svn.apache.org/viewvc/roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/core/Register-validation.xml?rev=672574&view=auto
==============================================================================
--- roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/core/Register-validation.xml (added)
+++ roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/core/Register-validation.xml Sat Jun 28 12:18:17 2008
@@ -0,0 +1,65 @@
+<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN"
+       "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
+<validators>
+    
+    <field name="bean.userName">
+        <field-validator type="requiredstring">
+            <message key="Register.error.nameNull">unspecified key</message>
+        </field-validator>
+        
+        <field-validator type="stringlength">
+            <param name="maxLength">255</param>
+            <message key="Register.error.nameSize">unspecified key</message>
+        </field-validator>
+    </field>
+    
+    <field name="bean.passwordText">
+        <field-validator type="requiredstring">
+            <message key="Register.error.passwordNull">unspecified key</message>
+        </field-validator>
+        
+        <field-validator type="stringlength">
+            <param name="maxLength">255</param>
+            <message key="Register.error.passwordSize">unspecified key</message>
+        </field-validator>
+    </field>
+    
+    <field name="bean.passwordConfirm">
+        <field-validator type="requiredstring">
+            <message key="Register.error.passwordConfirmNull">unspecified key</message>
+        </field-validator>
+        
+        <field-validator type="stringlength">
+            <param name="maxLength">255</param>
+            <message key="Register.error.passwordConfirmSize">unspecified key</message>
+        </field-validator>
+    </field>
+    
+    
+    <field name="bean.fullName">
+        <field-validator type="requiredstring">
+            <message key="Register.error.fullNameNull">unspecified key</message>
+        </field-validator>
+        
+        <field-validator type="stringlength">
+            <param name="maxLength">255</param>
+            <message key="Register.error.fullNameSize">unspecified key</message>
+        </field-validator>
+    </field>
+    
+    <field name="bean.emailAddress">
+        <field-validator type="requiredstring">
+            <message key="Register.error.emailAddressNull">unspecified key</message>
+        </field-validator>
+        
+        <field-validator type="stringlength">
+            <param name="maxLength">255</param>
+            <message key="Register.error.emailAddressSize">unspecified key</message>
+        </field-validator>
+        
+        <field-validator type="email">
+            <message key="Register.error.emailAddressBad">unspecified key</message>
+        </field-validator>
+    </field>
+    
+</validators>

Added: roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/core/Register.java
URL: http://svn.apache.org/viewvc/roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/core/Register.java?rev=672574&view=auto
==============================================================================
--- roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/core/Register.java (added)
+++ roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/core/Register.java Sat Jun 28 12:18:17 2008
@@ -0,0 +1,157 @@
+/*
+ * 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.planet.ui.struts2.core;
+
+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.planet.PlanetException;
+import org.apache.roller.planet.business.AggregatorFactory;
+import org.apache.roller.planet.business.UserManager;
+import org.apache.roller.planet.pojos.User;
+import org.apache.roller.planet.ui.struts2.util.UIAction;
+import org.apache.struts2.interceptor.validation.SkipValidation;
+
+
+/**
+ * Actions for registering a new user.
+ */
+public class Register extends UIAction {
+    
+    private static Log log = LogFactory.getLog(Register.class);
+    
+    public static String DEFAULT_ALLOWED_CHARS = "A-Za-z0-9";
+    
+    private ProfileBean bean = new ProfileBean();
+    
+    
+    public Register() {
+        this.pageTitle = "Register.title";
+    }
+    
+    
+    @Override
+    public boolean isEnabled() {
+        // TODO: check for external user/auth management
+        return AggregatorFactory.getAggregator().getConfig().getBooleanProperty("users.registration.enabled");
+    }
+    
+    // override default security, we do not require an authenticated user
+    @Override
+    public boolean isUserRequired() {
+        return false;
+    }
+    
+    // override default security, we do not require an action weblog
+    @Override
+    public boolean isPlanetRequired() {
+        return false;
+    }
+    
+    
+    @SkipValidation
+    @Override
+    public String execute() {
+        return INPUT;
+    }
+    
+    
+    public String save() {
+        
+        myValidate();
+        
+        if (!hasActionErrors()) try {
+            
+            UserManager mgr = AggregatorFactory.getAggregator().getUserManager();
+            
+            // copy form data into new user pojo
+            User ud = new User();
+            getBean().copyTo(ud); // doesn't copy password
+            ud.setUserName(getBean().getUserName());
+            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(getBean().getPasswordText());
+            }
+            
+            // save new user
+            mgr.addUser(ud);
+            AggregatorFactory.getAggregator().flush();
+            
+            // set a special page title
+            this.pageTitle = "welcome.title";
+            
+            return SUCCESS;
+            
+        } catch (PlanetException ex) {
+            log.error("Error adding new user", ex);
+            // TODO: i18n
+            addError("Error adding new user");
+        }
+        
+        return INPUT;
+    }
+    
+    
+    public void myValidate() {
+        
+        String allowed = getPlanetConfig().getProperty("username.allowedChars");
+        if(allowed == null || allowed.trim().length() == 0) {
+            allowed = DEFAULT_ALLOWED_CHARS;
+        }
+        
+        // check that username only contains safe characters
+        String safe = CharSetUtils.keep(getBean().getUserName(), allowed);
+        if (!safe.equals(getBean().getUserName()) ) {
+            addError("error.add.user.badUserName");
+        }
+        
+        // check that passwords match
+        if(!getBean().getPasswordText().equals(getBean().getPasswordConfirm())) {
+            addError("Register.error.passowordMismatch");
+        }
+        
+        // check that username is not taken
+        if(!StringUtils.isEmpty(getBean().getUserName())) try {
+            UserManager mgr = AggregatorFactory.getAggregator().getUserManager();
+            if(mgr.getUserByUserName(getBean().getUserName(), null) != null) {
+                addError("error.add.user.userNameInUse");
+                // reset user name
+                getBean().setUserName(null);
+            }
+        } catch (PlanetException ex) {
+            log.error("error checking for user", ex);
+            // TODO: i18n
+            addError("unexpected error");
+        }
+    }
+    
+    public ProfileBean getBean() {
+        return bean;
+    }
+
+    public void setBean(ProfileBean bean) {
+        this.bean = bean;
+    }
+    
+}

Added: roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/core/Setup.java
URL: http://svn.apache.org/viewvc/roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/core/Setup.java?rev=672574&view=auto
==============================================================================
--- roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/core/Setup.java (added)
+++ roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/core/Setup.java Sat Jun 28 12:18:17 2008
@@ -0,0 +1,84 @@
+/*
+ * 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.planet.ui.struts2.core;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.roller.planet.ui.struts2.util.UIAction;
+
+
+/**
+ * Page used to display Planet install instructions.
+ */
+public class Setup extends UIAction {
+    
+    private static final Log log = LogFactory.getLog(Setup.class);
+    
+    private long userCount = 0;
+    private long blogCount = 0;
+    
+    
+    public Setup() {
+        // TODO: i18n
+        this.pageTitle = "index.heading";
+    }
+    
+    
+    @Override
+    public boolean isEnabled() {
+        // TODO: check if auto-setup is enabled
+        // This feature isn't available in planets right now.
+        return false;
+    }
+    
+    @Override
+    public boolean isUserRequired() {
+        return false;
+    }
+    
+    @Override
+    public boolean isPlanetRequired() {
+        return false;
+    }
+    
+    
+    @Override
+    public String execute() {
+        
+        return SUCCESS;
+    }
+
+    
+    public long getUserCount() {
+        return userCount;
+    }
+
+    public void setUserCount(long userCount) {
+        this.userCount = userCount;
+    }
+
+    public long getBlogCount() {
+        return blogCount;
+    }
+
+    public void setBlogCount(long blogCount) {
+        this.blogCount = blogCount;
+    }
+    
+}

Added: roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/core/package.properties
URL: http://svn.apache.org/viewvc/roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/core/package.properties?rev=672574&view=auto
==============================================================================
--- roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/core/package.properties (added)
+++ roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/core/package.properties Sat Jun 28 12:18:17 2008
@@ -0,0 +1,163 @@
+
+# Login
+
+Login.title=Login
+
+Login.prompt=Please enter your username and password to login.
+
+Login.userName=Username
+Login.password=Password
+Login.rememberMe=Remember Me
+Login.login=Login
+Login.reset=Reset
+
+
+# Register
+
+Register.title=Register Account
+
+Register.disabled=The administrator of this site has disabled user registrations \
+at this time.  Please contact the system administrators if you think this is \
+incorrect.
+
+Register.prompt=Use this form to register a new account, please \
+create only one user account per person.
+
+Register.userName=Username
+Register.password=Password
+Register.passwordConfirm=Password (Confirm)
+Register.fullName=Full Name
+Register.emailAddress=Email
+
+Register.tip.userName=A short one-word username for your user account. \
+Please limit it to simple ASCII alphanumeric characters (a-z, A-Z and 0-9), \
+and do not use HTML.
+Register.tip.password=Your password.
+Register.tip.passwordConfirm=Confirm your password.
+Register.tip.fullName=Your full name (with no HTML).
+Register.tip.email=Please enter valid email address, the site administrator \
+may disable your account if he/she cannot reach you via email.
+Register.button.save=Register User
+Register.button.cancel=Cancel
+
+Register.error.nameNull=User Name is a required field
+Register.error.nameSize=User Name cannot be more than 255 characters
+Register.error.passwordNull=Password is a required field
+Register.error.passwordSize=Password cannot be more than 255 characters
+Register.error.passwordConfirmNull=Password confirm is a required field
+Register.error.passwordConfirmSize=Password confirm cannot be more than 255 characters
+Register.error.fullNameNull=Full name is a required field
+Register.error.fullNameSize=Full name cannot be more than 255 characters
+Register.error.emailAddressNull=Email address is a required field
+Register.error.emailAddressSize=Email address cannot be more than 255 characters
+Register.error.emailAddressBad=The email address you entered is not properly formatted
+
+
+# Profile
+
+Profile.title=Update Profile
+Profile.prompt=Use this form to update your account information
+
+Profile.tip.userName=You can''t change your username.
+Profile.button.save=Save
+
+Profile.saved=Changes to your profile have been saved.
+Profile.unsaved=Unsaved changes, must press Save button to persist.
+
+
+# MainMenu
+
+MainMenu.title=Main Menu
+
+MainMenu.prompt.noPlanets=You''ve got a user account, but no planet. \
+Would you like to
+MainMenu.createOne=create one?
+
+MainMenu.prompt.hasPlanet=Select an existing planet to work on, or 
+MainMenu.createAdditionalOne=create a new planet.
+
+MainMenu.invited=You''ve been invited to join the planet
+MainMenu.accept=accept
+MainMenu.decline=decline
+
+MainMenu.tableTitle=Title
+MainMenu.tableDescription=Description
+MainMenu.select=Select
+
+MainMenu.permission=Permission
+MainMenu.confirmResignation=Are you sure you wish to resign from planet
+MainMenu.notAllowed=Not allowed
+MainMenu.planet=Link
+MainMenu.description=Description
+
+MainMenu.config=Configuration
+MainMenu.subscriptions=Subscriptions
+MainMenu.members=Members
+MainMenu.resign=Resign
+MainMenu.remove=Remove
+
+
+MainMenu.invitations=Weblog Invitations
+MainMenu.invitationsPrompt=You have one or more invitations to accept or \
+decline:
+MainMenu.youAreInvited=You are invited to join planet [{0}] - 
+
+MainMenu.selected=You are now working in planet [{0}]
+MainMenu.declined=You have declined an invitation to join planet [{0}]
+MainMenu.accepted=You are now a member of planet [{0}]
+MainMenu.resigned=You have resigned from planet [{0}]
+MainMenu.permNotFound=Sorry, that invitation was just revoked.
+
+MainMenu.message.acceptSucceeded=Welcome! You are now a member of the <b>{0}</b> planet.
+MainMenu.message.declineSucceeded=Okay. You have declined your invitation to the <b>{0}</b> planet.
+MainMenu.message.resignSucceded=Bye! You are no longer a member of the <b>{0}</b> planet.
+MainMenu.error.acceptFailed=Oops!  Something unexpected happened and your invitation \
+could not be accepted.  Give it another try and if you get the same error \
+then you may have found a bug, please report it to the site administrator.
+MainMenu.error.declineFailed=Oops!  Something unexpected happened and your invitation \
+could not be declined.  Give it another try and if you get the same error \
+then you may have found a bug, please report it to the site administrator.
+MainMenu.error.resignFailed=Oops!  Something unexpected happened and we could not \
+resign your membership.  Give it another try and if you get the same error \
+then you may have found a bug, please report it to the site administrator.
+
+
+# CreatePlanet
+
+CreatePlanet.pageTitle=Create Planet
+
+CreatePlanet.prompt=Use this form to create a new planet.  Each planet you create \
+has the ability to contain any number of subscription groups.
+
+CreatePlanet.tip.handle=The handle is a short one-word name for your \
+planet. It will be used in your URL, so please limit it to simple ASCII \
+alphanumeric characters (a-z, A-Z and 0-9), and do not use HTML.
+CreatePlanet.tip.title=This is the title of your planet, it will be \
+displayed at the top of your planet page, and in the title field of your \
+planet''s newsfeed. This field should not include HTML.
+CreatePlanet.tip.description=The description of your planet may be displayed \
+at the top of your planet, and it will be used in description or subtitle field \
+of your newsfeed. This field should not include HTML.
+
+CreatePlanet.planetUrl=URL
+CreatePlanet.handle=Handle
+CreatePlanet.title=Title
+CreatePlanet.description=Description
+CreatePlanet.button.save=Create Planet
+CreatePlanet.button.cancel=Cancel
+
+CreatePlanet.created=New planet <b>{0}</b> has been successfully created.
+
+# errors from validation
+CreatePlanet.error.handleNull=Handle is a required field
+CreatePlanet.error.handleSize=Handle cannot be more than 255 characters
+CreatePlanet.error.titleNull=Title is a required field
+CreatePlanet.error.titleSize=Title cannot be more than 255 characters
+CreatePlanet.error.descriptionSize=Description cannot be more than 255 characters
+
+CreatePlanet.error.invalidHandle=The handle you specified uses invalid characters. \
+You may only use the characters {0} to create handles.
+CreatePlanet.error.handleExists=Sorry, a planet with that handle already exists.
+CreatePlanet.error.unexpected=Oops!  Something unexpected happened and we weren't \
+able to create your planet.  Give it another try and if you get the same error \
+then you may have found a bug, please report it to the site administrator.

Added: roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/GroupAdd-validation.xml
URL: http://svn.apache.org/viewvc/roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/GroupAdd-validation.xml?rev=672574&view=auto
==============================================================================
--- roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/GroupAdd-validation.xml (added)
+++ roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/GroupAdd-validation.xml Sat Jun 28 12:18:17 2008
@@ -0,0 +1,54 @@
+<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN"
+       "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
+<validators>
+    
+    <field name="bean.handle">
+        <field-validator type="requiredstring">
+            <message key="GroupAdd.error.handleNull">unspecified key</message>
+        </field-validator>
+        
+        <field-validator type="stringlength">
+            <param name="maxLength">255</param>
+            <message key="GroupAdd.error.handleSize">unspecified key</message>
+        </field-validator>
+    </field>
+    
+    <field name="bean.title">
+        <field-validator type="requiredstring">
+            <message key="GroupAdd.error.titleNull">unspecified key</message>
+        </field-validator>
+        
+        <field-validator type="stringlength">
+            <param name="maxLength">255</param>
+            <message key="GroupAdd.error.titleSize">unspecified key</message>
+        </field-validator>
+    </field>
+    
+    <field name="bean.description">
+        <field-validator type="stringlength">
+            <param name="maxLength">255</param>
+            <message key="GroupAdd.error.descriptionSize">unspecified key</message>
+        </field-validator>
+    </field>
+    
+    <field name="bean.pageEntries">
+        <field-validator type="required">
+            <message key="GroupAdd.error.maxPageEntriesNull">unspecified key</message>
+        </field-validator>
+        
+        <field-validator type="int">
+            <message key="GroupAdd.error.maxPageEntriesInt">unspecified key</message>
+        </field-validator>
+    </field>
+    
+    <field name="bean.feedEntries">
+        <field-validator type="required">
+            <message key="GroupAdd.error.maxFeedEntriesNull">unspecified key</message>
+        </field-validator>
+        
+        <field-validator type="int">
+            <message key="GroupAdd.error.maxFeedEntriesInt">unspecified key</message>
+        </field-validator>
+    </field>
+    
+</validators>

Added: roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/GroupAdd.java
URL: http://svn.apache.org/viewvc/roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/GroupAdd.java?rev=672574&view=auto
==============================================================================
--- roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/GroupAdd.java (added)
+++ roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/GroupAdd.java Sat Jun 28 12:18:17 2008
@@ -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.planet.ui.struts2.editor;
+
+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.planet.PlanetException;
+import org.apache.roller.planet.business.AggregatorFactory;
+import org.apache.roller.planet.business.PlanetManager;
+import org.apache.roller.planet.pojos.Planet;
+import org.apache.roller.planet.pojos.PlanetGroup;
+import org.apache.roller.planet.ui.struts2.core.Register;
+import org.apache.roller.planet.ui.struts2.util.UIAction;
+import org.apache.struts2.interceptor.validation.SkipValidation;
+
+
+/**
+ * Add a group to a planet.
+ */
+public class GroupAdd extends UIAction {
+    
+    private static Log log = LogFactory.getLog(GroupAdd.class);
+    
+    private GroupBean bean = new GroupBean();
+    
+    
+    public GroupAdd() {
+        this.pageTitle = "GroupAdd.title";
+    }
+    
+    
+    @SkipValidation
+    @Override
+    public String execute() {
+        
+        // set a couple defaults
+        getBean().setPageEntries(30);
+        getBean().setFeedEntries(30);
+        
+        return INPUT;
+    }
+    
+    
+    /**
+     * Add new group to planet. 
+     */
+    public String save() {
+        
+        // validation
+        myValidate();
+        
+        if(!hasActionErrors()) try {
+            PlanetManager pmgr = AggregatorFactory.getAggregator().getPlanetManager();
+            
+            Planet planet = getActionPlanet();
+            PlanetGroup newGroup = new PlanetGroup();
+            newGroup.setPlanet(planet);
+            
+            // copy attributes
+            getBean().copyTo(newGroup);
+            
+            // copy handle manually
+            newGroup.setHandle(getBean().getHandle());
+            
+            // save and flush
+            pmgr.saveGroup(newGroup);
+            AggregatorFactory.getAggregator().flush();
+            
+            // set our new group as our action group now
+            setActionGroup(newGroup);
+            
+            addMessage("GroupAdd.message.saveSucceeded", newGroup.getTitle());
+            
+            return SUCCESS;
+            
+        } catch (PlanetException ex) {
+            log.error("Error saving planet group", ex);
+            addError("GroupAdd.error.unexpected");
+        }
+        
+        return INPUT;
+    }
+    
+    
+    // TODO: Validation - make sure that html is not allowed in handle or title
+    // TODO: Validation - make sure maxXXXEntries have a proper value range
+    private void myValidate() {
+        
+        String allowed = getPlanetConfig().getProperty("username.allowedChars");
+        if(allowed == null || allowed.trim().length() == 0) {
+            allowed = Register.DEFAULT_ALLOWED_CHARS;
+        }
+        
+        // make sure handle only contains safe characters
+        String safe = CharSetUtils.keep(getBean().getHandle(), allowed);
+        if (!safe.equals(getBean().getHandle()) ) {
+            addError("GroupAdd.error.invalidHandle", Register.DEFAULT_ALLOWED_CHARS);
+        }
+        
+        // make sure handle isn't already taken
+        if(!StringUtils.isEmpty(getBean().getHandle())) try {
+            PlanetManager mgr = AggregatorFactory.getAggregator().getPlanetManager();
+            if (mgr.getGroup(getActionPlanet(), getBean().getHandle()) != null) {
+                addError("GroupAdd.error.handleExists");
+                // reset handle
+                getBean().setHandle(null);
+            }
+        } catch (PlanetException ex) {
+            log.error("error checking for group", ex);
+            addError("GroupAdd.error.unexpected");
+        }
+    }
+    
+    
+    public GroupBean getBean() {
+        return bean;
+    }
+
+    public void setBean(GroupBean bean) {
+        this.bean = bean;
+    }
+    
+}

Added: roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/GroupBean.java
URL: http://svn.apache.org/viewvc/roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/GroupBean.java?rev=672574&view=auto
==============================================================================
--- roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/GroupBean.java (added)
+++ roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/GroupBean.java Sat Jun 28 12:18:17 2008
@@ -0,0 +1,84 @@
+/*
+ * GroupBean.java
+ * 
+ * Created on Aug 2, 2007, 2:48:22 PM
+ * 
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package org.apache.roller.planet.ui.struts2.editor;
+
+import org.apache.roller.planet.pojos.PlanetGroup;
+
+/**
+ * A bean to manage properties of a Group.
+ */
+public class GroupBean {
+
+    private String handle;
+    private String title;
+    private String description;
+    private int pageEntries;
+    private int feedEntries;
+    
+    
+    public String getHandle() {
+        return handle;
+    }
+    
+    public void setHandle(String handle) {
+        this.handle = handle;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+    
+    public String getDescription() {
+        return description;
+    }
+    
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    public int getFeedEntries() {
+        return feedEntries;
+    }
+
+    public void setFeedEntries(int feedEntries) {
+        this.feedEntries = feedEntries;
+    }
+
+    public int getPageEntries() {
+        return pageEntries;
+    }
+
+    public void setPageEntries(int pageEntries) {
+        this.pageEntries = pageEntries;
+    }
+    
+    
+    public void copyFrom(PlanetGroup dataHolder) {
+        setHandle(dataHolder.getHandle());
+        setTitle(dataHolder.getTitle());
+        setDescription(dataHolder.getDescription());
+        setPageEntries(dataHolder.getMaxPageEntries());
+        setFeedEntries(dataHolder.getMaxPageEntries());
+    }
+    
+    
+    public void copyTo(PlanetGroup dataHolder) {
+        // don't allow changes to handles
+        dataHolder.setTitle(getTitle());
+        dataHolder.setDescription(getDescription());
+        dataHolder.setMaxPageEntries(getPageEntries());
+        dataHolder.setMaxFeedEntries(getPageEntries());
+    }
+
+}

Added: roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/GroupEdit-validation.xml
URL: http://svn.apache.org/viewvc/roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/GroupEdit-validation.xml?rev=672574&view=auto
==============================================================================
--- roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/GroupEdit-validation.xml (added)
+++ roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/GroupEdit-validation.xml Sat Jun 28 12:18:17 2008
@@ -0,0 +1,54 @@
+<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN"
+       "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
+<validators>
+    
+    <field name="bean.handle">
+        <field-validator type="requiredstring">
+            <message key="GroupAdd.error.handleNull">unspecified key</message>
+        </field-validator>
+        
+        <field-validator type="stringlength">
+            <param name="maxLength">255</param>
+            <message key="GroupAdd.error.handleSize">unspecified key</message>
+        </field-validator>
+    </field>
+    
+    <field name="bean.title">
+        <field-validator type="requiredstring">
+            <message key="GroupAdd.error.titleNull">unspecified key</message>
+        </field-validator>
+        
+        <field-validator type="stringlength">
+            <param name="maxLength">255</param>
+            <message key="GroupAdd.error.titleSize">unspecified key</message>
+        </field-validator>
+    </field>
+    
+    <field name="bean.description">
+        <field-validator type="stringlength">
+            <param name="maxLength">255</param>
+            <message key="GroupAdd.error.descriptionSize">unspecified key</message>
+        </field-validator>
+    </field>
+    
+    <field name="bean.pageEntries">
+        <field-validator type="required">
+            <message key="GroupAdd.error.maxPageEntriesNull">unspecified key</message>
+        </field-validator>
+        
+        <field-validator type="int">
+            <message key="GroupAdd.error.maxPageEntriesInt">unspecified key</message>
+        </field-validator>
+    </field>
+    
+    <field name="bean.feedEntries">
+        <field-validator type="required">
+            <message key="GroupAdd.error.maxFeedEntriesNull">unspecified key</message>
+        </field-validator>
+        
+        <field-validator type="int">
+            <message key="GroupAdd.error.maxFeedEntriesInt">unspecified key</message>
+        </field-validator>
+    </field>
+    
+</validators>

Added: roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/GroupEdit.java
URL: http://svn.apache.org/viewvc/roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/GroupEdit.java?rev=672574&view=auto
==============================================================================
--- roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/GroupEdit.java (added)
+++ roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/GroupEdit.java Sat Jun 28 12:18:17 2008
@@ -0,0 +1,113 @@
+/*
+ * 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.planet.ui.struts2.editor;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.roller.planet.PlanetException;
+import org.apache.roller.planet.business.AggregatorFactory;
+import org.apache.roller.planet.business.PlanetManager;
+import org.apache.roller.planet.pojos.PlanetGroup;
+import org.apache.roller.planet.ui.struts2.util.UIAction;
+import org.apache.roller.planet.util.cache.CacheManager;
+import org.apache.struts2.interceptor.validation.SkipValidation;
+
+
+/**
+ * Edit a group.
+ */
+public class GroupEdit extends UIAction {
+    
+    private static Log log = LogFactory.getLog(GroupEdit.class);
+    
+    private GroupBean bean = new GroupBean();
+    
+    
+    public GroupEdit() {
+        this.pageTitle = "GroupEdit.title";
+    }
+    
+    
+    @Override
+    public boolean isGroupRequired() {
+        return true;
+    }
+    
+    
+    @SkipValidation
+    @Override
+    public String execute() {
+        
+        // load existing data
+        getBean().copyFrom(getActionGroup());
+        
+        return INPUT;
+    }
+    
+    
+    /**
+     * Update and existing group. 
+     */
+    public String save() {
+        
+        // validation
+        myValidate();
+        
+        if(!hasActionErrors()) try {
+            PlanetManager pmgr = AggregatorFactory.getAggregator().getPlanetManager();
+            
+            PlanetGroup group = getActionGroup();
+            
+            // copy attributes
+            getBean().copyTo(group);
+            
+            // save and flush
+            pmgr.saveGroup(group);
+            AggregatorFactory.getAggregator().flush();
+            
+            addMessage("GroupEdit.message.saveSucceeded", group.getTitle());
+            
+            // Clear cache entries associated with group
+            CacheManager.invalidate(group);
+            
+        } catch (PlanetException ex) {
+            log.error("Error saving planet group", ex);
+            addError("GroupEdit.error.saveFailed");
+        }
+        
+        return INPUT;
+    }
+    
+    
+    // TODO: Validation - make sure that html is not allowed in title
+    // TODO: Validation - make sure maxXXXEntries have a proper value range
+    private void myValidate() {
+        
+    }
+    
+    
+    public GroupBean getBean() {
+        return bean;
+    }
+
+    public void setBean(GroupBean bean) {
+        this.bean = bean;
+    }
+    
+}

Added: roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/GroupRemove.java
URL: http://svn.apache.org/viewvc/roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/GroupRemove.java?rev=672574&view=auto
==============================================================================
--- roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/GroupRemove.java (added)
+++ roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/GroupRemove.java Sat Jun 28 12:18:17 2008
@@ -0,0 +1,90 @@
+/*
+ * 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.planet.ui.struts2.editor;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.roller.planet.business.AggregatorFactory;
+import org.apache.roller.planet.business.PlanetManager;
+import org.apache.roller.planet.pojos.Planet;
+import org.apache.roller.planet.pojos.PlanetGroup;
+import org.apache.roller.planet.ui.struts2.util.UIAction;
+
+
+/**
+ * Action for removing a group.
+ */
+public class GroupRemove extends UIAction {
+    
+    private static Log log = LogFactory.getLog(GroupRemove.class);
+    
+    
+    public GroupRemove() {
+        this.pageTitle = "GroupRemove.title";
+    }
+    
+    
+    @Override
+    public boolean isGroupRequired() {
+        return true;
+    }
+    
+    /** 
+     * Show group remove confirmation.
+     */
+    @Override
+    public String execute() {
+        return "confirm";
+    }
+    
+    
+    /**
+     * Remove a group.
+     */
+    public String remove() {
+        
+        try {
+            PlanetManager pmgr = AggregatorFactory.getAggregator().getPlanetManager();
+            
+            // remove group
+            PlanetGroup group = getActionGroup();
+            String title = group.getTitle();
+            Planet planet = group.getPlanet();
+            planet.getGroups().remove(group);
+            pmgr.savePlanet(planet);
+            pmgr.deleteGroup(group);
+            AggregatorFactory.getAggregator().flush();
+            
+//            CacheManager.invalidate(getActionGroup());
+            
+            addMessage("GroupRemove.message.removeSucceeded", title);
+            setActionGroup(null);
+            
+            return SUCCESS;
+            
+        } catch (Exception ex) {
+            log.error("Error removing group - "+getActionGroup().getHandle(), ex);
+            addError("GroupRemove.error.unexpected");
+        }
+        
+        return "confirm";
+        
+    }
+    
+}

Added: roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/Groups.java
URL: http://svn.apache.org/viewvc/roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/Groups.java?rev=672574&view=auto
==============================================================================
--- roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/Groups.java (added)
+++ roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/Groups.java Sat Jun 28 12:18:17 2008
@@ -0,0 +1,44 @@
+/*
+ * 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.planet.ui.struts2.editor;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.roller.planet.ui.struts2.util.UIAction;
+
+
+/**
+ * Display list of groups in a planet.
+ */
+public class Groups extends UIAction {
+    
+    private static Log log = LogFactory.getLog(Groups.class);
+    
+    
+    public Groups() {
+        this.pageTitle = "Groups.title";
+    }
+    
+    
+    @Override
+    public String execute() {
+        return LIST;
+    }
+    
+}

Added: roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/Members.java
URL: http://svn.apache.org/viewvc/roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/Members.java?rev=672574&view=auto
==============================================================================
--- roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/Members.java (added)
+++ roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/Members.java Sat Jun 28 12:18:17 2008
@@ -0,0 +1,161 @@
+/*
+ * 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.planet.ui.struts2.editor;
+
+import java.util.ArrayList;
+import java.util.Collections;
+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.planet.business.AggregatorFactory;
+import org.apache.roller.planet.business.UserManager;
+import org.apache.roller.planet.business.startup.PlanetStartup;
+import org.apache.roller.planet.pojos.PlanetPermission;
+import org.apache.roller.planet.pojos.User;
+import org.apache.roller.planet.ui.struts2.util.UIAction;
+import org.apache.roller.planet.util.mail.PlanetMailer;
+import org.apache.roller.planet.util.mail.PlanetMailerException;
+import org.apache.struts2.interceptor.validation.SkipValidation;
+
+
+/**
+ * Action for modifying planet membership.
+ */
+public class Members extends UIAction {
+    
+    private static Log log = LogFactory.getLog(Members.class);
+    
+    private String userName = null;
+    private List<String> revokeIds = Collections.EMPTY_LIST;
+    
+    
+    public Members() {
+        this.pageTitle = "Members.title";
+    }
+    
+    
+    // admin perms required
+    @Override
+    public short requiredPlanetPermissions() {
+        return PlanetPermission.ADMIN;
+    }
+    
+    
+    @SkipValidation
+    @Override
+    public String execute() {
+        
+        return INPUT;
+    }
+    
+    
+    /**
+     * Invite new member.
+     */
+    public String invite() {
+        
+        if(!StringUtils.isEmpty(getUserName())) try {
+            UserManager umgr = AggregatorFactory.getAggregator().getUserManager();
+            
+            User user = umgr.getUserByUserName(getUserName());
+            if(user != null) {
+                umgr.inviteUser(getActionPlanet(), user, PlanetPermission.ADMIN);
+                AggregatorFactory.getAggregator().flush();
+
+                // now send out invitation email notification, if possible
+                try {
+                    PlanetMailer mailer = new PlanetMailer(PlanetStartup.getMailProvider(), getPlanetConfig());
+                    // params are ("user doing inviting", "user being invited", "planet")
+                    mailer.sendPlanetInvitation(getAuthenticatedUser(), user, getActionPlanet());
+                    
+                    addMessage("Members.message.invitedWithEmail", user.getFullName());
+                } catch(PlanetMailerException e) {
+                    addMessage("Members.message.invitedWithoutEmail", user.getFullName());
+                    log.warn("Failed to send invitation email", e);
+                }
+                
+            } else {
+                addError("Members.error.userNotFound", getUserName());
+            }
+            
+        } catch (Exception ex) {
+            log.error("Error inviting user - "+getUserName(), ex);
+            addError("Members.error.inviteFailed");
+        }
+        
+        return  INPUT;
+    }
+    
+    
+    /**
+     * Revoke membership.
+     */
+    public String revoke() {
+        
+        if(!getRevokeIds().isEmpty()) try {
+            UserManager umgr = AggregatorFactory.getAggregator().getUserManager();
+            
+            List<String> revoked = new ArrayList(getRevokeIds().size());
+            for (String revokeId : getRevokeIds()) {
+                PlanetPermission perm = umgr.getPermissions(revokeId);
+                
+                // prevent user from revoking themself from planet
+                if (perm != null && !perm.getUser().getId().equals(getAuthenticatedUser().getId())) {
+                    log.debug("Revoking permission - "+revokeId);
+                    revoked.add(perm.getUser().getEmailAddress());
+                    umgr.removePermissions(perm);
+                } else {
+                    addError("Members.error.selfRevokeAttempt");
+                }
+            }
+            
+            if (revoked.size() > 0) {
+                AggregatorFactory.getAggregator().flush();
+
+                // TODO: better formatting
+                addMessage("Members.message.revoked", revoked.toString());
+            }
+            
+        } catch (Exception ex) {
+            log.error("Error revoking user memberships", ex);
+            addError("Members.error.revokeFailed");
+        }
+        
+        return  INPUT;
+    }
+    
+    
+    public List<String> getRevokeIds() {
+        return revokeIds;
+    }
+
+    public void setRevokeIds(List<String> revokeIds) {
+        this.revokeIds = revokeIds;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+    
+}

Added: roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/PlanetConfig-validation.xml
URL: http://svn.apache.org/viewvc/roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/PlanetConfig-validation.xml?rev=672574&view=auto
==============================================================================
--- roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/PlanetConfig-validation.xml (added)
+++ roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/PlanetConfig-validation.xml Sat Jun 28 12:18:17 2008
@@ -0,0 +1,23 @@
+<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN"
+       "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
+<validators>
+    
+    <field name="bean.title">
+        <field-validator type="requiredstring">
+            <message key="PlanetConfig.error.titleNull">unspecified key</message>
+        </field-validator>
+        
+        <field-validator type="stringlength">
+            <param name="maxLength">255</param>
+            <message key="PlanetConfig.error.titleSize">unspecified key</message>
+        </field-validator>
+    </field>
+    
+    <field name="bean.description">
+        <field-validator type="stringlength">
+            <param name="maxLength">255</param>
+            <message key="PlanetConfig.error.descriptionSize">unspecified key</message>
+        </field-validator>
+    </field>
+    
+</validators>

Added: roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/PlanetConfig.java
URL: http://svn.apache.org/viewvc/roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/PlanetConfig.java?rev=672574&view=auto
==============================================================================
--- roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/PlanetConfig.java (added)
+++ roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/PlanetConfig.java Sat Jun 28 12:18:17 2008
@@ -0,0 +1,103 @@
+/*
+ * 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.planet.ui.struts2.editor;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.roller.planet.business.AggregatorFactory;
+import org.apache.roller.planet.business.PlanetManager;
+import org.apache.roller.planet.pojos.Planet;
+import org.apache.roller.planet.pojos.PlanetPermission;
+import org.apache.roller.planet.ui.struts2.util.UIAction;
+import org.apache.roller.planet.util.cache.CacheManager;
+import org.apache.struts2.interceptor.validation.SkipValidation;
+
+
+/**
+ * Action for modifying planet configuration.
+ */
+public class PlanetConfig extends UIAction {
+    
+    private static Log log = LogFactory.getLog(PlanetConfig.class);
+    
+    // bean for managing submitted data
+    private PlanetConfigBean bean = new PlanetConfigBean();
+    
+    
+    public PlanetConfig() {
+        this.pageTitle = "PlanetConfig.title";
+    }
+    
+    
+    // admin perms required
+    @Override
+    public short requiredPlanetPermissions() {
+        return PlanetPermission.ADMIN;
+    }
+    
+    
+    @SkipValidation
+    @Override
+    public String execute() {
+        
+        // load bean with data from planet
+        getBean().copyFrom(getActionPlanet());
+        
+        return INPUT;
+    }
+    
+    
+    /**
+     * Save planet configuration.
+     */
+    public String save() {
+        
+        try {
+            PlanetManager pmgr = AggregatorFactory.getAggregator().getPlanetManager();
+            
+            Planet planet = getActionPlanet();
+            getBean().copyTo(planet);
+            
+            // save config
+            pmgr.savePlanet(planet);
+            AggregatorFactory.getAggregator().flush();
+            
+            addMessage("PlanetConfig.message.saveSucceeded");
+            
+            // Clear cache entries associated with planet
+            CacheManager.invalidate(planet);
+            
+        } catch (Exception ex) {
+            log.error("Error updating weblog config", ex);
+            addError("PlanetConfig.error.unexpected");
+        }
+        
+        return  INPUT;
+    }
+    
+    
+    public PlanetConfigBean getBean() {
+        return bean;
+    }
+
+    public void setBean(PlanetConfigBean bean) {
+        this.bean = bean;
+    }
+    
+}

Added: roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/PlanetConfigBean.java
URL: http://svn.apache.org/viewvc/roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/PlanetConfigBean.java?rev=672574&view=auto
==============================================================================
--- roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/PlanetConfigBean.java (added)
+++ roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/PlanetConfigBean.java Sat Jun 28 12:18:17 2008
@@ -0,0 +1,72 @@
+/*
+ * 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.planet.ui.struts2.editor;
+
+import org.apache.roller.planet.pojos.Planet;
+
+
+/**
+ * form bean use by PlanetConfig action.
+ */
+public class PlanetConfigBean {
+    
+    private String handle;
+    private String title;
+    private String description;
+    
+    
+    public String getHandle() {
+        return handle;
+    }
+    
+    public void setHandle(String handle) {
+        this.handle = handle;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+    
+    public String getDescription() {
+        return description;
+    }
+    
+    public void setDescription(String description) {
+        this.description = description;
+    }
+    
+    
+    public void copyFrom(Planet dataHolder) {
+        setHandle(dataHolder.getHandle());
+        setTitle(dataHolder.getTitle());
+        setDescription(dataHolder.getDescription());
+    }
+    
+    
+    public void copyTo(Planet dataHolder) {
+        // don't allow changes to handles
+        dataHolder.setTitle(getTitle());
+        dataHolder.setDescription(getDescription());
+    }
+    
+}

Added: roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/PlanetRemove.java
URL: http://svn.apache.org/viewvc/roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/PlanetRemove.java?rev=672574&view=auto
==============================================================================
--- roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/PlanetRemove.java (added)
+++ roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/PlanetRemove.java Sat Jun 28 12:18:17 2008
@@ -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.planet.ui.struts2.editor;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.roller.planet.business.AggregatorFactory;
+import org.apache.roller.planet.business.PlanetManager;
+import org.apache.roller.planet.pojos.PlanetPermission;
+import org.apache.roller.planet.ui.struts2.util.UIAction;
+
+
+/**
+ * Action for removing a planet.
+ */
+public class PlanetRemove extends UIAction {
+    
+    private static Log log = LogFactory.getLog(PlanetRemove.class);
+    
+    
+    public PlanetRemove() {
+        this.pageTitle = "PlanetRemove.title";
+    }
+    
+    
+    // admin perms required
+    @Override
+    public short requiredPlanetPermissions() {
+        return PlanetPermission.ADMIN;
+    }
+    
+    
+    /** 
+     * Show planet remove confirmation.
+     */
+    @Override
+    public String execute() {
+        return "confirm";
+    }
+    
+    
+    /**
+     * Remove a planet.
+     */
+    public String remove() {
+        
+        try {
+            PlanetManager pmgr = AggregatorFactory.getAggregator().getPlanetManager();
+            
+            // remove planet
+            String title = getActionPlanet().getTitle();
+            pmgr.deletePlanet(getActionPlanet());
+            AggregatorFactory.getAggregator().flush();
+            
+//            CacheManager.invalidate(getActionPlanet());
+            
+            addMessage("PlanetRemove.message.removeSucceeded", title);
+            setActionPlanet(null);
+            
+            return SUCCESS;
+            
+        } catch (Exception ex) {
+            log.error("Error removing planet - "+getActionPlanet().getHandle(), ex);
+            addError("PlanetRemove.error.unexpected");
+        }
+        
+        return "confirm";
+    }
+    
+}

Added: roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/Subscriptions.java
URL: http://svn.apache.org/viewvc/roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/Subscriptions.java?rev=672574&view=auto
==============================================================================
--- roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/Subscriptions.java (added)
+++ roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/Subscriptions.java Sat Jun 28 12:18:17 2008
@@ -0,0 +1,165 @@
+/*
+ * 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.planet.ui.struts2.editor;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.roller.planet.PlanetException;
+import org.apache.roller.planet.business.AggregatorFactory;
+import org.apache.roller.planet.business.PlanetManager;
+import org.apache.roller.planet.business.fetcher.FeedFetcher;
+import org.apache.roller.planet.pojos.PlanetGroup;
+import org.apache.roller.planet.pojos.Subscription;
+import org.apache.roller.planet.ui.struts2.util.UIAction;
+import org.apache.roller.planet.util.cache.CacheManager;
+
+
+/**
+ * Manage list of Subscriptions in a group.
+ */
+public class Subscriptions extends UIAction {
+    
+    private static Log log = LogFactory.getLog(Subscriptions.class);
+    
+    // url of subscription to work on if doing an add or remove
+    private String subUrl = null;
+    
+    
+    public Subscriptions() {
+        this.pageTitle = "Subscriptions.title";
+    }
+    
+    
+    @Override
+    public boolean isGroupRequired() {
+        return true;
+    }
+    
+    
+    @Override
+    public String execute() {
+        return LIST;
+    }
+    
+    
+    /**
+     * Add a subscription to a group. 
+     */
+    public String add() {
+        
+        if(StringUtils.isEmpty(getSubUrl())) {
+            addError("Subscriptions.error.subscriptionNull");
+            return LIST;
+        }
+        
+        log.debug("Adding Planet Subscription - "+getSubUrl());
+        
+        PlanetManager pmgr = AggregatorFactory.getAggregator().getPlanetManager();
+        try {
+            PlanetGroup group = getActionGroup();
+            
+            // check if this subscription already exists before adding it
+            Subscription sub = pmgr.getSubscription(getSubUrl());
+            if(sub == null) {
+                // sub doesn't exist yet, so we need to fetch it
+                FeedFetcher fetcher = AggregatorFactory.getAggregator().getFeedFetcher();
+                sub = fetcher.fetchSubscription(getSubUrl());
+                
+                // save new sub
+                pmgr.saveSubscription(sub);
+            }
+            
+            // add the sub to the group
+            group.getSubscriptions().add(sub);
+            sub.getGroups().add(group);
+            pmgr.saveGroup(group);
+            
+            // flush changes
+            AggregatorFactory.getAggregator().flush();
+            
+            addMessage("Subscriptions.message.saveSucceeded", sub.getTitle());
+            
+            // clear field after success
+            setSubUrl(null);
+            
+            // Clear cache entries associated with group
+            CacheManager.invalidate(group);
+            
+        } catch (PlanetException ex) {
+            log.error("Error adding subscription", ex);
+            addError("Subscriptions.error.saveFailed", ex.getRootCauseMessage());
+        }
+        
+        
+        return LIST;
+    }
+    
+    
+    /**
+     * Remove a subscription from a group. 
+     */
+    public String remove() {
+        
+        if(StringUtils.isEmpty(getSubUrl())) {
+            addError("Subscriptions.error.subscriptionNull");
+            return LIST;
+        }
+        
+        log.debug("Deleting Planet Subscription - "+getSubUrl());
+        
+        PlanetManager pmgr = AggregatorFactory.getAggregator().getPlanetManager();
+        try {
+            Subscription sub = pmgr.getSubscription(getSubUrl());
+            if (sub == null) {
+                addError("Subscriptions.error.nullSubscription");
+            } else {
+                PlanetGroup group = getActionGroup();
+                group.getSubscriptions().remove(sub);
+                sub.getGroups().remove(group);
+                pmgr.saveGroup(group);
+                AggregatorFactory.getAggregator().flush();
+                
+                addMessage("Subscriptions.message.subscriptionDeleteSucceeded", sub.getTitle());
+                
+                // clear field after success
+                setSubUrl(null);
+                
+                // Clear cache entries associated with group
+                CacheManager.invalidate(group);
+            }
+            
+        } catch (PlanetException ex) {
+            log.error("Unable to lookup planet group", ex);
+            addError("Subscriptions.error.subscriptionDeleteFailed", getSubUrl());
+        }
+        
+        return LIST;
+    }
+    
+    
+    public String getSubUrl() {
+        return subUrl;
+    }
+
+    public void setSubUrl(String subUrl) {
+        this.subUrl = subUrl;
+    }
+    
+}

Added: roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/package.properties
URL: http://svn.apache.org/viewvc/roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/package.properties?rev=672574&view=auto
==============================================================================
--- roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/package.properties (added)
+++ roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/editor/package.properties Sat Jun 28 12:18:17 2008
@@ -0,0 +1,171 @@
+
+# Planet Config
+
+PlanetConfig.title=Planet Configuration
+
+PlanetConfig.field.handle=Handle
+PlanetConfig.field.title=Title
+PlanetConfig.field.description=Description
+PlanetConfig.button.save=Update Planet Config
+PlanetConfig.button.cancel=Cancel
+
+PlanetConfig.message.saveSucceeded=Planet configuration has been saved.
+
+PlanetConfig.error.titleNull=Title is a required field
+PlanetConfig.error.titleSize=Title cannot be more than 255 characters
+PlanetConfig.error.descriptionSize=Description cannot be more than 255 characters
+PlanetConfig.error.unexpected=Oops!  There was an unexpected error while trying \
+to save your planet configuration.  Try your update one more time and if you \
+get the same error you may have found a bug, please report it to the site administrator.
+
+
+# Planet Remove
+
+PlanetRemove.title=Confirm Planet Remove
+
+PlanetRemove.youSure=Are you sure you want to remove planet <b>{0}</b>?
+PlanetRemove.warning=\
+<b>WARNING</b>: removing this planet will remove everything: all of the groups \
+, subscriptions, and entries. <b>Planet removal is \
+NOT REVERSIBLE</b>.
+
+PlanetRemove.planetId=Planet ID
+PlanetRemove.planetTitle=Planet Title
+
+PlanetRemove.message.removeSucceeded=Poof! Planet <b>{0}</b> has been deleted.
+PlanetRemove.error.unexpected=Oops!  There was an unexpected error while trying \
+to remove your planet.  Try the removal one more time and if you \
+get the same error you may have found a bug, please report it to the site administrator.
+
+
+# Groups
+
+Groups.title=Subscription Groups
+Groups.prompt=A subscription group is a collection \
+of RSS or Atom feeds to be aggregated together.  Each planet is allowed to \
+contain any number of subscription groups, so you don't have to feel limited. \
+
+
+Groups.addGroup=Add a new subscription group.
+
+Groups.groupTitle=Group Title
+Groups.action=Actions
+Groups.tip.editGroup=Edit Group Configuration
+Groups.tip.subscriptions=Manage Group Subscriptions
+Groups.tip.deleteGroup=Remove Group
+
+
+# Group Add
+
+GroupAdd.title=Create Subscription Group
+GroupAdd.prompt=Add a new subscription group in the <b>{0}</b> planet.
+
+GroupAdd.field.handle=Handle
+GroupAdd.field.title=Title
+GroupAdd.field.description=Description
+GroupAdd.field.pageEntries=Max page entries
+GroupAdd.field.feedEntries=Max feeds entries
+GroupAdd.button.save=Create Group
+GroupAdd.button.cancel=Cancel
+
+GroupAdd.message.saveSucceeded=Group <b>{0}</b> successfully created.
+GroupAdd.error.unexpected=Oops!  There was an unexpected error while trying \
+to add your subscription group.  Try again and if you \
+get the same error you may have found a bug, please report it to the site administrator.
+
+GroupAdd.error.handleNull=How can you have a group with no handle?  Try again.
+GroupAdd.error.handleSize=That's a pretty long handle you chose.  We only allow handles to be at most 32 characters.
+GroupAdd.error.titleNull=Don't you want a title for your group?  Try again.
+GroupAdd.error.titleSize=That's a pretty long title you chose.  We only allow titles to be at most 255 characters.
+GroupAdd.error.descriptionSize=That's a pretty long description.  We only allow descriptions to be at most 255 characters.
+GroupAdd.error.maxPageEntriesNull=How can we display your group if we don't know how many entries to show?
+GroupAdd.error.maxPageEntriesInt=Don't try to be cheeky, you know we need a number here.
+GroupAdd.error.maxFeedEntriesNull=How can we offer your group feed if we don't know how many entries to include?
+GroupAdd.error.maxFeedEntriesInt=Don't try to be cheeky, you know we need a number here.
+
+GroupAdd.error.invalidHandle=The handle you specified uses invalid characters. \
+You may only use the characters {0} to create handles.
+GroupAdd.error.handleExists=A group with that handle already exists.
+
+
+# Group Edit
+
+GroupEdit.title=Edit Subscription Group
+GroupEdit.prompt=Modify configuration for subscription group <b>{0}</b>.
+
+GroupEdit.button.save=Save
+
+GroupEdit.message.saveSucceeded=Group {0} successfully updated.
+GroupEdit.error.saveFailed=Failed to save group.
+
+
+# Group Remove
+
+GroupRemove.title=Confirm Group Removal
+
+GroupRemove.youSure=Are you sure you want to remove subscription group <b>{0}</b>?
+GroupRemove.removeGroupWarning=\
+<b>WARNING</b>: removing this group will remove all of its subscription and entries. <b>Group removal is \
+NOT REVERSIBLE</b>.
+
+GroupRemove.groupId=Group ID
+GroupRemove.groupTitle=Group Title
+
+GroupRemove.message.removeSucceeded=Subscription group <b>{0}</b> has been deleted.
+GroupRemove.error.unexpected=Oops!  There was an unexpected error while trying \
+to remove your subscription group.  Try the removal one more time and if you \
+get the same error you may have found a bug, please report it to the site administrator.
+
+
+# Members
+
+Members.title=Planet Membership Management
+
+Members.prompt.invite=Invite new users to participate in the <b>{0}</b> planet.
+Members.search=Find User
+Members.submit.invite=Invite User
+
+Members.prompt.revoke=View the current list of members for the <b>{0}</b> planet \
+and revoke membership for any users no longer participating.
+Members.tableHeading.name=Member Name
+Members.tableHeading.action=Revoke
+Members.submit.revoke=Revoke Memberships
+
+Members.message.invitedWithEmail=<b>{0}</b> has been sent an invitation.
+Members.message.invitedWithoutEmail=<b>{0}</b> has been invited, but no \
+invitation email was sent due to a mail problem.
+Members.message.revoked=The following memberships have been revoked: <b>{0}</b>
+
+Members.error.userNotFound=Hmmm, it seems you are trying to invite a person who \
+is not in the system.  That won't work now will it?
+Members.error.inviteFailed=The system had a problem processing your invitation request. \
+Please try again and if the problem continues report it to the site administrator.
+Members.error.revokeFailed=The system had a problem processing your membership revoke request. \
+Please try again and if the problem continues report it to the site administrator.
+Members.error.selfRevokeAttempt=You didn't really want to revoke yourself from \
+this planet did you?  Sorry, we don't allow that.
+
+
+# Subscriptions
+
+Subscriptions.title=Subscriptions
+
+Subscriptions.backToGroups=Back to subscription groups
+
+Subscriptions.addSub=Add Subscription
+
+Subscriptions.subsTitle=Subscription Title
+Subscriptions.action=Actions
+Subscriptions.tip.visitFeed=View Subscription
+Subscriptions.tip.deleteSub=Delete Subscription
+
+Subscriptions.message.saveSucceeded=Subscription <b>{0}</b> has been added to this group.
+Subscriptions.message.subscriptionDeleteSucceeded=Subscription {0} has been deleted from this group.
+Subscriptions.error.subscriptionDeleteFailed=Oops!  There was an unexpected error while trying \
+to remove subscription <b>{0}</b>.  Try the removal one more time and if you \
+get the same error you may have found a bug, please report it to the site administrator.
+Subscriptions.error.subscriptionNull=You've got to enter in a feed url first silly!
+Subscriptions.error.saveFailed=Oops!  There was an error while trying \
+to add your subscription.  This is most likely a problem with the feed you are \
+trying to add.  Visit the feed url in your browser and make sure it is valid. Reason: {0}
+

Added: roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/util/KeyValueObject.java
URL: http://svn.apache.org/viewvc/roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/util/KeyValueObject.java?rev=672574&view=auto
==============================================================================
--- roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/util/KeyValueObject.java (added)
+++ roller/planet/core/trunk/src/java/org/apache/roller/planet/ui/struts2/util/KeyValueObject.java Sat Jun 28 12:18:17 2008
@@ -0,0 +1,54 @@
+/*
+ * 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.planet.ui.struts2.util;
+
+
+/**
+ * A simple object to maintain a key/value pair.
+ */
+public class KeyValueObject {
+    
+    private Object key = null;
+    private Object value = null;
+    
+    
+    public KeyValueObject() {}
+    
+    public KeyValueObject(Object key, Object value) {
+        this.setKey(key);
+        this.setValue(value);
+    }
+
+    public Object getKey() {
+        return key;
+    }
+
+    public void setKey(Object key) {
+        this.key = key;
+    }
+
+    public Object getValue() {
+        return value;
+    }
+
+    public void setValue(Object value) {
+        this.value = value;
+    }
+    
+}