Author: hoang_to
Date: 2009-11-04 21:34:27 -0500 (Wed, 04 Nov 2009)
New Revision: 495
Added:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/GateinSkinConfigRemoval.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/SkinDependentManager.java
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/SkinService.java
Log:
GTNPORTAL-130: Skin undeployment
Added:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/GateinSkinConfigRemoval.java
===================================================================
---
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/GateinSkinConfigRemoval.java
(rev 0)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/GateinSkinConfigRemoval.java 2009-11-05
02:34:27 UTC (rev 495)
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.exoplatform.portal.resource;
+
+import org.gatein.wci.WebAppEvent;
+import org.gatein.wci.WebAppLifeCycleEvent;
+
+/**
+ * @author <a href="mailto:hoang281283@gmail.com">Minh Hoang
TO</a>
+ * @version $Id$
+ *
+ */
+public class GateinSkinConfigRemoval extends AbstractResourceHandler
+{
+
+ private SkinService service;
+
+ private String portalContainerName;
+
+ public GateinSkinConfigRemoval(String _portalContainerName, SkinService _service){
+ this.portalContainerName = _portalContainerName;
+ this.service = _service;
+ }
+
+ /**
+ * @see
org.exoplatform.portal.resource.AbstractResourceHandler#onEvent(org.gatein.wci.WebAppEvent)
+ */
+ @Override
+ public void onEvent(WebAppEvent event)
+ {
+ // TODO Auto-generated method stub
+ if(event instanceof WebAppLifeCycleEvent){
+ WebAppLifeCycleEvent waEvent = (WebAppLifeCycleEvent)event;
+ if(waEvent.getType() == WebAppLifeCycleEvent.REMOVED){
+
+ }
+ }
+ }
+
+}
Added:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/SkinDependentManager.java
===================================================================
---
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/SkinDependentManager.java
(rev 0)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/SkinDependentManager.java 2009-11-05
02:34:27 UTC (rev 495)
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.exoplatform.portal.resource;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:hoang281283@gmail.com">Minh Hoang
TO</a>
+ * @version $Id$
+ *
+ */
+public class SkinDependentManager
+{
+
+ /** Map of skinName (Default, Mac, Vista ) and associated web applications */
+ private static Map<String, List<String>> skinName_dependentApps_Map = new
HashMap<String, List<String>>();
+
+
+}
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/SkinService.java
===================================================================
---
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/SkinService.java 2009-11-04
22:40:51 UTC (rev 494)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/SkinService.java 2009-11-05
02:34:27 UTC (rev 495)
@@ -97,6 +97,9 @@
/** The deployer. */
private final AbstractResourceHandler deployer;
+
+ /** The removal. */
+ private final AbstractResourceHandler removal;
private final Map<SkinKey, SkinConfig> portalSkins_;
@@ -124,10 +127,6 @@
*/
final String id = Long.toString(System.currentTimeMillis());
- /** Temporary hack. */
- //private static final List<String> skinBlackList =
Arrays.asList("Vista", "Mac");
- private static final List<String> skinBlackList = new
ArrayList<String>();
-
public SkinService(ExoContainerContext context)
{
portalSkins_ = new LinkedHashMap<SkinKey, SkinConfig>();
@@ -138,8 +137,8 @@
portletThemes_ = new HashMap<String, Set<String>>();
portalContainerName = context.getPortalContainerName();
mainResolver = new MainResourceResolver(portalContainerName, skinConfigs_);
- //deployer = new SkinConfigDeployer(portalContainerName, this);
- deployer = new GateinSkinConfigDeployer(portalContainerName, this);
+ deployer = new GateinSkinConfigDeployer(portalContainerName, this);
+ removal = new GateinSkinConfigRemoval(portalContainerName, this);
}
public void addCategoryTheme(String categoryName)
@@ -548,10 +547,12 @@
public void start()
{
DefaultServletContainerFactory.getInstance().getServletContainer().addWebAppListener(deployer);
+
DefaultServletContainerFactory.getInstance().getServletContainer().addWebAppListener(removal);
}
public void stop()
{
DefaultServletContainerFactory.getInstance().getServletContainer().removeWebAppListener(deployer);
+
DefaultServletContainerFactory.getInstance().getServletContainer().removeWebAppListener(removal);
}
}
\ No newline at end of file