org.apache.tapestry
Interface IScriptProcessor

All Known Subinterfaces:
PageRenderSupport, ScriptSession
All Known Implementing Classes:
Body, PageRenderSupportImpl, ScriptSessionImpl

public interface IScriptProcessor

Defines methods needed by a IScriptto execute.

Since:
3.0
Author:
Howard Lewis Ship
See Also:
Body

Method Summary
 void addBodyScript(java.lang.String script)
          Adds scripting code to the main body.
 void addExternalScript(org.apache.hivemind.Resource resource)
          Adds an external script.
 void addInitializationScript(java.lang.String script)
          Adds initialization script.
 java.lang.String getUniqueString(java.lang.String baseValue)
          Ensures that the given string is unique.
 

Method Detail

addBodyScript

void addBodyScript(java.lang.String script)
Adds scripting code to the main body. During the render, multiple scripts may render multiple bodies; all are concatinated together to form a single block. The Body component will write the body script contents just inside the <body> tag.


addInitializationScript

void addInitializationScript(java.lang.String script)
Adds initialization script. Initialization script is executed once, when the containing page loads. Initialization script content is written only after all HTML content that could be referenced from the script (in effect, just before the </body> tag).


addExternalScript

void addExternalScript(org.apache.hivemind.Resource resource)
Adds an external script. The processor is expected to ensure that external scripts are only loaded a single time per page.


getUniqueString

java.lang.String getUniqueString(java.lang.String baseValue)
Ensures that the given string is unique. The string is either returned unchanged, or a suffix is appended to ensure uniqueness.