You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Simon Mieth <si...@t-online.de> on 2003/12/08 15:38:49 UTC
[CocoonBean] recycle?
Hi all (Upayavira ;-) ),
i use the CocoonBean for a OfflineCMS-System,
which (CocoonBean) works fine. I would like rebuild
pipelines without creating new instances of cocoon.
For new pipelines it works, but for already build pipelines
it fails.
In my case, i added a recycle() method to CocoonBean like:
public void recycle(){
this.crawler = new Crawler();
//checksums-test can be switched on/off
//with setChecksumURI(uri or null)?
}
is something like this in CocoonBean, or will this break
something?
With recycle() it works much faster, because cocoon is
started up already.
BTW: the Checksum and page-reporting stuff works fine,
thanks.
Best regards,
Simon
Re: [CocoonBean] recycle?
Posted by Simon Mieth <si...@t-online.de>.
On Sun, 14 Dec 2003 08:05:52 +0000
Upayavira <uv...@upaya.co.uk> wrote:
> Thinking about this, it occurs to me that what your
> 'recycle' method does is to remove all targets, rather
> than recycle the component.
>
> Therefore, I'd suggest we have a method called something
> like removeTargets() that does crawler = new Crawler();
>
> Regards, Upayavira
>
Hi Upayavira,
sounds clearer now. I looked in CocoonBean-source the last
days and it looks like there are only the
exclude-/includePattern not available for remove/change. All
other things can be setXXX().
I don't use the include/excludePattern, but a
removeXXcludePattern may be usefull in some cases too.
Best regards,
Simon
Re: [CocoonBean] recycle?
Posted by Upayavira <uv...@upaya.co.uk>.
Simon Mieth wrote:
>Hi again,
>
>i forgot, the CocoonBean setup like ContextDir is the same
>and a changes are ignored, this needs a new cocoon-instance.
>
>So the "recycle" only works with the initialized Context.
>
>Maybe there is a better name as "recycle" to protect
>confusion about the interface from Avalon.
>
>Best Regards,
>
>Simon
>
>
>
Thinking about this, it occurs to me that what your 'recycle' method
does is to remove all targets, rather than recycle the component.
Therefore, I'd suggest we have a method called something like
removeTargets() that does crawler = new Crawler();
Regards, Upayavira
Re: [CocoonBean] recycle?
Posted by Simon Mieth <si...@t-online.de>.
Hi again,
i forgot, the CocoonBean setup like ContextDir is the same
and a changes are ignored, this needs a new cocoon-instance.
So the "recycle" only works with the initialized Context.
Maybe there is a better name as "recycle" to protect
confusion about the interface from Avalon.
Best Regards,
Simon
Re: [CocoonBean] recycle?
Posted by Simon Mieth <si...@t-online.de>.
On Mon, 08 Dec 2003 15:00:02 +0000
Upayavira <uv...@upaya.co.uk> wrote:
> Are you really sure that this.crawler = new Crawler() is
> all that is needed? If so, then that's great.
>
In my case, i'm sure. By processing the Crawler iterates
through the targets, remove from stillNotVisited and put
they to visitedAlready.
If i will now rebuild the pipeline i add the URI as a new
target to CocoonBean, but the Crawler ignores this, because
the uri is in "visitedAlready".
So if i will rebuild the pipeline i need a empty Crawler,
which now reports correct the generated pages for this
process-session.
What i do, is:
addTarget(uri1)
addTarget(uri2)
process()
//change the documents
recycle()
addTarget(uri1)
addTarget(uri2)
process()
and it works now with recycle() without create a new
cocoon-instance, as before.
In my case it looks, as it works, but not i'm sure, if it
works for all ;-) .
> Note, this would not be an implementation of an interface,
> as the CocoonBean is not an Avalon component. It would
> just be a convenience method.
>
> I'm happy to add it. Any objections anyone?
>
> Regards, Upayavira
>
> >BTW: the Checksum and page-reporting stuff works fine,
> >thanks.
> >
> >
> Great. Maybe I should document it!
>
> Regards, Upayavira
With the page/link-reporting a have build a progressbar, so
everybody can see the page-building, thats really fine,
thanks again.
Best regards,
Simon
Re: [CocoonBean] recycle?
Posted by Upayavira <uv...@upaya.co.uk>.
Simon Mieth wrote:
>Hi all (Upayavira ;-) ),
>
>
>i use the CocoonBean for a OfflineCMS-System,
>which (CocoonBean) works fine. I would like rebuild
>pipelines without creating new instances of cocoon.
>For new pipelines it works, but for already build pipelines
>it fails.
>
>In my case, i added a recycle() method to CocoonBean like:
>
> public void recycle(){
>
> this.crawler = new Crawler();
>
> //checksums-test can be switched on/off
> //with setChecksumURI(uri or null)?
> }
>
>is something like this in CocoonBean, or will this break
>something?
>
>With recycle() it works much faster, because cocoon is
>started up already.
>
>
There is no recycle method in there, but I see no reason not to add one.
Are you really sure that this.crawler = new Crawler() is all that is
needed? If so, then that's great.
Note, this would not be an implementation of an interface, as the
CocoonBean is not an Avalon component. It would just be a convenience
method.
I'm happy to add it. Any objections anyone?
Regards, Upayavira
>BTW: the Checksum and page-reporting stuff works fine,
>thanks.
>
>
Great. Maybe I should document it!
Regards, Upayavira