Changeset 22041 for gs3-extensions/mat


Ignore:
Timestamp:
2010-05-05T17:33:46+12:00 (14 years ago)
Author:
sjm84
Message:

Updated mat-colbuild.bash and mat-colbuild-download.bash so that they use more recent methods to create/build collections

Location:
gs3-extensions/mat/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • gs3-extensions/mat/trunk/bin/script/mat-colbuild-download.bash

    r22002 r22041  
    1313# $9 should be the creator
    1414# $10 should be the proxy settings
     15
     16COL_NAME=$1
     17OAI_URL=$2
     18CACHE_DIR=$3
     19MAX_RECORDS=$4
     20OAI_PREF=$5
    1521GS3_ROOT=$6
    1622COLLECT_DIR=$7
    1723LOG_FILE=$8
    18 CACHE_DIR=$3
     24CREATOR=$9
     25#SHIFT
     26#PROXY=$9
    1927
    2028if [ -x /usr/bin/lsof ] ; then
     
    2836fi
    2937
    30 TOMCAT_ID=`ps ux  | grep tomcat | grep java | grep -v grep | awk -F" " '{ print $2 }'`
     38TOMCAT_ID=`ps ux  | grep tomcat | grep java | grep -v grep | awk -F" " '{ print $OAI_URL }'`
    3139
    3240if [ ! -z "$lsof" ] ; then
     
    4452source setup.bash >> $LOG_FILE
    4553
    46 perl -S mkcol.pl -gs3mode -collectdir $COLLECT_DIR $1
     54perl -S mkcol.pl -gs3mode -buildtype lucene -collectdir $COLLECT_DIR $COL_NAME
    4755
    48 echo $1 $2 $3 $4 $5 $6 $7 $8 >> $LOG_FILE
     56echo $COL_NAME $OAI_URL $CACHE_DIR $MAX_RECORDS $OAI_PREF $GS3_ROOT $COLLECT_DIR $LOG_FILE >> $LOG_FILE
    4957
    5058if [ ! -z "$lsof" ] ; then
     
    6775fi
    6876
    69 perl -S downloadfrom.pl -download_mode OAI -cache_dir $CACHE_DIR -url $2 -max_records $4 -metadata_prefix $5 $9 2>&1 >> $LOG_FILE
     77perl -S downloadfrom.pl -download_mode OAI -cache_dir $CACHE_DIR -url $OAI_URL -max_records $MAX_RECORDS -metadata_prefix $OAI_PREF $CREATOR 2>&1 >> $LOG_FILE
    7078
    7179if [ ! -z "$lsof" ] ; then
  • gs3-extensions/mat/trunk/bin/script/mat-colbuild.bash

    r21996 r22041  
    55# $2 should be the oai URL
    66# $3 should the cache directory
    7 # $4 should be the max records
    8 # $5 should be the OAI metadata prefix
    9 # $6 should be GS3 root
    10 # $7 should be the collection directory
    11 # $8 should the log file
    12 # $9 should be the host name : port number
     7# $4 should be GS3 root
     8# $5 should be the collection directory
     9# $6 should the log file
     10# $7 should be the host name : port number
    1311
    14 #$GS3_ROOT=$6
    15 #$COLLECT_DIR=$7
    16 #$LOG_FILE=$8
     12COL_NAME=$1
     13OAI_URL=$2
    1714CACHE_DIR=$3
     15GS3_ROOT=$4
     16COL_DIR=$5
     17LOG_FILE=$6
     18HOST_PORT=$7
    1819
    1920# check we are still in the right directories
     
    2930fi
    3031
    31 TOMCAT_ID=`ps ux  | grep tomcat | grep java | grep -v grep | awk -F" " '{ print $2 }'`
     32TOMCAT_ID=`ps ux  | grep tomcat | grep java | grep -v grep | awk -F" " '{ print $OAI_URL }'`
    3233echo Tomcat_ID: $TOMCAT_ID
    3334
     
    3738fi
    3839
    39 cd $6
    40 source gs3-setup.sh >> $8
     40cd $GS3_ROOT
     41source gs3-setup.sh >> $LOG_FILE
    4142
    4243cd gs2build/
    43 source setup.bash >> $8
    44 
     44source setup.bash >> $LOG_FILE
    4545
    4646# event log goes to greenstone3/gs2build/etc/events.txt
     
    4848## build -indextype lucene -site localsite -collectdir $COLLECT_DIR -download file://$3 -log_events $1
    4949
    50 echo "Away to build"  >> $8
     50echo "Away to build"  >> $LOG_FILE
     51#echo "BABAB CACHE_DIR = Q $CACHE_DIR Q - COL_DIR = Q $COL_DIR Q - COL_NAME = Q $COL_NAME Q"
     52#echo "AAAAA /bin/cp -r" $CACHE_DIR/* "$COL_DIR/$COL_NAME/import/."
     53/bin/cp -r $CACHE_DIR/* $COL_DIR/$COL_NAME/import/.
    5154
    52 build -indextype lucene -site localsite -collectdir $7 -log_events -download file://$CACHE_DIR  $1 2>&1
     55echo "perl -S incremental-rebuild.pl -site localsite -collectdir $COL_DIR $COL_NAME"
     56
     57perl -S incremental-rebuild.pl -site localsite -collectdir $COL_DIR $COL_NAME
     58
     59#build -indextype lucene -site localsite -collectdir $COL_DIR -log_events -download file://$CACHE_DIR  $COL_NAME 2>&1
    5360#2>&1  >> $LOG_FILE
    5461
     
    5764if [ ! -z "$lsof" ] ; then
    5865  NUM_OPEN_FILES=`$lsof -p $TOMCAT_ID | wc -l `
    59   echo open files: $NUM_OPEN_FILES
     66  echo Finished Build: open files: $NUM_OPEN_FILES
    6067fi
    6168
    62 echo "Build finished ...." >> $8
     69echo "Build finished ...." >> $LOG_FILE
    6370
    64 if [ -d $6/gs2build/collect/$1 ]
     71if [ -d $GS3_ROOT/gs2build/collect/$COL_NAME ]
    6572then
    66     echo "moving from gs2 dir" >> $8
     73    echo "moving from gs2 dir" >> $LOG_FILE
    6774    echo built in gs2 dir ... moving
    68     mv $6/gs2build/collect/$1 $7/$1
     75    mv $GS3_ROOT/gs2build/collect/$COL_NAME $COL_DIR/$COL_NAME
    6976fi
    7077
    71 echo "Away to convert from Greenstone 2 to Greenstone 3"  >> $8
    72 echo "Away to convert from Greenstone 2 to Greenstone 3"
    73 
    74 # >> $LOG_FILE
    7578
    7679if [ ! -z "$lsof" ] ; then
     
    8083fi
    8184
    82 echo "Away to reconfigure Greenstone 3 server"  >> $8
     85echo "Away to reconfigure Greenstone 3 server"  >> $LOG_FILE
    8386echo "Away to reconfigure Greenstone 3 server"
    8487
     
    8689
    8790#wget -O /tmp/mat5.html "http://localhost:8090/greenstone3/library?a=s&sa=c"
    88 wget -O /tmp/mat3.html "http://$9/greenstone3/library?a=s&sa=c"
     91wget -O /tmp/mat3.html "http://$HOST_PORT/greenstone3/library?a=s&sa=c"
    8992
    90 echo "Done"  >> $8
     93echo "Done"  >> $LOG_FILE
    9194echo "Done"
    9295
  • gs3-extensions/mat/trunk/src/org/greenstone/mat/servlet/MatServlet.java

    r22007 r22041  
    461461   
    462462       
    463         String[] arrays = new String[14];
     463        String[] arrays = new String[11];
    464464        arrays[0] = "cmd";
    465465        arrays[1] = "/c";
     
    468468        arrays[4] = "mat-colbuild.bat";
    469469        arrays[5] = collName;
    470         arrays[6] = oaiURLString;
    471         arrays[7] = cacheDir;
    472         arrays[8] = "100";
    473         arrays[9] = oaiPrefix;
    474         arrays[10] = gs3Root;
    475         arrays[11] = collectDir;
    476         arrays[12] = logFile;
    477         arrays[13] = hostName + port_number;
     470        arrays[6] = cacheDir;
     471        arrays[7] = gs3Root;
     472        arrays[8] = collectDir;
     473        arrays[9] = logFile;
     474        arrays[10] = hostName + ":" + port_number;
    478475       
    479476        Process p2 = processBatch(arrays,out,wd);
     
    623620        + cacheDir
    624621        + " "
    625         + maxRecords
    626         + " "
    627         + metadataprefix
    628         + " "
    629622        + gs3Root
    630623        + " "
Note: See TracChangeset for help on using the changeset viewer.