roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agillil...@apache.org
Subject svn commit: r514033 - in /incubator/roller/trunk/apps/planet: src/java/org/apache/roller/planet/pojos/ src/java/org/apache/roller/planet/ui/admin/struts2/ src/java/org/apache/roller/planet/ui/rendering/ src/java/org/apache/roller/planet/ui/rendering/mo...
Date Sat, 03 Mar 2007 00:42:57 GMT
Author: agilliland
Date: Fri Mar  2 16:42:55 2007
New Revision: 514033

URL: http://svn.apache.org/viewvc?view=rev&rev=514033
Log:
Lots of little cleanup items for Planet app ...

1. added a 'description' attribute for Planet object because just a title wasn't cutting it.

2. fixed up some redundancy happening in rendering models package and eliminated all traces of unnecessary code, including the use of the original http request in any Models.

3. updated url handling to be a bit more complete and allow for a planet homepage which is controlled via the planet.vm template.

4. changed the way the homepage is rendered by creating a HomepageServlet and having it use a home.vm template for rendering.



Added:
    incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/model/PlanetURLModel.java
    incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/model/SiteModel.java
    incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/model/SiteURLModel.java
    incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/servlets/HomepageServlet.java
    incubator/roller/trunk/apps/planet/web/WEB-INF/velocity/home.vm
    incubator/roller/trunk/apps/planet/web/WEB-INF/velocity/planet.vm
Removed:
    incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/model/URLModel.java
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-PlanetForm!save-validation.xml
    incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/admin/struts2/package.properties
    incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/MultiPlanetRequestMapper.java
    incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/model/FeedModel.java
    incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/model/PageModel.java
    incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/model/PlanetGroupModel.java
    incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/model/UtilitiesModel.java
    incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/servlets/FeedServlet.java
    incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/servlets/OpmlServlet.java
    incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/servlets/PageServlet.java
    incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/util/PlanetGroupPageRequest.java
    incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/util/PlanetGroupRequest.java
    incubator/roller/trunk/apps/planet/src/sql/createdb.vm
    incubator/roller/trunk/apps/planet/web/WEB-INF/classes/log4j.properties
    incubator/roller/trunk/apps/planet/web/WEB-INF/classes/planet.properties
    incubator/roller/trunk/apps/planet/web/WEB-INF/jsps/admin/PlanetForm.jsp
    incubator/roller/trunk/apps/planet/web/WEB-INF/jsps/admin/PlanetGroupForm.jsp
    incubator/roller/trunk/apps/planet/web/WEB-INF/jsps/admin/PlanetsList.jsp
    incubator/roller/trunk/apps/planet/web/WEB-INF/velocity/group.vm
    incubator/roller/trunk/apps/planet/web/WEB-INF/web.xml
    incubator/roller/trunk/apps/planet/web/index.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=514033&r1=514032&r2=514033
==============================================================================
--- 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 Fri Mar  2 16:42:55 2007
@@ -30,8 +30,9 @@
 public class PlanetData {
     
     private String id = null;
-    private String title = null;
     private String handle = null;
+    private String title = null;
+    private String description = null;
     private Set groups = new HashSet();
     
     
@@ -57,6 +58,17 @@
     }
 
     /**
+     * @hibernate.property column="handle" non-null="true" unique="true"
+     */
+    public String getHandle() {
+        return handle;
+    }
+
+    public void setHandle(String handle) {
+        this.handle = handle;
+    }
+    
+    /**
      * @hibernate.property column="title" non-null="true" unique="false"
      */
     public String getTitle() {
@@ -68,16 +80,16 @@
     }
 
     /**
-     * @hibernate.property column="handle" non-null="true" unique="true"
+     * @hibernate.property column="description" non-null="false" unique="false"
      */
-    public String getHandle() {
-        return handle;
+    public String getDescription() {
+        return description;
     }
 
-    public void setHandle(String handle) {
-        this.handle = handle;
+    public void setDescription(String description) {
+        this.description = description;
     }
-
+    
     /** 
      * @hibernate.set lazy="true" invert="true" cascade="all"
      * @hibernate.collection-key column="planet_id"

Modified: 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=diff&rev=514033&r1=514032&r2=514033
==============================================================================
--- incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/admin/struts2/PlanetForm-PlanetForm!save-validation.xml (original)
+++ incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/admin/struts2/PlanetForm-PlanetForm!save-validation.xml Fri Mar  2 16:42:55 2007
@@ -35,4 +35,15 @@
             <message key="PlanetForm.error.titleSize">title must be less than 255 characters</message>
         </field-validator>
     </field>
+    
+    <!-- validate the planet description field -->
+    <field name="planet.description">
+        
+        <!-- description has a max size -->
+        <field-validator type="stringlength">
+            <param name="maxLength">255</param>
+            <param name="trim">true</param>
+            <message key="PlanetForm.error.descriptionSize">description must be less than 255 characters</message>
+        </field-validator>
+    </field>
 </validators>

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=514033&r1=514032&r2=514033
==============================================================================
--- 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 Fri Mar  2 16:42:55 2007
@@ -47,6 +47,7 @@
 
 PlanetForm.handle=Handle
 PlanetForm.title=Title
+PlanetForm.description=Description
 
 PlanetForm.groupsHeading=Groups in this planet
 PlanetForm.groupTitle=Group Title
@@ -64,6 +65,7 @@
 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.descriptionSize=That's a pretty long description you chose.  We only allow descriptions to be at most 255 characters.
 
 PlanetForm.error.saveFailed=Failed to save planet.
 PlanetForm.error.groupDeleteFailed=Failed to delete group {0}.

Modified: incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/MultiPlanetRequestMapper.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/MultiPlanetRequestMapper.java?view=diff&rev=514033&r1=514032&r2=514033
==============================================================================
--- incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/MultiPlanetRequestMapper.java (original)
+++ incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/MultiPlanetRequestMapper.java Fri Mar  2 16:42:55 2007
@@ -35,7 +35,7 @@
 
 
 /**
- * Planets's multi-planet request mapper.
+ * Multi-planet request mapper.
  *
  * This request mapper is used to map all planet specific urls of the form
  * /<planet handle>/* to the appropriate servlet for handling the actual
@@ -153,10 +153,12 @@
         // special handling for trailing slash issue
         // we need this because by http standards the urls /foo and /foo/ are
         // supposed to be considered different, so we must enforce that
-        if(planetContext == null && !trailingSlash) {
-            // this means someone referred to a planet index page with the 
-            // shortest form of url /<planet> and we need to do a redirect 
-            // to /<planet>/
+        if( (planetContext == null && !trailingSlash) ||
+            (groupHandle != null && groupContext == null && !trailingSlash) ) {
+            
+            // this means someone referred to a planet or group index page 
+            // with the shortest form of url /<planet> or /<planet>/group/<group>
+            // and we need to add a slash to the url and redirect
             String redirectUrl = request.getRequestURI() + "/";
             if(request.getQueryString() != null) {
                 redirectUrl += "?"+request.getQueryString();
@@ -165,6 +167,12 @@
             response.sendRedirect(redirectUrl);
             return true;
             
+        } else if(groupContext != null && trailingSlash) {
+            // this means that someone has accessed a url and included a 
+            // trailing slash, like /<planet>/group/<group>/feed/atom/ which is
+            // not supported, so we need to offer up a 404 Not Found
+            response.sendError(HttpServletResponse.SC_NOT_FOUND);
+            return true;
         }
         
         // calculate forward url

Modified: incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/model/FeedModel.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/model/FeedModel.java?view=diff&rev=514033&r1=514032&r2=514033
==============================================================================
--- incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/model/FeedModel.java (original)
+++ incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/model/FeedModel.java Fri Mar  2 16:42:55 2007
@@ -34,21 +34,20 @@
 /**
  * Model which provides information needed to render a planet feed.
  */
-public class FeedModel implements Model {
+public class FeedModel extends PlanetGroupModel {
     
     private static Log log = LogFactory.getLog(FeedModel.class);
     
     private PlanetGroupFeedRequest feedRequest = null;
-    private Map requestParameters = null;
-    private PlanetData planet = null;
-    private PlanetGroupData group = null;
     
     
     /** 
      * Creates an un-initialized new instance, Roller calls init() to complete
      * construction. 
      */
-    public FeedModel() {}
+    public FeedModel() {
+        super();
+    }
     
     
     /** 
@@ -64,6 +63,9 @@
      */
     public void init(Map initData) throws RollerException {
         
+        // parent gets to go first
+        super.init(initData);
+        
         // we expect the init data to contain a weblogRequest object
         PlanetRequest planetRequest = (PlanetRequest) initData.get("planetRequest");
         if(planetRequest == null) {
@@ -78,37 +80,12 @@
             throw new RollerException("weblogRequest is not a WeblogPageRequest."+
                     "  PageModel only supports page requests.");
         }
-        
-        // custom request parameters
-        this.requestParameters = (Map)initData.get("requestParameters");
-        
-        // extract planet object
-        planet = feedRequest.getPlanet();
-        
-        // extract weblog object
-        group = feedRequest.getGroup();
-    }
-    
-    
-    /**
-     * Get planet being displayed.
-     */
-    public PlanetData getPlanet() {
-        return planet;
-    }
-    
-    
-    /**
-     * Get group being displayed.
-     */
-    public PlanetGroupData getGroup() {
-        return group;
     }
     
     
     public Pager getPager() {
         
-        String pagerUrl = URLUtilities.getPlanetGroupURL(planet.getHandle(), feedRequest.getGroupHandle());
+        String pagerUrl = URLUtilities.getPlanetGroupURL(getPlanet().getHandle(), feedRequest.getGroupHandle());
         
         return new PlanetEntriesPager(
                 null,
@@ -117,18 +94,6 @@
                 0,
                 0,
                 30);
-    }
-    
-    
-    /**
-     * Get request parameter by name.
-     */
-    public String getRequestParameter(String paramName) {
-        String[] values = (String[])requestParameters.get(paramName);
-        if (values != null && values.length > 0) {
-            return values[0];
-        }
-        return null;
     }
     
 }

Modified: incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/model/PageModel.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/model/PageModel.java?view=diff&rev=514033&r1=514032&r2=514033
==============================================================================
--- incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/model/PageModel.java (original)
+++ incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/model/PageModel.java Fri Mar  2 16:42:55 2007
@@ -32,23 +32,21 @@
 
 
 /**
- * Model which provides information needed to render a weblog page.
+ * Model which provides information needed to render a planet page.
  */
-public class PageModel implements Model {
+public class PageModel extends PlanetGroupModel {
     
     private static Log log = LogFactory.getLog(PageModel.class);
     
     private PlanetGroupPageRequest pageRequest = null;
-    private Map requestParameters = null;
-    private PlanetData planet = null;
-    private PlanetGroupData group = null;
     
     
     /** 
-     * Creates an un-initialized new instance, Roller calls init() to complete
-     * construction. 
+     * Creates an un-initialized new instance.
      */
-    public PageModel() {}
+    public PageModel() {
+        super();
+    }
     
     
     /** 
@@ -64,6 +62,9 @@
      */
     public void init(Map initData) throws RollerException {
         
+        // parent gets to go first
+        super.init(initData);
+        
         // we expect the init data to contain a weblogRequest object
         PlanetRequest planetRequest = (PlanetRequest) initData.get("planetRequest");
         if(planetRequest == null) {
@@ -78,37 +79,12 @@
             throw new RollerException("weblogRequest is not a WeblogPageRequest."+
                     "  PageModel only supports page requests.");
         }
-        
-        // custom request parameters
-        this.requestParameters = (Map)initData.get("requestParameters");
-        
-        // extract planet object
-        planet = pageRequest.getPlanet();
-        
-        // extract group object
-        group = pageRequest.getGroup();
-    }
-    
-    
-    /**
-     * Get planet being displayed.
-     */
-    public PlanetData getPlanet() {
-        return planet;
-    }
-    
-    
-    /**
-     * Get group being displayed.
-     */
-    public PlanetGroupData getGroup() {
-        return group;
     }
     
     
     public Pager getPager() {
         
-        String pagerUrl = URLUtilities.getPlanetGroupURL(planet.getHandle(), pageRequest.getGroupHandle());
+        String pagerUrl = URLUtilities.getPlanetGroupURL(getPlanet().getHandle(), pageRequest.getGroupHandle());
         
         return new PlanetEntriesPager(
                 null,
@@ -117,18 +93,6 @@
                 0,
                 0,
                 30);
-    }
-    
-    
-    /**
-     * Get request parameter by name.
-     */
-    public String getRequestParameter(String paramName) {
-        String[] values = (String[])requestParameters.get(paramName);
-        if (values != null && values.length > 0) {
-            return values[0];
-        }
-        return null;
     }
     
 }

Modified: incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/model/PlanetGroupModel.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/model/PlanetGroupModel.java?view=diff&rev=514033&r1=514032&r2=514033
==============================================================================
--- incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/model/PlanetGroupModel.java (original)
+++ incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/model/PlanetGroupModel.java Fri Mar  2 16:42:55 2007
@@ -29,14 +29,13 @@
 
 
 /**
- * Model which provides information needed to render a weblog page.
+ * Model which provides information common to a planet group request
  */
 public class PlanetGroupModel implements Model {
     
     private static Log log = LogFactory.getLog(PlanetGroupModel.class);
     
     private PlanetGroupRequest planetGroupRequest = null;
-    private Map requestParameters = null;
     private PlanetData planet = null;
     private PlanetGroupData group = null;
     
@@ -61,24 +60,21 @@
      */
     public void init(Map initData) throws RollerException {
         
-        // we expect the init data to contain a weblogRequest object
+        // we expect the init data to contain a planetRequest object
         PlanetRequest planetRequest = (PlanetRequest) initData.get("planetRequest");
         if(planetRequest == null) {
             throw new RollerException("expected planetRequest from init data");
         }
         
-        // PageModel only works on page requests, so cast planetRequest
-        // into a PlanetRequest and if it fails then throw exception
+        // only works on planet group requests, so cast planetRequest
+        // into a PlanetGroupRequest and if it fails then throw exception
         if(planetRequest instanceof PlanetGroupRequest) {
             this.planetGroupRequest = (PlanetGroupRequest) planetRequest;
         } else {
-            throw new RollerException("weblogRequest is not a WeblogPageRequest."+
-                    "  PageModel only supports page requests.");
+            throw new RollerException("planetRequest is not a PlanetGroupRequest."+
+                    "  PlanetGroupModel only supports planet group requests.");
         }
         
-        // custom request parameters
-        this.requestParameters = (Map)initData.get("requestParameters");
-        
         // extract planet object
         planet = planetGroupRequest.getPlanet();
         
@@ -100,18 +96,6 @@
      */
     public PlanetGroupData getGroup() {
         return group;
-    }
-    
-    
-    /**
-     * Get request parameter by name.
-     */
-    public String getRequestParameter(String paramName) {
-        String[] values = (String[])requestParameters.get(paramName);
-        if (values != null && values.length > 0) {
-            return values[0];
-        }
-        return null;
     }
     
 }

Added: incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/model/PlanetURLModel.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/model/PlanetURLModel.java?view=auto&rev=514033
==============================================================================
--- incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/model/PlanetURLModel.java (added)
+++ incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/model/PlanetURLModel.java Fri Mar  2 16:42:55 2007
@@ -0,0 +1,117 @@
+/*
+ * 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.rendering.model;
+
+import java.util.Map;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.roller.RollerException;
+import org.apache.roller.planet.business.PlanetFactory;
+import org.apache.roller.planet.business.URLStrategy;
+import org.apache.roller.planet.config.PlanetRuntimeConfig;
+import org.apache.roller.planet.pojos.PlanetData;
+import org.apache.roller.planet.ui.rendering.util.PlanetRequest;
+
+
+/**
+ * Provides access to URL building functionality.
+ *
+ * NOTE: we purposely go against the standard getter/setter bean standard
+ * for methods that take arguments so that users get a consistent way to
+ * access those methods in their templates. i.e.
+ *
+ * $url.category("foo")
+ *
+ * instead of
+ *
+ * $url.getCategory("foo")
+ */
+public class PlanetURLModel implements Model {
+    
+    private static Log log = LogFactory.getLog(PlanetURLModel.class);
+    
+    private URLStrategy urlStrategy = null;
+    private PlanetData planet = null;
+    
+    
+    public PlanetURLModel() {}
+    
+    public String getModelName() {
+        return "url";
+    }
+    
+    public void init(Map initData) throws RollerException {
+        
+        // grab a reference to the url strategy
+        this.urlStrategy = PlanetFactory.getPlanet().getURLStrategy();
+        
+        // need a weblog request so that we can know the weblog and locale
+        PlanetRequest planetRequest = (PlanetRequest) initData.get("planetRequest");
+        if(planetRequest == null) {
+            throw new RollerException("Expected 'planetRequest' init param!");
+        }
+        
+        this.planet = planetRequest.getPlanet();
+    }
+    
+    
+    public String getSite() {
+        return PlanetRuntimeConfig.getProperty("site.absoluteurl");
+    }
+    
+        
+    public String getHome() {
+        return urlStrategy.getPlanetURL(planet.getHandle());
+    }
+    
+    
+    public String group(String groupHandle) {
+        return urlStrategy.getPlanetGroupURL(planet.getHandle(), groupHandle, -1);
+    }
+    
+    
+    public String group(String groupHandle, int pageNum) {
+        return urlStrategy.getPlanetGroupURL(planet.getHandle(), groupHandle, pageNum);
+    }
+    
+    
+    public FeedURLS getFeed() {
+        return new FeedURLS();
+    }
+    
+    
+    public String opml(String groupHandle) {
+        return urlStrategy.getPlanetGroupOpmlURL(planet.getHandle(), groupHandle);
+    }
+    
+    
+    ///////  Inner Classes  ///////
+    
+    public class FeedURLS {
+        
+        public String rss(String groupHandle) {
+            return urlStrategy.getPlanetGroupFeedURL(planet.getHandle(), groupHandle, "rss");
+        }
+        
+        public String atom(String groupHandle) {
+            return urlStrategy.getPlanetGroupFeedURL(planet.getHandle(), groupHandle, "atom");
+        }
+    }
+    
+}

Added: incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/model/SiteModel.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/model/SiteModel.java?view=auto&rev=514033
==============================================================================
--- incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/model/SiteModel.java (added)
+++ incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/model/SiteModel.java Fri Mar  2 16:42:55 2007
@@ -0,0 +1,85 @@
+/*
+ * 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.rendering.model; 
+
+import java.util.List;
+import java.util.Map;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.roller.RollerException;
+import org.apache.roller.planet.business.PlanetFactory;
+import org.apache.roller.planet.business.PlanetManager;
+import org.apache.roller.planet.config.PlanetRuntimeConfig;
+
+
+/**
+ * Model which provides information on an application wide scope.
+ */
+public class SiteModel implements Model {
+    
+    private static Log log = LogFactory.getLog(SiteModel.class);
+    
+    
+    /** 
+     * Creates an un-initialized new instance.
+     */
+    public SiteModel() {}
+    
+    
+    /** 
+     * Template context name to be used for model.
+     */
+    public String getModelName() {
+        return "site";
+    }
+    
+    
+    /** 
+     * Init page model based on request. 
+     */
+    public void init(Map initData) throws RollerException {
+        // no-op
+    }
+    
+    
+    public String getTitle() {
+        return PlanetRuntimeConfig.getProperty("site.name");
+    }
+    
+    
+    public String getDescription() {
+        return PlanetRuntimeConfig.getProperty("site.description");
+    }
+    
+    
+    /**
+     * Get the list of all planets.
+     */
+    public List getPlanets() {
+        PlanetManager pMgr = PlanetFactory.getPlanet().getPlanetManager();
+        try {
+            return pMgr.getPlanets();
+        } catch(Exception e) {
+            log.error("Error getting planets list", e);
+        }
+        
+        return null;
+    }
+    
+}

Added: incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/model/SiteURLModel.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/model/SiteURLModel.java?view=auto&rev=514033
==============================================================================
--- incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/model/SiteURLModel.java (added)
+++ incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/model/SiteURLModel.java Fri Mar  2 16:42:55 2007
@@ -0,0 +1,74 @@
+/*
+ * 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.rendering.model;
+
+import java.util.Map;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.roller.RollerException;
+import org.apache.roller.planet.business.PlanetFactory;
+import org.apache.roller.planet.business.URLStrategy;
+import org.apache.roller.planet.config.PlanetRuntimeConfig;
+import org.apache.roller.planet.pojos.PlanetData;
+import org.apache.roller.planet.ui.rendering.util.PlanetRequest;
+
+
+/**
+ * Provides access to URL building functionality.
+ *
+ * NOTE: we purposely go against the standard getter/setter bean standard
+ * for methods that take arguments so that users get a consistent way to
+ * access those methods in their templates. i.e.
+ *
+ * $url.category("foo")
+ *
+ * instead of
+ *
+ * $url.getCategory("foo")
+ */
+public class SiteURLModel implements Model {
+    
+    private static Log log = LogFactory.getLog(SiteURLModel.class);
+    
+    private URLStrategy urlStrategy = null;
+    
+    
+    public SiteURLModel() {}
+    
+    public String getModelName() {
+        return "url";
+    }
+    
+    public void init(Map initData) throws RollerException {
+        
+        // grab a reference to the url strategy
+        this.urlStrategy = PlanetFactory.getPlanet().getURLStrategy();
+    }
+    
+    
+    public String getSite() {
+        return PlanetRuntimeConfig.getProperty("site.absoluteurl");
+    }
+    
+    
+    public String planet(String planetHandle) {
+        return this.urlStrategy.getPlanetURL(planetHandle);
+    }
+    
+}

Modified: incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/model/UtilitiesModel.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/model/UtilitiesModel.java?view=diff&rev=514033&r1=514032&r2=514033
==============================================================================
--- incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/model/UtilitiesModel.java (original)
+++ incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/model/UtilitiesModel.java Fri Mar  2 16:42:55 2007
@@ -37,6 +37,7 @@
 import org.apache.roller.planet.util.RegexUtil;
 import org.apache.roller.planet.util.Utilities;
 
+
 /**
  * Model which provides access to a set of general utilities.
  */
@@ -87,7 +88,6 @@
     private static final Pattern QUOTE_PATTERN = 
             Pattern.compile("&quot;", Pattern.CASE_INSENSITIVE);
     
-    private HttpServletRequest request = null;
     private TimeZone tz = null;
     
     
@@ -99,9 +99,6 @@
     
     /** Init page model based on request */
     public void init(Map initData) throws RollerException {
-        
-        // extract request object
-        this.request = (HttpServletRequest) initData.get("request");
     }
     
         

Modified: incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/servlets/FeedServlet.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/servlets/FeedServlet.java?view=diff&rev=514033&r1=514032&r2=514033
==============================================================================
--- incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/servlets/FeedServlet.java (original)
+++ incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/servlets/FeedServlet.java Fri Mar  2 16:42:55 2007
@@ -115,7 +115,6 @@
         try {
             // populate the rendering model
             Map initData = new HashMap();
-            initData.put("request", request);
             initData.put("planetRequest", feedRequest);
             
             // Load models for feeds

Added: incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/servlets/HomepageServlet.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/servlets/HomepageServlet.java?view=auto&rev=514033
==============================================================================
--- incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/servlets/HomepageServlet.java (added)
+++ incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/servlets/HomepageServlet.java Fri Mar  2 16:42:55 2007
@@ -0,0 +1,137 @@
+/*
+ * 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.rendering.servlets;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.roller.RollerException;
+import org.apache.roller.planet.config.PlanetConfig;
+import org.apache.roller.planet.pojos.PlanetData;
+import org.apache.roller.planet.pojos.PlanetGroupData;
+import org.apache.roller.planet.pojos.StaticTemplate;
+import org.apache.roller.planet.pojos.Template;
+import org.apache.roller.planet.ui.rendering.Renderer;
+import org.apache.roller.planet.ui.rendering.RendererManager;
+import org.apache.roller.planet.ui.rendering.model.ModelLoader;
+import org.apache.roller.planet.ui.rendering.util.PlanetGroupPageRequest;
+
+
+/**
+ * Responsible for rendering application homepage.
+ */
+public class HomepageServlet extends HttpServlet {
+
+    private static Log log = LogFactory.getLog(HomepageServlet.class);
+
+
+    /**
+     * Init method for this servlet
+     */
+    public void init(ServletConfig servletConfig) throws ServletException {
+
+        super.init(servletConfig);
+
+        log.info("Initializing HomepageServlet");
+    }
+
+
+    /**
+     * Handle GET requests for weblog feeds.
+     */
+    public void doGet(HttpServletRequest request, HttpServletResponse response)
+            throws ServletException, IOException {
+
+        log.debug("Entering");
+
+        // set content type
+        response.setContentType("text/html; charset=utf-8");
+        
+        
+        // initialize model
+        HashMap model = new HashMap();
+        try {
+            // populate the rendering model
+            Map initData = new HashMap();
+            
+            // Load models for pages
+            String models = PlanetConfig.getProperty("rendering.homepageModels");
+            ModelLoader.loadModels(models, model, initData, true);
+
+        } catch (RollerException ex) {
+            log.error("ERROR loading model", ex);
+
+            if(!response.isCommitted()) response.reset();
+            response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+            return;
+        }
+
+
+        // lookup Renderer we are going to use
+        Renderer renderer = null;
+        try {
+            log.debug("Looking up renderer");
+            
+            // what template are we going to render?
+            Template template = new StaticTemplate("home.vm", null, "velocity");
+            
+            // get the Renderer
+            renderer = RendererManager.getRenderer(template);
+            
+        } catch(Exception e) {
+            // nobody wants to render my content :(
+
+            if(!response.isCommitted()) response.reset();
+            response.sendError(HttpServletResponse.SC_NOT_FOUND);
+            return;
+        }
+        
+        
+        // render content
+        try {
+            log.debug("Doing rendering");
+            renderer.render(model, response.getWriter());
+        } catch(Exception e) {
+            // bummer, error during rendering
+            log.error("Error during rendering", e);
+
+            if(!response.isCommitted()) response.reset();
+            response.sendError(HttpServletResponse.SC_NOT_FOUND);
+            return;
+        }
+
+
+        // post rendering process
+
+        // flush rendered content to response
+        log.debug("Flushing response output");
+        //response.setContentLength(rendererOutput.getContent().length);
+        //response.getOutputStream().write(rendererOutput.getContent());
+
+        log.debug("Exiting");
+    }
+
+}

Modified: incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/servlets/OpmlServlet.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/servlets/OpmlServlet.java?view=diff&rev=514033&r1=514032&r2=514033
==============================================================================
--- incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/servlets/OpmlServlet.java (original)
+++ incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/servlets/OpmlServlet.java Fri Mar  2 16:42:55 2007
@@ -103,7 +103,6 @@
         try {
             // populate the rendering model
             Map initData = new HashMap();
-            initData.put("request", request);
             initData.put("planetRequest", opmlRequest);
             
             // Load models for feeds

Modified: incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/servlets/PageServlet.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/servlets/PageServlet.java?view=diff&rev=514033&r1=514032&r2=514033
==============================================================================
--- incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/servlets/PageServlet.java (original)
+++ incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/servlets/PageServlet.java Fri Mar  2 16:42:55 2007
@@ -82,10 +82,6 @@
             }
             
             group = pageRequest.getGroup();
-            if(group == null) {
-                throw new RollerException("unable to lookup group: "+
-                        pageRequest.getGroupHandle());
-            }
 
         } catch(Exception e) {
             // invalid feed request format or weblog doesn't exist
@@ -103,10 +99,9 @@
         try {
             // populate the rendering model
             Map initData = new HashMap();
-            initData.put("request", request);
             initData.put("planetRequest", pageRequest);
             
-            // Load models for feeds
+            // Load models for pages
             String pageModels = PlanetConfig.getProperty("rendering.pageModels");
             ModelLoader.loadModels(pageModels, model, initData, true);
 
@@ -123,8 +118,20 @@
         Renderer renderer = null;
         try {
             log.debug("Looking up renderer");
-            Template template = new StaticTemplate("group.vm", null, "velocity");
+            
+            // what template are we going to render?
+            Template template = null;
+            if(group == null) {
+                // planet homepage
+                template = new StaticTemplate("planet.vm", null, "velocity");
+            } else {
+                // group homepage
+                template = new StaticTemplate("group.vm", null, "velocity");
+            }
+            
+            // get the Renderer
             renderer = RendererManager.getRenderer(template);
+            
         } catch(Exception e) {
             // nobody wants to render my content :(
 
@@ -132,14 +139,15 @@
             response.sendError(HttpServletResponse.SC_NOT_FOUND);
             return;
         }
-
-        // render content.  use default size of about 24K for a standard page
+        
+        
+        // render content
         try {
             log.debug("Doing rendering");
             renderer.render(model, response.getWriter());
         } catch(Exception e) {
             // bummer, error during rendering
-            log.error("Error during rendering for group.vm", e);
+            log.error("Error during rendering", e);
 
             if(!response.isCommitted()) response.reset();
             response.sendError(HttpServletResponse.SC_NOT_FOUND);

Modified: incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/util/PlanetGroupPageRequest.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/util/PlanetGroupPageRequest.java?view=diff&rev=514033&r1=514032&r2=514033
==============================================================================
--- incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/util/PlanetGroupPageRequest.java (original)
+++ incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/util/PlanetGroupPageRequest.java Fri Mar  2 16:42:55 2007
@@ -50,7 +50,7 @@
             throws InvalidRequestException {
         
         // let our parent take care of their business first
-        // parent determines weblog handle and locale if specified
+        // parent determines planet handle
         super(request);
         
         // we only want the path info left over from after our parents parsing

Modified: incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/util/PlanetGroupRequest.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/util/PlanetGroupRequest.java?view=diff&rev=514033&r1=514032&r2=514033
==============================================================================
--- incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/util/PlanetGroupRequest.java (original)
+++ incubator/roller/trunk/apps/planet/src/java/org/apache/roller/planet/ui/rendering/util/PlanetGroupRequest.java Fri Mar  2 16:42:55 2007
@@ -30,7 +30,7 @@
 /**
  * Represents a request to a planet group.
  * 
- * /<planetHandle>/<groupHandle>[/extra/path/info]
+ * /<planetHandle>/group/<groupHandle>[/extra/path/info]
  *
  */
 public class PlanetGroupRequest extends PlanetRequest {
@@ -72,9 +72,6 @@
                 this.pathInfo = urlPath[1];
             }
             
-        } else {
-            throw new InvalidRequestException("invalid feed path info, "+
-                    request.getRequestURL());
         }
         
         if(log.isDebugEnabled()) {

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=514033&r1=514032&r2=514033
==============================================================================
--- incubator/roller/trunk/apps/planet/src/sql/createdb.vm (original)
+++ incubator/roller/trunk/apps/planet/src/sql/createdb.vm Fri Mar  2 16:42:55 2007
@@ -17,8 +17,9 @@
 
 create table rag_planet (
     id              varchar(48) not null primary key,
+    handle          varchar(32) not null,
     title           varchar(255) not null,
-    handle          varchar(32) not null
+    description     varchar(255)
 );
 alter table rag_planet add constraint ragp_handle_uq unique ( handle );
 

Modified: incubator/roller/trunk/apps/planet/web/WEB-INF/classes/log4j.properties
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/apps/planet/web/WEB-INF/classes/log4j.properties?view=diff&rev=514033&r1=514032&r2=514033
==============================================================================
--- incubator/roller/trunk/apps/planet/web/WEB-INF/classes/log4j.properties (original)
+++ incubator/roller/trunk/apps/planet/web/WEB-INF/classes/log4j.properties Fri Mar  2 16:42:55 2007
@@ -16,12 +16,12 @@
 
 # Properties for configuring Log4j for this application
 # This is the configuring for logging displayed in the Application Server
-log4j.rootCategory=INFO, roller
+log4j.rootCategory=INFO, planet
 
-log4j.appender.roller=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.roller.File=${catalina.base}/logs/planet.log
-log4j.appender.roller.layout=org.apache.log4j.PatternLayout
-log4j.appender.roller.layout.ConversionPattern=%-5p %d{yyyy-MM-dd HH:mm:ss,SSS} %C{1}:%M - %m%n
+log4j.appender.planet=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.planet.File=${catalina.base}/logs/planet.log
+log4j.appender.planet.layout=org.apache.log4j.PatternLayout
+log4j.appender.planet.layout.ConversionPattern=%-5p %d{yyyy-MM-dd HH:mm:ss,SSS} %C{1}:%M - %m%n
 
 # Options are: DEBUG, INFO, WARN, ERROR, FATAL
 # Roller code

Modified: incubator/roller/trunk/apps/planet/web/WEB-INF/classes/planet.properties
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/apps/planet/web/WEB-INF/classes/planet.properties?view=diff&rev=514033&r1=514032&r2=514033
==============================================================================
--- incubator/roller/trunk/apps/planet/web/WEB-INF/classes/planet.properties (original)
+++ incubator/roller/trunk/apps/planet/web/WEB-INF/classes/planet.properties Fri Mar  2 16:42:55 2007
@@ -40,25 +40,21 @@
 # properties in this file are accessed like this ...
 #    PlanetConfig.getProperty("propname");
 
-# Business layer implementation to be used
-persistence.planet.classname=\
-org.apache.roller.planet.business.hibernate.HibernatePlanetImpl
-
-# choose a url strategy
-urlstrategy.classname=\
-org.apache.roller.planet.business.MultiPlanetURLStrategy
-
 # You MUST override and set these three properties correctly:
 cache.dir=/var/planet/cache
 output.dir=/usr/local/planet/webapp
 template.dir=/usr/local/planet/webapp/WEB-INF/templates
 
-# Name of control template (in template dir) to be used
-planet.aggregator.mainPage=control.vm
-
 # Number of Technorati queries allowed per day
 planet.aggregator.technorati.limit=500
 
+# Business layer implementation to be used
+persistence.planet.classname=\
+org.apache.roller.planet.business.hibernate.HibernatePlanetImpl
+
+# choose a url strategy
+urlstrategy.classname=\
+org.apache.roller.planet.business.MultiPlanetURLStrategy
 
 # The set of default Roller renderer factories.
 rendering.rollerRendererFactories=\
@@ -80,22 +76,26 @@
 planet-ui,index.jsp,favicon.ico,robots.txt
 
 # Set of user defined protected urls.  These are added to the set above.
-rendering.multiPlanetMapper.userProtectedUrls=\
-images,css
+rendering.multiPlanetMapper.userProtectedUrls=
+
+rendering.homepageModels=\
+org.apache.roller.planet.ui.rendering.model.SiteModel,\
+org.apache.roller.planet.ui.rendering.model.SiteURLModel,\
+org.apache.roller.planet.ui.rendering.model.UtilitiesModel
 
 rendering.pageModels=\
 org.apache.roller.planet.ui.rendering.model.PageModel,\
-org.apache.roller.planet.ui.rendering.model.URLModel,\
+org.apache.roller.planet.ui.rendering.model.PlanetURLModel,\
 org.apache.roller.planet.ui.rendering.model.UtilitiesModel
 
 rendering.feedModels=\
 org.apache.roller.planet.ui.rendering.model.FeedModel,\
-org.apache.roller.planet.ui.rendering.model.URLModel,\
+org.apache.roller.planet.ui.rendering.model.PlanetURLModel,\
 org.apache.roller.planet.ui.rendering.model.UtilitiesModel
 
 rendering.opmlModels=\
 org.apache.roller.planet.ui.rendering.model.PlanetGroupModel,\
-org.apache.roller.planet.ui.rendering.model.URLModel,\
+org.apache.roller.planet.ui.rendering.model.PlanetURLModel,\
 org.apache.roller.planet.ui.rendering.model.UtilitiesModel
 
 # Hibernate dialect: You must override this to use a database other than MySQL4

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=514033&r1=514032&r2=514033
==============================================================================
--- 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 Fri Mar  2 16:42:55 2007
@@ -50,6 +50,7 @@
                 <s:hidden name="planetid" />
                 <s:textfield label="%{getText('PlanetForm.handle')}" name="planet.handle" size="40" />
                 <s:textfield label="%{getText('PlanetForm.title')}" name="planet.title" size="40" />
+                <s:textarea label="%{getText('PlanetForm.description')}" name="planet.description" cols="47" rows="3" />
                 <s:submit />
             </s:form>
             
@@ -60,7 +61,6 @@
                 
                 <table class="data">
                     <tr>
-                        <th><s:text name="PlanetForm.groupHandle" /></th>
                         <th><s:text name="PlanetForm.groupTitle" /></th>
                         <th><s:text name="PlanetForm.groupURL" /></th>
                         <th><s:text name="PlanetForm.action" /></th>
@@ -72,8 +72,7 @@
                         </s:url>
                         <tr class='<s:if test="#status.even">evenRow</s:if><s:else>oddRow</s:else>'>
                             <td><s:a href="%{editgroupurl}"><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="/%{planet.handle}/group/%{handle}" />'><s:text name="PlanetForm.link" /></a></td>
+                            <td><img src='<s:url value="/planet-ui/images/world_link.png"/>' /><a href='<s:url value="/%{planet.handle}/group/%{handle}/" />'><s:text name="PlanetForm.link" /></a></td>
                             <td><img src='<s:url value="/planet-ui/images/delete.png"/>' /><a href="javascript: void(0);" onclick="confirmGroupDelete('<s:property value="id"/>', '<s:property value="handle"/>');"><s:text name="PlanetForm.deleteGroup"/></a></td>
                         </tr>
                     </s:iterator>

Modified: incubator/roller/trunk/apps/planet/web/WEB-INF/jsps/admin/PlanetGroupForm.jsp
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/apps/planet/web/WEB-INF/jsps/admin/PlanetGroupForm.jsp?view=diff&rev=514033&r1=514032&r2=514033
==============================================================================
--- incubator/roller/trunk/apps/planet/web/WEB-INF/jsps/admin/PlanetGroupForm.jsp (original)
+++ incubator/roller/trunk/apps/planet/web/WEB-INF/jsps/admin/PlanetGroupForm.jsp Fri Mar  2 16:42:55 2007
@@ -54,7 +54,7 @@
                 <s:hidden name="groupid" value="%{group.id}" />
                 <s:textfield label="%{getText('PlanetGroupForm.handle')}" name="group.handle" size="40" />
                 <s:textfield label="%{getText('PlanetGroupForm.title')}" name="group.title" size="40" />
-                <s:textfield label="%{getText('PlanetGroupForm.description')}" name="group.description" size="40" />
+                <s:textarea label="%{getText('PlanetGroupForm.description')}" name="group.description" cols="47" rows="3" />
                 <s:textfield label="%{getText('PlanetGroupForm.maxPageEntries')}" name="group.maxPageEntries" size="4" />
                 <s:textfield label="%{getText('PlanetGroupForm.maxFeedEntries')}" name="group.maxFeedEntries" size="4" />
                 <s:submit />

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=514033&r1=514032&r2=514033
==============================================================================
--- 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 Fri Mar  2 16:42:55 2007
@@ -48,7 +48,6 @@
             <table class="data">
                 <tr>
                     <th><s:text name="PlanetsList.planetTitle" /></th>
-                    <th><s:text name="PlanetsList.planetHandle" /></th>
                     <th><s:text name="PlanetsList.planetURL" /></th>
                     <th><s:text name="PlanetsList.action" /></th>
                 </tr>
@@ -61,8 +60,7 @@
                     </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="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/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>
                     </tr>
                 </s:iterator>

Modified: incubator/roller/trunk/apps/planet/web/WEB-INF/velocity/group.vm
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/apps/planet/web/WEB-INF/velocity/group.vm?view=diff&rev=514033&r1=514032&r2=514033
==============================================================================
--- incubator/roller/trunk/apps/planet/web/WEB-INF/velocity/group.vm (original)
+++ incubator/roller/trunk/apps/planet/web/WEB-INF/velocity/group.vm Fri Mar  2 16:42:55 2007
@@ -48,4 +48,7 @@
          #end
       </td>
 </tr>
-</body></html>
+</table>
+
+</body>
+</html>
\ No newline at end of file

Added: incubator/roller/trunk/apps/planet/web/WEB-INF/velocity/home.vm
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/apps/planet/web/WEB-INF/velocity/home.vm?view=auto&rev=514033
==============================================================================
--- incubator/roller/trunk/apps/planet/web/WEB-INF/velocity/home.vm (added)
+++ incubator/roller/trunk/apps/planet/web/WEB-INF/velocity/home.vm Fri Mar  2 16:42:55 2007
@@ -0,0 +1,43 @@
+#**
+  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.
+
+*#
+<html>
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" >
+    <title>$site.title</title>
+  </head>
+  <body>
+
+  <div class="siteHeading">
+    <h1 class="siteTitle">$site.title</h1>
+    <p class="siteDescription">$site.description</p>
+  </div>
+
+  <table class="planetListings">
+    <tr>
+      #foreach($planet in $site.planets)
+      <td class="planet">
+         <h3 class="planetTitle"><a href="$url.planet($planet.handle)">$planet.title</a></h3>
+         <p class="planetDescription">$planet.description</p>
+      </td>
+      #end
+    </tr>
+  </table>
+
+  </body>
+</html>

Added: incubator/roller/trunk/apps/planet/web/WEB-INF/velocity/planet.vm
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/apps/planet/web/WEB-INF/velocity/planet.vm?view=auto&rev=514033
==============================================================================
--- incubator/roller/trunk/apps/planet/web/WEB-INF/velocity/planet.vm (added)
+++ incubator/roller/trunk/apps/planet/web/WEB-INF/velocity/planet.vm Fri Mar  2 16:42:55 2007
@@ -0,0 +1,43 @@
+#**
+  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.
+
+*#
+<html>
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" >
+    <title>$model.planet.title</title>
+  </head>
+  <body>
+
+  <div class="planetHeading">
+    <h1 class="planetTitle">$model.planet.title</h1>
+    <p class="planetDescription">$model.planet.description</p>
+  </div>
+
+  <table class="groupListings">
+    <tr>
+      #foreach($group in $model.planet.groups)
+      <td class="planetGroup">
+         <h3 class="groupTitle"><a href="$url.group($group.handle)">$group.title</a></h3>
+         <p class="groupDescription">$group.description</p>
+      </td>
+      #end
+    </tr>
+  </table>
+
+  </body>
+</html>

Modified: incubator/roller/trunk/apps/planet/web/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/apps/planet/web/WEB-INF/web.xml?view=diff&rev=514033&r1=514032&r2=514033
==============================================================================
--- incubator/roller/trunk/apps/planet/web/WEB-INF/web.xml (original)
+++ incubator/roller/trunk/apps/planet/web/WEB-INF/web.xml Fri Mar  2 16:42:55 2007
@@ -50,16 +50,25 @@
         <dispatcher>FORWARD</dispatcher>
     </filter-mapping>
     
+    
+    <servlet>
+        <servlet-name>HomepageServlet</servlet-name>
+        <servlet-class>org.apache.roller.planet.ui.rendering.servlets.HomepageServlet</servlet-class>
+        <load-on-startup>5</load-on-startup>
+    </servlet>
+    
     <servlet>
         <servlet-name>FeedServlet</servlet-name>
         <servlet-class>org.apache.roller.planet.ui.rendering.servlets.FeedServlet</servlet-class>
         <load-on-startup>5</load-on-startup>
     </servlet>
+    
     <servlet>
         <servlet-name>PageServlet</servlet-name>
         <servlet-class>org.apache.roller.planet.ui.rendering.servlets.PageServlet</servlet-class>
         <load-on-startup>5</load-on-startup>
     </servlet>
+    
     <servlet>
         <servlet-name>OpmlServlet</servlet-name>
         <servlet-class>org.apache.roller.planet.ui.rendering.servlets.OpmlServlet</servlet-class>
@@ -67,6 +76,11 @@
     </servlet>
     
     <servlet-mapping>
+        <servlet-name>HomepageServlet</servlet-name>
+        <url-pattern>/planet-ui/rendering/homepage</url-pattern>
+    </servlet-mapping>
+    
+    <servlet-mapping>
         <servlet-name>FeedServlet</servlet-name>
         <url-pattern>/planet-ui/rendering/feed/*</url-pattern>
     </servlet-mapping>
@@ -81,9 +95,11 @@
         <url-pattern>/planet-ui/rendering/opml/*</url-pattern>
     </servlet-mapping>
     
+    
     <listener>
         <listener-class>org.apache.roller.planet.ui.core.PlanetContext</listener-class>
     </listener>
+    
     
     <resource-ref>
             <res-ref-name>jdbc/rollerdb</res-ref-name>

Modified: incubator/roller/trunk/apps/planet/web/index.jsp
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/apps/planet/web/index.jsp?view=diff&rev=514033&r1=514032&r2=514033
==============================================================================
--- incubator/roller/trunk/apps/planet/web/index.jsp (original)
+++ incubator/roller/trunk/apps/planet/web/index.jsp Fri Mar  2 16:42:55 2007
@@ -15,5 +15,4 @@
   copyright in this work, please see the NOTICE file in the top level
   directory of this distribution.
 --%>
-
-need a homepage
+<jsp:forward page="planet-ui/rendering/homepage" />
\ No newline at end of file

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=514033&r1=514032&r2=514033
==============================================================================
--- incubator/roller/trunk/apps/planet/web/planet-ui/css/planet.css (original)
+++ incubator/roller/trunk/apps/planet/web/planet-ui/css/planet.css Fri Mar  2 16:42:55 2007
@@ -72,6 +72,10 @@
     text-align: right;
 }
 
+td.tdLabel {
+    vertical-align:top;
+}
+
 table.form {
     width: 80%
 }



Mime
View raw message