On Wed, Oct 14, 2009 at 8:41 PM, Thomas Mortagne
<thomas.mortagne(a)xwiki.com>wrote;wrote:
On Wed, Oct 14, 2009 at 17:03, Arun Reddy
<vipunreddy.n(a)gmail.com> wrote:
Hi,
On Mon, Oct 12, 2009 at 10:27 PM, Asiri Rathnayake <
asiri.rathnayake(a)gmail.com> wrote:
> Hi,
>
> Actually in my mind there was more than just this method, i see at least
> > also
> >
> > WikiImporterListener::onWikiPageAttachment(AttachmentName,
InputStream)
> >
> > since having the whole WikiPage with all its attachments in memory
> > make the import not strong enough if you have too big attachments.
> > Making a streaming API is about making every memory consuming part
> > streamed (Actually to be sure maybe also have
> > WikiImporterListener::onWikiPageObject(WikiPageObject) but since XWiki
> > does not support this well internally currently it's less important
> > than attachments).
> >
> > The getNextPage() API is good when you have only one simple kind of
> > data in a plane list but the events based way is more generic and
> > easier to implements for the importer writer IMO since it send the
> > events when he wants.
> >
>
> Ok, Now I understand that importer writers work would be easy if we go
with
> an event based API.
>
> So for Arun this means,
>
> 1. The model you proposed is ok
>
> 2. You need to refine the WikiImporter API so that it takes into account
> what we discussed here. This means:
>
> i) Have a mechanism for defining WikiImporter components with different
> requirements (look at the getParameters() approach suggested by Thomas)
>
> ii) Make the WikiImporter api mode stream oriented. I think you can
start
with
onWikiPage() & onAttachment() events for now.
- Can we have beginWikiPage() followed by endWikiPage()
beginAttachment() and endAttachment() rather than having a single
onWikiPage(),onAttachment() in the WikiImporterListener.
If you plan to have something like
beginWikiPage(name)
beginObject(type)
onProperty(name, value, ...)
endObject()
beginObject()
onProperty()
endObject()
beginAttachment(name)
endAttachment()
endWikiPage()
+1 it's a good idea, now i'm not sure why you need begin and end for
an attachment, what other events would you have inside it ?
Because even it has few properties and revisions.
Kindly correct me, if am wrong.