Hi devs,
Here's the sheet resolution algorithm I have implemented in
https://github.com/xwiki/xwiki-platform/blob/cbad868094b9cc9d811621670e3205…
.
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.
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