You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by ge...@apache.org on 2013/02/23 09:28:36 UTC

svn commit: r1449281 - in /servicemix/website/trunk: ./ src/main/scala/ src/main/scala/org/ src/main/scala/org/apache/ src/main/scala/org/apache/servicemix/ src/main/scala/org/apache/servicemix/website/ src/main/webapp/ src/main/webapp/downloads/ src/t...

Author: gertv
Date: Sat Feb 23 08:28:35 2013
New Revision: 1449281

URL: http://svn.apache.org/r1449281
Log:
Add 4.4.3-SNAPSHOT and 5.0.0-SNAPSHOT download pages

Added:
    servicemix/website/trunk/src/main/scala/
    servicemix/website/trunk/src/main/scala/org/
    servicemix/website/trunk/src/main/scala/org/apache/
    servicemix/website/trunk/src/main/scala/org/apache/servicemix/
    servicemix/website/trunk/src/main/scala/org/apache/servicemix/website/
    servicemix/website/trunk/src/main/scala/org/apache/servicemix/website/Helper.scala
    servicemix/website/trunk/src/main/webapp/downloads/_servicemix5.scaml
    servicemix/website/trunk/src/main/webapp/downloads/servicemix-4.4.3.page
    servicemix/website/trunk/src/main/webapp/downloads/servicemix-5.0.0.page
    servicemix/website/trunk/src/test/
    servicemix/website/trunk/src/test/scala/
    servicemix/website/trunk/src/test/scala/org/
    servicemix/website/trunk/src/test/scala/org/apache/
    servicemix/website/trunk/src/test/scala/org/apache/servicemix/
    servicemix/website/trunk/src/test/scala/org/apache/servicemix/website/
    servicemix/website/trunk/src/test/scala/org/apache/servicemix/website/HelperTest.scala
Modified:
    servicemix/website/trunk/pom.xml
    servicemix/website/trunk/src/main/webapp/downloads.page
    servicemix/website/trunk/src/main/webapp/downloads/_servicemix3.scaml
    servicemix/website/trunk/src/main/webapp/downloads/_servicemix4.scaml

Modified: servicemix/website/trunk/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/website/trunk/pom.xml?rev=1449281&r1=1449280&r2=1449281&view=diff
==============================================================================
--- servicemix/website/trunk/pom.xml (original)
+++ servicemix/website/trunk/pom.xml Sat Feb 23 08:28:35 2013
@@ -44,7 +44,6 @@
         <jetty-port>8080</jetty-port>
         <jetty-war-dir>${project.build.directory}/webapp/</jetty-war-dir>
 
-
         <scalate.editor>${env.SCALATE_EDITOR}</scalate.editor>
         <scalate.mode>production</scalate.mode>
         <scalate.workdir>${project.build.directory}/scalateWorkDir</scalate.workdir>
@@ -103,21 +102,44 @@
             <artifactId>slf4j-api</artifactId>
             <version>${slf4j.version}</version>
         </dependency>
-		<dependency>
-			<groupId>org.scala-lang</groupId>
-			<artifactId>scala-library</artifactId>
-			<version>${scala.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>org.scala-lang</groupId>
-			<artifactId>scala-compiler</artifactId>
-			<version>${scala.version}</version>
-		</dependency>
+    		<dependency>
+			      <groupId>org.scala-lang</groupId>
+			      <artifactId>scala-library</artifactId>
+			      <version>${scala.version}</version>
+		    </dependency>
+		    <dependency>
+			      <groupId>org.scala-lang</groupId>
+			      <artifactId>scala-compiler</artifactId>
+			      <version>${scala.version}</version>
+		    </dependency>
+
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.11</version>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
 
     <build>
         <plugins>
             <plugin>
+                <groupId>org.scala-tools</groupId>
+                <artifactId>maven-scala-plugin</artifactId>
+                <version>2.15.2</version>
+                <configuration>
+                    <scalaVersion>${scala.version}</scalaVersion>
+                </configuration>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>compile</goal>
+                            <goal>testCompile</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-resources-plugin</artifactId>
                 <executions>

Added: servicemix/website/trunk/src/main/scala/org/apache/servicemix/website/Helper.scala
URL: http://svn.apache.org/viewvc/servicemix/website/trunk/src/main/scala/org/apache/servicemix/website/Helper.scala?rev=1449281&view=auto
==============================================================================
--- servicemix/website/trunk/src/main/scala/org/apache/servicemix/website/Helper.scala (added)
+++ servicemix/website/trunk/src/main/scala/org/apache/servicemix/website/Helper.scala Sat Feb 23 08:28:35 2013
@@ -0,0 +1,151 @@
+/**
+ * Copyright (C) 2009-2013 the original author or authors.
+ * See the notice.md file distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * Licensed 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.servicemix.website
+
+/**
+ * Helper methods to build the download pages
+ */
+object Helper {
+
+  /**
+   * Generate a download url for a release/snapshot artifact
+   */
+  def download(specs: (ReleaseArtifact => ReleaseArtifact)*)(implicit release: Release) : String = {
+    artifactFor(specs, release) match {
+      case artifact @ ReleaseArtifact(release, _, _, _) if isSnapshot(release) => _snapshot(artifact)
+      case artifact @ ReleaseArtifact(release, _, _, _) if release.archived => _archive(artifact)
+      case artifact => _mirror(artifact)
+    }
+  }
+
+  /**
+   * Generate the URL fo the MD5 hash
+   */
+  def md5(specs: (ReleaseArtifact => ReleaseArtifact)*)(implicit release: Release) : String = _metafile(artifactFor(specs, release), "md5")
+
+  /**
+   * Generate the URL fo the PGP signatur
+   */
+  def pgp(specs: (ReleaseArtifact => ReleaseArtifact)*)(implicit release: Release) : String = _metafile(artifactFor(specs, release), "asc")
+
+  /**
+   * Generate the URL fo the SHA1 hash
+   */
+  def sha1(specs: (ReleaseArtifact => ReleaseArtifact)*)(implicit release: Release) : String = _metafile(artifactFor(specs, release), "sha1")
+
+  /**
+   * Function to specify a -minimal assembly
+   */
+  val minimal : ReleaseArtifact => ReleaseArtifact = (artifact) => artifact match {
+    case ReleaseArtifact(release, _, packaging, classifier) => ReleaseArtifact(release, "apache-servicemix-minimal", packaging, classifier)
+  }
+
+  /**
+   * Function to specify a -jbi assembly
+   */
+  val jbi : ReleaseArtifact => ReleaseArtifact = (artifact) => artifact match {
+    case ReleaseArtifact(release, _, packaging, classifier) => ReleaseArtifact(release, "apache-servicemix-jbi", packaging, classifier)
+  }
+
+  /**
+   * Function to specify a -full assembly
+   */
+  val full : ReleaseArtifact => ReleaseArtifact = (artifact) => artifact match {
+    case ReleaseArtifact(release, _, packaging, classifier) => ReleaseArtifact(release, "apache-servicemix-full", packaging, classifier)
+  }
+
+  /**
+   * Function to specify a -src assembly
+   */
+  val source : ReleaseArtifact => ReleaseArtifact = (artifact) => artifact match {
+    case ReleaseArtifact(release, artifact, packaging, _) => ReleaseArtifact(release, artifact, packaging, Some("src"))
+  }
+
+  /**
+   * Function to specify tar.gz packaging
+   */
+  val tarball : ReleaseArtifact => ReleaseArtifact = (artifact) => artifact match {
+    case ReleaseArtifact(release, artifact, _, classifier) => ReleaseArtifact(release, artifact, "tar.gz", classifier)
+  }
+
+  /**
+   * Function to specify zip packaging
+   */
+  val zip : ReleaseArtifact => ReleaseArtifact = (artifact) => artifact match {
+    case ReleaseArtifact(release, artifact, _, classifier) => ReleaseArtifact(release, artifact, "zip", classifier)
+  }
+
+  /**
+   * Function to specify war packaging
+   */
+  val war : ReleaseArtifact => ReleaseArtifact = (artifact) => artifact match {
+    case ReleaseArtifact(release, _, _, classifier) => ReleaseArtifact(release, "apache-servicemix-web", "war", classifier)
+  }
+
+
+  val isSnapshot : Release => Boolean = _.version.endsWith("SNAPSHOT")
+  val isRelease : Release => Boolean = !isSnapshot(_)
+
+  val filename : ReleaseArtifact => String = _ match {
+    case ReleaseArtifact(release, artifact, packaging, Some(classifier)) => s"${artifact}-${release.version}-${classifier}.${packaging}"
+    case ReleaseArtifact(release, artifact, packaging, None) => s"${artifact}-${release.version}.${packaging}"
+  }
+
+  val location : ReleaseArtifact => String = _ match {
+    case ReleaseArtifact(Release(version, _), _, _, _) if version.startsWith("3") => "servicemix-3"
+    case _ => "servicemix-4"
+  }
+
+  val versionOf : ReleaseArtifact => String = _.release.version
+
+  val artifactFor : (Seq[ReleaseArtifact => ReleaseArtifact], Release) => ReleaseArtifact =
+    (specs, release) => specs.foldLeft(ReleaseArtifact(release))((artifact, spec) => spec(artifact))
+
+  private def _metafile(artifact: ReleaseArtifact, suffix: String) : String =
+    artifact match {
+      case ReleaseArtifact(release, _, _, _) if release.archived => s"${_archive(artifact)}.${suffix}"
+      case _ => s"${_dist(artifact)}.${suffix}"
+    }
+
+  private def _archive(artifact: ReleaseArtifact) : String =
+    s"http://archive.apache.org/dist/servicemix/${location(artifact)}/${versionOf(artifact)}/${filename(artifact)}"
+
+  private def _dist(artifact: ReleaseArtifact) : String = {
+    s"http://www.apache.org/dist/servicemix/${location(artifact)}/${artifact.release.version}/${filename(artifact)}"
+  }
+
+  private def _mirror(artifact: ReleaseArtifact) : String =
+    s"http://www.apache.org/dyn/closer.cgi?path=servicemix/${location(artifact)}/${artifact.release.version}/${filename(artifact)}"
+
+  private def _snapshot(artifact: ReleaseArtifact) : String =
+    s"http://repository.apache.org/service/local/artifact/maven/redirect?r=snapshots&g=org.apache.servicemix&a=${artifact.artifact}&v=${versionOf(artifact)}&p=${artifact.packaging}"
+
+  case class ReleaseArtifact(release: Release,
+                             artifact: String = "apache-servicemix",
+                             packaging: String = "tar.gz",
+                             classifier: Option[String] = None)
+
+}
+
+/**
+ * Defines a version of Apache ServiceMix
+ *
+ * @param version the version
+ * @param archived <code>true<code> if the version is no longer available on the download mirrors
+ */
+case class Release(version: String, archived: Boolean = false)

Modified: servicemix/website/trunk/src/main/webapp/downloads.page
URL: http://svn.apache.org/viewvc/servicemix/website/trunk/src/main/webapp/downloads.page?rev=1449281&r1=1449280&r2=1449281&view=diff
==============================================================================
--- servicemix/website/trunk/src/main/webapp/downloads.page (original)
+++ servicemix/website/trunk/src/main/webapp/downloads.page Sat Feb 23 08:28:35 2013
@@ -6,6 +6,13 @@ h1. Download
 The latest release is the [ServiceMix 4.5.0 Release|/downloads/servicemix-4.5.0.html].  We strongly encourage all users to use this release.
 
 --- name:previous pipeline:conf
+h2. Development snapshots
+
+We have development snapshots available for
+
+* [Apache ServiceMix 5.0.0-SNAPSHOT|/downloads/servicemix-5.0.0.html]
+* [Apache ServiceMix 4.4.3-SNAPSHOT|/downloads/servicemix-4.4.3.html]
+
 h2. Previous Releases
 
 An archive of previous releases can be found [here|http://archive.apache.org/dist/servicemix/].

Modified: servicemix/website/trunk/src/main/webapp/downloads/_servicemix3.scaml
URL: http://svn.apache.org/viewvc/servicemix/website/trunk/src/main/webapp/downloads/_servicemix3.scaml?rev=1449281&r1=1449280&r2=1449281&view=diff
==============================================================================
--- servicemix/website/trunk/src/main/webapp/downloads/_servicemix3.scaml (original)
+++ servicemix/website/trunk/src/main/webapp/downloads/_servicemix3.scaml Sat Feb 23 08:28:35 2013
@@ -2,8 +2,9 @@
 -@ val archive: Boolean = false
 
 -
-  val mirror = if (archive) "http://archive.apache.org/dist" else "http://www.apache.org/dyn/closer.cgi?path="
-  val dist = if (archive) "http://archive.apache.org/dist" else "http://www.apache.org/dist"
+  import org.apache.servicemix.website.Release
+  import org.apache.servicemix.website.Helper._
+  implicit val release = Release(version, archive)
 
 %div#downloads
   %div.alert
@@ -33,52 +34,52 @@
           %p Our default assembly is the best way to get started with Apache ServiceMix.
         %td
           %p.tar
-            %a(href="#{mirror}/servicemix/servicemix-3/#{version}/apache-servicemix-#{version}.tar.gz")
+            %a(href="#{download(tarball)}")
               Apache ServiceMix #{version} (tar.gz)
           %p.keys
-            %a(href="#{dist}/servicemix/servicemix-3/#{version}/apache-servicemix-#{version}.tar.gz.asc") [PGP]
-            %a(href="#{dist}/servicemix/servicemix-3/#{version}/apache-servicemix-#{version}.tar.gz.sha1") [SHA1]
-            %a(href="#{dist}/servicemix/servicemix-3/#{version}/apache-servicemix-#{version}.tar.gz.md5") [MD5]
+            %a(href="#{pgp(tarball)}") [PGP]
+            %a(href="#{sha1(tarball)}") [SHA1]
+            %a(href="#{md5(tarball)}") [MD5]
         %td
           %p.zip
-            %a(href="#{mirror}/servicemix/servicemix-4/#{version}/apache-servicemix-#{version}.zip")
+            %a(href="#{download(zip)}")
               Apache ServiceMix #{version} (zip)
           %p.keys
-            %a(href="#{dist}/servicemix/servicemix-3/#{version}/apache-servicemix-#{version}.zip.asc") [PGP]
-            %a(href="#{dist}/servicemix/servicemix-3/#{version}/apache-servicemix-#{version}.zip.sha1") [SHA1]
-            %a(href="#{dist}/servicemix/servicemix-3/#{version}/apache-servicemix-#{version}.zip.md5") [MD5]
+            %a(href="#{pgp(zip)}") [PGP]
+            %a(href="#{sha1(zip)}") [SHA1]
+            %a(href="#{md5(zip)}") [MD5]
       %tr
         %td.first
           %p.title Source assembly
           %p Use this if you want to build Apache ServiceMix from source yourself
         %td
           %p.tar
-            %a(href="#{mirror}/servicemix/servicemix-3/#{version}/apache-servicemix-#{version}-src.tar.gz")
+            %a(href="#{download(source,tarball)}")
               Apache ServiceMix Sources #{version} (tar.gz)
           %p.keys
-            %a(href="#{dist}/servicemix/servicemix-3/#{version}/apache-servicemix-#{version}-src.tar.gz.asc") [PGP]
-            %a(href="#{dist}/servicemix/servicemix-3/#{version}/apache-servicemix-#{version}-src.tar.gz.sha1") [SHA1]
-            %a(href="#{dist}/servicemix/servicemix-3/#{version}/apache-servicemix-#{version}-src.tar.gz.md5") [MD5]
+            %a(href="#{pgp(source,tarball)}") [PGP]
+            %a(href="#{sha1(source,tarball)}") [SHA1]
+            %a(href="#{md5(source,tarball)}") [MD5]
         %td
           %p.zip
-            %a(href="#{mirror}/servicemix/servicemix-3/#{version}/apache-servicemix-#{version}-src.zip")
+            %a(href="#{download(source,zip)}")
               Apache ServiceMix Sources #{version} (zip)
           %p.keys
-            %a(href="#{dist}/servicemix/servicemix-3/#{version}/apache-servicemix-#{version}-src.zip.asc") [PGP]
-            %a(href="#{dist}/servicemix/servicemix-3/#{version}/apache-servicemix-#{version}-src.zip.sha1") [SHA1]
-            %a(href="#{dist}/servicemix/servicemix-3/#{version}/apache-servicemix-#{version}-src.zip.md5") [MD5]
+            %a(href="#{pgp(source,zip)}") [PGP]
+            %a(href="#{sha1(source,zip)}") [SHA1]
+            %a(href="#{md5(source,zip)}") [MD5]
       %tr
         %td.first
           %p.title Web assembly
           %p Use this if you want to run Apache ServiceMix as a web application inside an existing web container
         %td.both(colspan=2)
           %p.tar
-            %a(href="#{mirror}/servicemix/servicemix-3/#{version}/apache-servicemix-web-#{version}.war")
+            %a(href="#{download(war)}")
               Apache ServiceMix WAR #{version} (tar.gz)
           %p.keys
-            %a(href="#{dist}/servicemix/servicemix-3/#{version}/apache-servicemix-web-#{version}.war.asc") [PGP]
-            %a(href="#{dist}/servicemix/servicemix-3/#{version}/apache-servicemix-web-#{version}.war.asc") [SHA1]
-            %a(href="#{dist}/servicemix/servicemix-3/#{version}/apache-servicemix-web-#{version}.war.asc") [MD5]
+            %a(href="#{pgp(war)}") [PGP]
+            %a(href="#{sha1(war)}") [SHA1]
+            %a(href="#{md5(war)}") [MD5]
 
 
   %div.info

Modified: servicemix/website/trunk/src/main/webapp/downloads/_servicemix4.scaml
URL: http://svn.apache.org/viewvc/servicemix/website/trunk/src/main/webapp/downloads/_servicemix4.scaml?rev=1449281&r1=1449280&r2=1449281&view=diff
==============================================================================
--- servicemix/website/trunk/src/main/webapp/downloads/_servicemix4.scaml (original)
+++ servicemix/website/trunk/src/main/webapp/downloads/_servicemix4.scaml Sat Feb 23 08:28:35 2013
@@ -2,10 +2,20 @@
 -@ val archive: Boolean = false
 
 -
-  val mirror = if (archive) "http://archive.apache.org/dist/" else "http://www.apache.org/dyn/closer.cgi?path="
-  val dist = if (archive) "http://archive.apache.org/dist/" else "http://www.apache.org/dist/"
+  import org.apache.servicemix.website.Release
+  import org.apache.servicemix.website.Helper._
+  implicit val release = Release(version, archive)
 
 %div#downloads
+  - if (isSnapshot(release))
+    %div.alert
+      %p.title
+        This is a development snapshot for an upcoming Apache ServiceMix release.
+        Feel free to use it for testing purposes or to get a sneak preview of new features.
+        For production use, you should download
+        %a{:href => {uri("/downloads.html")}} our latest release
+        instead
+
   %table
     %thead
       %tr
@@ -25,40 +35,44 @@
           %p Our default assembly is the best way to get started with Apache ServiceMix.
         %td
           %p.tar
-            %a(href="#{mirror}servicemix/servicemix-4/#{version}/apache-servicemix-#{version}.tar.gz")
+            %a(href="#{download(tarball)}")
               Apache ServiceMix #{version} (tar.gz)
-          %p.keys
-            %a(href="#{dist}servicemix/servicemix-4/#{version}/apache-servicemix-#{version}.tar.gz.asc") [PGP]
-            %a(href="#{dist}servicemix/servicemix-4/#{version}/apache-servicemix-#{version}.tar.gz.sha1") [SHA1]
-            %a(href="#{dist}servicemix/servicemix-4/#{version}/apache-servicemix-#{version}.tar.gz.md5") [MD5]
+          - if (isRelease(release))
+            %p.keys
+              %a(href="#{pgp(tarball)}") [PGP]
+              %a(href="#{sha1(tarball)}") [SHA1]
+              %a(href="#{md5(tarball)}") [MD5]
         %td
           %p.zip
-            %a(href="#{mirror}servicemix/servicemix-4/#{version}/apache-servicemix-#{version}.zip")
+            %a(href="#{download(zip)}")
               Apache ServiceMix #{version} (zip)
-          %p.keys
-            %a(href="#{dist}servicemix/servicemix-4/#{version}/apache-servicemix-#{version}.zip.asc") [PGP]
-            %a(href="#{dist}servicemix/servicemix-4/#{version}/apache-servicemix-#{version}.zip.sha1") [SHA1]
-            %a(href="#{dist}servicemix/servicemix-4/#{version}/apache-servicemix-#{version}.zip.md5") [MD5]
+          - if (isRelease(release))
+            %p.keys
+              %a(href="#{pgp(zip)}") [PGP]
+              %a(href="#{sha1(zip)}") [SHA1]
+              %a(href="#{md5(zip)}") [MD5]
       %tr
         %td.first
           %p.title Source assembly
           %p Use this if you want to build Apache ServiceMix from source yourself
         %td
           %p.tar
-            %a(href="#{mirror}servicemix/servicemix-4/#{version}/apache-servicemix-#{version}-src.tar.gz")
+            %a(href="#{download(source,tarball)}")
               Apache ServiceMix Sources #{version} (tar.gz)
-          %p.keys
-            %a(href="#{dist}servicemix/servicemix-4/#{version}/apache-servicemix-#{version}-src.tar.gz.asc") [PGP]
-            %a(href="#{dist}servicemix/servicemix-4/#{version}/apache-servicemix-#{version}-src.tar.gz.sha1") [SHA1]
-            %a(href="#{dist}servicemix/servicemix-4/#{version}/apache-servicemix-#{version}-src.tar.gz.md5") [MD5]
+          - if (isRelease(release))
+            %p.keys
+              %a(href="#{pgp(source,tarball)}") [PGP]
+              %a(href="#{sha1(source,tarball)}") [SHA1]
+              %a(href="#{md5(source,tarball)}") [MD5]
         %td
           %p.zip
-            %a(href="#{mirror}servicemix/servicemix-4/#{version}/apache-servicemix-#{version}-src.zip")
+            %a(href="#{download(source,zip)}")
               Apache ServiceMix Sources #{version} (zip)
-          %p.keys
-            %a(href="#{dist}servicemix/servicemix-4/#{version}/apache-servicemix-#{version}-src.zip.asc") [PGP]
-            %a(href="#{dist}servicemix/servicemix-4/#{version}/apache-servicemix-#{version}-src.zip.sha1") [SHA1]
-            %a(href="#{dist}servicemix/servicemix-4/#{version}/apache-servicemix-#{version}-src.zip.md5") [MD5]
+          - if (isRelease(release))
+            %p.keys
+              %a(href="#{pgp(source,zip)}") [PGP]
+              %a(href="#{sha1(source,zip)}") [SHA1]
+              %a(href="#{md5(source,zip)}") [MD5]
 
       - if (version != "4.2.0" && version != "4.3.0")
         %tr
@@ -67,60 +81,66 @@
             %p Use this if you want to run Apache ServiceMix on a server that does not have an internet connection
           %td
             %p.tar
-              %a(href="#{mirror}servicemix/servicemix-4/#{version}/apache-servicemix-full-#{version}.tar.gz")
+              %a(href="#{download(full,tarball)}")
                 Apache ServiceMix Full #{version} (tar.gz)
-            %p.keys
-              %a(href="#{dist}servicemix/servicemix-4/#{version}/apache-servicemix-full-#{version}.tar.gz.asc") [PGP]
-              %a(href="#{dist}servicemix/servicemix-4/#{version}/apache-servicemix-full-#{version}.tar.gz.sha1") [SHA1]
-              %a(href="#{dist}servicemix/servicemix-4/#{version}/apache-servicemix-full-#{version}.tar.gz.md5") [MD5]
+            - if (isRelease(release))
+              %p.keys
+                %a(href="#{pgp(full,tarball)}") [PGP]
+                %a(href="#{sha1(full,tarball)}") [SHA1]
+                %a(href="#{md5(full,tarball)}") [MD5]
           %td
             %p.zip
-              %a(href="#{mirror}servicemix/servicemix-4/#{version}/apache-servicemix-full-#{version}.zip")
+              %a(href="#{download(full,zip)}")
                 Apache ServiceMix Full #{version} (zip)
-            %p.keys
-              %a(href="#{dist}servicemix/servicemix-4/#{version}/apache-servicemix-full-#{version}.zip.asc") [PGP]
-              %a(href="#{dist}servicemix/servicemix-4/#{version}/apache-servicemix-full-#{version}.zip.sha1") [SHA1]
-              %a(href="#{dist}servicemix/servicemix-4/#{version}/apache-servicemix-full-#{version}.zip.md5") [MD5]
+            - if (isRelease(release))
+              %p.keys
+                %a(href="#{pgp(full,zip)}") [PGP]
+                %a(href="#{sha1(full,zip)}") [SHA1]
+                %a(href="#{md5(full,zip)}") [MD5]
         %tr
           %td.first
             %p.title JBI assembly
             %p Use this if you're migrating from ServiceMix 3.x or if you want to reuse your existing JBI artifacts
           %td
             %p.tar
-              %a(href="#{mirror}servicemix/servicemix-4/#{version}/apache-servicemix-jbi-#{version}.tar.gz")
+              %a(href="#{download(jbi,tarball)}")
                 Apache ServiceMix JBI #{version} (tar.gz)
-            %p.keys
-              %a(href="#{dist}servicemix/servicemix-4/#{version}/apache-servicemix-jbi-#{version}.tar.gz.asc") [PGP]
-              %a(href="#{dist}servicemix/servicemix-4/#{version}/apache-servicemix-jbi-#{version}.tar.gz.sha1") [SHA1]
-              %a(href="#{dist}servicemix/servicemix-4/#{version}/apache-servicemix-jbi-#{version}.tar.gz.md5") [MD5]
+            - if (isRelease(release))
+              %p.keys
+                %a(href="#{pgp(jbi,tarball)}") [PGP]
+                %a(href="#{sha1(jbi,tarball)}") [SHA1]
+                %a(href="#{md5(jbi,tarball)}") [MD5]
           %td
             %p.zip
-              %a(href="#{mirror}servicemix/servicemix-4/#{version}/apache-servicemix-jbi-#{version}.zip")
+              %a(href="#{download(jbi,zip)}")
                 Apache ServiceMix JBI #{version} (zip)
-            %p.keys
-              %a(href="#{dist}servicemix/servicemix-4/#{version}/apache-servicemix-jbi-#{version}.zip.asc") [PGP]
-              %a(href="#{dist}servicemix/servicemix-4/#{version}/apache-servicemix-jbi-#{version}.zip.sha1") [SHA1]
-              %a(href="#{dist}servicemix/servicemix-4/#{version}/apache-servicemix-jbi-#{version}.zip.md5") [MD5]
+            - if (isRelease(release))
+              %p.keys
+                %a(href="#{pgp(jbi,zip)}") [PGP]
+                %a(href="#{sha1(jbi,zip)}") [SHA1]
+                %a(href="#{md5(jbi,zip)}") [MD5]
         %tr
           %td.first
             %p.title Minimal assembly
             %p Use this if you're an advanced user that wants to create your own edition of Apache ServiceMix at runtime
           %td
             %p.tar
-              %a(href="#{mirror}servicemix/servicemix-4/#{version}/apache-servicemix-minimal-#{version}.tar.gz")
+              %a(href="#{download(minimal,tarball)}")
                 Apache ServiceMix Minimal #{version} (tar.gz)
-            %p.keys
-              %a(href="#{dist}servicemix/servicemix-4/#{version}/apache-servicemix-minimal-#{version}.tar.gz.asc") [PGP]
-              %a(href="#{dist}servicemix/servicemix-4/#{version}/apache-servicemix-minimal-#{version}.tar.gz.sha1") [SHA1]
-              %a(href="#{dist}servicemix/servicemix-4/#{version}/apache-servicemix-minimal-#{version}.tar.gz.md5") [MD5]
+            - if (isRelease(release))
+              %p.keys
+                %a(href="#{pgp(minimal,tarball)}") [PGP]
+                %a(href="#{sha1(minimal,tarball)}") [SHA1]
+                %a(href="#{md5(minimal,tarball)}") [MD5]
           %td
             %p.zip
-              %a(href="#{mirror}servicemix/servicemix-4/#{version}/apache-servicemix-minimal-#{version}.zip")
+              %a(href="#{download(minimal,zip)}")
                 Apache ServiceMix Minimal #{version} (zip)
-            %p.keys
-              %a(href="#{dist}servicemix/servicemix-4/#{version}/apache-servicemix-minimal-#{version}.zip.asc") [PGP]
-              %a(href="#{dist}servicemix/servicemix-4/#{version}/apache-servicemix-minimal-#{version}.zip.sha1") [SHA1]
-              %a(href="#{dist}servicemix/servicemix-4/#{version}/apache-servicemix-minimal-#{version}.zip.md5") [MD5]
+            - if (isRelease(release))
+              %p.keys
+                %a(href="#{pgp(minimal,zip)}") [PGP]
+                %a(href="#{sha1(minimal,zip)}") [SHA1]
+                %a(href="#{md5(minimal,zip)}") [MD5]
 
   %div.info
     %p.title The above URLs use redirection

Added: servicemix/website/trunk/src/main/webapp/downloads/_servicemix5.scaml
URL: http://svn.apache.org/viewvc/servicemix/website/trunk/src/main/webapp/downloads/_servicemix5.scaml?rev=1449281&view=auto
==============================================================================
--- servicemix/website/trunk/src/main/webapp/downloads/_servicemix5.scaml (added)
+++ servicemix/website/trunk/src/main/webapp/downloads/_servicemix5.scaml Sat Feb 23 08:28:35 2013
@@ -0,0 +1,125 @@
+-@ val version: String
+-@ val archive: Boolean = false
+
+-
+  import org.apache.servicemix.website.Release
+  import org.apache.servicemix.website.Helper._
+  implicit val release = Release(version, archive)
+
+%div#downloads
+  - if (isSnapshot(release))
+    %div.alert
+      %p.title
+        This is a development snapshot for an upcoming Apache ServiceMix release.
+        Feel free to use it for testing purposes or to get a sneak preview of new features.
+        For production use, you should download
+        %a{:href => {uri("/downloads.html")}} our latest release
+        instead
+
+  %table
+    %thead
+      %tr
+        %th.first
+        %th
+          %p Linux/Mac OS X/Unix Downloads
+          %img{:src => {uri("/images/tux.png")}}
+          %img{:src => {uri("/images/freebsd.png")}}
+          %img{:src => {uri("/images/mac_logo.png")}}
+        %th
+          %p Windows Downloads
+          %img{:src => {uri("/images/xp.png")}}
+    %tbody
+      %tr.default
+        %td.first
+          %p.title Default assembly
+          %p Our default assembly is the best way to get started with Apache ServiceMix.
+        %td
+          %p.tar
+            %a(href="#{download(tarball)}")
+              Apache ServiceMix #{version} (tar.gz)
+          - if (isRelease(release))
+            %p.keys
+              %a(href="#{pgp(tarball)}") [PGP]
+              %a(href="#{sha1(tarball)}") [SHA1]
+              %a(href="#{md5(tarball)}") [MD5]
+        %td
+          %p.zip
+            %a(href="#{download(zip)}")
+              Apache ServiceMix #{version} (zip)
+          - if (isRelease(release))
+            %p.keys
+              %a(href="#{pgp(zip)}") [PGP]
+              %a(href="#{sha1(zip)}") [SHA1]
+              %a(href="#{md5(zip)}") [MD5]
+      %tr
+        %td.first
+          %p.title Source assembly
+          %p Use this if you want to build Apache ServiceMix from source yourself
+        %td
+          %p.tar
+            %a(href="#{download(source,tarball)}")
+              Apache ServiceMix Sources #{version} (tar.gz)
+          - if (isRelease(release))
+            %p.keys
+              %a(href="#{pgp(source,tarball)}") [PGP]
+              %a(href="#{sha1(source,tarball)}") [SHA1]
+              %a(href="#{md5(source,tarball)}") [MD5]
+        %td
+          %p.zip
+            %a(href="#{download(source,zip)}")
+              Apache ServiceMix Sources #{version} (zip)
+          - if (isRelease(release))
+            %p.keys
+              %a(href="#{pgp(source,zip)}") [PGP]
+              %a(href="#{sha1(source,zip)}") [SHA1]
+              %a(href="#{md5(source,zip)}") [MD5]
+      %tr
+        %td.first
+          %p.title Full assembly
+          %p Use this if you want to run Apache ServiceMix on a server that does not have an internet connection
+        %td
+          %p.tar
+            %a(href="#{download(full,tarball)}")
+              Apache ServiceMix Full #{version} (tar.gz)
+          - if (isRelease(release))
+            %p.keys
+              %a(href="#{pgp(full,tarball)}") [PGP]
+              %a(href="#{sha1(full,tarball)}") [SHA1]
+              %a(href="#{md5(full,tarball)}") [MD5]
+        %td
+          %p.zip
+            %a(href="#{download(full,zip)}")
+              Apache ServiceMix Full #{version} (zip)
+          - if (isRelease(release))
+            %p.keys
+              %a(href="#{pgp(full,zip)}") [PGP]
+              %a(href="#{sha1(full,zip)}") [SHA1]
+              %a(href="#{md5(full,zip)}") [MD5]
+      %tr
+        %td.first
+          %p.title Minimal assembly
+          %p Use this if you're an advanced user that wants to create your own edition of Apache ServiceMix at runtime
+        %td
+          %p.tar
+            %a(href="#{download(minimal,tarball)}")
+              Apache ServiceMix Minimal #{version} (tar.gz)
+          - if (isRelease(release))
+            %p.keys
+              %a(href="#{pgp(minimal,tarball)}") [PGP]
+              %a(href="#{sha1(minimal,tarball)}") [SHA1]
+              %a(href="#{md5(minimal,tarball)}") [MD5]
+        %td
+          %p.zip
+            %a(href="#{download(minimal,zip)}")
+              Apache ServiceMix Minimal #{version} (zip)
+          - if (isRelease(release))
+            %p.keys
+              %a(href="#{pgp(minimal,zip)}") [PGP]
+              %a(href="#{sha1(minimal,zip)}") [SHA1]
+              %a(href="#{md5(minimal,zip)}") [MD5]
+
+  %div.info
+    %p.title The above URLs use redirection
+    %p
+      The above URLs use the Apache Mirror system to redirect you to a suitable downloads for your download. Some users have experienced issues with some versions of browsers (e.g. some Safari browsers). If the download doesn't seem to work for you from the above URL then try using
+      %a(href="http://www.mozilla.com/en-US/firefox/") FireFox

Added: servicemix/website/trunk/src/main/webapp/downloads/servicemix-4.4.3.page
URL: http://svn.apache.org/viewvc/servicemix/website/trunk/src/main/webapp/downloads/servicemix-4.4.3.page?rev=1449281&view=auto
==============================================================================
--- servicemix/website/trunk/src/main/webapp/downloads/servicemix-4.4.3.page (added)
+++ servicemix/website/trunk/src/main/webapp/downloads/servicemix-4.4.3.page Sat Feb 23 08:28:35 2013
@@ -0,0 +1,18 @@
+---
+title: ServiceMix 4.4.3-SNAPSHOT
+--- name:notes pipeline:conf
+
+h2. Helping us...
+
+You can help us by trying out this development snapshot and reporting any problems you encounter on the [mailing lists|/community/mailing-lists]
+
+An overview of outstanding JIRA issues for this release can be found at https://issues.apache.org/jira/browse/SM/fixforversion/12324078
+
+--- name:content pipeline:ssp
+<%@ val notes : String %>
+
+<h2>Downloads : Apache ServiceMix 4.4.3-SNAPSHOT</h2>
+
+<% render("/downloads/_servicemix4.scaml", Map("version" -> "4.4.3-SNAPSHOT")) %>
+
+<%= unescape(notes) %>

Added: servicemix/website/trunk/src/main/webapp/downloads/servicemix-5.0.0.page
URL: http://svn.apache.org/viewvc/servicemix/website/trunk/src/main/webapp/downloads/servicemix-5.0.0.page?rev=1449281&view=auto
==============================================================================
--- servicemix/website/trunk/src/main/webapp/downloads/servicemix-5.0.0.page (added)
+++ servicemix/website/trunk/src/main/webapp/downloads/servicemix-5.0.0.page Sat Feb 23 08:28:35 2013
@@ -0,0 +1,18 @@
+---
+title: ServiceMix 5.0.0-SNAPSHOT
+--- name:notes pipeline:conf
+
+h2. Helping us...
+
+You can help us by trying out this development snapshot and reporting any problems you encounter on the [mailing lists|/community/mailing-lists]
+
+An overview of outstanding JIRA issues for this release can be found at [https://issues.apache.org/jira/browse/SM/fixforversion/12324078]
+
+--- name:content pipeline:ssp
+<%@ val notes : String %>
+
+<h2>Downloads : Apache ServiceMix 5.0.0-SNAPSHOT</h2>
+
+<% render("/downloads/_servicemix5.scaml", Map("version" -> "5.0.0-SNAPSHOT")) %>
+
+<%= unescape(notes) %>

Added: servicemix/website/trunk/src/test/scala/org/apache/servicemix/website/HelperTest.scala
URL: http://svn.apache.org/viewvc/servicemix/website/trunk/src/test/scala/org/apache/servicemix/website/HelperTest.scala?rev=1449281&view=auto
==============================================================================
--- servicemix/website/trunk/src/test/scala/org/apache/servicemix/website/HelperTest.scala (added)
+++ servicemix/website/trunk/src/test/scala/org/apache/servicemix/website/HelperTest.scala Sat Feb 23 08:28:35 2013
@@ -0,0 +1,74 @@
+/**
+ * Copyright (C) 2009-2013 the original author or authors.
+ * See the notice.md file distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * Licensed 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.servicemix.website
+
+import org.junit.Test
+import org.junit.Assert._
+
+import Helper._
+
+/**
+ * Test cases for download link generation methods
+ */
+class HelperTest {
+
+  @Test
+  def testDownloadsForRelease() = {
+    implicit val release = Release("4.5.0")
+    assertEquals("http://www.apache.org/dyn/closer.cgi?path=servicemix/servicemix-4/4.5.0/apache-servicemix-jbi-4.5.0.tar.gz",
+                 download(jbi, tarball))
+    assertEquals("http://www.apache.org/dyn/closer.cgi?path=servicemix/servicemix-4/4.5.0/apache-servicemix-full-4.5.0.zip",
+                 download(full,zip))
+    assertEquals("http://www.apache.org/dyn/closer.cgi?path=servicemix/servicemix-4/4.5.0/apache-servicemix-4.5.0-src.zip",
+                 download(source,zip))
+    assertEquals("http://www.apache.org/dist/servicemix/servicemix-4/4.5.0/apache-servicemix-minimal-4.5.0.zip.asc",
+                 pgp(minimal,zip))
+  }
+
+  @Test
+  def testDownloadsForArchivedRelease() = {
+    implicit val release = Release("4.4.0", true)
+    assertEquals("http://archive.apache.org/dist/servicemix/servicemix-4/4.4.0/apache-servicemix-jbi-4.4.0.tar.gz",
+                 download(jbi, tarball))
+    assertEquals("http://archive.apache.org/dist/servicemix/servicemix-4/4.4.0/apache-servicemix-full-4.4.0.zip",
+                 download(full,zip))
+    assertEquals("http://archive.apache.org/dist/servicemix/servicemix-4/4.4.0/apache-servicemix-4.4.0-src.zip",
+                 download(source,zip))
+    assertEquals("http://archive.apache.org/dist/servicemix/servicemix-4/4.4.0/apache-servicemix-minimal-4.4.0.zip.sha1",
+                 sha1(minimal,zip))
+  }
+
+  @Test
+  def testDownloadsForWarRelease() = {
+    implicit val release = Release("3.4.0", true)
+    assertEquals("http://archive.apache.org/dist/servicemix/servicemix-3/3.4.0/apache-servicemix-web-3.4.0.war",
+                 download(war))
+    assertEquals("http://archive.apache.org/dist/servicemix/servicemix-3/3.4.0/apache-servicemix-web-3.4.0.war.md5",
+                 md5(war))
+  }
+
+  @Test
+  def testDownloadsForSnapshotRelease() = {
+    implicit val release = Release("5.0.0-SNAPSHOT")
+    assertEquals("http://repository.apache.org/service/local/artifact/maven/redirect?r=snapshots&g=org.apache.servicemix&a=apache-servicemix&v=5.0.0-SNAPSHOT&p=tar.gz",
+                 download(tarball))
+    assertEquals("http://repository.apache.org/service/local/artifact/maven/redirect?r=snapshots&g=org.apache.servicemix&a=apache-servicemix-full&v=5.0.0-SNAPSHOT&p=zip",
+                 download(full,zip))
+  }
+
+}