Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Krueger2015-04-30 12:54:47 -0400
committerJan Krueger2015-04-30 12:54:47 -0400
commit67d73473cdfa5787fbeb9e0d34fec20c572845ca (patch)
tree73fa5ef85ef5d01e28704294c723682f5804184a
parent2d5defc282b07813b88cf2bb84646ec68bbebc5c (diff)
downloadorg.eclipse.openk-platform.openk-repo-67d73473cdfa5787fbeb9e0d34fec20c572845ca.tar.gz
org.eclipse.openk-platform.openk-repo-67d73473cdfa5787fbeb9e0d34fec20c572845ca.tar.xz
org.eclipse.openk-platform.openk-repo-67d73473cdfa5787fbeb9e0d34fec20c572845ca.zip
fix interfaces and tests
-rw-r--r--openk-platform/config/liferay-portal-ext/portal-ext.properties17
-rw-r--r--openk-platform/config/setup-database/setup-postgeSQL.sql2
-rw-r--r--openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/adapter/rest/GeographicalRegionRestConsumer.java2
-rw-r--r--openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/adapter/rest/SubstationRestConsumer.java2
-rw-r--r--openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/adapter/rest/SynchronousMachineRestConsumer.java3
-rw-r--r--openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/controller/rest/GeographicalRegionRestController.java1
-rw-r--r--openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/controller/rest/SubstationRestController.java2
-rw-r--r--openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/controller/rest/config/IncludeAttribute4Json.java2
-rw-r--r--openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/core/EquipmentContainer.java7
-rw-r--r--openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/domain/ReductionSetting.java6
-rw-r--r--openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/domain/Voltage.java9
-rw-r--r--openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/wires/SynchronousMachine.java82
-rw-r--r--openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/wires/SynchronousMachineKind.java6
-rw-r--r--openk-platform/openk-cachedb-service/src/main/resources/flyway-migration/V01/_00/OPENK_CACHEDB_V01_00_001__init.sql32
-rw-r--r--openk-platform/openk-cachedb-service/src/main/webapp/WEB-INF/restful-servlet.xml4
-rw-r--r--openk-platform/openk-cachedb-service/src/test/java/org/eclipse/openk/adapter/rest/GeographicalRegionRestConsumerTest.java118
-rw-r--r--openk-platform/openk-cachedb-service/src/test/java/org/eclipse/openk/adapter/rest/SynchronousMachineRestConsumerTest.java45
-rw-r--r--openk-platform/openk-cachedb-service/src/test/java/org/eclipse/openk/repository/AbstractRepositoryJpaTest.java127
-rw-r--r--openk-platform/openk-cachedb-service/src/test/java/org/eclipse/openk/repository/SynchronousMachineRepositoryTest.java5
-rw-r--r--openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/geographicalregion-sample-01.json2
-rw-r--r--openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/geographicalregion-sample-02.json290
-rw-r--r--openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/geographicalregion-sample-03.json717
-rw-r--r--openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/synchronousmachine-sample-01.json4
-rw-r--r--openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/synchronousmachine-sample-02.json16
-rw-r--r--openk-platform/openk-cachedb-service/uml-diagram/cachedb.uml228
-rw-r--r--openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/adapter/rest/SubGeographicalRegionRestConsumer.java39
-rw-r--r--openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/adapter/rest/SubstationRestConsumer.java39
-rw-r--r--openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/controller/rest/ActivityRestController.java2
-rw-r--r--openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/controller/rest/SubGeographicalRegionRestController.java44
-rw-r--r--openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/controller/rest/SubstationRestController.java46
-rw-r--r--openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/controller/rest/config/IncludeAttribute4Json.java9
-rw-r--r--openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/core/EquipmentContainer.java5
-rw-r--r--openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/core/SubGeographicalRegion.java6
-rw-r--r--openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/process/Activity.java2
-rw-r--r--openk-platform/openk-eisman-portlet/src/main/webapp/WEB-INF/restful-servlet.xml11
-rw-r--r--openk-platform/openk-eisman-portlet/src/test/java/org/eclipse/openk/eisman/controller/rest/PreselectionControllerRestTest.java (renamed from openk-platform/openk-eisman-portlet/src/test/java/org/eclipse/openk/eisman/repository/PreselectionRepositoryTest.java)26
-rw-r--r--openk-platform/openk-eisman-portlet/src/test/java/org/eclipse/openk/eisman/repository/AbstractRepositoryJpaTest.java21
-rw-r--r--openk-platform/openk-eisman-portlet/src/test/resources/json-test-samples/preselection-sample-01.json2
38 files changed, 1596 insertions, 385 deletions
diff --git a/openk-platform/config/liferay-portal-ext/portal-ext.properties b/openk-platform/config/liferay-portal-ext/portal-ext.properties
index e99d3ae3..51bb46f2 100644
--- a/openk-platform/config/liferay-portal-ext/portal-ext.properties
+++ b/openk-platform/config/liferay-portal-ext/portal-ext.properties
@@ -22,20 +22,17 @@ appdb.password=eisman
appdb.initialconnections=3
appdb.maxconnections=10
-# Konfiguration fuer Development
-theme.css.fast.load=false
-layout.template.cache.enabled=false
-browser.launcher.url=
-freemarker.engine.resource.modification.check.interval=0
-minifier.enabled=false
-
# Jobs
ift.scheduler.job.synchronousMachineDataJob.hour = 11
ift.scheduler.job.synchronousMachineDataJob.minute = 43
-# REST URIs
-rest.uri.synchronousmachine=http://localhost:8080/openk-cachedb-service/rest/synchronousmachine/
-rest.uri.substation=http://localhost:8080/openk-cachedb-service/rest/topology/substation/
+# ESB and REST URIs
+esb.url.base=http://localhost:8080
+esb.rest.uri.synchronousmachine=/openk-cachedb-service/rest/synchronousmachine/
+esb.rest.uri.substation=/openk-cachedb-service/rest/topology/substation/
+esb.rest.uri.substation.lov=/openk-cachedb-service/rest/substation/lov
+esb.rest.uri.geographicalregion=/openk-cachedb-service/rest/topology/geographicalregion
+esb.rest.uri.subgeographicalregion.lov=/openk-cachedb-service/rest/subgeographicalregion/lov
# Reduction Settings of DSO (Absenkstufen)
reduction.settings.dso=10,20,30,40,50,60,70,80,90
diff --git a/openk-platform/config/setup-database/setup-postgeSQL.sql b/openk-platform/config/setup-database/setup-postgeSQL.sql
index 55c37b69..07eb496f 100644
--- a/openk-platform/config/setup-database/setup-postgeSQL.sql
+++ b/openk-platform/config/setup-database/setup-postgeSQL.sql
@@ -1,6 +1,6 @@
--
-- Jan Krueger, April 2015
--- Scirpts for setting up database structures:
+-- Scripts for setting up databases:
-- - login-roles
-- - databases
-- - schemas
diff --git a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/adapter/rest/GeographicalRegionRestConsumer.java b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/adapter/rest/GeographicalRegionRestConsumer.java
index 728736f1..a2becc9b 100644
--- a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/adapter/rest/GeographicalRegionRestConsumer.java
+++ b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/adapter/rest/GeographicalRegionRestConsumer.java
@@ -28,7 +28,7 @@ public class GeographicalRegionRestConsumer {
* @return
*/
public GeographicalRegion getGeographicalRegion() {
- final String uri = PropsUtil.get("rest.uri.geographicalregion");
+ final String uri = PropsUtil.get("esb.url.base") + PropsUtil.get("esb.rest.uri.geographicalregion");
return restTemplate.getForObject(uri, GeographicalRegion.class);
}
diff --git a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/adapter/rest/SubstationRestConsumer.java b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/adapter/rest/SubstationRestConsumer.java
index ef6831af..304d9490 100644
--- a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/adapter/rest/SubstationRestConsumer.java
+++ b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/adapter/rest/SubstationRestConsumer.java
@@ -29,7 +29,7 @@ public class SubstationRestConsumer {
* @return
*/
public Substation getSubstation(final Long id) {
- final String uri = PropsUtil.get("rest.uri.substation") + id.toString();
+ final String uri = PropsUtil.get("esb.url.base") + PropsUtil.get("esb.rest.uri.substation") + id.toString();
return restTemplate.getForObject(uri, Substation.class);
}
} \ No newline at end of file
diff --git a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/adapter/rest/SynchronousMachineRestConsumer.java b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/adapter/rest/SynchronousMachineRestConsumer.java
index 74ea279f..d97a512e 100644
--- a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/adapter/rest/SynchronousMachineRestConsumer.java
+++ b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/adapter/rest/SynchronousMachineRestConsumer.java
@@ -24,11 +24,12 @@ public class SynchronousMachineRestConsumer {
/**
* Get SynchronousMachine from REST-Service
+ *
* @param id
* @return
*/
public SynchronousMachine getSynchronousMachine(final Long id) {
- final String uri = PropsUtil.get("rest.uri.synchronousmachine") + id.toString();
+ final String uri = PropsUtil.get("esb.url.base") + PropsUtil.get("esb.rest.uri.synchronousmachine") + id.toString();
return restTemplate.getForObject(uri, SynchronousMachine.class);
}
}
diff --git a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/controller/rest/GeographicalRegionRestController.java b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/controller/rest/GeographicalRegionRestController.java
index 076d2071..07d682bd 100644
--- a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/controller/rest/GeographicalRegionRestController.java
+++ b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/controller/rest/GeographicalRegionRestController.java
@@ -41,6 +41,7 @@ public class GeographicalRegionRestController {
return Lists.newArrayList(geographicalRegionRepository.findAll());
}
+ @JsonView(IncludeAttribute4Json.Topology.class)
@RequestMapping(value = "/topology/geographicalregion/{id}", method = RequestMethod.GET)
public GeographicalRegion findOne(@PathVariable final Long id) {
LOG.info("calling REST - find GeographicalRegion with id: " + id);
diff --git a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/controller/rest/SubstationRestController.java b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/controller/rest/SubstationRestController.java
index fed5c024..19341512 100644
--- a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/controller/rest/SubstationRestController.java
+++ b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/controller/rest/SubstationRestController.java
@@ -73,7 +73,7 @@ public class SubstationRestController {
*
* @return
*/
- @JsonView(IncludeAttribute4Json.Substation4Lov.class)
+ @JsonView(IncludeAttribute4Json.SubstationLov.class)
@RequestMapping(value = "/substation/lov", method = RequestMethod.GET)
public List<Substation> findAllSubstation4Lov() {
return substationService.getSubsationHoldingSynchronousMachine();
diff --git a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/controller/rest/config/IncludeAttribute4Json.java b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/controller/rest/config/IncludeAttribute4Json.java
index 507b2d30..5ab13e70 100644
--- a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/controller/rest/config/IncludeAttribute4Json.java
+++ b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/controller/rest/config/IncludeAttribute4Json.java
@@ -26,7 +26,7 @@ public class IncludeAttribute4Json {
public interface SynchronousMachine {
}
- public interface Substation4Lov {
+ public interface SubstationLov {
}
public interface SubGeographicalRegion {
diff --git a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/core/EquipmentContainer.java b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/core/EquipmentContainer.java
index fe6f0c20..0acc2d6e 100644
--- a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/core/EquipmentContainer.java
+++ b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/core/EquipmentContainer.java
@@ -48,7 +48,7 @@ import java.util.List;
@Access(AccessType.FIELD)
public class EquipmentContainer extends ConnectivityNodeContainer {
- @JsonView(IncludeAttribute4Json.Substation4Lov.class)
+ @JsonView(IncludeAttribute4Json.SubstationLov.class)
@Id
@TableGenerator(name = "EquipmentContainerTableGen",
table = "OPENK_CACHEDB_SEQ_TABLE",
@@ -65,7 +65,7 @@ public class EquipmentContainer extends ConnectivityNodeContainer {
@JsonView({IncludeAttribute4Json.Topology.class,
IncludeAttribute4Json.NetworkState.class,
- IncludeAttribute4Json.Substation4Lov.class})
+ IncludeAttribute4Json.SubstationLov.class})
@Column(name = "NAME")
private String name;
@@ -131,4 +131,7 @@ public class EquipmentContainer extends ConnectivityNodeContainer {
return synchronousMachineList;
}
+ public List<AcLineSegment> getAcLineSegmentList() {
+ return acLineSegmentList;
+ }
}
diff --git a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/domain/ReductionSetting.java b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/domain/ReductionSetting.java
index c0448b0f..e5f4cc56 100644
--- a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/domain/ReductionSetting.java
+++ b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/domain/ReductionSetting.java
@@ -49,9 +49,9 @@ public class ReductionSetting {
@JsonView(IncludeAttribute4Json.SynchronousMachine.class)
@Embedded
@AttributeOverride(name = "value", column = @Column(name = "REDUCTION_SETTING_PER_CENT"))
- private PerCent value;
+ private PerCent setting;
- public PerCent getValue() {
- return value;
+ public PerCent getSetting() {
+ return setting;
}
}
diff --git a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/domain/Voltage.java b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/domain/Voltage.java
index 3e1660d0..0aa0b8a9 100644
--- a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/domain/Voltage.java
+++ b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/domain/Voltage.java
@@ -26,14 +26,17 @@ import java.math.BigDecimal;
@Embeddable
public class Voltage {
- @JsonView(IncludeAttribute4Json.Topology.class)
+ @JsonView({IncludeAttribute4Json.Topology.class,
+ IncludeAttribute4Json.SynchronousMachine.class})
private BigDecimal value;
- @JsonView(IncludeAttribute4Json.Topology.class)
+ @JsonView({IncludeAttribute4Json.Topology.class,
+ IncludeAttribute4Json.SynchronousMachine.class})
@Enumerated(EnumType.STRING)
private UnitMultiplier multiplier;
- @JsonView(IncludeAttribute4Json.Topology.class)
+ @JsonView({IncludeAttribute4Json.Topology.class,
+ IncludeAttribute4Json.SynchronousMachine.class})
@Enumerated(EnumType.STRING)
private final UnitSymbol unit = UnitSymbol.V;
diff --git a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/wires/SynchronousMachine.java b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/wires/SynchronousMachine.java
index b9ecdc9f..8bf962ae 100644
--- a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/wires/SynchronousMachine.java
+++ b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/wires/SynchronousMachine.java
@@ -19,7 +19,9 @@ import org.eclipse.openk.controller.rest.config.IncludeAttribute4Json;
import org.eclipse.openk.model.common.Location;
import org.eclipse.openk.model.core.Terminal;
import org.eclipse.openk.model.domain.CommunicationType;
+import org.eclipse.openk.model.domain.PerCent;
import org.eclipse.openk.model.domain.ReductionSetting;
+import org.eclipse.openk.model.domain.Voltage;
import org.eclipse.openk.model.informative.infoperations.PsrEvent;
import org.eclipse.openk.model.meas.Analog;
import org.eclipse.openk.model.production.GeneratingUnit;
@@ -27,9 +29,12 @@ import org.eclipse.openk.model.utils.converter.Boolean2StringConverter;
import javax.persistence.Access;
import javax.persistence.AccessType;
+import javax.persistence.AttributeOverride;
+import javax.persistence.AttributeOverrides;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Convert;
+import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
@@ -42,6 +47,7 @@ import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.TableGenerator;
import javax.persistence.Transient;
+import javax.validation.constraints.NotNull;
import java.util.List;
@JsonIgnoreProperties(ignoreUnknown = true)
@@ -61,12 +67,15 @@ public class SynchronousMachine extends RotatingMachine {
@Column(name = "ID")
private Long id;
- @JsonView({IncludeAttribute4Json.Topology.class, IncludeAttribute4Json.NetworkState.class,
+ @JsonView({IncludeAttribute4Json.Topology.class,
+ IncludeAttribute4Json.NetworkState.class,
IncludeAttribute4Json.SynchronousMachine.class})
+ @NotNull
@Column(name = "MRID")
private String mRid;
- @JsonView({IncludeAttribute4Json.Topology.class, IncludeAttribute4Json.NetworkState.class,
+ @JsonView({IncludeAttribute4Json.Topology.class,
+ IncludeAttribute4Json.NetworkState.class,
IncludeAttribute4Json.SynchronousMachine.class})
@Column(name = "NAME")
private String name;
@@ -76,22 +85,41 @@ public class SynchronousMachine extends RotatingMachine {
@Column(name = "NORMALLY_IN_SERVICE")
private Boolean normallyInService;
+ @JsonView(IncludeAttribute4Json.SynchronousMachine.class)
+ @Convert(converter = Boolean2StringConverter.class)
+ @Column(name = "CONTROL_ENABLED")
+ private Boolean controlEnabled;
+
+ /**
+ * Maximum voltage limit for the unit.
+ */
+ @JsonView(IncludeAttribute4Json.SynchronousMachine.class)
+ @Embedded
+ @AttributeOverrides({
+ @AttributeOverride(name = "value", column = @Column(name = "MAX_VOLTAGE_LIMIT_VALUE")),
+ @AttributeOverride(name = "multiplier", column = @Column(name = "MAX_VOLTAGE_LIMIT_UNIT_MULTIPLIER")),
+ @AttributeOverride(name = "unit", column = @Column(name = "MAX_VOLTAGE_LIMIT_UNIT_SYMBOL"))
+ })
+ private Voltage maxU;
+
+
/**
* Modes that this synchronous machine can operate in.
*/
- @JsonView({IncludeAttribute4Json.Topology.class,IncludeAttribute4Json.SynchronousMachine.class})
+ @NotNull
+ @JsonView({IncludeAttribute4Json.Topology.class, IncludeAttribute4Json.SynchronousMachine.class})
@Enumerated(EnumType.STRING)
@Column(name = "SYNCHRONOUS_MACHINE_KIND")
private SynchronousMachineKind synchronousMachineKind;
- // todo: ist das hier richtig? das ist eigentlich ein Messwert?
/**
- * Reduction setting which is set.
+ * Reduction setting which is currently set.
* CIM extension by Jan Krueger, April 2015
*/
-// @Embedded
-// @AttributeOverride(name = "value", column = @Column(name = "REDUCTION_SETTING_PER_CENT"))
-// private PerCent reductionSetting;
+ @JsonView(IncludeAttribute4Json.SynchronousMachine.class)
+ @Embedded
+ @AttributeOverride(name = "value", column = @Column(name = "CURRENT_REDUCTION_SETTING_PER_CENT"))
+ private PerCent currentReductionSetting;
/**
* All reduction settings of a Synchronous Machine, e.g. 30%, 60% and 100%
@@ -114,6 +142,15 @@ public class SynchronousMachine extends RotatingMachine {
private Integer feedInRanking;
/**
+ * The feed-in priority of a generator (SynchronousMachine)
+ * 1 - high priority, ... 5 - low priority
+ * CIM extension by Jan Krueger, April 2015
+ */
+ @JsonView(IncludeAttribute4Json.SynchronousMachine.class)
+ @Column(name = "FEED_IN_PRIORITY")
+ private Integer feedInPriority;
+
+ /**
* Communication Type EFT, FWT, TRA
* CIM extension by Jan Krueger, April 2015
*/
@@ -131,18 +168,10 @@ public class SynchronousMachine extends RotatingMachine {
private Integer communicationGroup;
/**
- * SynchronousMachine is referenced.
- * CIM extension by Jan Krueger, April 2015
- */
- @JsonView(IncludeAttribute4Json.SynchronousMachine.class)
- @Convert(converter = Boolean2StringConverter.class)
- @Column(name = "REFERENCE_SYNCHRONOUS_MACHINE")
- private Boolean parentSynchronousMachine;
-
- /**
* Referenced SynchronousMachine
* CIM extension by Jan Krueger, April 2015
*/
+ // todo: das sollte mRid sein siehe referencedSynchronousMachineMrid
@JsonIgnore
@ManyToOne
@JoinColumn(name = "SYNCHRONOUS_MACHINE_ID", referencedColumnName = "ID")
@@ -233,12 +262,23 @@ public class SynchronousMachine extends RotatingMachine {
return communicationGroup;
}
- public Boolean isParentSynchronousMachine() {
- return parentSynchronousMachine;
- }
-
public SynchronousMachine getReferencedSynchronousMachine() {
return referencedSynchronousMachine;
}
+ public Voltage getMaxU() {
+ return maxU;
+ }
+
+ public PerCent getCurrentReductionSetting() {
+ return currentReductionSetting;
+ }
+
+ public Boolean getControlEnabled() {
+ return controlEnabled;
+ }
+
+ public Integer getFeedInPriority() {
+ return feedInPriority;
+ }
}
diff --git a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/wires/SynchronousMachineKind.java b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/wires/SynchronousMachineKind.java
index e28a5cd5..3e88dafc 100644
--- a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/wires/SynchronousMachineKind.java
+++ b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/wires/SynchronousMachineKind.java
@@ -15,9 +15,9 @@ package org.eclipse.openk.model.wires;
import com.fasterxml.jackson.annotation.JsonValue;
public enum SynchronousMachineKind {
- GENERATOR("generator"),
- CONDENSER("condenser"),
- MOTOR("motor");
+ GENERATOR("GENERATOR"),
+ CONDENSER("CONDENSER"),
+ MOTOR("MOTOR");
// generatorOrCondenser,
// generatorOrMotor,
// motorOrCondenser,
diff --git a/openk-platform/openk-cachedb-service/src/main/resources/flyway-migration/V01/_00/OPENK_CACHEDB_V01_00_001__init.sql b/openk-platform/openk-cachedb-service/src/main/resources/flyway-migration/V01/_00/OPENK_CACHEDB_V01_00_001__init.sql
index 55061db6..2331769e 100644
--- a/openk-platform/openk-cachedb-service/src/main/resources/flyway-migration/V01/_00/OPENK_CACHEDB_V01_00_001__init.sql
+++ b/openk-platform/openk-cachedb-service/src/main/resources/flyway-migration/V01/_00/OPENK_CACHEDB_V01_00_001__init.sql
@@ -120,20 +120,24 @@ ALTER TABLE GENERATING_UNIT OWNER TO cachedb;
CREATE TABLE SYNCHRONOUS_MACHINE
(
- ID INTEGER NOT NULL,
- MRID VARCHAR(16),
- NAME VARCHAR(64),
- NORMALLY_IN_SERVICE VARCHAR(5),
- SYNCHRONOUS_MACHINE_KIND VARCHAR(32),
- -- REDUCTION_SETTING_PER_CENT INTEGER,
- FEED_IN_RANKING INTEGER,
- COMMUNICATION_TYPE VARCHAR(12),
- COMMUNICATION_GROUP INTEGER,
- REFERENCE_SYNCHRONOUS_MACHINE VARCHAR(5),
- SYNCHRONOUS_MACHINE_ID INTEGER,
- GENERATING_UNIT_ID INTEGER,
- LOCATION_ID INTEGER,
- EQUIPMENT_CONTAINER_ID INTEGER,
+ ID INTEGER NOT NULL,
+ MRID VARCHAR(16) NOT NULL,
+ NAME VARCHAR(64),
+ NORMALLY_IN_SERVICE VARCHAR(5),
+ MAX_VOLTAGE_LIMIT_VALUE NUMERIC,
+ MAX_VOLTAGE_LIMIT_UNIT_MULTIPLIER VARCHAR(12),
+ MAX_VOLTAGE_LIMIT_UNIT_SYMBOL VARCHAR(12),
+ SYNCHRONOUS_MACHINE_KIND VARCHAR(32) NOT NULL,
+ CURRENT_REDUCTION_SETTING_PER_CENT INTEGER,
+ FEED_IN_RANKING INTEGER,
+ FEED_IN_PRIORITY INTEGER,
+ COMMUNICATION_TYPE VARCHAR(12),
+ COMMUNICATION_GROUP INTEGER,
+ CONTROL_ENABLED VARCHAR(5),
+ SYNCHRONOUS_MACHINE_ID INTEGER,
+ GENERATING_UNIT_ID INTEGER,
+ LOCATION_ID INTEGER,
+ EQUIPMENT_CONTAINER_ID INTEGER,
CONSTRAINT "PK_SYNCHRONOUS_MACHINE_ID" PRIMARY KEY (ID),
CONSTRAINT "FK_SYNCHRONOUS_MACHINE_SYNCHRONOUS_MACHINE" FOREIGN KEY (SYNCHRONOUS_MACHINE_ID) REFERENCES SYNCHRONOUS_MACHINE (ID) ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "FK_SYNCHRONOUS_MACHINE_GENERATING_UNIT" FOREIGN KEY (GENERATING_UNIT_ID) REFERENCES GENERATING_UNIT (ID) ON UPDATE NO ACTION ON DELETE NO ACTION,
diff --git a/openk-platform/openk-cachedb-service/src/main/webapp/WEB-INF/restful-servlet.xml b/openk-platform/openk-cachedb-service/src/main/webapp/WEB-INF/restful-servlet.xml
index a863a9a1..6886b00f 100644
--- a/openk-platform/openk-cachedb-service/src/main/webapp/WEB-INF/restful-servlet.xml
+++ b/openk-platform/openk-cachedb-service/src/main/webapp/WEB-INF/restful-servlet.xml
@@ -16,7 +16,9 @@
http://hmkcode.com/spring-mvc-return-json-using-responseboyd/
-->
<context:component-scan
- base-package="org.eclipse.openk.controller.rest, org.eclipse.openk.adapter.rest, org.eclipse.openk.service"/>
+ base-package="org.eclipse.openk.controller.rest,
+ org.eclipse.openk.adapter.rest,
+ org.eclipse.openk.service"/>
<mvc:annotation-driven/>
<!--
diff --git a/openk-platform/openk-cachedb-service/src/test/java/org/eclipse/openk/adapter/rest/GeographicalRegionRestConsumerTest.java b/openk-platform/openk-cachedb-service/src/test/java/org/eclipse/openk/adapter/rest/GeographicalRegionRestConsumerTest.java
index eea4a02f..4354a50b 100644
--- a/openk-platform/openk-cachedb-service/src/test/java/org/eclipse/openk/adapter/rest/GeographicalRegionRestConsumerTest.java
+++ b/openk-platform/openk-cachedb-service/src/test/java/org/eclipse/openk/adapter/rest/GeographicalRegionRestConsumerTest.java
@@ -12,37 +12,135 @@
*/
package org.eclipse.openk.adapter.rest;
+import org.eclipse.openk.controller.rest.config.IncludeAttribute4Json;
import org.eclipse.openk.model.core.GeographicalRegion;
+import org.eclipse.openk.model.core.SubGeographicalRegion;
+import org.eclipse.openk.model.core.Substation;
import org.eclipse.openk.repository.AbstractRepositoryJpaTest;
import org.eclipse.openk.repository.GeographicalRegionRepository;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.MediaType;
+import org.springframework.test.web.client.MockRestServiceServer;
+import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.client.RestTemplate;
+import org.testng.Assert;
+import org.testng.annotations.AfterMethod;
import org.testng.annotations.Test;
+import javax.persistence.Query;
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.util.List;
+
+import static org.springframework.test.web.client.match.MockRestRequestMatchers.method;
+import static org.springframework.test.web.client.match.MockRestRequestMatchers.requestTo;
+import static org.springframework.test.web.client.response.MockRestResponseCreators.withSuccess;
+
public class GeographicalRegionRestConsumerTest extends AbstractRepositoryJpaTest {
@Autowired
private GeographicalRegionRepository geographicalRegionRepository;
-// @Autowired
-// private GeographicalRegionRestConsumer geographicalRegionRestConsumer;
+ @AfterMethod
+ private void cleanup() {
+ deleteDataTopology();
+ }
- final RestTemplate restTemplate = new RestTemplate();
+ @Test(enabled = false) // nur enablen, wenn Liferay Portal gestartet ist
+ public void getAndSaveGeographicalRegion() {
+ RestTemplate restTemplate = new RestTemplate();
+ GeographicalRegion geographicalRegionNew =
+ restTemplate.getForObject("http://localhost:8080/openk-cachedb-service/rest/topology/geographicalregion/1000", GeographicalRegion.class);
+ geographicalRegionRepository.save(geographicalRegionNew);
+ }
-// @Test
- public void saveGeographicalRegionTest() {
+ @Test()
+ public void getAndSaveGeographicalRegionFromJsonFile() throws IOException, URISyntaxException {
- // todo: just for testing the adapter => to be deleted from here
-// final GeographicalRegion geographicalRegionNew = geographicalRegionRestConsumer.getGeographicalRegion();
+ final String contentJson = getContentOfJsonFile("json-test-samples/geographicalregion-sample-03.json");
- GeographicalRegion geographicalRegionNew =
- restTemplate.getForObject("http://localhost:8080/openk-cachedb-service/rest/topology/geographicalregion/1000", GeographicalRegion.class);
+ RestTemplate restTemplate = new RestTemplate();
+ MockRestServiceServer mockServer = MockRestServiceServer.createServer(restTemplate);
+ mockServer.expect(requestTo("/openk-cachedb-service/rest/topology/geographicalregion/1000")).andExpect(method(HttpMethod.GET))
+ .andRespond(withSuccess(contentJson, MediaType.APPLICATION_JSON));
+ GeographicalRegion geographicalRegion =
+ restTemplate.getForObject(
+ "/openk-cachedb-service/rest/topology/geographicalregion/1000",
+ GeographicalRegion.class);
- geographicalRegionRepository.save(geographicalRegionNew);
+ mockServer.verify();
+
+ Assert.assertTrue(geographicalRegion.getName().startsWith(PREFIX_TEST_NAME));
+ Assert.assertFalse(geographicalRegion.getmRid().isEmpty());
+ Assert.assertFalse(geographicalRegion.getSubGeographicalRegionList().isEmpty());
+ SubGeographicalRegion subGeographicalRegion = geographicalRegion.getSubGeographicalRegionList().get(0);
+ Assert.assertEquals(subGeographicalRegion.getName(), "UnitTest - Netzgebiet A");
+ Substation substation = subGeographicalRegion.getSubstationList().get(0);
+ Assert.assertEquals(substation.getName(), "UnitTest - Substation01 - Ortsnetzstation Stopfenheim");
+ Assert.assertEquals(substation.getSynchronousMachineList().size(), 2);
+ Assert.assertEquals(substation.getConnectivityNodeList().size(), 3);
+ Assert.assertEquals(substation.getVoltageLevelList().size(), 0);
+ Assert.assertEquals(substation.getAcLineSegmentList().size(), 1);
+
+ geographicalRegionRepository.save(geographicalRegion);
+
+ Assert.assertEquals(getCountTerminals(), Long.valueOf(82));
+ Assert.assertEquals(getCountConnectivityNode(), Long.valueOf(19));
+ }
+
+ // Test mit Measurement, allerdings sind in der Topology die Messdaten nicht enthalten
+ @Test()
+ public void getAndSaveGeographicalRegionFromJsonFileWithMeasurement() throws IOException, URISyntaxException {
+
+ final String contentJson = getContentOfJsonFile("json-test-samples/geographicalregion-sample-02.json");
+
+ RestTemplate restTemplate = new RestTemplate();
+ MockRestServiceServer mockServer = MockRestServiceServer.createServer(restTemplate);
+
+ mockServer.expect(requestTo("/openk-cachedb-service/rest/topology/geographicalregion/1000")).andExpect(method(HttpMethod.GET))
+ .andRespond(withSuccess(contentJson, MediaType.APPLICATION_JSON));
+
+ GeographicalRegion geographicalRegion =
+ restTemplate.getForObject(
+ "/openk-cachedb-service/rest/topology/geographicalregion/1000",
+ GeographicalRegion.class);
+
+ mockServer.verify();
+ Assert.assertTrue(geographicalRegion.getName().startsWith(PREFIX_TEST_NAME));
+ Assert.assertFalse(geographicalRegion.getmRid().isEmpty());
+ Assert.assertFalse(geographicalRegion.getSubGeographicalRegionList().isEmpty());
+ SubGeographicalRegion subGeographicalRegion = geographicalRegion.getSubGeographicalRegionList().get(0);
+ Assert.assertEquals(subGeographicalRegion.getName(), "UnitTest - Netzgebiet A");
+ Substation substation = subGeographicalRegion.getSubstationList().get(0);
+ Assert.assertEquals(substation.getName(), "UnitTest - Substation01 - Ortsnetzstation Stopfenheim");
+ Assert.assertEquals(substation.getSynchronousMachineList().size(), 1);
+ Assert.assertEquals(substation.getConnectivityNodeList().size(), 3);
+ Assert.assertEquals(substation.getVoltageLevelList().size(), 0);
+ Assert.assertEquals(substation.getAcLineSegmentList().size(), 1);
+ geographicalRegionRepository.save(geographicalRegion);
+
+ Assert.assertEquals(getCountTerminals(), Long.valueOf(82));
+ Assert.assertEquals(getCountConnectivityNode(), Long.valueOf(19));
+ }
+
+ private Long getCountTerminals(){
+ Query selectCountTerminal = entityManager.createNativeQuery(
+ "select count(*) from terminal where name like ?1");
+ selectCountTerminal.setParameter(1, PREFIX_TEST_NAME + "%");
+ return (Long) selectCountTerminal.getSingleResult();
}
+ private Long getCountConnectivityNode(){
+ Query selectCountConnectivityNode = entityManager.createNativeQuery(
+ "select count(*) from connectivity_node where name like ?1");
+ selectCountConnectivityNode.setParameter(1, PREFIX_TEST_NAME + "%");
+ return (Long) selectCountConnectivityNode.getSingleResult();
+ }
+
+
}
diff --git a/openk-platform/openk-cachedb-service/src/test/java/org/eclipse/openk/adapter/rest/SynchronousMachineRestConsumerTest.java b/openk-platform/openk-cachedb-service/src/test/java/org/eclipse/openk/adapter/rest/SynchronousMachineRestConsumerTest.java
index 4ca0b673..072f9927 100644
--- a/openk-platform/openk-cachedb-service/src/test/java/org/eclipse/openk/adapter/rest/SynchronousMachineRestConsumerTest.java
+++ b/openk-platform/openk-cachedb-service/src/test/java/org/eclipse/openk/adapter/rest/SynchronousMachineRestConsumerTest.java
@@ -12,20 +12,39 @@
*/
package org.eclipse.openk.adapter.rest;
+import org.eclipse.openk.model.core.GeographicalRegion;
+import org.eclipse.openk.model.core.SubGeographicalRegion;
+import org.eclipse.openk.model.core.Substation;
import org.eclipse.openk.model.wires.SynchronousMachine;
import org.eclipse.openk.repository.AbstractRepositoryJpaTest;
import org.eclipse.openk.repository.SynchronousMachineRepository;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.MediaType;
+import org.springframework.test.web.client.MockRestServiceServer;
import org.springframework.web.client.RestTemplate;
+import org.testng.Assert;
+import org.testng.annotations.AfterMethod;
import org.testng.annotations.Test;
+import java.io.IOException;
+import java.net.URISyntaxException;
import java.util.Arrays;
+import static org.springframework.test.web.client.match.MockRestRequestMatchers.method;
+import static org.springframework.test.web.client.match.MockRestRequestMatchers.requestTo;
+import static org.springframework.test.web.client.response.MockRestResponseCreators.withSuccess;
+
public class SynchronousMachineRestConsumerTest extends AbstractRepositoryJpaTest {
@Autowired
private SynchronousMachineRepository synchronousMachineRepository;
+ @AfterMethod
+ private void cleanup() {
+ deleteDataTopology();
+ }
+
// nur lokal testen wenn Liferay gestartet ist...
@Test(enabled = false)
public void getSynchronousMachine() {
@@ -33,14 +52,36 @@ public class SynchronousMachineRestConsumerTest extends AbstractRepositoryJpaTes
final RestTemplate restTemplate = new RestTemplate();
final String uri = "http://localhost:8080/openk-cachedb-service/rest/synchronousmachine/";
-
SynchronousMachine[] synchronousMachineList = restTemplate.getForObject(uri, SynchronousMachine[].class);
for (SynchronousMachine synchronousMachine : Arrays.asList(synchronousMachineList)) {
synchronousMachineRepository.save(synchronousMachine);
}
-
}
+ @Test()
+ public void getAndSaveSynchronousMachineListFromJsonFile() throws IOException, URISyntaxException {
+
+ final String contentJson = getContentOfJsonFile("json-test-samples/synchronousmachine-sample-02.json");
+
+ RestTemplate restTemplate = new RestTemplate();
+ MockRestServiceServer mockServer = MockRestServiceServer.createServer(restTemplate);
+
+ final String uri = "/openk-cachedb-service/rest/synchronousmachine/";
+
+ mockServer.expect(requestTo(uri)).andExpect(method(HttpMethod.GET))
+ .andRespond(withSuccess(contentJson, MediaType.APPLICATION_JSON));
+
+ SynchronousMachine[] synchronousMachineList = restTemplate.getForObject(uri, SynchronousMachine[].class);
+
+ mockServer.verify();
+
+ Assert.assertEquals(synchronousMachineList.length, 3);
+
+ for (SynchronousMachine synchronousMachine : Arrays.asList(synchronousMachineList)) {
+ Assert.assertTrue(synchronousMachine.getGeneratingUnit() != null);
+ synchronousMachineRepository.save(synchronousMachine);
+ }
+ }
}
diff --git a/openk-platform/openk-cachedb-service/src/test/java/org/eclipse/openk/repository/AbstractRepositoryJpaTest.java b/openk-platform/openk-cachedb-service/src/test/java/org/eclipse/openk/repository/AbstractRepositoryJpaTest.java
index bac7810c..d1f89913 100644
--- a/openk-platform/openk-cachedb-service/src/test/java/org/eclipse/openk/repository/AbstractRepositoryJpaTest.java
+++ b/openk-platform/openk-cachedb-service/src/test/java/org/eclipse/openk/repository/AbstractRepositoryJpaTest.java
@@ -1,15 +1,19 @@
-/*******************************************************************************
+/**
+ * ****************************************************************************
* Copyright (c) 2015 BTC AG.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ * <p/>
* Contributors:
- * Jan Krueger - initial API and implementation
- *******************************************************************************/
+ * Jan Krueger - initial API and implementation
+ * *****************************************************************************
+ */
package org.eclipse.openk.repository;
+import com.google.common.base.Charsets;
+import com.google.common.io.CharStreams;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.TestExecutionListeners;
import org.springframework.test.context.testng.AbstractTestNGSpringContextTests;
@@ -17,9 +21,124 @@ import org.springframework.test.context.transaction.TransactionConfiguration;
import org.springframework.test.context.transaction.TransactionalTestExecutionListener;
import org.springframework.transaction.annotation.Transactional;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.persistence.Query;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.net.URISyntaxException;
+import java.util.List;
+
@TransactionConfiguration(defaultRollback = false)
@Transactional(value = "cacheDbTransactionManager", rollbackFor = Throwable.class)
@TestExecutionListeners(TransactionalTestExecutionListener.class)
@ContextConfiguration(locations = {"classpath:database-spring-data-test.xml"})
public class AbstractRepositoryJpaTest extends AbstractTestNGSpringContextTests {
+
+ protected final static String PREFIX_TEST_NAME = "UnitTest - ";
+
+ @PersistenceContext(unitName = "cacheDbEntityManagerFactory")
+ protected EntityManager entityManager;
+
+ protected String getContentOfJsonFile(final String path) throws IOException, URISyntaxException {
+ return CharStreams.toString(new InputStreamReader(ClassLoader.getSystemResourceAsStream(path), Charsets.UTF_8));
+ }
+
+ protected void deleteDataTopology() {
+
+ Query deleteTerminalStatement = entityManager.createNativeQuery(
+ "delete from terminal where name like ?1");
+ deleteTerminalStatement.setParameter(1, PREFIX_TEST_NAME + "%");
+ deleteTerminalStatement.executeUpdate();
+
+ Query deletePsrEventStatement = entityManager.createNativeQuery(
+ "delete from psr_event where synchronous_machine_id in (select id from synchronous_machine where name like ?1)");
+ deletePsrEventStatement.setParameter(1, PREFIX_TEST_NAME + "%");
+ deletePsrEventStatement.executeUpdate();
+
+ Query deleteReductionSettingStatement = entityManager.createNativeQuery(
+ "delete from reduction_setting where synchronous_machine_id in (select id from synchronous_machine where name like ?1)");
+ deleteReductionSettingStatement.setParameter(1, PREFIX_TEST_NAME + "%");
+ deleteReductionSettingStatement.executeUpdate();
+
+ Query deleteMeasurementAnalogValueStatement = entityManager.createNativeQuery(
+ "delete from measurement_analog_value where measurement_analog_id in " +
+ "(select id from measurement_analog where synchronous_machine_id in (select id from synchronous_machine where name like ?1))");
+ deleteMeasurementAnalogValueStatement.setParameter(1, PREFIX_TEST_NAME + "%");
+ deleteMeasurementAnalogValueStatement.executeUpdate();
+
+ Query deleteMeasurementAnalogStatement = entityManager.createNativeQuery(
+ "delete from measurement_analog where synchronous_machine_id in (select id from synchronous_machine where name like ?1)");
+ deleteMeasurementAnalogStatement.setParameter(1, PREFIX_TEST_NAME + "%");
+ deleteMeasurementAnalogStatement.executeUpdate();
+
+ Query deletePositionPointStatement = entityManager.createNativeQuery(
+ "delete from position_point where location_id in (select location_id from synchronous_machine where name like ?1)");
+ deletePositionPointStatement.setParameter(1, PREFIX_TEST_NAME + "%");
+ deletePositionPointStatement.executeUpdate();
+
+ Query selectGeneratingUnit = entityManager.createNativeQuery(
+ "select generating_unit_id from synchronous_machine where name like ?1");
+ selectGeneratingUnit.setParameter(1, PREFIX_TEST_NAME + "%");
+ List<Integer> generatingUnitIdList = (List<Integer>) selectGeneratingUnit.getResultList();
+
+ Query deleteSynchronousMachineStatement = entityManager.createNativeQuery(
+ "delete from synchronous_machine where name like ?1");
+ deleteSynchronousMachineStatement.setParameter(1, PREFIX_TEST_NAME + "%");
+ deleteSynchronousMachineStatement.executeUpdate();
+
+ for (Integer id : generatingUnitIdList) {
+ Query deleteGeneratingUnitStatement = entityManager.createNativeQuery(
+ "delete from generating_unit where id = ?1");
+ deleteGeneratingUnitStatement.setParameter(1, id);
+ deleteGeneratingUnitStatement.executeUpdate();
+ }
+
+ Query deleteLocationStatement = entityManager.createNativeQuery(
+ "delete from location where name like ?1");
+ deleteLocationStatement.setParameter(1, PREFIX_TEST_NAME + "%");
+ deleteLocationStatement.executeUpdate();
+
+ Query deleteSwitchStatement = entityManager.createNativeQuery(
+ "delete from switch where name like ?1");
+ deleteSwitchStatement.setParameter(1, PREFIX_TEST_NAME + "%");
+ deleteSwitchStatement.executeUpdate();
+
+ Query deleteBusbarSectionStatement = entityManager.createNativeQuery(
+ "delete from busbar_section where name like ?1");
+ deleteBusbarSectionStatement.setParameter(1, PREFIX_TEST_NAME + "%");
+ deleteBusbarSectionStatement.executeUpdate();
+
+ Query deleteAcLineSegmentStatement = entityManager.createNativeQuery(
+ "delete from ac_line_segment where name like ?1");
+ deleteAcLineSegmentStatement.setParameter(1, PREFIX_TEST_NAME + "%");
+ deleteAcLineSegmentStatement.executeUpdate();
+
+ Query deletePowerTransformerStatement = entityManager.createNativeQuery(
+ "delete from power_transformer where name like ?1");
+ deletePowerTransformerStatement.setParameter(1, PREFIX_TEST_NAME + "%");
+ deletePowerTransformerStatement.executeUpdate();
+
+ Query deleteConnectivtyNodeStatement = entityManager.createNativeQuery(
+ "delete from connectivity_node where name like ?1");
+ deleteConnectivtyNodeStatement.setParameter(1, PREFIX_TEST_NAME + "%");
+ deleteConnectivtyNodeStatement.executeUpdate();
+
+ Query deleteEquipmentContainerStatement = entityManager.createNativeQuery(
+ "delete from equipment_container where name like ?1");
+ deleteEquipmentContainerStatement.setParameter(1, PREFIX_TEST_NAME + "%");
+ deleteEquipmentContainerStatement.executeUpdate();
+
+ Query deleteSubGeographicalRegionStatement = entityManager.createNativeQuery(
+ "delete from subgeographical_region where name like ?1");
+ deleteSubGeographicalRegionStatement.setParameter(1, PREFIX_TEST_NAME + "%");
+ deleteSubGeographicalRegionStatement.executeUpdate();
+
+ Query deleteGeographicalRegionStatement = entityManager.createNativeQuery(
+ "delete from geographical_region where name like ?1");
+ deleteGeographicalRegionStatement.setParameter(1, PREFIX_TEST_NAME + "%");
+ deleteGeographicalRegionStatement.executeUpdate();
+ }
+
+
}
diff --git a/openk-platform/openk-cachedb-service/src/test/java/org/eclipse/openk/repository/SynchronousMachineRepositoryTest.java b/openk-platform/openk-cachedb-service/src/test/java/org/eclipse/openk/repository/SynchronousMachineRepositoryTest.java
index a2e0d86a..6e883fb5 100644
--- a/openk-platform/openk-cachedb-service/src/test/java/org/eclipse/openk/repository/SynchronousMachineRepositoryTest.java
+++ b/openk-platform/openk-cachedb-service/src/test/java/org/eclipse/openk/repository/SynchronousMachineRepositoryTest.java
@@ -63,10 +63,11 @@ public class SynchronousMachineRepositoryTest extends AbstractRepositoryJpaTest
private void insertData() {
Query insertSynchronousMachine = entityManager.createNativeQuery(
"INSERT INTO SYNCHRONOUS_MACHINE " +
- "(ID, MRID) " +
- "VALUES (?1, ?2)");
+ "(ID, MRID, SYNCHRONOUS_MACHINE_KIND) " +
+ "VALUES (?1, ?2, ?3)");
insertSynchronousMachine.setParameter(1, 5557L);
insertSynchronousMachine.setParameter(2, "Test5557");
+ insertSynchronousMachine.setParameter(3, "GENERATOR");
insertSynchronousMachine.executeUpdate();
}
diff --git a/openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/geographicalregion-sample-01.json b/openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/geographicalregion-sample-01.json
index daf5f88f..bdeba850 100644
--- a/openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/geographicalregion-sample-01.json
+++ b/openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/geographicalregion-sample-01.json
@@ -1,5 +1,5 @@
[{
- "name": "Geamtes Netz Netzbetreiber A",
+ "name": "Test - Geamtes Netz Netzbetreiber A",
"mRid": "1000",
"subGeographicalRegionList": [ {
"name": "Netzgebiet A",
diff --git a/openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/geographicalregion-sample-02.json b/openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/geographicalregion-sample-02.json
index f0d014d9..cb4ff4d8 100644
--- a/openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/geographicalregion-sample-02.json
+++ b/openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/geographicalregion-sample-02.json
@@ -1,52 +1,52 @@
{
- "name": "Geamtes Netz Netzbetreiber A",
+ "name": "UnitTest - Geamtes Netz Netzbetreiber A",
"mRid": "1000",
"subGeographicalRegionList": [ {
- "name": "Netzgebiet A",
+ "name": "UnitTest - Netzgebiet A",
"mRid": "1000",
"substationList": [
{
- "name": "Substation01 - Ortsnetzstation Stopfenheim",
+ "name": "UnitTest - Substation01 - Ortsnetzstation Stopfenheim",
"mRid": "236454466",
"connectivityNodeList": [
{
- "name": "CN01",
+ "name": "UnitTest - CN01",
"mRid": "12359",
"terminalList": [
{
- "name": "T01",
+ "name": "UnitTest - T01",
"mRid": "1000"
},
{
- "name": "T02",
+ "name": "UnitTest - T02",
"mRid": "1002"
}
]
},
{
- "name": "CN02",
+ "name": "UnitTest - CN02",
"mRid": "235699898",
"terminalList": [
{
- "name": "T03",
+ "name": "UnitTest - T03",
"mRid": "1003"
},
{
- "name": "T04",
+ "name": "UnitTest - T04",
"mRid": "1004"
}
]
},
{
- "name": "CN03",
+ "name": "UnitTest - CN03",
"mRid": "2343589",
"terminalList": [
{
- "name": "T05",
+ "name": "UnitTest - T05",
"mRid": "1005"
},
{
- "name": "T06",
+ "name": "UnitTest - T06",
"mRid": "1006"
}
]
@@ -56,7 +56,7 @@
"busbarSectionList": [],
"switchList": [],
"synchronousMachineList": [ {
- "name": "SynchronousMachine01",
+ "name": "UnitTest - SynchronousMachine01",
"mRid": "458899",
"psrEventList": [ {
"createdDateTime": {"value": "2015-12-10"},
@@ -64,10 +64,10 @@
}],
"normallyInService": true,
"terminalList": [ {
- "name": "T01",
+ "name": "UnitTest - T01",
"mRid": "1000"
}],
- "synchronousMachineKind": "generator",
+ "synchronousMachineKind": "GENERATOR",
"reductionSettingList": [
{"value": {"value": 10}},
{"value": {"value": 20}},
@@ -95,17 +95,17 @@
"registeredGenerator": {"unitType": "PHOT"}
},
"location": {
- "name": "Location01",
+ "name": "UnitTest - Location01",
"electronicAddress": {"email": "mail@einspeiser-01.de"},
"mainAddress": {
"streetDetail": {
- "name": "Strasse A",
+ "name": "UnitTest - Strasse A",
"number": "21"
},
"postalCode": "22000",
"townDetail": {
"country": "Germany",
- "name": "City A"
+ "name": "UnitTest - City A"
}
},
"positionPointList": [ {
@@ -144,19 +144,19 @@
}]
}],
"acLineSegmentList": [ {
- "name": "Cable01",
+ "name": "UnitTest - Cable01",
"mRid": "45889",
"terminalList": [
{
- "name": "T02",
+ "name": "UnitTest - T02",
"mRid": "1002"
},
{
- "name": "T04",
+ "name": "UnitTest - T04",
"mRid": "1004"
},
{
- "name": "T05",
+ "name": "UnitTest - T05",
"mRid": "1005"
}
]
@@ -164,18 +164,18 @@
"voltageLevelList": []
},
{
- "name": "Substation02 - Ortsnetzstation Störzelbach",
+ "name": "UnitTest - Substation02 - Ortsnetzstation Störzelbach",
"mRid": "23222666",
"connectivityNodeList": [ {
- "name": "CN04",
+ "name": "UnitTest - CN04",
"mRid": "222333589",
"terminalList": [
{
- "name": "T07",
+ "name": "UnitTest - T07",
"mRid": "1007"
},
{
- "name": "T08",
+ "name": "UnitTest - T08",
"mRid": "1008"
}
]
@@ -183,30 +183,30 @@
"powerTransformerList": [],
"busbarSectionList": [],
"switchList": [ {
- "name": "Switch01",
+ "name": "UnitTest - Switch01",
"mRid": "1000",
"terminalList": [
{
- "name": "T06",
+ "name": "UnitTest - T06",
"mRid": "1006"
},
{
- "name": "T07",
+ "name": "UnitTest - T07",
"mRid": "1007"
}
],
"open": false
}],
"synchronousMachineList": [ {
- "name": "SynchronousMachine02",
+ "name": "UnitTest - SynchronousMachine02",
"mRid": "2000",
"psrEventList": [],
"normallyInService": true,
"terminalList": [ {
- "name": "T03",
+ "name": "UnitTest - T03",
"mRid": "1003"
}],
- "synchronousMachineKind": "generator",
+ "synchronousMachineKind": "GENERATOR",
"reductionSettingList": [],
"feedInRanking": 15,
"communicationType": "EFT",
@@ -228,7 +228,7 @@
"registeredGenerator": {"unitType": "PTUR"}
},
"location": {
- "name": "Location02",
+ "name": "UnitTest - Location02",
"electronicAddress": {"email": "mail@einspeiser-02.de"},
"mainAddress": {
"streetDetail": {
@@ -255,15 +255,15 @@
}]
}],
"acLineSegmentList": [ {
- "name": "Cable02",
+ "name": "UnitTest - Cable02",
"mRid": "1034534501",
"terminalList": [
{
- "name": "T08",
+ "name": "UnitTest - T08",
"mRid": "1008"
},
{
- "name": "T09",
+ "name": "UnitTest - T09",
"mRid": "1009"
}
]
@@ -271,41 +271,41 @@
"voltageLevelList": []
},
{
- "name": "Substation03 - Ortsnetzstation Alesheim04",
+ "name": "UnitTest - Substation03 - Ortsnetzstation Alesheim04",
"mRid": "2366456",
"connectivityNodeList": [
{
- "name": "CN05",
+ "name": "UnitTest - CN05",
"mRid": "25789989",
"terminalList": [
{
- "name": "T09",
+ "name": "UnitTest - T09",
"mRid": "1009"
},
{
- "name": "T10",
+ "name": "UnitTest - T10",
"mRid": "1010"
}
]
},
{
- "name": "CN06",
+ "name": "UnitTest - CN06",
"mRid": "25341189",
"terminalList": [
{
- "name": "T11",
+ "name": "UnitTest - T11",
"mRid": "1011"
},
{
- "name": "T12",
+ "name": "UnitTest - T12",
"mRid": "1012"
},
{
- "name": "T13",
+ "name": "UnitTest - T13",
"mRid": "1013"
},
{
- "name": "T14",
+ "name": "UnitTest - T14",
"mRid": "1014"
}
]
@@ -315,45 +315,45 @@
"busbarSectionList": [],
"switchList": [
{
- "name": "Switch02",
+ "name": "UnitTest - Switch02",
"mRid": "2000",
"terminalList": [
{
- "name": "T10",
+ "name": "UnitTest - T10",
"mRid": "1010"
},
{
- "name": "T11",
+ "name": "UnitTest - T11",
"mRid": "1011"
}
],
"open": false
},
{
- "name": "Switch03",
+ "name": "UnitTest - Switch03",
"mRid": "3000",
"terminalList": [
{
- "name": "T12",
+ "name": "UnitTest - T12",
"mRid": "1012"
},
{
- "name": "T16",
+ "name": "UnitTest - T16",
"mRid": "1016"
}
],
"open": true
},
{
- "name": "Switch04",
+ "name": "UnitTest - Switch04",
"mRid": "1003",
"terminalList": [
{
- "name": "T13",
+ "name": "UnitTest - T13",
"mRid": "1013"
},
{
- "name": "T15",
+ "name": "UnitTest - T15",
"mRid": "1015"
}
],
@@ -361,15 +361,15 @@
}
],
"synchronousMachineList": [ {
- "name": "SynchronousMachine03",
+ "name": "UnitTest - SynchronousMachine03",
"mRid": "1002",
"psrEventList": [],
"normallyInService": true,
"terminalList": [ {
- "name": "T14",
+ "name": "UnitTest - T14",
"mRid": "1014"
}],
- "synchronousMachineKind": "generator",
+ "synchronousMachineKind": "GENERATOR",
"reductionSettingList": [],
"feedInRanking": 15,
"communicationType": "EFT",
@@ -391,7 +391,7 @@
"registeredGenerator": {"unitType": "WIND"}
},
"location": {
- "name": "Location03",
+ "name": "UnitTest - Location03",
"electronicAddress": {"email": "mail@einspeiser-03.de"},
"mainAddress": {
"streetDetail": {
@@ -412,18 +412,18 @@
"voltageLevelList": []
},
{
- "name": "Substation04 - Ortsnetzstation A02",
+ "name": "UnitTest - Substation04 - Ortsnetzstation A02",
"mRid": "236453466",
"connectivityNodeList": [ {
- "name": "CN07",
+ "name": "UnitTest - CN07",
"mRid": "25546489",
"terminalList": [
{
- "name": "T16",
+ "name": "UnitTest - T16",
"mRid": "1016"
},
{
- "name": "T17",
+ "name": "UnitTest - T17",
"mRid": "1017"
}
]
@@ -433,15 +433,15 @@
"switchList": [],
"synchronousMachineList": [],
"acLineSegmentList": [ {
- "name": "Cable03",
+ "name": "UnitTest - Cable03",
"mRid": "1034534501",
"terminalList": [
{
- "name": "T17",
+ "name": "UnitTest - T17",
"mRid": "1017"
},
{
- "name": "T18",
+ "name": "UnitTest - T18",
"mRid": "1018"
}
]
@@ -449,18 +449,18 @@
"voltageLevelList": []
},
{
- "name": "Substation05 - Ortsnetzstation A06",
+ "name": "UnitTest - Substation05 - Ortsnetzstation A06",
"mRid": "34423666",
"connectivityNodeList": [ {
- "name": "CN08",
+ "name": "UnitTest - CN08",
"mRid": "1045507",
"terminalList": [
{
- "name": "T18",
+ "name": "UnitTest - T18",
"mRid": "1018"
},
{
- "name": "T19",
+ "name": "UnitTest - T19",
"mRid": "1019"
}
]
@@ -470,15 +470,15 @@
"switchList": [],
"synchronousMachineList": [],
"acLineSegmentList": [ {
- "name": "Cable04",
+ "name": "UnitTest - Cable04",
"mRid": "1034534501",
"terminalList": [
{
- "name": "T19",
+ "name": "UnitTest - T19",
"mRid": "1019"
},
{
- "name": "T20",
+ "name": "UnitTest - T20",
"mRid": "1020"
}
]
@@ -486,18 +486,18 @@
"voltageLevelList": []
},
{
- "name": "Substation06 - Ortsnetzstation Alesheim06",
+ "name": "UnitTest - Substation06 - Ortsnetzstation Alesheim06",
"mRid": "2367766",
"connectivityNodeList": [ {
- "name": "CN09",
+ "name": "UnitTest - CN09",
"mRid": "2577789",
"terminalList": [
{
- "name": "T20",
+ "name": "UnitTest - T20",
"mRid": "1020"
},
{
- "name": "T21",
+ "name": "UnitTest - T21",
"mRid": "1021"
}
]
@@ -507,15 +507,15 @@
"switchList": [],
"synchronousMachineList": [],
"acLineSegmentList": [ {
- "name": "Cable05",
+ "name": "UnitTest - Cable05",
"mRid": "10454301",
"terminalList": [
{
- "name": "T21",
+ "name": "UnitTest - T21",
"mRid": "1021"
},
{
- "name": "T22",
+ "name": "UnitTest - T22",
"mRid": "1022"
}
]
@@ -523,33 +523,33 @@
"voltageLevelList": []
},
{
- "name": "Substation07 - Ortsnetzstation A03",
+ "name": "UnitTest - Substation07 - Ortsnetzstation A03",
"mRid": "2368866",
"connectivityNodeList": [
{
- "name": "CN10",
+ "name": "UnitTest - CN10",
"mRid": "29000589",
"terminalList": [
{
- "name": "T22",
+ "name": "UnitTest - T22",
"mRid": "1022"
},
{
- "name": "T23",
+ "name": "UnitTest - T23",
"mRid": "1023"
}
]
},
{
- "name": "CN11",
+ "name": "UnitTest - CN11",
"mRid": "258345349",
"terminalList": [
{
- "name": "T24",
+ "name": "UnitTest - T24",
"mRid": "1024"
},
{
- "name": "T25",
+ "name": "UnitTest - T25",
"mRid": "1024"
}
]
@@ -560,15 +560,15 @@
"switchList": [],
"synchronousMachineList": [],
"acLineSegmentList": [ {
- "name": "Cable06",
+ "name": "UnitTest - Cable06",
"mRid": "1042534234301",
"terminalList": [
{
- "name": "T23",
+ "name": "UnitTest - T23",
"mRid": "1023"
},
{
- "name": "T24",
+ "name": "UnitTest - T24",
"mRid": "1024"
}
]
@@ -576,22 +576,22 @@
"voltageLevelList": []
},
{
- "name": "Substation08 - Ortsnetzstation W02",
+ "name": "UnitTest - Substation08 - Ortsnetzstation W02",
"mRid": "23633366",
"connectivityNodeList": [ {
- "name": "CN12",
+ "name": "UnitTest - CN12",
"mRid": "253453489",
"terminalList": [
{
- "name": "T26",
+ "name": "UnitTest - T26",
"mRid": "1025"
},
{
- "name": "T27",
+ "name": "UnitTest - T27",
"mRid": "1026"
},
{
- "name": "T28",
+ "name": "UnitTest - T28",
"mRid": "1027"
}
]
@@ -601,15 +601,15 @@
"switchList": [],
"synchronousMachineList": [],
"acLineSegmentList": [ {
- "name": "Cable07",
+ "name": "UnitTest - Cable07",
"mRid": "104234301",
"terminalList": [
{
- "name": "T25",
+ "name": "UnitTest - T25",
"mRid": "1024"
},
{
- "name": "T26",
+ "name": "UnitTest - T26",
"mRid": "1025"
}
]
@@ -617,19 +617,19 @@
"voltageLevelList": []
},
{
- "name": "Substation09 - Umspannwerk WAHF",
+ "name": "UnitTest - Substation09 - Umspannwerk WAHF",
"mRid": "23633366",
"connectivityNodeList": [],
"powerTransformerList": [ {
- "name": "PowerTransformer01",
+ "name": "UnitTest - PowerTransformer01",
"mRid": "1000100",
"terminalList": [
{
- "name": "T39",
+ "name": "UnitTest - T39",
"mRid": "1038"
},
{
- "name": "T40",
+ "name": "UnitTest - T40",
"mRid": "1039"
}
]
@@ -640,18 +640,18 @@
"acLineSegmentList": [],
"voltageLevelList": [
{
- "name": "VoltageLevel01 - 110kV",
+ "name": "UnitTest - VoltageLevel01 - 110kV",
"mRid": "236634336",
"connectivityNodeList": [ {
- "name": "CN18",
+ "name": "UnitTest - CN18",
"mRid": "8888884",
"terminalList": [
{
- "name": "T40",
+ "name": "UnitTest - T40",
"mRid": "1039"
},
{
- "name": "T41",
+ "name": "UnitTest - T41",
"mRid": "1040"
}
]
@@ -661,10 +661,10 @@
"switchList": [],
"synchronousMachineList": [],
"acLineSegmentList": [ {
- "name": "Cable08",
+ "name": "UnitTest - Cable08",
"mRid": "188804234301",
"terminalList": [ {
- "name": "T41",
+ "name": "UnitTest - T41",
"mRid": "1040"
}]
}],
@@ -675,79 +675,79 @@
}
},
{
- "name": "VoltageLevel02",
+ "name": "UnitTest - VoltageLevel02",
"mRid": "8974455",
"connectivityNodeList": [
{
- "name": "CN13",
+ "name": "UnitTest - CN13",
"mRid": "2533434453489",
"terminalList": [
{
- "name": "T29",
+ "name": "UnitTest - T29",
"mRid": "1028"
},
{
- "name": "T30",
+ "name": "UnitTest - T30",
"mRid": "1029"
}
]
},
{
- "name": "CN14",
+ "name": "UnitTest - CN14",
"mRid": "2534534",
"terminalList": [
{
- "name": "T31",
+ "name": "UnitTest - T31",
"mRid": "1030"
},
{
- "name": "T32",
+ "name": "UnitTest - T32",
"mRid": "1031"
}
]
},
{
- "name": "CN15",
+ "name": "UnitTest - CN15",
"mRid": "2534587834",
"terminalList": [
{
- "name": "T33",
+ "name": "UnitTest - T33",
"mRid": "1032"
},
{
- "name": "T34",
+ "name": "UnitTest - T34",
"mRid": "1033"
}
]
},
{
- "name": "CN16",
+ "name": "UnitTest - CN16",
"mRid": "25345434",
"terminalList": [
{
- "name": "T35",
+ "name": "UnitTest - T35",
"mRid": "1034"
},
{
- "name": "T36",
+ "name": "UnitTest - T36",
"mRid": "1035"
}
]
},
{
- "name": "CN17",
+ "name": "UnitTest - CN17",
"mRid": "2534343834",
"terminalList": [
{
- "name": "T37",
+ "name": "UnitTest - T37",
"mRid": "1036"
},
{
- "name": "T38",
+ "name": "UnitTest - T38",
"mRid": "1037"
},
{
- "name": "T39",
+ "name": "UnitTest - T39",
"mRid": "1038"
}
]
@@ -756,29 +756,29 @@
"powerTransformerList": [],
"busbarSectionList": [
{
- "name": "BusbarSection01",
+ "name": "UnitTest - BusbarSection01",
"mRid": "5488855",
"terminalList": [
{
- "name": "T32",
+ "name": "UnitTest - T32",
"mRid": "1031"
},
{
- "name": "T35",
+ "name": "UnitTest - T35",
"mRid": "1034"
}
]
},
{
- "name": "BusbarSection02",
+ "name": "UnitTest - BusbarSection02",
"mRid": "53423488855",
"terminalList": [
{
- "name": "T30",
+ "name": "UnitTest - T30",
"mRid": "1029"
},
{
- "name": "T33",
+ "name": "UnitTest - T33",
"mRid": "1032"
}
]
@@ -786,60 +786,60 @@
],
"switchList": [
{
- "name": "Switch05",
+ "name": "UnitTest - Switch05",
"mRid": "1004",
"terminalList": [
{
- "name": "T27",
+ "name": "UnitTest - T27",
"mRid": "1026"
},
{
- "name": "T31",
+ "name": "UnitTest - T31",
"mRid": "1030"
}
],
"open": true
},
{
- "name": "Switch06",
+ "name": "UnitTest - Switch06",
"mRid": "1005",
"terminalList": [
{
- "name": "T28",
+ "name": "UnitTest - T28",
"mRid": "1027"
},
{
- "name": "T29",
+ "name": "UnitTest - T29",
"mRid": "1028"
}
],
"open": true
},
{
- "name": "Switch07",
+ "name": "UnitTest - Switch07",
"mRid": "1006",
"terminalList": [
{
- "name": "T36",
+ "name": "UnitTest - T36",
"mRid": "1035"
},
{
- "name": "T38",
+ "name": "UnitTest - T38",
"mRid": "1037"
}
],
"open": true
},
{
- "name": "Switch08",
+ "name": "UnitTest - Switch08",
"mRid": "1007",
"terminalList": [
{
- "name": "T34",
+ "name": "UnitTest - T34",
"mRid": "1033"
},
{
- "name": "T37",
+ "name": "UnitTest - T37",
"mRid": "1036"
}
],
@@ -857,13 +857,13 @@
]
},
{
- "name": "Substation10 - Ortsnetzstation Alesheim05A",
+ "name": "UnitTest - Substation10 - Ortsnetzstation Alesheim05A",
"mRid": "23633366",
"connectivityNodeList": [ {
- "name": "CN19",
+ "name": "UnitTest - CN19",
"mRid": "1018",
"terminalList": [ {
- "name": "T15",
+ "name": "UnitTest - T15",
"mRid": "1015"
}]
}],
diff --git a/openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/geographicalregion-sample-03.json b/openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/geographicalregion-sample-03.json
new file mode 100644
index 00000000..e859ade6
--- /dev/null
+++ b/openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/geographicalregion-sample-03.json
@@ -0,0 +1,717 @@
+{
+ "name": "UnitTest - Geamtes Netz Netzbetreiber A",
+ "mRid": "1000",
+ "subGeographicalRegionList": [ {
+ "name": "UnitTest - Netzgebiet A",
+ "mRid": "1000",
+ "substationList": [
+ {
+ "name": "UnitTest - Substation01 - Ortsnetzstation Stopfenheim",
+ "mRid": "236454466",
+ "connectivityNodeList": [
+ {
+ "name": "UnitTest - CN01",
+ "mRid": "12359",
+ "terminalList": [
+ {
+ "name": "UnitTest - T01",
+ "mRid": "1000"
+ },
+ {
+ "name": "UnitTest - T02",
+ "mRid": "1002"
+ }
+ ]
+ },
+ {
+ "name": "UnitTest - CN02",
+ "mRid": "235699898",
+ "terminalList": [
+ {
+ "name": "UnitTest - T03",
+ "mRid": "1003"
+ },
+ {
+ "name": "UnitTest - T04",
+ "mRid": "1004"
+ }
+ ]
+ },
+ {
+ "name": "UnitTest - CN03",
+ "mRid": "2343589",
+ "terminalList": [
+ {
+ "name": "UnitTest - T05",
+ "mRid": "1005"
+ },
+ {
+ "name": "UnitTest - T06",
+ "mRid": "1006"
+ }
+ ]
+ }
+ ],
+ "powerTransformerList": [],
+ "busbarSectionList": [],
+ "switchList": [],
+ "synchronousMachineList": [
+ {
+ "name": "UnitTest - SynchronousMachine01",
+ "mRid": "458899",
+ "terminalList": [ {
+ "name": "UnitTest - T01",
+ "mRid": "1000"
+ }],
+ "synchronousMachineKind": "GENERATOR",
+ "generatingUnit": {"registeredGenerator": {"unitType": "PHOT"}}
+ },
+ {
+ "name": "UnitTest - SynchronousMachine02",
+ "mRid": "2000",
+ "terminalList": [ {
+ "name": "UnitTest - T03",
+ "mRid": "1003"
+ }],
+ "synchronousMachineKind": "GENERATOR",
+ "generatingUnit": {"registeredGenerator": {"unitType": "PTUR"}}
+ }
+ ],
+ "acLineSegmentList": [ {
+ "name": "UnitTest - Cable01",
+ "mRid": "45889",
+ "terminalList": [
+ {
+ "name": "UnitTest - T02",
+ "mRid": "1002"
+ },
+ {
+ "name": "UnitTest - T04",
+ "mRid": "1004"
+ },
+ {
+ "name": "UnitTest - T05",
+ "mRid": "1005"
+ }
+ ]
+ }],
+ "voltageLevelList": []
+ },
+ {
+ "name": "UnitTest - Substation02 - Ortsnetzstation Störzelbach",
+ "mRid": "23222666",
+ "connectivityNodeList": [ {
+ "name": "UnitTest - CN04",
+ "mRid": "222333589",
+ "terminalList": [
+ {
+ "name": "UnitTest - T07",
+ "mRid": "1007"
+ },
+ {
+ "name": "UnitTest - T08",
+ "mRid": "1008"
+ }
+ ]
+ }],
+ "powerTransformerList": [],
+ "busbarSectionList": [],
+ "switchList": [ {
+ "name": "UnitTest - Switch01",
+ "mRid": "1000",
+ "terminalList": [
+ {
+ "name": "UnitTest - T06",
+ "mRid": "1006"
+ },
+ {
+ "name": "UnitTest - T07",
+ "mRid": "1007"
+ }
+ ]
+ }],
+ "synchronousMachineList": [],
+ "acLineSegmentList": [ {
+ "name": "UnitTest - Cable02",
+ "mRid": "1034534501",
+ "terminalList": [
+ {
+ "name": "UnitTest - T08",
+ "mRid": "1008"
+ },
+ {
+ "name": "UnitTest - T09",
+ "mRid": "1009"
+ }
+ ]
+ }],
+ "voltageLevelList": []
+ },
+ {
+ "name": "UnitTest - Substation03 - Ortsnetzstation Alesheim04",
+ "mRid": "2366456",
+ "connectivityNodeList": [
+ {
+ "name": "UnitTest - CN05",
+ "mRid": "25789989",
+ "terminalList": [
+ {
+ "name": "UnitTest - T09",
+ "mRid": "1009"
+ },
+ {
+ "name": "UnitTest - T10",
+ "mRid": "1010"
+ }
+ ]
+ },
+ {
+ "name": "UnitTest - CN06",
+ "mRid": "25341189",
+ "terminalList": [
+ {
+ "name": "UnitTest - T11",
+ "mRid": "1011"
+ },
+ {
+ "name": "UnitTest - T12",
+ "mRid": "1012"
+ },
+ {
+ "name": "UnitTest - T13",
+ "mRid": "1013"
+ },
+ {
+ "name": "UnitTest - T14",
+ "mRid": "1014"
+ }
+ ]
+ }
+ ],
+ "powerTransformerList": [],
+ "busbarSectionList": [],
+ "switchList": [
+ {
+ "name": "UnitTest - Switch02",
+ "mRid": "2000",
+ "terminalList": [
+ {
+ "name": "UnitTest - T10",
+ "mRid": "1010"
+ },
+ {
+ "name": "UnitTest - T11",
+ "mRid": "1011"
+ }
+ ]
+ },
+ {
+ "name": "UnitTest - Switch03",
+ "mRid": "3000",
+ "terminalList": [
+ {
+ "name": "UnitTest - T12",
+ "mRid": "1012"
+ },
+ {
+ "name": "UnitTest - T16",
+ "mRid": "1016"
+ }
+ ]
+ },
+ {
+ "name": "UnitTest - Switch04",
+ "mRid": "1003",
+ "terminalList": [
+ {
+ "name": "UnitTest - T13",
+ "mRid": "1013"
+ },
+ {
+ "name": "UnitTest - T15",
+ "mRid": "1015"
+ }
+ ]
+ }
+ ],
+ "synchronousMachineList": [ {
+ "name": "UnitTest - SynchronousMachine03",
+ "mRid": "1002",
+ "terminalList": [ {
+ "name": "UnitTest - T14",
+ "mRid": "1014"
+ }],
+ "synchronousMachineKind": "GENERATOR",
+ "generatingUnit": {"registeredGenerator": {"unitType": "WIND"}}
+ }],
+ "acLineSegmentList": [],
+ "voltageLevelList": []
+ },
+ {
+ "name": "UnitTest - Substation04 - Ortsnetzstation A02",
+ "mRid": "236453466",
+ "connectivityNodeList": [ {
+ "name": "UnitTest - CN07",
+ "mRid": "25546489",
+ "terminalList": [
+ {
+ "name": "UnitTest - T16",
+ "mRid": "1016"
+ },
+ {
+ "name": "UnitTest - T17",
+ "mRid": "1017"
+ }
+ ]
+ }],
+ "powerTransformerList": [],
+ "busbarSectionList": [],
+ "switchList": [],
+ "synchronousMachineList": [],
+ "acLineSegmentList": [ {
+ "name": "UnitTest - Cable03",
+ "mRid": "1034534501",
+ "terminalList": [
+ {
+ "name": "UnitTest - T17",
+ "mRid": "1017"
+ },
+ {
+ "name": "UnitTest - T18",
+ "mRid": "1018"
+ }
+ ]
+ }],
+ "voltageLevelList": []
+ },
+ {
+ "name": "UnitTest - Substation05 - Ortsnetzstation A06",
+ "mRid": "34423666",
+ "connectivityNodeList": [ {
+ "name": "UnitTest - CN08",
+ "mRid": "1045507",
+ "terminalList": [
+ {
+ "name": "UnitTest - T18",
+ "mRid": "1018"
+ },
+ {
+ "name": "UnitTest - T19",
+ "mRid": "1019"
+ }
+ ]
+ }],
+ "powerTransformerList": [],
+ "busbarSectionList": [],
+ "switchList": [],
+ "synchronousMachineList": [],
+ "acLineSegmentList": [ {
+ "name": "UnitTest - Cable04",
+ "mRid": "1034534501",
+ "terminalList": [
+ {
+ "name": "UnitTest - T19",
+ "mRid": "1019"
+ },
+ {
+ "name": "UnitTest - T20",
+ "mRid": "1020"
+ }
+ ]
+ }],
+ "voltageLevelList": []
+ },
+ {
+ "name": "UnitTest - Substation06 - Ortsnetzstation Alesheim06",
+ "mRid": "2367766",
+ "connectivityNodeList": [ {
+ "name": "UnitTest - CN09",
+ "mRid": "2577789",
+ "terminalList": [
+ {
+ "name": "UnitTest - T20",
+ "mRid": "1020"
+ },
+ {
+ "name": "UnitTest - T21",
+ "mRid": "1021"
+ }
+ ]
+ }],
+ "powerTransformerList": [],
+ "busbarSectionList": [],
+ "switchList": [],
+ "synchronousMachineList": [],
+ "acLineSegmentList": [ {
+ "name": "UnitTest - Cable05",
+ "mRid": "10454301",
+ "terminalList": [
+ {
+ "name": "UnitTest - T21",
+ "mRid": "1021"
+ },
+ {
+ "name": "UnitTest - T22",
+ "mRid": "1022"
+ }
+ ]
+ }],
+ "voltageLevelList": []
+ },
+ {
+ "name": "UnitTest - Substation07 - Ortsnetzstation A03",
+ "mRid": "2368866",
+ "connectivityNodeList": [
+ {
+ "name": "UnitTest - CN10",
+ "mRid": "29000589",
+ "terminalList": [
+ {
+ "name": "UnitTest - T22",
+ "mRid": "1022"
+ },
+ {
+ "name": "UnitTest - T23",
+ "mRid": "1023"
+ }
+ ]
+ },
+ {
+ "name": "UnitTest - CN11",
+ "mRid": "258345349",
+ "terminalList": [
+ {
+ "name": "UnitTest - T24",
+ "mRid": "1024"
+ },
+ {
+ "name": "UnitTest - T25",
+ "mRid": "1024"
+ }
+ ]
+ }
+ ],
+ "powerTransformerList": [],
+ "busbarSectionList": [],
+ "switchList": [],
+ "synchronousMachineList": [],
+ "acLineSegmentList": [ {
+ "name": "UnitTest - Cable06",
+ "mRid": "1042534234301",
+ "terminalList": [
+ {
+ "name": "UnitTest - T23",
+ "mRid": "1023"
+ },
+ {
+ "name": "UnitTest - T24",
+ "mRid": "1024"
+ }
+ ]
+ }],
+ "voltageLevelList": []
+ },
+ {
+ "name": "UnitTest - Substation08 - Ortsnetzstation W02",
+ "mRid": "23633366",
+ "connectivityNodeList": [ {
+ "name": "UnitTest - CN12",
+ "mRid": "253453489",
+ "terminalList": [
+ {
+ "name": "UnitTest - T26",
+ "mRid": "1025"
+ },
+ {
+ "name": "UnitTest - T27",
+ "mRid": "1026"
+ },
+ {
+ "name": "UnitTest - T28",
+ "mRid": "1027"
+ }
+ ]
+ }],
+ "powerTransformerList": [],
+ "busbarSectionList": [],
+ "switchList": [],
+ "synchronousMachineList": [],
+ "acLineSegmentList": [ {
+ "name": "UnitTest - Cable07",
+ "mRid": "104234301",
+ "terminalList": [
+ {
+ "name": "UnitTest - T25",
+ "mRid": "1024"
+ },
+ {
+ "name": "UnitTest - T26",
+ "mRid": "1025"
+ }
+ ]
+ }],
+ "voltageLevelList": []
+ },
+ {
+ "name": "UnitTest - Substation09 - Umspannwerk WAHF",
+ "mRid": "23633366",
+ "connectivityNodeList": [],
+ "powerTransformerList": [ {
+ "name": "UnitTest - PowerTransformer01",
+ "mRid": "1000100",
+ "terminalList": [
+ {
+ "name": "UnitTest - T39",
+ "mRid": "1038"
+ },
+ {
+ "name": "UnitTest - T40",
+ "mRid": "1039"
+ }
+ ]
+ }],
+ "busbarSectionList": [],
+ "switchList": [],
+ "synchronousMachineList": [],
+ "acLineSegmentList": [],
+ "voltageLevelList": [
+ {
+ "name": "UnitTest - VoltageLevel01 - 110kV",
+ "mRid": "236634336",
+ "connectivityNodeList": [ {
+ "name": "UnitTest - CN18",
+ "mRid": "8888884",
+ "terminalList": [
+ {
+ "name": "UnitTest - T40",
+ "mRid": "1039"
+ },
+ {
+ "name": "UnitTest - T41",
+ "mRid": "1040"
+ }
+ ]
+ }],
+ "powerTransformerList": [],
+ "busbarSectionList": [],
+ "switchList": [],
+ "synchronousMachineList": [],
+ "acLineSegmentList": [ {
+ "name": "UnitTest - Cable08",
+ "mRid": "188804234301",
+ "terminalList": [ {
+ "name": "UnitTest - T41",
+ "mRid": "1040"
+ }]
+ }],
+ "highVoltageLimit": {
+ "value": 110,
+ "multiplier": "k",
+ "unit": "V"
+ }
+ },
+ {
+ "name": "UnitTest - VoltageLevel02",
+ "mRid": "8974455",
+ "connectivityNodeList": [
+ {
+ "name": "UnitTest - CN13",
+ "mRid": "2533434453489",
+ "terminalList": [
+ {
+ "name": "UnitTest - T29",
+ "mRid": "1028"
+ },
+ {
+ "name": "UnitTest - T30",
+ "mRid": "1029"
+ }
+ ]
+ },
+ {
+ "name": "UnitTest - CN14",
+ "mRid": "2534534",
+ "terminalList": [
+ {
+ "name": "UnitTest - T31",
+ "mRid": "1030"
+ },
+ {
+ "name": "UnitTest - T32",
+ "mRid": "1031"
+ }
+ ]
+ },
+ {
+ "name": "UnitTest - CN15",
+ "mRid": "2534587834",
+ "terminalList": [
+ {
+ "name": "UnitTest - T33",
+ "mRid": "1032"
+ },
+ {
+ "name": "UnitTest - T34",
+ "mRid": "1033"
+ }
+ ]
+ },
+ {
+ "name": "UnitTest - CN16",
+ "mRid": "25345434",
+ "terminalList": [
+ {
+ "name": "UnitTest - T35",
+ "mRid": "1034"
+ },
+ {
+ "name": "UnitTest - T36",
+ "mRid": "1035"
+ }
+ ]
+ },
+ {
+ "name": "UnitTest - CN17",
+ "mRid": "2534343834",
+ "terminalList": [
+ {
+ "name": "UnitTest - T37",
+ "mRid": "1036"
+ },
+ {
+ "name": "UnitTest - T38",
+ "mRid": "1037"
+ },
+ {
+ "name": "UnitTest - T39",
+ "mRid": "1038"
+ }
+ ]
+ }
+ ],
+ "powerTransformerList": [],
+ "busbarSectionList": [
+ {
+ "name": "UnitTest - BusbarSection01",
+ "mRid": "5488855",
+ "terminalList": [
+ {
+ "name": "UnitTest - T32",
+ "mRid": "1031"
+ },
+ {
+ "name": "UnitTest - T35",
+ "mRid": "1034"
+ }
+ ]
+ },
+ {
+ "name": "UnitTest - BusbarSection02",
+ "mRid": "53423488855",
+ "terminalList": [
+ {
+ "name": "UnitTest - T30",
+ "mRid": "1029"
+ },
+ {
+ "name": "UnitTest - T33",
+ "mRid": "1032"
+ }
+ ]
+ }
+ ],
+ "switchList": [
+ {
+ "name": "UnitTest - Switch05",
+ "mRid": "1004",
+ "terminalList": [
+ {
+ "name": "UnitTest - T27",
+ "mRid": "1026"
+ },
+ {
+ "name": "UnitTest - T31",
+ "mRid": "1030"
+ }
+ ]
+ },
+ {
+ "name": "UnitTest - Switch06",
+ "mRid": "1005",
+ "terminalList": [
+ {
+ "name": "UnitTest - T28",
+ "mRid": "1027"
+ },
+ {
+ "name": "UnitTest - T29",
+ "mRid": "1028"
+ }
+ ]
+ },
+ {
+ "name": "UnitTest - Switch07",
+ "mRid": "1006",
+ "terminalList": [
+ {
+ "name": "UnitTest - T36",
+ "mRid": "1035"
+ },
+ {
+ "name": "UnitTest - T38",
+ "mRid": "1037"
+ }
+ ]
+ },
+ {
+ "name": "UnitTest - Switch08",
+ "mRid": "1007",
+ "terminalList": [
+ {
+ "name": "UnitTest - T34",
+ "mRid": "1033"
+ },
+ {
+ "name": "UnitTest - T37",
+ "mRid": "1036"
+ }
+ ]
+ }
+ ],
+ "synchronousMachineList": [ {
+ "name": "UnitTest - SynchronousMachine99",
+ "mRid": "1002",
+ "terminalList": [],
+ "synchronousMachineKind": "GENERATOR",
+ "generatingUnit": {"registeredGenerator": {"unitType": "WIND"}}
+ }],
+ "acLineSegmentList": [],
+ "highVoltageLimit": {
+ "value": 20,
+ "multiplier": "k",
+ "unit": "V"
+ }
+ }
+ ]
+ },
+ {
+ "name": "UnitTest - Substation10 - Ortsnetzstation Alesheim05A",
+ "mRid": "23633366",
+ "connectivityNodeList": [ {
+ "name": "UnitTest - CN19",
+ "mRid": "1018",
+ "terminalList": [ {
+ "name": "UnitTest - T15",
+ "mRid": "1015"
+ }]
+ }],
+ "powerTransformerList": [],
+ "busbarSectionList": [],
+ "switchList": [],
+ "synchronousMachineList": [],
+ "acLineSegmentList": [],
+ "voltageLevelList": []
+ }
+ ]
+ }]
+} \ No newline at end of file
diff --git a/openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/synchronousmachine-sample-01.json b/openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/synchronousmachine-sample-01.json
index 92e035a5..2b3ac294 100644
--- a/openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/synchronousmachine-sample-01.json
+++ b/openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/synchronousmachine-sample-01.json
@@ -1,6 +1,6 @@
[
{
- "name": "SynchronousMachine01",
+ "name": "UnitTest - SynchronousMachine01",
"mRid": "458899",
"psrEventList": [ {
"createdDateTime": {"value": "2015-12-10"},
@@ -8,7 +8,7 @@
}],
"normallyInService": true,
"terminalList": [ {
- "name": "T01",
+ "name": "UnitTest - T01",
"mRid": "1000"
}],
"synchronousMachineKind": "generator",
diff --git a/openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/synchronousmachine-sample-02.json b/openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/synchronousmachine-sample-02.json
index 64c0a816..3b642346 100644
--- a/openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/synchronousmachine-sample-02.json
+++ b/openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/synchronousmachine-sample-02.json
@@ -1,13 +1,13 @@
[
{
- "name": "SynchronousMachine01",
+ "name": "UnitTest - SynchronousMachine01",
"mRid": "458899",
"psrEventList": [ {
"createdDateTime": {"value": "2015-12-10"},
"psrEventKind": "inService"
}],
"normallyInService": true,
- "synchronousMachineKind": "generator",
+ "synchronousMachineKind": "GENERATOR",
"reductionSettingList": [
{"value": {"value": 10}},
{"value": {"value": 20}},
@@ -35,7 +35,7 @@
"registeredGenerator": {"unitType": "PHOT"}
},
"location": {
- "name": "Location01",
+ "name": "UnitTest - Location01",
"electronicAddress": {"email": "mail@einspeiser-01.de"},
"mainAddress": {
"streetDetail": {
@@ -57,11 +57,11 @@
}
},
{
- "name": "SynchronousMachine02",
+ "name": "UnitTest - SynchronousMachine02",
"mRid": "2000",
"psrEventList": [],
"normallyInService": true,
- "synchronousMachineKind": "generator",
+ "synchronousMachineKind": "GENERATOR",
"reductionSettingList": [],
"feedInRanking": 15,
"communicationType": "EFT",
@@ -83,7 +83,7 @@
"registeredGenerator": {"unitType": "PTUR"}
},
"location": {
- "name": "Location02",
+ "name": "UnitTest - Location02",
"electronicAddress": {"email": "mail@einspeiser-02.de"},
"mainAddress": {
"streetDetail": {
@@ -100,11 +100,11 @@
}
},
{
- "name": "SynchronousMachine03",
+ "name": "UnitTest - SynchronousMachine03",
"mRid": "1002",
"psrEventList": [],
"normallyInService": true,
- "synchronousMachineKind": "generator",
+ "synchronousMachineKind": "GENERATOR",
"reductionSettingList": [],
"feedInRanking": 15,
"communicationType": "EFT",
diff --git a/openk-platform/openk-cachedb-service/uml-diagram/cachedb.uml b/openk-platform/openk-cachedb-service/uml-diagram/cachedb.uml
index 7468be67..ca7fb1bb 100644
--- a/openk-platform/openk-cachedb-service/uml-diagram/cachedb.uml
+++ b/openk-platform/openk-cachedb-service/uml-diagram/cachedb.uml
@@ -1,153 +1,153 @@
<?xml version="1.0" encoding="UTF-8"?>
<Diagram>
<ID>DATABASE</ID>
- <OriginalElement>9dc0eaa4-8431-467a-a38b-810e2ae2eb20.schema:cachedb.cachedb</OriginalElement>
+ <OriginalElement />
<nodes>
- <node x="919.4774509803922" y="316.0">9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.generating_unit</node>
- <node x="1170.5166666666664" y="327.0">9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.location</node>
- <node x="1246.0166666666664" y="682.0">9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.position_point</node>
- <node x="0.0" y="704.0">9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.power_transformer</node>
- <node x="162.0" y="704.0">9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.busbar_section</node>
- <node x="354.9274509803922" y="316.0">9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.equipment_container</node>
- <node x="1257.6774509803922" y="1056.0">9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.psr_event</node>
- <node x="374.3137254901961" y="1012.0">9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.terminal</node>
- <node x="395.4274509803922" y="147.0">9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.subgeographical_region</node>
- <node x="1111.6774509803922" y="1078.0">9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.reduction_setting</node>
- <node x="404.9274509803922" y="0.0">9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.geographical_region</node>
- <node x="879.4774509803922" y="605.0">9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.synchronous_machine</node>
- <node x="324.0" y="704.0">9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.ac_line_segment</node>
- <node x="880.1774509803922" y="1291.0">9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.measurement_analog_value</node>
- <node x="686.5166666666667" y="704.0">9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.connectivity_node</node>
- <node x="849.6774509803922" y="1012.0">9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.measurement_analog</node>
- <node x="486.0" y="693.0">9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.switch</node>
+ <node x="348.750980392157" y="316.0">ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.equipment_container</node>
+ <node x="389.250980392157" y="147.0">ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.subgeographical_region</node>
+ <node x="324.0" y="704.0">ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.ac_line_segment</node>
+ <node x="874.0009803921569" y="1291.0">ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.measurement_analog_value</node>
+ <node x="843.5009803921569" y="1012.0">ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.measurement_analog</node>
+ <node x="1251.5009803921569" y="1056.0">ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.psr_event</node>
+ <node x="398.750980392157" y="0.0">ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.geographical_region</node>
+ <node x="369.31372549019613" y="1012.0">ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.terminal</node>
+ <node x="1241.0166666666667" y="682.0">ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.position_point</node>
+ <node x="486.0" y="704.0">ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.power_transformer</node>
+ <node x="913.3009803921568" y="316.0">ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.generating_unit</node>
+ <node x="1105.5009803921569" y="1078.0">ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.reduction_setting</node>
+ <node x="661.5166666666667" y="693.0">ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.switch</node>
+ <node x="873.3009803921568" y="605.0">ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.synchronous_machine</node>
+ <node x="162.0" y="704.0">ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.busbar_section</node>
+ <node x="0.0" y="704.0">ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.connectivity_node</node>
+ <node x="1165.5166666666667" y="327.0">ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.location</node>
</nodes>
<notes />
<edges>
- <edge source="9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.equipment_container" target="9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.subgeographical_region">
- <point x="0.0" y="-114.5" />
- <point x="0.0" y="59.5" />
- </edge>
- <edge source="9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.terminal" target="9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.busbar_section">
- <point x="-60.5" y="-114.5" />
- <point x="434.8137254901961" y="982.0" />
- <point x="233.0" y="982.0" />
+ <edge source="ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.terminal" target="ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.ac_line_segment">
+ <point x="-20.16666666666663" y="-114.5" />
+ <point x="470.1470588235295" y="972.0" />
+ <point x="395.0" y="972.0" />
<point x="0.0" y="59.5" />
</edge>
- <edge source="9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.power_transformer" target="9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.equipment_container">
- <point x="0.0" y="-59.5" />
- <point x="71.0" y="565.0" />
- <point x="375.09411764705885" y="565.0" />
- <point x="-100.83333333333337" y="114.5" />
- </edge>
- <edge source="9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.busbar_section" target="9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.equipment_container">
- <point x="0.0" y="-59.5" />
- <point x="233.0" y="575.0" />
- <point x="415.4274509803922" y="575.0" />
- <point x="-60.5" y="114.5" />
+ <edge source="ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.reduction_setting" target="ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.synchronous_machine">
+ <point x="0.0" y="-48.5" />
+ <point x="1168.5009803921569" y="992.0" />
+ <point x="1098.700980392157" y="992.0" />
+ <point x="64.40000000000009" y="158.5" />
</edge>
- <edge source="9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.synchronous_machine" target="9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.synchronous_machine">
+ <edge source="ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.synchronous_machine" target="ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.synchronous_machine">
<point x="-128.8" y="158.5" />
- <point x="911.6774509803922" y="942.0" />
- <point x="859.4774509803922" y="942.0" />
- <point x="859.4774509803922" y="763.5" />
+ <point x="905.5009803921569" y="942.0" />
+ <point x="853.3009803921568" y="942.0" />
+ <point x="853.3009803921568" y="763.5" />
<point x="-161.0" y="-0.0" />
</edge>
- <edge source="9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.synchronous_machine" target="9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.location">
+ <edge source="ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.equipment_container" target="ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.subgeographical_region">
+ <point x="0.0" y="-114.5" />
+ <point x="0.0" y="59.5" />
+ </edge>
+ <edge source="ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.terminal" target="ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.synchronous_machine">
+ <point x="100.83333333333337" y="-114.5" />
+ <point x="591.1470588235295" y="982.0" />
+ <point x="969.900980392157" y="982.0" />
+ <point x="-64.39999999999998" y="158.5" />
+ </edge>
+ <edge source="ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.position_point" target="ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.location">
+ <point x="0.0" y="-81.5" />
+ <point x="55.5" y="103.5" />
+ </edge>
+ <edge source="ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.synchronous_machine" target="ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.location">
<point x="107.33333333333326" y="-158.5" />
- <point x="1147.8107843137254" y="585.0" />
- <point x="1226.0166666666664" y="585.0" />
+ <point x="1141.63431372549" y="585.0" />
+ <point x="1221.0166666666667" y="585.0" />
<point x="-55.5" y="103.5" />
</edge>
- <edge source="9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.ac_line_segment" target="9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.equipment_container">
- <point x="0.0" y="-59.5" />
- <point x="395.0" y="585.0" />
- <point x="455.76078431372554" y="585.0" />
- <point x="-20.166666666666686" y="114.5" />
+ <edge source="ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.terminal" target="ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.power_transformer">
+ <point x="20.16666666666663" y="-114.5" />
+ <point x="510.48039215686276" y="962.0" />
+ <point x="557.0" y="962.0" />
+ <point x="0.0" y="59.5" />
</edge>
- <edge source="9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.subgeographical_region" target="9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.geographical_region">
+ <edge source="ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.measurement_analog_value" target="ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.measurement_analog">
<point x="0.0" y="-59.5" />
- <point x="0.0" y="48.5" />
- </edge>
- <edge source="9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.synchronous_machine" target="9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.generating_unit">
- <point x="0.0" y="-158.5" />
<point x="0.0" y="114.5" />
</edge>
- <edge source="9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.psr_event" target="9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.synchronous_machine">
+ <edge source="ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.switch" target="ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.equipment_container">
<point x="0.0" y="-70.5" />
- <point x="1338.6774509803922" y="982.0" />
- <point x="1169.2774509803921" y="982.0" />
- <point x="128.79999999999995" y="158.5" />
+ <point x="742.5166666666667" y="575.0" />
+ <point x="530.250980392157" y="575.0" />
+ <point x="60.5" y="114.5" />
</edge>
- <edge source="9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.switch" target="9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.equipment_container">
- <point x="0.0" y="-70.5" />
- <point x="567.0" y="585.0" />
- <point x="496.09411764705885" y="585.0" />
- <point x="20.16666666666663" y="114.5" />
+ <edge source="ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.synchronous_machine" target="ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.generating_unit">
+ <point x="0.0" y="-158.5" />
+ <point x="0.0" y="114.5" />
</edge>
- <edge source="9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.terminal" target="9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.connectivity_node">
- <point x="60.5" y="-114.5" />
- <point x="555.813725490196" y="972.0" />
- <point x="757.5166666666667" y="972.0" />
- <point x="0.0" y="59.5" />
+ <edge source="ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.ac_line_segment" target="ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.equipment_container">
+ <point x="0.0" y="-59.5" />
+ <point x="395.0" y="585.0" />
+ <point x="449.5843137254903" y="585.0" />
+ <point x="-20.166666666666686" y="114.5" />
</edge>
- <edge source="9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.terminal" target="9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.switch">
- <point x="20.166666666666686" y="-114.5" />
- <point x="515.4803921568628" y="962.0" />
- <point x="567.0" y="962.0" />
+ <edge source="ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.terminal" target="ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.switch">
+ <point x="60.5" y="-114.5" />
+ <point x="550.8137254901961" y="972.0" />
+ <point x="742.5166666666667" y="972.0" />
<point x="0.0" y="70.5" />
</edge>
- <edge source="9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.terminal" target="9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.power_transformer">
- <point x="-100.83333333333337" y="-114.5" />
- <point x="394.4803921568627" y="992.0" />
- <point x="71.0" y="992.0" />
- <point x="0.0" y="59.5" />
- </edge>
- <edge source="9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.terminal" target="9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.ac_line_segment">
- <point x="-20.16666666666663" y="-114.5" />
- <point x="475.14705882352945" y="972.0" />
- <point x="395.0" y="972.0" />
- <point x="0.0" y="59.5" />
- </edge>
- <edge source="9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.reduction_setting" target="9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.synchronous_machine">
- <point x="0.0" y="-48.5" />
- <point x="1174.6774509803922" y="992.0" />
- <point x="1104.8774509803923" y="992.0" />
- <point x="64.40000000000009" y="158.5" />
- </edge>
- <edge source="9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.measurement_analog" target="9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.synchronous_machine">
- <point x="0.0" y="-114.5" />
- <point x="970.6774509803922" y="992.0" />
- <point x="1040.4774509803922" y="992.0" />
- <point x="0.0" y="158.5" />
- </edge>
- <edge source="9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.synchronous_machine" target="9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.equipment_container">
+ <edge source="ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.synchronous_machine" target="ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.equipment_container">
<point x="-107.33333333333326" y="-158.5" />
- <point x="933.1441176470589" y="565.0" />
- <point x="576.7607843137256" y="565.0" />
+ <point x="926.9676470588236" y="565.0" />
+ <point x="570.5843137254903" y="565.0" />
<point x="100.83333333333337" y="114.5" />
</edge>
- <edge source="9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.position_point" target="9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.location">
- <point x="0.0" y="-81.5" />
- <point x="55.5" y="103.5" />
+ <edge source="ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.connectivity_node" target="ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.equipment_container">
+ <point x="0.0" y="-59.5" />
+ <point x="71.0" y="565.0" />
+ <point x="368.9176470588236" y="565.0" />
+ <point x="-100.83333333333337" y="114.5" />
</edge>
- <edge source="9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.terminal" target="9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.synchronous_machine">
- <point x="100.83333333333337" y="-114.5" />
- <point x="596.1470588235295" y="982.0" />
- <point x="976.0774509803922" y="982.0" />
- <point x="-64.39999999999998" y="158.5" />
+ <edge source="ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.psr_event" target="ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.synchronous_machine">
+ <point x="0.0" y="-70.5" />
+ <point x="1332.5009803921569" y="982.0" />
+ <point x="1163.1009803921568" y="982.0" />
+ <point x="128.79999999999995" y="158.5" />
</edge>
- <edge source="9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.connectivity_node" target="9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.equipment_container">
+ <edge source="ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.busbar_section" target="ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.equipment_container">
<point x="0.0" y="-59.5" />
- <point x="757.5166666666667" y="575.0" />
- <point x="536.4274509803922" y="575.0" />
- <point x="60.5" y="114.5" />
+ <point x="233.0" y="575.0" />
+ <point x="409.250980392157" y="575.0" />
+ <point x="-60.5" y="114.5" />
</edge>
- <edge source="9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.measurement_analog_value" target="9dc0eaa4-8431-467a-a38b-810e2ae2eb20.table:cachedb.cachedb.measurement_analog">
+ <edge source="ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.power_transformer" target="ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.equipment_container">
<point x="0.0" y="-59.5" />
- <point x="0.0" y="114.5" />
+ <point x="557.0" y="585.0" />
+ <point x="489.9176470588236" y="585.0" />
+ <point x="20.16666666666663" y="114.5" />
+ </edge>
+ <edge source="ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.subgeographical_region" target="ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.geographical_region">
+ <point x="0.0" y="-59.5" />
+ <point x="0.0" y="48.5" />
+ </edge>
+ <edge source="ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.measurement_analog" target="ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.synchronous_machine">
+ <point x="0.0" y="-114.5" />
+ <point x="964.5009803921569" y="992.0" />
+ <point x="1034.3009803921568" y="992.0" />
+ <point x="0.0" y="158.5" />
+ </edge>
+ <edge source="ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.terminal" target="ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.busbar_section">
+ <point x="-60.5" y="-114.5" />
+ <point x="429.81372549019613" y="982.0" />
+ <point x="233.0" y="982.0" />
+ <point x="0.0" y="59.5" />
+ </edge>
+ <edge source="ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.terminal" target="ebcc1de1-f40c-4b02-b582-4f517d4c46e0.table:cachedb.cachedb.connectivity_node">
+ <point x="-100.83333333333337" y="-114.5" />
+ <point x="389.48039215686276" y="992.0" />
+ <point x="71.0" y="992.0" />
+ <point x="0.0" y="59.5" />
</edge>
</edges>
- <settings layout="Hierarchic Group" zoom="0.7260179434092477" x="969.31463878327" y="705.0" />
+ <settings layout="Hierarchic Group" zoom="0.7363636363636363" x="712.0" y="705.0" />
<SelectedNodes />
<Categories>
<Category>Columns</Category>
diff --git a/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/adapter/rest/SubGeographicalRegionRestConsumer.java b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/adapter/rest/SubGeographicalRegionRestConsumer.java
new file mode 100644
index 00000000..126b441c
--- /dev/null
+++ b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/adapter/rest/SubGeographicalRegionRestConsumer.java
@@ -0,0 +1,39 @@
+/**
+ * ****************************************************************************
+ * Copyright (c) 2015 BTC AG.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * <p/>
+ * Contributors:
+ * Jan Krueger - initial API and implementation
+ * *****************************************************************************
+ */
+package org.eclipse.openk.eisman.adapter.rest;
+
+import com.liferay.portal.kernel.util.PropsUtil;
+import org.eclipse.openk.eisman.model.core.SubGeographicalRegion;
+import org.springframework.stereotype.Service;
+import org.springframework.web.client.RestTemplate;
+
+import java.util.Arrays;
+import java.util.List;
+
+@Service
+public class SubGeographicalRegionRestConsumer {
+
+ final RestTemplate restTemplate = new RestTemplate();
+
+ /**
+ * Get SubGeographicalRegion from REST-Service
+ * Netzgebiete
+ *
+ * @return
+ */
+ public List<SubGeographicalRegion> getSubGeographicalRegion() {
+ final String uri = PropsUtil.get("esb.url.base") + PropsUtil.get("esb.rest.uri.subgeographicalregion.lov");
+ return Arrays.asList(restTemplate.getForObject(uri, SubGeographicalRegion[].class));
+ }
+
+}
diff --git a/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/adapter/rest/SubstationRestConsumer.java b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/adapter/rest/SubstationRestConsumer.java
new file mode 100644
index 00000000..0be33b23
--- /dev/null
+++ b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/adapter/rest/SubstationRestConsumer.java
@@ -0,0 +1,39 @@
+/**
+ * ****************************************************************************
+ * Copyright (c) 2015 BTC AG.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * <p/>
+ * Contributors:
+ * Jan Krueger - initial API and implementation
+ * *****************************************************************************
+ */
+package org.eclipse.openk.eisman.adapter.rest;
+
+import com.liferay.portal.kernel.util.PropsUtil;
+import org.eclipse.openk.eisman.model.core.Substation;
+import org.springframework.stereotype.Service;
+import org.springframework.web.client.RestTemplate;
+
+import java.util.Arrays;
+import java.util.List;
+
+@Service
+public class SubstationRestConsumer {
+
+ final RestTemplate restTemplate = new RestTemplate();
+
+ /**
+ * Get all Substations from REST-Service, which are holding SynchronousMachine.
+ * Einspeisepunkte
+ *
+ * @return
+ */
+ public List<Substation> getSubstationList() {
+ final String uri = PropsUtil.get("esb.url.base") + PropsUtil.get("esb.rest.uri.substation.lov");
+ return Arrays.asList(restTemplate.getForObject(uri, Substation[].class));
+ }
+
+}
diff --git a/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/controller/rest/ActivityRestController.java b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/controller/rest/ActivityRestController.java
index 9d4a7b46..315b2fad 100644
--- a/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/controller/rest/ActivityRestController.java
+++ b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/controller/rest/ActivityRestController.java
@@ -15,7 +15,7 @@ package org.eclipse.openk.eisman.controller.rest;
import com.fasterxml.jackson.annotation.JsonView;
import com.google.common.collect.Lists;
import org.apache.log4j.Logger;
-import org.eclipse.openk.controller.rest.config.IncludeAttribute4Json;
+import org.eclipse.openk.eisman.controller.rest.config.IncludeAttribute4Json;
import org.eclipse.openk.eisman.controller.util.JpaUtils;
import org.eclipse.openk.eisman.model.process.Activity;
import org.eclipse.openk.eisman.repository.ActivityRepository;
diff --git a/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/controller/rest/SubGeographicalRegionRestController.java b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/controller/rest/SubGeographicalRegionRestController.java
new file mode 100644
index 00000000..f948d49d
--- /dev/null
+++ b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/controller/rest/SubGeographicalRegionRestController.java
@@ -0,0 +1,44 @@
+/**
+ * ****************************************************************************
+ * Copyright (c) 2015 BTC AG.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * <p/>
+ * Contributors:
+ * Jan Krueger - initial API and implementation
+ * *****************************************************************************
+ */
+package org.eclipse.openk.eisman.controller.rest;
+
+import com.fasterxml.jackson.annotation.JsonView;
+import org.eclipse.openk.eisman.adapter.rest.SubGeographicalRegionRestConsumer;
+import org.eclipse.openk.eisman.controller.rest.config.IncludeAttribute4Json;
+import org.eclipse.openk.eisman.model.core.SubGeographicalRegion;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+@RestController
+public class SubGeographicalRegionRestController {
+
+ @Autowired
+ private SubGeographicalRegionRestConsumer subGeographicalRegionRestConsumer;
+
+ /**
+ * List of all SubGeographicalRegion.
+ * Netzgebiete
+ *
+ * @return
+ */
+ @JsonView(IncludeAttribute4Json.SubGeographicalRegion.class)
+ @RequestMapping(value = "/subgeographicalregion/lov", method = RequestMethod.GET)
+ public List<SubGeographicalRegion> findAllSubGeographicalRegion4Lov() {
+ return subGeographicalRegionRestConsumer.getSubGeographicalRegion();
+ }
+
+}
diff --git a/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/controller/rest/SubstationRestController.java b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/controller/rest/SubstationRestController.java
new file mode 100644
index 00000000..ee54368f
--- /dev/null
+++ b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/controller/rest/SubstationRestController.java
@@ -0,0 +1,46 @@
+/**
+ * ****************************************************************************
+ * Copyright (c) 2015 BTC AG.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * <p/>
+ * Contributors:
+ * Jan Krueger - initial API and implementation
+ * *****************************************************************************
+ */
+package org.eclipse.openk.eisman.controller.rest;
+
+import com.fasterxml.jackson.annotation.JsonView;
+import org.eclipse.openk.eisman.controller.rest.config.IncludeAttribute4Json;
+import org.eclipse.openk.eisman.adapter.rest.SubstationRestConsumer;
+import org.eclipse.openk.eisman.model.core.Substation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+@RestController
+public class SubstationRestController {
+
+ @Autowired
+ private SubstationRestConsumer substationRestConsumer;
+
+ /**
+ * List of Substations, which hold a SynchronousMachine.
+ * Includes also Substations, which hold a VoltageLevel, which holds a SynchronousMachine
+ * Einspeisepunkte
+ *
+ * @return
+ */
+ @JsonView(IncludeAttribute4Json.SubstationLov.class)
+ @RequestMapping(value = "/substation/lov", method = RequestMethod.GET)
+ public List<Substation> findAllSubstation4Lov() {
+ return substationRestConsumer.getSubstationList();
+ }
+
+
+}
diff --git a/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/controller/rest/config/IncludeAttribute4Json.java b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/controller/rest/config/IncludeAttribute4Json.java
index b71ea2cd..bfb5f55d 100644
--- a/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/controller/rest/config/IncludeAttribute4Json.java
+++ b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/controller/rest/config/IncludeAttribute4Json.java
@@ -10,7 +10,7 @@
* Jan Krueger - initial API and implementation
* *****************************************************************************
*/
-package org.eclipse.openk.controller.rest.config;
+package org.eclipse.openk.eisman.controller.rest.config;
/*
see https://spring.io/blog/2014/12/02/latest-jackson-integration-improvements-in-spring
@@ -20,6 +20,9 @@ public class IncludeAttribute4Json {
public interface ParentActivity {
}
-// public interface NetworkState {
-// }
+ public interface SubstationLov {
+ }
+
+ public interface SubGeographicalRegion {
+ }
}
diff --git a/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/core/EquipmentContainer.java b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/core/EquipmentContainer.java
index 6e91250d..87fb154b 100644
--- a/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/core/EquipmentContainer.java
+++ b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/core/EquipmentContainer.java
@@ -12,6 +12,9 @@
*/
package org.eclipse.openk.eisman.model.core;
+import com.fasterxml.jackson.annotation.JsonView;
+import org.eclipse.openk.eisman.controller.rest.config.IncludeAttribute4Json;
+
import javax.persistence.Access;
import javax.persistence.AccessType;
import javax.persistence.Column;
@@ -34,6 +37,7 @@ import javax.persistence.TableGenerator;
@Access(AccessType.FIELD)
public class EquipmentContainer {
+ @JsonView(IncludeAttribute4Json.SubstationLov.class)
@Id
@TableGenerator(name = "EquipmentContainerTableGen",
table = "OPENK_CACHEDB_SEQ_TABLE",
@@ -47,6 +51,7 @@ public class EquipmentContainer {
@Column(name = "MRID")
private String mRid;
+ @JsonView(IncludeAttribute4Json.SubstationLov.class)
@Column(name = "NAME")
private String name;
diff --git a/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/core/SubGeographicalRegion.java b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/core/SubGeographicalRegion.java
index 30145216..fee394b5 100644
--- a/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/core/SubGeographicalRegion.java
+++ b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/core/SubGeographicalRegion.java
@@ -30,6 +30,9 @@ import javax.persistence.TableGenerator;
import java.util.List;
*/
+import com.fasterxml.jackson.annotation.JsonView;
+import org.eclipse.openk.eisman.controller.rest.config.IncludeAttribute4Json;
+
/**
* A subset of a geographical region of a power system network model.
* <p/>
@@ -40,7 +43,7 @@ import java.util.List;
//@Access(AccessType.FIELD)
public class SubGeographicalRegion {// extends IdentifiedObject {
- // @JsonView(IncludeAttribute4Json.SubGeographicalRegion.class)
+ @JsonView(IncludeAttribute4Json.SubGeographicalRegion.class)
// @Id
// @TableGenerator(name = "SubGeographicalRegionTableGen",
// table = "OPENK_CACHEDB_SEQ_TABLE",
@@ -59,6 +62,7 @@ public class SubGeographicalRegion {// extends IdentifiedObject {
// IncludeAttribute4Json.NetworkState.class,
// IncludeAttribute4Json.SubGeographicalRegion.class})
// @Column(name = "NAME")
+ @JsonView(IncludeAttribute4Json.SubGeographicalRegion.class)
private String name;
// @JsonView({IncludeAttribute4Json.Topology.class, IncludeAttribute4Json.NetworkState.class})
diff --git a/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/process/Activity.java b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/process/Activity.java
index 2bd08346..da8d2fe4 100644
--- a/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/process/Activity.java
+++ b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/process/Activity.java
@@ -14,7 +14,7 @@ package org.eclipse.openk.eisman.model.process;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonView;
-import org.eclipse.openk.controller.rest.config.IncludeAttribute4Json;
+import org.eclipse.openk.eisman.controller.rest.config.IncludeAttribute4Json;
import org.eclipse.openk.eisman.model.AbstractBaseEntitiy;
import org.eclipse.openk.eisman.model.core.Substation;
import org.eclipse.openk.eisman.model.domain.Power;
diff --git a/openk-platform/openk-eisman-portlet/src/main/webapp/WEB-INF/restful-servlet.xml b/openk-platform/openk-eisman-portlet/src/main/webapp/WEB-INF/restful-servlet.xml
index 61206774..0f470a3a 100644
--- a/openk-platform/openk-eisman-portlet/src/main/webapp/WEB-INF/restful-servlet.xml
+++ b/openk-platform/openk-eisman-portlet/src/main/webapp/WEB-INF/restful-servlet.xml
@@ -16,18 +16,21 @@
http://spring.io/blog/2013/06/03/content-negotiation-using-views
http://hmkcode.com/spring-mvc-return-json-using-responseboyd/
-->
- <context:component-scan base-package="org.eclipse.openk.eisman.controller.rest, org.eclipse.openk.eisman.service"/>
+ <context:component-scan
+ base-package="org.eclipse.openk.eisman.controller.rest,
+ org.eclipse.openk.eisman.adapter.rest,
+ org.eclipse.openk.eisman.service"/>
<mvc:annotation-driven>
<mvc:argument-resolvers>
<ref bean="sortResolver"/>
- <ref bean="pageableResolver" />
+ <ref bean="pageableResolver"/>
</mvc:argument-resolvers>
</mvc:annotation-driven>
- <bean id="sortResolver" class="org.springframework.data.web.SortHandlerMethodArgumentResolver" />
+ <bean id="sortResolver" class="org.springframework.data.web.SortHandlerMethodArgumentResolver"/>
<bean id="pageableResolver" class="org.springframework.data.web.PageableHandlerMethodArgumentResolver">
- <constructor-arg ref="sortResolver" />
+ <constructor-arg ref="sortResolver"/>
</bean>
<!--
diff --git a/openk-platform/openk-eisman-portlet/src/test/java/org/eclipse/openk/eisman/repository/PreselectionRepositoryTest.java b/openk-platform/openk-eisman-portlet/src/test/java/org/eclipse/openk/eisman/controller/rest/PreselectionControllerRestTest.java
index 98758c03..b2772bff 100644
--- a/openk-platform/openk-eisman-portlet/src/test/java/org/eclipse/openk/eisman/repository/PreselectionRepositoryTest.java
+++ b/openk-platform/openk-eisman-portlet/src/test/java/org/eclipse/openk/eisman/controller/rest/PreselectionControllerRestTest.java
@@ -10,11 +10,11 @@
* Jan Krueger - initial API and implementation
* *****************************************************************************
*/
-package org.eclipse.openk.eisman.repository;
+package org.eclipse.openk.eisman.controller.rest;
-import com.google.common.base.Charsets;
-import com.google.common.io.CharStreams;
import org.eclipse.openk.eisman.model.process.Preselection;
+import org.eclipse.openk.eisman.repository.AbstractRepositoryJpaTest;
+import org.eclipse.openk.eisman.repository.PreselectionRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpMethod;
import org.springframework.http.MediaType;
@@ -28,31 +28,26 @@ import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import java.io.IOException;
-import java.io.InputStreamReader;
import java.net.URISyntaxException;
import static org.springframework.test.web.client.match.MockRestRequestMatchers.method;
import static org.springframework.test.web.client.match.MockRestRequestMatchers.requestTo;
import static org.springframework.test.web.client.response.MockRestResponseCreators.withSuccess;
-public class PreselectionRepositoryTest extends AbstractRepositoryJpaTest {
-
- @PersistenceContext(unitName = "appDbEntityManagerFactory")
- protected EntityManager entityManager;
+public class PreselectionControllerRestTest extends AbstractRepositoryJpaTest {
@Autowired
private PreselectionRepository preselectionRepository;
-
@AfterMethod
private void cleanup() {
- deleteData();}
-
+ deleteData();
+ }
@Test()
public void getPreselection() throws IOException, URISyntaxException {
- /*final String contentJson = getContentOfJsonFile("json-test-samples/preselection-sample-01.json");
+ final String contentJson = getContentOfJsonFile("json-test-samples/preselection-sample-01.json");
RestTemplate restTemplate = new RestTemplate();
MockRestServiceServer mockServer = MockRestServiceServer.createServer(restTemplate);
@@ -70,11 +65,7 @@ public class PreselectionRepositoryTest extends AbstractRepositoryJpaTest {
Assert.assertEquals(preselection.getReductionSetting(), Integer.valueOf(10));
Assert.assertEquals(preselection.getCreatedBy(), "User A");
- preselectionRepository.save(preselection);*/
- }
-
- private String getContentOfJsonFile(final String path) throws IOException, URISyntaxException {
- return CharStreams.toString(new InputStreamReader(ClassLoader.getSystemResourceAsStream(path), Charsets.UTF_8));
+ preselectionRepository.save(preselection);
}
private void deleteData() {
@@ -84,5 +75,4 @@ public class PreselectionRepositoryTest extends AbstractRepositoryJpaTest {
deleteStatement.executeUpdate();
}
-
}
diff --git a/openk-platform/openk-eisman-portlet/src/test/java/org/eclipse/openk/eisman/repository/AbstractRepositoryJpaTest.java b/openk-platform/openk-eisman-portlet/src/test/java/org/eclipse/openk/eisman/repository/AbstractRepositoryJpaTest.java
index 59d8ce45..538471db 100644
--- a/openk-platform/openk-eisman-portlet/src/test/java/org/eclipse/openk/eisman/repository/AbstractRepositoryJpaTest.java
+++ b/openk-platform/openk-eisman-portlet/src/test/java/org/eclipse/openk/eisman/repository/AbstractRepositoryJpaTest.java
@@ -10,11 +10,10 @@
* Jan Krueger - initial API and implementation
* *****************************************************************************
*/
-package org.eclipse.openk.eisman.
- repository;
+package org.eclipse.openk.eisman.repository;
-import org.eclipse.openk.eisman.model.process.Activity;
-import org.springframework.beans.factory.annotation.Autowired;
+import com.google.common.base.Charsets;
+import com.google.common.io.CharStreams;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.TestExecutionListeners;
import org.springframework.test.context.testng.AbstractTestNGSpringContextTests;
@@ -22,11 +21,23 @@ import org.springframework.test.context.transaction.TransactionConfiguration;
import org.springframework.test.context.transaction.TransactionalTestExecutionListener;
import org.springframework.transaction.annotation.Transactional;
-import java.util.List;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.net.URISyntaxException;
@TransactionConfiguration(defaultRollback = false)
@Transactional(value = "appDbTransactionManager", rollbackFor = Throwable.class)
@TestExecutionListeners(TransactionalTestExecutionListener.class)
@ContextConfiguration(locations = {"classpath:database-spring-data-test.xml"})
public class AbstractRepositoryJpaTest extends AbstractTestNGSpringContextTests {
+
+ @PersistenceContext(unitName = "appDbEntityManagerFactory")
+ protected EntityManager entityManager;
+
+ protected String getContentOfJsonFile(final String path) throws IOException, URISyntaxException {
+ return CharStreams.toString(new InputStreamReader(ClassLoader.getSystemResourceAsStream(path), Charsets.UTF_8));
+ }
+
}
diff --git a/openk-platform/openk-eisman-portlet/src/test/resources/json-test-samples/preselection-sample-01.json b/openk-platform/openk-eisman-portlet/src/test/resources/json-test-samples/preselection-sample-01.json
index 59d0dc8a..b5cbce9a 100644
--- a/openk-platform/openk-eisman-portlet/src/test/resources/json-test-samples/preselection-sample-01.json
+++ b/openk-platform/openk-eisman-portlet/src/test/resources/json-test-samples/preselection-sample-01.json
@@ -1,5 +1,5 @@
{
- "dateCreated": "2015-04-17 10:24:30",
+ "dateCreated": "2015-04-29T10:08:55.128+0200",
"createdBy": "User A",
"dateUpdated": null,
"updatedBy": null,

Back to the top