jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sridhar Raman" <sridhar.ra...@gmail.com>
Subject Re: Help with SearchIndex parameters
Date Tue, 12 Feb 2008 06:08:47 GMT
Oh ok, I got it (I hope).
Currently, I perform an import by doing a session.importXML(...) in my
class.  Instead, I should do this right?
ContentHandler ch = session.getImportContentHandler(...);
MyImportHandler mih = (MyImportHandler) ch;
mih.parse(input stream);

On Feb 12, 2008 11:24 AM, Sridhar Raman <sridhar.raman@gmail.com> wrote:

> But how would I be able to wrap the content handler without modifying the
> AbstractSession class?  Is there some API I can use to set the content
> handler, in which case I wouldn't need to alter any of the Jackrabbit code.
>
>
> On Feb 8, 2008 6:49 PM, Marcel Reutegger <marcel.reutegger@gmx.net> wrote:
>
> > Hi Sridhar,
> >
> > Sridhar Raman wrote:
> > > In the class AbstractSession, the method importXML has this line:
> > > ContentHandler handler =
> > >             getImportContentHandler(parentAbsPath, uuidBehavior);
> > > I am supposed to wrap this ContentHandler object right?
> >
> > correct. but you don't have to change any of the jackrabbit code. simply
> > wrap
> > the content handler that is returned.
> >
> > > Currently it's returning ImportHandler object.  I need to write a
> > similar
> > > handler, where I take care of the 1000 node count in the endElement
> > method.
> > > Am I on the right track?
> >
> > yes, something similar to:
> >
> > https://svn.apache.org/repos/asf/jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/xml/DefaultContentHandler.java
> >
> > then keep track on nodes that are added through start/endElement().
> >
> > regards
> >  marcel
> >
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message