rubys 01/10/23 10:16:37
Modified: proposal/gump rubypad.xml
proposal/gump/java Module.java Project.java
proposal/gump/stylesheet build.xsl
Log:
XSLT => Java
Revision Changes Path
1.43 +1 -0 jakarta-alexandria/proposal/gump/rubypad.xml
Index: rubypad.xml
===================================================================
RCS file: /home/cvs/jakarta-alexandria/proposal/gump/rubypad.xml,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- rubypad.xml 2001/09/25 02:30:34 1.42
+++ rubypad.xml 2001/10/23 17:16:36 1.43
@@ -9,6 +9,7 @@
<!-- Project overrides -->
<project name="jakarta-cactus-22" target="jar"/>
+ <project name="xml-xalan2-smoketest" target="jar"/>
<!-- Repository overrides -->
1.9 +29 -0 jakarta-alexandria/proposal/gump/java/Module.java
Index: Module.java
===================================================================
RCS file: /home/cvs/jakarta-alexandria/proposal/gump/java/Module.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- Module.java 2001/10/08 01:09:50 1.8
+++ Module.java 2001/10/23 17:16:36 1.9
@@ -19,6 +19,8 @@
private Element cvs;
private String name;
private String srcdir;
+ private Element description;
+ private Element url;
private static String cvspass = System.getProperty("user.home")+"/.cvspass";
@@ -74,6 +76,15 @@
promoteProjects();
resolveCvsroot();
+ Node child=element.getFirstChild();
+ for (; child != null; child=child.getNextSibling()) {
+ if (child.getNodeName().equals("description")) {
+ description = (Element) child;
+ } else if (child.getNodeName().equals("url")) {
+ url = (Element) child;
+ }
+ }
+
modules.put(name, this);
}
@@ -83,6 +94,24 @@
*/
public String getSrcDir() {
return srcdir;
+ }
+
+ /**
+ * Property accessor for description attribute.
+ * @param name attribute name
+ * @return Value of the specified attribute.
+ */
+ public Element getDescription() {
+ return description;
+ }
+
+ /**
+ * Property accessor for url attribute.
+ * @param name attribute name
+ * @return Value of the specified attribute.
+ */
+ public Element getUrl() {
+ return url;
}
/**
1.10 +27 -1 jakarta-alexandria/proposal/gump/java/Project.java
Index: Project.java
===================================================================
RCS file: /home/cvs/jakarta-alexandria/proposal/gump/java/Project.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- Project.java 2001/10/19 12:54:13 1.9
+++ Project.java 2001/10/23 17:16:36 1.10
@@ -17,6 +17,8 @@
private Element ant = null;
private Hashtable depends = new Hashtable();
private Hashtable jars = new Hashtable();
+ private Element description;
+ private Element url;
/**
* Create a set of Project definitions based on XML nodes.
@@ -66,6 +68,10 @@
ant = (Element)child;
} else if (child.getNodeName().equals("home")) {
home = (Element)child;
+ } else if (child.getNodeName().equals("description")) {
+ description = (Element)child;
+ } else if (child.getNodeName().equals("url")) {
+ url = (Element)child;
} else if (child.getNodeName().equals("jar")) {
jars.put(((Element)child).getAttribute("id"), child);
}
@@ -76,6 +82,8 @@
if (ant != null) {
genProperties(ant);
genDepends(ant);
+ if (!get("target").equals(""))
+ ant.setAttribute("target", get("target"));
}
// if only one jar is found, make sure that it can be accessed without
@@ -152,7 +160,8 @@
}
/**
- * Resolve home directory.
+ * Resolve home directory. In the process copy any description and
+ * url elements necessary to complete this definition.
* @param home <ant> element which may contain info
*/
private void computeHome(Element home) {
@@ -162,6 +171,23 @@
Module module = Module.find(element.getAttribute("module"));
if (module == null) return;
String srcdir = module.getSrcDir();
+ element.setAttribute("srcdir", srcdir);
+
+ // if a description is not provided, copy the one from the module
+ if (description == null) {
+ description = module.getDescription();
+ if (description != null) {
+ element.appendChild(description.cloneNode(true));
+ }
+ }
+
+ // if a url is not provided, copy the one from the module
+ if (url == null) {
+ url = module.getUrl();
+ if (url != null) {
+ element.appendChild(url.cloneNode(true));
+ }
+ }
// compute home directory
String result=element.getAttribute("home");
1.46 +16 -45 jakarta-alexandria/proposal/gump/stylesheet/build.xsl
Index: build.xsl
===================================================================
RCS file: /home/cvs/jakarta-alexandria/proposal/gump/stylesheet/build.xsl,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- build.xsl 2001/10/21 13:33:03 1.45
+++ build.xsl 2001/10/23 17:16:36 1.46
@@ -100,8 +100,6 @@
<xsl:template match="project">
<xsl:copy>
<xsl:copy-of select="@*"/>
- <xsl:variable name="module" select="@module"/>
- <xsl:variable name="srcdir" select="../module[@name=$module]/@srcdir"/>
<html log="{$logdir}/{@name}.html"
banner-image="{$banner-image}" banner-link="{$banner-link}">
@@ -109,18 +107,10 @@
<title>
<xsl:text>Build </xsl:text>
<xsl:value-of select="@name"/>
- <xsl:choose>
- <xsl:when test="description">
- <xsl:text> - </xsl:text>
- <xsl:value-of select="normalize-space(description)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:for-each select="../module[@name=$module]/description">
- <xsl:text> - </xsl:text>
- <xsl:value-of select="normalize-space(.)"/>
- </xsl:for-each>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:if test="description">
+ <xsl:text> - </xsl:text>
+ <xsl:value-of select="normalize-space(description)"/>
+ </xsl:if>
</title>
<xsl:copy-of select="note"/>
@@ -142,19 +132,15 @@
<br/>
<xsl:text>Module: </xsl:text>
+
+ <a href="module_{@defined-in}.html">definition</a>
+
<xsl:if test="url">
<a href="{url/@href}">home</a>
</xsl:if>
- <a href="module_{@defined-in}.html">definition</a>
+ <a href="cvs_{@module}.html">cvs</a>
- <xsl:for-each select="/workspace/module[cvs and @name=$module]">
- <xsl:if test="url">
- <a href="{url/@href}">home</a>
- </xsl:if>
- <a href="cvs_{@defined-in}.html">cvs</a>
- </xsl:for-each>
-
<!-- dependencies -->
<br/>
@@ -188,7 +174,8 @@
</xsl:for-each>
<logic name="{@name}">
- <initdir dir="{$srcdir}" basedon="{$cvsdir}/{$module}"/>
+ <xsl:variable name="srcdir" select="@srcdir"/>
+ <initdir dir="{$srcdir}" basedon="{$cvsdir}/{@module}"/>
<chdir dir="{$srcdir}"/>
<xsl:copy-of select="mkdir"/>
@@ -245,35 +232,19 @@
<xsl:template match="ant">
<xsl:if test="@basedir">
- <xsl:variable name="module" select="ancestor::project/@module"/>
- <xsl:variable name="srcdir"
- select="/workspace/module[@name=$module]/@srcdir"/>
- <chdir dir="{$srcdir}/{@basedir}"/>
+ <chdir dir="{ancestor::project/@srcdir}/{@basedir}"/>
</xsl:if>
<xsl:copy>
- <xsl:choose>
- <xsl:when test="ancestor::project/@target">
- <xsl:attribute name="target">
- <xsl:value-of select="ancestor::project/@target"/>
- </xsl:attribute>
- </xsl:when>
- <xsl:when test="@target">
- <xsl:copy-of select="@target"/>
- </xsl:when>
- </xsl:choose>
-
- <xsl:apply-templates select="@*[name()!='target']"/>
+ <xsl:apply-templates select="@*"/>
<xsl:apply-templates select="/workspace/property"/>
<xsl:apply-templates select="*"/>
<xsl:if test="/workspace[@bootclass='yes']">
- <xsl:for-each select="../depend/jar[@type='boot']">
- <bootclass location="{../@home}/{@name}"/>
- </xsl:for-each>
-
- <xsl:for-each select="../option/jar[@type='boot']">
- <bootclass location="{../@home}/{@name}"/>
+ <xsl:for-each select="../depend | ../option">
+ <xsl:for-each select="jar[@type='boot']">
+ <bootclass location="{../@home}/{@name}"/>
+ </xsl:for-each>
</xsl:for-each>
</xsl:if>
</xsl:copy>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]