private void decorateVersion(Map<Integer, ApplicationWithVersion> appsWithVersion, AppServerRelationProperties properties) { if(properties.getProperties().containsKey(VERSION)) { //if MavenVersion property exists and has a value do not overwrite with Version if (!properties.getProperties().containsKey(MAVEN_VERSION) || StringUtils.isBlank(properties.getProperties().get(MAVEN_VERSION).getCurrentValue())) { properties.getProperties().put(MAVEN_VERSION, properties.getProperties().get(VERSION)); } } if (appsWithVersion.containsKey(properties.getOwner().getId())) { ApplicationWithVersion applicationWithVersion = appsWithVersion.get(properties.getOwner() .getId()); if (StringUtils.isNotBlank(applicationWithVersion.getVersion())) { properties.getProperties().put(VERSION, new FreeMarkerProperty(applicationWithVersion.getVersion(), VERSION)); properties.getProperties().put(MAVEN_VERSION, new FreeMarkerProperty(applicationWithVersion.getVersion(), MAVEN_VERSION)); } } }
private FreeMarkerProperty getPropertyFromUnit(GenerationUnit unit, String key) { return unit.getAppServerRelationProperties().getProperties().get(key); }
public void transform(AMWTemplateExceptionHandler templateExceptionHandler, AmwAppServerNodeModel model) { AppServerRelationProperties app = new AppServerRelationProperties(options.getContext().getContext(), getApplication(), templateExceptionHandler); AppServerRelationProperties appServer = new AppServerRelationProperties(options.getContext().getContext(), getApplicationServer(), templateExceptionHandler); model.setAppProperties(app.getProperties()); model.setAppServerProperties(appServer.getProperties()); List<Map<String, FreeMarkerProperty>> nodePropertyList = Lists.newArrayList(); model.setNodePropertyList(nodePropertyList); } }
private AmwResourceTemplateModel getPropertiesWithTemplates(AmwResourceTemplateModel parent) { AmwResourceTemplateModel model = new AmwResourceTemplateModel(); model.setProperties(getProperties()); model.setFunctions(functions); model.setResourceEntity(owner); model.setParentResourceTemplateModel(parent); model.setResourceTemplates(resourceTemplates); model.setResourceRelationTemplates(resourceRelationTemplates); model.setTemplates(getGeneratedTemplates()); return model; }
void assertPropertyValues(ResourceEntity entity, String value) { GenerationUnit unit = unitFor(work.getAsSet(), entity); Map<String, FreeMarkerProperty> properties = unit.getAppServerRelationProperties().getProperties(); assertEquals(value, properties.get("name").getCurrentValue()); }