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 04:49:14 UTC
svn commit: r883236 - in /incubator/pivot/trunk: ./ demos/www/ demos/xsl/
Author: tvolkert
Date: Mon Nov 23 03:49:12 2009
New Revision: 883236
URL: http://svn.apache.org/viewvc?rev=883236&view=rev
Log:
Removed static JNLP files in favor of dynamically generated ones at build time using XSLT
Added:
incubator/pivot/trunk/demos/xsl/jnlp.xsl
Removed:
incubator/pivot/trunk/demos/www/animated_clock.jnlp
incubator/pivot/trunk/demos/www/decorators.jnlp
incubator/pivot/trunk/demos/www/file_drag_drop.jnlp
incubator/pivot/trunk/demos/www/fixed_column_table.jnlp
incubator/pivot/trunk/demos/www/itunes_search.jnlp
incubator/pivot/trunk/demos/www/jnlp_properties.jsp
incubator/pivot/trunk/demos/www/json_viewer.jnlp
incubator/pivot/trunk/demos/www/kitchen_sink.custom_colors.jnlp
incubator/pivot/trunk/demos/www/kitchen_sink.jnlp
incubator/pivot/trunk/demos/www/kitchen_sink.signed.jnlp
incubator/pivot/trunk/demos/www/large_data.jnlp
incubator/pivot/trunk/demos/www/multiselect.jnlp
incubator/pivot/trunk/demos/www/pivot-runtime.jnlp
incubator/pivot/trunk/demos/www/pivot-runtime.signed.jnlp
incubator/pivot/trunk/demos/www/rss_feed.jnlp
incubator/pivot/trunk/demos/www/scripting.jnlp
incubator/pivot/trunk/demos/www/stock_tracker.jnlp
incubator/pivot/trunk/demos/www/stock_tracker_fr.jnlp
incubator/pivot/trunk/demos/www/table_row_editor.jnlp
incubator/pivot/trunk/demos/www/version.template.jsp
incubator/pivot/trunk/demos/www/xml_viewer.jnlp
Modified:
incubator/pivot/trunk/build.xml
incubator/pivot/trunk/demos/www/kitchen-sink.xml
incubator/pivot/trunk/demos/www/web_start.jsp
Modified: incubator/pivot/trunk/build.xml
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/build.xml?rev=883236&r1=883235&r2=883236&view=diff
==============================================================================
--- incubator/pivot/trunk/build.xml (original)
+++ incubator/pivot/trunk/build.xml Mon Nov 23 03:49:12 2009
@@ -449,6 +449,7 @@
<clean-www project="demos"/>
<delete>
<fileset dir="demos/www" includes="*.html" excludes="index.html"/>
+ <fileset dir="demos/www" includes="*.jnlp"/>
</delete>
</target>
@@ -614,6 +615,7 @@
</fileset>
</copy>
+ <!-- Transform demos html -->
<xslt basedir="demos/www"
destdir="demos/www"
extension=".html"
@@ -623,13 +625,15 @@
<param name="release" expression="${version}"/>
</xslt>
- <!-- Generate demos version templates -->
- <copy todir="demos/www" filtering="true">
- <fileset dir="demos/www">
- <include name="version.template.jsp"/>
- </fileset>
- <mapper type="glob" from="version.template.jsp" to="version.jsp"/>
- </copy>
+ <!-- Transform demos jnlp -->
+ <xslt basedir="demos/www"
+ destdir="demos/www"
+ extension=".jnlp"
+ style="demos/xsl/jnlp.xsl"
+ includes="*.xml"
+ excludes="index.xml">
+ <param name="release" expression="${version}"/>
+ </xslt>
<!-- Generate demos WAR -->
<war destfile="${folder.lib}/${ant.project.name}-demos.war" webxml="demos/web.xml">
Modified: incubator/pivot/trunk/demos/www/kitchen-sink.xml
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/demos/www/kitchen-sink.xml?rev=883236&r1=883235&r2=883236&view=diff
==============================================================================
--- incubator/pivot/trunk/demos/www/kitchen-sink.xml (original)
+++ incubator/pivot/trunk/demos/www/kitchen-sink.xml Mon Nov 23 03:49:12 2009
@@ -16,6 +16,10 @@
limitations under the License.
-->
+<!--
+TODO create version that specifies system property:
+org.apache.pivot.wtk.skin.terra.location=org/apache/pivot/tutorials/TerraTheme_dark.json
+-->
<document group="demos">
<properties>
<title>Pivot "Kitchen Sink" Demo</title>
Modified: incubator/pivot/trunk/demos/www/web_start.jsp
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/demos/www/web_start.jsp?rev=883236&r1=883235&r2=883236&view=diff
==============================================================================
--- incubator/pivot/trunk/demos/www/web_start.jsp (original)
+++ incubator/pivot/trunk/demos/www/web_start.jsp Mon Nov 23 03:49:12 2009
@@ -81,21 +81,21 @@
<td>
Unsigned:
<script>
-var url = "<%= codebase %>kitchen_sink.jnlp";
+var url = "<%= codebase %>kitchen-sink.jnlp";
deployJava.createWebStartLaunchButton(url, '1.6');
</script>
</td>
<td>
Signed:
<script>
-var url = "<%= codebase %>kitchen_sink.signed.jnlp";
+var url = "<%= codebase %>kitchen-sink.signed.jnlp";
deployJava.createWebStartLaunchButton(url, '1.6');
</script>
</td>
<td>
Signed, with custom color scheme:
<script>
-var url = "<%= codebase %>kitchen_sink.custom_colors.jnlp";
+var url = "<%= codebase %>kitchen-sink.custom-colors.jnlp";
deployJava.createWebStartLaunchButton(url, '1.6');
</script>
</td>
@@ -114,14 +114,14 @@
<td>
Signed:
<script>
-var url = "<%= codebase %>stock_tracker.jnlp";
+var url = "<%= codebase %>stock-tracker.jnlp";
deployJava.createWebStartLaunchButton(url, '1.6');
</script>
</td>
<td>
Signed, in French locale (fr):
<script>
-var url = "<%= codebase %>stock_tracker_fr.jnlp";
+var url = "<%= codebase %>stock-tracker_fr.jnlp";
deployJava.createWebStartLaunchButton(url, '1.6');
</script>
</td>
@@ -139,7 +139,7 @@
<td>
Signed:
<script>
-var url = "<%= codebase %>itunes_search.jnlp";
+var url = "<%= codebase %>itunes-search.jnlp";
deployJava.createWebStartLaunchButton(url, '1.6');
</script>
</td>
@@ -156,7 +156,7 @@
<td>
Signed:
<script>
-var url = "<%= codebase %>json_viewer.jnlp";
+var url = "<%= codebase %>json-viewer.jnlp";
deployJava.createWebStartLaunchButton(url, '1.6');
</script>
</td>
@@ -173,7 +173,7 @@
<td>
Signed:
<script>
-var url = "<%= codebase %>xml_viewer.jnlp";
+var url = "<%= codebase %>xml-viewer.jnlp";
deployJava.createWebStartLaunchButton(url, '1.6');
</script>
</td>
@@ -205,7 +205,7 @@
<td>
Signed:
<script>
-var url = "<%= codebase %>file_drag_drop.jnlp";
+var url = "<%= codebase %>file-drag-drop.jnlp";
deployJava.createWebStartLaunchButton(url, '1.6');
</script>
</td>
@@ -222,7 +222,7 @@
<td>
Unsigned:
<script>
-var url = "<%= codebase %>table_row_editor.jnlp";
+var url = "<%= codebase %>table-row-editor.jnlp";
deployJava.createWebStartLaunchButton(url, '1.6');
</script>
</td>
@@ -240,7 +240,7 @@
<td>
Unsigned:
<script>
-var url = "<%= codebase %>animated_clock.jnlp";
+var url = "<%= codebase %>animated-clock.jnlp";
deployJava.createWebStartLaunchButton(url, '1.6');
</script>
</td>
@@ -257,7 +257,7 @@
<td>
Unsigned:
<script>
-var url = "<%= codebase %>large_data.jnlp";
+var url = "<%= codebase %>large-data.jnlp";
deployJava.createWebStartLaunchButton(url, '1.6');
</script>
</td>
@@ -273,7 +273,7 @@
<td>
Unsigned:
<script>
-var url = "<%= codebase %>rss_feed.jnlp";
+var url = "<%= codebase %>rss-feed.jnlp";
deployJava.createWebStartLaunchButton(url, '1.6');
</script>
</td>
@@ -310,7 +310,7 @@
<td>
Unsigned:
<script>
-var url = "<%= codebase %>fixed_column_table.jnlp";
+var url = "<%= codebase %>fixed-column-table.jnlp";
deployJava.createWebStartLaunchButton(url, '1.6');
</script>
</td>
Added: incubator/pivot/trunk/demos/xsl/jnlp.xsl
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/demos/xsl/jnlp.xsl?rev=883236&view=auto
==============================================================================
--- incubator/pivot/trunk/demos/xsl/jnlp.xsl (added)
+++ incubator/pivot/trunk/demos/xsl/jnlp.xsl Mon Nov 23 03:49:12 2009
@@ -0,0 +1,144 @@
+<?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">
+ <!-- Output method -->
+ <xsl:output method="text"/>
+
+ <!-- Defined parameters (overrideable) -->
+ <xsl:param name="release"/>
+
+ <xsl:variable name="jar-core">
+ <xsl:value-of select="'lib/pivot-core-'"/>
+ <xsl:value-of select="$release"/>
+ <xsl:value-of select="'.jar'"/>
+ </xsl:variable>
+
+ <xsl:variable name="jar-wtk">
+ <xsl:value-of select="'lib/pivot-wtk-'"/>
+ <xsl:value-of select="$release"/>
+ <xsl:value-of select="'.jar'"/>
+ </xsl:variable>
+
+ <xsl:variable name="jar-wtk-terra">
+ <xsl:value-of select="'lib/pivot-wtk-'"/>
+ <xsl:value-of select="$release"/>
+ <xsl:value-of select="'.terra.jar'"/>
+ </xsl:variable>
+
+ <xsl:variable name="jar-web">
+ <xsl:value-of select="'lib/pivot-web-'"/>
+ <xsl:value-of select="$release"/>
+ <xsl:value-of select="'.jar'"/>
+ </xsl:variable>
+
+ <xsl:variable name="jar-demos">
+ <xsl:value-of select="'lib/pivot-demos-'"/>
+ <xsl:value-of select="$release"/>
+ <xsl:value-of select="'.jar'"/>
+ </xsl:variable>
+
+ <xsl:variable name="jar-tutorials">
+ <xsl:value-of select="'lib/pivot-tutorials-'"/>
+ <xsl:value-of select="$release"/>
+ <xsl:value-of select="'.jar'"/>
+ </xsl:variable>
+
+ <xsl:variable name="jar-tools">
+ <xsl:value-of select="'lib/pivot-tools-'"/>
+ <xsl:value-of select="$release"/>
+ <xsl:value-of select="'.jar'"/>
+ </xsl:variable>
+
+ <xsl:variable name="title">
+ <xsl:value-of select="//document/properties/title"/>
+ </xsl:variable>
+
+ <xsl:template match="demo">
+ <?xml version="1.0" encoding="UTF-8" ?>
+
+ <%@ page language="java" contentType="application/x-java-jnlp-file" pageEncoding="UTF-8" %>
+ <%@ include file="jnlp_common.jsp" %>
+
+ <jnlp spec="1.6+" codebase="<%= codebase %>" href="<%= href %>">
+ <information>
+ <title><xsl:value-of select="$title"/></title>
+ <vendor>Apache Pivot</vendor>
+ <homepage href="http://pivot.apache.org/"/>
+ <icon kind="shortcut" href="logo.png"/>
+ <offline-allowed/>
+ <shortcut online="false">
+ <desktop/>
+ </shortcut>
+ </information>
+
+ <resources>
+ <property name="jnlp.packEnabled" value="true"/>
+ <property name="sun.awt.noerasebackground" value="true"/>
+ <property name="sun.awt.erasebackgroundonresize=true" value="true"/>
+
+ <java version="1.6+" href="http://java.sun.com/products/autodl/j2se"/>
+
+ <xsl:for-each select="libraries/library">
+ <xsl:choose>
+ <xsl:when test=".='core'">
+ <jar href="<xsl:value-of select="$jar-core"/>"/>
+ </xsl:when>
+ <xsl:when test=".='wtk'">
+ <jar href="<xsl:value-of select="$jar-wtk"/>" main="true"/>
+ <jar href="<xsl:value-of select="$jar-wtk-terra"/>"/>
+ </xsl:when>
+ <xsl:when test=".='web'">
+ <jar href="<xsl:value-of select="$jar-web"/>"/>
+ </xsl:when>
+ <xsl:when test=".='demos'">
+ <jar href="<xsl:value-of select="$jar-demos"/>"/>
+ </xsl:when>
+ <xsl:when test=".='tutorials'">
+ <jar href="<xsl:value-of select="$jar-tutorials"/>"/>
+ </xsl:when>
+ <xsl:when test=".='tools'">
+ <jar href="<xsl:value-of select="$jar-tools"/>"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:for-each>
+ </resources>
+
+ <application-desc main-class="org.apache.pivot.wtk.DesktopApplicationContext">
+ <xsl:for-each select="parameters/*">
+ <xsl:choose>
+ <xsl:when test="name(.)='class-name'">
+ <argument><xsl:value-of select="."/></argument>
+ </xsl:when>
+ <xsl:otherwise>
+ <argument>
+ --<xsl:value-of select="name(.)"/>=<xsl:value-of select="."/>
+ </argument>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </application-desc>
+
+ <update check="background"/>
+ </jnlp>
+ </xsl:template>
+
+ <xsl:template match="*|@*">
+ <xsl:apply-templates select="*"/>
+ </xsl:template>
+</xsl:stylesheet>