Adding a mixin property to a node using sequencing
souvikonline Jan 17, 2011 10:52 AMI have an image repository where the images have the EXIF UserComment field containing the image tags. I have written a custom sequencer to extract this metadata and would like to add these tags as a mixin to the 'same' nt:file node.
I am able to add mixins programaticaly to the nt:file node easily using the Node.addMixin() method. For this, I have defined a cnd like the following:
[tfmi:taggable] mixin
- tfmi:tags (STRING) multiple
However, the custom sequencer fails to add the mixin automatically. The sequencer config has the following path-expression:
<mode:pathExpression>content:photos:/files(//*.(jpg|jpeg|gif|bmp|pcx|png|iff|ras|pbm|pgm|ppm|psd)[*])/jcr:content[@jcr:data] =>
content:photos:/files/$1</mode:pathExpression>
With this configuration I get the following exception:
21:16:33,811 ERROR Error finding sequencers to run against node 2011-01-17T15:46:33.654Z @Fred [content] - 3 changes
java.lang.NullPointerException
at org.modeshape.graph.Graph$BatchResultsNode.addProperty(Graph.java:7095)
at org.modeshape.graph.Graph$BatchResults.<init>(Graph.java:6956)
at org.modeshape.graph.Graph$Batch.execute(Graph.java:4823)
at org.modeshape.repository.sequencer.StreamSequencerAdapter.saveOutput(StreamSequencerAdapter.java:335)
at org.modeshape.repository.sequencer.StreamSequencerAdapter.execute(StreamSequencerAdapter.java:228)
at org.modeshape.repository.sequencer.SequencingService.processChange(SequencingService.java:495)
at org.modeshape.repository.sequencer.SequencingService$RepositoryObserver$1.run(SequencingService.java:657)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Can a sequencer output the results as mxin types to the source node? If yes, what would be the correct path expression?