Fixed handling of type.properties entries and creation of DbMappings.

Not fixed all the way, though - still needs some work.
This commit is contained in:
hns 2002-09-25 17:36:49 +00:00
parent 5a6f044c40
commit 131ae0c6a9

View file

@ -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 {