Author: hoang_to
Date: 2009-11-09 06:13:18 -0500 (Mon, 09 Nov 2009)
New Revision: 527
Modified:
portal/trunk/component/web/src/main/java/org/exoplatform/web/application/javascript/JavascriptRemoval.java
Log:
GTNPORTAL-131: Javascript deployment
Modified:
portal/trunk/component/web/src/main/java/org/exoplatform/web/application/javascript/JavascriptRemoval.java
===================================================================
---
portal/trunk/component/web/src/main/java/org/exoplatform/web/application/javascript/JavascriptRemoval.java 2009-11-09
10:41:01 UTC (rev 526)
+++
portal/trunk/component/web/src/main/java/org/exoplatform/web/application/javascript/JavascriptRemoval.java 2009-11-09
11:13:18 UTC (rev 527)
@@ -51,26 +51,35 @@
*/
public void onEvent(WebAppEvent arg0)
{
- if(arg0 instanceof WebAppLifeCycleEvent){
+ if (arg0 instanceof WebAppLifeCycleEvent)
+ {
WebAppLifeCycleEvent wevent = (WebAppLifeCycleEvent)arg0;
- if(wevent.getType() == WebAppLifeCycleEvent.REMOVED){
+ if (wevent.getType() == WebAppLifeCycleEvent.REMOVED)
+ {
removeJavascript(wevent.getWebApp().getServletContext());
refreshJavascript();
}
}
}
-
- /** Remove javascript deployed in this web app **/
- private void removeJavascript(ServletContext scontext){
+
+ /** Remove javascript deployed in this web app * */
+ private void removeJavascript(ServletContext scontext)
+ {
String webApp = scontext.getContextPath();
List<JavascriptKey> jsKeys =
JavascriptDependentManager.getDeployedJScripts(webApp);
- for(JavascriptKey key : jsKeys){
+ if (jsKeys == null)
+ {
+ return;
+ }
+ for (JavascriptKey key : jsKeys)
+ {
javascriptService.removeJavascript(key, scontext);
- }
+ }
JavascriptDependentManager.clearAssociatedJScripts(webApp);
}
-
- private void refreshJavascript(){
+
+ private void refreshJavascript()
+ {
javascriptService.refreshMergedJavascript();
}
Show replies by date