From 131ae0c6a935eeb6e01cdff7611a0fe3f761bb00 Mon Sep 17 00:00:00 2001 From: hns Date: Wed, 25 Sep 2002 17:36:49 +0000 Subject: [PATCH] Fixed handling of type.properties entries and creation of DbMappings. Not fixed all the way, though - still needs some work. --- src/helma/framework/core/ZippedAppFile.java | 53 +++++---------------- 1 file changed, 12 insertions(+), 41 deletions(-) diff --git a/src/helma/framework/core/ZippedAppFile.java b/src/helma/framework/core/ZippedAppFile.java index c7ad03b1..a59f5389 100644 --- a/src/helma/framework/core/ZippedAppFile.java +++ b/src/helma/framework/core/ZippedAppFile.java @@ -104,9 +104,17 @@ public class ZippedAppFile implements Updatable { } else if ("type.properties".equalsIgnoreCase (fname)) { String name = fname.substring (0, fname.lastIndexOf (".")); - SystemProperties props = new SystemProperties (zip.getInputStream (entry)); - // DbMapping does its own registering, just construct it. - new DbMapping (app, proto.getName (), props); + DbMapping dbmap = proto.getDbMapping (); + if (dbmap == null) { + SystemProperties props = new SystemProperties (zip.getInputStream (entry)); + dbmap = new DbMapping (app, proto.getName (), props); + proto.setDbMapping (dbmap); + } else { + // FIXME: provide a way to let zip files add to + // type.properties files of existing prototypes. + // SystemProperties props = dbmap.getProperties (); + // props.add (zip.getInputStream (entry)); + } // mark prototype as updated proto.markUpdated (); } @@ -114,10 +122,9 @@ public class ZippedAppFile implements Updatable { } for (Iterator it = newPrototypes.iterator (); it.hasNext (); ) { Prototype proto = (Prototype) it.next (); - if (app.getDbMapping (proto.getName ()) == null) { + if (proto.getDbMapping() == null) { // DbMapping doesn't exist, we still need to create one SystemProperties props = new SystemProperties (); - // DbMapping does its own registering, just construct it. proto.setDbMapping (new DbMapping (app, proto.getName (), props)); } } @@ -156,39 +163,3 @@ public class ZippedAppFile implements Updatable { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -