Changeset 15787
- Timestamp:
- 2008-05-29T13:29:54+12:00 (15 years ago)
- Location:
- greenstone3/branches/customizingGreenstone3
- Files:
-
- 26 edited
- 11 copied
Legend:
- Unmodified
- Added
- Removed
-
greenstone3/branches/customizingGreenstone3/build.properties
r15191 r15787 11 11 12 12 ## windows c++ compilation 13 compile.windows.c++.setup=C:/Program Files/Microsoft Visual Studio/VC98/Bin/VCVARS32.BAT 13 # The following property does not help in build.xml. 14 # The user needs to run Visual Studio's vcvars32.bat script from the 15 # MSDOS prompt before compiling Greenstone3 (before "ant prepare install") 16 #compile.windows.c++.setup=C:/Program Files/Microsoft Visual Studio/VC98/Bin/VCVARS32.BAT 14 17 15 18 ## Tomcat installation … … 48 51 proxy.password= 49 52 50 ## Mac OS X specific stuff 51 # set the path to your GDBM here 52 #install.gdbm=true 53 #gdbm.installed.path=${gdbm.home} 53 # Not all unix systems (for example MacOS) come with GDBM pre-installed 54 # To keep things simple, instruct Greenstone3 to download a GDBM tar file 55 # configure and install it. The location used by default is within the 56 # Greenstone3 src/packages area 57 install.gdbm=true 58 gdbm.installed.path=${gdbm.home} 54 59 55 60 ##Flax stuff## 56 61 ##uncomment if you want to install flax 57 62 #install.flax=true 63 64 ##Web services related constants## 65 base.webservice.name=SOAPServer 66 ##listing and description of all the web services deployable on GS3## 67 web.services.list=${base.webservice.name} for Greenstone3's core web services, QBR${base.webservice.name} for Query, Browse and Retrieve services -
greenstone3/branches/customizingGreenstone3/build.xml
r15191 r15787 9 9 <project name="greenstone3" default="usage" basedir="."> 10 10 11 12 13 14 <include name="**/*.jar"/>15 16 17 18 19 20 21 22 23 24 25 26 27 28 11 <!-- ============ classpath =================== --> 12 <path id="project.classpath"> 13 <fileset dir="lib/java"> 14 <include name="**/*.jar"/> 15 </fileset> 16 </path> 17 18 <!-- ============ self defined tasks =================== --> 19 <taskdef name="mysetproxy" classname="org.greenstone.anttasks.MySetProxy" classpathref="project.classpath"/> 20 <taskdef name="getuserandpassword" classname="org.greenstone.anttasks.MyGetUserAndPassword" classpathref="project.classpath"/> 21 <taskdef name="svn" classname="org.tigris.subversion.svnant.SvnTask" classpathref="project.classpath"/> 22 <taskdef name="rsr" classname="org.greenstone.anttasks.RegexSearchReplace" classpathref="project.classpath"/> 23 <taskdef name="if" classname="ise.antelope.tasks.IfTask" classpathref="project.classpath"/> 24 <taskdef name="try" classname="ise.antelope.tasks.TryTask" classpathref="project.classpath"/> 25 26 <!-- ===================== Property Definitions =========================== --> 27 28 <!-- 29 29 30 30 Each of the following properties are used in the build script. … … 35 35 36 36 * Definitions from a "build.properties" file in the top level 37 source directory of this application.37 source directory of this application. 38 38 39 39 * Definitions from a "build.properties" file in the user's 40 home directory.40 home directory. 41 41 42 42 * Default definitions in this build.xml file. … … 48 48 "build.properties" files as well as in the "build.xml" script. 49 49 50 --> 51 52 50 --> 51 53 52 <!--the first two properties have to be put on the top to be used by build.properties--> 54 53 <property name="src.packages.home" value="${basedir}/src/packages"/> … … 59 58 <!-- get properties from the environment --> 60 59 <property environment="env"/> 61 62 63 <!-- version properties for external packages -->64 <property name="tomcat.version" value="apache-tomcat-5.5.25"/>65 <property name="axis.zip.version" value="axis-bin-1_2_1.zip"/>66 <property name="axis.dir.version" value="axis-1_2_1"/>67 <property name="gdbm.version" value="gdbm-1.8.3"/>68 69 60 <property name="build.home" value="${basedir}/build"/> 70 61 <property name="src.home" value="${basedir}/src/java"/> … … 84 75 <!-- jni libraries and java wrappers go here --> 85 76 <property name="lib.jni" value="${basedir}/lib/jni"/> 86 77 87 78 <property name="javadocs" value="${basedir}/docs/javadoc"/> 88 79 … … 164 155 </condition> 165 156 166 167 168 157 <!-- where is search4j tool --> 158 <condition property="search4j.exec" value="bin/search4j.exe"> 159 <isset property="current.os.iswindows"/> 169 160 </condition> 170 161 <property name="search4j.exec" value="bin/search4j"/> 171 162 172 163 173 164 <!-- ============= Base dirs for each package and component ============ --> 174 165 <property name="src.applet.home" value="${src.home}/org/greenstone/applet"/> … … 178 169 <property name="gli.home" value="${basedir}/gli"/> 179 170 <property name="javagdbm.home" value="${src.packages.home}/javagdbm"/> 180 171 181 172 <!--<property name="indexers.home" value="${basedir}/src/packages/indexers">--> 182 173 <condition property="indexers.home" value="${basedir}/src/packages/indexers"> … … 193 184 <property name="lucene.home" value="${indexers.home}/lucene-gs"/> 194 185 195 196 197 198 186 187 <!-- ==================== Compilation Control Options ==================== --> 188 189 <!-- 199 190 200 191 These properties control option settings on the Javac compiler when it … … 207 198 compile.optimize Should compilation include the optimize option? 208 199 209 200 --> 210 201 211 202 <property name="compile.debug" value="true"/> … … 213 204 <property name="compile.optimize" value="true"/> 214 205 215 206 <!-- 216 207 217 208 Rather than relying on the CLASSPATH environment variable, Ant includes … … 222 213 that you explicitly added. 223 214 224 215 --> 225 216 226 217 <path id="compile.classpath"> … … 238 229 <!-- Include the axis jar files --> 239 230 <!--<fileset dir="${basedir}/comms/soap/axis/lib"> 240 <include name="*.jar"/>241 </fileset>-->231 <include name="*.jar"/> 232 </fileset>--> 242 233 243 234 <!-- include the jar files from the source packages --> … … 286 277 <echo>os.unix: ${os.unix}</echo> 287 278 </target> 288 279 <!-- ==================== Primary and Global Targets ============================= --> 289 280 290 281 <!-- add comments about using xxx-core, xxx-packages if only want certain parts?? --> … … 292 283 <target name="prepare" depends="accept-properties,init,prepare-core,prepare-packages,prepare-gs2building,prepare-tomcat,prepare-axis,prepare-web,prepare-collections,prepare-gdbm, prepare-flax" 293 284 description="Use this when you first checkout the code: 'ant prepare install'. This will do some additional subversion checkouts and downloads, so you need to be online to run this."> 294 285 <!-- <target name="prepare" depends="accept-properties,init,prepare-core,prepare-packages,prepare-gs2building,prepare-tomcat,prepare-axis,prepare-web,prepare-collections" 295 286 description="Use this when you first checkout the code: 'ant prepare install'. This will do some additional cvs checkouts and downloads, so you need to be online to run this.">--> 296 287 … … 304 295 description="Install Greenstone 3. Use this when you first checkout the code: 'ant prepare install'."/> 305 296 306 307 description="Do a cvs update for all sources. Doesn't recompile the code. You need to be online to run this."/>-->297 <!-- <target name="cvsupdate" depends="init,cvsupdate-packages,cvsupdate-core,cvsupdate-gs2building,cvsupdate-web" 298 description="Do a cvs update for all sources. Doesn't recompile the code. You need to be online to run this."/>--> 308 299 <target name="svnupdate" depends="init,svnupdate-packages,svnupdate-core,svnupdate-gs2building,svnupdate-web" 309 300 description="Do a `svn update` for all sources. Doesn't recompile the code. You need to be online to run this."/> … … 316 307 description="Configure the installation. Includes setting up config files. Should be re-run if you change the build.properties file."/> 317 308 318 <target name="clean" depends="init,clean-packages,clean-core,clean-gs2building ,clean-gdbm"309 <target name="clean" depends="init,clean-packages,clean-core,clean-gs2building" 319 310 description="Remove all old compiled code. Includes core, packages and gs2building if necessary"/> 320 321 <target name="distclean" depends="init,distclean-packages,clean-core,distclean-gs2building,distclean-gdbm"322 description="Remove all compiled code and also any Makefiles etc generated during configure-c++. Includes core, packages, gs2building as necessary"/>323 311 324 312 <target name="compile" depends="init,compile-web,compile-packages,compile-core,compile-gs2building" 325 313 description="Compile all the source code, includes core, packages and gs2building if necessary. Copy jar files and executables to their correct places."/> 326 314 327 315 <target name="update" depends="init,svnupdate,clean,configure,configure-c++,compile" 328 description="Update (thru Subversion) all the source (including core, packages and gs2building), then clean, configure and recompile. To do this without any SVN updates, run it like 'ant -Dnosvn.mode=yes update'"/>316 description="Update (thru Subversion) all the source (including core, packages and gs2building), then clean, configure and recompile."/> 329 317 330 318 <target name="start" depends="init,start-tomcat" 331 319 description="Startup the Tomcat server." > 332 333 334 335 <echo>URL: http://${tomcat.server}:${tomcat.port}${app.path}/</echo>336 <!-- assuming that index.html is not needed here -->320 <echo>${app.name} (${app.version}) server running using Apache Tomcat and Java</echo> 321 <echo>Tomcat: ${catalina.home}</echo> 322 <echo>Java: ${java.home}</echo> 323 <echo>URL: http://${tomcat.server}:${tomcat.port}${app.path}/</echo> 324 <!-- assuming that index.html is not needed here --> 337 325 </target> 338 326 … … 343 331 344 332 345 333 <!-- =========== Help targets =================================== --> 346 334 347 335 <property name="install-command" value="ant [options] prepare install"/> … … 351 339 <echo message=" Execute 'ant -help' for Ant help."/> 352 340 <echo>To install Greenstone3, run '${install-command}'. 353 354 355 341 There are properties defined in build.properties. The install process will ask you if these properties are set correctly. To avoid this prompt, use the '-Dproperties.accepted=yes' option. 342 To log the output, use the '-logfile build.log' option. 343 The README.txt file has more information about the ant targets and install process. 356 344 </echo> 357 345 </target> … … 363 351 </target> 364 352 365 353 <!-- ====== initialization and setup targets ================== --> 366 354 367 355 <target name="accept-properties" unless="properties.accepted"> 368 356 <input addproperty="properties.ok" validargs="y,n">The following properties (among others) are being used from a build.properties file found in this directory: 369 370 371 372 373 374 357 tomcat.server=${tomcat.server} 358 tomcat.port=${tomcat.port} 359 tomcat.installed.path=${tomcat.installed.path} (this is the location of Tomcat's base dir if it is already installed) 360 proxy.host=${proxy.host} 361 proxy.port=${proxy.port} 362 If these are not acceptable, please change them and rerun this target. Continue [y/n]? /> 375 363 </input> 376 364 <condition property="do.abort"> … … 380 368 </target> 381 369 370 <!-- <target name="check-cvsroot"> 371 <condition property="svnroot.notset"> 372 <or> 373 <not> 374 <isset property="env.CVSROOT"/> 375 </not> 376 <equals arg1="" arg2="${env.CVSROOT}"/> 377 </or> 378 </condition> 379 <fail if="cvsroot.notset" message="You need to set the CVSROOT variable"/> 380 </target> --> 382 381 383 382 <!-- this sets up some initial properties --> … … 406 405 </condition> 407 406 408 <echo>tomcat.port = ${tomcat.port}</echo> 409 <echo>gli.present = ${gli.present}</echo> 410 <echo>gs2build.present = ${gs2build.present}</echo> 411 <echo>gsdl2.installed.path = ${gsdl2.installed.path}</echo> 412 <!-- gsdl2.installed.path appears not to be set? --> 407 <echo>tomcat.port = ${tomcat.port}</echo> 408 <echo>gli.present = ${gli.present}</echo> 409 <echo>gs2build.present = ${gs2build.present}</echo> 410 <!-- gsdl2.installed.path appears not to be set, so wrap in if block --> 411 <if> 412 <bool><isset property="gsdl2.installed.path"/></bool> 413 <echo>gsdl2.installed.path = ${gsdl2.installed.path}</echo> 414 </if> 413 415 414 416 <condition property="proxy.present"> … … 441 443 <mysetproxy proxyhost="${proxy.host}" proxyport="${proxy.port}" proxyuser="${proxy.username}" proxypassword="${proxy.password}"/> 442 444 </target> 443 444 445 446 <!-- ========== Web app Targets ================================ --> 445 447 446 448 <target name="prepare-web" depends="init,configure-java-version"> … … 453 455 description="Activates or deactivates some jar libraries as needed depending on your java version"> 454 456 455 457 <available property="have.xalan.jar" file="${web.lib}/xalan.jar"/> 456 458 <condition property="need.xalan.jar"> 457 458 <equals arg1="1.5" arg2="${ant.java.version}"/>459 <equals arg1="1.6" arg2="${ant.java.version}"/>460 461 462 463 464 465 466 <and>467 468 469 </and>470 471 472 473 474 475 476 477 <and>478 479 480 </and>481 482 483 459 <or> 460 <equals arg1="1.5" arg2="${ant.java.version}"/> 461 <equals arg1="1.6" arg2="${ant.java.version}"/> 462 </or> 463 </condition> 464 465 <!-- if they have xalan.jar but dont need it --> 466 <if> 467 <bool> 468 <and> 469 <isset property="have.xalan.jar"/> 470 <not><isset property="need.xalan.jar"/></not> 471 </and> 472 </bool> 473 <antcall target="deactivate-xalan-jar"/> 474 </if> 475 476 <!-- if they need xalan.jar but dont have it --> 477 <if> 478 <bool> 479 <and> 480 <not><isset property="have.xalan.jar"/></not> 481 <isset property="need.xalan.jar"/> 482 </and> 483 </bool> 484 <antcall target="activate-xalan-jar"/> 485 </if> 484 486 485 487 </target> 486 488 487 489 <target name="activate-xalan-jar"> 488 490 <echo>activating xalan.jar</echo> 489 491 <copy file="${web.lib}/xalan.jar.tmp" tofile="${web.lib}/xalan.jar"/> 490 491 492 493 </target> 494 495 492 <if><bool><isset property="current.os.ismac"/></bool> 493 <copy file="${web.lib}/xalan.jar.tmp" tofile="${catalina.home}/common/endorsed/xalan.jar"/> 494 </if> 495 </target> 496 497 <!-- to delete --> 496 498 <target name="copy-xalan-for-mac"></target> 497 499 498 500 <target name="deactivate-xalan-jar"> 499 501 <echo>deactivating xalan.jar</echo> 500 502 <delete file="${web.lib}/xalan.jar"/> 501 503 </target> 502 504 503 <target name="prepare-collections" depends="init">504 <property name="collect.dir" value="${web.home}/sites/localsite/collect"/>505 <echo message="installing collections..."/>506 <antcall target="gs2mgdemo-install"/>507 <antcall target="gs2mgppdemo-install"/>508 <antcall target="gberg-install"/>509 510 </target>511 512 <target name="gs2mgdemo-prepare" if="collect.dir">513 <property name="gs2mgdemo.dir" value="${collect.dir}/gs2mgdemo"/>514 <property name="gs2mgdemo.import.zip" value="${gs2mgdemo.dir}/import.zip"/>515 <property name="gs2mgdemo.metadata.zip" value="${gs2mgdemo.dir}/metadata.zip"/>516 <property name="gs2mgdemo.index.zip" value="${gs2mgdemo.dir}/index.zip"/>517 518 <fileset id="gs2mgdemofiles" dir="${gs2mgdemo.dir}">519 <include name="${gs2mgdemo.import.zip}"/>520 <include name="${gs2mgdemo.metadata.zip}"/>521 <include name="${gs2mgdemo.index.zip}"/>522 </fileset>523 524 <condition property="gs2mgdemo.present">525 <and>526 <available file="${gs2mgdemo.import.zip}"/>527 <available file="${gs2mgdemo.metadata.zip}"/>528 <available file="${gs2mgdemo.index.zip}"/>529 </and>530 </condition>531 </target>532 533 <target name="gs2mgdemo-install" if="gs2mgdemo.present" depends="gs2mgdemo-prepare">534 <echo> installing gs2mgdemo</echo>535 <unzip dest="${gs2mgdemo.dir}">536 <fileset refid="gs2mgdemofiles"/>537 </unzip>538 <delete>539 <fileset refid="gs2mgdemofiles"/>540 </delete>541 <echo>collection gs2mgdemo installed</echo>542 </target>543 544 <target name="gs2mgppdemo-prepare" if="collect.dir">545 <property name="gs2mgppdemo.dir" value="${collect.dir}/gs2mgppdemo"/>546 <property name="gs2mgppdemo.import.zip" value="${gs2mgppdemo.dir}/import.zip"/>547 <property name="gs2mgppdemo.metadata.zip" value="${gs2mgppdemo.dir}/metadata.zip"/>548 <property name="gs2mgppdemo.index.zip" value="${gs2mgppdemo.dir}/index.zip"/>549 550 <fileset id="gs2mgppdemofiles" dir="${gs2mgppdemo.dir}">551 <include name="${gs2mgppdemo.import.zip}"/>552 <include name="${gs2mgppdemo.metadata.zip}"/>553 <include name="${gs2mgppdemo.index.zip}"/>554 </fileset>555 556 <condition property="gs2mgppdemo.present">557 <and>558 <available file="${gs2mgppdemo.import.zip}"/>559 <available file="${gs2mgppdemo.metadata.zip}"/>560 <available file="${gs2mgppdemo.index.zip}"/>561 </and>562 </condition>563 </target>564 565 <target name="gs2mgppdemo-install" if="gs2mgppdemo.present" depends="gs2mgppdemo-prepare">566 <unzip dest="${gs2mgppdemo.dir}">567 <fileset refid="gs2mgppdemofiles"/>568 </unzip>569 <delete>570 <fileset refid="gs2mgppdemofiles"/>571 </delete>572 <echo>collection gs2mgppdemo installed</echo>573 </target>574 575 <target name="gberg-prepare" if="collect.dir">576 <property name="gberg.dir" value="${collect.dir}/gberg"/>577 <property name="gberg.index.zip" value="${gberg.dir}/index.zip"/>578 579 <fileset id="gbergfiles" dir="${gberg.dir}">580 <include name="${gberg.index.zip}"/>581 </fileset>582 <available file="${gberg.index.zip}" property="gberg.present"/>583 </target>584 585 <target name="gberg-install" if="gberg.present" depends="gberg-prepare">586 <unzip dest="${gberg.dir}">587 <fileset refid="gbergfiles"/>588 </unzip>589 <delete>590 <fileset refid="gbergfiles"/>591 </delete>592 <echo>collection gberg installed</echo>593 </target>594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 <!--612 505 <target name="prepare-collections" depends="init"> 613 506 <property name="collect.dir" value="${web.home}/sites/localsite/collect"/> 614 507 <!-- gs2mgdemo --> 615 508 <unzip src="${collect.dir}/gs2mgdemo/import.zip" 616 509 dest="${collect.dir}/gs2mgdemo"/> … … 622 515 <delete file="${collect.dir}/gs2mgdemo/metadata.zip"/> 623 516 <delete file="${collect.dir}/gs2mgdemo/index/index.zip"/> 624 517 <!-- gs2mgppdemo --> 625 518 <unzip src="${collect.dir}/gs2mgppdemo/import.zip" 626 519 dest="${collect.dir}/gs2mgppdemo"/> … … 632 525 <delete file="${collect.dir}/gs2mgppdemo/metadata.zip"/> 633 526 <delete file="${collect.dir}/gs2mgppdemo/index/index.zip"/> 634 527 <!-- gberg --> 635 528 <unzip src="${collect.dir}/gberg/index/index.zip" 636 529 dest="${collect.dir}/gberg/index"/> 637 530 <delete file="${collect.dir}/gberg/index/index.zip"/> 638 531 </target> 639 --> 532 640 533 641 534 <target name="configure-web" depends="init" … … 667 560 </target> 668 561 669 670 671 672 673 562 <target name="svnupdate-web" unless="nosvn.mode"> 563 <svn> 564 <update dir="${web.home}"/> 565 </svn> 566 </target> 674 567 675 568 <target name="update-web" depends="init,svnupdate-web,configure-web" … … 677 570 678 571 679 572 <!-- ======================= Tomcat Targets ========================== --> 680 573 681 574 <!-- this target downloads and installs Tomcat --> … … 685 578 <!-- check that packages dir is there --> 686 579 <mkdir dir="${packages.home}"/> 687 <get src="http://www.greenstone.org/gs3files/ ${tomcat.version}.zip"688 dest="${packages.home}/ ${tomcat.version}.zip"580 <get src="http://www.greenstone.org/gs3files/apache-tomcat-5.5.25.zip" 581 dest="${packages.home}/apache-tomcat-5.5.25.zip" 689 582 usetimestamp="true"/> 690 <unzip src="${packages.home}/ ${tomcat.version}.zip"583 <unzip src="${packages.home}/apache-tomcat-5.5.25.zip" 691 584 dest="${packages.home}"/> 692 <get src="http://www.greenstone.org/gs3files/ ${tomcat.version}-compat.zip"693 dest="${packages.home}/ ${tomcat.version}-compat.zip"585 <get src="http://www.greenstone.org/gs3files/apache-tomcat-5.5.25-compat.zip" 586 dest="${packages.home}/apache-tomcat-5.5.25-compat.zip" 694 587 usetimestamp="true"/> 695 <unzip src="${packages.home}/ ${tomcat.version}-compat.zip"588 <unzip src="${packages.home}/apache-tomcat-5.5.25-compat.zip" 696 589 dest="${packages.home}"/> 697 590 <!-- delete any existing tomcat --> 698 591 <delete dir="${packages.home}/tomcat"/> 699 592 <move todir="${packages.home}/tomcat"> 700 <fileset dir="${packages.home}/ ${tomcat.version}"/>593 <fileset dir="${packages.home}/apache-tomcat-5.5.25"/> 701 594 </move> 702 595 <copy file="${basedir}/resources/tomcat/setclasspath.bat" … … 733 626 <!-- need to edit the config file, or do we get the user to do this???--> 734 627 </target> 735 628 736 629 <target name="start-tomcat" description="Startup only Tomcat" depends="init,configure-java-version" if="tomcat.islocal"> 737 630 <property name="tomcat.classpath" refid="local.tomcat.classpath"/> 738 631 <property name="tomcat.path" refid="local.tomcat.path"/> 739 632 <property name="catalina.opts" value="-Djava.util.prefs.syncInterval=2000000 -DGSDL3HOME=$GSDL3HOME -DGSDLOS=$GSDLOS -DPATH=$PATH -Xmx400M"/> … … 798 691 799 692 800 801 802 803 804 <!-- ======================= ant Targets ============================ --> 693 <!-- ======================= ant Targets ============================ --> 805 694 <target name="prepare-ant" depends="init"> 806 695 <get src="http://www.greenstone.org/gs3files/apache-ant-1.7.0-bin.zip" … … 814 703 </target> 815 704 816 705 <!-- ======================= Axis Targets ============================ --> 817 706 818 707 <target name="prepare-axis" depends="init"> 819 <get src="http://www.greenstone.org/gs3files/ ${axis.zip.version}"820 dest="${packages.home}/ ${axis.zip.version}"708 <get src="http://www.greenstone.org/gs3files/axis-bin-1_2_1.zip" 709 dest="${packages.home}/axis-bin-1_2_1.zip" 821 710 usetimestamp="true"/> 822 <unzip src="${packages.home}/ ${axis.zip.version}"711 <unzip src="${packages.home}/axis-bin-1_2_1.zip" 823 712 dest="${packages.home}"/> 824 713 <move todir="${packages.home}/axis"> 825 <fileset dir="${packages.home}/ ${axis.dir.version}"/>714 <fileset dir="${packages.home}/axis-1_2_1"/> 826 715 </move> 827 716 <!-- install axis into greenstone web app --> … … 845 734 </target> 846 735 847 <target name="soap-deploy-site" depends="init,get-sitename,get-siteuri, create-deployment-files,deploy-site"736 <target name="soap-deploy-site" depends="init,get-sitename,get-siteuri,get-webservices,create-deployment-files,deploy-site" 848 737 description="Deploy a SOAP web service for a local Greenstone site. Tomcat must be running for this to work."/> 849 738 … … 853 742 <arg value="-l"/> 854 743 <arg value="http://${tomcat.server}:${tomcat.port}${app.path}/servlet/AxisServlet"/> 855 <arg file="${basedir}/resources/soap/${axis.sitename}.wsdd"/> 856 </java> 857 </target> 858 859 <target name="soap-undeploy-site" depends="get-sitename" 744 <arg file="${basedir}/resources/soap/deploy.wsdd"/> 745 </java> 746 <delete file="${basedir}/resources/soap/deploy.wsdd"/> <!--clean up, no longer used--> 747 </target> 748 749 <target name="soap-undeploy-site" depends="get-undeploy-service-name" 860 750 description="Undeploy a SOAP web service for a local Greenstone site. Tomcat must be running for this to work."> 751 <filter token="servicesname" value="${axis.undeploy.servicename}"/> 752 <copy file="${basedir}/resources/soap/undeploy-site.wsdd.template" 753 tofile="${basedir}/resources/soap/undeploy.wsdd" 754 filtering="true" 755 overwrite="true"/> 861 756 <java classname="org.apache.axis.client.AdminClient"> 862 757 <classpath refid="compile.classpath"/> 863 758 <arg value="-l"/> 864 759 <arg value="http://${tomcat.server}:${tomcat.port}${app.path}/servlet/AxisServlet"/> 865 <arg file="${basedir}/resources/soap/undeploy -${axis.sitename}.wsdd"/>760 <arg file="${basedir}/resources/soap/undeploy.wsdd"/> 866 761 </java> 867 </target> 868 869 <!-- this target used to deploy the preprepared localsite server --> 762 <delete file="${basedir}/resources/soap/undeploy.wsdd"/> <!--clean up, no longer used--> 763 </target> 764 765 <!-- this target used to deploy the default web service SOAPServer (base.webservice.name) on the localsite server 766 with the default servicename of localsite--> 870 767 <target name="deploy-localsite" depends="init" 871 768 description="Deploy the SOAP server for localsite. Will start and stop Tomcat."> 872 769 <antcall target="start-tomcat"/> 770 <echo>Deploying ${base.webservice.name} web services for localsite under service name: localsite</echo> 771 <antcall target="create-deployment-files"> 772 <param name="axis.sitename" value="localsite"/> 773 <param name="axis.servicesname" value="${base.webservice.name}"/> 774 <param name="axis.siteuri" value="localsite"/> 775 </antcall> 873 776 <antcall target="deploy-site"> 874 777 <param name="axis.sitename" value="localsite"/> 778 <param name="axis.servicesname" value="${base.webservice.name}"/> 779 <param name="axis.siteuri" value="localsite"/> 875 780 </antcall> 876 < antcall target="stop-tomcat"/>781 <echo>The Greenstone server has been started up. If you do not want it running, please type: ant stop.</echo> 877 782 </target> 878 783 879 784 <target name="get-sitename" unless="axis.sitename"> 880 <input addproperty="axis.sitename" message="What site? (press enter for default:localsite)" defaultvalue="localsite"/> 881 </target> 882 883 <target name="get-siteuri" depends="get-sitename" unless="axis.siteuri"> 884 <input addproperty="axis.siteuri" message="What name do you want the service to have? (press enter for default:${axis.sitename})" defaultvalue="${axis.sitename}"/> 885 <echo>${axis.sitename}, ${axis.siteuri}</echo> 886 </target> 887 888 <target name="check-deployment-files" depends="get-sitename"> 889 <condition property="deploy.exists"> 890 <and> 891 <available file="${basedir}/resources/soap/${axis.sitename}.wsdd"/> 892 <available file="${basedir}/resources/soap/undeploy-${axis.sitename}.wsdd"/> 893 <available file="${web.classes}/org/greenstone/gsdl3/SOAPServer${axis.sitename}.class"/> 894 </and> 785 <input addproperty="axis.sitename" defaultvalue="localsite">What site do you want to deploy services for? 786 Press Enter for default:localsite</input> 787 </target> 788 789 <target name="get-undeploy-service-name" unless="axis.undeploy.servicename"> 790 <input addproperty="axis.undeploy.servicename" defaultvalue="localsite">Please enter the full name of the service you wish to undeploy. 791 To find out which web services you've got deployed, point your browser to http://HOST:PORT/greenstone3/services 792 Or press Enter for undeploying the default:localsite /></input> 793 <echo>Name of service to undeploy: ${axis.undeploy.servicename}</echo> 794 </target> 795 796 <target name="get-webservices" unless="axis.servicesname"> 797 <input addproperty="axis.servicesname" defaultvalue="${base.webservice.name}">Which set of web services do you want to deploy? 798 Choose from: ${web.services.list} 799 Or press Enter for default:${base.webservice.name} /></input> 800 <echo>${axis.servicesname}</echo> 801 </target> 802 803 <target name="get-siteuri" depends="get-sitename,get-webservices" unless="axis.siteuri"> 804 <input addproperty="axis.siteuri" defaultvalue="${axis.servicesname}${axis.sitename}">What name do you want the service to have? (Press Enter for default:${axis.servicesname}${axis.sitename})</input> 805 <echo>Site: ${axis.sitename}, services: ${axis.servicesname}, servicesname: ${axis.siteuri}</echo> 806 </target> 807 808 <target name="set-soapmethod" description="Determines whether the service in the wsdd should have the style attribute set to message or the provider attribute set to java:RPC" if="axis.servicesname"> 809 <condition property="soap.method" value="provider='java:MSG' style='message' use='literal'"> 810 <equals arg1="${axis.servicesname}" arg2="${base.webservice.name}"/> 895 811 </condition> 896 </target> 897 898 <target name="create-deployment-files" depends="get-sitename,get-siteuri,check-deployment-files" 899 if="axis.sitename" unless="deploy.exists"> 812 813 <!--everything else defaults to java:RPC at present--> 814 <condition property="soap.method" value="provider='java:RPC'"> 815 <not> 816 <equals arg1="${axis.servicesname}" arg2="${base.webservice.name}"/> 817 </not> 818 </condition> 819 </target> 820 821 <target name="create-deployment-files" depends="set-soapmethod" if="axis.sitename"> 900 822 <filter token="sitename" value="${axis.sitename}"/> 901 823 <filter token="siteuri" value="${axis.siteuri}"/> 824 <filter token="servicesname" value="${axis.servicesname}"/> 825 <filter token="soapmethod" value="${soap.method}"/> 902 826 <copy file="${basedir}/resources/soap/site.wsdd.template" 903 tofile="${basedir}/resources/soap/${axis.sitename}.wsdd" 904 filtering="true"/> 905 <copy file="${basedir}/resources/soap/undeploy-site.wsdd.template" 906 tofile="${basedir}/resources/soap/undeploy-${axis.sitename}.wsdd" 907 filtering="true"/> 827 tofile="${basedir}/resources/soap/deploy.wsdd" 828 filtering="true" 829 overwrite="true"/> 908 830 <!-- create the java files and compile them --> 909 <copy file="${basedir}/resources/java/SOAPServer.java.in" 910 tofile="${src.gsdl3.home}/SOAPServer${axis.sitename}.java" 911 filtering="true"/> 831 <copy file="${basedir}/resources/java/${axis.servicesname}.java.in" 832 tofile="${src.gsdl3.home}/${axis.servicesname}${axis.sitename}.java" 833 filtering="true" 834 overwrite="true"/> 912 835 <mkdir dir="${build.home}"/> 913 836 <javac srcdir="${src.home}" … … 917 840 optimize="${compile.optimize}"> 918 841 <classpath refid="compile.classpath"/> 919 <include name="org/greenstone/gsdl3/ SOAPServer${axis.sitename}.java" />842 <include name="org/greenstone/gsdl3/${axis.servicesname}${axis.sitename}.java" /> 920 843 </javac> 921 844 <mkdir dir="${web.classes}/org/greenstone/gsdl3"/> 922 <copy file="${build.home}/org/greenstone/gsdl3/SOAPServer${axis.sitename}.class" tofile="${web.classes}/org/greenstone/gsdl3/SOAPServer${axis.sitename}.class" /> 923 </target> 924 925 926 <!-- ====================== Core targets ============================== --> 927 <!-- core targets refer to the core gsdl3 java src --> 928 929 <target name="prepare-core" unless="nosvn.mode"> 845 <copy file="${build.home}/org/greenstone/gsdl3/${axis.servicesname}${axis.sitename}.class" tofile="${web.classes}/org/greenstone/gsdl3/${axis.servicesname}${axis.sitename}.class" 846 overwrite="true" /> 847 </target> 848 849 850 <!-- ====================== Core targets ============================== --> 851 <!-- core targets refer to the core gsdl3 java src --> 852 853 <target name="prepare-core" unless="nocvs.mode"> 930 854 <!-- just get rid of empty directories--> 931 855 <svn> 932 933 856 <update dir="."/> 857 </svn> 934 858 </target> 935 859 … … 939 863 description="Update only the Greenstone core" /> 940 864 941 <target name="svnupdate-core" unless="no svn.mode">942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 865 <target name="svnupdate-core" unless="nocvs.mode"> 866 867 <svn> 868 <update dir="." recurse="false"/> 869 </svn> 870 871 <svn> 872 <update dir="bin"/> 873 <update dir="comms"/> 874 <update dir="dist-resources"/> 875 <update dir="docs"/> 876 <update dir="lib"/> 877 <update dir="resources"/> 878 <update dir="src"/> 879 <update dir="winutil"/> 880 </svn> 957 881 958 882 </target> … … 963 887 </target> 964 888 965 <target name="compile-core" depends="init"889 <target name="compile-core" depends="init" 966 890 description="Compile only the Greenstone core"> 967 891 <mkdir dir="${build.home}"/> … … 987 911 <copy file="${build.home}/gsdl3.jar" todir="${web.lib}"/> 988 912 <!-- copy the localsite server in case we need it --> 989 <copy file="${build.home}/org/greenstone/gsdl3/ SOAPServerlocalsite.class" tofile="${web.classes}/org/greenstone/gsdl3/SOAPServerlocalsite.class" />913 <copy file="${build.home}/org/greenstone/gsdl3/${base.webservice.name}localsite.class" tofile="${web.classes}/org/greenstone/gsdl3/${base.webservice.name}localsite.class" /> 990 914 991 915 <jar destfile="${build.home}/GAI.jar"> … … 997 921 </manifest> 998 922 </jar> 999 923 1000 924 <jar destfile="${build.home}/phind.jar"> 1001 925 <fileset dir="${build.home}"> … … 1040 964 <copy file="${build.home}/server.jar" todir="${basedir}"/> 1041 965 </target> 1042 1043 966 967 <!-- ================== Packages targets ================================ --> 1044 968 <!-- these targets refer to the greenstone source packages - these need 1045 969 updating less often, so are in separate targets to the core --> 1046 970 <target name="prepare-packages" depends="init,prepare-indexers"/> 1047 971 1048 <target name="checkout-indexers" depends="init" if="independent-indexers" unless="nosvn.mode"> 972 <target name="checkout-indexers" depends="init" if="independent-indexers" unless="nocvs.mode"> 973 <!-- <target name="checkout-indexers" depends="check-svnroot,init" if="independent-indexers" unless="nocvs.mode"> --> 1049 974 <svn> 1050 1051 975 <checkout url="${svn.root}/indexers/${branch.path}" dest="${src.packages.home}/indexers" revision="${branch.revision}"/> 976 </svn> 1052 977 </target> 1053 978 … … 1059 984 description="Update only the source packages"/> 1060 985 1061 <target name="svnupdate-packages" unless="no svn.mode">1062 1063 1064 986 <target name="svnupdate-packages" unless="nocvs.mode"> 987 <svn> 988 <update dir="${src.packages.home}"/> 989 </svn> 1065 990 </target> 1066 991 … … 1081 1006 <arg value="--prefix=${basedir}"/> 1082 1007 <arg value="--libdir=${lib.jni}"/> 1083 1008 <arg value="--with-gdbm=${gdbm.installed.path}"/> 1084 1009 </exec> 1085 1010 </target> 1086 1011 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1012 <!-- Message from oran. I removed the condition from this line becuase it meant 1013 the indexers would only be configured if collection building was DISabled. 1014 Shouldn't they be configured when collection building is ENabled? --> 1015 1016 <!-- <target name="configure-indexers" depends="init" if="independent-indexers"> --> 1017 <target name="configure-indexers" depends="init"> 1018 <echo>Configuring Indexers</echo> 1019 <exec executable="${indexers.home}/configure" os="${os.unix}" dir="${indexers.home}"> 1020 <arg value="--prefix=${basedir}"/> 1021 <arg value="--libdir=${lib.jni}"/> 1022 </exec> 1023 </target> 1099 1024 1100 1025 <target name="clean-packages" depends="init,clean-javagdbm,clean-indexers" description="Clean only the packages"/> … … 1113 1038 </exec> 1114 1039 <exec executable="${indexers.home}/winMake.bat" os="${os.windows}" 1115 dir="${indexers.home}"> 1116 <arg value="clean"/> 1117 </exec> 1118 1119 </target> 1120 <target name="distclean-packages" depends="init,distclean-javagdbm,distclean-indexers" description="Distclean only the packages"/> 1121 1122 <target name="distclean-javagdbm" depends="init"> 1123 <exec executable="make" os="${os.unix}" 1124 dir="${javagdbm.home}"> 1125 <arg value="distclean"/> 1126 </exec> 1127 </target> 1128 1129 <target name="distclean-indexers" depends="init" if="independent-indexers"> 1130 <exec executable="make" os="${os.unix}" 1131 dir="${indexers.home}"> 1132 <arg value="distclean"/> 1133 </exec> 1134 <exec executable="${indexers.home}/winMake.bat" os="${os.windows}" 1135 dir="${indexers.home}"> 1136 <arg value="clean"/> 1137 </exec> 1138 1139 </target> 1140 1141 <target name="compile-packages" description="Compile only the source packages"> 1142 1143 <!-- javagdbm --> 1144 <echo>compile javagdbm</echo> 1145 <exec executable="make" os="${os.unix}" dir="${javagdbm.home}"/> 1146 <exec executable="make" os="${os.unix}" dir="${javagdbm.home}"> 1147 <arg value="install"/> 1148 </exec> 1149 1150 <!-- windows: just the java stuff. --> 1151 <echo>Windows: compile javagdbm (java only)</echo> 1152 <exec executable="${javagdbm.home}/winMake.bat" os="${os.windows}" dir="${javagdbm.home}"> 1153 <arg value="compile"/> 1154 <arg value="javaonly"/> 1155 </exec> 1156 1157 <!-- install the jar file --> 1158 <echo>Install the javagdbm jar file</echo> 1159 <copy file="${javagdbm.home}/javagdbm.jar" todir="${lib.jni}"/> 1160 1161 <!-- Indexers --> 1162 1163 <!-- this may be in gs2build - we will be recompiling, but never mind --> 1164 <echo>Indexers: make (from ${indexers.home})</echo> 1165 <exec executable="make" os="${os.unix}" dir="${indexers.home}"/> 1166 <echo>Indexers: make install</echo> 1167 <exec executable="make" os="${os.unix}" dir="${indexers.home}"> 1168 <arg value="install"/> 1169 </exec> 1170 1171 <echo>Indexers: make</echo> 1172 <exec executable="${indexers.home}/winMake.bat" os="${os.windows}" dir="${indexers.home}"> 1173 <arg value="all"/> 1174 </exec> 1175 <echo>Indexers: make install</echo> 1176 <exec executable="${indexers.home}/winMake.bat" os="${os.windows}" dir="${indexers.home}"> 1177 <arg value="install"/> 1178 </exec> 1179 1180 <!-- install the jar and jni files --> 1181 <echo>Install the indexers' jar and jni files</echo> 1182 <copy file="${mg.home}/mg.jar" todir="${lib.jni}"/> 1183 <copy file="${mgpp.home}/mgpp.jar" todir="${lib.jni}"/> 1184 <copy file="${lucene.home}/LuceneWrapper.jar" todir="${web.lib}"/> 1185 <antcall target="install-jni-files"/> 1186 </target> 1040 dir="${indexers.home}"> 1041 <arg value="clean"/> 1042 </exec> 1043 1044 </target> 1045 1046 <target name="compile-packages" description="Compile only the source packages"> 1047 1048 <!-- javagdbm --> 1049 <echo>compile javagdbm</echo> 1050 <exec executable="make" os="${os.unix}" dir="${javagdbm.home}"/> 1051 <exec executable="make" os="${os.unix}" dir="${javagdbm.home}"> 1052 <arg value="install"/> 1053 </exec> 1054 1055 <!-- windows: just the java stuff. --> 1056 <echo>Windows: compile javagdbm (java only)</echo> 1057 <exec executable="${javagdbm.home}/winMake.bat" os="${os.windows}" dir="${javagdbm.home}"> 1058 <arg value="compile"/> 1059 <arg value="javaonly"/> 1060 </exec> 1061 1062 <!-- install the jar file --> 1063 <echo>Install the javagdbm jar file</echo> 1064 <copy file="${javagdbm.home}/javagdbm.jar" todir="${lib.jni}"/> 1065 1066 <!-- Indexers --> 1067 1068 <!-- this may be in gs2build - we will be recompiling, but never mind --> 1069 <echo>Indexers: make (from ${indexers.home})</echo> 1070 <exec executable="make" os="${os.unix}" dir="${indexers.home}"/> 1071 <echo>Indexers: make install</echo> 1072 <exec executable="make" os="${os.unix}" dir="${indexers.home}"> 1073 <arg value="install"/> 1074 </exec> 1075 1076 <echo>Indexers: make</echo> 1077 <exec executable="${indexers.home}/winMake.bat" os="${os.windows}" dir="${indexers.home}"> 1078 <arg value="all"/> 1079 </exec> 1080 <echo>Indexers: make install</echo> 1081 <exec executable="${indexers.home}/winMake.bat" os="${os.windows}" dir="${indexers.home}"> 1082 <arg value="install"/> 1083 </exec> 1084 1085 <!-- install the jar and jni files --> 1086 <echo>Install the indexers' jar and jni files</echo> 1087 <copy file="${mg.home}/mg.jar" todir="${lib.jni}"/> 1088 <copy file="${mgpp.home}/mgpp.jar" todir="${lib.jni}"/> 1089 <copy file="${lucene.home}/LuceneWrapper.jar" todir="${web.lib}"/> 1090 <antcall target="install-jni-files"/> 1091 </target> 1187 1092 1188 1093 <target name="install-jni-files" depends="init,install-jni-files-linux,install-jni-files-windows,install-jni-files-macos"/> 1189 1094 1190 <target name="install-jni-files-linux" depends="init" if="current.os.isunixnotmac">1095 <target name="install-jni-files-linux" depends="init" if="current.os.isunixnotmac"> 1191 1096 <copy file="${mg.home}/jni/libmgretrievejni.so" todir="${lib.jni}"/> 1192 1097 <copy file="${mg.home}/jni/libmgsearchjni.so" todir="${lib.jni}"/> 1193 <copy file="${mg.home}/jni/libmgpassjni.so" todir="${lib.jni}"/>1098 <copy file="${mg.home}/jni/libmgpassjni.so" todir="${lib.jni}"/> 1194 1099 <copy file="${mgpp.home}/jni/libmgppretrievejni.so" todir="${lib.jni}"/> 1195 1100 <copy file="${mgpp.home}/jni/libmgppsearchjni.so" todir="${lib.jni}"/> 1196 <copy file="${mgpp.home}/jni/libmgpppassjni.so" todir="${lib.jni}"/>1197 </target>1198 <target name="install-jni-files-windows" depends="init" if="current.os.iswindows">1101 <copy file="${mgpp.home}/jni/libmgpppassjni.so" todir="${lib.jni}"/> 1102 </target> 1103 <target name="install-jni-files-windows" depends="init" if="current.os.iswindows"> 1199 1104 <copy file="${mg.home}/jni/mgretrievejni.dll" todir="${lib.jni}"/> 1200 1105 <copy file="${mg.home}/jni/mgsearchjni.dll" todir="${lib.jni}"/> 1201 <copy file="${mg.home}/jni/mgpassjni.dll" todir="${lib.jni}"/>1106 <copy file="${mg.home}/jni/mgpassjni.dll" todir="${lib.jni}"/> 1202 1107 <copy file="${mgpp.home}/jni/mgppretrievejni.dll" todir="${lib.jni}"/> 1203 1108 <copy file="${mgpp.home}/jni/mgppsearchjni.dll" todir="${lib.jni}"/> 1204 <copy file="${mgpp.home}/jni/mgpppassjni.dll" todir="${lib.jni}"/>1205 </target>1206 <target name="install-jni-files-macos" depends="init" if="current.os.ismac">1109 <copy file="${mgpp.home}/jni/mgpppassjni.dll" todir="${lib.jni}"/> 1110 </target> 1111 <target name="install-jni-files-macos" depends="init" if="current.os.ismac"> 1207 1112 <copy file="${mg.home}/jni/libmgretrievejni.jnilib" todir="${lib.jni}"/> 1208 1113 <copy file="${mg.home}/jni/libmgsearchjni.jnilib" todir="${lib.jni}"/> 1209 <copy file="${mg.home}/jni/libmgpassjni.jnilib" todir="${lib.jni}"/>1114 <copy file="${mg.home}/jni/libmgpassjni.jnilib" todir="${lib.jni}"/> 1210 1115 <copy file="${mgpp.home}/jni/libmgppretrievejni.jnilib" todir="${lib.jni}"/> 1211 1116 <copy file="${mgpp.home}/jni/libmgppsearchjni.jnilib" todir="${lib.jni}"/> 1212 <copy file="${mgpp.home}/jni/libmgpppassjni.jnilib" todir="${lib.jni}"/>1213 </target>1214 1117 <copy file="${mgpp.home}/jni/libmgpppassjni.jnilib" todir="${lib.jni}"/> 1118 </target> 1119 1215 1120 <!-- ================== gs2building targets ===============--> 1216 1121 … … 1220 1125 description="Update only the Greenstone 2 building components"/> 1221 1126 1222 <target name="svnupdate-gs2building" if="collection.building.enabled" depends="init,svnupdate-gs2build,svnupdate-gli" unless="nosvn.mode"> 1223 </target> 1224 1225 <target name="svnupdate-gs2build" if="collection.building.enabled" depends="init" unless="nosvn.mode"> 1226 <!-- please keep this function in sync with checkout-gs2build --> 1227 1228 <echo>updating gs2build</echo> 1229 <!-- svn updates --> 1127 <target name="svnupdate-gs2building" if="collection.building.enabled" depends="init,svnupdate-gs2build,svnupdate-gli" unless="nocvs.mode"> 1128 </target> 1129 1130 <target name="svnupdate-gs2build" if="collection.building.enabled" depends="init" unless="nocvs.mode"> 1131 <!-- please keep this function in sync with checkout-gs2build --> 1132 1133 <echo>updating gs2build</echo> 1134 <!-- svn updates --> 1135 <svn> 1136 <!-- perllib --> 1137 <update dir="gs2build/perllib" revision="${branch.revision}"/> 1138 1139 <!-- selected packages --> 1140 <update dir="gs2build/packages/cpan" revision="${branch.revision}" /> 1141 <update dir="gs2build/packages/expat" revision="${branch.revision}" /> 1142 <update dir="gs2build/packages/html-tidy" revision="${branch.revision}" /> 1143 <update dir="gs2build/packages/isis-gdl" revision="${branch.revision}" /> 1144 <update dir="gs2build/packages/kea" revision="${branch.revision}" /> 1145 <update dir="gs2build/packages/pdftohtml" revision="${branch.revision}" /> 1146 <update dir="gs2build/packages/rtftohtml" revision="${branch.revision}" /> 1147 <update dir="gs2build/packages/w3mir" revision="${branch.revision}" /> 1148 <update dir="gs2build/packages/wget" revision="${branch.revision}" /> 1149 <update dir="gs2build/packages/windows" revision="${branch.revision}" /> 1150 <update dir="gs2build/packages/wv" revision="${branch.revision}" /> 1151 <update dir="gs2build/packages/xlhtml" revision="${branch.revision}" /> 1152 <update dir="gs2build/packages/yaz" revision="${branch.revision}" /> 1153 1154 <!-- some of src (db2txt hashfile phind txt2db) --> 1155 <update dir="gs2build/src/gdbmedit/db2txt" revision="${branch.revision}" /> 1156 <update dir="gs2build/src/hashfile" revision="${branch.revision}" /> 1157 <update dir="gs2build/src/phind" revision="${branch.revision}" /> 1158 <update dir="gs2build/src/gdbmedit/txt2db" revision="${branch.revision}" /> 1159 1160 <!-- bin --> 1161 <update dir="gs2build/bin/script" revision="${branch.revision}" /> 1162 1163 <!-- mappings --> 1164 <update dir="gs2build/mappings" revision="${branch.revision}"/> 1165 1166 <!-- etc/packages --> 1167 <update dir="gs2build/etc/packages" revision="${branch.revision}"/> 1168 1169 <!-- collect --> 1170 <update dir="gs2build/collect/modelcol" revision="${branch.revision}"/> 1171 1172 <!-- gs2build-extra --> 1173 <update dir="gs2build/gs2build-extra" revision="${branch.revision}"/> 1174 1175 <!-- indexers --> 1176 <update dir="gs2build/indexers" revision="${branch.revision}"/> 1177 1178 <!-- single files --> 1179 1180 <!-- some files from lib --> 1181 <export srcUrl="${svn.root}/gsdl/${branch.path}/lib/text_t.h" destPath="gs2build/lib/text_t.h"/> 1182 <export srcUrl="${svn.root}/gsdl/${branch.path}/lib/text_t.cpp" destPath="gs2build/lib/text_t.cpp"/> 1183 <export srcUrl="${svn.root}/gsdl/${branch.path}/lib/gsdlconf.h" destPath="gs2build/lib/gsdlconf.h"/> 1184 1185 <!-- some files from etc --> 1186 <export srcUrl="${svn.root}/gsdl/${branch.path}/etc/marctodc.txt" destPath="gs2build/etc/marctodc.txt"/> 1187 <export srcUrl="${svn.root}/gsdl/${branch.path}/etc/dc2marc-mapping.xml" destPath="gs2build/etc/dc2marc-mapping.xml"/> 1188 <export srcUrl="${svn.root}/gsdl/${branch.path}/etc/dc2marc.xsl" destPath="gs2build/etc/dc2marc.xsl"/> 1189 <export srcUrl="${svn.root}/gsdl/${branch.path}/etc/qdc2marc-mapping.xml" destPath="gs2build/etc/qdc2marc-mapping.xml"/> 1190 1191 <!-- some files from the gsdl root directory --> 1192 <export srcUrl="${svn.root}/gsdl/${branch.path}/setup.bash" destPath="gs2build/setup.bash"/> 1193 <export srcUrl="${svn.root}/gsdl/${branch.path}/config.sub" destPath="gs2build/config.sub"/> 1194 <export srcUrl="${svn.root}/gsdl/${branch.path}/config.guess" destPath="gs2build/config.guess"/> 1195 <export srcUrl="${svn.root}/gsdl/${branch.path}/config.h.in" destPath="gs2build/config.h.in"/> 1196 <export srcUrl="${svn.root}/gsdl/${branch.path}/configtest.pl" destPath="gs2build/configtest.pl"/> 1197 <export srcUrl="${svn.root}/gsdl/${branch.path}/install-sh" destPath="gs2build/install-sh"/> 1198 <export srcUrl="${svn.root}/gsdl/${branch.path}/acconfig.h" destPath="gs2build/acconfig.h"/> 1199 <export srcUrl="${svn.root}/gsdl/${branch.path}/aclocal.m4" destPath="gs2build/aclocal.m4"/> 1200 <export srcUrl="${svn.root}/gsdl/${branch.path}/WIN32cfg.h" destPath="gs2build/WIN32cfg.h"/> 1201 </svn> 1202 </target> 1203 1204 <target name="svnupdate-gli" if="collection.building.enabled" depends="init" unless="nocvs.mode"> 1230 1205 <svn> 1231 <!-- perllib --> 1232 <update dir="gs2build/perllib" revision="${branch.revision}"/> 1233 1234 <!-- selected packages --> 1235 <update dir="gs2build/packages/cpan" revision="${branch.revision}" /> 1236 <update dir="gs2build/packages/expat" revision="${branch.revision}" /> 1237 <update dir="gs2build/packages/html-tidy" revision="${branch.revision}" /> 1238 <update dir="gs2build/packages/isis-gdl" revision="${branch.revision}" /> 1239 <update dir="gs2build/packages/kea" revision="${branch.revision}" /> 1240 <update dir="gs2build/packages/pdftohtml" revision="${branch.revision}" /> 1241 <update dir="gs2build/packages/rtftohtml" revision="${branch.revision}" /> 1242 <update dir="gs2build/packages/w3mir" revision="${branch.revision}" /> 1243 <update dir="gs2build/packages/wget" revision="${branch.revision}" /> 1244 <update dir="gs2build/packages/windows" revision="${branch.revision}" /> 1245 <update dir="gs2build/packages/wv" revision="${branch.revision}" /> 1246 <update dir="gs2build/packages/xlhtml" revision="${branch.revision}" /> 1247 <update dir="gs2build/packages/yaz" revision="${branch.revision}" /> 1248 1249 <!-- some of src (db2txt hashfile phind txt2db) --> 1250 <update dir="gs2build/src/db2txt" revision="${branch.revision}" /> 1251 <update dir="gs2build/src/hashfile" revision="${branch.revision}" /> 1252 <update dir="gs2build/src/phind" revision="${branch.revision}" /> 1253 <update dir="gs2build/src/txt2db" revision="${branch.revision}" /> 1254 1255 <!-- bin --> 1256 <update dir="gs2build/bin/script" revision="${branch.revision}" /> 1257 1258 <!-- mappings --> 1259 <update dir="gs2build/mappings" revision="${branch.revision}"/> 1260 1261 <!-- etc/packages --> 1262 <update dir="gs2build/etc/packages" revision="${branch.revision}"/> 1263 1264 <!-- collect --> 1265 <update dir="gs2build/collect/modelcol" revision="${branch.revision}"/> 1266 1267 <!-- gs2build-extra --> 1268 <update dir="gs2build/gs2build-extra" revision="${branch.revision}"/> 1269 1270 <!-- indexers --> 1271 <update dir="gs2build/indexers" revision="${branch.revision}"/> 1272 1273 <!-- single files --> 1274 1275 <!-- some files from lib --> 1276 <export srcUrl="${svn.root}/gsdl/${branch.path}/lib/text_t.h" destPath="gs2build/lib/text_t.h"/> 1277 <export srcUrl="${svn.root}/gsdl/${branch.path}/lib/text_t.cpp" destPath="gs2build/lib/text_t.cpp"/> 1278 <export srcUrl="${svn.root}/gsdl/${branch.path}/lib/gsdlconf.h" destPath="gs2build/lib/gsdlconf.h"/> 1279 1280 <!-- some files from etc --> 1281 <export srcUrl="${svn.root}/gsdl/${branch.path}/etc/marctodc.txt" destPath="gs2build/etc/marctodc.txt"/> 1282 <export srcUrl="${svn.root}/gsdl/${branch.path}/etc/dc2marc-mapping.xml" destPath="gs2build/etc/dc2marc-mapping.xml"/> 1283 <export srcUrl="${svn.root}/gsdl/${branch.path}/etc/dc2marc.xsl" destPath="gs2build/etc/dc2marc.xsl"/> 1284 <export srcUrl="${svn.root}/gsdl/${branch.path}/etc/qdc2marc-mapping.xml" destPath="gs2build/etc/qdc2marc-mapping.xml"/> 1285 1286 <!-- some files from the gsdl root directory --> 1287 <export srcUrl="${svn.root}/gsdl/${branch.path}/setup.bash" destPath="gs2build/setup.bash"/> 1288 <export srcUrl="${svn.root}/gsdl/${branch.path}/config.sub" destPath="gs2build/config.sub"/> 1289 <export srcUrl="${svn.root}/gsdl/${branch.path}/config.guess" destPath="gs2build/config.guess"/> 1290 <export srcUrl="${svn.root}/gsdl/${branch.path}/config.h.in" destPath="gs2build/config.h.in"/> 1291 <export srcUrl="${svn.root}/gsdl/${branch.path}/configtest.pl" destPath="gs2build/configtest.pl"/> 1292 <export srcUrl="${svn.root}/gsdl/${branch.path}/install-sh" destPath="gs2build/install-sh"/> 1293 <export srcUrl="${svn.root}/gsdl/${branch.path}/acconfig.h" destPath="gs2build/acconfig.h"/> 1294 <export srcUrl="${svn.root}/gsdl/${branch.path}/aclocal.m4" destPath="gs2build/aclocal.m4"/> 1295 <export srcUrl="${svn.root}/gsdl/${branch.path}/WIN32cfg.h" destPath="gs2build/WIN32cfg.h"/> 1296 </svn> 1297 </target> 1298 1299 <target name="svnupdate-gli" if="collection.building.enabled" depends="init" unless="nosvn.mode"> 1300 <svn> 1301 <update dir="${gli.home}" revision="${branch.revision}"/> 1302 </svn> 1206 <update dir="${gli.home}" revision="${branch.revision}"/> 1207 </svn> 1303 1208 </target> 1304 1209 1305 1210 <target name="prepare-gs2building" depends="init,prepare-gs2build,prepare-gli" if="collection.building.enabled"> 1306 1211 </target> 1307 <target name="checkout-gs2build" depends="init" if="collection.building.enabled" unless="nosvn.mode">1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 <checkout url="${svn.root}/gsdl/${branch.path}/src/db2txt" destPath="gs2build/src/db2txt" revision="${branch.revision}" />1336 1337 1338 <checkout url="${svn.root}/gsdl/${branch.path}/src/txt2db" destPath="gs2build/src/txt2db" revision="${branch.revision}" />1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1212 <target name="checkout-gs2build" depends="init" if="collection.building.enabled" unless="nocvs.mode"> 1213 <!-- please keep this function in sync with update-gs2build --> 1214 <echo>checking out gs2build</echo> 1215 1216 <!-- this has to be created first to avoid errors when trying to export to it later --> 1217 <mkdir dir="${basedir}/gs2build/lib"/> 1218 1219 <!-- svn checkouts --> 1220 <svn> 1221 <!-- perllib --> 1222 <checkout url="${svn.root}/gsdl/${branch.path}/perllib" destPath="gs2build/perllib" revision="${branch.revision}"/> 1223 1224 <!-- selected packages --> 1225 <checkout url="${svn.root}/gsdl/${branch.path}/packages/cpan" destPath="gs2build/packages/cpan" revision="${branch.revision}" /> 1226 <checkout url="${svn.root}/gsdl/${branch.path}/packages/expat" destPath="gs2build/packages/expat" revision="${branch.revision}" /> 1227 <checkout url="${svn.root}/gsdl/${branch.path}/packages/html-tidy" destPath="gs2build/packages/html-tidy" revision="${branch.revision}" /> 1228 <checkout url="${svn.root}/gsdl/${branch.path}/packages/isis-gdl" destPath="gs2build/packages/isis-gdl" revision="${branch.revision}" /> 1229 <checkout url="${svn.root}/gsdl/${branch.path}/packages/kea" destPath="gs2build/packages/kea" revision="${branch.revision}" /> 1230 <checkout url="${svn.root}/gsdl/${branch.path}/packages/pdftohtml" destPath="gs2build/packages/pdftohtml" revision="${branch.revision}" /> 1231 <checkout url="${svn.root}/gsdl/${branch.path}/packages/rtftohtml" destPath="gs2build/packages/rtftohtml" revision="${branch.revision}" /> 1232 <checkout url="${svn.root}/gsdl/${branch.path}/packages/w3mir" destPath="gs2build/packages/w3mir" revision="${branch.revision}" /> 1233 <checkout url="${svn.root}/gsdl/${branch.path}/packages/wget" destPath="gs2build/packages/wget" revision="${branch.revision}" /> 1234 <checkout url="${svn.root}/gsdl/${branch.path}/packages/windows" destPath="gs2build/packages/windows" revision="${branch.revision}" /> 1235 <checkout url="${svn.root}/gsdl/${branch.path}/packages/wv" destPath="gs2build/packages/wv" revision="${branch.revision}" /> 1236 <checkout url="${svn.root}/gsdl/${branch.path}/packages/xlhtml" destPath="gs2build/packages/xlhtml" revision="${branch.revision}" /> 1237 <checkout url="${svn.root}/gsdl/${branch.path}/packages/yaz" destPath="gs2build/packages/yaz" revision="${branch.revision}" /> 1238 1239 <!-- some of src (db2txt hashfile phind txt2db) --> 1240 <checkout url="${svn.root}/gsdl/${branch.path}/src/gdbmedit/db2txt" destPath="gs2build/src/gdbmedit/db2txt" revision="${branch.revision}" /> 1241 <checkout url="${svn.root}/gsdl/${branch.path}/src/hashfile" destPath="gs2build/src/hashfile" revision="${branch.revision}" /> 1242 <checkout url="${svn.root}/gsdl/${branch.path}/src/phind" destPath="gs2build/src/phind" revision="${branch.revision}" /> 1243 <checkout url="${svn.root}/gsdl/${branch.path}/src/gdbmedit/txt2db" destPath="gs2build/src/gdbmedit/txt2db" revision="${branch.revision}" /> 1244 1245 <!-- bin --> 1246 <checkout url="${svn.root}/gsdl/${branch.path}/bin/script" destPath="gs2build/bin/script" revision="${branch.revision}" /> 1247 1248 <!-- mappings --> 1249 <checkout url="${svn.root}/gsdl/${branch.path}/mappings" destPath="gs2build/mappings" revision="${branch.revision}"/> 1250 1251 <!-- etc/packages --> 1252 <checkout url="${svn.root}/gsdl/${branch.path}/etc/packages" destPath="gs2build/etc/packages" revision="${branch.revision}"/> 1253 1254 <!-- collect --> 1255 <checkout url="${svn.root}/gsdl/${branch.path}/collect/modelcol" destPath="gs2build/collect/modelcol" revision="${branch.revision}"/> 1256 1257 <!-- gs2build-extra --> 1258 <checkout url="${svn.root}/other-projects/trunk/gs2build-extra" destPath="gs2build/gs2build-extra" revision="${branch.revision}"/> 1259 1260 <!-- indexers --> 1261 <checkout url="${svn.root}/indexers/${branch.path}" destPath="gs2build/indexers" revision="${branch.revision}"/> 1262 1263 <!-- single files --> 1264 1265 <!-- some files from lib --> 1266 <export srcUrl="${svn.root}/gsdl/${branch.path}/lib/text_t.h" destPath="gs2build/lib/text_t.h"/> 1267 <export srcUrl="${svn.root}/gsdl/${branch.path}/lib/text_t.cpp" destPath="gs2build/lib/text_t.cpp"/> 1268 <export srcUrl="${svn.root}/gsdl/${branch.path}/lib/gsdlconf.h" destPath="gs2build/lib/gsdlconf.h"/> 1269 1270 <!-- some files from etc --> 1271 <export srcUrl="${svn.root}/gsdl/${branch.path}/etc/marctodc.txt" destPath="gs2build/etc/marctodc.txt"/> 1272 <export srcUrl="${svn.root}/gsdl/${branch.path}/etc/dc2marc-mapping.xml" destPath="gs2build/etc/dc2marc-mapping.xml"/> 1273 <export srcUrl="${svn.root}/gsdl/${branch.path}/etc/dc2marc.xsl" destPath="gs2build/etc/dc2marc.xsl"/> 1274 <export srcUrl="${svn.root}/gsdl/${branch.path}/etc/qdc2marc-mapping.xml" destPath="gs2build/etc/qdc2marc-mapping.xml"/> 1275 1276 <!-- some files from the gsdl root directory --> 1277 <export srcUrl="${svn.root}/gsdl/${branch.path}/setup.bash" destPath="gs2build/setup.bash"/> 1278 <export srcUrl="${svn.root}/gsdl/${branch.path}/config.sub" destPath="gs2build/config.sub"/> 1279 <export srcUrl="${svn.root}/gsdl/${branch.path}/config.guess" destPath="gs2build/config.guess"/> 1280 <export srcUrl="${svn.root}/gsdl/${branch.path}/config.h.in" destPath="gs2build/config.h.in"/> 1281 <export srcUrl="${svn.root}/gsdl/${branch.path}/configtest.pl" destPath="gs2build/configtest.pl"/> 1282 <export srcUrl="${svn.root}/gsdl/${branch.path}/install-sh" destPath="gs2build/install-sh"/> 1283 <export srcUrl="${svn.root}/gsdl/${branch.path}/acconfig.h" destPath="gs2build/acconfig.h"/> 1284 <export srcUrl="${svn.root}/gsdl/${branch.path}/aclocal.m4" destPath="gs2build/aclocal.m4"/> 1285 <export srcUrl="${svn.root}/gsdl/${branch.path}/WIN32cfg.h" destPath="gs2build/WIN32cfg.h"/> 1286 </svn> 1287 </target> 1383 1288 1384 1289 <target name="prepare-gs2build" depends="init" if="collection.building.enabled" unless="gs2build.present"> … … 1393 1298 1394 1299 <target name="checkout-winbin" depends="init" if="current.os.iswindows" 1395 unless="no svn.mode">1300 unless="nocvs.mode"> 1396 1301 <svn> 1397 1398 1399 </target> 1400 1401 <target name="update-winbin" depends="init" if="current.os.iswindows" unless="no svn.mode">1402 1403 1404 1405 1302 <checkout url="${svn.root}/other-projects/trunk/winbin" destPath="${basedir}/winbin" revision="${branch.revision}"/> 1303 </svn> 1304 </target> 1305 1306 <target name="update-winbin" depends="init" if="current.os.iswindows" unless="nocvs.mode"> 1307 <svn> 1308 <update dir="winbin"/> 1309 </svn> 1310 </target> 1406 1311 1407 1312 <target name="get-windows-binaries" depends="init" if="collection.building.enabled.windows"> … … 1416 1321 <target name="unzip-windows-packages" depends="init" if="collection.building.enabled.windows"> 1417 1322 <unzip src="${gs2build.home}/packages/windows/gdbm/gdbm.zip" 1418 1419 1420 1421 <unzip src="${gs2build.home}/packages/windows/expat/expat.zip"1422 1423 </target>1323 dest="${gs2build.home}/packages/windows/gdbm"/> 1324 <unzip src="${gs2build.home}/packages/windows/crypt/crypt.zip" 1325 dest="${gs2build.home}/packages/windows/crypt"/> 1326 <unzip src="${gs2build.home}/packages/windows/expat/expat.zip" 1327 dest="${gs2build.home}/packages/windows/expat"/> 1328 </target> 1424 1329 1425 1330 <!-- downloads a good XML-Parser --> 1426 1331 <target name="get-macos-extra" depends="init" if="need.macos.extra"> 1427 <get src="http://www.greenstone.org/gs3files/XML-Parser.tar.gz" 1332 <!-- 1333 <get src="http://www.greenstone.org/gs3files/XML-Parser.tar.gz" 1428 1334 dest="${gs2build.home}/perllib/cpan/XML-Parser.tar.gz" 1429 1335 usetimestamp="true"/> 1336 --> 1337 <echo>Nothing extra currently needed for MacOs prepare</echo> 1430 1338 </target> 1431 1339 … … 1434 1342 <!-- make sure these directories are present, otherwise chmod craps out 1435 1343 this chmod is needed in case we are unpacking for a second time --> 1344 <!-- 1436 1345 <mkdir dir="${gs2build.home}/perllib/cpan/perl-5.8"/> 1437 1346 <mkdir dir="${gs2build.home}/perllib/cpan/perl-5.6"/> … … 1441 1350 dest="${gs2build.home}/perllib/cpan/" 1442 1351 compression="gzip"/> 1352 --> 1353 <echo>Nothing extra currently needed for MacOs install</echo> 1443 1354 </target> 1444 1355 … … 1460 1371 <filterset> 1461 1372 <filter token="gsdlhome" value="${gs2build.home.windows}"/> 1462 1373 </filterset> 1463 1374 </move> 1464 1375 <move file="${gs2build.home}/setup-tmp.bat" tofile="${gs2build.home}/setup.bat" /> … … 1488 1399 </target> 1489 1400 1490 <target name="checkout-gli" depends="init" if="collection.building.enabled" unless="nosvn.mode"> 1401 <!-- <target name="checkout-gli" depends="check-cvsroot,init" if="collection.building.enabled" unless="nocvs.mode"> --> 1402 <target name="checkout-gli" depends="init" if="collection.building.enabled" unless="nocvs.mode"> 1491 1403 <echo>checking out gli</echo> 1492 1404 <svn> 1493 1494 1495 </target> 1496 1405 <checkout url="${svn.root}/gli/${branch.path}" destPath="gli" revision="${branch.revision}"/> 1406 </svn> 1407 </target> 1408 1497 1409 <target name="configure-gs2building" depends="init" if="collection.building.enabled" 1498 1410 description="Configure only the Greenstone 2 building components"> … … 1531 1443 <!-- windows: --> 1532 1444 <!-- run the setup script --> 1533 <exec executable="${compile.windows.c++.setup}" os="${os.windows}" /> 1445 <!--<exec executable="${compile.windows.c++.setup}" os="${os.windows}" />--> 1446 <!--Above does not work: 1447 even though vcvars.bat executes, the env changes it makes don't get saved. Need user to run vcvars.bat first before calling ant--> 1534 1448 <exec executable="nmake" dir="${gs2build.home}" os="${os.windows}" > 1535 <arg value="/f"/> 1536 <arg value="win32.mak"/> 1537 <arg value="clean"/> 1538 </exec> 1539 </target> 1540 1541 <target name="distclean-gs2building" depends="init,clean-gli,clean-gs2build,distclean-gs2build" 1542 description="Distclean only the Greenstone 2 building components" 1543 if="collection.building.enabled"/> 1544 1449 <arg value="/f"/> 1450 <arg value="win32.mak"/> 1451 <arg value="clean"/> 1452 </exec> 1453 </target> 1454 1545 1455 <target name="distclean-gs2build" depends="init" if="collection.building.enabled"> 1456 <!-- gs2build --> 1457 <!--linux: --> 1546 1458 <exec executable="make" os="${os.unix}" dir="${gs2build.home}"> 1547 1459 <arg value="distclean"/> 1548 1460 </exec> 1461 <!-- windows: --> 1549 1462 </target> 1550 1463 … … 1557 1470 <property name="gli.home" value="${basedir}/gli"/> 1558 1471 1559 1560 1472 <!-- change the version number --> 1473 <rsr file="${gli.home}/src/org/greenstone/gatherer/Gatherer.java" pattern="^(.*)String\s*PROGRAM_VERSION\s*=\s*"(.*)"" replacement="$1String PROGRAM_VERSION = "${app.version}""/> 1561 1474 <!-- linux --> 1562 1475 <exec executable="makegli.sh" os="${os.unix}" dir="${gli.home}" resolveExecutable="true"/> 1563 <!--remote gli-->1564 <exec executable="makejar.sh" os="${os.unix}" dir="${gli.home}"1476 <!--remote gli--> 1477 <exec executable="makejar.sh" os="${os.unix}" dir="${gli.home}" 1565 1478 resolveExecutable="true"/> 1566 1479 <!-- windows --> 1567 1480 <exec executable="makegli.bat" os="${os.windows}" dir="${gli.home}" resolveExecutable="true"/> 1568 1481 <!--remote gli--> 1569 <exec executable="makejar.bat" os="${os.windows}" dir="${gli.home}"1482 <exec executable="makejar.bat" os="${os.windows}" dir="${gli.home}" 1570 1483 resolveExecutable="true"/> 1571 <copy file="${gli.home}/GLIServer.jar" todir="${gs2build.home}/bin/java" />1484 <copy file="${gli.home}/GLIServer.jar" todir="${gs2build.home}/bin/java" /> 1572 1485 </target> 1573 1486 … … 1581 1494 </exec> 1582 1495 <!-- run the setup script --> 1583 <exec executable="${compile.windows.c++.setup}" os="${os.windows}"/> 1496 <!--<exec executable="${compile.windows.c++.setup}" os="${os.windows}"/>--> 1497 <!--Above does not work: 1498 even though vcvars.bat executes, the env changes it makes don't get saved. Need user to run vcvars.bat first before calling ant--> 1584 1499 <exec executable="nmake" dir="${gs2build.home}" os="${os.windows}"> 1585 1586 1500 <arg value="/f"/> 1501 <arg value="win32.mak"/> 1587 1502 </exec> 1588 1503 <exec executable="nmake" dir="${gs2build.home}" os="${os.windows}"> 1589 1590 1591 1504 <arg value="/f"/> 1505 <arg value="win32.mak"/> 1506 <arg value="install"/> 1592 1507 </exec> 1593 1508 <!-- LuceneWrapper jar file not installed by default --> … … 1623 1538 </echo> 1624 1539 </target> 1625 1626 1627 1540 1541 1542 <!-- ======================== TESTING Targets ========================= --> 1628 1543 1629 1544 <target name="test" description="Run the (incomplete) JUnit test suite " … … 1648 1563 <echo> 1649 1564 ********************************************* 1650 Test output can be found in directory 'test'1565 Test output can be found in directory 'test' 1651 1566 ********************************************* 1652 1567 </echo> 1653 1568 </target> 1654 1655 <!-- ======================== FLAX Targets ========================= -->1656 1569 <target name="prepare-flax" description="check out flax source code from another repository" if="install.flax"> 1657 1570 <echo>checking out flax ...</echo> 1658 1571 <mkdir dir="${basedir}/src/java/org/flax"/> 1659 1572 <mkdir dir="${basedir}/src/java/org/greenstone/gsdl3/flax"/> 1660 <mkdir dir="${ web.home}/WEB-INF/classes/flax"/>1661 <mkdir dir="${ web.home}/interfaces/flax"/>1662 <mkdir dir="${ web.home}/sites/flax"/>1573 <mkdir dir="${basedir}/web/WEB-INF/classes/flax"/> 1574 <mkdir dir="${basedir}/web/interfaces/flax"/> 1575 <mkdir dir="${basedir}/web/sites/flax"/> 1663 1576 <mkdir dir="${basedir}/flax-resources"/> 1664 1577 <mkdir dir="${basedir}/flax-lib"/> 1665 1578 <svn> 1666 1579 <checkout url="${flax.svn.root}/flax1.0/trunk/src/java/org/flax/" 1667 1580 destPath="${basedir}/src/java/org/flax"/> 1668 1581 <checkout url="${flax.svn.root}/flax1.0/trunk/src/java/org/greenstone/gsdl3/flax/" 1669 1582 destPath="${basedir}/src/java/org/greenstone/gsdl3/flax"/> 1670 1583 <checkout url="${flax.svn.root}/flax1.0/trunk/web/WEB-INF/classes/flax/" 1671 destPath="${web.home}/WEB-INF/classes/flax"/>1584 destPath="${basedir}/web/WEB-INF/classes/flax"/> 1672 1585 <checkout url="${flax.svn.root}/flax1.0/trunk/web/interfaces/flax/" 1673 destPath="${web.home}/interfaces/flax"/>1586 destPath="${basedir}/web/interfaces/flax"/> 1674 1587 <checkout url="${flax.svn.root}/flax1.0/trunk/web/sites/flax/" 1675 destPath="${web.home}/sites/flax"/>1588 destPath="${basedir}/web/sites/flax"/> 1676 1589 <checkout url="${flax.svn.root}/flax1.0/trunk/flax-resources" 1677 1590 destPath="${basedir}/flax-resources"/> 1678 1591 <checkout url="${flax.svn.root}/flax1.0/trunk/lib" 1679 1592 destPath="${basedir}/flax-lib"/> 1680 1593 </svn> 1681 <echo>prepare flax files...</echo>1682 <move file="${ web.home}/WEB-INF/web.xml" tofile="${web.home}/WEB-INF/web.xml.greenstone3backup"/>1594 <echo>prepare flax files...</echo> 1595 <move file="${basedir}/web/WEB-INF/web.xml" tofile="${basedir}/web/WEB-INF/web.xml.greenstone3backup"/> 1683 1596 <antcall target="flax-copy-files" /> 1684 1597 <antcall target="unzip-flax-collections" /> 1685 1598 <antcall target="unzip-flax-resources" /> 1686 </target>1599 </target> 1687 1600 1688 1601 <target name="update-flax" description="update flax from repository"> 1689 1690 1691 1692 1693 <update dir="${web.home}/WEB-INF/classes/flax"/>1694 <update dir="${web.home}/interfaces/flax"/>1695 <update dir="${web.home}/sites/flax"/>1696 1697 <antcall target="flax-copy-files" />1602 <echo>updating flax ...</echo> 1603 <svn> 1604 <update dir="${basedir}/src/java/org/flax"/> 1605 <update dir="${basedir}/src/java/org/greenstone/gsdl3/flax"/> 1606 <update dir="${basedir}/web/WEB-INF/classes/flax"/> 1607 <update dir="${basedir}/web/interfaces/flax"/> 1608 <update dir="${basedir}/web/sites/flax"/> 1609 </svn> 1610 <antcall target="flax-copy-files" /> 1698 1611 <antcall target="unzip-flax-collections" /> 1699 </target>1700 1701 <target name="unzip-flax-collections" >1702 <property name="coll.dir" value="${ web.home}/sites/flax/collect"/>1612 </target> 1613 1614 <target name="unzip-flax-collections" > 1615 <property name="coll.dir" value="${basedir}/web/sites/flax/collect"/> 1703 1616 <unzip dest="${coll.dir}"> 1704 1617 <fileset dir="${coll.dir}"> 1705 1618 <include name="*.zip"/> 1706 </fileset>1619 </fileset> 1707 1620 </unzip> 1708 1621 <delete> … … 1711 1624 </target> 1712 1625 1713 1714 <property name="classes.dir" value="${ web.home}/WEB-INF/classes/flax"/>1626 <target name="unzip-flax-resources" > 1627 <property name="classes.dir" value="${basedir}/web//WEB-INF/classes/flax"/> 1715 1628 <unzip dest="${classes.dir}"> 1716 1629 <fileset dir="${classes.dir}"> 1717 1630 <include name="*.zip"/> 1718 </fileset>1631 </fileset> 1719 1632 </unzip> 1720 1633 <delete> … … 1722 1635 </delete> 1723 1636 </target> 1724 1725 <target name="flax-copy-files" description="copy some flax files into the appropriate greenstone3 directories"> 1726 <echo>copying flax files ...</echo> 1727 <copy file="${web.home}/WEB-INF/classes/flax/web.xml" todir="${web.home}/WEB-INF" overwrite="true" /> 1728 <!-- A configuration file containing web service binding information for the axis engine --> 1729 <copy file="${web.home}/WEB-INF/classes/flax/server-config.wsdd" todir="${web.home}/WEB-INF" overwrite="true" /> 1730 <copy file="${basedir}/flax-resources/flax-build.xml" todir="${basedir}" overwrite="true" /> 1731 <copy file="${basedir}/flax-lib/opennlp-tools-1.3.0.jar" todir="${web.home}/WEB-INF/lib" overwrite="true" /> 1732 </target> 1733 1734 1735 <!-- ======================== GDBM Targets ========================= --> 1736 1637 1638 <target name="flax-copy-files" description="copy some flax files into the appropriate greenstone3 directories"> 1639 <echo>copying flax files ...</echo> 1640 <copy file="${basedir}/web/WEB-INF/classes/flax/web.xml" todir="${basedir}/web/WEB-INF" overwrite="true" /> 1641 <!-- A configuration file containing web service binding information for the axis engine --> 1642 <copy file="${basedir}/web/WEB-INF/classes/flax/server-config.wsdd" todir="${basedir}/web/WEB-INF" overwrite="true" /> 1643 <copy file="${basedir}/flax-resources/flax-build.xml" todir="${basedir}" overwrite="true" /> 1644 <copy file="${basedir}/flax-lib/opennlp-tools-1.3.0.jar" todir="${basedir}/web/WEB-INF/lib" overwrite="true" /> 1645 </target> 1646 <!--install gdbm stuff --> 1647 1648 <!-- downloads the gdbm library --> 1737 1649 <target name="prepare-gdbm" depends="init" if="install.gdbm"> 1738 <get src="http://www.greenstone.org/gs3files/${gdbm.version}.tar.gz"1739 dest="${src.packages.home}/${gdbm.version}.tar.gz" usetimestamp="true"/>1740 <untar compression= "gzip" src="${src.packages.home}/${gdbm.version}.tar.gz" dest="${src.packages.home}" />1741 <chmod dir="${src.packages.home}/${gdbm.version}" perm="ugo+wrx" includes="**" />1742 <antcall target="configure-gdbm" />1743 <antcall target="compile-gdbm" />1650 <get src="http://www.greenstone.org/gs3files/gdbm-1.8.3.tar.gz" 1651 dest="${src.packages.home}/gdbm-1.8.3.tar.gz" usetimestamp="true"/> 1652 <untar compression= "gzip" src="${src.packages.home}/gdbm-1.8.3.tar.gz" dest="${src.packages.home}" /> 1653 <chmod dir="${src.packages.home}/gdbm-1.8.3" perm="ugo+wrx" includes="**" /> 1654 <antcall target="configure-gdbm" /> 1655 <antcall target="compile-gdbm" /> 1744 1656 </target> 1745 1657 1746 <target name="configure-gdbm" if="install.gdbm">1658 <target name="configure-gdbm" if="install.gdbm"> 1747 1659 <echo> 1748 1660 Configuring GDBM … … 1752 1664 <arg value="--prefix=${gdbm.home}"/> 1753 1665 </exec> 1754 </target>1755 1756 1666 </target> 1667 1668 <target name="clean-gdbm" depends="init" if="install.gdbm"> 1757 1669 <echo>clean GDBM</echo> 1758 <exec executable="make" os="${os.unix} " dir="${gdbm.home}" >1759 1670 <exec executable="make" os="${os.unix},${os.mac}" dir="${gdbm.home}" > 1671 <arg value="clean"/> 1760 1672 </exec> 1761 1673 </target> 1762 1674 1763 <target name="distclean-gdbm" depends="init" if="install.gdbm"> 1764 <echo>distclean GDBM</echo> 1765 <exec executable="make" os="${os.unix}" dir="${gdbm.home}" > 1766 <arg value="distclean"/> 1767 </exec> 1768 </target> 1769 1675 1770 1676 <target name="compile-gdbm" depends="init" if="install.gdbm"> 1771 1677 <echo>compile GDBM</echo> 1772 <exec executable="make" os="${os.unix}" dir="${gdbm.home}"/> 1773 <exec executable="make" os="${os.unix}" dir="${gdbm.home}"> 1678 <exec executable="groups" outputproperty="usergroups"/> 1679 <exec executable="awk" inputstring="${usergroups}" outputproperty="firstgroup"> 1680 <arg line="'{print $1}'"/> 1681 </exec> 1682 1683 <exec executable="make" os="${os.unix},${os.mac}" dir="${gdbm.home}"/> 1684 <exec executable="make" os="${os.unix},${os.mac}" dir="${gdbm.home}"> 1685 <arg value="BINOWN=${env.USER}"/> 1686 <arg value="BINGRP=${firstgroup}"/> 1774 1687 <arg value="install"/> 1775 1688 </exec> 1776 1689 </target> 1777 1690 1691 1692 1778 1693 </project> 1779 1694 -
greenstone3/branches/customizingGreenstone3/docs/manual/manual.tex
r15191 r15787 835 835 siblings & All the sibling sections\\ 836 836 children & The immediate child sections of the current section\\ 837 descend ents & All the descendent sections\\837 descendants & All the descendent sections\\ 838 838 \hline 839 839 \end{tabular}} … … 1546 1546 \end{verbatim}\end{gsc}\end{quote} 1547 1547 1548 Possible values for structure parameters are \gst{ancestors}, \gst{parent}, \gst{siblings}, \gst{children}, \gst{descend ents}. The response gives, for each identifier in the request, a \gst{<nodeStructure>} element with all the requested structure put together into a hierarchy. The structure may include classifier and document nodes.1548 Possible values for structure parameters are \gst{ancestors}, \gst{parent}, \gst{siblings}, \gst{children}, \gst{descendants}. The response gives, for each identifier in the request, a \gst{<nodeStructure>} element with all the requested structure put together into a hierarchy. The structure may include classifier and document nodes. 1549 1549 1550 1550 … … 1654 1654 \end{verbatim}\end{gsc}\end{quote} 1655 1655 1656 Structure is returned inside a \gst{<nodeStructure>} element, while structural info is returned in a \gst{<nodeStructureInfo>} element. Possible values for structure parameters are as for browse services: \gst{ancestors}, \gst{parent}, \gst{siblings}, \gst{children}, \gst{descend ents}, \gst{entire}. Possible values for info parameters are \gst{numSiblings}, \gst{siblingPosition}, \gst{numChildren}.1656 Structure is returned inside a \gst{<nodeStructure>} element, while structural info is returned in a \gst{<nodeStructureInfo>} element. Possible values for structure parameters are as for browse services: \gst{ancestors}, \gst{parent}, \gst{siblings}, \gst{children}, \gst{descendants}, \gst{entire}. Possible values for info parameters are \gst{numSiblings}, \gst{siblingPosition}, \gst{numChildren}. 1657 1657 1658 1658 \subsubsection{'process'-type services}\label{sec:process} -
greenstone3/branches/customizingGreenstone3/gs3-setup.bat
r15191 r15787 8 8 9 9 :start 10 :: ---- Set the GSDL3HOME variable to the current directory ---- 11 cd | winutil\setvar.exe GSDL3SRCHOME > %SystemRoot%\Temp\setgsdl3.bat 12 call %SystemRoot%\Temp\setgsdl3.bat 13 del %SystemRoot%\Temp\setgsdl3.bat 10 :: ---- Set some relevant environment variables ---- 11 12 :: this is the default 13 :: greenstone3 (%GSDL3SRCHOME%) 14 :: +-- web (%GSDLHOME%) 15 :: +-- packages 16 :: +-- tomcat (%TOMCAT_HOME%) 17 :: +-- ant (%ANT_HOME%) 18 19 :: set GSDLSRCHOME to the current directory 20 cd | winutil\setvar.exe GSDL3SRCHOME > %TMP%\setgsdl3.bat 21 call %TMP%\setgsdl3.bat 22 del %TMP%\setgsdl3.bat 23 24 :: set GSDLHOME to the 'web' subdirectory 14 25 set GSDL3HOME=%GSDL3SRCHOME%\web 15 26 16 :: change if using external tomcat 27 :: change if using external tomcat or ant 17 28 set TOMCAT_HOME=%GSDL3SRCHOME%\packages\tomcat 29 set ANT_HOME=%GSDL3SRCHOME%\packages\ant 18 30 19 :: ---- Set other important environment variables ----31 :: other important environment variables 20 32 set GSDLOS=windows 21 set ANT_HOME=%GSDL3SRCHOME%\packages\ant 33 34 :: ---- Set the CLASSPATH and PATH environment variables ---- 35 if "%GS_CP_SET%" == "yes" goto skipSetCp 36 set CLASSPATH=%CLASSPATH%;.;%GSDL3HOME%\WEB-INF\classes;%GSDL3SRCHOME%\resources\java;%GSDL3SRCHOME%\server.jar;%GSDL3HOME%\WEB-INF\lib\cp.jar;%GSDL3SRCHOME%\lib\jni\cp.jar;%GSDL3SRCHOME%\build\cp.jar 22 37 set PATH=%PATH%;%GSDL3SRCHOME%\bin;%GSDL3SRCHOME%\bin\script;%GSDL3SRCHOME%\lib\jni;%ANT_HOME%\bin 23 38 24 :: ---- Set the CLASSPATH environment variable ---- 25 if "%GS_CP_SET%" == "yes" goto skipSetCp 26 set CLASSPATH=.;%GSDL3HOME%\WEB-INF\classes;%GSDL3SRCHOME%\resources\java;%CLASSPATH% 27 if exist %SystemRoot%\Temp\setcp.bat del %SystemRoot%\Temp\setcp.bat 28 for %%j in ("%GSDL3SRCHOME%"\*.jar) do echo set CLASSPATH=%%CLASSPATH%%;%%j>> %SystemRoot%\Temp\setcp.bat 29 for %%j in ("%GSDL3HOME%"\WEB-INF\lib\*.jar) do echo set CLASSPATH=%%CLASSPATH%%;%%j>> %SystemRoot%\Temp\setcp.bat 30 for %%j in ("%GSDL3SRCHOME%"\lib\jni\*.jar) do echo set CLASSPATH=%%CLASSPATH%%;%%j>> %SystemRoot%\Temp\setcp.bat 31 for %%j in ("%TOMCAT_HOME%"\common\endorsed\*.jar) do echo set CLASSPATH=%%CLASSPATH%%;%%j>> %SystemRoot%\Temp\setcp.bat 32 for %%j in ("%GSDL3SRCHOME%"\build\*.jar) do echo set CLASSPATH=%%CLASSPATH%%;%%j>> %SystemRoot%\Temp\setcp.bat 33 echo set GS_CP_SET=yes >> %SystemRoot%\Temp\setcp.bat 34 call %SystemRoot%\Temp\setcp.bat 35 del %SystemRoot%\Temp\setcp.bat 39 :: a little dynamic set cp stuff 40 if exist %TMP%\setcp.bat del %TMP%\setcp.bat 41 for %%j in ("%TOMCAT_HOME%"\common\endorsed\*.jar) do echo set CLASSPATH=%%CLASSPATH%%;%%j>> %TMP%\setcp.bat 42 if exist %TMP%\setcp.bat call %TMP%\setcp.bat 43 if exist %TMP%\setcp.bat del %TMP%\setcp.bat 44 45 set GS_CP_SET=yes 36 46 :skipSetCp 37 47 38 winutil\search4j.exe -m %java_min_version% | winutil\setvar.exe _JRE_HOME > %SystemRoot%\Temp\set_jre_home.bat 39 call %SystemRoot%\Temp\set_jre_home.bat 40 del %SystemRoot%\Temp\set_jre_home.bat 48 :: ---- Search for java ---- 49 winutil\search4j.exe -m %java_min_version% | winutil\setvar.exe _JRE_HOME > %TMP%\set_jre_home.bat 50 call %TMP%\set_jre_home.bat 51 del %TMP%\set_jre_home.bat 41 52 42 echo %_JRE_HOME%\bin\java.exe | winutil\setvar.exe RUNJAVA > % SystemRoot%\Temp\setrunjava.bat43 call % SystemRoot%\Temp\setrunjava.bat44 del % SystemRoot%\Temp\setrunjava.bat53 echo %_JRE_HOME%\bin\java.exe | winutil\setvar.exe RUNJAVA > %TMP%\setrunjava.bat 54 call %TMP%\setrunjava.bat 55 del %TMP%\setrunjava.bat 45 56 46 57 if "%JRE_HOME%" == "" set JRE_HOME=%_JRE_HOME% -
greenstone3/branches/customizingGreenstone3/resources/soap/site.wsdd.template
r9911 r15787 2 2 xmlns:java="http://xml.apache.org/axis/wsdd/providers/java" 3 3 xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance"> 4 <service name="@siteuri@" style="message">5 <parameter name="className" value="org.greenstone.gsdl3. SOAPServer@sitename@"/>6 <parameter name="allowedMethods" value=" process"/>4 <service name="@siteuri@" @soapmethod@> 5 <parameter name="className" value="org.greenstone.gsdl3.@servicesname@@sitename@"/> 6 <parameter name="allowedMethods" value="*"/> 7 7 <parameter name="scope" value="application"/> 8 8 </service> -
greenstone3/branches/customizingGreenstone3/resources/soap/undeploy-site.wsdd.template
r9874 r15787 1 1 <undeployment xmlns="http://xml.apache.org/axis/wsdd/"> 2 <service name="@s iteuri@"/>2 <service name="@servicesname@"/> 3 3 </undeployment> -
greenstone3/branches/customizingGreenstone3/src/java/org/greenstone/gsdl3/service/AbstractBrowse.java
r14526 r15787 725 725 */ 726 726 abstract protected String getStructureInfo(String node_id, String info_type); 727 // /** needs to get info from gdbm database - if the calling code gets it already it may pay to pass it in instead */728 // protected String resolveTextMacros(String doc_content, String doc_id, String lang)729 // {730 // DBInfo info = null;731 // if (doc_content.indexOf("_httpdocimg_")!=-1) {732 // String top_doc_id = OID.getTop(doc_id);733 // info = this.gdbm_src.getInfo(top_doc_id);734 // if (info == null) {735 // // perhaps we had per.iods in the ids - just try the current id736 // top_doc_id = doc_id;737 // info = this.gdbm_src.getInfo(top_doc_id);738 // }739 // if (info != null) {740 // String archivedir = info.getInfo("archivedir");741 // String image_dir = this.site_http_address + "/collect/"+this.cluster_name+"/index/assoc/"+archivedir;742 743 // // Resolve all "_httpdocimg_"s744 // doc_content = doc_content.replaceAll("_httpdocimg_", image_dir);745 // }746 // }747 // // resolve any collection specific macros748 // doc_content = macro_resolver.resolve(doc_content, lang, GS2MacroResolver.SCOPE_TEXT, doc_id, info);749 // return doc_content;750 // }751 752 727 753 728 } -
greenstone3/branches/customizingGreenstone3/src/java/org/greenstone/gsdl3/service/AbstractDocumentRetrieve.java
r14552 r15787 22 22 23 23 // Greenstone classes 24 //import org.greenstone.gdbm.*;25 24 import org.greenstone.gsdl3.core.GSException; 26 25 import org.greenstone.gsdl3.util.GSXML; -
greenstone3/branches/customizingGreenstone3/src/java/org/greenstone/gsdl3/service/AbstractGS2DocumentRetrieve.java
r14527 r15787 27 27 import org.greenstone.gsdl3.util.GS2MacroResolver; 28 28 import org.greenstone.gsdl3.util.GSConstants; 29 import org.greenstone.gsdl3.util. GDBMWrapper;29 import org.greenstone.gsdl3.util.SimpleCollectionDatabase; 30 30 import org.greenstone.gsdl3.util.DBInfo; 31 31 // XML classes … … 59 59 protected String index_stem = null; 60 60 61 protected GDBMWrapper gdbm_src= null;61 protected SimpleCollectionDatabase coll_db = null; 62 62 63 63 … … 65 65 protected AbstractGS2DocumentRetrieve() 66 66 { 67 this.gdbm_src = new GDBMWrapper(); 68 this.macro_resolver = new GS2MacroResolver(this.gdbm_src); 67 this.macro_resolver = new GS2MacroResolver(); 69 68 } 70 69 71 70 public void cleanUp() { 72 73 this.gdbm_src.closeDatabase();71 super.cleanUp(); 72 this.coll_db.closeDatabase(); 74 73 } 75 74 /** configure this service */ … … 93 92 } 94 93 95 // Open GDBM database for querying 96 String gdbm_db_file = GSFile.GDBMDatabaseFile(this.site_home, this.cluster_name, this.index_stem); 97 if (!this.gdbm_src.openDatabase(gdbm_db_file, GDBMWrapper.READER)) { 98 logger.error("Could not open GDBM database!"); 94 // find out what kind of database we have 95 Element database_type_elem = (Element) GSXML.getChildByTagName(info, GSXML.DATABASE_TYPE_ELEM); 96 String database_type = null; 97 if (database_type_elem != null) { 98 database_type = database_type_elem.getAttribute(GSXML.NAME_ATT); 99 } 100 if (database_type == null || database_type.equals("")) { 101 database_type = "gdbm"; // the default 102 } 103 coll_db = new SimpleCollectionDatabase(database_type); 104 if (coll_db == null) { 105 logger.error("Couldn't create the collection database of type "+database_type); 106 return false; 107 } 108 109 // Open database for querying 110 String coll_db_file = GSFile.collectionDatabaseFile(this.site_home, this.cluster_name, this.index_stem, database_type); 111 if (!this.coll_db.openDatabase(coll_db_file, SimpleCollectionDatabase.READ)) { 112 logger.error("Could not open collection database!"); 99 113 return false; 100 114 } 115 116 // we need to set the database for our GS2 macro resolver 117 GS2MacroResolver gs2_macro_resolver = (GS2MacroResolver)this.macro_resolver; 118 gs2_macro_resolver.setDB(this.coll_db); 101 119 102 120 return true; … … 105 123 /** if id ends in .fc, .pc etc, then translate it to the correct id */ 106 124 protected String translateId(String node_id) { 107 return this. gdbm_src.translateOID(node_id);125 return this.coll_db.translateOID(node_id); 108 126 } 109 127 … … 111 129 it to a greenstone one*/ 112 130 protected String translateExternalId(String node_id){ 113 return this. gdbm_src.externalId2OID(node_id);131 return this.coll_db.externalId2OID(node_id); 114 132 } 115 133 … … 120 138 /** returns a list of the child ids in order, null if no children */ 121 139 protected ArrayList getChildrenIds(String node_id) { 122 DBInfo info = this. gdbm_src.getInfo(node_id);140 DBInfo info = this.coll_db.getInfo(node_id); 123 141 if (info == null) { 124 142 return null; … … 156 174 throws GSException { 157 175 Element metadata_list = this.doc.createElement(GSXML.METADATA_ELEM+GSXML.LIST_MODIFIER); 158 DBInfo info = this. gdbm_src.getInfo(node_id);176 DBInfo info = this.coll_db.getInfo(node_id); 159 177 if (info == null) { 160 178 return null; … … 211 229 } 212 230 213 DBInfo info = this. gdbm_src.getInfo(parent_id);231 DBInfo info = this.coll_db.getInfo(parent_id); 214 232 if (info==null) { 215 233 return "-1"; … … 235 253 236 254 protected int getNumChildren(String node_id) { 237 DBInfo info = this. gdbm_src.getInfo(node_id);255 DBInfo info = this.coll_db.getInfo(node_id); 238 256 if (info == null) { 239 257 return 0; … … 254 272 */ 255 273 protected String getDocType(String node_id) { 256 DBInfo info = this. gdbm_src.getInfo(node_id);274 DBInfo info = this.coll_db.getInfo(node_id); 257 275 if (info == null) { 258 276 return GSXML.DOC_TYPE_SIMPLE; … … 275 293 // now we just check the top node 276 294 if (!is_top) { // we need to look at the top info 277 info = this. gdbm_src.getInfo(top_id);295 info = this.coll_db.getInfo(top_id); 278 296 } 279 297 if (info == null) { … … 337 355 338 356 // now check for relational info 339 if (temp.equals("parent") || temp.equals("root") || temp.equals( "ancestors")) { // "current" "siblings" "children" "descend ents"357 if (temp.equals("parent") || temp.equals("root") || temp.equals( "ancestors")) { // "current" "siblings" "children" "descendants" 340 358 relation = temp; 341 359 pos = metadata.indexOf(GSConstants.META_RELATION_SEP); … … 370 388 relation_info = info; 371 389 } else { 372 relation_info = this. gdbm_src.getInfo(relation_id);390 relation_info = this.coll_db.getInfo(relation_id); 373 391 } 374 392 if (relation_info == null) { … … 405 423 relation_id = OID.getParent(current_id); 406 424 while (!relation_id.equals(current_id)) { 407 relation_info = this. gdbm_src.getInfo(relation_id);425 relation_info = this.coll_db.getInfo(relation_id); 408 426 if (relation_info == null) return result.toString(); 409 427 if (!multiple) { … … 427 445 428 446 429 /** needs to get info from gdbmdatabase - if the calling code gets it already it may pay to pass it in instead */447 /** needs to get info from collection database - if the calling code gets it already it may pay to pass it in instead */ 430 448 protected String resolveTextMacros(String doc_content, String doc_id, String lang) 431 449 { … … 452 470 value="-1"; 453 471 } else { 454 DBInfo info = this. gdbm_src.getInfo(parent_id);472 DBInfo info = this.coll_db.getInfo(parent_id); 455 473 if (info==null) { 456 474 value ="-1"; … … 478 496 479 497 protected String getHrefOID(String href_url){ 480 return this. gdbm_src.docnum2OID(href_url);498 return this.coll_db.docnum2OID(href_url); 481 499 } 482 500 -
greenstone3/branches/customizingGreenstone3/src/java/org/greenstone/gsdl3/service/AbstractGS2FieldSearch.java
r15191 r15787 75 75 76 76 protected static final String DEFAULT_LEVEL_ELEM = "defaultLevel"; 77 protected static final String DEFAULT_ GDBM_LEVEL_ELEM = "defaultGDBMLevel";77 protected static final String DEFAULT_DB_LEVEL_ELEM = "defaultDBLevel"; 78 78 protected static final String LEVEL_ELEM = "level"; 79 79 protected static final String FIELD_ATT = "field"; … … 90 90 // the default level for searching 91 91 protected String default_level=null; 92 // default level for gdbmdb93 protected String default_ gdbm_level = null;92 // default level for collection db 93 protected String default_db_level = null; 94 94 // which search services will we offer?? 95 95 protected boolean plain_search = false; … … 162 162 } 163 163 164 // Get the default GDBMlevel165 def = (Element) GSXML.getChildByTagName(info, DEFAULT_ GDBM_LEVEL_ELEM);164 // Get the default DB level 165 def = (Element) GSXML.getChildByTagName(info, DEFAULT_DB_LEVEL_ELEM); 166 166 if (def != null) { 167 this.default_ gdbm_level = def.getAttribute(GSXML.SHORTNAME_ATT);168 } 169 if (this.default_ gdbm_level == null || this.default_gdbm_level.equals("")) {170 logger.error("default gdbm levelnot specified!, assuming Sec");171 this.default_ gdbm_level = "Sec";167 this.default_db_level = def.getAttribute(GSXML.SHORTNAME_ATT); 168 } 169 if (this.default_db_level == null || this.default_db_level.equals("")) { 170 logger.error("default database level (defaultDBLevel) not specified!, assuming Sec"); 171 this.default_db_level = "Sec"; 172 172 } 173 173 -
greenstone3/branches/customizingGreenstone3/src/java/org/greenstone/gsdl3/service/AbstractGS2Search.java
r13999 r15787 20 20 21 21 // Greenstone classes 22 import org.greenstone.mg.*; 23 import org.greenstone.gsdl3.util.*; 22 import org.greenstone.gsdl3.util.OID; 23 import org.greenstone.gsdl3.util.DBInfo; 24 import org.greenstone.gsdl3.util.GSXML; 25 import org.greenstone.gsdl3.util.SimpleCollectionDatabase; 26 import org.greenstone.gsdl3.util.GSFile; 24 27 25 28 // XML classes … … 74 77 protected int maxnumeric = 4; 75 78 76 protected GDBMWrapper gdbm_src = null; 77 78 static Logger logger = Logger.getLogger(org.greenstone.gsdl3.service.GS2MGSearch.class.getName()); 79 // collection database 80 protected SimpleCollectionDatabase coll_db = null; 81 82 static Logger logger = Logger.getLogger(org.greenstone.gsdl3.service.AbstractGS2Search.class.getName()); 79 83 80 84 … … 82 86 public AbstractGS2Search() 83 87 { 84 this.gdbm_src = new GDBMWrapper();88 85 89 } 86 90 public void cleanUp() { 87 91 super.cleanUp(); 88 this. gdbm_src.closeDatabase();92 this.coll_db.closeDatabase(); 89 93 } 90 94 … … 93 97 { 94 98 if (!super.configure(info, extra_info)){ 99 return false; 100 } 101 102 // find out what kind of database we have 103 Element database_type_elem = (Element) GSXML.getChildByTagName(info, GSXML.DATABASE_TYPE_ELEM); 104 String database_type = null; 105 if (database_type_elem != null) { 106 database_type = database_type_elem.getAttribute(GSXML.NAME_ATT); 107 } 108 if (database_type == null || database_type.equals("")) { 109 database_type = "gdbm"; // the default 110 } 111 coll_db = new SimpleCollectionDatabase(database_type); 112 if (coll_db == null) { 113 logger.error("Couldn't create the collection database of type "+database_type); 114 return false; 115 } 116 117 // the index stem is either the collection name or is specified in the config file 118 Element index_stem_elem = (Element) GSXML.getChildByTagName(info, INDEX_STEM_ELEM); 119 if (index_stem_elem != null) { 120 this.index_stem = index_stem_elem.getAttribute(GSXML.NAME_ATT); 121 } 122 if (this.index_stem == null || this.index_stem.equals("")) { 123 logger.warn("indexStem element not found, stem will default to collection name"); 124 this.index_stem = this.cluster_name; 125 } 126 127 // Open database for querying 128 String coll_db_file = GSFile.collectionDatabaseFile(this.site_home, this.cluster_name, this.index_stem, database_type); 129 if (!this.coll_db.openDatabase(coll_db_file, SimpleCollectionDatabase.READ)) { 130 logger.error("Could not open collection database!"); 95 131 return false; 96 132 } … … 116 152 this.default_index_language = defLang.getAttribute(GSXML.SHORTNAME_ATT); 117 153 } //concate defaultIndex + defaultIndexSubcollection + defaultIndexLanguage 118 119 120 // the index stem is either the collection name or is specified in the config file 121 Element index_stem_elem = (Element) GSXML.getChildByTagName(info, INDEX_STEM_ELEM); 122 if (index_stem_elem != null) { 123 this.index_stem = index_stem_elem.getAttribute(GSXML.NAME_ATT); 124 } 125 if (this.index_stem == null || this.index_stem.equals("")) { 126 logger.warn("indexStem element not found, stem will default to collection name"); 127 this.index_stem = this.cluster_name; 128 } 129 154 130 155 // get index options 131 156 Element index_option_list = (Element) GSXML.getChildByTagName(info, GSXML.INDEX_OPTION_ELEM + GSXML.LIST_MODIFIER); … … 187 212 } // for each index 188 213 } 189 // Open GDBM database for querying190 String gdbm_db_file = GSFile.GDBMDatabaseFile(this.site_home, this.cluster_name, this.index_stem);191 if (!this.gdbm_src.openDatabase(gdbm_db_file, GDBMWrapper.READER)) {192 logger.error(" Could not open GDBM database!");193 return false;194 }195 214 return true; 196 215 } … … 294 313 */ 295 314 protected String getDocType(String node_id){ 296 DBInfo info = this. gdbm_src.getInfo(node_id);315 DBInfo info = this.coll_db.getInfo(node_id); 297 316 if (info == null) { 298 317 return GSXML.DOC_TYPE_SIMPLE; … … 315 334 // now we just check the top node 316 335 if (!is_top) { // we need to look at the top info 317 info = this. gdbm_src.getInfo(top_id);336 info = this.coll_db.getInfo(top_id); 318 337 } 319 338 if (info == null) { … … 331 350 /** returns true if the node has child nodes */ 332 351 protected boolean hasChildren(String node_id){ 333 DBInfo info = this. gdbm_src.getInfo(node_id);352 DBInfo info = this.coll_db.getInfo(node_id); 334 353 if (info == null) { 335 354 return false; … … 351 370 } 352 371 353 /** convert MGinternal id to Greenstone oid */372 /** convert indexer internal id to Greenstone oid */ 354 373 protected String internalNum2OID(long docnum) 355 374 { 356 return this. gdbm_src.docnum2OID(docnum);375 return this.coll_db.docnum2OID(docnum); 357 376 358 377 } 359 378 protected String internalNum2OID(String docnum) 360 379 { 361 return this. gdbm_src.docnum2OID(docnum);380 return this.coll_db.docnum2OID(docnum); 362 381 363 382 } -
greenstone3/branches/customizingGreenstone3/src/java/org/greenstone/gsdl3/service/GS2Browse.java
r13962 r15787 25 25 import org.greenstone.gsdl3.util.MacroResolver; 26 26 import org.greenstone.gsdl3.util.GS2MacroResolver; 27 import org.greenstone.gsdl3.util. GDBMWrapper;27 import org.greenstone.gsdl3.util.SimpleCollectionDatabase; 28 28 import org.greenstone.gsdl3.util.DBInfo; 29 29 // XML classes … … 52 52 static Logger logger = Logger.getLogger(org.greenstone.gsdl3.service.GS2Browse.class.getName()); 53 53 54 protected GDBMWrapper gdbm_src= null;54 protected SimpleCollectionDatabase coll_db = null; 55 55 56 56 public GS2Browse() 57 57 { 58 this.gdbm_src = new GDBMWrapper();59 this.macro_resolver = new GS2MacroResolver(this.gdbm_src);60 58 } 61 59 62 60 public void cleanUp() { 63 61 super.cleanUp(); 64 this. gdbm_src.closeDatabase();62 this.coll_db.closeDatabase(); 65 63 } 66 64 … … 82 80 } 83 81 84 // Open GDBM database for querying 85 String gdbm_db_file = GSFile.GDBMDatabaseFile(this.site_home, this.cluster_name, index_stem); 86 if (!this.gdbm_src.openDatabase(gdbm_db_file, GDBMWrapper.READER)) { 87 logger.error("Could not open GDBM database!"); 82 // find out what kind of database we have 83 Element database_type_elem = (Element) GSXML.getChildByTagName(info, GSXML.DATABASE_TYPE_ELEM); 84 String database_type = null; 85 if (database_type_elem != null) { 86 database_type = database_type_elem.getAttribute(GSXML.NAME_ATT); 87 } 88 if (database_type == null || database_type.equals("")) { 89 database_type = "gdbm"; // the default 90 } 91 coll_db = new SimpleCollectionDatabase(database_type); 92 if (coll_db == null) { 93 logger.error("Couldn't create the collection database of type "+database_type); 94 return false; 95 } 96 97 // Open database for querying 98 String coll_db_file = GSFile.collectionDatabaseFile(this.site_home, this.cluster_name, index_stem, database_type); 99 if (!this.coll_db.openDatabase(coll_db_file, SimpleCollectionDatabase.READ)) { 100 logger.error("Could not open collection database!"); 88 101 return false; 89 102 } 103 this.macro_resolver = new GS2MacroResolver(this.coll_db); 90 104 return true; 91 105 } … … 93 107 /** if id ends in .fc, .pc etc, then translate it to the correct id */ 94 108 protected String translateId(String node_id) { 95 return this. gdbm_src.translateOID(node_id);109 return this.coll_db.translateOID(node_id); 96 110 } 97 111 … … 103 117 */ 104 118 protected String getDocType(String node_id) { 105 DBInfo info = this. gdbm_src.getInfo(node_id);119 DBInfo info = this.coll_db.getInfo(node_id); 106 120 if (info == null) { 107 121 return GSXML.DOC_TYPE_SIMPLE; … … 124 138 // now we just check the top node 125 139 if (!is_top) { // we need to look at the top info 126 info = this. gdbm_src.getInfo(top_id);140 info = this.coll_db.getInfo(top_id); 127 141 } 128 142 if (info == null) { … … 144 158 /** returns a list of the child ids in order, null if no children */ 145 159 protected ArrayList getChildrenIds(String node_id) { 146 DBInfo info = this. gdbm_src.getInfo(node_id);160 DBInfo info = this.coll_db.getInfo(node_id); 147 161 if (info == null) { 148 162 return null; … … 170 184 171 185 protected String getMetadata(String node_id, String key){ 172 DBInfo info = this. gdbm_src.getInfo(node_id);186 DBInfo info = this.coll_db.getInfo(node_id); 173 187 if (info == null) { 174 188 return ""; … … 200 214 String lang = "en"; 201 215 Element metadata_list = this.doc.createElement(GSXML.METADATA_ELEM+GSXML.LIST_MODIFIER); 202 DBInfo info = this. gdbm_src.getInfo(node_id);216 DBInfo info = this.coll_db.getInfo(node_id); 203 217 if (info == null) { 204 218 return null; … … 251 265 } 252 266 253 DBInfo info = this. gdbm_src.getInfo(parent_id);267 DBInfo info = this.coll_db.getInfo(parent_id); 254 268 if (info==null) { 255 269 return "-1"; … … 275 289 276 290 protected int getNumChildren(String node_id) { 277 DBInfo info = this. gdbm_src.getInfo(node_id);291 DBInfo info = this.coll_db.getInfo(node_id); 278 292 if (info == null) { 279 293 return 0; -
greenstone3/branches/customizingGreenstone3/src/java/org/greenstone/gsdl3/service/GS2LuceneRetrieve.java
r13916 r15787 23 23 import org.greenstone.gsdl3.util.GSFile; 24 24 import org.greenstone.gsdl3.util.GSXML; 25 import org.greenstone.gsdl3.util.GDBMWrapper;26 25 import org.greenstone.gsdl3.util.DBInfo; 27 26 import org.greenstone.gsdl3.util.GSHTML; … … 109 108 } 110 109 111 long doc_num = this.gdbm_src.OID2Docnum(doc_id);112 if (doc_num == -1) {110 String doc_num = this.coll_db.OID2Docnum(doc_id); 111 if (doc_num == null || doc_num.equals("")) { 113 112 throw new Exception("OID "+doc_id +" couldn't be converted to lucene doc num"); 114 113 } 115 114 116 DBInfo info=this. gdbm_src.getInfo(OID.getTop(doc_id));115 DBInfo info=this.coll_db.getInfo(OID.getTop(doc_id)); 117 116 if (info == null) { 118 throw new Exception("Couldn't get GDBMdatabase entry for "+OID.getTop(doc_id));117 throw new Exception("Couldn't get database entry for "+OID.getTop(doc_id)); 119 118 } 120 119 … … 136 135 current_section = full_document; 137 136 } else { 138 current_section = GSXML.getNamedElement(full_document, SEC_LEVEL, ID_ATT, String.valueOf(doc_num));137 current_section = GSXML.getNamedElement(full_document, SEC_LEVEL, ID_ATT, doc_num); 139 138 } 140 139 if (current_section == null) { -
greenstone3/branches/customizingGreenstone3/src/java/org/greenstone/gsdl3/service/GS2MGPPRetrieve.java
r14441 r15787 93 93 */ 94 94 protected Element getNodeContent(String doc_id, String lang) throws GSException { 95 long doc_num = this. gdbm_src.OID2Docnum(doc_id);95 long doc_num = this.coll_db.OID2DocnumLong(doc_id); 96 96 if (doc_num == -1) { 97 97 logger.error("OID "+doc_id +" couldn't be converted to mgpp num"); -
greenstone3/branches/customizingGreenstone3/src/java/org/greenstone/gsdl3/service/GS2MGPPSearch.java
r15191 r15787 20 20 21 21 // Greenstone classes 22 import org.greenstone.mgpp.*; 23 import org.greenstone.gsdl3.util.*; 22 import org.greenstone.mgpp.MGPPSearchWrapper; 23 import org.greenstone.mgpp.MGPPTermInfo; 24 import org.greenstone.mgpp.MGPPQueryResult; 25 import org.greenstone.mgpp.MGPPDocInfo; 26 27 import org.greenstone.gsdl3.util.GSFile; 28 import org.greenstone.gsdl3.util.GSXML; 29 24 30 25 31 // XML classes … … 66 72 /** process a query */ 67 73 protected Element processAnyQuery(Element request, int query_type) { 68 69 70 74 synchronized (mgpp_src) { 75 return super.processAnyQuery(request, query_type); 76 } 71 77 } 72 78 /** configure this service */ … … 76 82 } 77 83 78 // the default level is also the level which gdbmis expecting84 // the default level is also the level which the database is expecting 79 85 // this must not be overwritten 80 mgpp_src.setReturnLevel(this.default_ gdbm_level);86 mgpp_src.setReturnLevel(this.default_db_level); 81 87 // return term info 82 88 mgpp_src.setReturnTerms(true); -
greenstone3/branches/customizingGreenstone3/src/java/org/greenstone/gsdl3/service/GS2MGRetrieve.java
r15191 r15787 20 20 21 21 // Greenstone classes 22 import org.greenstone.mg. *;22 import org.greenstone.mg.MGRetrieveWrapper; 23 23 import org.greenstone.gsdl3.core.GSException; 24 24 import org.greenstone.gsdl3.util.GSFile; … … 113 113 */ 114 114 protected Element getNodeContent (String doc_id, String lang) throws GSException { 115 long doc_num = this. gdbm_src.OID2Docnum(doc_id);115 long doc_num = this.coll_db.OID2DocnumLong (doc_id); 116 116 if (doc_num == -1) { 117 117 logger.error ("OID "+doc_id +" couldn't be converted to mg num"); -
greenstone3/branches/customizingGreenstone3/src/java/org/greenstone/gsdl3/service/GoogleNgramMGPPSearch.java
r15191 r15787 37 37 extends GS2MGPPSearch { 38 38 static Logger logger = Logger.getLogger(org.greenstone.gsdl3.service.GoogleNgramMGPPSearch.class.getName()); 39 protected GDBMWrapper gdbm_src = null;40 39 41 40 /** constructor */ 42 41 public GoogleNgramMGPPSearch(){ 43 super(); 44 gdbm_src = new GDBMWrapper(); 45 42 super(); 46 43 } 47 44 … … 52 49 } 53 50 54 // Open GDBM database for querying55 String gdbm_db_file = GSFile.GDBMDatabaseFile(this.site_home, this.cluster_name, this.index_stem);56 if (!this.gdbm_src.openDatabase(gdbm_db_file, GDBMWrapper.READER)) {57 logger.error("Could not open GDBM database!");58 return false;59 }60 51 this.default_max_docs = "-1"; 61 52 this.default_hits_per_page = "30"; … … 78 69 String num = Long.toString((((MGPPDocInfo) docs.elementAt(d)).num_)); 79 70 String doc_id = internalNum2OID(num); 80 DBInfo gdbmInfo = this.gdbm_src.getInfo(doc_id);81 String fre = (String) gdbmInfo.getInfo("Frequency");82 String tense = (String) gdbmInfo.getInfo("Tense");71 DBInfo dbInfo = this.coll_db.getInfo(doc_id); 72 String fre = (String)dbInfo.getInfo("Frequency"); 73 String tense = (String)dbInfo.getInfo("Tense"); 83 74 84 75 if(!fre.equals("")){ -
greenstone3/branches/customizingGreenstone3/src/java/org/greenstone/gsdl3/service/OAIPMH.java
r14209 r15787 27 27 import org.greenstone.gsdl3.util.XMLConverter; 28 28 29 import org.greenstone.gsdl3.util. GDBMWrapper;29 import org.greenstone.gsdl3.util.SimpleCollectionDatabase; 30 30 import org.greenstone.gsdl3.util.DBInfo; 31 31 // XML classes … … 45 45 import java.util.Map.Entry; 46 46 47 import org.apache.log4j. *;47 import org.apache.log4j.Logger; 48 48 49 49 /** Implements the oai metadata retrieval service for GS3 collections. 50 * Dig into each collection's gdbmdatabase and retrieve the metadata50 * Dig into each collection's database and retrieve the metadata 51 51 * 52 52 * @author <a href="mailto:xiao@cs.waikato.ac.nz">Xiao</a> … … 57 57 static Logger logger = Logger.getLogger(org.greenstone.gsdl3.service.OAIPMH.class.getName()); 58 58 59 protected GDBMWrapper gdbm_src= null;59 protected SimpleCollectionDatabase coll_db = null; 60 60 61 61 protected String site_name = ""; … … 65 65 /** constructor */ 66 66 public OAIPMH() { 67 this.gdbm_src = new GDBMWrapper(); 67 68 68 } 69 69 70 70 public void cleanUp() { 71 71 super.cleanUp();//?? 72 this. gdbm_src.closeDatabase();72 this.coll_db.closeDatabase(); 73 73 } 74 74 /** configure this service */ … … 89 89 this.config_info = info; 90 90 91 92 93 94 95 96 97 98 99 91 // the index stem is either specified in the buildConfig.xml file or uses the collection name 92 Element index_stem_elem = (Element) GSXML.getChildByTagName(info, GSXML.INDEX_STEM_ELEM); 93 String index_stem = null; 94 if (index_stem_elem != null) { 95 index_stem = index_stem_elem.getAttribute(GSXML.NAME_ATT); 96 } 97 if (index_stem == null || index_stem.equals("")) { 98 index_stem = this.cluster_name; 99 } 100 100 101 // Open GDBM database for querying 102 String gdbm_db_file = GSFile.GDBMDatabaseFile(this.site_home, this.cluster_name, index_stem); 103 if (!this.gdbm_src.openDatabase(gdbm_db_file, GDBMWrapper.READER)) { 104 logger.error("Could not open GDBM database!"); 101 // find out what kind of database we have 102 Element database_type_elem = (Element) GSXML.getChildByTagName(info, GSXML.DATABASE_TYPE_ELEM); 103 String database_type = null; 104 if (database_type_elem != null) { 105 database_type = database_type_elem.getAttribute(GSXML.NAME_ATT); 106 } 107 if (database_type == null || database_type.equals("")) { 108 database_type = "gdbm"; // the default 109 } 110 coll_db = new SimpleCollectionDatabase(database_type); 111 if (coll_db == null) { 112 logger.error("Couldn't create the collection database of type "+database_type); 105 113 return false; 106 114 } 107 115 116 // Open database for querying 117 String coll_db_file = GSFile.collectionDatabaseFile(this.site_home, this.cluster_name, index_stem, database_type); 118 if (!this.coll_db.openDatabase(coll_db_file, SimpleCollectionDatabase.READ)) { 119 logger.error("Could not open collection database!"); 120 return false; 121 } 122 108 123 // the short_service_info is used by the message router to find the method names, 109 124 //so we just use the doc variable in class ServiceRack to create the xml; but … … 214 229 //get a DBInfo object of the identifier; if this identifier is not present in the database, 215 230 // null is returned. 216 DBInfo info = this. gdbm_src.getInfo(oid);231 DBInfo info = this.coll_db.getInfo(oid); 217 232 if (info == null) { 218 233 logger.error("OID: " + oid + " is not present in the database."); … … 294 309 for(int i=0; i<oid_list.size(); i++) { 295 310 String oid = (String)oid_list.get(i); 296 DBInfo info = this. gdbm_src.getInfo(oid);311 DBInfo info = this.coll_db.getInfo(oid); 297 312 if (info == null) { 298 313 logger.error("Database does not contains information about oid: " +oid); … … 386 401 for(int i=0; i<oid_list.size(); i++) { 387 402 String oid = (String)oid_list.get(i); 388 DBInfo info = this. gdbm_src.getInfo(oid);403 DBInfo info = this.coll_db.getInfo(oid); 389 404 if (info == null) { 390 405 logger.error("Database does not contains information about oid: " +oid); … … 506 521 507 522 DBInfo info = null; 508 info = this. gdbm_src.getInfo(oid);523 info = this.coll_db.getInfo(oid); 509 524 if (info == null) { //just double check 510 525 return OAIXML.getResponse(OAIXML.createErrorElement(OAIXML.OAI_SERVICE_UNAVAILABLE, "")); … … 577 592 /** returns a list of the child ids in order, null if no children */ 578 593 protected ArrayList getChildrenIds(String node_id) { 579 DBInfo info = this. gdbm_src.getInfo(node_id);594 DBInfo info = this.coll_db.getInfo(node_id); 580 595 if (info == null) { 581 596 return null; … … 614 629 } 615 630 /** @param keys - contains a list of keys in string format. 616 * Here is a typical record in the gdbmdatabase, 'keys' contains the values in <...>:631 * Here is a typical record in the collection database, 'keys' contains the values in <...>: 617 632 *---------------------------------------------------------------------- 618 633 [HASH01a84acb0f1aad2380493b3a] -
greenstone3/branches/customizingGreenstone3/src/java/org/greenstone/gsdl3/util/GDBMWrapper.java
r15191 r15787 5 5 import au.com.pharos.gdbm.GdbmException; 6 6 7 import org.apache.log4j. *;7 import org.apache.log4j.Logger; 8 8 9 9 /** java wrapper class for gdbm - uses Java-GDBM written by Martin Pool … … 11 11 */ 12 12 13 public class GDBMWrapper { 13 public class GDBMWrapper 14 implements FlatDatabaseWrapper { 14 15 15 static Logger logger = Logger.getLogger(org.greenstone.gsdl3.util.GDBMWrapper.class.getName()); 16 17 18 // Values must match those from gdbm.h - uses the definitions from GdbmFile ! 19 /** Indicates that the caller will just read the database. Many 20 * readers may share a database. */ 21 public final static int READER = GdbmFile.READER; 22 23 /** The caller wants read/write access to an existing database and 24 * requires exclusive access. */ 25 public final static int WRITER = GdbmFile.WRITER; 26 27 /** The caller wants exclusive read/write access, and the database 28 * should be created if it does not already exist. */ 29 public final static int WRCREAT = GdbmFile.WRCREAT; 30 31 /** The caller wants exclusive read/write access, and the database 32 * should be replaced if it already exists. */ 33 public final static int NEWDB = GdbmFile.NEWDB; 16 static Logger logger = Logger.getLogger(org.greenstone.gsdl3.util.GDBMWrapper.class.getName()); 17 18 /* GdbmFile modes: 19 READER - read access, many readers may share the database 20 WRITER - read/write access, exclusive access 21 WRCREAT - read/write access, create db if doesn't exist 22 NEWDB - read/write access, db should be replaced if exists 23 */ 24 34 25 35 26 protected GdbmFile db_=null; 36 27 37 /** open the database filename, with mode mode - uses the constants 38 above, eg GdbmFile.WRITER */ 39 public boolean openDatabase(String filename, int mode){ 40 try { 41 if (db_!=null) { 42 db_.close(); 43 } 44 db_ = new GdbmFile(filename, mode); 45 } catch ( GdbmException e) { // the database wasn't opened or created 46 logger.error("couldn't open database "+filename); 47 return false; 48 } 49 db_.setKeyPacking(new StringPacking()); 50 db_.setValuePacking(new StringPacking()); 51 return true; 28 /** open the database filename, with mode mode - uses the constants 29 above, eg GdbmFile.WRITER */ 30 public boolean openDatabase(String filename, int mode) { 31 // need to convert mode to GdbmFile mode 32 if (mode == READ) { 33 mode = GdbmFile.READER; 34 } else if (mode == WRITE) { 35 mode = GdbmFile.WRITER; 36 } else { 37 logger.error ("invalid mode, "+mode+ ", opening db for reading only"); 38 mode = GdbmFile.READER; 52 39 } 40 41 try { 42 if (db_!=null) { 43 db_.close(); 44 } 45 db_ = new GdbmFile(filename, mode); 46 } catch ( GdbmException e) { // the database wasn't opened or created 47 logger.error("couldn't open database "+filename); 48 return false; 49 } 50 db_.setKeyPacking(new StringPacking()); 51 db_.setValuePacking(new StringPacking()); 52 return true; 53 } 54 55 /** close the database associated with this wrapper */ 56 public void closeDatabase() { 57 try { 58 if (db_ != null) { 59 db_.close(); 60 db_ = null; 61 } 62 } catch (GdbmException e) { 63 // should never get here - close never actually throws an exception 64 logger.error("error on close()"); 65 } 66 } 53 67 54 /** close the database associated with this wrapper */ 55 public void closeDatabase() { 56 try { 57 if (db_ != null) { 58 db_.close(); 59 db_ = null; 60 } 61 } catch (GdbmException e) { 62 // should never get here - close never actually throws an exception 63 logger.error("error on close()"); 64 } 68 public String getValue(String key) { 69 if (db_==null) { 70 return null; 65 71 } 72 String s_info; 73 try { 74 s_info = (String)db_.fetch(key); 75 } catch (GdbmException e) { 76 logger.error("couldn't get record"); 77 return null; 78 } 79 if (s_info==null) { 80 // record not present 81 logger.error("key "+key+" not present in db"); 82 return null; 83 } 84 return s_info; 85 } 66 86 67 /** returns a DBInfo object containing all the name-value pairs for 68 * main_key 69 * @see DBInfo 70 */ 71 public DBInfo getInfo(String main_key) { 72 if (db_==null) { 73 return null; 74 } 75 String s_info; 76 try { 77 s_info = (String)db_.fetch(main_key); 78 } catch (GdbmException e) { 79 logger.error("couldn't get record"); 80 return null; 81 } 82 if (s_info==null) { 83 // record not present 84 logger.error("key "+main_key+" not present in db"); 85 return null; 86 } 87 DBInfo info = new DBInfo(); 87 /** sets the key value as info 88 * TODO - not implemented yet */ 89 public boolean setValue (String key, String value) { 90 if (db_==null) { 91 return false; 92 } 93 return false; 94 } 95 /** deletes the entry for key 96 * TODO - not implemented yet */ 97 public boolean deleteKey(String key) { 98 if (db_==null) { 99 return false; 100 } 101 return false; 102 } 88 103 89 String [] lines = s_info.split("\n");90 String key;91 String value;92 for (int i=0; i<lines.length; i++) {93 logger.debug("line:"+lines[i]);94 int a = lines[i].indexOf('<');95 int b= lines[i].indexOf('>');96 if (a==-1 || b==-1) {97 logger.error("bad format in db");98 }99 else {100 key=lines[i].substring(a+1, b);101 value=lines[i].substring(b+1);102 logger.debug("key="+key+", val="+value);103 info.addInfo(key, value);104 105 }106 }107 return info;108 }109 110 /** sets all the name-value pairs in info as the content for key key111 * TODO - not implemented yet */112 public boolean setInfo(String key, DBInfo info) {113 if (db_==null) {114 return false;115 }116 return true;117 }118 /** sets the key value as info119 * TODO - not implemented yet */120 public boolean setInfo (String key, String info) {121 if (db_==null) {122 return false;123 }124 return true;125 }126 /** deletes the entry for key127 * TODO - not implemented yet */128 public boolean deleteKey(String key) {129 if (db_==null) {130 return false;131 }132 return true;133 }134 135 // greenstone convenience methods - should these go into a separate class?136 // yes I think so.137 /** converts a greenstone OID to internal docnum */138 public long OID2Docnum(String OID) {139 DBInfo info = getInfo(OID);140 if (info != null) {141 long real_num = Long.parseLong(info.getInfo("docnum"));142 return real_num;143 }144 return -1;145 }146 /** converts a docnum to greenstone OID */147 public String docnum2OID(long docnum) {148 return docnum2OID(Long.toString(docnum));149 }150 151 /** converts a docnum to greenstone OID */152 public String docnum2OID(String docnum) {153 DBInfo info = getInfo(docnum);154 if (info!=null){155 String oid = info.getInfo("section");156 return oid;157 }else{158 return null;159 }160 }161 162 /** converts an external id to greenstone OID */163 public String externalId2OID(String extid) {164 DBInfo info = getInfo(extid);165 if (info != null) {166 String oid = info.getInfo("section");167 return oid;168 }169 return null;170 }171 /** translates relative oids into proper oids:172 * .pr (parent), .rt (root) .fc (first child), .lc (last child),173 * .ns (next sibling), .ps (previous sibling)174 * .np (next page), .pp (previous page) : links sections in the order that you'd read the document175 * a suffix is expected to be present so test before using176 */177 public String translateOID(String oid) {178 179 int p = oid.lastIndexOf('.');180 if (p != oid.length()-3) {181 logger.info("translateoid error: '.' is not the third to last char!!");182 return oid;183 }184 185 String top = oid.substring(0, p);186 String suff = oid.substring(p+1);187 // just in case we have multiple extensions, we must translate188 // we process inner ones first189 if (OID.needsTranslating(top)) {190 top = translateOID(top);191 }192 if (suff.equals("pr")) {193 return OID.getParent(top);194 }195 if (suff.equals("rt")) {196 return OID.getTop(top);197 }198 if (suff.equals("np")) {199 // try first child200 String node_id = translateOID(top+".fc");201 if (!node_id.equals(top)) {202 return node_id;203 }204 // try next sibling205 node_id = translateOID(top+".ns");206 if (!node_id.equals(top)) {207 return node_id;208 }209 // otherwise we keep trying parents sibling210 String child_id = top;211 String parent_id = OID.getParent(child_id);212 while(!parent_id.equals(child_id)) {213 node_id = translateOID(parent_id+".ns");214 if (!node_id.equals(parent_id)) {215 return node_id;216 }217 child_id = parent_id;218 parent_id = OID.getParent(child_id);219 }220 return top; // we couldn't get a next page, so just return the original221 }222 if (suff.equals("pp")) {223 String prev_sib = translateOID(top+".ps");224 if (prev_sib.equals(top)) {225 // no previous sibling, so return the parent226 return OID.getParent(top);227 }228 // there is a previous sibling, so its either this section, or the last child of the last child..229 String last_child = translateOID(prev_sib+".lc");230 while (!last_child.equals(prev_sib)) {231 prev_sib = last_child;232 last_child = translateOID(prev_sib+".lc");233 }234 return last_child;235 }236 237 int sibling_num = 0;238 if (suff.equals("ss")) {239 // we have to remove the sib num before we get top240 p = top.lastIndexOf('.');241 sibling_num = Integer.parseInt(top.substring(p+1));242 top = top.substring(0, p);243 }244 245 // need to get info out of gdbm db -246 String doc_id = top;247 if (suff.endsWith("s")) {248 doc_id = OID.getParent(top);249 if (doc_id.equals(top)) {250 // i.e. we are already at the top251 return top;252 }253 }254 DBInfo info = getInfo(doc_id);255 if (info==null) {256 logger.info("info is null!!");257 return top;258 }259 260 String contains = info.getInfo("contains");261 if (contains.equals("")) {262 // something is wrong263 return top;264 }265 contains = contains.replaceAll("\"", doc_id);266 String [] children = contains.split(";");267 if (suff.equals("fc")) {268 return children[0];269 } else if (suff.equals("lc")) {270 return children[children.length-1];271 } else {272 if (suff.equals("ss")) {273 return children[sibling_num-1];274 }275 // find the position that we are at.276 int i=0;277 while (i<children.length) {278 if (children[i].equals(top)) {279 break;280 }281 i++;282 }283 284 if (suff.equals("ns")) {285 if (i==children.length-1) {286 return children[i];287 }288 return children[i+1];289 } else if (suff.equals("ps")) {290 if (i==0) {291 return children[i];292 }293 return children[i-1];294 }295 }296 297 return top;298 }299 104 } -
greenstone3/branches/customizingGreenstone3/src/java/org/greenstone/gsdl3/util/GS2MacroResolver.java
r14532 r15787 28 28 { 29 29 30 protected GDBMWrapper gdbm_src= null;30 protected SimpleCollectionDatabase coll_db = null; 31 31 32 32 // need to make it not add macros if they are already present 33 public GS2MacroResolver( GDBMWrapper gdbm) {33 public GS2MacroResolver(SimpleCollectionDatabase db) { 34 34 super(); 35 gdbm_src = gdbm; 35 coll_db = db; 36 } 37 38 public GS2MacroResolver() { 39 super(); 40 } 41 42 public void setDB(SimpleCollectionDatabase db) { 43 this.coll_db = db; 36 44 } 37 45 … … 107 115 if (match.matches()) { 108 116 if (node_info == null) { 109 node_info = gdbm_src.getInfo(doc_oid);117 node_info = coll_db.getInfo(doc_oid); 110 118 if (node_info == null) { 111 119 break; … … 116 124 // try the root node 117 125 if (root_info == null && !OID.isTop(doc_oid)) { 118 root_info = gdbm_src.getInfo(OID.getTop(doc_oid));126 root_info = coll_db.getInfo(OID.getTop(doc_oid)); 119 127 } 120 128 if (root_info == null) break; -
greenstone3/branches/customizingGreenstone3/src/java/org/greenstone/gsdl3/util/GSFile.java
r15191 r15787 289 289 } 290 290 291 /** the gdbmdatabase file -292 * note, need to change extension depending on OS */291 /** the collection database file - 292 * note, need to change extension depending on OS and database type */ 293 293 // The perl code can't detect big vs little endian on a Mac, so the Perl 294 294 // code will always name the gdbm db file .bdb on a Mac whether its little 295 295 // endian or not. A Mac little endian file is NOT the same as a Linux 296 296 // little endian file 297 static public String GDBMDatabaseFile(String site_home, 298 String collection_name, 299 String index_stem) { 300 301 String db_ext = ".ldb"; 302 if (Misc.isMac() || Misc.isBigEndian()) { 297 // jdbm files are endian independent ?? 298 static public String collectionDatabaseFile(String site_home, 299 String collection_name, 300 String index_stem, 301 String database_type) { 302 303 String db_ext = null; 304 if (database_type.equalsIgnoreCase("jdbm")) { 305 db_ext = ".db"; 306 } else { 307 // assume gdbm 308 db_ext = ".ldb"; 309 if (Misc.isMac() || Misc.isBigEndian()) { 303 310 db_ext = ".bdb"; 304 } 311 } 312 } 313 305 314 return site_home + File.separatorChar + 306 315 "collect" + File.separatorChar + -
greenstone3/branches/customizingGreenstone3/src/java/org/greenstone/gsdl3/util/GSXML.java
r15191 r15787 64 64 public static final String DISPLAY_ELEM = "display"; 65 65 public static final String LEVEL_ELEM = "level"; 66 public static final String DATABASE_TYPE_ELEM = "databaseType"; 66 67 public static final String SHORTNAME_ATT = "shortname"; 67 68 public static final String NOTIFY_ELEM = "notify"; 68 69 public static final String NOTIFY_HOST_ATT = "host"; 69 70 70 // elems for the pages to be processed by xslt 71 71 public final static String PAGE_ELEM = "page"; … … 423 423 /** returns the (first) child element with the given name */ 424 424 public static Node getChildByTagName(Node n, String name) { 425 426 Node child = n.getFirstChild(); 427 while (child!=null) { 428 if (child.getNodeName().equals(name)) { 429 return child; 430 } 431 child = child.getNextSibling(); 432 } 433 return null; //not found 425 if(n != null) { // this line is an attempted solution to the NullPointerException mentioned 426 // in trac bug ticket #225. If n is null can't do n.getFirstChild() below. As per bug #225: 427 // GSXML.getNodeByPath() is called by GS2BrowseAction, which then calls this method. 428 // If n is null, null will be returned which GS2BrowseAction already checks for. It's here 429 // that the NullPointerException was thrown. 430 431 Node child = n.getFirstChild(); 432 while (child!=null) { 433 if (child.getNodeName().equals(name)) { 434 return child; 435 } 436 child = child.getNextSibling(); 437 } 438 } 439 return null; //not found 434 440 } 435 441 -
greenstone3/branches/customizingGreenstone3/src/java/org/greenstone/gsdl3/util/OAIXML.java
r14206 r15787 121 121 public static final String NO_METADATA_FORMATS = "noMetadataFormats"; 122 122 123 // The node id in the gdbmdatabase, which contains all the OIDs in the database123 // The node id in the collection database, which contains all the OIDs in the database 124 124 public static final String BROWSELIST = "browselist"; 125 125 -
greenstone3/branches/customizingGreenstone3/web/WEB-INF/cgi/gliserver4gs3.pl
r14602 r15787 118 118 while (1) { } 119 119 } 120 elsif ($cmd eq "file-exists") { 121 &file_exists($gsdl_cgi); 122 } 120 123 else { 121 124 $gsdl_cgi->generate_error("Unrecognised command: '$cmd'"); … … 542 545 } 543 546 547 # Method that will check if the given file exists 548 # No error message: all messages generated are OK messages 549 # This method will simply state whether the file exists or does not exist. 550 sub file_exists 551 { 552 my ($gsdl_cgi, $username, $timestamp) = @_; 553 554 my ($gsdl_cgi) = @_; 555 556 my $collection = $gsdl_cgi->clean_param("c"); 557 if ((!defined $collection) || ($collection =~ m/^\s*$/)) { 558 $gsdl_cgi->generate_error("No collection specified."); 559 } 560 my $file = $gsdl_cgi->clean_param("file"); 561 if ((!defined $file) || ($file =~ m/^\s*$/)) { 562 $gsdl_cgi->generate_error("No file specified."); 563 } 564 $file =~ s/\|/&util::get_dirsep()/eg; # Convert the '|' characters into whatever is right for this OS 565 566 # Not necessary: checking whether the user is authenticated to query existance of the file 567 #&authenticate_user($gsdl_cgi, $username, $collection); 568 569 my $gsdlhome = $ENV{'GSDLHOME'}; 570 my $collection_directory = &util::filename_cat($gsdlhome, "collect", $collection); 571 $gsdl_cgi->checked_chdir($collection_directory); 572 573 # Check that the collection file exists 574 if (-e $file) { 575 $gsdl_cgi->generate_ok_message("File $file exists."); 576 } else { 577 $gsdl_cgi->generate_ok_message("File $file does not exist."); 578 } 579 } 544 580 545 581 sub download_collection_file … … 862 898 &lock_collection($gsdl_cgi, $username, $collection, $site) unless ($script eq "mkcol.pl"); 863 899 864 # Last argument is the collection name, except for explode_metadata_database.pl 900 # Last argument is the collection name, except for explode_metadata_database.pl and 901 # replace_srcdoc_with_html (where there's a "file" option followed by the filename. These two preceed the collection name) 865 902 my $perl_args = $collection; 866 if ($script eq "explode_metadata_database.pl" ) {867 # Last argument is the file to be exploded 903 if ($script eq "explode_metadata_database.pl" || $script eq "replace_srcdoc_with_html.pl") { 904 # Last argument is the file to be exploded or it is the file to be replaced with its html version 868 905 my $file = $gsdl_cgi->clean_param("file"); 869 906 if ((!defined $file) || ($file =~ m/^\s*$/)) { … … 871 908 } 872 909 $gsdl_cgi->delete("file"); 910 $file =~ s/ /\\ /g; # escape all spaces in filename with a backslash, i.e. "\ ". 873 911 $perl_args = $file; 874 912 }
Note:
See TracChangeset
for help on using the changeset viewer.