java.lang.Object | |
↳ | com.microstrategy.web.app.utils.PageResourceManager |
This class represents the resource manager associated with the page. It is used for managing the resources like JavaScript/CSS for the page.
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
PageResourceManager()
Default Constructor.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
addBundle(String fileName, boolean includeInHead)
Add a JS bundle to the manager.
| ||||||||||
void |
addInterScriptFileDependency(String fromScriptFileName, String toScriptFileName)
This method programmatically specify a dependency relationship between two JavaScript files.
| ||||||||||
void |
addScript(MarkupOutput mo)
Add a scriptlet to the manager.
| ||||||||||
void |
addScript(StringBuilder script)
Add a scriptlet to the manager.
| ||||||||||
void |
addScriptFile(String fileName, boolean includeInHead)
Add a script file to the manager.
| ||||||||||
List<String> | getAllBundles() | ||||||||||
Iterator<String> | getAllBundlesAsIterator() | ||||||||||
List<String> |
getBundles(boolean includeInHead)
Returns an iterator over the list of JS Bundles.
| ||||||||||
Iterator<String> | getBundlesAsIterator(boolean includeInHead) | ||||||||||
Iterator<String> | getScriptFiles(boolean includeInHead) | ||||||||||
Iterator<String> |
getScriptFilesNotSorted(boolean includeInHead)
Returns an iterator over the list of files.
| ||||||||||
Iterator<StringBuilder> |
getScripts()
Returns an iterator over the list of scriptlets.
| ||||||||||
List<String> |
getTailUniqueFiles(boolean isDebugMode)
build a list of unique files to be included in document body
steps
1.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Default Constructor.
Add a JS bundle to the manager.
fileName | - name of the JavaScript Bundle file. |
---|---|
includeInHead | - whether it is needed at the head section of the page |
This method programmatically specify a dependency relationship between two JavaScript files.
If JavaScrit file B.js depends on A.js, then the A.js will be regarded as "fromScriptFileName", the B.js will be regarded as the "toScriptFileName". This relationship is represented by a graph. Normally, JavaScriptDependencyAnalyzer
can automatically capture most dependency relationships in our JavaScript library by analyzing JavaScript source codes.
When it comes to few exceptions that the dependency relationship is unable to be captured, we need to invoke this method to explicitly specify the relationship between two JavaScript files.
More importantly, you can use this method to define different relationships on the same file in different pages.
fromScriptFileName | - the file name of the JavaScript file which is at the "from" end |
---|---|
toScriptFileName | - the file name of the JavaScript file which is at the "to" end |
Add a scriptlet to the manager.
mo | - MarkupOutput - body of the script tag |
---|
Add a scriptlet to the manager.
script | : StringBuilder - body of the script tag. |
---|
Add a script file to the manager.
fileName | - name of the JavaScript file. |
---|---|
includeInHead | - whether it is needed at the head section of the page |
Returns an iterator over the list of JS Bundles.
Returns an iterator over the list of files.
includeInHead | : Boolean - files to be included in the head section of the page. |
---|
Returns an iterator over the list of scriptlets.
build a list of unique files to be included in document body steps 1. build a list of unique files in all HEAD Bundles 2. build a list of unique files in all HeAD/TAIL Bundles 3. for dynamic files that are depends-sorted, remove all dependency files that are in the list of unique files built at step 2. now the result of step 3 is the list of files to be included as 'tail' files.
isDebugMode | Flag Indicating whether JS bundles are requested in debug mode. |
---|