log.debug("The filetemplate bundle plugin has been shut down!!! : " + this);
}
public RecipeParseResults parseRecipe(String recipe) throws UnknownRecipeException, Exception {
RecipeParser parser = new RecipeParser();
RecipeContext recipeContext = new RecipeContext(recipe);
try {
parser.parseRecipe(recipeContext);
} catch (Exception e) {
if (recipeContext.isUnknownRecipe()) {
throw new UnknownRecipeException("Not a valid file template recipe");
}
throw e;
}
DeploymentProperties bundleMetadata = recipeContext.getDeploymentProperties();
Set<String> bundleFileNames = new HashSet<String>();
Map<String, String> deployFiles = recipeContext.getDeployFiles();
bundleFileNames.addAll(deployFiles.keySet());
Set<String> scriptFiles = recipeContext.getScriptFiles();
bundleFileNames.addAll(scriptFiles);
Set<String> files = recipeContext.getFiles().keySet();
bundleFileNames.addAll(files);
ConfigurationDefinition configDef = null;
if (recipeContext.getReplacementVariables() != null) {
configDef = new ConfigurationDefinition("replacementVariables", null);
for (String replacementVar : recipeContext.getReplacementVariables()) {
PropertyDefinitionSimple prop = new PropertyDefinitionSimple(replacementVar,
"Needed by bundle recipe.", false, PropertySimpleType.STRING);
prop.setDisplayName(replacementVar);
prop.setDefaultValue(recipeContext.getReplacementVariableDefaultValues().get(replacementVar));
configDef.put(prop);
}
}
RecipeParseResults results = new RecipeParseResults(bundleMetadata, configDef, bundleFileNames);