On Mon, Jan 9, 2012 at 10:39 AM, Vincent Massol <[email protected]> wrote:
>
> On Jan 9, 2012, at 9:09 AM, Marius Dumitru Florea wrote:
>
>> On Sat, Jan 7, 2012 at 4:49 PM, Vincent Massol <[email protected]> wrote:
>>> Hi Marius,
>>>
>>> I think the display module should be independent of the Velocity module.
>>>
>>> I see that the VelocityManager is used in DocumentContentDisplayer but I 
>>> don't think that's nice. It's used to isolate the velocity context in case 
>>> velocity is used. I think we can improve this for the following reasons:
>>>
>>> 1) We don't always need to render content using velocity
>>> 2) Code using the displayer shouldn't need to depend on velocity if it 
>>> doesn't need to
>>>
>>> I think a better solution would be to have some generic component interface 
>>> for isolating content (we might already have this) and then have the 
>>> displayer call "registered" components without knowing them.
>>>
>>> This would mean that the code isolating the velocity namespace would be 
>>> located in the velocity module itself for ex (or in a sub module) which 
>>> makes more sense IMO.
>>>
>>> WDYT?
>>
>> I agree. I don't remember seeing such an interface in the platform.
>> Why do you think we might have it already?
>
> I think I was referring to execution context isolation code we already have. 
> I've just looked at the code now and see I was thinking about 
> ExecutionContextInitializer.
>
> It's probably different though.

> I haven't read the Display module code but it's probably already using 
> ExecutionContextManager to clone the execution context when displaying in 
> isolation

No, the display module uses DAB#pushDocumentInContext(...) and
DAB#popDocumentFromContext(...), which use the
ExecutionContextManager.

> (btw shouldn't that be always the case since otherwise it's called an 
> include?).

No. When you display a sheet, you don't want the execution context to
be isolated. You want the sheet to be rendered in the context of the
"displayed" document (I quoted "displayed" because the displayed
document is actually the sheet). And you can't say that the sheet is
*included* in the "displayed" document. There's no inclusion. It's
more like a forward, but not entirely, because the context is
preserved.

>
> Thanks
> -Vincent
>
> _______________________________________________
> devs mailing list
> [email protected]
> http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to