[ http://jira.magnolia.info/browse/MAGNOLIA-1659?page=all ]
Fabrizio Giustina updated MAGNOLIA-1659:
----------------------------------------
Fix Version/s: 3.1 M4
(was: 3.1)
Description:
(related to the new update mechanism, MAGNOLIA-1602 )
at this moment the registration of new workspaces (also repositories/nodetypes)
only happens during bootstrap and it's implemented by rewriting the
repositories.xml file that will be loaded at system restart.
This should not be needed, we have all the APIs we need to register new
repositories/workspaces without changing such xml file...
I propose to change the current implementation by making repositories declared
in the module definition always checked. These are the steps that should be
always performed while loading a module:
- check if a declared repository exists -> if not create/load it in memory with
default values (as it happens now on the repositories.xml file)
- check if nodetypes already exist -> if not create them (better than now, this
will auto-fix repositories where the nodetype definition is wrong/not complete)
- check if workspace exists -> if not create it
I see several benefits in doing it this way: no restart needed, cleaner
implementation and removal of the last bit that still rewrite a user
configuration file. It should not have any drawback (if you want to tune your
configuration you can still add a repository/workspace configuration to
repositories.xml as before)
was:
(related to the new update mechanism, MAGNOLIA-1602 )
at this moment the registration of new workspaces (also repositories/nodetypes)
only happens during bootstrap and it's implemented by rewriting the
repositories.xml file that will be loaded at system restart.
This should not be needed, we have all the APIs we need to register new
repositories/workspaces without changing such xml file...
I propose to change the current implementation by making repositories declared
in the module definition always checked. These are the steps that should be
always performed while loading a module:
- check if a declared repository exists -> if not create/load it in memory with
default values (as it happens now on the repositories.xml file)
- check if nodetypes already exist -> if not create them (better than now, this
will auto-fix repositories where the nodetype definition is wrong/not complete)
- check if workspace exists -> if not create it
I see several benefits in doing it this way: no restart needed, cleaner
implementation and removal of the last bit that still rewrite a user
configuration file. It should not have any drawback (if you want to tune your
configuration you can still add a repository/workspace configuration to
repositories.xml as before)
first draft in svn:
now repositories, workspaces and nodetypes are loaded directly from the
definition in module's xml, without having to modify repositories.xml anymore.
All the setup is performed in ModuleManagerImpl, the previous methods in
ModuleUtil have been deprecated and don't do anything now (a warn is logged).
Repositories/workspaces/nodetypes needs to be loaded always at startup; if
modules need to be installed/updated this is also the firts step to be done.
For this reason this step is NOT performed as an update task but it's managed
internally by ModuleManager. Everything is done in the method
loadRepositories().
At this moment the logic is:
- if there are no modules that need install or update
-> load repositories directly in checkForInstallOrUpdates()
- if updates are needed
-> load repositories in performInstallOrUpdate()
this means that the creation of repositories is only performed after the user
confirmation during an update, and also speedup the loading of magnolia itself.
The repository loading in checkForInstallOrUpdates()() could not look so nice,
but the only alternative solution is to add another public method/phase that
should be called by the config loader.
Note also that:
- the existing repository registration task have been renamed: now it only
perform the initial bootstrap of empty workspaces and assigns permissions to
the the superuser role (those tasks were already there, after workspace
registration
- nodetypes are always manually checked/registered, this should improve the
consistency of repositories
- when you remove a module their repositories are automatically discarded (not
loaded anymore)... now it's a lot easier to remove a module, you don't have to
manually rollback the repositories.xml file anymore
ready for feedbak
> always register repositories, nodetypes and workspaces from module definitions
> ------------------------------------------------------------------------------
>
> Key: MAGNOLIA-1659
> URL: http://jira.magnolia.info/browse/MAGNOLIA-1659
> Project: Magnolia
> Issue Type: Improvement
> Components: core
> Affects Versions: 3.1 M1
> Reporter: Fabrizio Giustina
> Assigned To: Sameer Charles
> Fix For: 3.1 M4
>
>
> (related to the new update mechanism, MAGNOLIA-1602 )
> at this moment the registration of new workspaces (also
> repositories/nodetypes) only happens during bootstrap and it's implemented by
> rewriting the repositories.xml file that will be loaded at system restart.
> This should not be needed, we have all the APIs we need to register new
> repositories/workspaces without changing such xml file...
> I propose to change the current implementation by making repositories
> declared in the module definition always checked. These are the steps that
> should be always performed while loading a module:
> - check if a declared repository exists -> if not create/load it in memory
> with default values (as it happens now on the repositories.xml file)
> - check if nodetypes already exist -> if not create them (better than now,
> this will auto-fix repositories where the nodetype definition is wrong/not
> complete)
> - check if workspace exists -> if not create it
> I see several benefits in doing it this way: no restart needed, cleaner
> implementation and removal of the last bit that still rewrite a user
> configuration file. It should not have any drawback (if you want to tune your
> configuration you can still add a repository/workspace configuration to
> repositories.xml as before)
>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.magnolia.info/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
----------------------------------------------------------------
for list details see
http://documentation.magnolia.info/docs/en/editor/stayupdated.html
----------------------------------------------------------------