On the subject of ordering resources contributed from several modules, and actions are a typical example, I would like to contribute the following thoughts.

Basically, I think integer-based ordering is a bad idea, because in effect it means all modules have to be "aware" of a common namespace, the integers, and know what a given position means. If I want to be after the workflows tabs do I have to have order 15 or 20? How do I know that workflows are at position 5? And how can I change that in another component?

To go around that, here's what I can think of:

1. Each component when it defines a new resource ("relation" tab for instance), specifies that it has to go before or after some other resource, or that its order is not important. This means that the resource registry will have to do a graph-based resolution to determine a final ordering.

2. A "toplevel" component (like Nuxeo 5) has authority and decides the relative order of resources, so specifies that we have overview then edit then workflow then relations etc. If a resource is nonexistent, it is ignored. If a resource is not mentioned, it is put at the end. That's what was done in CPSSkins to decide the preferred order of actions for instance.

3. Point 1. is probably not flexible enough, so overrides will be necessary. We could see the point 2. as the highest-level override. When several overrides exist, they themselves have to be ordered (we had the same problem with ZCML overrides in CPS 3).

Quick proposal maybe not completely though out :) :

In NXRelations extensions:
<extension target="org.nuxeo.ecm.platform.ec.actions.WebActionService" point="order">
  <order by="RELATIONS" id="TAB_RELATIONS" after="TAB_WORKFLOWS"/>
<!-- also before="" is possible, and several constraints can be expressed -->
</extension>

And in Nuxeo extensions if we want to override that:
<extension target="org.nuxeo.ecm.platform.ec.actions.WebActionService" point="order"> <order by="NUXEO" override="RELATIONS" id="TAB_RELATIONS" after="TAB_EDIT"/>
</extension>

It's possible that the override= is unnecessary and can be inferred from underlying OSGi deployment order, I don't know.


I can go on more about the resolution algorithm I'm thinking of if there's interest.

Florent


On 8 Dec 2006, at 23:55, Bogdan Stefanescu wrote:

HI all,

I've created a new project NXRelationsWeb that contains the web interface for the Relations module.
(actions, xhtml, faces-config settings etc)
Relations web resources was removed from Nuxeo project so you need checkout and deploy this new project.

When the NXRealtionsWeb is deployed you have a new TAB (Relations) and when removed from the nuxeo.nxp EAR
the TAB disappear.

Translations are not yet integrated - I will do this tomorrow

Anyway there is a little problem with contributed actions .. the Relation TAB is inserted on position 0 before other TABS. To fix this we need to use the order parameter of the action and sort returned actions.


--
Florent Guillaume, Director of R&D, Nuxeo
Open Source Enterprise Content Management (ECM)
http://www.nuxeo.com   http://www.nuxeo.org   +33 1 40 33 79 87


_______________________________________________
ECM mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm

Reply via email to