roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r925653 [1/5] - in /roller/trunk: planet-business/src/test/resources/ planet-web/ planet-web/src/ planet-web/src/main/ planet-web/src/main/java/ planet-web/src/main/java/org/ planet-web/src/main/java/org/apache/ planet-web/src/main/java/org...
Date Sat, 20 Mar 2010 18:37:54 GMT
Author: snoopdave
Date: Sat Mar 20 18:37:51 2010
New Revision: 925653

URL: http://svn.apache.org/viewvc?rev=925653&view=rev
Log:
Adding in the missing planet-web module which went missing during the Mavenization

Added:
    roller/trunk/planet-web/   (with props)
    roller/trunk/planet-web/pom.xml
    roller/trunk/planet-web/src/
    roller/trunk/planet-web/src/main/
    roller/trunk/planet-web/src/main/java/
    roller/trunk/planet-web/src/main/java/org/
    roller/trunk/planet-web/src/main/java/org/apache/
    roller/trunk/planet-web/src/main/java/org/apache/roller/
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/admin/
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/admin/struts2/
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/admin/struts2/ConfigForm.java
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/admin/struts2/PlanetForm-PlanetForm!save-validation.xml
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/admin/struts2/PlanetForm.java
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/admin/struts2/PlanetGroupForm-PlanetGroupForm!save-validation.xml
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/admin/struts2/PlanetGroupForm.java
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/admin/struts2/PlanetSubscriptionForm-PlanetSubscriptionForm!save-validation.xml
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/admin/struts2/PlanetSubscriptionForm.java
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/admin/struts2/PlanetsList.java
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/admin/struts2/package.properties
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/core/
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/core/PlanetContext.java
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/core/filters/
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/core/filters/DebugFilter.java
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/core/filters/PersistenceSessionFilter.java
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/core/struts2/
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/core/struts2/Login.java
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/core/struts2/Logout.java
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/core/struts2/MainMenu.java
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/core/struts2/PlanetActionSupport.java
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/core/struts2/package.properties
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/rendering/
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/rendering/MultiPlanetRequestMapper.java
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/rendering/Renderer.java
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/rendering/RendererFactory.java
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/rendering/RendererManager.java
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/rendering/RenderingException.java
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/rendering/RequestMapper.java
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/rendering/filters/
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/rendering/filters/RequestMappingFilter.java
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/rendering/model/
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/rendering/model/FeedModel.java
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/rendering/model/Model.java
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/rendering/model/ModelLoader.java
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/rendering/model/PageModel.java
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/rendering/model/PlanetGroupModel.java
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/rendering/model/PlanetURLModel.java
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/rendering/model/SiteModel.java
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/rendering/model/SiteURLModel.java
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/rendering/model/UtilitiesModel.java
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/rendering/pagers/
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/rendering/pagers/AbstractPager.java
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/rendering/pagers/Pager.java
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/rendering/pagers/PlanetEntriesPager.java
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/rendering/servlets/
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/rendering/servlets/FeedServlet.java
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/rendering/servlets/HomepageServlet.java
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/rendering/servlets/OpmlServlet.java
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/rendering/servlets/PageServlet.java
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/rendering/util/
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/rendering/util/InvalidRequestException.java
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/rendering/util/ParsedRequest.java
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/rendering/util/PlanetGroupFeedRequest.java
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/rendering/util/PlanetGroupOpmlRequest.java
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/rendering/util/PlanetGroupPageRequest.java
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/rendering/util/PlanetGroupRequest.java
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/rendering/util/PlanetRequest.java
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/rendering/velocity/
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/rendering/velocity/PlanetVelocity.java
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/rendering/velocity/TemplateResourceLoader.java
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/rendering/velocity/VelocityRenderer.java
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/rendering/velocity/VelocityRendererFactory.java
    roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/rendering/velocity/WebappResourceLoader.java
    roller/trunk/planet-web/src/main/java/org/apache/roller/util/
    roller/trunk/planet-web/src/main/java/org/apache/roller/util/OldUtilities.java
    roller/trunk/planet-web/src/main/java/org/apache/roller/util/StandaloneWebappClassLoader.java
    roller/trunk/planet-web/src/main/java/org/apache/roller/util/TaskRunner.java
    roller/trunk/planet-web/src/main/java/org/apache/roller/util/UtilitiesModel.java
    roller/trunk/planet-web/src/main/resources/
    roller/trunk/planet-web/src/main/resources/JPAEMF.properties
    roller/trunk/planet-web/src/main/resources/commons-logging.properties
    roller/trunk/planet-web/src/main/resources/ehcache.xml
    roller/trunk/planet-web/src/main/resources/log4j.properties
    roller/trunk/planet-web/src/main/resources/rome.properties
    roller/trunk/planet-web/src/main/resources/struts.properties
    roller/trunk/planet-web/src/main/resources/struts.xml
    roller/trunk/planet-web/src/main/webapp/
    roller/trunk/planet-web/src/main/webapp/META-INF/
    roller/trunk/planet-web/src/main/webapp/META-INF/context.xml
    roller/trunk/planet-web/src/main/webapp/WEB-INF/
    roller/trunk/planet-web/src/main/webapp/WEB-INF/applicationContext.xml
    roller/trunk/planet-web/src/main/webapp/WEB-INF/jsps/
    roller/trunk/planet-web/src/main/webapp/WEB-INF/jsps/MainMenu.jsp
    roller/trunk/planet-web/src/main/webapp/WEB-INF/jsps/admin/
    roller/trunk/planet-web/src/main/webapp/WEB-INF/jsps/admin/ConfigForm.jsp
    roller/trunk/planet-web/src/main/webapp/WEB-INF/jsps/admin/PlanetForm.jsp
    roller/trunk/planet-web/src/main/webapp/WEB-INF/jsps/admin/PlanetGroupForm.jsp
    roller/trunk/planet-web/src/main/webapp/WEB-INF/jsps/admin/PlanetSubscriptionForm.jsp
    roller/trunk/planet-web/src/main/webapp/WEB-INF/jsps/admin/PlanetsList.jsp
    roller/trunk/planet-web/src/main/webapp/WEB-INF/jsps/admin/menu.jsp
    roller/trunk/planet-web/src/main/webapp/WEB-INF/jsps/admin/statusMessage.jsp
    roller/trunk/planet-web/src/main/webapp/WEB-INF/jsps/login.jsp
    roller/trunk/planet-web/src/main/webapp/WEB-INF/jsps/logout.jsp
    roller/trunk/planet-web/src/main/webapp/WEB-INF/scripts/
    roller/trunk/planet-web/src/main/webapp/WEB-INF/scripts/genplanet.sh
    roller/trunk/planet-web/src/main/webapp/WEB-INF/scripts/planet-custom.properties
    roller/trunk/planet-web/src/main/webapp/WEB-INF/scripts/refreshplanet.sh
    roller/trunk/planet-web/src/main/webapp/WEB-INF/sun-web.xml
    roller/trunk/planet-web/src/main/webapp/WEB-INF/velocity/
    roller/trunk/planet-web/src/main/webapp/WEB-INF/velocity.properties
    roller/trunk/planet-web/src/main/webapp/WEB-INF/velocity/group-atom.vm
    roller/trunk/planet-web/src/main/webapp/WEB-INF/velocity/group-rss.vm
    roller/trunk/planet-web/src/main/webapp/WEB-INF/velocity/group.vm
    roller/trunk/planet-web/src/main/webapp/WEB-INF/velocity/home.vm
    roller/trunk/planet-web/src/main/webapp/WEB-INF/velocity/opml.vm
    roller/trunk/planet-web/src/main/webapp/WEB-INF/velocity/planet.vm
    roller/trunk/planet-web/src/main/webapp/WEB-INF/web.xml
    roller/trunk/planet-web/src/main/webapp/index.jsp
    roller/trunk/planet-web/src/main/webapp/planet-ui/
    roller/trunk/planet-web/src/main/webapp/planet-ui/css/
    roller/trunk/planet-web/src/main/webapp/planet-ui/css/planet.css
    roller/trunk/planet-web/src/main/webapp/planet-ui/images/
    roller/trunk/planet-web/src/main/webapp/planet-ui/images/body-bg-grey.png   (with props)
    roller/trunk/planet-web/src/main/webapp/planet-ui/images/delete.png   (with props)
    roller/trunk/planet-web/src/main/webapp/planet-ui/images/feed_add.png   (with props)
    roller/trunk/planet-web/src/main/webapp/planet-ui/images/feed_link.png   (with props)
    roller/trunk/planet-web/src/main/webapp/planet-ui/images/folder_add.png   (with props)
    roller/trunk/planet-web/src/main/webapp/planet-ui/images/folder_feed.png   (with props)
    roller/trunk/planet-web/src/main/webapp/planet-ui/images/page_white_world.png   (with props)
    roller/trunk/planet-web/src/main/webapp/planet-ui/images/th-bg-grey.png   (with props)
    roller/trunk/planet-web/src/main/webapp/planet-ui/images/world_link.png   (with props)
    roller/trunk/planet-web/src/main/webapp/planet-ui/index.jsp
    roller/trunk/planet-web/src/test/
    roller/trunk/planet-web/src/test/resources/
    roller/trunk/planet-web/src/test/resources/jetty.xml
    roller/trunk/planet-web/src/test/resources/planet-custom.properties
Removed:
    roller/trunk/planet-business/src/test/resources/ehcache.xml
Modified:
    roller/trunk/weblogger-web/src/main/webapp/themes/basic/theme.css

Propchange: roller/trunk/planet-web/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Mar 20 18:37:51 2010
@@ -0,0 +1 @@
+target

Added: roller/trunk/planet-web/pom.xml
URL: http://svn.apache.org/viewvc/roller/trunk/planet-web/pom.xml?rev=925653&view=auto
==============================================================================
--- roller/trunk/planet-web/pom.xml (added)
+++ roller/trunk/planet-web/pom.xml Sat Mar 20 18:37:51 2010
@@ -0,0 +1,333 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.roller</groupId>
+        <artifactId>roller-project</artifactId>
+        <version>5.0-BETA2-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <name>Apache Roller Planet Web Application</name>
+    <groupId>org.apache.roller</groupId>
+    <artifactId>roller-weblogger-web</artifactId>
+    <version>5.0-EXPERIMENTAL-SNAPSHOT</version>
+    <packaging>war</packaging>
+
+    <dependencies>
+
+        <dependency>
+            <groupId>org.apache.roller</groupId>
+            <artifactId>roller-core</artifactId>
+            <version>5.0-BETA2-SNAPSHOT</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.struts</groupId>
+            <artifactId>struts2-core</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.struts</groupId>
+            <artifactId>struts2-tiles-plugin</artifactId>
+            <exclusions>
+                <exclusion>
+                    <artifactId>commons-logging-api</artifactId>
+                    <groupId>commons-logging</groupId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+        <dependency>
+            <groupId>taglibs</groupId>
+            <artifactId>string</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>taglibs</groupId>
+            <artifactId>string</artifactId>
+        </dependency>
+
+        <!-- Spring Security deps -->
+
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-web</artifactId>
+            <version>2.5.6</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>aopalliance</groupId>
+                    <artifactId>aopalliance</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.ldap</groupId>
+            <artifactId>spring-ldap</artifactId>
+            <version>1.2</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.security</groupId>
+            <artifactId>spring-security-core</artifactId>
+            <version>2.0.5.RELEASE</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.springframework</groupId>
+                    <artifactId>spring-support</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.security</groupId>
+            <artifactId>spring-security-openid</artifactId>
+            <version>2.0.5.RELEASE</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.security</groupId>
+            <artifactId>spring-security-taglibs</artifactId>
+            <version>2.0.5.RELEASE</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.security</groupId>
+            <artifactId>spring-security-acl</artifactId>
+            <version>2.0.5.RELEASE</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.springframework</groupId>
+                    <artifactId>spring-jdbc</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-dao</artifactId>
+            <version>2.0.6</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>aopalliance</groupId>
+                    <artifactId>aopalliance</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+        <!-- Java EE deps -->
+
+        <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>jstl</artifactId>
+            <!-- <scope>provided</scope> -->
+        </dependency>
+
+        <dependency>
+            <groupId>javax.mail</groupId>
+            <artifactId>mail</artifactId>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>servlet-api</artifactId>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>javax.servlet.jsp</groupId>
+            <artifactId>jsp-api</artifactId>
+            <version>2.1</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.mortbay.jetty</groupId>
+            <artifactId>jetty</artifactId>
+            <version>6.1.10</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <!-- test deps -->
+
+        <dependency>
+            <groupId>commons-dbcp</groupId>
+            <artifactId>commons-dbcp</artifactId>
+            <version>1.2.2</version>
+            <scope>test</scope>
+            <exclusions>
+                <exclusion>
+                    <artifactId>commons-pool</artifactId>
+                    <groupId>commons-pool</groupId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+        <dependency>
+            <groupId>simple-jndi</groupId>
+            <artifactId>simple-jndi</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.roller</groupId>
+            <artifactId>test-utils</artifactId>
+            <version>5.0-BETA2-SNAPSHOT</version>
+            <scope>test</scope>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.apache.derby</groupId>
+                    <artifactId>derby</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.apache.derby</groupId>
+                    <artifactId>derby</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.derby</groupId>
+            <artifactId>derbyclient</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+    </dependencies>
+
+    <build>
+
+        <finalName>planet</finalName>
+
+        <plugins>
+
+            <plugin>
+                <artifactId>maven-resources-plugin</artifactId>
+                <executions>
+
+                    <execution>
+                        <id>copy-test-properties</id>
+                        <phase>validate</phase>
+                        <goals><goal>copy-resources</goal></goals>
+                        <configuration>
+                            <outputDirectory>${basedir}/target/testsetup</outputDirectory>
+                            <resources>
+                                <resource>
+                                    <directory>src/test/resources</directory>
+                                    <filtering>true</filtering>
+                                </resource>
+                            </resources>
+                        </configuration>
+                    </execution>
+
+                    <execution>
+                        <id>copy-test-config</id>
+                        <phase>validate</phase>
+                        <goals><goal>copy-resources</goal></goals>
+                        <configuration>
+                            <outputDirectory>${basedir}/target/</outputDirectory>
+                            <resources>
+                                <resource>
+                                    <directory>src/test/resources</directory>
+                                    <filtering>true</filtering>
+                                </resource>
+                            </resources>
+                        </configuration>
+                    </execution>
+
+                </executions>
+                <configuration>
+                    <includeEmptyDirs>true</includeEmptyDirs>
+                </configuration>
+            </plugin>
+
+            <plugin>
+                <groupId>org.mortbay.jetty</groupId>
+                <artifactId>maven-jetty-plugin</artifactId>
+                <configuration>
+                    <contextPath>planet</contextPath>
+                    <jettyConfig>${project.build.directory}/jetty.xml</jettyConfig>
+                    <systemProperties>
+
+                        <systemProperty>
+                            <name>derby.dir</name>
+                            <value>${project.build.directory}/work/derby-system</value>
+                        </systemProperty>
+
+                        <systemProperty>
+                            <name>config.dir</name>
+                            <value>${basedir}/src/test/resources</value>
+                        </systemProperty>
+
+                        <systemProperty>
+                            <name>jetty.home</name>
+                            <value>${basedir}/src/test/resources</value>
+                        </systemProperty>
+
+                        <systemProperty>
+                            <name>jetty.logs</name>
+                            <value>${basedir}/src/test/resources</value>
+                        </systemProperty>
+
+                        <systemProperty>
+                            <name>derby.port</name>
+                            <value>3223</value>
+                        </systemProperty>
+
+                        <systemProperty>
+                            <name>planet.custom.config</name>
+                            <value>${project.build.directory}/testsetup/planet-custom.properties</value>
+                        </systemProperty>
+
+                    </systemProperties>
+                </configuration>
+                <dependencies>
+                    <dependency>
+                        <groupId>org.apache.roller</groupId>
+                        <artifactId>test-utils</artifactId>
+                        <version>5.0-BETA2-SNAPSHOT</version>
+                    </dependency>
+                    <dependency>
+                        <groupId>log4j</groupId>
+                        <artifactId>log4j</artifactId>
+                        <version>1.2.12</version>
+                    </dependency>
+                    <dependency>
+                        <groupId>org.apache.roller</groupId>
+                        <artifactId>test-utils</artifactId>
+                        <version>5.0-BETA2-SNAPSHOT</version>
+                    </dependency>
+                </dependencies>
+            </plugin>
+
+        </plugins>
+
+        <testResources>
+            <testResource>
+                <directory>src/test/resources</directory>
+                <filtering>true</filtering>
+            </testResource>
+        </testResources>
+
+        <resources>
+            <resource>
+                <directory>src/main/resources</directory>
+                <filtering>true</filtering>
+            </resource>
+        </resources>
+
+    </build>
+
+</project>

Added: roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/admin/struts2/ConfigForm.java
URL: http://svn.apache.org/viewvc/roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/admin/struts2/ConfigForm.java?rev=925653&view=auto
==============================================================================
--- roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/admin/struts2/ConfigForm.java (added)
+++ roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/admin/struts2/ConfigForm.java Sat Mar 20 18:37:51 2010
@@ -0,0 +1,140 @@
+/*
+ * 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.admin.struts2;
+
+import com.opensymphony.xwork2.Preparable;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.Map;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.roller.planet.PlanetException;
+import org.apache.roller.planet.business.PlanetFactory;
+import org.apache.roller.planet.business.PropertiesManager;
+import org.apache.roller.planet.pojos.RuntimeConfigProperty;
+import org.apache.roller.planet.ui.core.struts2.PlanetActionSupport;
+import org.apache.struts2.interceptor.ParameterAware;
+
+
+/**
+ * Config Form Action.
+ *
+ * Handles editing of global runtime properties.
+ *
+ * TODO: validation and security.
+ */
+public class ConfigForm extends PlanetActionSupport 
+        implements Preparable, ParameterAware {
+    
+    private static Log log = LogFactory.getLog(ConfigForm.class);
+    
+    // original request parameters
+    private Map parameters = Collections.EMPTY_MAP;
+    
+    // runtime properties data
+    private Map properties = Collections.EMPTY_MAP;
+    
+    
+    public void prepare() throws Exception {
+        // just grab our properties map and put it in the request
+        PropertiesManager pMgr = PlanetFactory.getPlanet().getPropertiesManager();
+        this.properties = pMgr.getProperties();
+    }
+
+    
+    public String execute() {
+        return INPUT;
+    }
+    
+    
+    public String save() {
+        
+        log.debug("Handling update request");
+        
+        try {
+            // only set values for properties that are already defined
+            String propName = null;
+            RuntimeConfigProperty updProp = null;
+            String incomingProp = null;
+            Iterator propsIT = this.properties.keySet().iterator();
+            while(propsIT.hasNext()) {
+                propName = (String) propsIT.next();
+                
+                log.debug("Checking property ["+propName+"]");
+                
+                updProp = (RuntimeConfigProperty) this.properties.get(propName);
+                String[] propValues = (String[]) this.parameters.get(updProp.getName());
+                if(propValues != null && propValues.length > 0) {
+                    // we don't deal with multi-valued props
+                    incomingProp = propValues[0];
+                }
+                
+                // some special treatment for booleans
+                // this is a bit hacky since we are assuming that any prop
+                // with a value of "true" or "false" is meant to be a boolean
+                // it may not always be the case, but we should be okay for now
+                if( updProp.getValue() != null // null check needed w/Oracle
+                        && (updProp.getValue().equals("true") || updProp.getValue().equals("false"))) {
+                    
+                    if(incomingProp == null || !incomingProp.equals("on"))
+                        incomingProp = "false";
+                    else
+                        incomingProp = "true";
+                }
+                
+                // only work on props that were submitted with the request
+                if(incomingProp != null) {
+                    log.debug("Setting new value for ["+propName+"]");
+                    
+                    updProp.setValue(incomingProp.trim());
+                }
+            }
+            
+            // save it
+            PropertiesManager pMgr = PlanetFactory.getPlanet().getPropertiesManager();
+            pMgr.saveProperties(this.properties);
+            PlanetFactory.getPlanet().flush();
+            
+        } catch (PlanetException e) {
+            log.error(e);
+            setError("ConfigForm.error.saveFailed");
+        }
+        
+        setSuccess("ConfigForm.message.saveSucceeded");
+        return INPUT;
+    }
+
+    
+    public Map getParameters() {
+        return parameters;
+    }
+
+    public void setParameters(Map parameters) {
+        this.parameters = parameters;
+    }
+
+    public Map getProperties() {
+        return properties;
+    }
+
+    public void setProperties(Map properties) {
+        this.properties = properties;
+    }
+    
+}

Added: roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/admin/struts2/PlanetForm-PlanetForm!save-validation.xml
URL: http://svn.apache.org/viewvc/roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/admin/struts2/PlanetForm-PlanetForm%21save-validation.xml?rev=925653&view=auto
==============================================================================
--- roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/admin/struts2/PlanetForm-PlanetForm!save-validation.xml (added)
+++ roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/admin/struts2/PlanetForm-PlanetForm!save-validation.xml Sat Mar 20 18:37:51 2010
@@ -0,0 +1,49 @@
+<!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>
+    
+    <!-- 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>
\ No newline at end of file

Added: roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/admin/struts2/PlanetForm.java
URL: http://svn.apache.org/viewvc/roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/admin/struts2/PlanetForm.java?rev=925653&view=auto
==============================================================================
--- roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/admin/struts2/PlanetForm.java (added)
+++ roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/admin/struts2/PlanetForm.java Sat Mar 20 18:37:51 2010
@@ -0,0 +1,160 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+
+package org.apache.roller.planet.ui.admin.struts2;
+
+import com.opensymphony.xwork2.Preparable;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.roller.planet.PlanetException;
+import org.apache.roller.planet.business.PlanetFactory;
+import org.apache.roller.planet.business.PlanetManager;
+import org.apache.roller.planet.pojos.Planet;
+import org.apache.roller.planet.pojos.PlanetGroup;
+import org.apache.roller.planet.ui.core.struts2.PlanetActionSupport;
+
+
+/**
+ * Planet Form Action.
+ *
+ * Handles adding/modifying Planets.
+ *
+ * TODO: validation and security.
+ */
+public class PlanetForm extends PlanetActionSupport implements Preparable {
+    
+    private static Log log = LogFactory.getLog(PlanetForm.class);
+    
+    // the objects to work on
+    private Planet planet = null;
+    private PlanetGroup group = null;
+    
+    // form fields
+    private String planetid = null;
+    private String groupid = null;
+    
+    
+    /**
+     * Load relevant form data if possible.
+     */
+    public void prepare() throws Exception {
+        
+        PlanetManager pMgr = PlanetFactory.getPlanet().getPlanetManager();
+        
+        // load existing planet
+        if(getPlanetid() != null && !"".equals(getPlanetid())) {
+            log.debug("Loading Planet ... "+getPlanetid());
+            this.planet = pMgr.getPlanetById(getPlanetid());
+        } else {
+            // new planet
+            log.debug("No planet specified, constructing new one");
+            this.planet = new Planet();
+        }
+    }
+    
+    
+    public String execute() {
+        return INPUT;
+    }
+    
+    
+    // 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) {
+            // save planet
+            log.debug("Saving Planet ...");
+            
+            try {
+                PlanetManager pmgr = PlanetFactory.getPlanet().getPlanetManager();
+                pmgr.savePlanet(this.planet);
+                PlanetFactory.getPlanet().flush();
+                
+                // need to set planetid attribute
+                setPlanetid(this.planet.getId());
+            } catch (PlanetException ex) {
+                log.error("Error saving planet ", ex);
+                setError("PlanetForm.error.saveFailed");
+                return INPUT;
+            }
+            
+            setSuccess("PlanetForm.message.saveSucceeded");
+            return INPUT;
+        } else {
+            setError("PlanetForm.error.planetNull");
+            return INPUT;
+        }
+
+    }
+    
+    
+    public String deleteGroup() {
+        
+        if(getGroupid() != null && !"".equals(getGroupid())) {
+            // delete a planet group
+            log.debug("Deleting Planet Group ... "+getGroupid());
+            
+            PlanetManager pmgr = PlanetFactory.getPlanet().getPlanetManager();
+            try {
+                PlanetGroup group = pmgr.getGroupById(getGroupid());
+                this.planet = group.getPlanet();
+                this.planet.getGroups().remove(group);
+                pmgr.savePlanet(this.planet);
+                pmgr.deleteGroup(group);
+                PlanetFactory.getPlanet().flush();
+                
+                setSuccess("PlanetForm.message.groupDeleteSucceeded", group.getHandle());
+                return INPUT;
+            } catch (PlanetException ex) {
+                log.error("Error deleting planet group", ex);
+                setError("PlanetForm.error.groupDeleteFailed", getGroupid());
+                return INPUT;
+            }
+            
+        } else {
+            setError("PlanetForm.error.groupNull");
+            return INPUT;
+        }
+    }
+
+    public String getPlanetid() {
+        return planetid;
+    }
+
+    public void setPlanetid(String id) {
+        this.planetid = id;
+    }
+
+    public String getGroupid() {
+        return groupid;
+    }
+
+    public void setGroupid(String groupid) {
+        this.groupid = groupid;
+    }
+    
+    public Planet getPlanet() {
+        return planet;
+    }
+
+    public void setPlanet(Planet planet) {
+        this.planet = planet;
+    }
+    
+}

Added: roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/admin/struts2/PlanetGroupForm-PlanetGroupForm!save-validation.xml
URL: http://svn.apache.org/viewvc/roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/admin/struts2/PlanetGroupForm-PlanetGroupForm%21save-validation.xml?rev=925653&view=auto
==============================================================================
--- roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/admin/struts2/PlanetGroupForm-PlanetGroupForm!save-validation.xml (added)
+++ roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/admin/struts2/PlanetGroupForm-PlanetGroupForm!save-validation.xml Sat Mar 20 18:37:51 2010
@@ -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

Added: roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/admin/struts2/PlanetGroupForm.java
URL: http://svn.apache.org/viewvc/roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/admin/struts2/PlanetGroupForm.java?rev=925653&view=auto
==============================================================================
--- roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/admin/struts2/PlanetGroupForm.java (added)
+++ roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/admin/struts2/PlanetGroupForm.java Sat Mar 20 18:37:51 2010
@@ -0,0 +1,228 @@
+/*
+ * 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.admin.struts2;
+
+import com.opensymphony.xwork2.Preparable;
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.roller.planet.PlanetException;
+import org.apache.roller.planet.business.PlanetFactory;
+import org.apache.roller.planet.business.PlanetManager;
+import org.apache.roller.planet.business.fetcher.FeedFetcher;
+import org.apache.roller.planet.pojos.Planet;
+import org.apache.roller.planet.pojos.PlanetGroup;
+import org.apache.roller.planet.pojos.Subscription;
+import org.apache.roller.planet.ui.core.struts2.PlanetActionSupport;
+
+
+/**
+ * Planet Group Form Action.
+ *
+ * Handles adding/modifying groups for a planet.
+ *
+ * TODO: validation and security.
+ */
+public class PlanetGroupForm extends PlanetActionSupport implements Preparable {
+    
+    private static Log log = LogFactory.getLog(PlanetGroupForm.class);
+    
+    // the PlanetGroup to work on
+    private PlanetGroup group = null;
+    
+    // form fields
+    private String planetid = null;
+    private String groupid = null;
+    private String subid = null;
+    private String addSubUrl = null;
+    
+    
+    /**
+     * Load relevant Planet if possible.
+     */
+    public void prepare() throws Exception {
+        PlanetManager pMgr = PlanetFactory.getPlanet().getPlanetManager();
+        if(getGroupid() != null && !"".equals(getGroupid())) {
+            // load a planet group
+            log.debug("Loading Planet Group ...");
+            
+            group = pMgr.getGroupById(getGroupid());
+        } else {
+            // new group, must have a planet to add it to
+            Planet planet = pMgr.getPlanetById(getPlanetid());
+            if(planet != null) {
+                group = new PlanetGroup();
+                group.setPlanet(planet);
+            } else {
+                throw new PlanetException("could not determine planet "+getPlanetid());
+            }
+        }
+    }
+    
+    public String execute() {
+        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 ...");
+        
+        try {
+            PlanetManager pMgr = PlanetFactory.getPlanet().getPlanetManager();
+            pMgr.saveGroup(this.group);
+            PlanetFactory.getPlanet().flush();
+            
+            // call setGroupid() just in case this was a new group with no id yet
+            setGroupid(this.group.getId());
+        } catch (PlanetException ex) {
+            log.error("Error saving planet group", ex);
+            setError("PlanetGroupForm.error.saveFailed");
+            return INPUT;
+        }
+        
+        setSuccess("PlanetGroupForm.message.saveSucceeded");
+        return INPUT;
+    }
+    
+    
+    // Validation - sub url cannot be null, must be valid url
+    public String addSub() {
+        // add a planet subscription
+        log.debug("Adding Planet Subscription ...");
+        
+        PlanetManager pMgr = PlanetFactory.getPlanet().getPlanetManager();
+        try {
+            PlanetGroup group = getGroup();
+            if(group == null) {
+                setError("PlanetSubscriptionForm.error.groupNull");
+                return INPUT;
+            }
+            
+            // check if this subscription already exists before adding it
+            Subscription sub = pMgr.getSubscription(getAddSubUrl());
+            if(sub == null) {
+                // sub doesn't exist yet, so we need to fetch it
+                FeedFetcher fetcher = PlanetFactory.getPlanet().getFeedFetcher();
+                sub = fetcher.fetchSubscription(getAddSubUrl());
+                
+                // save new sub
+                pMgr.saveSubscription(sub);
+            }
+            
+            // add the sub to the group
+            group.getSubscriptions().add(sub);
+            sub.getGroups().add(group);
+            pMgr.saveGroup(group);
+            
+            // flush changes
+            PlanetFactory.getPlanet().flush();
+            
+            // clear field after success
+            setAddSubUrl(null);
+            
+        } catch (PlanetException ex) {
+            log.error("Error adding subscription", ex);
+            setError("PlanetSubscriptionForm.error.saveFailed");
+            return INPUT;
+        }
+        
+        setSuccess("PlanetSubscriptionForm.message.saveSucceeded");
+        return INPUT;
+    }
+    
+    
+    public String deleteSub() {
+        // delete a planet subscription
+        log.debug("Deleting Planet Subscription ...");
+        
+        PlanetManager pmgr = PlanetFactory.getPlanet().getPlanetManager();
+        try {
+            if(!StringUtils.isEmpty(getSubid())) {
+                Subscription sub = pmgr.getSubscriptionById(getSubid());
+                if(sub == null) {
+                    setError("PlanetGroupForm.error.nullSubscription");
+                    return INPUT;
+                } else {
+                    PlanetGroup group = getGroup();
+                    group.getSubscriptions().remove(sub);
+                    sub.getGroups().remove(group);
+                    pmgr.saveGroup(group);
+                    PlanetFactory.getPlanet().flush();
+                }
+                
+                setSuccess("PlanetGroupForm.message.subscriptionDeleteSucceeded", sub.getTitle());
+            } else {
+                setError("PlanetGroupForm.error.subscriptionNull");
+            }
+            
+            return INPUT;
+            
+        } catch (PlanetException ex) {
+            log.error("Unable to lookup planet group", ex);
+            setError("PlanetGroupForm.error.subscriptionDeleteFailed", getSubid());
+            return INPUT;
+        }
+    }
+    
+
+    public String getPlanetid() {
+        return planetid;
+    }
+
+    public void setPlanetid(String planetid) {
+        this.planetid = planetid;
+    }
+
+    public String getGroupid() {
+        return groupid;
+    }
+
+    public void setGroupid(String groupid) {
+        this.groupid = groupid;
+    }
+
+    public String getSubid() {
+        return subid;
+    }
+
+    public void setSubid(String subid) {
+        this.subid = subid;
+    }
+    
+    public PlanetGroup getGroup() {
+        return group;
+    }
+
+    public void setGroup(PlanetGroup group) {
+        this.group = group;
+    }
+
+    public String getAddSubUrl() {
+        return addSubUrl;
+    }
+
+    public void setAddSubUrl(String addSubUrl) {
+        this.addSubUrl = addSubUrl;
+    }
+    
+}

Added: roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/admin/struts2/PlanetSubscriptionForm-PlanetSubscriptionForm!save-validation.xml
URL: http://svn.apache.org/viewvc/roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/admin/struts2/PlanetSubscriptionForm-PlanetSubscriptionForm%21save-validation.xml?rev=925653&view=auto
==============================================================================
--- roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/admin/struts2/PlanetSubscriptionForm-PlanetSubscriptionForm!save-validation.xml (added)
+++ roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/admin/struts2/PlanetSubscriptionForm-PlanetSubscriptionForm!save-validation.xml Sat Mar 20 18:37:51 2010
@@ -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

Added: roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/admin/struts2/PlanetSubscriptionForm.java
URL: http://svn.apache.org/viewvc/roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/admin/struts2/PlanetSubscriptionForm.java?rev=925653&view=auto
==============================================================================
--- roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/admin/struts2/PlanetSubscriptionForm.java (added)
+++ roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/admin/struts2/PlanetSubscriptionForm.java Sat Mar 20 18:37:51 2010
@@ -0,0 +1,143 @@
+/*
+ * 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.admin.struts2;
+
+import com.opensymphony.xwork2.Preparable;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.roller.planet.PlanetException;
+import org.apache.roller.planet.business.PlanetFactory;
+import org.apache.roller.planet.business.PlanetManager;
+import org.apache.roller.planet.pojos.PlanetGroup;
+import org.apache.roller.planet.pojos.Subscription;
+import org.apache.roller.planet.ui.core.struts2.PlanetActionSupport;
+
+
+/**
+ * Planet Sub Form Action.
+ * 
+ * Handles adding/modifying subscriptions for a group.
+ *
+ * TODO: validation and security.
+ */
+public class PlanetSubscriptionForm extends PlanetActionSupport implements Preparable {
+    
+    private static Log log = LogFactory.getLog(PlanetSubscriptionForm.class);
+    
+    // the Subscription to work on
+    private Subscription subscription = null;
+    
+    // form fields
+    private String groupid = null;
+    private String subid = null;
+    
+    
+    /**
+     * Load relevant Subscription if possible.
+     */
+    public void prepare() throws Exception {
+        PlanetManager pMgr = PlanetFactory.getPlanet().getPlanetManager();
+        if(getSubid() != null && !"".equals(getSubid())) {
+            // load a planet subscription
+            log.debug("Loading Planet Subscription ...");
+            
+            subscription = pMgr.getSubscriptionById(getSubid());
+        } else {
+            subscription = new Subscription();
+        }
+    }
+    
+    public String execute() {
+        return INPUT;
+    }
+    
+    
+    // TODO: Validation - make sure that html is not allowed in title
+    public String save() {
+        // save a subscription
+        log.debug("Saving Planet Subscription ...");
+        
+        PlanetManager pMgr = PlanetFactory.getPlanet().getPlanetManager();
+        try {
+            if(this.subscription.getId() == null) {
+                // adding a new sub to a group, so make sure we have a group
+                PlanetGroup group = pMgr.getGroupById(getGroupid());
+                if(group == null) {
+                    setError("PlanetSubscriptionForm.error.groupNull");
+                    return INPUT;
+                }
+                
+                // check if this subscription already exists before adding it
+                Subscription sub = pMgr.getSubscription(this.subscription.getFeedURL());
+                if(sub != null) {
+                    this.subscription = sub;
+                } else {
+                    pMgr.saveSubscription(this.subscription);
+                    
+                    // set subid now that we have one
+                    setSubid(this.subscription.getId());
+                }
+                
+                // add the sub to the group
+                group.getSubscriptions().add(this.subscription);
+                this.subscription.getGroups().add(group);
+                pMgr.saveGroup(group);
+                
+            } else {
+                // updating and existing subscription, so just save it
+                pMgr.saveSubscription(this.subscription);
+            }
+            
+            // flush changes
+            PlanetFactory.getPlanet().flush();
+        } catch (PlanetException ex) {
+            log.error("Error saving subscription", ex);
+            setError("PlanetSubscriptionForm.error.saveFailed");
+            return INPUT;
+        }
+        
+        setSuccess("PlanetSubscriptionForm.message.saveSucceeded");
+        return INPUT;
+    }
+
+    public String getGroupid() {
+        return groupid;
+    }
+
+    public void setGroupid(String groupid) {
+        this.groupid = groupid;
+    }
+
+    public String getSubid() {
+        return subid;
+    }
+
+    public void setSubid(String subid) {
+        this.subid = subid;
+    }
+
+    public Subscription getSubscription() {
+        return subscription;
+    }
+
+    public void setSubscription(Subscription subscription) {
+        this.subscription = subscription;
+    }
+    
+}

Added: roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/admin/struts2/PlanetsList.java
URL: http://svn.apache.org/viewvc/roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/admin/struts2/PlanetsList.java?rev=925653&view=auto
==============================================================================
--- roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/admin/struts2/PlanetsList.java (added)
+++ roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/admin/struts2/PlanetsList.java Sat Mar 20 18:37:51 2010
@@ -0,0 +1,115 @@
+/*
+ * 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.admin.struts2;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.roller.planet.business.PlanetFactory;
+import org.apache.roller.planet.business.PlanetManager;
+import org.apache.roller.planet.pojos.Planet;
+import org.apache.roller.planet.ui.core.struts2.PlanetActionSupport;
+
+
+/**
+ * Planet List Action.
+ *
+ * Displays the list of planets in the system.
+ *
+ * TODO: validation and security.
+ */
+public class PlanetsList extends PlanetActionSupport {
+    
+    private static Log log = LogFactory.getLog(PlanetsList.class);
+    
+    private static final String LIST = "list";
+    
+    // action properties
+    private String planetid = null;
+    private Collection planets = Collections.EMPTY_LIST;
+    
+    
+    public String execute() {
+        try {
+            PlanetManager pMgr = PlanetFactory.getPlanet().getPlanetManager();
+            List planets = pMgr.getPlanets();
+            //Collections.sort(planets);
+            setPlanets(planets);
+        } catch(Exception e) {
+            log.error("PlanetsList.error.general", e);
+            return LIST;
+        }
+        
+        return LIST;
+    }
+    
+    
+    /**
+     * Delete a planet.
+     */
+    public String deletePlanet() {
+        
+        if(getPlanetid() != null && getPlanetid().length() > 0) {
+            // delete a planet
+            log.debug("Deleting Planet ... "+getPlanetid());
+            
+            try {
+                PlanetManager pMgr = PlanetFactory.getPlanet().getPlanetManager();
+                Planet planet = pMgr.getPlanetById(getPlanetid());
+                if(planet != null) {
+                    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;
+            }
+            
+        } else {
+            setError("PlanetsList.error.planetNull");
+            return execute();
+        }
+        
+    }
+    
+    
+    public Collection getPlanets() {
+        return this.planets;
+    }
+    
+    private void setPlanets(Collection planets) {
+        this.planets = planets;
+    }
+
+    public String getPlanetid() {
+        return planetid;
+    }
+
+    public void setPlanetid(String planetid) {
+        this.planetid = planetid;
+    }
+    
+}

Added: roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/admin/struts2/package.properties
URL: http://svn.apache.org/viewvc/roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/admin/struts2/package.properties?rev=925653&view=auto
==============================================================================
--- roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/admin/struts2/package.properties (added)
+++ roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/admin/struts2/package.properties Sat Mar 20 18:37:51 2010
@@ -0,0 +1,168 @@
+
+# General purpose keys for use on many views
+
+error=Error:
+warning=Warning:
+success=Success:
+
+
+# MenuBar (menu.jsp)
+
+MenuBar.home=Home
+MenuBar.config=Configuration
+MenuBar.planets=Planets
+MenuBar.logout=Logout
+
+
+# ConfigForm
+
+ConfigForm.pageTitle=Roller-Planet admin console
+ConfigForm.formTitle=Configuration
+ConfigForm.formHelp=You can set the title, description and administrator \
+information to be used in all pages and feeds generated by Roller-Planet. \
+You can also set the default group, the aggregation group that will \
+be featured on the front page of the site.
+
+ConfigForm.siteSettings=General Site Settings
+ConfigForm.title=Site Title
+ConfigForm.description=Site Description
+ConfigForm.adminName=Admin Name
+ConfigForm.adminEmail=Admin Email
+ConfigForm.absoluteUrl=Site URL
+ConfigForm.proxyHost=Proxy Host
+ConfigForm.proxyPort=Proxy Port
+
+ConfigForm.message.saveSucceeded=Configuration saved.
+
+ConfigForm.error.saveFailed=Failed to save configuration.
+
+
+# PlanetForm
+
+PlanetForm.pageTitle=Edit planet
+PlanetForm.heading=Edit Planet
+PlanetForm.returnToList=Return to planets list
+PlanetForm.help=\
+You can set the title, handle for each planet.
+
+PlanetForm.handle=Handle
+PlanetForm.title=Title
+PlanetForm.description=Description
+
+PlanetForm.groupsHeading=Groups in this planet
+PlanetForm.groupTitle=Group Title
+PlanetForm.groupHandle=Group Handle
+PlanetForm.groupURL=Group URL
+PlanetForm.action=Action
+PlanetForm.link=Link
+PlanetForm.deleteGroup=Delete
+PlanetForm.addGroup=Add group to this planet
+
+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.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}.
+PlanetForm.error.planetNull=Operation failed, planet was null
+PlanetForm.error.groupNull=Operation failed, group was null
+
+
+# PlanetGroupForm
+
+PlanetGroupForm.pageTitle=Edit group
+PlanetGroupForm.heading=Edit Group
+PlanetGroupForm.returnToPlanet=Return to planet
+PlanetGroupForm.help=\
+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.
+
+PlanetGroupForm.handle=Handle
+PlanetGroupForm.title=Title
+PlanetGroupForm.description=Description
+PlanetGroupForm.maxPageEntries=Max page entries
+PlanetGroupForm.maxFeedEntries=Max feeds entries
+
+PlanetGroupForm.subsHeading=Subscriptions in this group
+PlanetGroupForm.subsTitle=Title
+PlanetGroupForm.subsSiteURL=Site URL
+PlanetGroupForm.subsFeedURL=Feed URL
+PlanetGroupForm.action=Action
+PlanetGroupForm.deleteSub=Delete
+PlanetGroupForm.addSub=Add subscription for this group
+
+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.
+
+
+# PlanetSubscriptionForm
+
+PlanetSubscriptionForm.pageTitle=Edit subscription
+PlanetSubscriptionForm.heading=Edit Subscription
+PlanetSubscriptionForm.help=A subscription is an RSS or Atom feed that can be included \
+in one or more Roller-Planet groups.
+PlanetSubscriptionForm.returnToGroup=Return to group
+
+PlanetSubscriptionForm.title=Title
+PlanetSubscriptionForm.feedURL=Feed URL
+PlanetSubscriptionForm.siteURL=Site URL
+
+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.
+
+
+# PlanetsList
+
+PlanetsList.pageTitle=Planets List
+PlanetsList.heading=Planets
+PlanetsList.help=You can define any number of Planets within the application.  Each \
+Planet may contain any number of groups and subscriptions.  Below is the current \
+list of Planets.
+
+PlanetsList.planetHandle=Planet Handle
+PlanetsList.planetTitle=Planet Title
+PlanetsList.planetURL=Planet URL
+PlanetsList.action=Action
+PlanetsList.link=Link
+PlanetsList.deletePlanet=Delete
+PlanetsList.addPlanet=Create a new Planet
+
+PlanetsList.message.planetDeleteSucceeded=Planet {0} has been deleted
+
+PlanetsList.error.general=Unable to get planets listing
+PlanetsList.error.planetDeleteFailed=Could not delete planet {0}
+PlanetsList.error.planetNull=Cannot determine which planet to delete
+

Added: roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/core/PlanetContext.java
URL: http://svn.apache.org/viewvc/roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/core/PlanetContext.java?rev=925653&view=auto
==============================================================================
--- roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/core/PlanetContext.java (added)
+++ roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/core/PlanetContext.java Sat Mar 20 18:37:51 2010
@@ -0,0 +1,115 @@
+/*
+ * 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.core;
+
+import javax.servlet.ServletContext;
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.roller.planet.PlanetException;
+import org.apache.roller.planet.business.BootstrapException;
+import org.apache.roller.planet.business.PlanetFactory;
+import org.apache.roller.planet.business.startup.PlanetStartup;
+import org.apache.roller.planet.business.startup.StartupException;
+import org.springframework.web.context.ContextLoaderListener;
+
+
+/**
+ * Responds to app init/destroy events and holds Roller instance.
+ */
+public class PlanetContext extends ContextLoaderListener 
+        implements ServletContextListener {
+    
+    private static Log log = LogFactory.getLog(PlanetContext.class);
+    
+    // reference to ServletContext object
+    private static ServletContext context = null;
+    
+    
+    public PlanetContext() {
+        super();
+    }
+    
+    
+    /**
+     * Get the ServletContext.
+     *
+     * @return ServletContext
+     */
+    public static ServletContext getServletContext() {
+        return context;
+    }
+    
+
+    /**
+     * Responds to context initialization event by processing context
+     * paramters for easy access by the rest of the application.
+     */
+    public void contextInitialized(ServletContextEvent sce) {
+        
+        log.info("Roller Planet Initializing ... ");
+        
+        // keep a reverence to ServletContext object
+        this.context = sce.getServletContext();
+        
+        // call Spring's context ContextLoaderListener to initialize
+        // all the context files specified in web.xml. This is necessary
+        // because listeners don't initialize in the order specified in
+        // 2.3 containers
+        super.contextInitialized(sce);
+                
+        // Now prepare the core services of the app so we can bootstrap
+        try {
+            PlanetStartup.prepare();
+        } catch (StartupException ex) {
+            log.fatal("Roller Planet startup failed during app preparation", ex);
+            return;
+        }        
+        
+        // if preparation failed or is incomplete then we are done,
+        // otherwise try to bootstrap the business tier
+        if (!PlanetStartup.isPrepared()) {
+            log.info("Roller Planet startup requires interaction from user to continue");
+        } else {
+            try {
+                // trigger bootstrapping process
+                PlanetFactory.bootstrap();
+                
+                // trigger initialization process
+                PlanetFactory.getPlanet().initialize();
+                
+            } catch (BootstrapException ex) {
+                log.fatal("Roller PlanetFactory bootstrap failed", ex);
+            } catch (PlanetException ex) {
+                log.fatal("Roller PlanetFactory initialization failed", ex);
+            }
+        }
+        
+        log.info("Roller Planet Initialization Complete");
+    }
+    
+    
+    /** 
+     * Responds to app-destroy. 
+     */
+    public void contextDestroyed(ServletContextEvent sce) {
+        PlanetFactory.getPlanet().shutdown();
+    }
+}

Added: roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/core/filters/DebugFilter.java
URL: http://svn.apache.org/viewvc/roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/core/filters/DebugFilter.java?rev=925653&view=auto
==============================================================================
--- roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/core/filters/DebugFilter.java (added)
+++ roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/core/filters/DebugFilter.java Sat Mar 20 18:37:51 2010
@@ -0,0 +1,91 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+
+package org.apache.roller.planet.ui.core.filters;
+
+import java.io.IOException;
+import java.util.Enumeration;
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+
+/**
+ * Used for debugging, not mapped by default.
+ */
+public class DebugFilter implements Filter {
+    
+    private static Log log = LogFactory.getLog(DebugFilter.class);
+    
+    
+    public void init(FilterConfig filterConfig) {
+        
+    }
+    
+    
+    /**
+     * Inspect incoming urls and see if they should be routed.
+     */
+    public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain)
+            throws IOException, ServletException {
+        
+        HttpServletRequest request = (HttpServletRequest) req;
+        HttpServletResponse response = (HttpServletResponse) res;
+        
+        log.info("entering");
+        
+        // print out session details
+        HttpSession session = request.getSession(false);
+        if(session != null) {
+            log.info("inbound session contains:");
+            Enumeration foo = session.getAttributeNames();
+            while(foo.hasMoreElements()) {
+                String attr = (String) foo.nextElement();
+                log.info(attr+" = "+session.getAttribute("attr"));
+            }
+        }
+        
+        // keep going
+        chain.doFilter(request, response);
+        
+        // print out session details
+        session = request.getSession(false);
+        if(session != null) {
+            log.info("outbound session contains:");
+            Enumeration bar = session.getAttributeNames();
+            while(bar.hasMoreElements()) {
+                String attr = (String) bar.nextElement();
+                log.info(attr+" = "+session.getAttribute("attr"));
+            }
+        }
+        
+        log.info("exiting");
+    }
+    
+    
+    public void destroy() {}
+    
+}

Added: roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/core/filters/PersistenceSessionFilter.java
URL: http://svn.apache.org/viewvc/roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/core/filters/PersistenceSessionFilter.java?rev=925653&view=auto
==============================================================================
--- roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/core/filters/PersistenceSessionFilter.java (added)
+++ roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/core/filters/PersistenceSessionFilter.java Sat Mar 20 18:37:51 2010
@@ -0,0 +1,75 @@
+/*
+ * 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.core.filters;
+
+import java.io.IOException;
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+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.planet.business.Planet;
+import org.apache.roller.planet.business.PlanetFactory;
+
+
+/**
+ * Sole responsibility is to ensure that each request's Planet
+ * persistence session is released at end of the request.
+ */
+public class PersistenceSessionFilter implements Filter {
+    
+    private static Log log = LogFactory.getLog(PersistenceSessionFilter.class);
+    
+    
+    /**
+     * Release Roller persistence session at end of request processing.
+     */
+    public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain)
+            throws IOException, ServletException {
+        
+        HttpServletRequest request = (HttpServletRequest) req;
+        HttpServletResponse response = (HttpServletResponse) res;
+        
+        log.debug("Entered PersistenceSessionFilter");
+        
+        Planet planet = PlanetFactory.getPlanet();
+        try {
+            chain.doFilter(request, response);
+        } finally {
+            log.debug("Releasing Planet Session");
+            if (PlanetFactory.isBootstrapped()) {
+                PlanetFactory.getPlanet().release();
+            }
+        }
+        
+        log.debug("Exiting PersistenceSessionFilter");
+    }
+    
+    
+    public void init(FilterConfig filterConfig) throws ServletException {}
+    
+    public void destroy() {}
+    
+}
+

Added: roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/core/struts2/Login.java
URL: http://svn.apache.org/viewvc/roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/core/struts2/Login.java?rev=925653&view=auto
==============================================================================
--- roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/core/struts2/Login.java (added)
+++ roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/core/struts2/Login.java Sat Mar 20 18:37:51 2010
@@ -0,0 +1,45 @@
+/*
+ * 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.core.struts2;
+
+import com.opensymphony.xwork2.ActionSupport;
+
+
+/**
+ * Login Action.
+ */
+public class Login extends PlanetActionSupport {
+    
+    private boolean failed = false;
+    
+    
+    public String execute() {
+        // nothing to do right now
+        return SUCCESS;
+    }
+
+    public boolean isFailed() {
+        return failed;
+    }
+
+    public void setFailed(boolean failed) {
+        this.failed = failed;
+    }
+    
+}

Added: roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/core/struts2/Logout.java
URL: http://svn.apache.org/viewvc/roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/core/struts2/Logout.java?rev=925653&view=auto
==============================================================================
--- roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/core/struts2/Logout.java (added)
+++ roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/core/struts2/Logout.java Sat Mar 20 18:37:51 2010
@@ -0,0 +1,34 @@
+/*
+ * 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.core.struts2;
+
+import com.opensymphony.xwork2.ActionSupport;
+
+
+/**
+ * Logout Action.
+ */
+public class Logout extends ActionSupport {
+    
+    public String execute() {
+        // nothing to do right now
+        return SUCCESS;
+    }
+    
+}

Added: roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/core/struts2/MainMenu.java
URL: http://svn.apache.org/viewvc/roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/core/struts2/MainMenu.java?rev=925653&view=auto
==============================================================================
--- roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/core/struts2/MainMenu.java (added)
+++ roller/trunk/planet-web/src/main/java/org/apache/roller/planet/ui/core/struts2/MainMenu.java Sat Mar 20 18:37:51 2010
@@ -0,0 +1,34 @@
+/*
+ * 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.core.struts2;
+
+import com.opensymphony.xwork2.ActionSupport;
+
+
+/**
+ * Menu Action.
+ */
+public class MainMenu extends ActionSupport {
+    
+    public String execute() {
+        // nothing to do right now
+        return SUCCESS;
+    }
+    
+}



Mime
View raw message