Add Create loop dialog
[clamp.git] / src / main / java / org / onap / clamp / loop / template / LoopTemplatesService.java
index 2938213..09bc80f 100644 (file)
@@ -49,6 +49,17 @@ public class LoopTemplatesService {
         return loopTemplatesRepository.save(loopTemplate);
     }
 
+
+    /**
+     * Get the SVG representation of the loopTemplate.
+     *
+     * @param templateName The loopTemplate name
+     * @return The SVG representation in xml
+     */
+    public String getSvgRepresentation(String templateName) {
+        return loopTemplatesRepository.findById(templateName).orElse(new LoopTemplate()).getSvgRepresentation();
+    }
+
     public List<String> getLoopTemplateNames() {
         return loopTemplatesRepository.getAllLoopTemplateNames();
     }