diff --git a/src/helma/doc/DocApplication.java b/src/helma/doc/DocApplication.java index a9074f34..b5f05483 100644 --- a/src/helma/doc/DocApplication.java +++ b/src/helma/doc/DocApplication.java @@ -18,7 +18,7 @@ package helma.doc; import helma.framework.IPathElement; import helma.framework.core.Application; -import helma.framework.repository.FileRepository; +import helma.framework.core.Prototype; import helma.main.Server; import helma.util.ResourceProperties; import java.io.*; @@ -40,60 +40,11 @@ public class DocApplication extends DocElement { * @throws DocException ... */ public DocApplication(Application app) throws DocException { - super(app.getName(), app.getAppDir(), APPLICATION); + super(app.getName(), APPLICATION); this.app = app; readProps(); } - /** - * Creates a new DocApplication object. - * - * @param name ... - * @param appDir ... - * - * @throws DocException ... - */ - public DocApplication(String name, String appDir) throws DocException { - super(name, new File(appDir), APPLICATION); - readProps(); - } - - /** - * - * - * @param args ... - */ - /* public static void main(String[] args) { - System.out.println("this is helma.doc"); - DocApplication app; - app = new DocApplication (args[0], args[1]); - app.readApplication (); - - // DocPrototype el = DocPrototype.newInstance (new File(args[0])); - // el.readFiles (); - // DocFunction func = DocFunction.newTemplate (new File(args[0])); - -// DocFunction func = DocFunction.newAction (new File(args[0])); - -// DocFunction[] func = DocFunction.newFunctions(new File(args[0])); -// for (int i=0; i start.y) && (ct < end.y)) { - buf.append(line + "\n"); + buf.append(line).append("\n"); } else if (ct == start.y) { if (start.y==end.y) { buf.append (line.substring (start.x, end.x)); break; } else { - buf.append(line.substring(start.x, line.length()) + "\n"); + buf.append(line.substring(start.x, line.length())).append("\n"); } } else if (ct == end.y) { buf.append(line.substring(0, end.x)); @@ -173,23 +147,4 @@ public final class Util { } } - - - /** - * extracts the function name from a file. basically chops the given suffix - * and throws an error if the file name doesn't fit. - */ - public static String nameFromFile(File f, String suffix) - throws DocException { - String filename = f.getName(); - - if (!filename.endsWith(suffix)) { - throw new DocException("file doesn't have suffix " + suffix + ": " + - f.toString()); - } - - return filename.substring(0, filename.lastIndexOf(suffix)); - } - - } diff --git a/src/helma/scripting/rhino/RhinoEngine.java b/src/helma/scripting/rhino/RhinoEngine.java index f61e07e6..b24e6543 100644 --- a/src/helma/scripting/rhino/RhinoEngine.java +++ b/src/helma/scripting/rhino/RhinoEngine.java @@ -449,8 +449,12 @@ public class RhinoEngine implements ScriptingEngine { */ public IPathElement getIntrospector() { if (doc == null) { - doc = new DocApplication(app); - doc.readApplication(); + try { + doc = new DocApplication(app); + doc.readApplication(); + } catch (IOException x) { + throw new RuntimeException(x.toString()); + } } return doc; }