excludedParams.add(DeploymentProperties.ALT_DD);
excludedParams.add(DeploymentProperties.RUNTIME_ALT_DD);
excludedParams.add(DeploymentProperties.UPLOAD); // We'll force it to true ourselves.
final ParameterMap paramMap;
final ParameterMapExtractor extractor = new ParameterMapExtractor(params);
paramMap = extractor.extract(excludedParams);
prepareGeneratedContent(dc, paramMap);
// set the path and plan params
// get the location properties from the application so the token
// will be resolved
Application application = applications.getApplication(params.name);
Properties appProperties = application.getDeployProperties();
String archiveLocation = appProperties.getProperty(Application.APP_LOCATION_PROP_NAME);
final File archiveFile = new File(new URI(archiveLocation));
paramMap.set("DEFAULT", archiveFile.getAbsolutePath());
String planLocation = appProperties.getProperty(Application.DEPLOYMENT_PLAN_LOCATION_PROP_NAME);
if (planLocation != null) {
final File actualPlan = new File(new URI(planLocation));
paramMap.set(DeployCommandParameters.ParameterNames.DEPLOYMENT_PLAN, actualPlan.getAbsolutePath());
}
String altDDLocation = appProperties.getProperty(Application.ALT_DD_LOCATION_PROP_NAME);
if (altDDLocation != null) {
final File altDD = new File(new URI(altDDLocation));
paramMap.set(DeployCommandParameters.ParameterNames.ALT_DD, altDD.getAbsolutePath());
}
String runtimeAltDDLocation = appProperties.getProperty(Application.RUNTIME_ALT_DD_LOCATION_PROP_NAME);
if (runtimeAltDDLocation != null) {
final File runtimeAltDD = new File(new URI(runtimeAltDDLocation));
paramMap.set(DeployCommandParameters.ParameterNames.RUNTIME_ALT_DD, runtimeAltDD.getAbsolutePath());
}
// always upload the archives to the instance side
// but not directories. Note that we prepare a zip file containing
// the generated directories and pass that as a single parameter so it
// will be uploaded even though a deployment directory is not.
paramMap.set(DeploymentProperties.UPLOAD, "true");
// pass the params we restored from the previous deployment in case of
// redeployment
if (params.previousContextRoot != null) {
paramMap.set(DeploymentProperties.PRESERVED_CONTEXT_ROOT, params.previousContextRoot);
}
// pass the app props so we have the information to persist in the
// domain.xml
Properties appProps = dc.getAppProps();
appProps.remove(DeploymentProperties.APP_CONFIG);
paramMap.set(DeploymentProperties.APP_PROPS, extractor.propertiesValue(appProps, ':'));
Properties previousVirtualServers = dc.getTransientAppMetaData(DeploymentProperties.PREVIOUS_VIRTUAL_SERVERS, Properties.class);
if (previousVirtualServers != null) {
paramMap.set(DeploymentProperties.PREVIOUS_VIRTUAL_SERVERS, extractor.propertiesValue(previousVirtualServers, ':'));
}
Properties previousEnabledAttributes = dc.getTransientAppMetaData(DeploymentProperties.PREVIOUS_ENABLED_ATTRIBUTES, Properties.class);
if (previousEnabledAttributes != null) {
paramMap.set(DeploymentProperties.PREVIOUS_ENABLED_ATTRIBUTES, extractor.propertiesValue(previousEnabledAttributes, ':'));
}
return paramMap;
}