You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cz...@apache.org on 2001/07/17 11:28:20 UTC
cvs commit: xml-cocoon2/xdocs html-generator.xml pdf-serializer.xml xt-transformer.xml
cziegeler 01/07/17 02:28:20
Modified: . Tag: cocoon_20_branch build.xml
bin Tag: cocoon_20_branch st.class
bin/src Tag: cocoon_20_branch st.java
webapp Tag: cocoon_20_branch sitemap.xmap
xdocs Tag: cocoon_20_branch html-generator.xml
pdf-serializer.xml xt-transformer.xml
Log:
- Slightly update the sitemap tools: mime-type and label attributes can now be specified
- php generator, html generator, xt transformer and fo2pdf serializer are only included
in the sitemap if the corresponding jars are available
- Updated docs for this optional components
Revision Changes Path
No revision
No revision
1.8.2.16 +55 -4 xml-cocoon2/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/xml-cocoon2/build.xml,v
retrieving revision 1.8.2.15
retrieving revision 1.8.2.16
diff -u -r1.8.2.15 -r1.8.2.16
--- build.xml 2001/07/16 15:23:03 1.8.2.15
+++ build.xml 2001/07/17 09:28:09 1.8.2.16
@@ -85,8 +85,35 @@
are the one you should call, the others are internal targets that are called
by the main ones.
- Happy hacking from the Apache Cocoon Dev Team :)
+Build Dependencies
+==================
+Some components are optional and require special jar files to be compiled
+and added to the web application. Some if these jars are already included
+in the distribution while others not.
+Here is a list of the optional components:
+
+Generators
+
+- Php Generator : Requires the php package (not included in the dist)
+ <map:generate name="php" src="org.apache.cocoon.generation.PhpGenerator"/>
+
+- HTML Generator : Requires the JTidy package (included in the dist)
+ <map:generator name="html" src="org.apache.cocoon.generation.HTMLGenerator" label="content"/>
+
+Transformers
+
+- XT transformer : Requires the XT package (included in the dist)
+ <map:transformer name="xt" src="org.apache.cocoon.transformation.XTTransformer"/>
+
+
+Serializers
+
+fo2pdf serializer : Requires the FOP package (included in the dist)
+ <map:serializer name="fo2pdf" src="org.apache.cocoon.serialization.FOPSerializer" mime-type="application/pdf"/>
+
+ Happy hacking from the Apache Cocoon 2 Dev Team :)
+
============================================================================ -->
<project default="package" basedir=".">
@@ -405,7 +432,7 @@
<!-- =================================================================== -->
- <!-- Prapares the webapp sitemap if php is available -->
+ <!-- Prepares the webapp sitemap if php is available -->
<!-- =================================================================== -->
<target name="prepare-webapp-php" depends="copy-webapp" if="php.present">
<java classname="st">
@@ -417,7 +444,7 @@
</target>
<!-- =================================================================== -->
- <!-- Prapares the webapp sitemap if xt is available -->
+ <!-- Prepares the webapp sitemap if xt is available -->
<!-- =================================================================== -->
<target name="prepare-webapp-xt" depends="copy-webapp" if="xt.present">
<java classname="st">
@@ -429,9 +456,33 @@
</target>
<!-- =================================================================== -->
+ <!-- Prepares the webapp sitemap if fop is available -->
+ <!-- =================================================================== -->
+ <target name="prepare-webapp-fop" depends="copy-webapp" if="fop.present">
+ <java classname="st">
+ <arg line="-i ${build.war}/sitemap.xmap -o ${build.war}/sitemap.xmap -m application/pdf -a serializers fo2pdf org.apache.cocoon.serialization.FOPSerializer"/>
+ <classpath>
+ <pathelement location="${bin.dir}"/>
+ </classpath>
+ </java>
+ </target>
+
+ <!-- =================================================================== -->
+ <!-- Prepares the webapp sitemap if jtidy is available -->
+ <!-- =================================================================== -->
+ <target name="prepare-webapp-tidy" depends="copy-webapp" if="tidy.present">
+ <java classname="st">
+ <arg line="-i ${build.war}/sitemap.xmap -o ${build.war}/sitemap.xmap -l content -a generators html org.apache.cocoon.generation.HTMLGenerator"/>
+ <classpath>
+ <pathelement location="${bin.dir}"/>
+ </classpath>
+ </java>
+ </target>
+
+ <!-- =================================================================== -->
<!-- Prepares the webapp directories -->
<!-- =================================================================== -->
- <target name="prepare-webapp" depends="copy-webapp, prepare-webapp-php, prepare-webapp-xt">
+ <target name="prepare-webapp" depends="copy-webapp, prepare-webapp-php, prepare-webapp-xt, prepare-webapp-fop, prepare-webapp-tidy">
<!-- Simply do nothing, just invoke all dependencies -->
</target>
No revision
No revision
1.1.2.3 +34 -47 xml-cocoon2/bin/st.class
<<Binary file>>
No revision
No revision
1.1.2.3 +32 -5 xml-cocoon2/bin/src/st.java
Index: st.java
===================================================================
RCS file: /home/cvs/xml-cocoon2/bin/src/st.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- st.java 2001/07/03 09:02:51 1.1.2.2
+++ st.java 2001/07/17 09:28:13 1.1.2.3
@@ -14,8 +14,11 @@
* Parameters:
* -i input sitemap
* -o output sitemap
+ * -l optional label
+ * -m optional mime type
* -a <component category> <component name> <component class> <optional conf>
*
+ * The -a option must be the last in the line
* Example:
* st -i sitemap.xmpa -o sitemap.xmap -a transformers log
* org.apache.cocoon.transformation.LogTransformer
@@ -28,7 +31,7 @@
* Pretty printing
*
* @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
- * @version CVS $Revision: 1.1.2.2 $ $Date: 2001/07/03 09:02:51 $
+ * @version CVS $Revision: 1.1.2.3 $ $Date: 2001/07/17 09:28:13 $
*/
public class st {
@@ -71,6 +74,8 @@
String inputName;
String outputName;
String arg;
+ String label = null;
+ String mimeType = null;
int mode = 0;
String arg1=null, arg2=null, arg3=null, arg4=null;
@@ -94,6 +99,18 @@
else
clError = true;
i += 2;
+ } else if (arg.equals("-l") == true) {
+ if (i + 1 < args.length)
+ label = args[i+1];
+ else
+ clError = true;
+ i += 2;
+ } else if (arg.equals("-m") == true) {
+ if (i + 1 < args.length)
+ mimeType = args[i+1];
+ else
+ clError = true;
+ i += 2;
} else if (arg.equals("-a") == true) {
if (i + 3 < args.length && mode == 0) {
mode = 1; // add
@@ -121,8 +138,9 @@
clError = true;
}
if (clError == true) {
- System.out.println("Usage: st -i [inputsitemap] -o [outputsitemap] -a [componentcategory]"+
- " [componentname] [class] [optionalconfigurationstring]");
+ System.out.println("Usage: st -i inputsitemap -o outputsitemap " +
+ "[-l label] [-m mimetype] -a componentcategory"+
+ " componentname class [optionalconfigurationstring]");
} else {
try {
String data = load(inputName);
@@ -136,14 +154,23 @@
String searchString = "</map:"+arg1+">";
int pos = data.indexOf(searchString);
- if (pos != -1) {
- data = data.substring(0, pos)
+ int categoryStartPos = data.indexOf("<map:"+arg1+">");
+ if (categoryStartPos == -1) categoryStartPos = data.indexOf("<map:"+arg1+" ");
+ if (categoryStartPos != -1 && categoryStartPos < pos && pos != -1) {
+ // the category exists, now search if a component
+ // with the name already exists
+ int componentPos = data.substring(categoryStartPos, pos).indexOf("name=\""+arg2+"\"");
+ if (componentPos == -1) {
+ data = data.substring(0, pos)
+ "<map:"+arg1.substring(0, arg1.length()-1)
+ " name=\"" + arg2 + "\" src=\""+arg3+"\""
+ + (mimeType == null ? "" : " mime-type=\""+mimeType+"\"")
+ + (label == null ? "" : " label=\""+label+"\"")
+ (arg4 == null ? "/>\n"
: ">\n"+arg4+"\n"
+ "</map:"+arg1.substring(0, arg1.length()-1)+">\n")
+ data.substring(pos);
+ }
}
}
No revision
No revision
1.11.2.22 +0 -2 xml-cocoon2/webapp/sitemap.xmap
Index: sitemap.xmap
===================================================================
RCS file: /home/cvs/xml-cocoon2/webapp/sitemap.xmap,v
retrieving revision 1.11.2.21
retrieving revision 1.11.2.22
diff -u -r1.11.2.21 -r1.11.2.22
--- sitemap.xmap 2001/07/16 14:41:18 1.11.2.21
+++ sitemap.xmap 2001/07/17 09:28:15 1.11.2.22
@@ -16,7 +16,6 @@
<map:generator name="extractor" src="org.apache.cocoon.generation.FragmentExtractorGenerator"/>
<map:generator name="script" src="org.apache.cocoon.generation.ScriptGenerator"/>
<map:generator name="velocity" src="org.apache.cocoon.generation.VelocityGenerator"/>
- <map:generator name="html" src="org.apache.cocoon.generation.HTMLGenerator" label="content"/>
<map:generator name="jsp" src="org.apache.cocoon.generation.JspGenerator"/>
<map:generator name="stream" src="org.apache.cocoon.generation.StreamGenerator"/>
</map:generators>
@@ -43,7 +42,6 @@
<map:serializer name="links" src="org.apache.cocoon.serialization.LinkSerializer"/>
<map:serializer name="xml" mime-type="text/xml" src="org.apache.cocoon.serialization.XMLSerializer"/>
<map:serializer name="html" mime-type="text/html" src="org.apache.cocoon.serialization.HTMLSerializer"/>
- <map:serializer name="fo2pdf" mime-type="application/pdf" src="org.apache.cocoon.serialization.FOPSerializer"/>
<map:serializer name="vrml" mime-type="model/vrml" src="org.apache.cocoon.serialization.TextSerializer"/>
<map:serializer name="wap" mime-type="text/vnd.wap.wml" src="org.apache.cocoon.serialization.XMLSerializer">
<doctype-public>-//WAPFORUM//DTD WML 1.1//EN</doctype-public>
No revision
No revision
1.1.2.2 +3 -0 xml-cocoon2/xdocs/html-generator.xml
Index: html-generator.xml
===================================================================
RCS file: /home/cvs/xml-cocoon2/xdocs/html-generator.xml,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- html-generator.xml 2001/07/12 21:06:13 1.1.2.1
+++ html-generator.xml 2001/07/17 09:28:17 1.1.2.2
@@ -16,6 +16,9 @@
<p>The html generator reads an html document from the local file system or from any url.
It acts similar to the file generator with the difference that it reads
html documents and converts them using jtidy to xhtml.</p>
+ <p>This generator is optional and requires the jtidy package
+ in the lib directory when building cocoon 2. However,
+ the distribution includes this package already.</p>
<ul>
<li>Name : html</li>
<li>Class: org.apache.cocoon.generation.HTMLGenerator</li>
1.1.2.2 +3 -0 xml-cocoon2/xdocs/pdf-serializer.xml
Index: pdf-serializer.xml
===================================================================
RCS file: /home/cvs/xml-cocoon2/xdocs/pdf-serializer.xml,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- pdf-serializer.xml 2001/07/12 21:06:52 1.1.2.1
+++ pdf-serializer.xml 2001/07/17 09:28:17 1.1.2.2
@@ -15,6 +15,9 @@
<s1 title="PDF Serializer">
<p>The pdf serializer takes fo xml events as input. By using the
FOP project it creates pdf out of the sax events.</p>
+ <p>This serializer is optional and requires the fop package
+ in the lib directory when building cocoon 2. However,
+ the distribution includes this package already.</p>
<ul>
<li>Name : fo2pdf</li>
<li>Class: org.apache.cocoon.serialization.FOPSerializer</li>
1.1.2.2 +8 -3 xml-cocoon2/xdocs/xt-transformer.xml
Index: xt-transformer.xml
===================================================================
RCS file: /home/cvs/xml-cocoon2/xdocs/xt-transformer.xml,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- xt-transformer.xml 2001/07/12 21:08:01 1.1.2.1
+++ xt-transformer.xml 2001/07/17 09:28:17 1.1.2.2
@@ -13,11 +13,16 @@
</header>
<body>
<s1 title="XT Transformer">
- <p>???? - optional.</p>
+ <p>The xt transformer is an alternative xslt transformer
+ which uses the xt transformer instead of a trax compatible
+ transformer.</p>
+ <p>This transformer is optional and requires the xt package
+ in the lib directory when building cocoon 2. However,
+ the distribution includes this package already.</p>
<ul>
- <li>Name : xinclude</li>
+ <li>Name : xt</li>
<li>Class: org.apache.cocoon.transformation.XTTransformer</li>
- <li>Cacheable: ????.</li>
+ <li>Cacheable: no.</li>
</ul>
</s1>
</body>
----------------------------------------------------------------------
In case of troubles, e-mail: webmaster@xml.apache.org
To unsubscribe, e-mail: cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org