Hi Jerome,

Thanks for jumping in.

On Mon, Sep 19, 2011 at 6:37 PM, Jerome Velociter <[email protected]> wrote:
> Hi Marius
>
> On Mon, Sep 19, 2011 at 4:34 PM, Marius Dumitru Florea <
> [email protected]> wrote:
>
>> Hi devs,
>>
>> Here's the sheet resolution algorithm I have implemented in
>>
>> https://github.com/xwiki/xwiki-platform/blob/cbad868094b9cc9d811621670e320596ddb2f495/xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/internal/sheet/DefaultSheetManager.java
>> .
>>
>> getSheets(document, action) : List<DocumentReference>
>>
>> (1) If there is a "sheet" request parameter that points to a sheet
>> that supports the passed action, return a reference to that sheet.
>>
>> (2) For each object of type XWiki.DocumentSheetBinding attached to the
>> passed document check if the "sheet" property points to a sheet that
>> supports the passed action. Return the computed list, if not empty.
>>
>> (3) For each type of object attached to the passed document:
>>
>>    (3.1) For each object of type XWiki.ClassSheetBinding attached to
>> the document defining the class check if the "sheet" property points
>> to a sheet that supports the passed action.
>>    (3.2) If the class doesn't have any XWiki.ClassSheetBinding object
>> then check if <ClassName><ActionName>Sheet exists
>>    (3.3) If not, then check if <ClassName>Sheet exists and supports
>> the passed action
>>    (3.4) If not, then check if "sheet.defaultClassSheetBinding"
>> configuration property specifies a sheet for the class we're looking
>> at
>>
>> Return the computed list if not empty.
>>
>> (4) If the passed document is a class (holds a class definition) then
>> return a reference to the default class sheet (XWiki.ClassSheet) if it
>> supports the passed action.
>>
>> Otherwise return an empty list.
>>
>

> Question : how do you order the display of sheets. Is this out of scope of
> the sheet manager ? (I am especially interested in ordering of multiple
> results in step 3.1)

As I was telling to Denis, this is not the topic of this mail.
SheetManager returns the list of sheets and DocumentDisplayer
(hint=sheet) chooses which sheet to apply. Currently,
SheetDocumentDisplayer applies the first sheet the current user has
the right to view. We can discuss about this in a different mail if
you think there are better implementations. At one point I was
considering aggregating the sheets (i.e. display them one after
another, in the order they appear in the list returned by the
SheetManager) but I preferred to have a simple implementation in 3.2.

Thanks,
Marius

>
> Jerome.
>
>>
>> I'd like you to vote on each of the steps of the algorithm. Are there
>> steps you think I should drop?
>>
>
>> I'm obviously +1 for each of the steps.
>>
>> Thanks,
>> Marius
>> _______________________________________________
>> devs mailing list
>> [email protected]
>> http://lists.xwiki.org/mailman/listinfo/devs
>>
>
>
>
> --
> Jérôme Velociter
> Winesquare
> http://www.winesquare.net/
> _______________________________________________
> 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