I've already implemented the dynamic registration of workspaces, so
that restarting and modification of repositories.xml is not needed
anymore.
I think this goes definitely into the right direction

Now I'm only lost with the module update APIs in order to understand
where we should put this kind of operation that should be executed
every time a module is loaded...

Not sure if you are looking for this: the module can implement the ModuleLifeCycle interface (add start() stop() method).

We could add a init() method (called before start, but after update and install) but not sure if this is what we are looking for. It should definitely not be part of the VersionHandler since it is only responsible for installation and update.

For this special case it might be better to put this 'init-repository- and-workspaces' code to a third party class.

The module descriptors are available from the ModuleRegistry.

Question 1 is: do you think that this should be part of the update
APIs since it's not actually an update task anymore but simply a
standard step in module loading? (my answer should probably be no, but
I need a review from the author of the update mechanism ;) )
No

Question 2: if not, where to put it? Or if yes, is there any way to
supply an update tasks that it's always executed and that doesn't
trigger the pop up of the new update UI?

I suspect that we have to do this phases

- read descriptors
- init repositories
- install and update
- ..

Some days ago Gregory and I had a discussion about needing even more phases.

- init minimal system
- read descriptors
- install and update (phase one)
- init repositories
- install and update (phase two)
- start system
- ..

at this moment I've implemented it by rewriting
ModuleUtil.registerWorkspace() and by always return a Delta with the
RegisterRepositoriesNodetypesAndWorkspacesTask in
AbstractModuleVersionHandler.getDeltas() just to confirm that it works
without problems... the actual registration of workspaces is fine, so
I can commit it as soon as I find a place where to trigger it.

Let's wait for a comment of Gregory ;-)

Philipp



----------------------------------------------------------------
for list details see
http://documentation.magnolia.info/docs/en/editor/stayupdated.html
----------------------------------------------------------------

Reply via email to