Hi Vincent,
Vincent Massol wrote:
Hi Florin,
On Oct 31, 2008, at 10:56 AM, Florin Ciubotaru wrote:
Hi devs,
We currently have a comments plug-in that is written for a custom
core. This plug-in enables us to have hierarchical comments and
several
storage implementations.
This sounds very cool (threaded comments have been asked several
times). Can you give more information:
* Where is it located?
* Is there a design page for it or at least what's the full spec for it?
* What's your roadmap for it?
The plug-in was written initially by Raluca and Ludovic and is located
here:
-
https://svn.xwiki.org/svnroot/xwiki/sandbox/plugins/comments/
There was an old design page for it but it was outdated and afterwards
deleted. Now we have only a layout design page, here:
-
http://dev.xwiki.org/xwiki/bin/view/Design/NewCommentsImplementation
The first thing we should do is to see how we can integrate it with the
platform. Ludovic made a patch for the core, can you review it and see
if you can apply it?
I need to finish the test suite for it and do some refactoring.
My intention is to rewrite the plug-in into a component but I'm starting
to doubt that I can do that at the moment.
The issue I encounter when rewriting it to a
plexus component is
that I
cannot make it independent from the core. I need both read and write
access to the storage, and I could not find a bridge to it. All I
can do
is retrieve data, with org.xwiki.bridge.DocumentAccessBridge and
org.xwiki.bridge.DocumentModelBridge, but not write data.
Does anybody know how can I write a component that needs read/write
access to the storage without using XWiki,XWikiDocument and
XWikiContext
classes?
For now you'll need to add methods to the bridge as I don't think
Artem has done the conversion of the storage to proper (i.e. using the
new architecture and not the old xwiki context one) components.
As we approach XWiki 2.0 we should put more effort into creating the
bridges that we need, so that will have a fully component oriented
architecture.
The problem is that we cannot create really powerful components, right
now. I think we should avoid using 1.0 elements in the new components.
The only things that we should change, when breaking the core into
pieces, are the bridge components implementation. This also applies for
the storage and other changes.
I see two options:
1) We first analyze what bridges we need and start developing them. And
only after that we switch to heavy implementation of components;
2) We write and enrich the bridges on the fly as we create new components.
Which do you think is the best one?
Definitely 2. This is the strategy we use already. The motivation is that:
Bridges should be a temporary workaround until we have the time to
implement the actual components. But we don't want to waste too much
time on the bridges, since this time would be better spent writing the
components themselves. Also, we don't want to have to change too much
code once the bridges are no longer needed, so the bridge interface
should be as similar as possible to the future components. But since we
don't know how the components will really look, we can only estimate,
and the less we have to estimate, the more likely we won't have
discrepancies. Thus the minimality + on the fly approach to writing bridges.