From e8e2c7098a88bd79c8f7e018a1344e7a0f492252 Mon Sep 17 00:00:00 2001 From: stefanp Date: Tue, 6 Jan 2004 15:55:39 +0000 Subject: [PATCH] added function renderApi(appName) which can be used from commandline --- Root/functions.js | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/Root/functions.js b/Root/functions.js index 342e79ea..b5c26f9e 100644 --- a/Root/functions.js +++ b/Root/functions.js @@ -1,10 +1,26 @@ /** - * of no use, just to avoid error message + * renders the api of a given application. used from commandline. */ -function onRequest () { +function renderApi(appName) { + + // supress security checks when accessing actions + res.data.noWeb = true; + + // start the application + this.startApplication(appName); + var appObj = this.getApp(appName); + var docApp = appObj.getChildElement("api"); + + // now render the api + var ct = docApp.renderApi(); + writeln("rendered " + ct + " files"); + + // cleanup + this.stopApplication(appName); } + /** * lists all applications in appdir. * for active apps use this.getApplications() = helma.main.Server.getApplications()