Hi Matteo,
The behavior you observe and describe is exactly how the version
handling mechanism is intended to work. It knows about the current
version (ie the last one to be succesfully installed) because that
version number is simply sorted as a property of the module's node in
the configuration workspace. From there, it deducts which deltas need
to be applied.
... and this is exactly how your module could be able to upgrade/
maintain itself and its own configuration. With every release of your
module, you'll add the appropriate tasks to modify the configuration
as needed, and voila.
hth,
-g
On Dec 30, 2008, at 4:59 PM, Matteo Pelucco wrote:
Hi all..
I'm trying to fulfill this requirement:
* a module should be self upgradable, even as regards configuration.
For this reason, I would like to use a version handler, but I can
not understand the behaviour of this code:
**********************************************************************
public MyModuleVersionHandler() {
super();
Delta delta133 = DeltaBuilder.update("1.3.3", "").addTask(new
NotifyTask("1.3.3", ""));
Delta delta134 = DeltaBuilder.update("1.3.4", "").addTask(new
NotifyTask("1.3.4", ""));
Delta delta135 = DeltaBuilder.update("1.3.5", "").addTask(new
NotifyTask("1.3.5", ""));
Delta delta136 = DeltaBuilder.update("1.3.6", "").addTask(new
NotifyTask("1.3.6", ""));
System.out.println(" ...registering delta133... ");
register(delta133);
System.out.println(" ...registering delta134... ");
register(delta134);
System.out.println(" ...registering delta135... ");
register(delta135);
System.out.println(" ...registering delta136... ");
register(delta136);
}
**********************************************************************
NotifyTask is a task I made, with a simple System.out.println (name
+ version) into execute() method.
**********************************************************************
FIrst time I added delta133, delta134 and delta135. All has been
executed when module jar has been replaced.
Without changing anything, they stop to execute.
I added next delta136 task.
Repack the jar and reboot.
Only delta136 has been executed.
Is there maybe a sort of "task history"?
Where?
Thanks for your help..
Matteo
----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------
----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------