Skip to content

Commit 7a7f543

Browse files
Merge pull request #346 from com-pas/feat/345-rsr-886-ldepf-service-uses-the-xml-settings-file
feat(EPF): Change setting file from CSV to XML
2 parents f5e7098 + 9ed3959 commit 7a7f543

20 files changed

+493
-2063
lines changed

sct-commons/pom.xml

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -161,23 +161,41 @@
161161
<version>3.1.0</version>
162162
<executions>
163163
<execution>
164-
<id>xjc</id>
164+
<id>scl</id>
165165
<goals>
166166
<goal>xjc</goal>
167167
</goals>
168+
<configuration>
169+
<sources>
170+
<source>${project.build.outputDirectory}/xsd/SCL2007B4/SCL.xsd</source>
171+
<source>${project.build.outputDirectory}/xsd/SCL_CoMPAS.xsd</source>
172+
</sources>
173+
<xjbSources>
174+
<xjbSource>${project.basedir}/src/main/resources/binding_configuration.xjb</xjbSource>
175+
</xjbSources>
176+
<packageName>org.lfenergy.compas.scl2007b4.model</packageName>
177+
<noPackageLevelAnnotations>true</noPackageLevelAnnotations>
178+
<clearOutputDir>false</clearOutputDir>
179+
</configuration>
180+
</execution>
181+
<execution>
182+
<id>epf</id>
183+
<goals>
184+
<goal>xjc</goal>
185+
</goals>
186+
<configuration>
187+
<sources>
188+
<source>${project.basedir}/src/main/resources/xsd/LDEPF_Config_file_v2.xsd</source>
189+
</sources>
190+
<xjbSources>
191+
<xjbSource>${project.basedir}/src/main/resources/binding_configuration.xjb</xjbSource>
192+
</xjbSources>
193+
<packageName>org.lfenergy.compas.sct.commons.model.epf</packageName>
194+
<noPackageLevelAnnotations>true</noPackageLevelAnnotations>
195+
<clearOutputDir>false</clearOutputDir>
196+
</configuration>
168197
</execution>
169198
</executions>
170-
<configuration>
171-
<sources>
172-
<source>${project.build.outputDirectory}/xsd/SCL2007B4/SCL.xsd</source>
173-
<source>${project.build.outputDirectory}/xsd/SCL_CoMPAS.xsd</source>
174-
</sources>
175-
<xjbSources>
176-
<xjbSource>${project.basedir}/src/main/resources/binding_configuration.xjb</xjbSource>
177-
</xjbSources>
178-
<packageName>org.lfenergy.compas.scl2007b4.model</packageName>
179-
<noPackageLevelAnnotations>true</noPackageLevelAnnotations>
180-
</configuration>
181199
</plugin>
182200
<plugin>
183201
<groupId>org.apache.maven.plugins</groupId>

sct-commons/src/main/java/org/lfenergy/compas/sct/commons/ExtRefService.java

Lines changed: 171 additions & 51 deletions
Large diffs are not rendered by default.

sct-commons/src/main/java/org/lfenergy/compas/sct/commons/api/ExtRefEditor.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import org.lfenergy.compas.sct.commons.dto.ExtRefInfo;
1010
import org.lfenergy.compas.sct.commons.dto.SclReportItem;
1111
import org.lfenergy.compas.sct.commons.exception.ScdException;
12-
import org.lfenergy.compas.sct.commons.util.ILDEPFSettings;
12+
import org.lfenergy.compas.sct.commons.model.epf.EPF;
1313

1414
import java.util.List;
1515

@@ -55,11 +55,11 @@ public interface ExtRefEditor {
5555
List<SclReportItem> updateAllExtRefIedNames(SCL scd);
5656

5757
/**
58-
* ExtRef Binding For LDevice (inst=LDEPF) that matching LDEPF configuration
58+
* ExtRef Binding For LDevice (inst=LDEPF) that matching EPF configuration
5959
* @param scd SCL
60-
* @param settings ILDEPFSettings
60+
* @param epf EPF
6161
* @return list of encountered errors
6262
*/
63-
List<SclReportItem> manageBindingForLDEPF(SCL scd, ILDEPFSettings settings);
63+
List<SclReportItem> manageBindingForLDEPF(SCL scd, EPF epf);
6464

6565
}

sct-commons/src/main/java/org/lfenergy/compas/sct/commons/dto/LDEPFSettingData.java

Lines changed: 0 additions & 107 deletions
This file was deleted.

sct-commons/src/main/java/org/lfenergy/compas/sct/commons/scl/ied/IEDAdapter.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
package org.lfenergy.compas.sct.commons.scl.ied;
66

77
import lombok.NonNull;
8-
import org.apache.commons.lang3.StringUtils;
98
import org.lfenergy.compas.scl2007b4.model.*;
109
import org.lfenergy.compas.sct.commons.dto.ExtRefBindingInfo;
1110
import org.lfenergy.compas.sct.commons.dto.ExtRefSignalInfo;
@@ -23,6 +22,8 @@
2322
import java.util.function.Function;
2423
import java.util.stream.Stream;
2524

25+
import static org.apache.commons.lang3.StringUtils.isBlank;
26+
2627
/**
2728
* A representation of the model object
2829
* <em><b>{@link org.lfenergy.compas.scl2007b4.model.TIED IED}</b></em>.
@@ -169,7 +170,7 @@ public LDeviceAdapter getLDeviceAdapterByLdInst(String ldInst) throws ScdExcepti
169170
* @return optional of <em>LDeviceAdapter</em> object
170171
*/
171172
public Optional<LDeviceAdapter> findLDeviceAdapterByLdInst(String ldInst) {
172-
if (StringUtils.isBlank(ldInst)) {
173+
if (isBlank(ldInst)) {
173174
return Optional.empty();
174175
}
175176
return streamLDevices()
@@ -230,7 +231,7 @@ public String getName() {
230231
* @return <em>Boolean</em> value of check result
231232
*/
232233
public boolean matches(ObjectReference objRef) {
233-
if (StringUtils.isBlank(getName())
234+
if (isBlank(getName())
234235
|| !objRef.getLdName().startsWith(getName())) {
235236
return false;
236237
}

sct-commons/src/main/java/org/lfenergy/compas/sct/commons/util/ILDEPFSettings.java

Lines changed: 0 additions & 42 deletions
This file was deleted.

sct-commons/src/main/java/org/lfenergy/compas/sct/commons/util/SettingLDEPFCsvHelper.java

Lines changed: 0 additions & 64 deletions
This file was deleted.

0 commit comments

Comments
 (0)