Class JavascriptBundleProducer
- java.lang.Object
-
- org.silverpeas.core.web.util.viewgenerator.html.JavascriptBundleProducer
-
public class JavascriptBundleProducer extends Object
This tool permits the creates dynamically javascript bundles that javascript plugins can used easily.
The generated javascript bundle will be an instance of SilverpeasPluginBundle defined into silverpeas.js- Author:
- Yohann Chastagnier
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description JavascriptBundleProducer
add(String key, String value)
Adds given key / value.JavascriptBundleProducer
add(org.silverpeas.kernel.bundle.SilverpeasBundle bundle, String... keys)
Adds given keys from the given bundle.static JavascriptBundleProducer
bundleVariableName(String jsBundleVariableName)
Initializes the bundle producer by specifying the name of the javascript variable that represents the bundle.String
produce()
The name of the javascript variable that represents the instance of the bundle.
Please ensure that it is unique.
-
-
-
Method Detail
-
bundleVariableName
public static JavascriptBundleProducer bundleVariableName(String jsBundleVariableName)
Initializes the bundle producer by specifying the name of the javascript variable that represents the bundle.- Parameters:
jsBundleVariableName
- the javascript variable name of the bundle.- Returns:
- the initialized producer instance.
-
add
public JavascriptBundleProducer add(org.silverpeas.kernel.bundle.SilverpeasBundle bundle, String... keys)
Adds given keys from the given bundle.- Parameters:
bundle
- the bundle from which the messages must be extracted.keys
- the requested message keys.- Returns:
- itself.
-
add
public JavascriptBundleProducer add(String key, String value)
Adds given key / value.- Parameters:
key
- the key to add.value
- the boolean value associated to the key.- Returns:
- itself.
-
produce
public String produce()
The name of the javascript variable that represents the instance of the bundle.
Please ensure that it is unique.- Returns:
- the javascript as string.
-
-