Author: gertv
Date: Tue May 7 07:02:25 2013
New Revision: 1479782
URL: http://svn.apache.org/r1479782
Log:
Default to 4.5.x docs and add docs links to download pages
Modified:
servicemix/website/trunk/src/main/scala/org/apache/servicemix/website/Helper.scala
servicemix/website/trunk/src/main/webapp/css/downloads.css
servicemix/website/trunk/src/main/webapp/downloads/_servicemix4.scaml
servicemix/website/trunk/src/main/webapp/downloads/_servicemix5.scaml
servicemix/website/trunk/src/main/webapp/site/navigation.page
servicemix/website/trunk/src/test/scala/org/apache/servicemix/website/HelperTest.scala
Modified:
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=1479782&r1=1479781&r2=1479782&view=diff
==============================================================================
---
servicemix/website/trunk/src/main/scala/org/apache/servicemix/website/Helper.scala
(original)
+++
servicemix/website/trunk/src/main/scala/org/apache/servicemix/website/Helper.scala
Tue May 7 07:02:25 2013
@@ -49,6 +49,11 @@ object Helper {
def sha1(specs: (ReleaseArtifact => ReleaseArtifact)*)(implicit release:
Release) : String = _metafile(artifactFor(specs, release), "sha1")
/**
+ * The version specific docs url for a page
+ */
+ def docs(page: String)(implicit release: Release) =
s"http://servicemix.apache.org/docs/${release.majorMinorX}/${page}"
+
+ /**
* Function to specify a -minimal assembly
*/
val minimal : ReleaseArtifact => ReleaseArtifact = (artifact) => artifact
match {
@@ -148,4 +153,11 @@ object Helper {
* @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)
+case class Release(version: String, archived: Boolean = false) {
+
+ lazy val majorMinorX = version.split("\\.").slice(0,2) match {
+ case Array(major, minor) => s"${major}.${minor}.x"
+ case _ => throw new RuntimeException(s"Unable to convert
${version} to <major>.<minor>.x format")
+ }
+
+}
Modified: servicemix/website/trunk/src/main/webapp/css/downloads.css
URL:
http://svn.apache.org/viewvc/servicemix/website/trunk/src/main/webapp/css/downloads.css?rev=1479782&r1=1479781&r2=1479782&view=diff
==============================================================================
--- servicemix/website/trunk/src/main/webapp/css/downloads.css (original)
+++ servicemix/website/trunk/src/main/webapp/css/downloads.css Tue May 7
07:02:25 2013
@@ -120,4 +120,13 @@ div#downloads p.title {
div#downloads td.both {
padding-left: 20%;
+ width: 100%;
+}
+
+div#downloads td.docs {
+ text-align: center;
+}
+
+div#downloads td.docs p.home {
+ font-weight: bold;
}
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=1479782&r1=1479781&r2=1479782&view=diff
==============================================================================
--- servicemix/website/trunk/src/main/webapp/downloads/_servicemix4.scaml
(original)
+++ servicemix/website/trunk/src/main/webapp/downloads/_servicemix4.scaml Tue
May 7 07:02:25 2013
@@ -141,6 +141,20 @@
%a(href="#{pgp(minimal,zip)}") [PGP]
%a(href="#{sha1(minimal,zip)}") [SHA1]
%a(href="#{md5(minimal,zip)}") [MD5]
+ %tr
+ %td.first
+ %p.title Documentation
+ %p Links to the documentation pages for this version
+ %td.docs(colspan=2)
+ %p.home
+ %a{:href => {docs("index.html")}}
+ Documentation for Apache ServiceMix #{release.majorMinorX}
+ %p
+ %a{:href => {docs("quickstart/index.html")}} [Quickstart]
+ %a{:href => {docs("activemq/index.html")}} [ActiveMQ]
+ %a{:href => {docs("camel/index.html")}} [Camel]
+ %a{:href => {docs("camel/index.html")}} [NMR]
+ %a{:href => {docs("camel/index.html")}} [JBI]
%div.info
%p.title The above URLs use redirection
Modified: 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=1479782&r1=1479781&r2=1479782&view=diff
==============================================================================
--- servicemix/website/trunk/src/main/webapp/downloads/_servicemix5.scaml
(original)
+++ servicemix/website/trunk/src/main/webapp/downloads/_servicemix5.scaml Tue
May 7 07:02:25 2013
@@ -117,6 +117,18 @@
%a(href="#{pgp(minimal,zip)}") [PGP]
%a(href="#{sha1(minimal,zip)}") [SHA1]
%a(href="#{md5(minimal,zip)}") [MD5]
+ %tr
+ %td.first
+ %p.title Documentation
+ %p Links to the documentation pages for this version
+ %td.docs(colspan=2)
+ %p.home
+ %a{:href => {docs("index.html")}}
+ Documentation for Apache ServiceMix #{release.majorMinorX}
+ %p
+ %a{:href => {docs("quickstart/index.html")}} [Quickstart]
+ %a{:href => {docs("activemq/index.html")}} [ActiveMQ]
+ %a{:href => {docs("camel/index.html")}} [Camel]
%div.info
%p.title The above URLs use redirection
Modified: servicemix/website/trunk/src/main/webapp/site/navigation.page
URL:
http://svn.apache.org/viewvc/servicemix/website/trunk/src/main/webapp/site/navigation.page?rev=1479782&r1=1479781&r2=1479782&view=diff
==============================================================================
--- servicemix/website/trunk/src/main/webapp/site/navigation.page (original)
+++ servicemix/website/trunk/src/main/webapp/site/navigation.page Tue May 7
07:02:25 2013
@@ -10,8 +10,8 @@ h3. [Overview|index]
h3. [Documentation]
{html}
<ul>
-<li><a href="http://servicemix.apache.org/docs/4.4.x/quickstart/index.html"
target="quickstart">Quickstart Guide</a></li>
-<li><a href="http://servicemix.apache.org/docs/4.4.x/index.html"
target="documentation">Documentation: 4.4.x</a></li>
+<li><a href="http://servicemix.apache.org/docs/4.5.x/quickstart/index.html"
target="quickstart">Quickstart Guide</a></li>
+<li><a href="http://servicemix.apache.org/docs/4.5.x/index.html"
target="documentation">Documentation: 4.5.x</a></li>
</ul>
{html}
Modified:
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=1479782&r1=1479781&r2=1479782&view=diff
==============================================================================
---
servicemix/website/trunk/src/test/scala/org/apache/servicemix/website/HelperTest.scala
(original)
+++
servicemix/website/trunk/src/test/scala/org/apache/servicemix/website/HelperTest.scala
Tue May 7 07:02:25 2013
@@ -71,4 +71,19 @@ class HelperTest {
download(full,zip))
}
+ @Test
+ def testDocumentationForSnapshotRelease = {
+ implicit val release = Release("4.5.2-SNAPSHOT")
+ assertEquals("http://servicemix.apache.org/docs/4.5.x/index.html",
docs("index.html"))
+
assertEquals("http://servicemix.apache.org/docs/4.5.x/quickstart/index.html",
docs("quickstart/index.html"))
+ }
+
+ @Test
+ def testDocumentationForRelease = {
+ implicit val release = Release("4.4.2")
+ assertEquals("http://servicemix.apache.org/docs/4.4.x/index.html",
docs("index.html"))
+
assertEquals("http://servicemix.apache.org/docs/4.4.x/quickstart/index.html",
docs("quickstart/index.html"))
+ }
+
+
}