jefft 2003/06/20 23:53:55
Modified:src/targets webapp-build.xml
tools/src blocks-build.xsl
tools/src/anttasks XConfToolTask.java
Log:
Surround sitemap.xmap block snippets with comments indicating their origin:
to make it easier for users to see what's what. Off by default, only switched
on for sitemap.xmap
Revision ChangesPath
1.20 +3 -2 cocoon-2.1/src/targets/webapp-build.xml
Index: webapp-build.xml
===
RCS file: /home/cvs/cocoon-2.1/src/targets/webapp-build.xml,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- webapp-build.xml 5 Jun 2003 03:02:45 - 1.19
+++ webapp-build.xml 21 Jun 2003 06:53:55 - 1.20
@@ -84,7 +84,8 @@
+includes="**/*.xconf"
+addComments="true"/>
@@ -166,7 +167,7 @@
-
+
1.22 +2 -1 cocoon-2.1/tools/src/blocks-build.xsl
Index: blocks-build.xsl
===
RCS file: /home/cvs/cocoon-2.1/tools/src/blocks-build.xsl,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- blocks-build.xsl 26 May 2003 08:44:30 - 1.21
+++ blocks-build.xsl 21 Jun 2003 06:53:55 - 1.22
@@ -77,7 +77,8 @@
+ srcdir="{string('${blocks}')}"
+ addcomments="true">
1.8 +31 -1 cocoon-2.1/tools/src/anttasks/XConfToolTask.java
Index: XConfToolTask.java
===
RCS file: /home/cvs/cocoon-2.1/tools/src/anttasks/XConfToolTask.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- XConfToolTask.java5 Jun 2003 21:06:17 - 1.7
+++ XConfToolTask.java21 Jun 2003 06:53:55 - 1.8
@@ -93,9 +93,12 @@
*/
public final class XConfToolTask extends MatchingTask {
+private static final String NL=System.getProperty("line.separator");
+private static final String FSEP=System.getProperty("file.separator");
private File file;
private File directory;
private File srcdir;
+private boolean addComments;
/** for resolving entities such as dtds */
private XMLCatalog xmlCatalog = new XMLCatalog();
@@ -128,6 +131,14 @@
}
/**
+ * Whether to add a comment indicating where this block of code comes
+ * from.
+ */
+public void setAddComments(Boolean addComments) {
+this.addComments = addComments.booleanValue();
+}
+
+/**
* Initialize internal instance of XMLCatalog
*/
public void init() throws BuildException
@@ -227,6 +238,7 @@
Element elem = component.getDocumentElement();
String extension =
file.lastIndexOf(".")>0?file.substring(file.lastIndexOf(".")+1):"";
+String basename = basename(file);
if ( !elem.getTagName().equals(extension)) {
log("Skipping non xconf-tool file: "+file);
@@ -325,6 +337,10 @@
log("Processing: "+file);
NodeList componentNodes =
component.getDocumentElement().getChildNodes();
+if (this.addComments) {
+root.appendChild(configuration.createComment(". Start
configuration from '"+basename+"' "));
+root.appendChild(configuration.createTextNode(NL));
+}
for (int i = 0; i