1
22
23 package com.liferay.portal.deploy.auto;
24
25 import com.liferay.portal.deploy.DeployUtil;
26 import com.liferay.portal.kernel.deploy.auto.AutoDeployException;
27 import com.liferay.portal.kernel.util.ServerDetector;
28 import com.liferay.portal.tools.LayoutTemplateDeployer;
29 import com.liferay.portal.util.PrefsPropsUtil;
30 import com.liferay.portal.util.PropsUtil;
31 import com.liferay.portal.util.PropsValues;
32
33 import java.util.ArrayList;
34 import java.util.List;
35
36 import org.apache.commons.logging.Log;
37 import org.apache.commons.logging.LogFactory;
38
39
46 public class LayoutTemplateAutoDeployer
47 extends LayoutTemplateDeployer implements AutoDeployer {
48
49 public LayoutTemplateAutoDeployer() {
50 try {
51 baseDir = PrefsPropsUtil.getString(
52 PropsUtil.AUTO_DEPLOY_DEPLOY_DIR,
53 PropsValues.AUTO_DEPLOY_DEPLOY_DIR);
54 destDir = DeployUtil.getAutoDeployDestDir();
55 appServerType = ServerDetector.getServerId();
56 jbossPrefix = PrefsPropsUtil.getString(
57 PropsUtil.AUTO_DEPLOY_JBOSS_PREFIX,
58 PropsValues.AUTO_DEPLOY_JBOSS_PREFIX);
59 unpackWar = PrefsPropsUtil.getBoolean(
60 PropsUtil.AUTO_DEPLOY_UNPACK_WAR,
61 PropsValues.AUTO_DEPLOY_UNPACK_WAR);
62
63 List jars = new ArrayList();
64
65 this.jars = jars;
66
67 checkArguments();
68 }
69 catch (Exception e) {
70 _log.error(e);
71 }
72 }
73
74 public void autoDeploy(String file) throws AutoDeployException {
75 List wars = new ArrayList();
76
77 wars.add(file);
78
79 this.wars = wars;
80
81 try {
82 deploy();
83 }
84 catch (Exception e) {
85 throw new AutoDeployException(e);
86 }
87 }
88
89 private static Log _log =
90 LogFactory.getLog(LayoutTemplateAutoDeployer.class);
91
92 }