You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by da...@apache.org on 2001/03/02 05:15:44 UTC

cvs commit: jakarta-velocity/whiteboard/daveb/pdfvsl build.sh build.xml pdfsite.vsl velocity.properties

daveb       01/03/01 20:15:43

  Added:       whiteboard/daveb/pdfvsl build.sh build.xml pdfsite.vsl
                        velocity.properties
  Log:
  Start of anakia generating PDF.
  
  Revision  Changes    Path
  1.1                  jakarta-velocity/whiteboard/daveb/pdfvsl/build.sh
  
  Index: build.sh
  ===================================================================
  #! /bin/sh
  
  if [ "$JAVA_HOME" = "" ] ; then
    echo You must set JAVA_HOME to point at your Java Development Kit directory
    exit 1
  fi
  
  # convert the existing path to unix
  if [ "$OSTYPE" = "cygwin32" ] || [ "$OSTYPE" = "cygwin" ] ; then
     CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
  fi
  
  CLASSPATH=${JAVA_HOME}/lib/tools.jar
  
  for i in ../../../build/lib/*.jar
  do
      CLASSPATH=$CLASSPATH:"$i"
  done
  
  for i in ../../../bin/*.jar
  do
      CLASSPATH=$CLASSPATH:"$i"
  done
  
  # convert the unix path to windows
  if [ "$OSTYPE" = "cygwin32" ] || [ "$OSTYPE" = "cygwin" ] ; then
     CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
  fi
  
  CLASSPATH=${CLASSPATH}:../../../build/lib
  
  BUILDFILE=build.xml
  
  echo $CLASSPATH
  
  java $ANT_OPTS -classpath "$CLASSPATH" org.apache.tools.ant.Main \
                  -Dant.home=$ANT_HOME \
                  -buildfile ${BUILDFILE} \
                   "$@"
  
  
  
  1.1                  jakarta-velocity/whiteboard/daveb/pdfvsl/build.xml
  
  Index: build.xml
  ===================================================================
  <project name="build-site" default="docs" basedir=".">
  
      <!-- Initialization properties -->
      <property name="project.name"   value="site"/>
      <property name="docs.src" value="../../../xdocs"/>
      <property name="docs.dest" value="."/>
  
      <target name="prepare">
          <available classname="org.apache.velocity.anakia.AnakiaTask" property="AnakiaTask.present"/>
      </target>
  
      <target depends="prepare" name="prepare-error" unless="AnakiaTask.present">
          <echo>
              AnakiaTask is not present! Please check to make sure that 
              velocity.jar is in your classpath.
          </echo>
      </target>
  
      <target name="docs" depends="prepare-error" if="AnakiaTask.present">
          <taskdef name="anakia" classname="org.apache.velocity.anakia.AnakiaTask"/>
          <taskdef name="fop" classname="org.apache.fop.tools.anttasks.Fop"/>
  	
  	<anakia basedir="${docs.src}" destdir="${docs.dest}/"
               extension=".fo" style="pdfsite.vsl"
               includes="**/*.xml"
               lastModifiedCheck="true">
          </anakia>
  	
  	<!-- Make big XML doc here -->
  	
  	<fop fofile="index.fo" 
  	    pdffile="index.pdf"
  	/>
          
      </target>
  </project>
  
  
  
  1.1                  jakarta-velocity/whiteboard/daveb/pdfvsl/pdfsite.vsl
  
  Index: pdfsite.vsl
  ===================================================================
  #document()
  #macro (document)
  <?xml version="1.0" encoding="utf-8"?>
   <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
    <!-- defines the layout master -->
    <fo:layout-master-set>
      <fo:simple-page-master master-name="Velocity" 
                             page-height="8.5in" 
                             page-width="11in" 
                             margin-top="0.25in" 
                             margin-bottom="0.25in" 
                             margin-left="0.5in" 
                             margin-right="0.5in">
        <fo:region-before extent="0.25in"/>	
        <fo:region-body margin-top="0.25in"/>  
      </fo:simple-page-master>
    </fo:layout-master-set>
  
  <!-- starts actual layout -->
      <fo:page-sequence master-name="Velocity">
  	
     <!-- header -->
      <fo:static-content flow-name="xsl-region-before">
        <fo:block text-align="end" font-size="10pt" font-family="serif" color="black" >
      	$root.getChild("properties").getChild("title").getText() pg <fo:page-number/>
        </fo:block>
      </fo:static-content>
  			
      <fo:flow flow-name="xsl-region-body">
  	
      #set ($allSections = $xpath.applyTo("body/section", $root))
  
      	<!-- Walk through the sections -->
  	 #foreach ( $section in $allSections )
             #foreach ( $item in $section.getChildren() )     
      	     #if ( $item.getName().equals("p") )
  		#makeBlock($item)
  	     #elseif ( $item.getName().equals("em") )
  	  	#makeEmphasize($item)		
   	     #elseif ( $item.getName().equals("source") )
  	  	#makeSource($item)
  	     #end
  	   #end
  	#end
  	
     </fo:flow>
   </fo:page-sequence>
  </fo:root>			 			
  #end
  
  #macro ( makeBlock $value )
   <fo:block font-size="14pt"
  	    space-after.optimum="15pt" 
              font-family="sans-serif"
  	    background-color="white"
              color="blue"
              text-align="start"
  	    padding-top="3pt">
     $value.getText()	
   </fo:block>
  #end
  
  #macro (makeEmphasize $value )
   <fo:block font-size="14pt"
  	    space-after.optimum="15pt" 
              font-family="sans-serif"
  	    font-weight="bold"
              background-color="white"
              color="blue"
              text-align="start"
  	    padding-top="3pt">
     $value.getText()	
  </fo:block>
  #end
  
  
  
  
  
  
  
  
  
  
  1.1                  jakarta-velocity/whiteboard/daveb/pdfvsl/velocity.properties
  
  Index: velocity.properties
  ===================================================================
  #----------------------------------------------------------------------------
  # These are the default properties for the
  # Velocity Runtime. These values are used when
  # Runtime.init() is called, and when Runtime.init(properties)
  # fails to find the specificed properties file.
  #----------------------------------------------------------------------------
  
  #----------------------------------------------------------------------------
  # R U N T I M E  L O G  
  #----------------------------------------------------------------------------
  # This is the location of the Velocity Runtime log.
  #----------------------------------------------------------------------------
  
  runtime.log = velocity.log
  
  #----------------------------------------------------------------------------
  # T E M P L A T E  E N C O D I N G
  #----------------------------------------------------------------------------
  
  template.encoding=8859_1
  
  #----------------------------------------------------------------------------
  # C O N T E N T  T Y P E  
  #----------------------------------------------------------------------------
  # This is the default content type for the VelocityServlet.
  #----------------------------------------------------------------------------
  
  default.contentType=text/html
  
  #----------------------------------------------------------------------------
  # F O R E A C H  P R O P E R T I E S
  #----------------------------------------------------------------------------
  # These properties control how the counter is accessed in the #foreach
  # directive. By default the reference $velocityCount will be available
  # in the body of the #foreach directive. The default starting value
  # for this reference is 1.
  #----------------------------------------------------------------------------
  
  counter.name = velocityCount
  counter.initial.value = 1
  
  #----------------------------------------------------------------------------
  # I N C L U D E  P R O P E R T I E S
  #----------------------------------------------------------------------------
  # These are the properties that governed the way #include'd content
  # is governed.
  #----------------------------------------------------------------------------
  
  include.output.errormsg.start = <!-- include error : 
  include.output.errormsg.end   =  see error log -->
  
  #----------------------------------------------------------------------------
  # P A R S E  P R O P E R T I E S
  #----------------------------------------------------------------------------
  
  parse_directive.maxdepth = 10
  
  #----------------------------------------------------------------------------
  # T E M P L A T E  L O A D E R S
  #----------------------------------------------------------------------------
  # 
  # 
  #----------------------------------------------------------------------------
  
  resource.loader.1.public.name = File
  resource.loader.1.description = Velocity File Resource Loader
  resource.loader.1.class = org.apache.velocity.runtime.resource.loader.FileResourceLoader
  resource.loader.1.resource.path = .
  resource.loader.1.cache = false
  resource.loader.1.modificationCheckInterval = 2
  
  #----------------------------------------------------------------------------
  # E X T E R N A L  S E R V I C E  I N I T I A L I Z A T I O N
  #----------------------------------------------------------------------------
  # If this property is set to true then an external service will
  # set certain system properties and initialize the Velocity
  # Runtime. This method is used by Turbine to initialize the
  # Velocity Runtime for the TurbineVelocityService.
  #----------------------------------------------------------------------------
  
  external.init = false
  
  #----------------------------------------------------------------------------
  # VELOCIMACRO GLOBAL LIBRARY
  #----------------------------------------------------------------------------
  # name of default global library.  It is expected to be in the regular
  # template path.  You may remove it (either the file or this property) if 
  # you wish with no harm.
  #----------------------------------------------------------------------------
  #velocimacro.library.global=VM_global_library.vm