Implement rootPrototype app property that allows to force-set the root object prototype.
This commit is contained in:
parent
95dd5feb63
commit
70eb0c5e5d
1 changed files with 8 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue