Hi,
my problem is close to "Plain JCR XPATH queries" by Edgar Merino
(http://article.gmane.org/gmane.comp.apache.jackrabbit.user/9748) but
not the same:
I read and followed the instructions from
http://jackrabbit.apache.org/5-with-jackrabbit-ocm.html (and related) to
set up OCM for Jackrabbit and i'm using the POJOs from the JUnit tests
to set up the mapping for Files and Folders. After solving that issue
with the ocm_classname discussed in
http://www.nabble.com/OCM-ocm:discriminator-NodeType-td20701910.html
http://www.nabble.com/OCM-Annotations-constraint-error-td20493710.html
everything is working except one thing:
Files that are uploaded via WebDAV do not contain that ocm_classname
discriminator, which means that these files cannot not be found by
queries like:
Filter filter = queryManager.createFilter(File.class);
Query query = qm.createQuery(filter);
contentManager.getObjects(query);
which is desirable. Using a basic search query like:
contentManager.getObjects("/*[jcr:primaryType='nt:file']",
javax.jcr.query.Query.XPATH)
results in an exception:
org.apache.jackrabbit.ocm.exception.ObjectContentManagerException: Class
'org.mycompany.model.jcr.File' has not a discriminator property.
The question: Is there a chance ...
1) to tell the WebDAV-Servlet to set the discriminator properties for
uploaded Files and Folders or
2) that OCM recognized nodes as files or folders even without that
discriminator property?
Any suggestions?
Thanks,
Martin