From 51c7e6c74ab520bd1c711407356a96ebffaf2214 Mon Sep 17 00:00:00 2001 From: Pavel Paroulek Date: Sun, 29 Sep 2019 21:38:19 +0200 Subject: Adding openmodel plugin mapping Change-Id: I9e499dde53b8fe44aaf62f00dae1d151e662be7c Signed-off-by: Pavel Paroulek Issue-ID: AAI-2583 --- .../velocity/VelocityEntityProperty.java | 8 ++- src/main/resources/model_export.vm | 65 ++++++++++++++++++---- 2 files changed, 61 insertions(+), 12 deletions(-) diff --git a/src/main/java/org/onap/aai/graphgraph/velocity/VelocityEntityProperty.java b/src/main/java/org/onap/aai/graphgraph/velocity/VelocityEntityProperty.java index 9ee2fbb..fcd2106 100644 --- a/src/main/java/org/onap/aai/graphgraph/velocity/VelocityEntityProperty.java +++ b/src/main/java/org/onap/aai/graphgraph/velocity/VelocityEntityProperty.java @@ -1,14 +1,16 @@ package org.onap.aai.graphgraph.velocity; +import java.util.UUID; import org.onap.aai.graphgraph.dto.Property; public class VelocityEntityProperty extends Property { private final VelocityEntity entity; - + private final String propertyId; public VelocityEntityProperty(String propertyName, String propertyValue, VelocityEntity entity) { super(propertyName, propertyValue); this.entity = entity; + propertyId = entity != null ? entity.getRandomId() : UUID.randomUUID().toString(); } public String getEntityId() { @@ -23,6 +25,10 @@ public class VelocityEntityProperty extends Property { return entity != null; } + public String getPropertyId() { + return propertyId; + } + @Override public String toString() { return "VelocityEntityProperty{" + diff --git a/src/main/resources/model_export.vm b/src/main/resources/model_export.vm index 01e62d4..c461d59 100644 --- a/src/main/resources/model_export.vm +++ b/src/main/resources/model_export.vm @@ -1,12 +1,10 @@ - - - - + + + + + + #foreach($association in $associationList) #if($prop.propertyValue == "java.lang.String") *# #else - #end #end #end - \ No newline at end of file + + +
+
+
+
+
+ + + + + + + + +
+
+
+
+
+ + + + + + + + +#foreach($association in $associationList) + +#if( ! $association.isComposition) + +#end +#end +#foreach($entity in $entityList) + + #foreach($association in $entity.neighbours) + #if( $association.isComposition) + + #end + #end + #foreach($prop in $entity.properties) + + #end +#end + \ No newline at end of file -- cgit 1.2.3-korg