Hi Julio,

the rep:excerpt() function is jackrabbit-core specific and is not guaranteed to work across the more JCR generic SPI layer.

regards
 marcel

Julio Castillo wrote:
I have a client accessing a server running jackrabbit.

I access the client via a custom client using the JCR 2 SPI interfaces.

I have been successful at storing, retrieving, searching documents.

I have not been able to get excerpts from the documents returned. I modeled
my logic after the search.jsp that ships with the jackrabbit war file.

Below is an excerpt (no pun intended) of my code.

    while (rowIt.hasNext()) {
        row = rowIt.nextRow();
        fileNode =
(Node)session.getItem(row.getValue("jcr:path").getString());
        rsrcNode = fileNode.getNode("jcr:content");
        if (rsrcNode.hasProperty("jcr:data"))
            fileSize = rsrcNode.getProperty("jcr:data").getLength();
        lastModified = rsrcNode.getProperty("jcr:lastModified").getDate();
        System.out.println (
                "File:"+ fileNode.getName() + "  [" + fileSize + "] " +
                lastModified.getTime());
        
System.out.println(row.getValue("rep:excerpt(jcr:content)").getString());
    }

While attempting to execute last getValue call I get the following error:
javax.jcr.RepositoryException: ':' not allowed in name

If I just use getValue("rep:excerpt()") I get an xml output that provides no
value to me: <excerpt><fragment></fragment></excerpt>

I think this is just different behavior between running this within
jackrabbit and remotely via JCR/SPI.

Any ideas?

Julio Castillo
Edgenuity Inc.



Reply via email to