Detailed reference of prototypes, properties and methods available in the
Javascript environment of your Helma web applications.

Default properties and methods of the Skin objects.
Packages.helma.framework.core.Skin Skin
A Skin object that can be passed to the global functions renderSkin, resp. renderSkinAsString.

Skins can either be defined by text files using a *.skin suffix, placed in an application's code repository or are created using the global createSkin function. There is no constructor to instantiate these objects.
see
Methods
Skin. allowMacro(macroname)
Limits the range of allowed macros to be rendered in a skin to an explicit set.

This is useful e.g. when text entered by non-trusted users is interpreted as skins to provide macro functions on a user-level.

Example:
// Two macro functions defined in a JavaScript file:
 
function isAllowed_macro() {
  return("Hello");
}
 
function isForbidden_macro() {
  return("World");
}
 
// The action that enables one of the macros:
 
function test_action() {
  var str = "<% root.isAllowed %>, <% root.isForbidden %>!";
  var skin = createSkin(str);
  // as soon as we call allowMacro() on a skin, only those
  // macros explicitely set are allowed to be evaluated.
  // all others will result in an error msg.
  skin.allowMacro("root.isAllowed");
  renderSkin(skin);
}
 
Hello, [Macro root.isForbidden not allowed in sandbox]!
parameters
String macroname as String
Skin. containsMacro(macroname)
Checks whether a skin does contain a specific macro.

This is useful to make sure a user-edited skin does not contain any macro with which the application would break.



Example:

var skin1 = createSkin("myMacro");
var skin2 = createSkin("<% myMacro %>");
var skin3 = createSkin("<% this.myMacro %>");
 
res.writeln(skin1.containsMacro("myMacro"));
false
 
res.writeln(skin2.containsMacro("myMacro"));
true
 
res.writeln(skin3.containsMacro("myMacro"));
false
 
res.writeln(skin3.containsMacro("this.myMacro"));
true
parameters
String macroname as String
returns
Boolean true if the skin contains the specified macro, otherwise false
Skin. getSource()
Returns the source of the unrendered skin.
returns
String with the source of the unrendered skin
Skin. getSubskin(name)
Returns a subskin by that name.
parameters
String name as String, the subskin name
returns
Skin the subskin
Skin. getSubskinNames()
Returns an array of names of all the subskins defined in this skin.
returns
Array of Strings containing this skin's subskin names
Skin. hasMainskin()
Checks if this skin has a main skin, as opposed to consisting just of subskins.
returns
Boolean true if this skin contains a main skin
Skin. hasSubskin(name)
Check if this skin contains a subskin with the given name.
parameters
String name as String, a subskin name
returns
Boolean true if the given subskin exists
Fri, 05 Feb 2010 17:40:03 GMT.

core framework

optional modules

java libraries

properties files