001
014
015 package com.liferay.portal.deploy.auto;
016
017 import com.liferay.portal.kernel.deploy.auto.AutoDeployException;
018 import com.liferay.portal.kernel.deploy.auto.BaseAutoDeployListener;
019 import com.liferay.portal.kernel.log.Log;
020 import com.liferay.portal.kernel.log.LogFactoryUtil;
021
022 import java.io.File;
023
024
028 public class LayoutTemplateAutoDeployListener extends BaseAutoDeployListener {
029
030 public LayoutTemplateAutoDeployListener() {
031 _deployer = new LayoutTemplateAutoDeployer();
032 }
033
034 public void deploy(File file) throws AutoDeployException {
035 if (_log.isDebugEnabled()) {
036 _log.debug("Invoking deploy for " + file.getPath());
037 }
038
039 if (!isMatchingFile(file, "WEB-INF/liferay-layout-templates.xml")) {
040 return;
041 }
042
043 if (_log.isInfoEnabled()) {
044 _log.info("Copying layout templates for " + file.getPath());
045 }
046
047 _deployer.autoDeploy(file.getName());
048
049 if (_log.isInfoEnabled()) {
050 _log.info(
051 "Layout templates for " + file.getPath() +
052 " copied successfully. Deployment will start in a few " +
053 "seconds.");
054 }
055 }
056
057 private static Log _log = LogFactoryUtil.getLog(
058 LayoutTemplateAutoDeployListener.class);
059
060 private AutoDeployer _deployer;
061
062 }