use of org.eclipse.winery.model.tosca.TDocumentation in project winery by eclipse.
the class DocumentationResource method onPost.
@PUT
public Response onPost(String documentation) {
this.documentation.clear();
TDocumentation tDocumentation = new TDocumentation();
tDocumentation.getContent().add(documentation);
this.documentation.add(tDocumentation);
return RestUtils.persist(this.abstractComponentInstanceResource);
}
use of org.eclipse.winery.model.tosca.TDocumentation 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;
}
use of org.eclipse.winery.model.tosca.TDocumentation in project winery by eclipse.
the class SelfServiceMetaDataUtils method getDefaultApplicationData.
private static Application getDefaultApplicationData(IRepository repository, SelfServiceMetaDataId id) {
Application app = new Application();
app.setIconUrl("icon.jpg");
app.setImageUrl("image.jpg");
final TServiceTemplate serviceTemplate = repository.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