marklogic/roxy — pull request #68 by mblakele (2012-12-12 00:18:24+00:00)
Title: improved recordloader action

I ran into some problems with the recordloader action. Here's an attempt to improve it. This version is a little more robust about filenames, and allows multiple arguments. Arguments can be property files, input files, or Java VM arguments. Anything starting with '-' is assumed to be a VM arg. Anything else is assumed to be a file, which could be an input file or a property file. The only bit that comes from roxy configuration is the `CONNECTION_STRING`, so the username and password only have to be stored in one place.

Technically RecordLoader doesn't require any args, but I left a check in place to enforce at least one, along with a note to that effect.

Using this code it becomes fairly easy to create `app_specific.rb` actions that use `recordloader`. For example:

def load_testdata()
logger.info "loading test data..."
ARGV.push "-Xincgc"
ARGV.push "src/ingestion/test-data.properties"
ARGV.push "data/test_data.zip"
recordloader
end

If this patch is acceptable, something very similar could be done for xqsync.