001
014
015 package com.liferay.portal.deploy.auto;
016
017 import com.liferay.portal.deploy.DeployUtil;
018 import com.liferay.portal.kernel.deploy.auto.AutoDeployException;
019 import com.liferay.portal.kernel.log.Log;
020 import com.liferay.portal.kernel.log.LogFactoryUtil;
021 import com.liferay.portal.kernel.util.PropsKeys;
022 import com.liferay.portal.kernel.util.ServerDetector;
023 import com.liferay.portal.kernel.util.StringPool;
024 import com.liferay.portal.tools.deploy.LayoutTemplateDeployer;
025 import com.liferay.portal.util.PrefsPropsUtil;
026 import com.liferay.portal.util.PropsValues;
027
028 import java.util.ArrayList;
029 import java.util.List;
030
031
035 public class LayoutTemplateAutoDeployer
036 extends LayoutTemplateDeployer implements AutoDeployer {
037
038 public LayoutTemplateAutoDeployer() {
039 try {
040 baseDir = PrefsPropsUtil.getString(
041 PropsKeys.AUTO_DEPLOY_DEPLOY_DIR,
042 PropsValues.AUTO_DEPLOY_DEPLOY_DIR);
043 destDir = DeployUtil.getAutoDeployDestDir();
044 appServerType = ServerDetector.getServerId();
045 unpackWar = PrefsPropsUtil.getBoolean(
046 PropsKeys.AUTO_DEPLOY_UNPACK_WAR,
047 PropsValues.AUTO_DEPLOY_UNPACK_WAR);
048 filePattern = StringPool.BLANK;
049 jbossPrefix = PrefsPropsUtil.getString(
050 PropsKeys.AUTO_DEPLOY_JBOSS_PREFIX,
051 PropsValues.AUTO_DEPLOY_JBOSS_PREFIX);
052 unpackWar = PrefsPropsUtil.getBoolean(
053 PropsKeys.AUTO_DEPLOY_UNPACK_WAR,
054 PropsValues.AUTO_DEPLOY_UNPACK_WAR);
055
056 List<String> jars = new ArrayList<String>();
057
058 this.jars = jars;
059
060 checkArguments();
061 }
062 catch (Exception e) {
063 _log.error(e);
064 }
065 }
066
067 public void autoDeploy(String file) throws AutoDeployException {
068 List<String> wars = new ArrayList<String>();
069
070 wars.add(file);
071
072 this.wars = wars;
073
074 try {
075 deploy();
076 }
077 catch (Exception e) {
078 throw new AutoDeployException(e);
079 }
080 }
081
082 private static Log _log = LogFactoryUtil.getLog(
083 LayoutTemplateAutoDeployer.class);
084
085 }