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

Packages.helma.framework.core.Skin
global.createSkin
global.renderSkin
global.renderSkinAsString

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

Tue, 25 Nov 2008 16:50:13 GMT.

### core framework

- global
- app (application)
- req (request)
- res (response)
- session
- path
- root
- HopObject
- User
- File
- FtpClient
- Image
- Mail
- Remote
- Xml
- DatabaseObject
- MimePart
- Skin
- Object

### optional modules

- Array extensions
- Date extensions
- Number extensions
- Object extensions
- String extensions
- HopObject extensions
- global macros
- macro filters
- JSON methods
- helma.Aspects
- helma.Chart
- helma.Color
- helma.Database
- helma.File
- helma.Ftp
- helma.Group
- helma.Html
- helma.Http
- helma.Image
- helma.Mail
- helma.Search
- helma.Skin
- helma.Ssh
- helma.Url
- helma.Zip
- jala.BitTorrent
- jala.Captcha
- jala.Date
- jala.db
- jala.DnsClient
- jala.Form
- jala.History
- jala HopObject extensions
- jala.HtmlDocument
- jala.I18n
- jala.ImageFilter
- jala.IndexManager
- jala.ListRenderer
- jala.Mp3
- jala.PodcastWriter
- jala.RemoteContent
- jala.Rss20Writer
- jala.Utilities
- jala.XmlRpcRequest
- jala.XmlWriter

### java libraries

- browse docjar