use of org.eclipse.winery.model.tosca.TServiceTemplate in project winery by eclipse.
the class SelfServiceMetaDataUtils method getDefaultApplicationData.
private static Application getDefaultApplicationData(SelfServiceMetaDataId id) {
Application app = new Application();
app.setIconUrl("icon.jpg");
app.setImageUrl("image.jpg");
final TServiceTemplate serviceTemplate = RepositoryFactory.getRepository().getElement((ServiceTemplateId) id.getParent());
app.setDisplayName(serviceTemplate.getName());
List<TDocumentation> documentation = serviceTemplate.getDocumentation();
if ((documentation != null) && (!documentation.isEmpty())) {
TDocumentation doc = documentation.get(0);
List<Object> content = doc.getContent();
if ((content != null) && (!content.isEmpty())) {
app.setDescription(content.get(0).toString());
}
}
return app;
}
Aggregations