Пример #1
0
  /**
   * Starts the reindexing process
   *
   * @param args
   */
  public static void main(String[] args) {
    startTime = new Date().getTime();
    // Get the configuration filename
    if (args.length == 0) {
      System.out.println("Please enter the server to index as the first parameter");
      System.exit(1);
    }
    serverName = args[0];
    System.setProperty("reindex.process.serverName", serverName);

    initializeReindex();

    // Runs the export process to extract marc records from the ILS (if applicable)
    runExportScript();

    // Process all reords (marc records, econtent that has been added to the database, and
    // resources)
    ArrayList<IRecordProcessor> recordProcessors = loadRecordProcesors();
    if (recordProcessors.size() > 0) {
      // Do processing of marc records with record processors loaded above.
      // includes indexing records
      // extracting eContent from records
      // Updating resource information
      // Saving records to strands - may need to move to resources if we are doing partial exports
      processMarcRecords(recordProcessors);

      // Process eContent records that have been saved to the database.
      processEContentRecords(recordProcessors);

      // Do processing of resources as needed (for extraction of resources).
      processResources(recordProcessors);

      for (IRecordProcessor processor : recordProcessors) {
        processor.finish();
      }
    }

    // Send completion information
    endTime = new Date().getTime();
    sendCompletionMessage(recordProcessors);

    logger.info("Finished Reindex for " + serverName);
  }