cziegeler    01/07/17 02:28:55

  Modified:    .        build.xml
               bin      st.class
               bin/src  st.java
               webapp   sitemap.xmap
               xdocs    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
  1.29      +55 -4     xml-cocoon2/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/build.xml,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- build.xml 2001/07/16 19:25:53     1.28
  +++ build.xml 2001/07/17 09:28:50     1.29
  @@ -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=".">
  @@ -407,7 +434,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">
  @@ -419,7 +446,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">
  @@ -431,9 +458,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>
   
  
  
  
  1.3       +34 -47    xml-cocoon2/bin/st.class
  
        <<Binary file>>
  
  
  1.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.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- st.java   2001/07/03 09:01:45     1.2
  +++ st.java   2001/07/17 09:28:52     1.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:[EMAIL PROTECTED]";>Carsten Ziegeler</a>
  - * @version CVS $Revision: 1.2 $ $Date: 2001/07/03 09:01:45 $
  + * @version CVS $Revision: 1.3 $ $Date: 2001/07/17 09:28:52 $
    */
   
   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);
  +                        }
                       }
                   }
   
  
  
  
  1.33      +0 -2      xml-cocoon2/webapp/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/webapp/sitemap.xmap,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- sitemap.xmap      2001/07/16 14:42:29     1.32
  +++ sitemap.xmap      2001/07/17 09:28:53     1.33
  @@ -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>
  
  
  
  1.3       +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.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- html-generator.xml        2001/07/13 09:56:29     1.2
  +++ html-generator.xml        2001/07/17 09:28:54     1.3
  @@ -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.3       +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.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- pdf-serializer.xml        2001/07/13 09:56:45     1.2
  +++ pdf-serializer.xml        2001/07/17 09:28:54     1.3
  @@ -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.3       +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.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- xt-transformer.xml        2001/07/13 09:57:15     1.2
  +++ xt-transformer.xml        2001/07/17 09:28:54     1.3
  @@ -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:     [EMAIL PROTECTED]
To unsubscribe, e-mail:          [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to