diff --git a/core-bundles/meta-model/org.eclipse.vorto.core/META-INF/MANIFEST.MF b/core-bundles/meta-model/org.eclipse.vorto.core/META-INF/MANIFEST.MF index 3535f5301e..f0f04c8ee0 100644 --- a/core-bundles/meta-model/org.eclipse.vorto.core/META-INF/MANIFEST.MF +++ b/core-bundles/meta-model/org.eclipse.vorto.core/META-INF/MANIFEST.MF @@ -1,10 +1,10 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 -Bundle-Name: Vorto Core (Incubation) +Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.vorto.core;singleton:=true Bundle-Version: 0.10.0.qualifier Bundle-ClassPath: . -Bundle-Vendor: Eclipse.org/Vorto +Bundle-Vendor: %providerName Bundle-Localization: plugin Require-Bundle: org.eclipse.emf.ecore;visibility:=reexport, org.eclipse.emf.ecore.xmi, diff --git a/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/BleGattMappingTest.java b/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/BleGattMappingTest.java index b1315ba4af..bc4650a049 100644 --- a/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/BleGattMappingTest.java +++ b/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/BleGattMappingTest.java @@ -87,7 +87,7 @@ private static class TestMappingSpecification implements IMappingSpecification { //################# BAROMETER Function Block #################### - FunctionblockModel barometerModel = new FunctionblockModel(ModelId.fromPrettyFormat("demo.fb.Barometer:1.0.0"), ModelType.Functionblock); + FunctionblockModel barometerModel = new FunctionblockModel(ModelId.fromPrettyFormat("demo.fb:Barometer:1.0.0"), ModelType.Functionblock); barometerModel.setDisplayName("Barometer"); barometerModel.setTargetPlatformKey("blegatt"); @@ -154,7 +154,7 @@ private static class TestMappingSpecification implements IMappingSpecification { //################# ACELLEROMETER Function Block #################### - FunctionblockModel accelerometerModel = new FunctionblockModel(ModelId.fromPrettyFormat("demo.fb.Accelerometer:1.0.0"), ModelType.Functionblock); + FunctionblockModel accelerometerModel = new FunctionblockModel(ModelId.fromPrettyFormat("demo.fb:Accelerometer:1.0.0"), ModelType.Functionblock); accelerometerModel.setDisplayName("Accelerometer"); accelerometerModel.setTargetPlatformKey("blegatt"); @@ -261,17 +261,17 @@ private static class TestMappingSpecification implements IMappingSpecification { @Override public Infomodel getInfoModel() { - Infomodel infomodel = new Infomodel(ModelId.fromPrettyFormat("devices.TiSensorTag:1.0.0"), ModelType.InformationModel); + Infomodel infomodel = new Infomodel(ModelId.fromPrettyFormat("devices:TiSensorTag:1.0.0"), ModelType.InformationModel); infomodel.setTargetPlatformKey("blegatt"); ModelProperty barometerProperty = new ModelProperty(); barometerProperty.setName("barometer"); - barometerProperty.setType(ModelId.fromPrettyFormat("demo.fb.Barometer:1.0.0")); + barometerProperty.setType(ModelId.fromPrettyFormat("demo.fb:Barometer:1.0.0")); infomodel.getFunctionblocks().add(barometerProperty); ModelProperty accelerometerProperty = new ModelProperty(); accelerometerProperty.setName("accelerometer"); - accelerometerProperty.setType(ModelId.fromPrettyFormat("demo.fb.Accelerometer:1.0.0")); + accelerometerProperty.setType(ModelId.fromPrettyFormat("demo.fb:Accelerometer:1.0.0")); infomodel.getFunctionblocks().add(accelerometerProperty); return infomodel; diff --git a/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/CommandMappingTest.java b/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/CommandMappingTest.java index d2ee2914ec..e1ef574dd5 100644 --- a/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/CommandMappingTest.java +++ b/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/CommandMappingTest.java @@ -29,7 +29,7 @@ public void testMapSimpleOperation() throws Exception { public void testMapOperationWithParams() throws Exception { IMappingSpecification mappingSpecification = MappingSpecificationBuilder.create() // .remoteClient(repository) - .infomodelId("com.bshg.CoffeeMakerCTL636ES1:1.0.0") + .infomodelId("com.bshg:CoffeeMakerCTL636ES1:1.0.0") .targetPlatformKey("homeconnect").build(); IDataMapper mapper = IDataMapper.newBuilder().withSpecification(mappingSpecification).buildCommandMapper(); diff --git a/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/JsonMappingTest.java b/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/JsonMappingTest.java index 69d3db9561..9f4edfed4b 100644 --- a/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/JsonMappingTest.java +++ b/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/JsonMappingTest.java @@ -292,7 +292,7 @@ public void testDittoMappingOnlyOneFeature() throws Exception { @Test(expected = MappingSpecificationProblem.class) public void testBuildMappingSpecificationForInvalidModelId() { - MappingSpecificationBuilder.create().infomodelId("devices.PhilipsLivingBloo:1.0.0").targetPlatformKey("button") + MappingSpecificationBuilder.create().infomodelId("devices:PhilipsLivingBloo:1.0.0").targetPlatformKey("button") .remoteClient(this.getModelRepository()).build(); } @@ -300,7 +300,7 @@ public void testBuildMappingSpecificationForInvalidModelId() { public void testDittoMappingFromRemoteRepository() throws Exception { IMappingSpecification mappingSpecification = MappingSpecificationBuilder.create() - .infomodelId("devices.aws.button.AWSIoTButton:1.0.0") + .infomodelId("devices.aws.button:AWSIoTButton:1.0.0") .targetPlatformKey("aws_ipso") .remoteClient(this.getModelRepository()) .build(); @@ -331,7 +331,7 @@ public void testDittoMappingFromRemoteRepository() throws Exception { public void testCreateDynamicMappingSpec() throws Exception { IMappingSpecification mappingSpecification = MappingSpecificationBuilder.create() - .infomodelId("com.bosch.BoschGLM100C:1.0.0") + .infomodelId("com.bosch:BoschGLM100C:1.0.0") .remoteClient(this.getModelRepository()) .build(); diff --git a/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/MappingSerializerTest.java b/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/MappingSerializerTest.java index cf4cf6966a..364361211b 100644 --- a/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/MappingSerializerTest.java +++ b/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/MappingSerializerTest.java @@ -16,7 +16,7 @@ public class MappingSerializerTest extends AbstractMappingTest { public void testCreateAndSerializeMappingSpec() throws Exception { IMappingSpecification mappingSpecification = MappingSpecificationBuilder.create() - .infomodelId("com.bosch.BoschGLM100C:1.0.0") + .infomodelId("com.bosch:BoschGLM100C:1.0.0") .remoteClient(this.getModelRepository()) .build(); @@ -32,7 +32,7 @@ public void testCreateAndSerializeMappingSpec() throws Exception { public void testCreateAndSerializeMappingSpec2() throws Exception { IMappingSpecification mappingSpecification = MappingSpecificationBuilder.create() - .infomodelId("com.bosch.BoschGLM100C:1.0.0") + .infomodelId("com.bosch:BoschGLM100C:1.0.0") .remoteClient(this.getModelRepository()) .build(); @@ -48,7 +48,7 @@ public void testCreateAndSerializeMappingSpec2() throws Exception { public void testCreateAndSerializeMappingSpecContainingCustomFunctions() throws Exception { IMappingSpecification mappingSpecification = MappingSpecificationBuilder.create() - .infomodelId("com.bosch.BoschGLM100C:1.0.0") + .infomodelId("com.bosch:BoschGLM100C:1.0.0") .remoteClient(this.getModelRepository()) .build(); @@ -65,7 +65,7 @@ public void testCreateAndSerializeMappingSpecContainingCustomFunctions() throws public void testCreateAndSerializeMappingSpecContainingEmptyFunctions() throws Exception { IMappingSpecification mappingSpecification = MappingSpecificationBuilder.create() - .infomodelId("com.bosch.BoschGLM100C:1.0.0") + .infomodelId("com.bosch:BoschGLM100C:1.0.0") .remoteClient(this.getModelRepository()) .build(); @@ -82,7 +82,7 @@ public void testCreateAndSerializeMappingSpecContainingEmptyFunctions() throws E public void testCreateAndSerializeMappingSpecContainingDoubleQuotesFunction() throws Exception { IMappingSpecification mappingSpecification = MappingSpecificationBuilder.create() - .infomodelId("com.bosch.BoschGLM100C:1.0.0") + .infomodelId("com.bosch:BoschGLM100C:1.0.0") .remoteClient(this.getModelRepository()) .build(); @@ -99,7 +99,7 @@ public void testCreateAndSerializeMappingSpecContainingDoubleQuotesFunction() th public void testCreateAndSerializeMappingSpecContainingDoubleQuotesCondition() throws Exception { IMappingSpecification mappingSpecification = MappingSpecificationBuilder.create() - .infomodelId("com.bosch.BoschGLM100C:1.0.0") + .infomodelId("com.bosch:BoschGLM100C:1.0.0") .remoteClient(this.getModelRepository()) .build(); diff --git a/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/UnideMappingTest.java b/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/UnideMappingTest.java index f806dbad66..5d47e067ea 100644 --- a/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/UnideMappingTest.java +++ b/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/UnideMappingTest.java @@ -17,7 +17,7 @@ public class UnideMappingTest extends AbstractMappingTest { @Test public void testMapUnideMessageToDitto() throws Exception { IMappingSpecification mappingSpecification = MappingSpecificationBuilder.create() - .infomodelId("org.eclipse.unide.devices.MobilePhone:1.0.0") + .infomodelId("org.eclipse.unide.devices:MobilePhone:1.0.0") .targetPlatformKey("org_eclipse_unide_devices_MobilePhone_1_0_0") .remoteClient(this.getModelRepository()) .build(); diff --git a/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/AbstractTestSpec.java b/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/AbstractTestSpec.java index 96f3204c3c..5ea1d876a4 100644 --- a/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/AbstractTestSpec.java +++ b/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/AbstractTestSpec.java @@ -15,7 +15,7 @@ public abstract class AbstractTestSpec implements IMappingSpecification { private static Map FBS = new HashMap(2); - private Infomodel infomodel = new Infomodel(ModelId.fromPrettyFormat("devices.AWSIoTButton:1.0.0"), + private Infomodel infomodel = new Infomodel(ModelId.fromPrettyFormat("devices:AWSIoTButton:1.0.0"), ModelType.InformationModel); public AbstractTestSpec() { diff --git a/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecGattConverter.java b/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecGattConverter.java index 7ec578780a..ea46c137b7 100644 --- a/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecGattConverter.java +++ b/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecGattConverter.java @@ -17,7 +17,7 @@ public class SpecGattConverter extends AbstractTestSpec { @Override protected void createFBSpec() { FunctionblockModel buttonModel = new FunctionblockModel( - ModelId.fromPrettyFormat("demo.fb.PushButton:1.0.0"), ModelType.Functionblock); + ModelId.fromPrettyFormat("demo.fb:PushButton:1.0.0"), ModelType.Functionblock); ModelProperty digitalInputStateProperty = new ModelProperty(); digitalInputStateProperty.setMandatory(true); digitalInputStateProperty.setName("sensor_value"); diff --git a/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithArrayPayload.java b/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithArrayPayload.java index 2816aab119..8dc125fd48 100644 --- a/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithArrayPayload.java +++ b/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithArrayPayload.java @@ -14,7 +14,7 @@ public class SpecWithArrayPayload extends AbstractTestSpec { @Override protected void createFBSpec() { FunctionblockModel buttonModel = new FunctionblockModel( - ModelId.fromPrettyFormat("demo.fb.PushButton:1.0.0"), ModelType.Functionblock); + ModelId.fromPrettyFormat("demo.fb:PushButton:1.0.0"), ModelType.Functionblock); ModelProperty digitalInputStateProperty = new ModelProperty(); digitalInputStateProperty.setMandatory(true); digitalInputStateProperty.setName("sensor_value"); diff --git a/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithBase64Converter.java b/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithBase64Converter.java index 6c95343e9f..a76f0ea107 100644 --- a/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithBase64Converter.java +++ b/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithBase64Converter.java @@ -19,7 +19,7 @@ protected void createFBSpec() { } private FunctionblockModel createButtonFb() { - FunctionblockModel buttonModel = new FunctionblockModel(ModelId.fromPrettyFormat("demo.fb.PushButton:1.0.0"), + FunctionblockModel buttonModel = new FunctionblockModel(ModelId.fromPrettyFormat("demo.fb:PushButton:1.0.0"), ModelType.Functionblock); ModelProperty digitalInputStateProperty = new ModelProperty(); digitalInputStateProperty.setMandatory(true); diff --git a/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithByteArrayConverter.java b/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithByteArrayConverter.java index 34922347f7..6b108ce437 100644 --- a/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithByteArrayConverter.java +++ b/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithByteArrayConverter.java @@ -17,7 +17,7 @@ public class SpecWithByteArrayConverter extends AbstractTestSpec { @Override protected void createFBSpec() { FunctionblockModel buttonModel = new FunctionblockModel( - ModelId.fromPrettyFormat("demo.fb.PushButton:1.0.0"), ModelType.Functionblock); + ModelId.fromPrettyFormat("demo.fb:PushButton:1.0.0"), ModelType.Functionblock); ModelProperty digitalInputStateProperty = new ModelProperty(); digitalInputStateProperty.setMandatory(true); digitalInputStateProperty.setName("sensor_value"); diff --git a/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithCondition.java b/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithCondition.java index 1eb2541d11..b71884091e 100644 --- a/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithCondition.java +++ b/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithCondition.java @@ -14,7 +14,7 @@ public class SpecWithCondition extends AbstractTestSpec { @Override protected void createFBSpec() { FunctionblockModel buttonModel = new FunctionblockModel( - ModelId.fromPrettyFormat("demo.fb.PushButton:1.0.0"), ModelType.Functionblock); + ModelId.fromPrettyFormat("demo.fb:PushButton:1.0.0"), ModelType.Functionblock); ModelProperty digitalInputStateProperty = new ModelProperty(); digitalInputStateProperty.setMandatory(true); digitalInputStateProperty.setName("sensor_value"); diff --git a/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithConditionFunction.java b/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithConditionFunction.java index 1afb3a68c7..8e67b2e391 100644 --- a/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithConditionFunction.java +++ b/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithConditionFunction.java @@ -14,7 +14,7 @@ public class SpecWithConditionFunction extends AbstractTestSpec { @Override protected void createFBSpec() { FunctionblockModel buttonModel = new FunctionblockModel( - ModelId.fromPrettyFormat("demo.fb.PushButton:1.0.0"), ModelType.Functionblock); + ModelId.fromPrettyFormat("demo.fb:PushButton:1.0.0"), ModelType.Functionblock); ModelProperty digitalInputStateProperty = new ModelProperty(); digitalInputStateProperty.setMandatory(true); digitalInputStateProperty.setName("sensor_value"); diff --git a/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithConditionXpath.java b/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithConditionXpath.java index 927660fe72..c3cab01ba0 100644 --- a/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithConditionXpath.java +++ b/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithConditionXpath.java @@ -14,7 +14,7 @@ public class SpecWithConditionXpath extends AbstractTestSpec { @Override protected void createFBSpec() { FunctionblockModel buttonModel = new FunctionblockModel( - ModelId.fromPrettyFormat("demo.fb.PushButton:1.0.0"), ModelType.Functionblock); + ModelId.fromPrettyFormat("demo.fb:PushButton:1.0.0"), ModelType.Functionblock); ModelProperty digitalInputStateProperty = new ModelProperty(); digitalInputStateProperty.setMandatory(true); digitalInputStateProperty.setName("sensor_value"); diff --git a/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithConditionedRules.java b/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithConditionedRules.java index 8f42512910..d9e1824db3 100644 --- a/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithConditionedRules.java +++ b/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithConditionedRules.java @@ -14,7 +14,7 @@ public class SpecWithConditionedRules extends AbstractTestSpec { @Override protected void createFBSpec() { FunctionblockModel doorState = new FunctionblockModel( - ModelId.fromPrettyFormat("demo.fb.PushButton:1.0.0"), ModelType.Functionblock); + ModelId.fromPrettyFormat("demo.fb:PushButton:1.0.0"), ModelType.Functionblock); ModelProperty digitalInputStateProperty = new ModelProperty(); digitalInputStateProperty.setMandatory(true); digitalInputStateProperty.setName("sensor_value"); @@ -27,7 +27,7 @@ protected void createFBSpec() { Arrays.asList(new ModelProperty[] { digitalInputStateProperty})); FunctionblockModel operationState = new FunctionblockModel( - ModelId.fromPrettyFormat("demo.fb.PushButton:1.0.0"), ModelType.Functionblock); + ModelId.fromPrettyFormat("demo.fb:PushButton:1.0.0"), ModelType.Functionblock); ModelProperty digitalInputStateProperty1 = new ModelProperty(); digitalInputStateProperty1.setMandatory(true); digitalInputStateProperty1.setName("sensor_value"); diff --git a/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithConfigMapping.java b/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithConfigMapping.java index 9501941fcc..9c2889face 100644 --- a/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithConfigMapping.java +++ b/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithConfigMapping.java @@ -21,7 +21,7 @@ protected void createFBSpec() { } private FunctionblockModel createButtonFb() { - FunctionblockModel buttonModel = new FunctionblockModel(ModelId.fromPrettyFormat("demo.fb.PushButton:1.0.0"), + FunctionblockModel buttonModel = new FunctionblockModel(ModelId.fromPrettyFormat("demo.fb:PushButton:1.0.0"), ModelType.Functionblock); ModelProperty digitalInputStateProperty = new ModelProperty(); digitalInputStateProperty.setMandatory(true); @@ -47,7 +47,7 @@ private FunctionblockModel createButtonFb() { } private FunctionblockModel createVoltageFb() { - FunctionblockModel voltageModel = new FunctionblockModel(ModelId.fromPrettyFormat("demo.fb.Voltage:1.0.0"), + FunctionblockModel voltageModel = new FunctionblockModel(ModelId.fromPrettyFormat("demo.fb:Voltage:1.0.0"), ModelType.Functionblock); ModelProperty sensorValueProperty = new ModelProperty(); sensorValueProperty.setMandatory(true); diff --git a/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithConstraintConfigMapping.java b/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithConstraintConfigMapping.java index 76c42d3cc9..30082158e2 100644 --- a/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithConstraintConfigMapping.java +++ b/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithConstraintConfigMapping.java @@ -23,7 +23,7 @@ protected void createFBSpec() { } private FunctionblockModel createButtonFb() { - FunctionblockModel buttonModel = new FunctionblockModel(ModelId.fromPrettyFormat("demo.fb.PushButton:1.0.0"), + FunctionblockModel buttonModel = new FunctionblockModel(ModelId.fromPrettyFormat("demo.fb:PushButton:1.0.0"), ModelType.Functionblock); ModelProperty digitalInputStateProperty = new ModelProperty(); digitalInputStateProperty.setMandatory(true); @@ -49,7 +49,7 @@ private FunctionblockModel createButtonFb() { } private FunctionblockModel createVoltageFb() { - FunctionblockModel voltageModel = new FunctionblockModel(ModelId.fromPrettyFormat("demo.fb.Voltage:1.0.0"), + FunctionblockModel voltageModel = new FunctionblockModel(ModelId.fromPrettyFormat("demo.fb:Voltage:1.0.0"), ModelType.Functionblock); ModelProperty sensorValueProperty = new ModelProperty(); sensorValueProperty.setMandatory(true); diff --git a/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithCustomFunction.java b/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithCustomFunction.java index d9cefa01a6..9a6995e060 100644 --- a/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithCustomFunction.java +++ b/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithCustomFunction.java @@ -21,7 +21,7 @@ protected void createFBSpec() { } private FunctionblockModel createButtonFb() { - FunctionblockModel buttonModel = new FunctionblockModel(ModelId.fromPrettyFormat("demo.fb.PushButton:1.0.0"), + FunctionblockModel buttonModel = new FunctionblockModel(ModelId.fromPrettyFormat("demo.fb:PushButton:1.0.0"), ModelType.Functionblock); ModelProperty digitalInputStateProperty = new ModelProperty(); digitalInputStateProperty.setMandatory(true); @@ -47,7 +47,7 @@ private FunctionblockModel createButtonFb() { } private FunctionblockModel createVoltageFb() { - FunctionblockModel voltageModel = new FunctionblockModel(ModelId.fromPrettyFormat("demo.fb.Voltage:1.0.0"), + FunctionblockModel voltageModel = new FunctionblockModel(ModelId.fromPrettyFormat("demo.fb:Voltage:1.0.0"), ModelType.Functionblock); ModelProperty sensorValueProperty = new ModelProperty(); sensorValueProperty.setMandatory(true); diff --git a/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithMaliciousFunction.java b/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithMaliciousFunction.java index 84f643ea07..885930e6c6 100644 --- a/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithMaliciousFunction.java +++ b/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithMaliciousFunction.java @@ -20,7 +20,7 @@ protected void createFBSpec() { } private FunctionblockModel createButtonFb() { - FunctionblockModel buttonModel = new FunctionblockModel(ModelId.fromPrettyFormat("demo.fb.PushButton:1.0.0"), + FunctionblockModel buttonModel = new FunctionblockModel(ModelId.fromPrettyFormat("demo.fb:PushButton:1.0.0"), ModelType.Functionblock); ModelProperty digitalInputCount = new ModelProperty(); digitalInputCount.setMandatory(true); diff --git a/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithOperationMapping.java b/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithOperationMapping.java index 5599d4e487..2d74eacc38 100644 --- a/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithOperationMapping.java +++ b/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithOperationMapping.java @@ -14,12 +14,12 @@ public class SpecWithOperationMapping extends AbstractTestSpec { @Override protected void createFBSpec() { FunctionblockModel buttonModel = new FunctionblockModel( - ModelId.fromPrettyFormat("demo.fb.PushButton:1.0.0"), ModelType.Functionblock); + ModelId.fromPrettyFormat("demo.fb:PushButton:1.0.0"), ModelType.Functionblock); Operation operation = new Operation(); operation.setName("press"); Param param = new Param(); param.setName("count"); - param.setType(ModelId.fromPrettyFormat("demo.types.Count:1.0.0")); + param.setType(ModelId.fromPrettyFormat("demo.types:Count:1.0.0")); param.setTargetPlatformKey("iotbutton"); param.addStereotype(Stereotype.createOperationTarget("data/count", "type:convertInt(obj/count)")); operation.setParams(Arrays.asList(param)); diff --git a/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithOperationRule.java b/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithOperationRule.java index 035c354f0f..6f947ad155 100644 --- a/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithOperationRule.java +++ b/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithOperationRule.java @@ -15,7 +15,7 @@ public class SpecWithOperationRule extends AbstractTestSpec { @Override protected void createFBSpec() { FunctionblockModel buttonModel = new FunctionblockModel( - ModelId.fromPrettyFormat("demo.fb.PushButton:1.0.0"), ModelType.Functionblock); + ModelId.fromPrettyFormat("demo.fb:PushButton:1.0.0"), ModelType.Functionblock); Operation operation = new Operation(); operation.setName("press"); operation.setTargetPlatformKey("iotbutton"); diff --git a/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithSameFunctionblock.java b/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithSameFunctionblock.java index 43ff4098a3..0b17975b47 100644 --- a/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithSameFunctionblock.java +++ b/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithSameFunctionblock.java @@ -14,7 +14,7 @@ public class SpecWithSameFunctionblock extends AbstractTestSpec { @Override protected void createFBSpec() { FunctionblockModel buttonModel = new FunctionblockModel( - ModelId.fromPrettyFormat("demo.fb.PushButton:1.0.0"), ModelType.Functionblock); + ModelId.fromPrettyFormat("demo.fb:PushButton:1.0.0"), ModelType.Functionblock); ModelProperty digitalInputStateProperty = new ModelProperty(); digitalInputStateProperty.setMandatory(true); digitalInputStateProperty.setName("sensor_value"); @@ -29,7 +29,7 @@ protected void createFBSpec() { addFunctionblockProperty("btn1", buttonModel); FunctionblockModel buttonModel2 = new FunctionblockModel( - ModelId.fromPrettyFormat("demo.fb.PushButton:1.0.0"), ModelType.Functionblock); + ModelId.fromPrettyFormat("demo.fb:PushButton:1.0.0"), ModelType.Functionblock); ModelProperty digitalInputStateProperty2 = new ModelProperty(); digitalInputStateProperty2.setMandatory(true); digitalInputStateProperty2.setName("sensor_value"); diff --git a/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithTimestamp.java b/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithTimestamp.java index 5b63d672f0..0091e7c2c4 100644 --- a/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithTimestamp.java +++ b/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithTimestamp.java @@ -14,7 +14,7 @@ public class SpecWithTimestamp extends AbstractTestSpec { @Override protected void createFBSpec() { FunctionblockModel buttonModel = new FunctionblockModel( - ModelId.fromPrettyFormat("demo.fb.PushButton:1.0.0"), ModelType.Functionblock); + ModelId.fromPrettyFormat("demo.fb:PushButton:1.0.0"), ModelType.Functionblock); ModelProperty digitalInputStateProperty = new ModelProperty(); digitalInputStateProperty.setMandatory(true); digitalInputStateProperty.setName("sensor_value"); diff --git a/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithTypeConversion.java b/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithTypeConversion.java index b65957574e..32232cdf96 100644 --- a/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithTypeConversion.java +++ b/mapping-engine/src/test/java/org/eclipse/vorto/service/mapping/spec/SpecWithTypeConversion.java @@ -14,7 +14,7 @@ public class SpecWithTypeConversion extends AbstractTestSpec { @Override protected void createFBSpec() { FunctionblockModel buttonModel = new FunctionblockModel( - ModelId.fromPrettyFormat("demo.fb.PushButton:1.0.0"), ModelType.Functionblock); + ModelId.fromPrettyFormat("demo.fb:PushButton:1.0.0"), ModelType.Functionblock); ModelProperty digitalInputStateProperty = new ModelProperty(); digitalInputStateProperty.setMandatory(true); digitalInputStateProperty.setName("sensor_value"); diff --git a/repository/repository-api/src/main/java/org/eclipse/vorto/repository/api/ModelId.java b/repository/repository-api/src/main/java/org/eclipse/vorto/repository/api/ModelId.java index 2076cfe11c..2e0b8f7277 100644 --- a/repository/repository-api/src/main/java/org/eclipse/vorto/repository/api/ModelId.java +++ b/repository/repository-api/src/main/java/org/eclipse/vorto/repository/api/ModelId.java @@ -26,7 +26,7 @@ public class ModelId implements IReferenceType { private String namespace; private String version; - private static final Pattern ID_PATTERN = Pattern.compile("([\\w\\.]+).([\\w\\.]+)*.([A-Z][\\w\\.]+):([\\w\\.]+)"); + private static final Pattern ID_PATTERN = Pattern.compile("([\\w\\.]+).([\\w\\.]+)*:([A-Z][\\w\\.]+):([\\w\\.]+)"); public ModelId() { } @@ -46,15 +46,15 @@ public static ModelId fromReference(String qualifiedName, String version) { public static ModelId fromPrettyFormat(String prettyFormat) { if (!ID_PATTERN.matcher(prettyFormat).matches()) { - throw new IllegalArgumentException("Model ID must match pattern .:"); + throw new IllegalArgumentException("Model ID must match pattern ::"); } - final int versionIndex = prettyFormat.indexOf(":"); - return ModelId.fromReference(prettyFormat.substring(0,versionIndex),prettyFormat.substring(versionIndex+1)); + final String[] tripleParts = prettyFormat.split(":"); + return new ModelId(tripleParts[1],tripleParts[0],tripleParts[2]); } public static ModelId newVersion(ModelId id, String newVersion) { - return ModelId.fromPrettyFormat(id.getNamespace()+"."+id.getName()+":"+newVersion); + return ModelId.fromPrettyFormat(id.getNamespace()+":"+id.getName()+":"+newVersion); } public String getName() { @@ -79,7 +79,7 @@ public void setVersion(String version) { @Override public String toString() { - return "ModelId [name=" + name + ", namespace=" + namespace + ", version=" + version + "]"; + return getPrettyFormat(); } @Override @@ -120,6 +120,6 @@ public boolean equals(Object obj) { } public String getPrettyFormat() { - return namespace + "." + name + ":" +version; + return namespace + ":" + name + ":" +version; } } \ No newline at end of file diff --git a/repository/repository-server/src/main/java/org/eclipse/vorto/repository/core/impl/utils/ModelReferencesHelper.java b/repository/repository-server/src/main/java/org/eclipse/vorto/repository/core/impl/utils/ModelReferencesHelper.java index 9b3c334859..4d21adc69f 100644 --- a/repository/repository-server/src/main/java/org/eclipse/vorto/repository/core/impl/utils/ModelReferencesHelper.java +++ b/repository/repository-server/src/main/java/org/eclipse/vorto/repository/core/impl/utils/ModelReferencesHelper.java @@ -42,10 +42,7 @@ public String[] getReferencesInPrettyFormat() { } public void addModelReference(String prettyFormat) { - int versionSeperator = prettyFormat.indexOf(":"); - String qualifiedName = prettyFormat.substring(0,versionSeperator); - String version = prettyFormat.substring(versionSeperator+1); - this.references.add(ModelId.fromReference(qualifiedName, version)); + this.references.add(ModelId.fromPrettyFormat(prettyFormat)); } public List getReferences() { diff --git a/repository/repository-server/src/main/java/org/eclipse/vorto/repository/web/api/v1/AttachmentController.java b/repository/repository-server/src/main/java/org/eclipse/vorto/repository/web/api/v1/AttachmentController.java index 1bc8347e69..08b30e77b6 100644 --- a/repository/repository-server/src/main/java/org/eclipse/vorto/repository/web/api/v1/AttachmentController.java +++ b/repository/repository-server/src/main/java/org/eclipse/vorto/repository/web/api/v1/AttachmentController.java @@ -69,7 +69,7 @@ public class AttachmentController extends AbstractRepositoryController { @RequestMapping(method = RequestMethod.PUT, value = "/{modelId:.+}", produces = "application/json") @PreAuthorize("isAuthenticated() && (hasRole('ROLE_ADMIN') or hasPermission(T(org.eclipse.vorto.repository.api.ModelId).fromPrettyFormat(#modelId),'model:owner'))") public AttachResult attach( - @ApiParam(value = "The ID of the vorto model in namespace.name:version format, e.g. com.mycompany.MagneticSensor:1.0.0", required = true) @PathVariable String modelId, + @ApiParam(value = "The ID of the vorto model in namespace.name:version format, e.g. com.mycompany:MagneticSensor:1.0.0", required = true) @PathVariable String modelId, @ApiParam(value = "The file to be uploaded as attachmment", required = true) @RequestParam("file") MultipartFile file) { ModelId modelID = ModelId.fromPrettyFormat(modelId); @@ -102,7 +102,7 @@ private Tag[] guessTagsFromFileExtension(String fileName) { @ApiResponse(code = 404, message = "The resource could not be found")}) @RequestMapping(method = RequestMethod.GET, value = "/{modelId:.+}", produces = "application/json") public List getAttachments( - @ApiParam(value = "The ID of the vorto model in namespace.name:version format, e.g. com.mycompany.MagneticSensor:1.0.0", required = true) @PathVariable String modelId) { + @ApiParam(value = "The ID of the vorto model in namespace.name:version format, e.g. com.mycompany:MagneticSensor:1.0.0", required = true) @PathVariable String modelId) { ModelId modelID = ModelId.fromPrettyFormat(modelId); @@ -119,7 +119,7 @@ public List getAttachments( @ApiResponse(code = 404, message = "The resource could not be found")}) @RequestMapping(method = RequestMethod.GET, value = "/{modelId:.+}/files/{filename:.+}") public void getAttachment( - @ApiParam(value = "The ID of the vorto model in namespace.name:version format, e.g. com.mycompany.MagneticSensor:1.0.0", required = true) @PathVariable String modelId, + @ApiParam(value = "The ID of the vorto model in namespace.name:version format, e.g. com.mycompany:MagneticSensor:1.0.0", required = true) @PathVariable String modelId, @ApiParam(value = "The name of the attached file that you want to retrieve", required = true) @PathVariable String filename, final HttpServletResponse response) { @@ -149,7 +149,7 @@ public void getAttachment( @ApiResponse(code = 404, message = "The resource could not be found")}) @RequestMapping(method = RequestMethod.DELETE, value = "/{modelId:.+}/files/{filename:.+}") @PreAuthorize("isAuthenticated() && (hasRole('ROLE_ADMIN') or hasPermission(T(org.eclipse.vorto.repository.api.ModelId).fromPrettyFormat(#modelId),'model:owner'))") - public ResponseEntity deleteAttachment(@ApiParam(value = "The ID of the vorto model in namespace.name:version format, e.g. com.mycompany.MagneticSensor:1.0.0", required = true) @PathVariable String modelId, + public ResponseEntity deleteAttachment(@ApiParam(value = "The ID of the vorto model in namespace.name:version format, e.g. com.mycompany:MagneticSensor:1.0.0", required = true) @PathVariable String modelId, @ApiParam(value = "The name of the attached file that you want to delete", required = true) @PathVariable String filename) { ModelId modelIdObject = ModelId.fromPrettyFormat(modelId); diff --git a/repository/repository-server/src/main/java/org/eclipse/vorto/repository/web/api/v1/GeneratorController.java b/repository/repository-server/src/main/java/org/eclipse/vorto/repository/web/api/v1/GeneratorController.java index 3bd78377e8..e5b7915575 100644 --- a/repository/repository-server/src/main/java/org/eclipse/vorto/repository/web/api/v1/GeneratorController.java +++ b/repository/repository-server/src/main/java/org/eclipse/vorto/repository/web/api/v1/GeneratorController.java @@ -77,7 +77,7 @@ public class GeneratorController extends AbstractRepositoryController { @ApiOperation(value = "Generate code for a specified platform, and extract specified path") @ApiResponses(value = { @ApiResponse(code = 200, message = "Code was successfully generated."), @ApiResponse(code = 400, message = "Wrong input"), @ApiResponse(code = 404, message = "Model or generator not found")}) @RequestMapping(value = "/{serviceKey}/models/{modelId:.+}/!/**", method = RequestMethod.GET) - public void generateAndExtract(@ApiParam(value = "The iD of vorto model, e.g. com.mycompany.Car:1.0.0", required = true) final @PathVariable String modelId, + public void generateAndExtract(@ApiParam(value = "The iD of vorto model, e.g. com.mycompany:Car:1.0.0", required = true) final @PathVariable String modelId, @ApiParam(value = "Service key for a specified platform, e.g. lwm2m", required = true) @PathVariable String serviceKey, final HttpServletRequest request, final HttpServletResponse response) { @@ -144,7 +144,7 @@ private String getExtractPath(final HttpServletRequest request) { @ApiOperation(value = "Generate code for a specified platform") @ApiResponses(value = { @ApiResponse(code = 200, message = "Code was successfully generated."),@ApiResponse(code = 400, message = "Wrong input"), @ApiResponse(code = 404, message = "Model or generator not found")}) @RequestMapping(value = "/{serviceKey}/models/{modelId:.+}", method = RequestMethod.GET) - public void generate( @ApiParam(value = "the vorto model ID, e.g. com.mycompany.Car:1.0.0", required = true) final @PathVariable String modelId, + public void generate( @ApiParam(value = "the vorto model ID, e.g. com.mycompany:Car:1.0.0", required = true) final @PathVariable String modelId, @ApiParam(value = "generator key, e.g. lwm2m", required = true) @PathVariable String serviceKey, final HttpServletRequest request, final HttpServletResponse response) { diff --git a/repository/repository-server/src/main/java/org/eclipse/vorto/repository/web/api/v1/ModelController.java b/repository/repository-server/src/main/java/org/eclipse/vorto/repository/web/api/v1/ModelController.java index 9b22f6922f..d1fb3b49df 100644 --- a/repository/repository-server/src/main/java/org/eclipse/vorto/repository/web/api/v1/ModelController.java +++ b/repository/repository-server/src/main/java/org/eclipse/vorto/repository/web/api/v1/ModelController.java @@ -68,7 +68,7 @@ public class ModelController extends AbstractRepositoryController { @PreAuthorize("hasRole('ROLE_USER') or hasRole('ROLE_ADMIN') or hasPermission(T(org.eclipse.vorto.repository.api.ModelId).fromPrettyFormat(#modelId),'model:get')") @RequestMapping(value = "/{modelId:.+}", method = RequestMethod.GET) public ModelInfo getModelInfo( - @ApiParam(value = "The modelId of vorto model, e.g. com.mycompany.Car:1.0.0", required = true) final @PathVariable String modelId) { + @ApiParam(value = "The modelId of vorto model, e.g. com.mycompany:Car:1.0.0", required = true) final @PathVariable String modelId) { Objects.requireNonNull(modelId, "modelId must not be null"); logger.info("getModelInfo: [" + modelId + "]"); @@ -87,7 +87,7 @@ public ModelInfo getModelInfo( @PreAuthorize("hasRole('ROLE_USER') or hasRole('ROLE_ADMIN') or hasPermission(T(org.eclipse.vorto.repository.api.ModelId).fromPrettyFormat(#modelId),'model:get')") @RequestMapping(value = "/{modelId:.+}/content", method = RequestMethod.GET) public AbstractModel getModelContent( - @ApiParam(value = "The modelId of vorto model, e.g. com.mycompany.Car:1.0.0", required = true) final @PathVariable String modelId) { + @ApiParam(value = "The modelId of vorto model, e.g. com.mycompany:Car:1.0.0", required = true) final @PathVariable String modelId) { final ModelId modelID = ModelId.fromPrettyFormat(modelId); if (this.modelRepository.getById(modelID) == null) { @@ -108,7 +108,7 @@ public AbstractModel getModelContent( @PreAuthorize("hasRole('ROLE_USER') or hasRole('ROLE_ADMIN') or hasPermission(T(org.eclipse.vorto.repository.api.ModelId).fromPrettyFormat(#modelId),'model:get')") @RequestMapping(value = "/{modelId:.+}/content/{targetplatformKey}", method = RequestMethod.GET) public AbstractModel getModelContentForTargetPlatform( - @ApiParam(value = "The modelId of vorto model, e.g. com.mycompany.Car:1.0.0", required = true) final @PathVariable String modelId, + @ApiParam(value = "The modelId of vorto model, e.g. com.mycompany:Car:1.0.0", required = true) final @PathVariable String modelId, @ApiParam(value = "The key of the targetplatform, e.g. lwm2m", required = true) final @PathVariable String targetplatformKey) { final ModelId modelID = ModelId.fromPrettyFormat(modelId); @@ -193,7 +193,7 @@ public AbstractModel getModelContentByModelAndMappingId( @PreAuthorize("hasRole('ROLE_USER') or hasRole('ROLE_ADMIN') or hasPermission(T(org.eclipse.vorto.repository.api.ModelId).fromPrettyFormat(#modelId),'model:get')") @RequestMapping(value = "/{modelId:.+}/file", method = RequestMethod.GET) public void downloadModelById( - @ApiParam(value = "The modelId of vorto model, e.g. com.mycompany.Car:1.0.0", required = true) final @PathVariable String modelId, + @ApiParam(value = "The modelId of vorto model, e.g. com.mycompany:Car:1.0.0", required = true) final @PathVariable String modelId, @ApiParam(value = "Set true if dependencies shall be included", required = false) final @RequestParam(value = "includeDependencies", required = false) boolean includeDependencies, final HttpServletResponse response) { diff --git a/repository/repository-server/src/test/java/org/eclipse/vorto/repository/core/MappingTest.java b/repository/repository-server/src/test/java/org/eclipse/vorto/repository/core/MappingTest.java index 4e2773e408..e86e728ace 100644 --- a/repository/repository-server/src/test/java/org/eclipse/vorto/repository/core/MappingTest.java +++ b/repository/repository-server/src/test/java/org/eclipse/vorto/repository/core/MappingTest.java @@ -99,7 +99,7 @@ public void testUsedByMappingOfEntity() throws Exception { Thread.sleep(2000); assertEquals(1, modelRepository.getById(ModelId.fromReference("org.eclipse.vorto.examples.type.Color", "1.0.0")) .getReferencedBy().size()); - assertEquals("org.eclipse.vorto.examples.type.Color_ios:1.0.0", + assertEquals("org.eclipse.vorto.examples.type:Color_ios:1.0.0", modelRepository.getById(ModelId.fromReference("org.eclipse.vorto.examples.type.Color", "1.0.0")) .getReferencedBy().get(0).getPrettyFormat()); diff --git a/repository/repository-server/src/test/java/org/eclipse/vorto/repository/core/ModelIdTest.java b/repository/repository-server/src/test/java/org/eclipse/vorto/repository/core/ModelIdTest.java index 8fbcd41d56..87b21de41d 100644 --- a/repository/repository-server/src/test/java/org/eclipse/vorto/repository/core/ModelIdTest.java +++ b/repository/repository-server/src/test/java/org/eclipse/vorto/repository/core/ModelIdTest.java @@ -35,25 +35,25 @@ public void testInvalidModelId2() { @Test (expected=IllegalArgumentException.class) public void testInvalidModelId3() { - String modelId = "com.bosch.test:1.0.0"; + String modelId = "com.bosch:test:1.0.0"; ModelId.fromPrettyFormat(modelId); } @Test public void testValidModelId() { - String modelId = "com.bosch.Test:1.0.0"; + String modelId = "com.bosch:Test:1.0.0"; assertEquals(new ModelId("Test", "com.bosch", "1.0.0"),ModelId.fromPrettyFormat(modelId)); } @Test public void testValidModelId2() { - String modelId = "com.Test:1.0.0"; + String modelId = "com:Test:1.0.0"; assertEquals(new ModelId("Test", "com", "1.0.0"),ModelId.fromPrettyFormat(modelId)); } @Test public void testValidModelId3() { - String modelId = "com.bosch.si.Test:1.0.2"; + String modelId = "com.bosch.si:Test:1.0.2"; assertEquals(new ModelId("Test", "com.bosch.si", "1.0.2"),ModelId.fromPrettyFormat(modelId)); } } diff --git a/repository/repository-server/src/test/java/org/eclipse/vorto/repository/core/ModelRepositoryTest.java b/repository/repository-server/src/test/java/org/eclipse/vorto/repository/core/ModelRepositoryTest.java index 480fb5fde0..d320052c17 100644 --- a/repository/repository-server/src/test/java/org/eclipse/vorto/repository/core/ModelRepositoryTest.java +++ b/repository/repository-server/src/test/java/org/eclipse/vorto/repository/core/ModelRepositoryTest.java @@ -96,7 +96,7 @@ public void testGetReferencesFromModel() throws Exception { ModelInfo result = modelRepository .getById(ModelId.fromReference("org.eclipse.vorto.examples.fb.ColorLight", "1.0.0")); assertEquals(1, result.getReferences().size()); - assertEquals("org.eclipse.vorto.examples.type.Color:1.0.0", result.getReferences().get(0).getPrettyFormat()); + assertEquals("org.eclipse.vorto.examples.type:Color:1.0.0", result.getReferences().get(0).getPrettyFormat()); } @Test @@ -107,7 +107,7 @@ public void testGetReferencedBy() throws Exception { ModelInfo result = modelRepository .getById(ModelId.fromReference("org.eclipse.vorto.examples.type.Color", "1.0.0")); assertEquals(1, result.getReferencedBy().size()); - assertEquals("org.eclipse.vorto.examples.fb.ColorLight:1.0.0", + assertEquals("org.eclipse.vorto.examples.fb:ColorLight:1.0.0", result.getReferencedBy().get(0).getPrettyFormat()); } diff --git a/repository/repository-web/src/main/resources/static/js/app.js b/repository/repository-web/src/main/resources/static/js/app.js index a99ed46dff..24bbf3f43d 100644 --- a/repository/repository-web/src/main/resources/static/js/app.js +++ b/repository/repository-web/src/main/resources/static/js/app.js @@ -55,7 +55,7 @@ repository.config([ "$routeProvider", "$httpProvider", function($routeProvider, }; $rootScope.modelId = function(namespace,name,version) { - return namespace + "." + name + ":" + version; + return namespace + ":" + name + ":" + version; }; $rootScope.logout = function() { diff --git a/repository/repository-web/src/main/resources/static/partials/details-template.html b/repository/repository-web/src/main/resources/static/partials/details-template.html index 64c6b2811c..a2d6be3e4c 100644 --- a/repository/repository-web/src/main/resources/static/partials/details-template.html +++ b/repository/repository-web/src/main/resources/static/partials/details-template.html @@ -544,7 +544,7 @@ {{ current.state }} - {{ current.id.namespace }}.{{ current.id.name }}:{{ current.id.version }} + {{ current.id.prettyFormat }} Copy to clipboard