diff --git a/src/helma/doc/DocElement.java b/src/helma/doc/DocElement.java index 151a77c7..0a5094ac 100644 --- a/src/helma/doc/DocElement.java +++ b/src/helma/doc/DocElement.java @@ -250,6 +250,21 @@ public abstract class DocElement implements IPathElement { return arr; } + /** + * walks up the tree and tries to find a DocApplication object + */ + public DocApplication getDocApplication () { + DocElement el = this; + while (el != null) { + if (el instanceof DocApplication) { + return (DocApplication) el; + } + el = (DocElement) el.getParentElement (); + } + return null; + } + + /** * from helma.framework.IPathElement. Elements are named * like this: typename_name