Modeshape sequencers
mcaspers Dec 12, 2010 11:36 PMI'm trying to get the XmlSequencer to work in a filesystem to allow me to search xml files. I know the repository is loading OK because I can dump the nodes and they reflect the contents of the directory I am looking at. But I can't seem to get the sequencer to work, and engine.getSequencingService().getSequencersList() always returns an empty list. What am I doing wrong?
try
{
final String REPO_NAME = "repo";
final String SOURCE_NAME = "source";
JcrConfiguration config = new JcrConfiguration();
config.repositorySource(SOURCE_NAME)
.usingClass(FileSystemSource.class)
.setProperty("workspaceRootPath", "/home/matthew/Documents")
.setProperty("defaultWorkspaceName", "ModeshapeRepoTest");
config.repository(REPO_NAME)
.setSource(SOURCE_NAME);
config.sequencer("Xml")
.usingClass(XmlSequencer.class)
.setDescription("XML Sequencer")
.sequencingFrom("//(*.xml[*])/jcr:content[@jcr:data]")
.andOutputtingTo("/xml/$1");
JcrEngine engine = config.build();
engine.start();
Repository repository = engine.getRepository(REPO_NAME);
Session session = repository.login();
List<Sequencer> list = engine.getSequencingService().getSequencersList();
boolean found = session.getRootNode().hasNode("xml");
session.logout();
engine.shutdown();
engine.awaitTermination(4, TimeUnit.SECONDS);
}
catch (Exception ex)
{
ex.printStackTrace();
}