1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
13   */
14  
15  package com.liferay.portal.deploy.auto.exploded.tomcat;
16  
17  import com.liferay.portal.kernel.deploy.auto.AutoDeployException;
18  import com.liferay.portal.kernel.log.Log;
19  import com.liferay.portal.kernel.log.LogFactoryUtil;
20  
21  import java.io.File;
22  
23  /**
24   * <a href="ThemeExplodedTomcatListener.java.html"><b><i>View Source</i></b></a>
25   *
26   * @author Olaf Fricke
27   * @author Brian Wing Shun Chan
28   */
29  public class ThemeExplodedTomcatListener extends BaseExplodedTomcatListener {
30  
31      public ThemeExplodedTomcatListener() {
32          _deployer = new ThemeExplodedTomcatDeployer();
33      }
34  
35      public void deploy(File file) throws AutoDeployException {
36          if (_log.isDebugEnabled()) {
37              _log.debug("Invoking deploy for " + file.getPath());
38          }
39  
40          File docBaseDir = getDocBaseDir(
41              file, "WEB-INF/liferay-look-and-feel.xml");
42  
43          if (docBaseDir == null) {
44              return;
45          }
46  
47          if (_log.isInfoEnabled()) {
48              _log.info("Modifying themes for " + file.getPath());
49          }
50  
51          _deployer.explodedTomcatDeploy(file, docBaseDir, null);
52  
53          if (_log.isInfoEnabled()) {
54              _log.info(
55                  "Themes for " + file.getPath() + " modified successfully");
56          }
57  
58          copyContextFile(file);
59      }
60  
61      private static Log _log = LogFactoryUtil.getLog(
62          ThemeExplodedTomcatListener.class);
63  
64      private ExplodedTomcatDeployer _deployer;
65  
66  }