From 70eb0c5e5db29a22e79a3f5315a23f6f119cc5ad Mon Sep 17 00:00:00 2001 From: hns Date: Thu, 12 May 2005 16:16:39 +0000 Subject: [PATCH] Implement rootPrototype app property that allows to force-set the root object prototype. --- src/helma/framework/core/Application.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/helma/framework/core/Application.java b/src/helma/framework/core/Application.java index 8a220d8a..5ec4edba 100644 --- a/src/helma/framework/core/Application.java +++ b/src/helma/framework/core/Application.java @@ -755,9 +755,14 @@ public final class Application implements IPathElement, Runnable { // no custom root object is defined - use standard helma objectmodel else { String rootId = props.getProperty("rootid", "0"); - rootObject = nmgr.safe.getNode(rootId, rootMapping); - - return rootObject; + Node rootNode = nmgr.safe.getNode(rootId, rootMapping); + // set the root node's prototype, if requested by rootPrototype property + String rootProto = props.getProperty("rootprototype"); + if (rootProto != null && !rootProto.equals(rootNode.getPrototype())) { + rootNode.setPrototype(rootProto); + rootNode.setDbMapping(getDbMapping(rootProto)); + } + return rootNode; } }