roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agillil...@apache.org
Subject svn commit: r510734 - in /incubator/roller/trunk/apps/planet: src/java/org/apache/roller/planet/pojos/ src/java/org/apache/roller/planet/ui/admin/struts2/ src/sql/ test/java/org/apache/roller/planet/business/ web/WEB-INF/jsps/admin/ web/planet-ui/css/
Date Fri, 23 Feb 2007 00:43:38 GMT
Author: agilliland
Date: Thu Feb 22 16:43:37 2007
New Revision: 510734

URL: http://svn.apache.org/viewvc?view=rev&rev=510734
Log:
doing a couple things to continue polishing things up a bit.

1. fixed up some quirks in the createdb script.

2. added first step of validation to forms to enforce simple checks like required fields,
field types, and max and min lengths.



Added:
    incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/admin/struts2/PlanetForm-PlanetForm!save-validation.xml
    incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/admin/struts2/PlanetGroupForm-PlanetGroupForm!save-validation.xml
    incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/admin/struts2/PlanetSubscriptionForm-PlanetSubscriptionForm!save-validation.xml
Modified:
    incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/pojos/PlanetData.java
    incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/admin/struts2/PlanetForm.java
    incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/admin/struts2/PlanetGroupForm.java
    incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/admin/struts2/PlanetSubscriptionForm.java
    incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/admin/struts2/PlanetsList.java
    incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/admin/struts2/package.properties
    incubator/roller/trunk/apps/planet/src/sql/createdb.vm
    incubator/roller/trunk/apps/planet/test/java/org/apache/roller/planet/business/PlanetManagerTest.java
    incubator/roller/trunk/apps/planet/test/java/org/apache/roller/planet/business/PlanetTest.java
    incubator/roller/trunk/apps/planet/web/WEB-INF/jsps/admin/PlanetForm.jsp
    incubator/roller/trunk/apps/planet/web/WEB-INF/jsps/admin/PlanetsList.jsp
    incubator/roller/trunk/apps/planet/web/planet-ui/css/planet.css

Modified: incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/pojos/PlanetData.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/pojos/PlanetData.java?view=diff&rev=510734&r1=510733&r2=510734
==============================================================================
--- incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/pojos/PlanetData.java
(original)
+++ incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/pojos/PlanetData.java
Thu Feb 22 16:43:37 2007
@@ -1,10 +1,19 @@
 /*
- * PlanetData.java
+ * 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
  *
- * Created on December 13, 2006, 5:09 PM
+ *     http://www.apache.org/licenses/LICENSE-2.0
  *
- * To change this template, choose Tools | Template Manager
- * and open the template in the editor.
+ * 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.pojos;
@@ -21,7 +30,7 @@
 public class PlanetData {
     
     private String id = null;
-    private String name = null;
+    private String title = null;
     private String handle = null;
     private Set groups = new HashSet();
     
@@ -31,7 +40,7 @@
     
     
     public PlanetData(String name, String handle) {
-        this.name = name;
+        this.title = name;
         this.handle = handle;
     }
     
@@ -48,14 +57,14 @@
     }
 
     /**
-     * @hibernate.property column="name" non-null="true" unique="false"
+     * @hibernate.property column="title" non-null="true" unique="false"
      */
-    public String getName() {
-        return name;
+    public String getTitle() {
+        return title;
     }
 
-    public void setName(String name) {
-        this.name = name;
+    public void setTitle(String title) {
+        this.title = title;
     }
 
     /**

Added: incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/admin/struts2/PlanetForm-PlanetForm!save-validation.xml
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/admin/struts2/PlanetForm-PlanetForm%21save-validation.xml?view=auto&rev=510734
==============================================================================
--- incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/admin/struts2/PlanetForm-PlanetForm!save-validation.xml
(added)
+++ incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/admin/struts2/PlanetForm-PlanetForm!save-validation.xml
Thu Feb 22 16:43:37 2007
@@ -0,0 +1,38 @@
+<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN"
+       "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
+<validators>
+    
+    <!-- validate the planet handle field -->
+    <field name="planet.handle">
+        
+        <!-- handle is required -->
+        <field-validator type="requiredstring">
+            <param name="trim">true</param>
+            <message key="PlanetForm.error.handleNull">handle is required</message>
+        </field-validator>
+        
+        <!-- handle has a max size -->
+        <field-validator type="stringlength">
+            <param name="maxLength">32</param>
+            <param name="trim">true</param>
+            <message key="PlanetForm.error.handleSize">handle must be less than 32
characters</message>
+        </field-validator>
+    </field>
+    
+    <!-- validate the planet title field -->
+    <field name="planet.title">
+        
+        <!-- title is required -->
+        <field-validator type="requiredstring">
+            <param name="trim">true</param>
+            <message key="PlanetForm.error.titleNull">title is required</message>
+        </field-validator>
+        
+        <!-- title has a max size -->
+        <field-validator type="stringlength">
+            <param name="maxLength">255</param>
+            <param name="trim">true</param>
+            <message key="PlanetForm.error.titleSize">title must be less than 255 characters</message>
+        </field-validator>
+    </field>
+</validators>
\ No newline at end of file

Modified: incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/admin/struts2/PlanetForm.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/admin/struts2/PlanetForm.java?view=diff&rev=510734&r1=510733&r2=510734
==============================================================================
--- incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/admin/struts2/PlanetForm.java
(original)
+++ incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/admin/struts2/PlanetForm.java
Thu Feb 22 16:43:37 2007
@@ -73,6 +73,8 @@
     }
     
     
+    // TODO: Validation - check that planet handle is unique
+    // TODO: Validation - make sure html is not allowed in handle or title
     public String save() {
         
         if(this.planet != null) {
@@ -116,14 +118,15 @@
                 pmgr.savePlanet(this.planet);
                 pmgr.deleteGroup(group);
                 PlanetFactory.getPlanet().flush();
+                
+                setSuccess("PlanetForm.message.groupDeleteSucceeded", group.getHandle());
+                return INPUT;
             } catch (RollerException ex) {
                 log.error("Error deleting planet group", ex);
                 setError("PlanetForm.error.groupDeleteFailed", getGroupid());
                 return INPUT;
             }
             
-            setSuccess("PlanetForm.message.groupDeleteSucceeded");
-            return INPUT;
         } else {
             setError("PlanetForm.error.groupNull");
             return INPUT;

Added: incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/admin/struts2/PlanetGroupForm-PlanetGroupForm!save-validation.xml
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/admin/struts2/PlanetGroupForm-PlanetGroupForm%21save-validation.xml?view=auto&rev=510734
==============================================================================
--- incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/admin/struts2/PlanetGroupForm-PlanetGroupForm!save-validation.xml
(added)
+++ incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/admin/struts2/PlanetGroupForm-PlanetGroupForm!save-validation.xml
Thu Feb 22 16:43:37 2007
@@ -0,0 +1,82 @@
+<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN"
+       "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
+<validators>
+    
+    <!-- validate group handle -->
+    <field name="group.handle">
+        
+        <!-- handle is required -->
+        <field-validator type="requiredstring">
+            <param name="trim">true</param>
+            <message key="PlanetGroupForm.error.handleNull">handle is required</message>
+        </field-validator>
+        
+        <!-- handle has a max size -->
+        <field-validator type="stringlength">
+            <param name="maxLength">32</param>
+            <param name="trim">true</param>
+            <message key="PlanetGroupForm.error.handleSize">handle must be less than
32 characters</message>
+        </field-validator>
+    </field>
+    
+    <!-- validate group title -->
+    <field name="group.title">
+        
+        <!-- title is required -->
+        <field-validator type="requiredstring">
+            <param name="trim">true</param>
+            <message key="PlanetGroupForm.error.titleNull">title is required</message>
+        </field-validator>
+        
+        <!-- title has a max size -->
+        <field-validator type="stringlength">
+            <param name="maxLength">255</param>
+            <param name="trim">true</param>
+            <message key="PlanetGroupForm.error.titleSize">title must be less than
255 characters</message>
+        </field-validator>
+    </field>
+    
+    <!-- validate group description -->
+    <field name="group.description">
+        
+        <!-- description has a max size -->
+        <field-validator type="stringlength">
+            <param name="maxLength">255</param>
+            <param name="trim">true</param>
+            <message key="PlanetGroupForm.error.descriptionSize">description must be
less than 255 characters</message>
+        </field-validator>
+    </field>
+    
+    <!-- validate group maxPageEntries -->
+    <field name="group.maxPageEntries">
+        
+        <!-- maxPageEntries is required -->
+        <field-validator type="required">
+            <message key="PlanetGroupForm.error.maxPageEntriesNull">maxPageEntries
is required</message>
+        </field-validator>
+        
+        <!-- maxPageEntries is an int -->
+        <field-validator type="int">
+            <param name="min">1</param>
+            <param name="max">100</param>
+            <message key="PlanetGroupForm.error.maxPageEntriesInt">maxPageEntries must
be a number between 1 and 100</message>
+        </field-validator>
+    </field>
+    
+    <!-- validate group maxFeedEntries -->
+    <field name="group.maxFeedEntries">
+        
+        <!-- maxFeedEntries is required -->
+        <field-validator type="required">
+            <message key="PlanetGroupForm.error.maxFeedEntriesNull">maxFeedEntries
is required</message>
+        </field-validator>
+        
+        <!-- maxFeedEntries is an int -->
+        <field-validator type="int">
+            <param name="min">1</param>
+            <param name="max">100</param>
+            <message key="PlanetGroupForm.error.maxFeedEntriesInt">maxFeedEntries must
be a number between 1 and 100</message>
+        </field-validator>
+    </field>
+    
+</validators>
\ No newline at end of file

Modified: incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/admin/struts2/PlanetGroupForm.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/admin/struts2/PlanetGroupForm.java?view=diff&rev=510734&r1=510733&r2=510734
==============================================================================
--- incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/admin/struts2/PlanetGroupForm.java
(original)
+++ incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/admin/struts2/PlanetGroupForm.java
Thu Feb 22 16:43:37 2007
@@ -76,6 +76,10 @@
         return INPUT;
     }
     
+    
+    // TODO: Validation - check that group handle is unique within planet
+    // TODO: Validation - make sure that html is not allowed in handle or title
+    // TODO: Validation - make sure maxXXXEntries have a proper value range
     public String save() {
         // save a group group
         log.debug("Saving Planet Group ...");
@@ -114,16 +118,18 @@
                     pmgr.saveGroup(group);
                     PlanetFactory.getPlanet().flush();
                 }
+                
+                setSuccess("PlanetGroupForm.message.subscriptionDeleteSucceeded", sub.getTitle());
             }
             
+            setError("PlanetGroupForm.error.subscriptionNull");
+            return INPUT;
+            
         } catch (RollerException ex) {
             log.error("Unable to lookup planet group", ex);
             setError("PlanetGroupForm.error.subscriptionDeleteFailed", getSubid());
             return INPUT;
         }
-        
-        setSuccess("PlanetGroupForm.message.subscriptionDeleteSucceeded", getSubid());
-        return INPUT;
     }
 
     public String getPlanetid() {

Added: incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/admin/struts2/PlanetSubscriptionForm-PlanetSubscriptionForm!save-validation.xml
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/admin/struts2/PlanetSubscriptionForm-PlanetSubscriptionForm%21save-validation.xml?view=auto&rev=510734
==============================================================================
--- incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/admin/struts2/PlanetSubscriptionForm-PlanetSubscriptionForm!save-validation.xml
(added)
+++ incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/admin/struts2/PlanetSubscriptionForm-PlanetSubscriptionForm!save-validation.xml
Thu Feb 22 16:43:37 2007
@@ -0,0 +1,62 @@
+<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN"
+       "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
+<validators>
+    
+    <!-- validate subscription title -->
+    <field name="subscription.title">
+        
+        <!-- title is required -->
+        <field-validator type="requiredstring">
+            <param name="trim">true</param>
+            <message key="PlanetSubscriptionForm.error.titleNull">title is required</message>
+        </field-validator>
+        
+        <!-- title has a max size -->
+        <field-validator type="stringlength">
+            <param name="maxLength">255</param>
+            <param name="trim">true</param>
+            <message key="PlanetSubscriptionForm.error.titleSize">title must be less
than 255 characters</message>
+        </field-validator>
+    </field>
+    
+    <!-- validate subscription feedURL -->
+    <field name="subscription.feedURL">
+        
+        <!-- feedURL is required -->
+        <field-validator type="requiredstring">
+            <param name="trim">true</param>
+            <message key="PlanetSubscriptionForm.error.feedURLNull">feedURL is required</message>
+        </field-validator>
+        
+        <!-- feedURL must be a valid url -->
+        <field-validator type="url">
+            <message key="PlanetSubscriptionForm.error.feedURLValid">feedURL must be
a valid url</message>
+        </field-validator>
+        
+        <!-- feedURL has a max size -->
+        <field-validator type="stringlength">
+            <param name="maxLength">255</param>
+            <param name="trim">true</param>
+            <message key="PlanetSubscriptionForm.error.feedURLSize">feedURL must be
less than 255 characters</message>
+        </field-validator>
+    </field>
+    
+    <!-- validate subscription siteURL -->
+    <field name="subscription.siteURL">
+        
+        <!-- siteURL must be a valid url -->
+        <field-validator type="url">
+            <message key="PlanetSubscriptionForm.error.siteURLValid">siteURL must be
a valid url</message>
+        </field-validator>
+        
+        <!-- siteURL has a max size -->
+        <field-validator type="stringlength">
+            <param name="maxLength">255</param>
+            <param name="trim">true</param>
+            <message key="PlanetSubscriptionForm.error.siteURLSize">siteURL must be
less than 255 characters</message>
+        </field-validator>
+    </field>
+    
+    
+    
+</validators>
\ No newline at end of file

Modified: incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/admin/struts2/PlanetSubscriptionForm.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/admin/struts2/PlanetSubscriptionForm.java?view=diff&rev=510734&r1=510733&r2=510734
==============================================================================
--- incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/admin/struts2/PlanetSubscriptionForm.java
(original)
+++ incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/admin/struts2/PlanetSubscriptionForm.java
Thu Feb 22 16:43:37 2007
@@ -67,6 +67,8 @@
         return INPUT;
     }
     
+    
+    // TODO: Validation - make sure that html is not allowed in title
     public String save() {
         // save a subscription
         log.debug("Saving Planet Subscription ...");

Modified: incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/admin/struts2/PlanetsList.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/admin/struts2/PlanetsList.java?view=diff&rev=510734&r1=510733&r2=510734
==============================================================================
--- incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/admin/struts2/PlanetsList.java
(original)
+++ incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/admin/struts2/PlanetsList.java
Thu Feb 22 16:43:37 2007
@@ -69,7 +69,7 @@
         
         if(getPlanetid() != null && getPlanetid().length() > 0) {
             // delete a planet
-            log.info("Deleting Planet ... "+getPlanetid());
+            log.debug("Deleting Planet ... "+getPlanetid());
             
             try {
                 PlanetManager pMgr = PlanetFactory.getPlanet().getPlanetManager();
@@ -78,15 +78,16 @@
                     pMgr.deletePlanet(planet);
                     PlanetFactory.getPlanet().flush();
                 }
+                
+                // delete succeeded, handle rest of request as usual
+                setSuccess("PlanetsList.message.planetDeleteSucceeded", planet.getHandle());
+                return execute();
             } catch(Exception e) {
                 log.error("Error deleting planet", e);
                 setError("PlanetsList.error.planetDeleteFailed", getPlanetid());
                 return LIST;
             }
             
-            // delete succeeded, handle rest of request as usual
-            setSuccess("PlanetsList.message.planetDeleteSucceeded", getPlanetid());
-            return execute();
         } else {
             setError("PlanetsList.error.planetNull");
             return execute();

Modified: incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/admin/struts2/package.properties
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/admin/struts2/package.properties?view=diff&rev=510734&r1=510733&r2=510734
==============================================================================
--- incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/admin/struts2/package.properties
(original)
+++ incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/admin/struts2/package.properties
Thu Feb 22 16:43:37 2007
@@ -46,7 +46,7 @@
 You can set the title, handle for each planet.
 
 PlanetForm.handle=Handle
-PlanetForm.title=Name
+PlanetForm.title=Title
 
 PlanetForm.groupsHeading=Groups in this planet
 PlanetForm.groupTitle=Group Title
@@ -60,6 +60,11 @@
 PlanetForm.message.saveSucceeded=Planet saved.
 PlanetForm.message.groupDeleteSucceeded=Group {0} has been deleted.
 
+PlanetForm.error.handleNull=How can you have a planet with no handle?  Try again.
+PlanetForm.error.titleNull=Don't you want a title for your planet?  Try again.
+PlanetForm.error.handleSize=That's a pretty long handle you chose.  We only allow handles
to be at most 32 characters.
+PlanetForm.error.titleSize=That's a pretty long title you chose.  We only allow titles to
be at most 255 characters.
+
 PlanetForm.error.saveFailed=Failed to save planet.
 PlanetForm.error.groupDeleteFailed=Failed to delete group {0}.
 PlanetForm.error.planetNull=Operation failed, planet was null
@@ -72,7 +77,7 @@
 PlanetGroupForm.heading=Edit Group
 PlanetGroupForm.returnToPlanet=Return to planet
 PlanetGroupForm.help=\
-You can set the title, handle, descrption and list of feeds for each group. \
+You can set the title, handle, description and list of feeds for each group. \
 What's a group? \
 A group is a collection of RSS or Atom feed subscriptions that will be aggregated together
to form a Planet. \
 The GeneratePlanetTask program (runs every hour or so) will generate a set of HTML, OPML
and RSS files for each group you define.
@@ -94,6 +99,16 @@
 PlanetGroupForm.message.saveSucceeded=Group saved.
 PlanetGroupForm.message.subscriptionDeleteSucceeded=Subscription {0} has been deleted.
 
+PlanetGroupForm.error.handleNull=How can you have a group with no handle?  Try again.
+PlanetGroupForm.error.handleSize=That's a pretty long handle you chose.  We only allow handles
to be at most 32 characters.
+PlanetGroupForm.error.titleNull=Don't you want a title for your group?  Try again.
+PlanetGroupForm.error.titleSize=That's a pretty long title you chose.  We only allow titles
to be at most 255 characters.
+PlanetGroupForm.error.descriptionSize=That's a pretty long description.  We only allow descriptions
to be at most 255 characters.
+PlanetGroupForm.error.maxPageEntriesNull=How can we display your group if we don't know how
many entries to show?
+PlanetGroupForm.error.maxPageEntriesInt=Don't try to be cheeky, you know we need a number
here.
+PlanetGroupForm.error.maxFeedEntriesNull=How can we offer your group feed if we don't know
how many entries to include?
+PlanetGroupForm.error.maxFeedEntriesInt=Don't try to be cheeky, you know we need a number
here.
+
 PlanetGroupForm.error.saveFailed=Failed to save group.
 PlanetGroupForm.error.subscriptionDeleteFailed=Failed to delete subscription {0}.
 PlanetGroupForm.error.subscriptionNull=Operation failed, subscription was null.
@@ -114,6 +129,14 @@
 PlanetSubscriptionForm.addSubscription=Add another subscription
 
 PlanetSubscriptionForm.message.saveSucceeded=Subscription saved.
+
+PlanetSubscriptionForm.error.titleNull=Don't you want a title for your subscription?
+PlanetSubscriptionForm.error.titleSize=That's a pretty long title you chose.  We only allow
titles to be at most 255 characters.
+PlanetSubscriptionForm.error.feedURLNull=How could we possibly subscribe without a feed url?
+PlanetSubscriptionForm.error.feedURLValid=Hmm, our url validator says you entered a non compliant
url.  Want to double check it?
+PlanetSubscriptionForm.error.feedURLSize=That's a pretty long feed url.  We only allow feed
urls to be at most 255 characters.
+PlanetSubscriptionForm.error.siteURLValid=Hmm, our url validator says you entered a non compliant
url.  Want to double check it?
+PlanetSubscriptionForm.error.siteURLSize=That's a pretty long site url.  We only allow site
urls to be at most 255 characters.
 
 PlanetSubscriptionForm.error.saveFailed=Failed to save subscription.
 PlanetSubscriptionForm.error.groupNull=Operation failed, group was null.

Modified: incubator/roller/trunk/apps/planet/src/sql/createdb.vm
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/apps/planet/src/sql/createdb.vm?view=diff&rev=510734&r1=510733&r2=510734
==============================================================================
--- incubator/roller/trunk/apps/planet/src/sql/createdb.vm (original)
+++ incubator/roller/trunk/apps/planet/src/sql/createdb.vm Thu Feb 22 16:43:37 2007
@@ -17,29 +17,29 @@
 
 create table rag_planet (
     id              varchar(48) not null primary key,
-    name            varchar(255) not null,
+    title           varchar(255) not null,
     handle          varchar(32) not null
 );
-create index ragp_handle_idx on rag_planet(handle);
+alter table rag_planet add constraint ragp_handle_uq unique ( handle );
 
 
 create table rag_group (
     id               varchar(48) not null primary key,
-    handle           varchar(255) not null,
+    planet_id        varchar(48),
+    handle           varchar(32) not null,
     title            varchar(255) not null,
     description      varchar(255),
-    cat_restriction  $db.TEXT_SQL_TYPE,
-    group_page       varchar(255),
     max_page_entries integer default 30,
     max_feed_entries integer default 30,
-    planet_id        varchar(48)
+    cat_restriction  $db.TEXT_SQL_TYPE,
+    group_page       varchar(255)
 );
-alter table rag_group add constraint ragg_handle_uq unique ( handle$!db.INDEXSIZE );
+alter table rag_group add constraint ragg_handle_uq unique ( planet_id, handle );
 
 
 create table rag_subscription (
     id               varchar(48) not null primary key,
-    title            varchar(255),
+    title            varchar(255) not null,
     feed_url         varchar(255) not null,
     site_url         varchar(255),
     author           varchar(255),

Modified: incubator/roller/trunk/apps/planet/test/java/org/apache/roller/planet/business/PlanetManagerTest.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/apps/planet/test/java/org/apache/roller/planet/business/PlanetManagerTest.java?view=diff&rev=510734&r1=510733&r2=510734
==============================================================================
--- incubator/roller/trunk/apps/planet/test/java/org/apache/roller/planet/business/PlanetManagerTest.java
(original)
+++ incubator/roller/trunk/apps/planet/test/java/org/apache/roller/planet/business/PlanetManagerTest.java
Thu Feb 22 16:43:37 2007
@@ -50,10 +50,12 @@
         
         {   // save subscriptions and a group
             PlanetSubscriptionData sub = new PlanetSubscriptionData();
+            sub.setTitle("test_url");
             sub.setFeedURL("test_url");
             planet.saveSubscription(sub);
             
             PlanetSubscriptionData sub1 = new PlanetSubscriptionData();
+            sub1.setTitle("test_url1");
             sub1.setFeedURL("test_url1");
             planet.saveSubscription(sub1);   
             
@@ -122,6 +124,7 @@
         
         {   // save subscription
             PlanetSubscriptionData sub = new PlanetSubscriptionData();
+            sub.setTitle("test_url");
             sub.setFeedURL("test_url");
             planet.saveSubscription(sub);
             TestUtils.endSession(true);
@@ -214,6 +217,7 @@
             planet.saveGroup(group);
             
             PlanetSubscriptionData sub = new PlanetSubscriptionData();
+            sub.setTitle(feed_url1);
             sub.setFeedURL(feed_url1);
             planet.saveSubscription(sub);
             
@@ -259,10 +263,12 @@
                 planet.saveGroup(group);
                 
                 PlanetSubscriptionData sub1 = new PlanetSubscriptionData();
+                sub1.setTitle(feed_url1);
                 sub1.setFeedURL(feed_url1);
                 planet.saveSubscription(sub1);
                 
                 PlanetSubscriptionData sub2 = new PlanetSubscriptionData();
+                sub2.setTitle(feed_url2);
                 sub2.setFeedURL(feed_url2);
                 planet.saveSubscription(sub2);
                 
@@ -318,9 +324,11 @@
             
             {
                 PlanetSubscriptionData sub1 = new PlanetSubscriptionData();
+                sub1.setTitle(feed_url1);
                 sub1.setFeedURL(feed_url1);
                 planet.saveSubscription(sub1);
                 PlanetSubscriptionData sub2 = new PlanetSubscriptionData();
+                sub2.setTitle(feed_url2);
                 sub2.setFeedURL(feed_url2);
                 planet.saveSubscription(sub2);
                 TestUtils.endSession(true);

Modified: incubator/roller/trunk/apps/planet/test/java/org/apache/roller/planet/business/PlanetTest.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/apps/planet/test/java/org/apache/roller/planet/business/PlanetTest.java?view=diff&rev=510734&r1=510733&r2=510734
==============================================================================
--- incubator/roller/trunk/apps/planet/test/java/org/apache/roller/planet/business/PlanetTest.java
(original)
+++ incubator/roller/trunk/apps/planet/test/java/org/apache/roller/planet/business/PlanetTest.java
Thu Feb 22 16:43:37 2007
@@ -52,7 +52,7 @@
         assertEquals("testPlanet", planet.getHandle());
         
         // modify
-        planet.setName("foo");
+        planet.setTitle("foo");
         mgr.savePlanet(planet);
         TestUtils.endSession(true);
         
@@ -60,7 +60,7 @@
         planet = null;
         planet = mgr.getPlanetById(testPlanet.getId());
         assertNotNull(planet);
-        assertEquals("foo", planet.getName());
+        assertEquals("foo", planet.getTitle());
         
         // remove
         mgr.deletePlanet(planet);

Modified: incubator/roller/trunk/apps/planet/web/WEB-INF/jsps/admin/PlanetForm.jsp
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/apps/planet/web/WEB-INF/jsps/admin/PlanetForm.jsp?view=diff&rev=510734&r1=510733&r2=510734
==============================================================================
--- incubator/roller/trunk/apps/planet/web/WEB-INF/jsps/admin/PlanetForm.jsp (original)
+++ incubator/roller/trunk/apps/planet/web/WEB-INF/jsps/admin/PlanetForm.jsp Thu Feb 22 16:43:37
2007
@@ -49,7 +49,7 @@
             <s:form name="PlanetForm" action="%{action}">
                 <s:hidden name="planetid" />
                 <s:textfield label="%{getText('PlanetForm.handle')}" name="planet.handle"
size="40" />
-                <s:textfield label="%{getText('PlanetForm.title')}" name="planet.name"
size="40" />
+                <s:textfield label="%{getText('PlanetForm.title')}" name="planet.title"
size="40" />
                 <s:submit />
             </s:form>
             

Modified: incubator/roller/trunk/apps/planet/web/WEB-INF/jsps/admin/PlanetsList.jsp
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/apps/planet/web/WEB-INF/jsps/admin/PlanetsList.jsp?view=diff&rev=510734&r1=510733&r2=510734
==============================================================================
--- incubator/roller/trunk/apps/planet/web/WEB-INF/jsps/admin/PlanetsList.jsp (original)
+++ incubator/roller/trunk/apps/planet/web/WEB-INF/jsps/admin/PlanetsList.jsp Thu Feb 22 16:43:37
2007
@@ -43,6 +43,8 @@
             <%-- show a status message if needed --%>
             <%@include file="/WEB-INF/jsps/admin/statusMessage.jsp" %>
             
+            <p/>
+            
             <table class="data">
                 <tr>
                     <th><s:text name="PlanetsList.planetTitle" /></th>
@@ -58,7 +60,7 @@
                         <s:param name="planetid"><s:property value="id"/></s:param>
                     </s:url>
                     <tr class='<s:if test="#status.even">evenRow</s:if><s:else>oddRow</s:else>'>
-                        <td><s:a href="%{editPlanetUrl}"><s:property value="name"/></s:a></td>
+                        <td><s:a href="%{editPlanetUrl}"><s:property value="title"/></s:a></td>
                         <td><s:property value="handle"/></td>
                         <td><img src='<s:url value="/planet-ui/images/world_link.png"/>'
/><a href='<s:url value="/%{handle}" />'><s:text name="PlanetsList.link"
/></a></td>
                         <td><img src='<s:url value="/planet-ui/images/delete.png"/>'
/><a href="javascript: void(0);" onclick="confirmPlanetDelete('<s:property value="id"/>',
'<s:property value="handle"/>');"><s:text name="PlanetsList.deletePlanet"/></a></td>

Modified: incubator/roller/trunk/apps/planet/web/planet-ui/css/planet.css
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/apps/planet/web/planet-ui/css/planet.css?view=diff&rev=510734&r1=510733&r2=510734
==============================================================================
--- incubator/roller/trunk/apps/planet/web/planet-ui/css/planet.css (original)
+++ incubator/roller/trunk/apps/planet/web/planet-ui/css/planet.css Thu Feb 22 16:43:37 2007
@@ -49,6 +49,11 @@
     padding: 4px;
 }
 
+.errorMessage {
+    color: red;
+    font-weight: bold;
+}
+
 .success  { 
     border: 1px green  solid; 
     background: #AAFFAA;



Mime
View raw message