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.log.Log;
28 import com.liferay.portal.kernel.log.LogFactoryUtil;
29 import com.liferay.portal.kernel.util.ServerDetector;
30 import com.liferay.portal.kernel.util.StringPool;
31 import com.liferay.portal.tools.deploy.LayoutTemplateDeployer;
32 import com.liferay.portal.util.PrefsPropsUtil;
33 import com.liferay.portal.util.PropsKeys;
34 import com.liferay.portal.util.PropsValues;
35
36 import java.util.ArrayList;
37 import java.util.List;
38
39
46 public class LayoutTemplateAutoDeployer
47 extends LayoutTemplateDeployer implements AutoDeployer {
48
49 public LayoutTemplateAutoDeployer() {
50 try {
51 baseDir = PrefsPropsUtil.getString(
52 PropsKeys.AUTO_DEPLOY_DEPLOY_DIR,
53 PropsValues.AUTO_DEPLOY_DEPLOY_DIR);
54 destDir = DeployUtil.getAutoDeployDestDir();
55 appServerType = ServerDetector.getServerId();
56 unpackWar = PrefsPropsUtil.getBoolean(
57 PropsKeys.AUTO_DEPLOY_UNPACK_WAR,
58 PropsValues.AUTO_DEPLOY_UNPACK_WAR);
59 filePattern = StringPool.BLANK;
60 jbossPrefix = PrefsPropsUtil.getString(
61 PropsKeys.AUTO_DEPLOY_JBOSS_PREFIX,
62 PropsValues.AUTO_DEPLOY_JBOSS_PREFIX);
63 unpackWar = PrefsPropsUtil.getBoolean(
64 PropsKeys.AUTO_DEPLOY_UNPACK_WAR,
65 PropsValues.AUTO_DEPLOY_UNPACK_WAR);
66
67 List<String> jars = new ArrayList<String>();
68
69 this.jars = jars;
70
71 checkArguments();
72 }
73 catch (Exception e) {
74 _log.error(e);
75 }
76 }
77
78 public void autoDeploy(String file) throws AutoDeployException {
79 List<String> wars = new ArrayList<String>();
80
81 wars.add(file);
82
83 this.wars = wars;
84
85 try {
86 deploy();
87 }
88 catch (Exception e) {
89 throw new AutoDeployException(e);
90 }
91 }
92
93 private static Log _log =
94 LogFactoryUtil.getLog(LayoutTemplateAutoDeployer.class);
95
96 }