Fix the tosca converter
[clamp.git] / src / main / java / org / onap / clamp / policy / Policy.java
index 004c450..c9055bf 100644 (file)
@@ -44,7 +44,7 @@ import org.hibernate.annotations.Type;
 import org.hibernate.annotations.TypeDef;
 import org.hibernate.annotations.TypeDefs;
 import org.json.JSONObject;
-import org.onap.clamp.clds.tosca.update.TemplateManagement;
+import org.onap.clamp.clds.tosca.update.ToscaConverterManager;
 import org.onap.clamp.clds.tosca.update.UnknownComponentException;
 import org.onap.clamp.clds.util.ResourceFileUtil;
 import org.onap.clamp.dao.model.jsontype.StringJsonUserType;
@@ -294,15 +294,15 @@ public abstract class Policy extends AuditEntity {
      * @param policyModelType The tosca model type (the policy_type entry in the tosca) that will used to create the
      *                        json schema
      * @return THe Json Schema as JsonObject
-     * @throws IOException In case of failure when opening the templates.properties file
+     * @throws IOException In case of failure when opening the templates.json file
      * @throws UnknownComponentException If the policyModelType is not found in the tosca model
      */
     public static JsonObject generateJsonRepresentationFromToscaModel(String policyToscaModel,
                                                                       String policyModelType)
             throws IOException, UnknownComponentException {
-        return new TemplateManagement(policyToscaModel,ResourceFileUtil.getResourceAsString(
-                "clds/tosca_update/defaultToscaTypes.yaml"),
-                ResourceFileUtil.getResourceAsString("clds/tosca_update/templates.properties"))
-                .launchTranslation(policyModelType);
+        return new ToscaConverterManager(policyToscaModel,ResourceFileUtil.getResourceAsString(
+                "clds/tosca_update/default-tosca-types.yaml"),
+                ResourceFileUtil.getResourceAsString("clds/tosca_update/templates.json"))
+                .startConversionToJson(policyModelType);
     }
 }