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/12/04 20:10:38 UTC
svn commit: r887324 - in /incubator/pivot/trunk/demos: www/ xsl/
Author: tvolkert
Date: Fri Dec 4 19:10:37 2009
New Revision: 887324
URL: http://svn.apache.org/viewvc?rev=887324&view=rev
Log:
Updated demos XML/XSL to explicitly use wtk-terra as a library
Modified:
incubator/pivot/trunk/demos/www/animated-clock.xml
incubator/pivot/trunk/demos/www/component-explorer.xml
incubator/pivot/trunk/demos/www/decorators.xml
incubator/pivot/trunk/demos/www/dom-interaction.xml
incubator/pivot/trunk/demos/www/file-drag-drop.xml
incubator/pivot/trunk/demos/www/fixed-column-table.xml
incubator/pivot/trunk/demos/www/itunes-search.xml
incubator/pivot/trunk/demos/www/json-viewer.xml
incubator/pivot/trunk/demos/www/kitchen-sink.xml
incubator/pivot/trunk/demos/www/large-data.xml
incubator/pivot/trunk/demos/www/multiselect.xml
incubator/pivot/trunk/demos/www/rss-feed.xml
incubator/pivot/trunk/demos/www/stock-tracker.xml
incubator/pivot/trunk/demos/www/table-row-editor.xml
incubator/pivot/trunk/demos/www/xml-viewer.xml
incubator/pivot/trunk/demos/xsl/demo.html.xsl
incubator/pivot/trunk/demos/xsl/demo.jnlp.xsl
Modified: incubator/pivot/trunk/demos/www/animated-clock.xml
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/demos/www/animated-clock.xml?rev=887324&r1=887323&r2=887324&view=diff
==============================================================================
--- incubator/pivot/trunk/demos/www/animated-clock.xml (original)
+++ incubator/pivot/trunk/demos/www/animated-clock.xml Fri Dec 4 19:10:37 2009
@@ -34,6 +34,7 @@
<libraries>
<library>core</library>
<library>wtk</library>
+ <library>wtk-terra</library>
<library>demos</library>
</libraries>
</application>
Modified: incubator/pivot/trunk/demos/www/component-explorer.xml
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/demos/www/component-explorer.xml?rev=887324&r1=887323&r2=887324&view=diff
==============================================================================
--- incubator/pivot/trunk/demos/www/component-explorer.xml (original)
+++ incubator/pivot/trunk/demos/www/component-explorer.xml Fri Dec 4 19:10:37 2009
@@ -31,6 +31,7 @@
<libraries>
<library>core</library>
<library>wtk</library>
+ <library>wtk-terra</library>
<library>tools</library>
<library>tutorials</library>
</libraries>
Modified: incubator/pivot/trunk/demos/www/decorators.xml
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/demos/www/decorators.xml?rev=887324&r1=887323&r2=887324&view=diff
==============================================================================
--- incubator/pivot/trunk/demos/www/decorators.xml (original)
+++ incubator/pivot/trunk/demos/www/decorators.xml Fri Dec 4 19:10:37 2009
@@ -37,6 +37,7 @@
<libraries>
<library>core</library>
<library>wtk</library>
+ <library>wtk-terra</library>
<library>demos</library>
</libraries>
</application>
Modified: incubator/pivot/trunk/demos/www/dom-interaction.xml
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/demos/www/dom-interaction.xml?rev=887324&r1=887323&r2=887324&view=diff
==============================================================================
--- incubator/pivot/trunk/demos/www/dom-interaction.xml (original)
+++ incubator/pivot/trunk/demos/www/dom-interaction.xml Fri Dec 4 19:10:37 2009
@@ -53,6 +53,7 @@
<libraries>
<library>core</library>
<library>wtk</library>
+ <library>wtk-terra</library>
<library>demos</library>
</libraries>
<attributes>
Modified: incubator/pivot/trunk/demos/www/file-drag-drop.xml
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/demos/www/file-drag-drop.xml?rev=887324&r1=887323&r2=887324&view=diff
==============================================================================
--- incubator/pivot/trunk/demos/www/file-drag-drop.xml (original)
+++ incubator/pivot/trunk/demos/www/file-drag-drop.xml Fri Dec 4 19:10:37 2009
@@ -35,6 +35,7 @@
<libraries>
<library>core</library>
<library>wtk</library>
+ <library>wtk-terra</library>
<library>demos</library>
</libraries>
</application>
Modified: incubator/pivot/trunk/demos/www/fixed-column-table.xml
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/demos/www/fixed-column-table.xml?rev=887324&r1=887323&r2=887324&view=diff
==============================================================================
--- incubator/pivot/trunk/demos/www/fixed-column-table.xml (original)
+++ incubator/pivot/trunk/demos/www/fixed-column-table.xml Fri Dec 4 19:10:37 2009
@@ -35,6 +35,7 @@
<libraries>
<library>core</library>
<library>wtk</library>
+ <library>wtk-terra</library>
<library>demos</library>
</libraries>
</application>
Modified: incubator/pivot/trunk/demos/www/itunes-search.xml
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/demos/www/itunes-search.xml?rev=887324&r1=887323&r2=887324&view=diff
==============================================================================
--- incubator/pivot/trunk/demos/www/itunes-search.xml (original)
+++ incubator/pivot/trunk/demos/www/itunes-search.xml Fri Dec 4 19:10:37 2009
@@ -35,6 +35,7 @@
<libraries>
<library>core</library>
<library>wtk</library>
+ <library>wtk-terra</library>
<library>web</library>
<library>demos</library>
</libraries>
Modified: incubator/pivot/trunk/demos/www/json-viewer.xml
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/demos/www/json-viewer.xml?rev=887324&r1=887323&r2=887324&view=diff
==============================================================================
--- incubator/pivot/trunk/demos/www/json-viewer.xml (original)
+++ incubator/pivot/trunk/demos/www/json-viewer.xml Fri Dec 4 19:10:37 2009
@@ -33,6 +33,7 @@
<libraries>
<library>core</library>
<library>wtk</library>
+ <library>wtk-terra</library>
<library>tools</library>
</libraries>
</application>
Modified: incubator/pivot/trunk/demos/www/kitchen-sink.xml
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/demos/www/kitchen-sink.xml?rev=887324&r1=887323&r2=887324&view=diff
==============================================================================
--- incubator/pivot/trunk/demos/www/kitchen-sink.xml (original)
+++ incubator/pivot/trunk/demos/www/kitchen-sink.xml Fri Dec 4 19:10:37 2009
@@ -35,6 +35,7 @@
<libraries>
<library>core</library>
<library>wtk</library>
+ <library>wtk-terra</library>
<library>tutorials</library>
</libraries>
</application>
Modified: incubator/pivot/trunk/demos/www/large-data.xml
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/demos/www/large-data.xml?rev=887324&r1=887323&r2=887324&view=diff
==============================================================================
--- incubator/pivot/trunk/demos/www/large-data.xml (original)
+++ incubator/pivot/trunk/demos/www/large-data.xml Fri Dec 4 19:10:37 2009
@@ -43,6 +43,7 @@
<libraries>
<library>core</library>
<library>wtk</library>
+ <library>wtk-terra</library>
<library>demos</library>
</libraries>
<startup-properties>
Modified: incubator/pivot/trunk/demos/www/multiselect.xml
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/demos/www/multiselect.xml?rev=887324&r1=887323&r2=887324&view=diff
==============================================================================
--- incubator/pivot/trunk/demos/www/multiselect.xml (original)
+++ incubator/pivot/trunk/demos/www/multiselect.xml Fri Dec 4 19:10:37 2009
@@ -35,6 +35,7 @@
<libraries>
<library>core</library>
<library>wtk</library>
+ <library>wtk-terra</library>
<library>demos</library>
</libraries>
</application>
Modified: incubator/pivot/trunk/demos/www/rss-feed.xml
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/demos/www/rss-feed.xml?rev=887324&r1=887323&r2=887324&view=diff
==============================================================================
--- incubator/pivot/trunk/demos/www/rss-feed.xml (original)
+++ incubator/pivot/trunk/demos/www/rss-feed.xml Fri Dec 4 19:10:37 2009
@@ -35,6 +35,7 @@
<library>core</library>
<library>web</library>
<library>wtk</library>
+ <library>wtk-terra</library>
<library>demos</library>
</libraries>
</application>
Modified: incubator/pivot/trunk/demos/www/stock-tracker.xml
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/demos/www/stock-tracker.xml?rev=887324&r1=887323&r2=887324&view=diff
==============================================================================
--- incubator/pivot/trunk/demos/www/stock-tracker.xml (original)
+++ incubator/pivot/trunk/demos/www/stock-tracker.xml Fri Dec 4 19:10:37 2009
@@ -36,6 +36,7 @@
<libraries>
<library>core</library>
<library>wtk</library>
+ <library>wtk-terra</library>
<library>web</library>
<library>tutorials</library>
</libraries>
Modified: incubator/pivot/trunk/demos/www/table-row-editor.xml
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/demos/www/table-row-editor.xml?rev=887324&r1=887323&r2=887324&view=diff
==============================================================================
--- incubator/pivot/trunk/demos/www/table-row-editor.xml (original)
+++ incubator/pivot/trunk/demos/www/table-row-editor.xml Fri Dec 4 19:10:37 2009
@@ -34,6 +34,7 @@
<libraries>
<library>core</library>
<library>wtk</library>
+ <library>wtk-terra</library>
<library>demos</library>
</libraries>
</application>
Modified: incubator/pivot/trunk/demos/www/xml-viewer.xml
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/demos/www/xml-viewer.xml?rev=887324&r1=887323&r2=887324&view=diff
==============================================================================
--- incubator/pivot/trunk/demos/www/xml-viewer.xml (original)
+++ incubator/pivot/trunk/demos/www/xml-viewer.xml Fri Dec 4 19:10:37 2009
@@ -33,6 +33,7 @@
<libraries>
<library>core</library>
<library>wtk</library>
+ <library>wtk-terra</library>
<library>tools</library>
</libraries>
</application>
Modified: incubator/pivot/trunk/demos/xsl/demo.html.xsl
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/demos/xsl/demo.html.xsl?rev=887324&r1=887323&r2=887324&view=diff
==============================================================================
--- incubator/pivot/trunk/demos/xsl/demo.html.xsl (original)
+++ incubator/pivot/trunk/demos/xsl/demo.html.xsl Fri Dec 4 19:10:37 2009
@@ -75,35 +75,49 @@
<!-- <application> gets translated to a JavaScript block that launches the applet -->
<xsl:template match="application">
<script type="text/javascript">
+ <!-- Base attributes -->
var attributes = {
code:"org.apache.pivot.wtk.BrowserApplicationContext$HostApplet",
width:"<xsl:value-of select="@width"/>",
height:"<xsl:value-of select="@height"/>"
};
+ <!-- Additional attributes -->
<xsl:for-each select="attributes/*">
attributes.<xsl:value-of select="name(.)"/> = '<xsl:value-of select="."/>';
</xsl:for-each>
+ <!-- Archive attribute -->
var libraries = [];
- <xsl:apply-templates select="libraries/library">
- <xsl:with-param name="signed" select="boolean(@signed)"/>
- </xsl:apply-templates>
+ <xsl:variable name="signed" select="@signed"/>
+ <xsl:for-each select="libraries/library">
+ <xsl:text><![CDATA[libraries.push("]]></xsl:text>
+ <xsl:value-of select="'lib/pivot-'"/>
+ <xsl:value-of select="."/>
+ <xsl:value-of select="'-'"/>
+ <xsl:value-of select="$release"/>
+ <xsl:if test="$signed">
+ <xsl:value-of select="'.signed'"/>
+ </xsl:if>
+ <xsl:value-of select="'.jar'"/>
+ <xsl:text><![CDATA[");
+ ]]></xsl:text>
+ </xsl:for-each>
attributes.archive = libraries.join(",");
+ <!-- Base parameters -->
var parameters = {
codebase_lookup:false,
java_arguments:"-Dsun.awt.noerasebackground=true -Dsun.awt.erasebackgroundonresize=true",
application_class_name:"<xsl:value-of select="@class"/>"
};
+ <!-- Startup properties -->
<xsl:if test="startup-properties">
var startupProperties = [];
-
<xsl:for-each select="startup-properties/*">
startupProperties.push("<xsl:value-of select="name(.)"/>=<xsl:apply-templates/>");
</xsl:for-each>
-
parameters.startup_properties = startupProperties.join("&");
</xsl:if>
@@ -111,47 +125,6 @@
</script>
</xsl:template>
- <!-- <library> gets translated to JavaScript that adds a JAR file to a JavaScript array -->
- <xsl:template match="library">
- <xsl:param name="signed"/>
-
- <xsl:choose>
- <xsl:when test=".='wtk'">
- <xsl:variable name="jar">
- <xsl:value-of select="'lib/pivot-wtk-'"/>
- <xsl:value-of select="$release"/>
- <xsl:if test="$signed">
- <xsl:value-of select="'.signed'"/>
- </xsl:if>
- <xsl:value-of select="'.jar'"/>
- </xsl:variable>
- libraries.push('<xsl:value-of select="$jar"/>');
- <xsl:variable name="jar-terra">
- <xsl:value-of select="'lib/pivot-wtk-terra-'"/>
- <xsl:value-of select="$release"/>
- <xsl:if test="$signed">
- <xsl:value-of select="'.signed'"/>
- </xsl:if>
- <xsl:value-of select="'.jar'"/>
- </xsl:variable>
- libraries.push('<xsl:value-of select="$jar-terra"/>');
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="jar">
- <xsl:value-of select="'lib/pivot-'"/>
- <xsl:value-of select="."/>
- <xsl:value-of select="'-'"/>
- <xsl:value-of select="$release"/>
- <xsl:if test="$signed">
- <xsl:value-of select="'.signed'"/>
- </xsl:if>
- <xsl:value-of select="'.jar'"/>
- </xsl:variable>
- libraries.push('<xsl:value-of select="$jar"/>');
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
<!-- Everything else gets passed through -->
<xsl:template match="*|@*">
<xsl:copy>
Modified: incubator/pivot/trunk/demos/xsl/demo.jnlp.xsl
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/demos/xsl/demo.jnlp.xsl?rev=887324&r1=887323&r2=887324&view=diff
==============================================================================
--- incubator/pivot/trunk/demos/xsl/demo.jnlp.xsl (original)
+++ incubator/pivot/trunk/demos/xsl/demo.jnlp.xsl Fri Dec 4 19:10:37 2009
@@ -18,16 +18,14 @@
<!-- Translates a demo XML document into a JNLP demo file -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+ <!-- Output method -->
+ <xsl:output method="xml" encoding="UTF-8" indent="no"/>
+
+ <!-- Parameters (overrideable) -->
<xsl:param name="release"/>
<xsl:param name="root"/>
- <!--
- Output method. NOTE This must be "text" because JSP tags are not valid XML, so setting the
- output method to "xml" (or "html") causes the XSLT process to escape the JSP tags, thus
- breaking the JSP
- -->
- <xsl:output method="text"/>
-
+ <!-- Variables (not overrideable) -->
<xsl:variable name="project" select="document('project.xml')/project"/>
<!-- <root> gets resolved to the 'root' XSL parameter -->
@@ -36,114 +34,95 @@
</xsl:template>
<xsl:template match="application">
- <?xml version="1.0" encoding="UTF-8" ?>
-
- <%@ page language="java" contentType="application/x-java-jnlp-file" pageEncoding="UTF-8" %>
- <%
- // response.setHeader("Cache-Control", "no-cache");
- // response.setHeader("Pragma", "no-cache");
- // response.setDateHeader("Expires", 0);
-
- String requestURL = request.getRequestURL().toString();
- int lastSlash = requestURL.lastIndexOf('/');
- String codebase = "";
- String href = "";
- if (requestURL != null) {
- if (lastSlash < 0) {
- lastSlash = 0;
- }
+ <xsl:text disable-output-escaping="yes">
+ <![CDATA[
+ <%@ page language="java" contentType="application/x-java-jnlp-file" pageEncoding="UTF-8" %>
+ <%
+ // response.setHeader("Cache-Control", "no-cache");
+ // response.setHeader("Pragma", "no-cache");
+ // response.setDateHeader("Expires", 0);
+
+ String requestURL = request.getRequestURL().toString();
+ int lastSlash = requestURL.lastIndexOf('/');
+ String codebase = "";
+ String href = "";
+ if (requestURL != null) {
+ if (lastSlash < 0) {
+ lastSlash = 0;
+ }
+
+ codebase = requestURL.substring(0, lastSlash + 1);
+ if ((lastSlash + 1) < requestURL.length()) {
+ href = requestURL.substring(lastSlash + 1);
+ }
- codebase = requestURL.substring(0, lastSlash + 1);
- if ((lastSlash + 1) < requestURL.length()) {
- href = requestURL.substring(lastSlash + 1);
}
+ %>
- }
- %>
-
- <jnlp spec="1.6+" codebase="<%= codebase %>" href="<%= href %>">
- <information>
- <title>Pivot <xsl:value-of select="//document/properties/title"/> Demo</title>
- <description><xsl:value-of select="//document/properties/description"/></description>
- <vendor><xsl:value-of select="$project/vendor"/></vendor>
- <homepage href="<xsl:value-of select="$project/@href"/>"/>
- <icon kind="shortcut" href="logo.png"/>
- <offline-allowed/>
- <shortcut online="false">
- <desktop/>
- </shortcut>
- </information>
-
- <xsl:if test="boolean(@signed)">
- <security>
- <all-permissions/>
- </security>
- </xsl:if>
-
- <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:apply-templates select="libraries/library">
- <xsl:with-param name="signed" select="boolean(@signed)"/>
- </xsl:apply-templates>
- </resources>
-
- <application-desc main-class="org.apache.pivot.wtk.DesktopApplicationContext">
- <argument><xsl:value-of select="@class"/></argument>
- <argument>--width=<xsl:value-of select="@width"/></argument>
- <argument>--height=<xsl:value-of select="@height"/></argument>
- <argument>--center=true</argument>
- <xsl:for-each select="startup-properties/*">
- <argument>--<xsl:value-of select="name(.)"/>=<xsl:apply-templates/></argument>
- </xsl:for-each>
- </application-desc>
-
- <update check="background"/>
- </jnlp>
- </xsl:template>
+ <jnlp spec="1.6+" codebase="<%= codebase %>" href="<%= href %>">
+ ]]>
+ </xsl:text>
+
+ <information>
+ <title>Pivot <xsl:value-of select="//document/properties/title"/> Demo</title>
+ <description>
+ <xsl:value-of select="normalize-space(//document/properties/description)"/>
+ </description>
+ <vendor><xsl:value-of select="$project/vendor"/></vendor>
+ <homepage href="{$project/@href}"/>
+ <icon kind="shortcut" href="logo.png"/>
+ <offline-allowed/>
+ <shortcut online="false">
+ <desktop/>
+ </shortcut>
+ </information>
+
+ <xsl:if test="boolean(@signed)">
+ <security>
+ <all-permissions/>
+ </security>
+ </xsl:if>
+
+ <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:variable name="signed" select="@signed"/>
+ <xsl:for-each select="libraries/library">
+ <xsl:element name="jar">
+ <xsl:attribute name="href">
+ <xsl:value-of select="'lib/pivot-'"/>
+ <xsl:value-of select="."/>
+ <xsl:value-of select="'-'"/>
+ <xsl:value-of select="$release"/>
+ <xsl:if test="$signed">
+ <xsl:value-of select="'.signed'"/>
+ </xsl:if>
+ <xsl:value-of select="'.jar'"/>
+ </xsl:attribute>
+ <xsl:if test=".='wtk'">
+ <xsl:attribute name="main">true</xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:for-each>
+ </resources>
+
+ <application-desc main-class="org.apache.pivot.wtk.DesktopApplicationContext">
+ <argument><xsl:value-of select="@class"/></argument>
+ <argument>--width=<xsl:value-of select="@width"/></argument>
+ <argument>--height=<xsl:value-of select="@height"/></argument>
+ <argument>--center=true</argument>
+ <xsl:for-each select="startup-properties/*">
+ <argument>--<xsl:value-of select="name(.)"/>=<xsl:apply-templates/></argument>
+ </xsl:for-each>
+ </application-desc>
- <xsl:template match="library">
- <xsl:param name="signed"/>
+ <update check="background"/>
- <xsl:choose>
- <xsl:when test=".='wtk'">
- <xsl:variable name="jar">
- <xsl:value-of select="'lib/pivot-wtk-'"/>
- <xsl:value-of select="$release"/>
- <xsl:if test="$signed">
- <xsl:value-of select="'.signed'"/>
- </xsl:if>
- <xsl:value-of select="'.jar'"/>
- </xsl:variable>
- <jar href="<xsl:value-of select="$jar"/>" main="true"/>
- <xsl:variable name="jar-terra">
- <xsl:value-of select="'lib/pivot-wtk-terra-'"/>
- <xsl:value-of select="$release"/>
- <xsl:if test="$signed">
- <xsl:value-of select="'.signed'"/>
- </xsl:if>
- <xsl:value-of select="'.jar'"/>
- </xsl:variable>
- <jar href="<xsl:value-of select="$jar-terra"/>"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="jar">
- <xsl:value-of select="'lib/pivot-'"/>
- <xsl:value-of select="."/>
- <xsl:value-of select="'-'"/>
- <xsl:value-of select="$release"/>
- <xsl:if test="$signed">
- <xsl:value-of select="'.signed'"/>
- </xsl:if>
- <xsl:value-of select="'.jar'"/>
- </xsl:variable>
- <jar href="<xsl:value-of select="$jar"/>"/>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:text disable-output-escaping="yes"><![CDATA[</jnlp>]]></xsl:text>
</xsl:template>
<xsl:template match="*|@*">