Chris Hillery has proposed merging lp:~zorba-coders/zorba/dataf-module-fix into 
lp:zorba/data-formatting-module.

Requested reviews:
  Matthias Brantner (matthias-brantner)
  Chris Hillery (ceejatec)

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/dataf-module-fix/+merge/105185

Enhance cmake script for finding fop.jar and its dependencies. Also, modified 
the test to be less strict such that it also succeeds on Mac.
-- 
https://code.launchpad.net/~zorba-coders/zorba/dataf-module-fix/+merge/105185
Your team Zorba Coders is subscribed to branch lp:zorba/data-formatting-module.
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt	2012-04-30 09:55:44 +0000
+++ CMakeLists.txt	2012-05-09 10:17:53 +0000
@@ -25,6 +25,8 @@
 FIND_PACKAGE (zorba_util-jvm_module QUIET)
 
 IF (zorba_util-jvm_module_FOUND)
+  INCLUDE ("${zorba_util-jvm_module_USE_FILE}")
+
   IF (JNI_FOUND)
     INCLUDE_DIRECTORIES (${zorba_util-jvm_module_INCLUDE_DIRS})
 

=== modified file 'src/com/zorba-xquery/www/modules/CMakeLists.txt'
--- src/com/zorba-xquery/www/modules/CMakeLists.txt	2012-04-11 16:06:04 +0000
+++ src/com/zorba-xquery/www/modules/CMakeLists.txt	2012-05-09 10:17:53 +0000
@@ -12,9 +12,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-
-
-
   IF (NOT DEFINED XSL_FOP_HOME)
     IF (DEFINED ENV{XSL_FOP_HOME})
       SET(XSL_FOP_HOME $ENV{XSL_FOP_HOME})
@@ -23,35 +20,35 @@
   
   IF (NOT DEFINED XSL_FOP_HOME)
     IF (WIN32)
-      MESSAGE (STATUS "Environment variable XSL_FOP_HOME not defined, trying default: C:\\dev\\libraries\\fop-1.0")
-      SET (XSL_FOP_HOME "C:\\dev\\libraries\\fop-1.0")
+      SET (XSL_FOP_HOME "C:\\dev\\libraries\\fop-1.0 C:\\dev\\libraries\\fop-1.0\\lib C:\\dev\\libraries\\fop-1.0\\build")
     ELSE (WIN32)
-      MESSAGE (STATUS "Environment variable XSL_FOP_HOME not defined, trying defaults: " ${Java_LIBRARIES} " /usr/share/java/ /usr/share/java/fop/")
-      SET (XSL_FOP_HOME "/usr/share/java/ /usr/share/java/fop/ ${Java_LIBRARIES}")
+      SET (XSL_FOP_HOME /usr/share/java/ /usr/share/java/fop/ /opt/local/share/java/fop/1.0 /opt/local/share/java/fop/1.0 ${Java_LIBRARIES})
     ENDIF (WIN32)
+    MESSAGE (STATUS "XSL_FOP_HOME not defined, trying defaults: ${XSL_FOP_HOME}")
   ENDIF (NOT DEFINED XSL_FOP_HOME)
   
   STRING(REGEX REPLACE "\\\\" "/" XSL_FOP_HOME "${XSL_FOP_HOME}")
   
-  MESSAGE (STATUS "XSL-FOP HOME: " ${XSL_FOP_HOME} )
-  FIND_FILE( FOP_JAR NAMES fop.jar 
-    PATHS ${XSL_FOP_HOME} ${XSL_FOP_HOME}/build )
-  FIND_FILE( FOP_D1_JAR NAMES avalon-framework.jar
-    PATHS ${XSL_FOP_HOME} ${XSL_FOP_HOME}/lib )
-  FIND_FILE( FOP_D2_JAR NAMES batik-all.jar
-    PATHS ${XSL_FOP_HOME} ${XSL_FOP_HOME}/lib )
-  FIND_FILE( FOP_D3_JAR NAMES commons-io.jar
-    PATHS ${XSL_FOP_HOME} ${XSL_FOP_HOME}/lib )
-  FIND_FILE( FOP_D4_JAR NAMES commons-logging.jar
-    PATHS ${XSL_FOP_HOME} ${XSL_FOP_HOME}/lib )
-  FIND_FILE( FOP_D5_JAR NAMES serializer.jar
-    PATHS ${XSL_FOP_HOME} ${XSL_FOP_HOME}/lib )
-  FIND_FILE( FOP_D6_JAR NAMES xalan.jar xalan2.jar
-    PATHS ${XSL_FOP_HOME} ${XSL_FOP_HOME}/lib )
-  FIND_FILE( FOP_D7_JAR NAMES xmlgraphics-commons.jar
-    PATHS ${XSL_FOP_HOME} ${XSL_FOP_HOME}/lib )
+  MESSAGE (STATUS "XSL-FOP HOME: ${XSL_FOP_HOME}")
+  ZORBA_FIND_JAR ( FOP_JAR    NAMES fop
+    PATHS ${XSL_FOP_HOME} PATH_SUFFIXES build)
+  ZORBA_FIND_JAR ( FOP_D1_JAR NAMES avalon-framework
+    PATHS ${XSL_FOP_HOME} PATH_SUFFIXES lib )
+  ZORBA_FIND_JAR ( FOP_D2_JAR NAMES batik-all
+    PATHS ${XSL_FOP_HOME} PATH_SUFFIXES lib )
+  ZORBA_FIND_JAR ( FOP_D3_JAR NAMES commons-io
+    PATHS ${XSL_FOP_HOME} PATH_SUFFIXES lib )
+  ZORBA_FIND_JAR ( FOP_D4_JAR NAMES commons-logging
+    PATHS ${XSL_FOP_HOME} PATH_SUFFIXES lib )
+  ZORBA_FIND_JAR ( FOP_D5_JAR NAMES serializer
+    PATHS ${XSL_FOP_HOME} PATH_SUFFIXES lib )
+  ZORBA_FIND_JAR ( FOP_D6_JAR NAMES xalan xalan2
+    PATHS ${XSL_FOP_HOME} PATH_SUFFIXES lib )
+  ZORBA_FIND_JAR ( FOP_D7_JAR NAMES xmlgraphics-commons
+    PATHS ${XSL_FOP_HOME} PATH_SUFFIXES lib )
 
-  #MULTIPLE EXISTS CAN'T BE USED IN AN *IF* COMMAND, LOOKS LIKE A BUG ON CMAKE
+  # Multiple "EXISTS" clauses can't be used in a single IF() command;
+  # looks like a bug in cmake.
   SET(ALL_FOP FALSE)
   IF ( EXISTS ${FOP_JAR} )
     IF ( EXISTS ${FOP_D1_JAR} )
@@ -70,8 +67,7 @@
       ENDIF ( EXISTS ${FOP_D2_JAR} )
     ENDIF ( EXISTS ${FOP_D1_JAR} )
   ENDIF ( EXISTS ${FOP_JAR} )
-  MESSAGE(STATUS "ALL_FOP:" ${ALL_FOP})
-
+  			
   IF ( ALL_FOP )
     MESSAGE(STATUS "FOP Libraries Found.")
     INCLUDE (CMakeJavaInformation )
@@ -101,5 +97,9 @@
 
   ELSE ( ALL_FOP )
     MESSAGE (STATUS "fop.jar and/or all its dependecies (avalon-framework.jar, batik-all.jar, commons-io.jar, commons-logging.jar, serializer.jar, xalan2.jar, xmlgraphics-commons.jar) not found skiping data-formating module")
+    MESSAGE ( STATUS " fop: " ${FOP_JAR} "\n    avalon: " ${FOP_D1_JAR}
+  			"\n    batik: " ${FOP_D2_JAR} "\n    io: " ${FOP_D3_JAR} 
+  			"\n    logging: " ${FOP_D4_JAR} "\n    serializer: " ${FOP_D5_JAR} "  " 
+  			"\n    xalan: " ${FOP_D6_JAR} "\n    xmlgraphics: " ${FOP_D7_JAR} )
   ENDIF ( ALL_FOP )
 

=== modified file 'test/ExpQueryResults/data-formatting/xslfo.xml.res'
--- test/ExpQueryResults/data-formatting/xslfo.xml.res	2012-03-12 22:08:04 +0000
+++ test/ExpQueryResults/data-formatting/xslfo.xml.res	2012-05-09 10:17:53 +0000
@@ -1,1 +1,1 @@
-<pdf><len>6484</len><start>JVBERi0xLj</start><end>AolJUVPRgo=</end></pdf>
+<pdf><len>true</len><start>JVBERi0xLj</start></pdf>

=== modified file 'test/Queries/data-formatting/xslfo.xq'
--- test/Queries/data-formatting/xslfo.xq	2012-03-12 22:08:04 +0000
+++ test/Queries/data-formatting/xslfo.xq	2012-05-09 10:17:53 +0000
@@ -21,7 +21,6 @@
 let $len := fn:string-length($pdf)
 return 
   <pdf>
-    <len>  { $len }</len>
+    <len>  { $len gt 6000 }</len>
     <start>{ fn:substring($pdf, 1, 10)}</start>
-    <end>  { fn:substring($pdf, $len -10, $len)}</end>
   </pdf>

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to     : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp

Reply via email to