Hi Ryan,
Ryan Gardner wrote:
I think that the data module should really have some kind of mechanism
built-in to handle this.
Yes, I think the same...
Has anyone come up with an easy solution yet?
I really need this feature, so I wrote a DataModuleInitializer, which
will be called after magnolia has been booted (else you would have some
strange runtime exceptions). Therefor I added my initializer into the
web.xml just after the MgnlServletContextListener.
The initializer looks like this:
public class DataModuleInitializer implements ServletContextListener
private int importUUIDBehavior =
ImportUUIDBehavior.IMPORT_UUID_COLLISION_REPLACE_EXISTING;
String[] resources = {"/data-bootstrap/data.xml"};
public void contextInitialized(ServletContextEvent sce) {
try {
ModuleUtil.bootstrap(resources, true, importUUIDBehavior);
} catch (Exception e) {
e.printStackTrace();
}
}
If you have a better solution please let me know.
Regards,
Patrick
----------------------------------------------------------------
for list details see
http://documentation.magnolia.info/docs/en/editor/stayupdated.html
----------------------------------------------------------------