You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by tv...@apache.org on 2009/11/23 22:12:24 UTC

svn commit: r883501 - in /incubator/pivot/trunk: build.xml demos/www/index.html demos/www/index.xml demos/xsl/demo.html.xsl demos/xsl/demo.jnlp.xsl demos/xsl/html.xsl demos/xsl/index.xsl demos/xsl/jnlp.xsl

Author: tvolkert
Date: Mon Nov 23 21:12:23 2009
New Revision: 883501

URL: http://svn.apache.org/viewvc?rev=883501&view=rev
Log:
Migrated demos index page to use XSLT to dynamically create the page from the demo XML documents

Added:
    incubator/pivot/trunk/demos/xsl/demo.html.xsl
      - copied unchanged from r883489, incubator/pivot/trunk/demos/xsl/html.xsl
    incubator/pivot/trunk/demos/xsl/demo.jnlp.xsl
      - copied unchanged from r883489, incubator/pivot/trunk/demos/xsl/jnlp.xsl
    incubator/pivot/trunk/demos/xsl/index.xsl   (with props)
Removed:
    incubator/pivot/trunk/demos/www/index.html
    incubator/pivot/trunk/demos/xsl/html.xsl
    incubator/pivot/trunk/demos/xsl/jnlp.xsl
Modified:
    incubator/pivot/trunk/build.xml
    incubator/pivot/trunk/demos/www/index.xml

Modified: incubator/pivot/trunk/build.xml
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/build.xml?rev=883501&r1=883500&r2=883501&view=diff
==============================================================================
--- incubator/pivot/trunk/build.xml (original)
+++ incubator/pivot/trunk/build.xml Mon Nov 23 21:12:23 2009
@@ -613,11 +613,18 @@
             </fileset>
         </copy>
 
+        <!-- Transform demos index -->
+        <xslt basedir="demos/www"
+            destdir="demos/www"
+            extension=".html"
+            style="demos/xsl/index.xsl"
+            includes="index.xml"/>
+
         <!-- Transform demos html -->
         <xslt basedir="demos/www"
             destdir="demos/www"
             extension=".html"
-            style="demos/xsl/html.xsl"
+            style="demos/xsl/demo.html.xsl"
             includes="*.xml"
             excludes="index.xml">
             <param name="release" expression="${version}"/>
@@ -627,7 +634,7 @@
         <xslt basedir="demos/www"
             destdir="demos/www"
             extension=".jnlp"
-            style="demos/xsl/jnlp.xsl"
+            style="demos/xsl/demo.jnlp.xsl"
             includes="*.xml"
             excludes="index.xml">
             <param name="release" expression="${version}"/>

Modified: incubator/pivot/trunk/demos/www/index.xml
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/demos/www/index.xml?rev=883501&r1=883500&r2=883501&view=diff
==============================================================================
--- incubator/pivot/trunk/demos/www/index.xml (original)
+++ incubator/pivot/trunk/demos/www/index.xml Mon Nov 23 21:12:23 2009
@@ -25,19 +25,33 @@
         <p>
             This page contains a collection of Pivot demos. All demos require Java 6 or greater.
         </p>
-        <demo id="kitchen-sink" featured="true"/>
-        <demo id="stock-tracker"/>
-        <demo id="itunes-search"/>
-        <demo id="json-viewer"/>
-        <demo id="xml-viewer"/>
+        <demo id="kitchen-sink" featured="true">
+            <screenshot kind="large">kitchen-sink.png</screenshot>
+        </demo>
+        <demo id="stock-tracker">
+            <screenshot kind="large">stock-tracker.png</screenshot>
+        </demo>
+        <demo id="itunes-search">
+            <screenshot kind="large">itunes-search.png</screenshot>
+        </demo>
+        <demo id="json-viewer">
+            <screenshot kind="large">json-viewer.png</screenshot>
+        </demo>
+        <demo id="xml-viewer">
+            <screenshot kind="large">xml-viewer.png</screenshot>
+        </demo>
         <demo id="scripting"/>
         <demo id="file-drag-drop"/>
         <demo id="table-row-editor"/>
-        <demo id="animated-clock"/>
+        <demo id="animated-clock">
+            <screenshot kind="large">animated-clock.png</screenshot>
+        </demo>
         <demo id="large-data"/>
         <demo id="rss-feed"/>
         <demo id="dom-interaction"/>
-        <demo id="decorators"/>
+        <demo id="decorators">
+            <screenshot kind="large">decorators.png</screenshot>
+        </demo>
         <demo id="fixed-column-table"/>
         <demo id="multiselect"/>
     </body>

Added: incubator/pivot/trunk/demos/xsl/index.xsl
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/demos/xsl/index.xsl?rev=883501&view=auto
==============================================================================
--- incubator/pivot/trunk/demos/xsl/index.xsl (added)
+++ incubator/pivot/trunk/demos/xsl/index.xsl Mon Nov 23 21:12:23 2009
@@ -0,0 +1,113 @@
+<?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.
+-->
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+    <xsl:param name="release"/>
+
+    <!-- Output method -->
+    <xsl:output method="html" encoding="UTF-8" indent="no"
+        doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
+        doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
+
+    <xsl:template match="document">
+        <html xmlns="http://www.w3.org/1999/xhtml">
+            <head>
+                <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+                <title>Pivot Demos</title>
+                <link rel="stylesheet" href="demo.css" type="text/css"/>
+                <link rel="icon" href="favicon.png" type="image/png" />
+                <link rel="shortcut icon" href="favicon.png" type="image/png" />
+                <style>
+                    body {
+                        font-family:Verdana;
+                        font-size:11px;
+                    }
+
+                    p.caption {
+                        font-style:italic;
+                        padding-top:0px;
+                    }
+
+                    p.command {
+                        font-family:"Consolas", "Monaco", "Bitstream Vera Sans Mono", "Courier New";
+                        background-color:#E7E5DC;
+                        padding-top:12px;
+                        padding-left:24px;
+                        padding-bottom:12px;
+                        padding-right:24px;
+                    }
+
+                    pre.snippet {
+                        padding:6px;
+                        border:#E7E5DC solid 1px;
+                        font-family:"Consolas", "Monaco", "Bitstream Vera Sans Mono", "Courier New";
+                        font-size:1em;
+                    }
+
+                    tt {
+                        font-family:"Consolas", "Monaco", "Bitstream Vera Sans Mono", "Courier New";
+                    }
+
+                    table {
+                        font-size:11px;
+                    }
+
+                    img {
+                        vertical-align: middle;
+                    }
+                </style>
+                <script xmlns="" type="text/javascript" src="http://java.com/js/deployJava.js"></script>
+                <xsl:apply-templates select="head"/>
+            </head>
+
+            <body>
+                <xsl:apply-templates select="body"/>
+            </body>
+        </html>
+    </xsl:template>
+
+    <xsl:template match="head">
+        <xsl:apply-templates/>
+    </xsl:template>
+
+    <xsl:template match="body">
+        <xsl:apply-templates/>
+    </xsl:template>
+
+    <xsl:template match="demo">
+        <xsl:if test="position()&gt;1">
+            <hr/>
+        </xsl:if>
+
+        <xsl:variable name="id" select="@id"/>
+        <xsl:variable name="demo" select="document(concat('../www/', $id, '.xml'))/document"/>
+
+        <h3><a href="{$id}.html"><xsl:value-of select="$demo/properties/title"/></a></h3>
+        <p><xsl:value-of select="$demo/properties/description"/></p>
+        <xsl:if test="screenshot[@kind='large']">
+            <xsl:variable name="src" select="screenshot[@kind='large']"/>
+            <p><img src="{$src}"/></p>
+        </xsl:if>
+    </xsl:template>
+
+    <xsl:template match="*|@*">
+        <xsl:copy>
+            <xsl:apply-templates select="@*|*|text()"/>
+        </xsl:copy>
+    </xsl:template>
+</xsl:stylesheet>

Propchange: incubator/pivot/trunk/demos/xsl/index.xsl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/pivot/trunk/demos/xsl/index.xsl
------------------------------------------------------------------------------
    svn:mime-type = text/xml