1
14
15 package com.liferay.portal.deploy.auto;
16
17 import com.liferay.portal.kernel.deploy.auto.AutoDeployException;
18 import com.liferay.portal.kernel.deploy.auto.BaseAutoDeployListener;
19 import com.liferay.portal.kernel.log.Log;
20 import com.liferay.portal.kernel.log.LogFactoryUtil;
21
22 import java.io.File;
23
24
31 public class LayoutTemplateAutoDeployListener extends BaseAutoDeployListener {
32
33 public LayoutTemplateAutoDeployListener() {
34 _deployer = new LayoutTemplateAutoDeployer();
35 }
36
37 public void deploy(File file) throws AutoDeployException {
38 if (_log.isDebugEnabled()) {
39 _log.debug("Invoking deploy for " + file.getPath());
40 }
41
42 if (!isMatchingFile(file, "WEB-INF/liferay-layout-templates.xml")) {
43 return;
44 }
45
46 if (_log.isInfoEnabled()) {
47 _log.info("Copying layout templates for " + file.getPath());
48 }
49
50 _deployer.autoDeploy(file.getName());
51
52 if (_log.isInfoEnabled()) {
53 _log.info(
54 "Layout templates for " + file.getPath() +
55 " copied successfully. Deployment will start in a few " +
56 "seconds.");
57 }
58 }
59
60 private static Log _log = LogFactoryUtil.getLog(
61 LayoutTemplateAutoDeployListener.class);
62
63 private AutoDeployer _deployer;
64
65 }