Object | +--app
| SUMMARY: Constructor | Properties | Methods | DETAIL: Constructor | Properties | Methods |
| Properties Summary | |
Application |
__app__
This property contains a reference this application's instance of the Packages.helma.framework.core.Application class. |
Object |
data
Object that serves as a cache for application specific data. |
String[] |
globalMacroPath
The app.globalMacroPath property allows to define a search path for global macros. |
Number |
maxThreads
This property contains the maximum number of additional threads (=request evaluators) The maximum number of additional threads that are being created by Helma to handle incoming requests. |
Map |
modules
Map object that can be used as an application wide data cache This property offers a dedicated place to store module-related data on an application wide level. |
Function |
processMacroParameter
This allows the application to set a callback function for pre-processing macro parameters formatted as $(...). |
Map |
properties
Map of any specified application or server properties This property offers access to each key/value pair defined in either app.properties or in server.properties. |
Array |
repositories
List of the application's code repositories This property offers a dedicated place to store module-related data on an application wide level. |
| Methods Summary | |
void
|
addCronJob(functionNameAsString, year, month, day, weekday, hour, minute)
Adds a global function to the list of CronJobs that are being called periodically. |
void
|
addRepository(<String> repository)
Adds a code repository to the current application |
void
|
clearCache()
Removes all objects from the object cache for the current application. |
Number
|
countSessions()
Returns the number of currently active sessions. |
SessionObject
|
createSession(sessionID)
Creates a SessionObject with the passed sessionID as its unique identifier. |
void
|
debug(<String> filenameOrText,<String> text)
Writes a string to a log file if debug is set to true in app.properties. |
Number
|
getActiveThreads()
Returns the number of currently active threads (=request evaluators). |
Array
|
getActiveUsers()
Returns an array of Users, that are currently logged in. |
String
|
getAppDir()
Returns the absolute path to the application directory. |
Number
|
getCacheUsage()
Returns the number of currently cached objects for the current application. |
Object
|
getCronJobs()
Returns an object of scheduled cron jobs. |
String
|
getDir()
Returns the absolute path to the application directory. |
Number
|
getErrorCount()
Returns the number of errors that have occurred since the application has been started. |
Number
|
getFreeThreads()
Returns the number of currently free threads (i.e. |
Number
|
getMaxThreads()
Returns the maximum number of threads (i.e. |
String
|
getName()
Returns the name of the current application, i.e. |
Array
|
getRegisteredUsers()
Returns an array of all existing users. |
Number
|
getRequestCount()
Returns the number of web requests that occurred since the application has been started. |
String
|
getServerDir()
Returns the absolute path to the home directory of this Helma installation. |
SessionObject
|
getSession(<String> sessionID)
Returns a SessionObject identified through the passed sessionID, if such a session exists. |
Array
|
getSessions()
Returns an array of all currently active sessions, represented as SessionObjects. |
Array
|
getSessionsForUser(<User> user)
Returns an array of active sessions for the specified user Returns an array of all currently active sessions, which have been associated with the passed User. |
Map
|
getSkinfiles()
Returns a Map that allows access to all defined file-based skins. |
Date
|
getUpSince()
Returns the timestamp of when that application has been started. |
User
|
getUser(<String> username)
Returns a User identified through the passed username. |
Number
|
getXmlrpcCount()
Returns the number of XmlRpc requests that occurred since the application has been started. |
Object
|
invoke(<Object> thisObject,<Function> fnc,<Array> args,<Number> timeout)
Trigger a synchronous Helma invocation. |
Object
|
invokeAsync(<Object> thisObject,<Function> fnc,<Array> args,<Number> timeout)
Trigger an asynchronous Helma invocation. |
void
|
log(<String> filenameOrText,<String> text)
Writes a string to a log file. |
User
|
registerUser(<String> username, <String> password)
Creates a new User object Creates a new HopObject of prototype User, stores it persistently, and returns the created User object. When mapping the User prototype to a relational database, the type.properties file must contain mappings for the '_name'-property (the username) and for a property named 'password'. |
void
|
removeCronJob(<String> functionName)
Removes a CronJob, identified through the passed function name, from the list of CronJobs. |
| Properties Detail |
Application __app__
Object data
app.data.runlevel = 4; app.data.language = "en"; res.write(app.data); TransientNode app for (var p in app.data) res.writeln(p + ": " + app.data[p]); runlevel: 4 language: en res.write(app.data.runlevel); 4 res.write(app.data["language"]); en
String[] globalMacroPath
Number maxThreads
Map modules
Function processMacroParameter
Map properties
# File app.properties:
debug = true
color = #ffcc00
res.write(app.properties);
{debug=true,color=#ffcc00}
for (var p in app.properties)
res.writeln(p + ": " + app.properties[p]);
debug: true
color: #ffcc00
res.write(app.properties.debug);
true
res.write(app.properties["color"]);
#ffcc00
Array repositories
| Method Detail |
void addCronJob(functionNameAsString, year, month, day, weekday, hour, minute)
functionName - as String, name of function to be scheduled as cron job
crontab - syntax of comma delimited arguments for year, month, day, weekday, hour, minute
void addRepository(<String> repository)
repository - as String, the path to the code repository
repository - as a Repository object, implementing the Repository interface
void clearCache()
Number countSessions()
SessionObject createSession(sessionID)
String - of the ID for this session
void debug(<String> filenameOrText,<String> text)
# File helma/apps/test/app.properties:
debug = true
// File helma/apps/test/root/main.hac:
app.debug("This message is written to the test application's event log.");
app.debug("custom", "This message is written to the custom.log file.");
File helma/log/test_event.log:
[2006/07/11 17:08] This message is written to the test application's event log.
File helma/log/custom.log:
[2006/07/11 17:08] This message is written to the custom.log file.
filenameOrText - as String, the log filename to write to or the text to write to the eventLog file
text - as String the text to write, if the filename was specified as the first argument
Number getActiveThreads()
Array getActiveUsers()
String getAppDir()
Number getCacheUsage()
Object getCronJobs()
String getDir()
Number getErrorCount()
Number getFreeThreads()
Number getMaxThreads()
String getName()
Array getRegisteredUsers()
Number getRequestCount()
String getServerDir()
SessionObject getSession(<String> sessionID)
sessionID - as String, the ID of an existing session
Array getSessions()
Array getSessionsForUser(<User> user)
user - as User object
Map getSkinfiles()
Date getUpSince()
User getUser(<String> username)
username - as String
Number getXmlrpcCount()
Object invoke(<Object> thisObject,<Function> fnc,<Array> args,<Number> timeout)
thisObject - as Object, the object to invoke the function on, or null for global invocation
fnc - the function or function name to invoke
args - as Array, optional arguments to be passed to the function fnc
timeout - as Number, optional amount of milliseconds after which the invocation should be interrupted
Object invokeAsync(<Object> thisObject,<Function> fnc,<Array> args,<Number> timeout)
thisObject - as Object, the object to invoke the function on, or null for global invocation
fnc - the function or function name to invoke
args - as Array, optional arguments to be passed to the function fnc
timeout - as Number, optional amount of milliseconds after which the invocation should be interrupted
void log(<String> filenameOrText,<String> text)
app.debug("This message is written to the test application's event log.");
app.debug("custom", "This message is written to the custom.log file.");
File helma/log/test_event.log:
[2006/07/11 17:08] This message is written to the test application's event log.
File helma/log/custom.log:
[2006/07/11 17:08] This message is written to the custom.log file.
filenameOrText - as String, the log filename to write to or the text to write to the eventLog file
text - as String the text to write, if the filename was specified as the first argument
User registerUser(<String> username, <String> password)
username - as String
password - as String
void removeCronJob(<String> functionName)
functionName - as String
| SUMMARY: Constructor | Properties | Methods | DETAIL: Constructor | Properties | Methods |