can anybody explain to me, how to proceed in following scenario ?
receiving documents (MS docs, ODS, PDF)
Dublic core metadata extraction via Ap
I am a bit rusty with JCR and I have never used 2.0 but this should get you started.
See this link. You'll want to open up the second comment.
You just store the file in a node and add additional metadata to the node. Here is how to store the file:
Node folder = session.getRootNode().getNode("path/to/file/uploads");
Node file = folder.addNode(fileName, "nt:file");
Node fileContent = file.addNode("jcr:content");
fileContent.setProperty("jcr:data", fileStream);
// Add other metadata
session.save();
How you store meta-data is up to you. A simple way is to just store key value pairs:
fileContent.setProperty(key, value, PropertyType.STRING);
To read the data you just call getProperty()
.
fileStream = fileContent.getProperty("jcr:data");
value = fileContent.getProperty(key);