java.lang.Object | |
↳ | com.microstrategy.web.app.utils.ClientSideHelper |
ClientSideHelper Provides utility functions used to provide a single code base for: 1) including javascript files, 2) registering bones, 3) setting bone properties
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ClientSideHelper(AppContext apc) |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
static void |
addInlineScript(MarkupOutput out, AppContext appContext, StringBuilder scriptBody)
Add an inline script in the page.
| ||||||||||
static void |
addInlineScript(MarkupOutput out, AppContext appContext, MarkupOutput scriptBodyMo)
Add an inline script in the page.
| ||||||||||
void |
addInterScriptClassDependency(String fromJsClassName, String toJsClassName)
Add a dependency between two JavaScript classes.
| ||||||||||
void |
addInterScriptFileDependency(String fromJsFileName, String toJsFileName)
Add a dependency between two JavaScript files.
| ||||||||||
void | addScriptDependency(String jsClassName) | ||||||||||
void |
addScriptDependency(String filename, String loadCondition)
This method adds a script dependency for a bone.
| ||||||||||
void |
generateAppendToBoneJS(MarkupOutput out, String id)
This method renders script loading tags and bone property append
| ||||||||||
void |
generateAppendToBoneJS(MarkupOutput out, String id, boolean encode)
This method renders script loading tags and bone property append.
| ||||||||||
void |
generateRegisterBoneJS(MarkupOutput out, String id)
This method renders script loading tags and bone registration.
| ||||||||||
void |
generateUpdateBoneJS(MarkupOutput out, String id)
This method renders script loading tags and bone update.
| ||||||||||
JsonGenerator |
getBonePropertiesGenerator()
This method returns the internal JsonGenerator used to render the bones properties.
| ||||||||||
static boolean | usePageResourceManagerForScripts(AppContext appContext) |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Add an inline script in the page. This method would delegate the rendering to the Page Resource Manager PageResourceManager
if it is enabled. Otherwise, it renders a script tag and adds the scriptBody as the child of the tag.
out | - MarkupOut to use |
---|---|
scriptBody | - Content of the script. |
Add an inline script in the page. This method would delegate the rendering to the Page Resource Manager PageResourceManager
if it is enabled. Otherwise, it renders a script tag and adds the scriptBody as the child of the tag.
out | - MarkupOut to use |
---|---|
scriptBodyMo | - Content of the script as a MarkupOutput object. |
Add a dependency between two JavaScript classes. Usually, Web Transforms only take care of JS class name information, while they are ignorant of the .js file namas. It is desirable for Web Transforms only pass into this method the JavaScript class information, rather than .js file name information. So this method is being provided in addition to the addInterScriptFileDependency. Usage Note: By the definition specified in the DAG.java, the "to" JavaScript depends on the "from" JavaScript. So if you want to ensure JS Class "A" appear before JS Class "B" in a web page, then you should call this method as 'addInterScriptClassDependency("A", "B")'.
fromJsClassName | String the "parent" JavaScript class name that should appear before the toJSClassName in the page. |
---|---|
toJsClassName | String the "dependent" JavaScript class name that should appear after the fromJsClassName in the page. |
Add a dependency between two JavaScript files. Usage Note: By the definition specified in the DAG.java, the "to" JavaScript depends on the "from" JavaScript. So if you want to ensure "a.js" appear before "b.js" in a web page, then you should call this method as 'addInterScriptFileDependency("a.js", "b.js")'.
fromJsFileName | String the "parent" JavaScript file name that should appear before the toJSFileName in the page. |
---|---|
toJsFileName | String the "dependent" JavaScript file name that should appear after the fromJSFileName in the page. |
This method adds a script dependency for a bone. Registration of a bone with a script dependency will be held until all script file dependencies have been resolved (loaded).
filename | String the name of the script file |
---|---|
loadCondition | String a JavaScript string that when evaluated (using the eval function) will return true when the file is loaded. |
This method renders script loading tags and bone property append
out | MarkupOutput that receives the output html |
---|---|
id | String the id of the main bone element (used for registration) |
This method renders script loading tags and bone property append.
out | MarkupOutput that receives the output html |
---|---|
id | String the id of the main bone element (used for registration) |
encode | boolean true if this rendering occurs within the context of a ComponentBlock, in which case the empty span tag will not be rendered so to preserve the correctness of the json syntax |
This method renders script loading tags and bone registration.
out | MarkupOutput that receives the output html |
---|---|
id | String the id of the main bone element (used for registration) |
This method renders script loading tags and bone update.
out | MarkupOutput that receives the output html |
---|---|
id | String the id of the main bone element (used for registration) |
This method returns the internal JsonGenerator used to render the bones properties.