Changeset 33975


Ignore:
Timestamp:
2020-02-25T14:46:51+13:00 (4 years ago)
Author:
kjdon
Message:

some mods to do with allowing multiple oaiservers. need OAIConfig-servername.xml for each one. Uses oai.servlets property which can be modified in build.properties.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/build.xml

    r33935 r33975  
    2424  <taskdef name="if" classname="ise.antelope.tasks.IfTask" classpathref="project.classpath"/>
    2525  <taskdef name="for" classname="net.sf.antcontrib.logic.ForTask" classpathref="project.classpath"/>
     26  <taskdef name="foreach" classname="net.sf.antcontrib.logic.ForEach" classpathref="project.classpath"/>
    2627  <taskdef name="stringutil" classname="ise.antelope.tasks.StringUtilTask" classpathref="project.classpath"/>
    2728
     
    318319  <!-- now we've read in properties, apply defaults -->
    319320  <property name="disable.collection.building" value="false"/>
    320 
     321  <property name="oai.servlets" value="oaiserver"/> <!-- in case user has old version of build.properties-->
    321322  <!-- get properties from the environment -->
    322323  <property environment="env"/>
     
    11921193
    11931194    <!--Now write out the url with /oaiserver suffix as the baseURL property in OAIConfig.xml-->
    1194     <available file="${basedir}/resources/oai/OAIConfig.xml.in" property="oaiconfig.present"/>
    1195     <antcall target="init-oaiconfig">
     1195    <antcall target="init-oaiconfigs">
    11961196      <param name="url" value="${url}"/>
    11971197    </antcall>
     
    12041204
    12051205  </target>
    1206 
    1207   <target name="init-oaiconfig" if="oaiconfig.present">
    1208     <echo>Writing out baseURL ${url}oaiserver to ${web.writableclasses}/OAIConfig.xml</echo>
    1209     <copy file="${basedir}/resources/oai/OAIConfig.xml.in" tofile="${web.writableclasses}/OAIConfig.xml"/>
    1210     <rsr verbosity="1" file="${web.writableclasses}/OAIConfig.xml" pattern="&lt;baseURL&gt;.*&lt;/baseURL&gt;" replacement="&lt;baseURL&gt;${url}oaiserver&lt;/baseURL&gt;" />   
     1206 
     1207  <available file="${basedir}/resources/oai/OAIConfig.xml.in" property="oaiconfig.present"/>
     1208
     1209  <target name="init-oaiconfigs" if="oaiconfig.present">
     1210    <echo>Generating new oaiconfigs for servlets ${oai.servlets} </echo>
     1211    <foreach list="${oai.servlets}" delimiter="," target="init-oaiconfig" param="servlet_name"/>
     1212  </target>
     1213 
     1214  <target name="init-oaiconfig">
     1215    <if><bool><not><available file="${basedir}/resources/oai/OAIConfig-${servlet_name}.xml.in"/></not></bool>
     1216    <echo>Copying file ${basedir}/resources/oai/OAIConfig.xml.in to ${basedir}/resources/oai/OAIConfig-${servlet_name}.xml.in</echo>
     1217    <echo>This file (OAIConfig-${servlet_name}.xml.in) will not be regenerated again, so you may edit it to customise settings for this servlet. To have it regenerated, delete the file.</echo>
     1218    <copy file="${basedir}/resources/oai/OAIConfig.xml.in" tofile="${basedir}/resources/oai/OAIConfig-${servlet_name}.xml.in"/>
     1219    </if>
     1220    <echo>Copying ${basedir}/resources/oai/OAIConfig-${servlet_name}.xml.in to ${web.writableclasses}/OAIConfig-${servlet_name}.xml and setting baseURL to ${url}${servlet_name}</echo>
     1221    <copy file="${basedir}/resources/oai/OAIConfig-${servlet_name}.xml.in" tofile="${web.writableclasses}/OAIConfig-${servlet_name}.xml"/>
     1222    <rsr verbosity="1" file="${web.writableclasses}/OAIConfig-${servlet_name}.xml" pattern="&lt;baseURL&gt;.*&lt;/baseURL&gt;" replacement="&lt;baseURL&gt;${url}${servlet_name}&lt;/baseURL&gt;" />   
    12111223  </target>
    12121224
     
    26452657    Doing "cat </dev/null > packages/tomcat/logs/catalina.out" doesn't work as an ant target.
    26462658    It seems to have a problem with cat or </dev/null, with or without the < sign. -->
    2647   <target name="reset-logs" description="Empties catalina.out, greenstone.log and contents of web/logs/tmp">
     2659  <target name="reset-logs" description="Empties catalina.out, solr.log, greenstone.log, usage.log, server.log and contents of web/logs/tmp">
    26482660    <echo>Truncating catalina.out, solr.log, greenstone.log, usage.log and server.log, and emptying ${web.writablehome}/logs/tmp</echo>   
    26492661    <exec executable="rm" os="${os.unix}" dir="${catalina.home}/logs" spawn="false">
Note: See TracChangeset for help on using the changeset viewer.