try {
session = contentSource.newSession();
String urisModule = options.getModuleRoot()
+ options.getUrisModule();
logger.info("invoking module " + urisModule);
Request req = session.newModuleInvoke(urisModule);
// NOTE: collection will be treated as a CWSV
req.setNewStringVariable("URIS", collection);
// TODO support DIRECTORY as type
req.setNewStringVariable("TYPE",
TransformOptions.COLLECTION_TYPE);
req.setNewStringVariable("PATTERN", "[,\\s]+");
req.setOptions(requestOptions);
ResultSequence res = session.submitRequest(req);
// like a Pascal string, the first item will be the count
total = ((XSInteger) res.next().getItem()).asPrimitiveInt();