You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by da...@apache.org on 2006/12/11 00:58:09 UTC

svn commit: r485320 - in /cocoon/whiteboard/java-sitemap: ./ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/cocoon/ src/main/java/org/apache/cocoon/javasitemap/ src/main/resources/ src/main/webapp/ s...

Author: danielf
Date: Sun Dec 10 15:58:07 2006
New Revision: 485320

URL: http://svn.apache.org/viewvc?view=rev&rev=485320
Log:
Experimenting with writing a sitemap in Java. To make the Java sitemap work the AbstractProcessingPipeline must be patched. I'll wait with checking in this patch until after the milestone release.

Added:
    cocoon/whiteboard/java-sitemap/   (with props)
    cocoon/whiteboard/java-sitemap/pom.xml
    cocoon/whiteboard/java-sitemap/src/
    cocoon/whiteboard/java-sitemap/src/main/
    cocoon/whiteboard/java-sitemap/src/main/java/
    cocoon/whiteboard/java-sitemap/src/main/java/org/
    cocoon/whiteboard/java-sitemap/src/main/java/org/apache/
    cocoon/whiteboard/java-sitemap/src/main/java/org/apache/cocoon/
    cocoon/whiteboard/java-sitemap/src/main/java/org/apache/cocoon/javasitemap/
    cocoon/whiteboard/java-sitemap/src/main/java/org/apache/cocoon/javasitemap/JavaSitemapServlet.java   (with props)
    cocoon/whiteboard/java-sitemap/src/main/resources/
    cocoon/whiteboard/java-sitemap/src/main/webapp/
    cocoon/whiteboard/java-sitemap/src/main/webapp/WEB-INF/
    cocoon/whiteboard/java-sitemap/src/main/webapp/WEB-INF/applicationContext.xml   (with props)
    cocoon/whiteboard/java-sitemap/src/main/webapp/WEB-INF/cocoon/
    cocoon/whiteboard/java-sitemap/src/main/webapp/WEB-INF/cocoon/log4j.xconf   (with props)
    cocoon/whiteboard/java-sitemap/src/main/webapp/WEB-INF/web.xml   (with props)
    cocoon/whiteboard/java-sitemap/src/main/webapp/not-found.xml   (with props)
    cocoon/whiteboard/java-sitemap/src/main/webapp/resources/
    cocoon/whiteboard/java-sitemap/src/main/webapp/resources/icons/
    cocoon/whiteboard/java-sitemap/src/main/webapp/resources/icons/cocoon.ico   (with props)
    cocoon/whiteboard/java-sitemap/src/main/webapp/resources/images/
    cocoon/whiteboard/java-sitemap/src/main/webapp/resources/images/powered.gif   (with props)
    cocoon/whiteboard/java-sitemap/src/main/webapp/resources/styles/
    cocoon/whiteboard/java-sitemap/src/main/webapp/resources/styles/main.css   (with props)
    cocoon/whiteboard/java-sitemap/src/main/webapp/welcome.xml   (with props)
    cocoon/whiteboard/java-sitemap/src/main/webapp/welcome.xslt   (with props)

Propchange: cocoon/whiteboard/java-sitemap/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sun Dec 10 15:58:07 2006
@@ -0,0 +1,3 @@
+target
+.classpath
+.project

Added: cocoon/whiteboard/java-sitemap/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/java-sitemap/pom.xml?view=auto&rev=485320
==============================================================================
--- cocoon/whiteboard/java-sitemap/pom.xml (added)
+++ cocoon/whiteboard/java-sitemap/pom.xml Sun Dec 10 15:58:07 2006
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  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.
+-->
+<!--+
+    | @version $Id$
+    |
+    +-->
+<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/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <packaging>war</packaging>
+  <name>java-sitemap</name>
+  <groupId>org.apache.cocoon</groupId>
+  <artifactId>java-sitemap</artifactId>
+  <version>1.0.0-SNAPSHOT</version>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.cocoon</groupId>
+        <artifactId>cocoon-deployer-plugin</artifactId>
+        <version>1.0.0-M2-SNAPSHOT</version>
+        <configuration>
+          <serverVersion>2.2</serverVersion>
+        </configuration>
+        <executions>
+          <execution>
+            <phase>package</phase>
+            <goals>
+              <goal>deploy</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <groupId>org.mortbay.jetty</groupId>
+        <artifactId>maven-jetty-plugin</artifactId>
+        <version>6.0.2</version>
+        <configuration>
+          <connectors>
+            <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
+              <port>8888</port>
+              <maxIdleTime>30000</maxIdleTime>
+            </connector>
+          </connectors>
+          <webAppSourceDirectory>${project.build.directory}/${pom.artifactId}-${pom.version}</webAppSourceDirectory>
+          <contextPath>/</contextPath>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.cocoon</groupId>
+      <artifactId>cocoon-core</artifactId>
+      <version>2.2.0-M3-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>javax.servlet</groupId>
+      <artifactId>servlet-api</artifactId>
+      <version>2.4</version>
+      <scope>provided</scope>
+    </dependency>
+  </dependencies>
+</project>

Added: cocoon/whiteboard/java-sitemap/src/main/java/org/apache/cocoon/javasitemap/JavaSitemapServlet.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/java-sitemap/src/main/java/org/apache/cocoon/javasitemap/JavaSitemapServlet.java?view=auto&rev=485320
==============================================================================
--- cocoon/whiteboard/java-sitemap/src/main/java/org/apache/cocoon/javasitemap/JavaSitemapServlet.java (added)
+++ cocoon/whiteboard/java-sitemap/src/main/java/org/apache/cocoon/javasitemap/JavaSitemapServlet.java Sun Dec 10 15:58:07 2006
@@ -0,0 +1,144 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * 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.
+ */
+package org.apache.cocoon.javasitemap;
+
+import java.io.IOException;
+import java.util.Map;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.avalon.framework.logger.Logger;
+import org.apache.avalon.framework.parameters.Parameters;
+import org.apache.cocoon.ProcessingException;
+import org.apache.cocoon.ProcessingUtil;
+import org.apache.cocoon.components.pipeline.ProcessingPipeline;
+import org.apache.cocoon.configuration.Settings;
+import org.apache.cocoon.core.container.spring.avalon.AvalonUtils;
+import org.apache.cocoon.environment.Environment;
+import org.apache.cocoon.environment.http.HttpContext;
+import org.apache.cocoon.environment.http.HttpEnvironment;
+import org.apache.cocoon.matching.Matcher;
+import org.apache.cocoon.sitemap.PatternException;
+import org.springframework.web.context.WebApplicationContext;
+import org.springframework.web.context.support.WebApplicationContextUtils;
+
+/**
+*
+* @version $Id$
+*/
+public class JavaSitemapServlet extends HttpServlet {
+
+    private static final Parameters EMPTY_PARAMETERS = Parameters.EMPTY_PARAMETERS;
+    private static final long serialVersionUID = 1L;
+    private WebApplicationContext beanFactory;
+    private Settings settings;
+    private String containerEncoding;
+    private Logger log;
+    private HttpContext environmentContext;
+
+    /* (non-Javadoc)
+     * @see javax.servlet.GenericServlet#init()
+     */
+    public void init() throws ServletException {
+        this.beanFactory =
+            WebApplicationContextUtils.getRequiredWebApplicationContext(this.getServletContext());
+        this.settings = (Settings) this.beanFactory.getBean(Settings.ROLE);
+        final String encoding = this.settings.getContainerEncoding();
+        if ( encoding == null ) {
+            this.containerEncoding = "ISO-8859-1";
+        } else {
+            this.containerEncoding = encoding;
+        }
+        this.log = (Logger) this.beanFactory.getBean(AvalonUtils.LOGGER_ROLE);
+        this.environmentContext = new HttpContext(this.getServletContext());
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.http.HttpServlet#service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
+     */
+    protected void service(HttpServletRequest request, HttpServletResponse response)
+    throws ServletException, IOException {
+        Environment environment;
+        try {
+            environment = this.getEnvironment(request.getPathInfo(), request, response);
+            ProcessingPipeline pipeline = this.buildPipeline(request, environment.getObjectModel());
+            pipeline.process(environment);
+        } catch (Exception e) {
+            this.log.error("Error processing the request", e);
+            response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.getMessage());
+        } finally {
+            // neccesary for geting rid of poolable components
+            ProcessingUtil.cleanup();
+        }
+    }
+
+    private ProcessingPipeline buildPipeline(HttpServletRequest request, Map objectModel)
+    throws PatternException, ProcessingException {
+        // get the pipeline. It will be recycled in the ProcessingUtil.cleanup() method.
+        ProcessingPipeline pipeline =
+            (ProcessingPipeline) this.beanFactory.getBean(ProcessingPipeline.ROLE + "/noncaching");
+        // get the wildcard matcher. It is thread safe so only one is needed.
+        Matcher wildcardMatcher = (Matcher) this.beanFactory.getBean(Matcher.ROLE + "/wildcard");
+        Map matches = null;
+        
+        if ((matches = wildcardMatcher.match("", objectModel, EMPTY_PARAMETERS)) != null) {
+            pipeline.setGenerator("file", "context://welcome.xml", EMPTY_PARAMETERS, EMPTY_PARAMETERS);
+            Parameters parameters = new Parameters();
+            parameters.setParameter("contextPath", request.getContextPath() + request.getServletPath());
+            pipeline.addTransformer("xslt", "context://welcome.xslt", parameters, EMPTY_PARAMETERS);
+            pipeline.setSerializer("xhtml", null, EMPTY_PARAMETERS, EMPTY_PARAMETERS, "text/html");
+        } else if ((matches = wildcardMatcher.match("images/*.gif", objectModel, EMPTY_PARAMETERS)) != null) {
+            // Images
+            pipeline.setReader("resource", "context://resources/images/" + matches.get("1") + ".gif", EMPTY_PARAMETERS, "image/gif");
+        } else if ((matches = wildcardMatcher.match("styles/*.css", objectModel, EMPTY_PARAMETERS)) != null) {
+            // CSS stylesheets
+            pipeline.setReader("resource", "context://resources/styles/" + matches.get("1") + ".css", EMPTY_PARAMETERS, "text/css");
+        } else if ((matches = wildcardMatcher.match("**favicon.ico", objectModel, EMPTY_PARAMETERS)) != null) {
+            // favicon
+            pipeline.setReader("resource", "context://resources/icons/cocoon.ico", EMPTY_PARAMETERS, "image/x-icon");
+        }
+
+        return pipeline;
+    }
+    
+    /**
+     * Create the environment for the request
+     */
+    private Environment getEnvironment(String uri,
+                                         HttpServletRequest req,
+                                         HttpServletResponse res)
+    throws Exception {
+        HttpEnvironment env;
+
+        String formEncoding = req.getParameter("cocoon-form-encoding");
+        if (formEncoding == null) {
+            formEncoding = this.settings.getFormEncoding();
+        }
+        env = new HttpEnvironment(uri,
+                                  req,
+                                  res,
+                                  this.getServletContext(),
+                                  this.environmentContext,
+                                  this.containerEncoding,
+                                  formEncoding);
+        env.enableLogging(this.log);
+        return env;
+    }
+}

Propchange: cocoon/whiteboard/java-sitemap/src/main/java/org/apache/cocoon/javasitemap/JavaSitemapServlet.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/whiteboard/java-sitemap/src/main/java/org/apache/cocoon/javasitemap/JavaSitemapServlet.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: cocoon/whiteboard/java-sitemap/src/main/webapp/WEB-INF/applicationContext.xml
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/java-sitemap/src/main/webapp/WEB-INF/applicationContext.xml?view=auto&rev=485320
==============================================================================
--- cocoon/whiteboard/java-sitemap/src/main/webapp/WEB-INF/applicationContext.xml (added)
+++ cocoon/whiteboard/java-sitemap/src/main/webapp/WEB-INF/applicationContext.xml Sun Dec 10 15:58:07 2006
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  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.
+-->
+<!-- @version $Id$ -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:util="http://www.springframework.org/schema/util"
+       xmlns:cocoon="http://cocoon.apache.org/core"
+       xmlns:avalon="http://cocoon.apache.org/avalon"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+                           http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd
+                           http://cocoon.apache.org/core http://cocoon.apache.org/core.xsd
+                           http://cocoon.apache.org/avalon http://cocoon.apache.org/avalon.xsd">
+
+  <!-- Load all the properties for Cocoon -->
+  <cocoon:settings/>
+
+  <!-- Load Avalon configurations
+       If you want to use a different logger than the default log4j logger,
+       add a bean conforming to the Avalon Logger interface to this definition
+       and leave out the loggingConfiguration attribute.
+       If you have an own cocoon.xconf specify the location attribute,
+       like location="/WEB-INF/cocoon/cocoon.xconf".
+   -->
+  <avalon:avalon loggingConfiguration="/WEB-INF/cocoon/log4j.xconf"/>
+
+</beans>
\ No newline at end of file

Propchange: cocoon/whiteboard/java-sitemap/src/main/webapp/WEB-INF/applicationContext.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/whiteboard/java-sitemap/src/main/webapp/WEB-INF/applicationContext.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Added: cocoon/whiteboard/java-sitemap/src/main/webapp/WEB-INF/cocoon/log4j.xconf
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/java-sitemap/src/main/webapp/WEB-INF/cocoon/log4j.xconf?view=auto&rev=485320
==============================================================================
--- cocoon/whiteboard/java-sitemap/src/main/webapp/WEB-INF/cocoon/log4j.xconf (added)
+++ cocoon/whiteboard/java-sitemap/src/main/webapp/WEB-INF/cocoon/log4j.xconf Sun Dec 10 15:58:07 2006
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  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.
+-->
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+
+    <!-- This is a sample configuration for log4j.
+         It simply just logs everything into a single
+         log file.
+         Note, that you can use properties for value substitution.
+    -->
+    <appender name="COCOON_DEFAULT" class="org.apache.log4j.FileAppender">
+        <param name="File"   value="${log-dir}/log4j.log" />
+        <param name="Append" value="false" />	    	
+        <layout class="org.apache.log4j.PatternLayout">
+            <param name="ConversionPattern" value="%t %-5p %c{2} - %m%n"/>
+        </layout>	    
+    </appender>
+
+    <root>
+      <priority value="${org.apache.cocoon.log4j.loglevel}"/>
+      <appender-ref ref="COCOON_DEFAULT" />
+    </root>
+</log4j:configuration>

Propchange: cocoon/whiteboard/java-sitemap/src/main/webapp/WEB-INF/cocoon/log4j.xconf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/whiteboard/java-sitemap/src/main/webapp/WEB-INF/cocoon/log4j.xconf
------------------------------------------------------------------------------
    svn:keywords = Id

Added: cocoon/whiteboard/java-sitemap/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/java-sitemap/src/main/webapp/WEB-INF/web.xml?view=auto&rev=485320
==============================================================================
--- cocoon/whiteboard/java-sitemap/src/main/webapp/WEB-INF/web.xml (added)
+++ cocoon/whiteboard/java-sitemap/src/main/webapp/WEB-INF/web.xml Sun Dec 10 15:58:07 2006
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  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.
+-->
+<!DOCTYPE web-app
+    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+    "http://java.sun.com/dtd/web-app_2_3.dtd">
+
+<web-app>
+  <!-- This listener sets up the spring container on startup of the web application. -->
+  <listener>
+    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
+  </listener>
+
+  <servlet>
+    <servlet-name>JavaSitemap</servlet-name>
+    <display-name>JavaSitemap</display-name>
+    <description>Java sitemap servlet - testing the sitemap pattern in Java</description>
+
+    <servlet-class>org.apache.cocoon.javasitemap.JavaSitemapServlet</servlet-class>
+
+    <load-on-startup>1</load-on-startup>
+  </servlet>
+
+  <servlet-mapping>
+    <servlet-name>JavaSitemap</servlet-name>
+    <url-pattern>/*</url-pattern>
+  </servlet-mapping>
+
+</web-app>

Propchange: cocoon/whiteboard/java-sitemap/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/whiteboard/java-sitemap/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Added: cocoon/whiteboard/java-sitemap/src/main/webapp/not-found.xml
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/java-sitemap/src/main/webapp/not-found.xml?view=auto&rev=485320
==============================================================================
--- cocoon/whiteboard/java-sitemap/src/main/webapp/not-found.xml (added)
+++ cocoon/whiteboard/java-sitemap/src/main/webapp/not-found.xml Sun Dec 10 15:58:07 2006
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  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.
+-->
+<!--+
+    | This a simple message page that is shown when a resource is not found.
+    |
+    | CVS $Id$
+    +-->
+<welcome>
+ <message>
+   Sorry, Cocoon couldn't find the resource you requested.
+ </message>
+</welcome>

Propchange: cocoon/whiteboard/java-sitemap/src/main/webapp/not-found.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/whiteboard/java-sitemap/src/main/webapp/not-found.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Added: cocoon/whiteboard/java-sitemap/src/main/webapp/resources/icons/cocoon.ico
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/java-sitemap/src/main/webapp/resources/icons/cocoon.ico?view=auto&rev=485320
==============================================================================
Binary file - no diff available.

Propchange: cocoon/whiteboard/java-sitemap/src/main/webapp/resources/icons/cocoon.ico
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: cocoon/whiteboard/java-sitemap/src/main/webapp/resources/images/powered.gif
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/java-sitemap/src/main/webapp/resources/images/powered.gif?view=auto&rev=485320
==============================================================================
Binary file - no diff available.

Propchange: cocoon/whiteboard/java-sitemap/src/main/webapp/resources/images/powered.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: cocoon/whiteboard/java-sitemap/src/main/webapp/resources/styles/main.css
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/java-sitemap/src/main/webapp/resources/styles/main.css?view=auto&rev=485320
==============================================================================
--- cocoon/whiteboard/java-sitemap/src/main/webapp/resources/styles/main.css (added)
+++ cocoon/whiteboard/java-sitemap/src/main/webapp/resources/styles/main.css Sun Dec 10 15:58:07 2006
@@ -0,0 +1,90 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements.  See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* 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.
+*/
+body { background-color: white; color: black; font-family: verdana, helvetica, arial, sans-serif; font-size: 80%; }
+
+h1 { color: #336699; text-align: center; font-size: 3em; padding-bottom: 10px; margin: 0px; }
+h2 { color: #336699; }
+h3 { color: #336699; }
+h4 { color: #336699; }
+
+a:link { color: #336699; }
+a:visited { color: #800080; }
+a:hover { color: #800080; background-color: #ffff80; }
+a:active { color: #006666; }
+
+img { border: 0; }
+.figure { text-align: center; }
+
+span.year { color: #336699; }
+
+p.copyright { text-align: center; padding-top: 10px; border-width: 1px 0px 0px 0px; border-style: solid; border-color: #336699; }
+p.author { color: #336699; padding-bottom: 10px; }
+p.block { text-align: center; }
+
+hr { height: 0px; color: #336699; }
+
+span.description { color: #336699; font-weight: bold; }
+span.switch { cursor: pointer; margin-left: 5px; text-decoration: underline; }
+
+/* Samples */
+
+.samplesGroup {
+    /* a tasteful shade of blue */
+    background-color: #BFCCDF;
+    color: black;
+    border-width: 0px 0px 2px 0px;
+    border-style: solid;
+    border-color: #336699;
+    font-size:120%;
+    padding-left: 0.2em;
+    padding-top: 0.2em;
+    padding-bottom: 0.2em;
+    margin-top: 1em;
+    margin-bottom: 0;
+ 
+    /* mozilla and some others support the fancy CSS3 borders */
+    -moz-border-radius-bottomleft: 1em;
+    border-radius-bottomleft: 1em;
+}
+
+.samplesNote {
+    color: #333333;
+    margin: 0.5em;
+    padding: 0.2em;
+    background-color: #ffffcc;
+    font-style: italic;
+}
+
+.samplesStatusNote {
+	font-style: italic;
+	font-size: 80%;
+	text-align: right;
+	margin: 2px;
+	padding: 0;
+}
+
+.samplesText {
+    margin-top: 0.2em;
+}
+
+div.resources {
+    text-align: right;
+}
+
+div.resources a {
+    margin: 5px;
+}

Propchange: cocoon/whiteboard/java-sitemap/src/main/webapp/resources/styles/main.css
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/whiteboard/java-sitemap/src/main/webapp/resources/styles/main.css
------------------------------------------------------------------------------
    svn:keywords = Id

Added: cocoon/whiteboard/java-sitemap/src/main/webapp/welcome.xml
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/java-sitemap/src/main/webapp/welcome.xml?view=auto&rev=485320
==============================================================================
--- cocoon/whiteboard/java-sitemap/src/main/webapp/welcome.xml (added)
+++ cocoon/whiteboard/java-sitemap/src/main/webapp/welcome.xml Sun Dec 10 15:58:07 2006
@@ -0,0 +1,33 @@
+<?xml version="1.0"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  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.
+-->
+
+<!--+
+    | This is a very simple XML page done just to show how a simple 
+    | cocoon pipeline works.
+    |
+    | $Id$
+    +-->
+<welcome>
+  <message>
+    Congratulations! If you are reading this page, it means that
+    your Apache Cocoon installation was successful.
+  </message>
+  <message>
+    To know more about Cocoon capabilities, look at the <link href="blocks/">sample blocks</link>.    
+  </message>
+</welcome>
\ No newline at end of file

Propchange: cocoon/whiteboard/java-sitemap/src/main/webapp/welcome.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/whiteboard/java-sitemap/src/main/webapp/welcome.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Added: cocoon/whiteboard/java-sitemap/src/main/webapp/welcome.xslt
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/java-sitemap/src/main/webapp/welcome.xslt?view=auto&rev=485320
==============================================================================
--- cocoon/whiteboard/java-sitemap/src/main/webapp/welcome.xslt (added)
+++ cocoon/whiteboard/java-sitemap/src/main/webapp/welcome.xslt Sun Dec 10 15:58:07 2006
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  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.
+-->
+
+<!-- CVS $Id$ -->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                              xmlns="http://www.w3.org/1999/xhtml">
+
+  <xsl:param name="contextPath"/>
+
+  <xsl:template match="welcome">
+    <html xml:lang="en" lang="en">
+      <head>
+        <title>Welcome to Apache Cocoon!</title>
+        <!-- 
+             NOTE (SM): this meta tag reflects the *output* of the pipeline and not
+             the encoding of this file. I agree it's sort of an hack and it should
+             be the XHTML serializer to add the meta tag to the response, but, for
+             now, this fixes encoding problems in those user-agents that don't parse
+             the <?xml?> processing instruction to understand the encoding of the
+             stream 
+         --> 
+        <meta http-equiv="Content-Type" content="text/xhtml; charset=UTF-8"/>
+        <link href="{$contextPath}/styles/main.css" type="text/css" rel="stylesheet"/>
+        <link href="favicon.ico" rel="SHORTCUT ICON" />
+      </head>
+      <body>
+        <h1>Welcome to Apache Cocoon!</h1>
+        <xsl:apply-templates/>
+        <p class="copyright">
+         Copyright © @year@ <a href="http://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.
+        </p>
+        <p class="block">
+          <a href="http://cocoon.apache.org/"><img src="{$contextPath}/images/powered.gif" alt="Powered by Apache Cocoon"/></a>
+        </p>
+      </body>
+    </html>
+  </xsl:template>
+
+  <xsl:template match="message">
+    <p class="block"><xsl:apply-templates/></p>
+  </xsl:template>
+  
+  <xsl:template match="link">
+    <a href="{@href}"><xsl:apply-templates/></a>
+  </xsl:template>
+
+</xsl:stylesheet>

Propchange: cocoon/whiteboard/java-sitemap/src/main/webapp/welcome.xslt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/whiteboard/java-sitemap/src/main/webapp/welcome.xslt
------------------------------------------------------------------------------
    svn:keywords = Id



Re: svn commit: r485320 - in /cocoon/whiteboard/java-sitemap: ./ src/ src/main/ src/main/java/ ...

Posted by Reinhard Poetz <re...@apache.org>.
danielf@apache.org wrote:
> Author: danielf
> Date: Sun Dec 10 15:58:07 2006
> New Revision: 485320
> 
> URL: http://svn.apache.org/viewvc?view=rev&rev=485320
> Log:
> Experimenting with writing a sitemap in Java. To make the Java sitemap work the AbstractProcessingPipeline must be patched. I'll wait with checking in this patch until after the milestone release.

wow, cool stuff! I only want to ask you to wait until the release got approved 
by the Cocoon PMC as it might happen, that I have to create the release 
artifacts several times. Thanks!

-- 
Reinhard Pötz           Independent Consultant, Trainer & (IT)-Coach 

{Software Engineering, Open Source, Web Applications, Apache Cocoon}

                                        web(log): http://www.poetz.cc
--------------------------------------------------------------------