diff --git a/backend/src/main/java/de/bund/digitalservice/ris/norms/application/service/BillToActService.java b/backend/src/main/java/de/bund/digitalservice/ris/norms/application/service/BillToActService.java index 7f199abe4..eb4d1ba11 100644 --- a/backend/src/main/java/de/bund/digitalservice/ris/norms/application/service/BillToActService.java +++ b/backend/src/main/java/de/bund/digitalservice/ris/norms/application/service/BillToActService.java @@ -321,7 +321,8 @@ private void rewriteFbrManifestation(Document document) { expressionEli.getVersion(), expressionEli.getLanguage(), verkuendungsDate, - expressionEli.getSubtype() + expressionEli.getSubtype(), + "xml" ); fRBRManifestationThis.setAttribute(VALUE, manifestationEli.toString()); fRBRManifestationUri.setAttribute(VALUE, manifestationEli.toString()); diff --git a/backend/src/main/java/de/bund/digitalservice/ris/norms/application/service/CreateNewVersionOfNormService.java b/backend/src/main/java/de/bund/digitalservice/ris/norms/application/service/CreateNewVersionOfNormService.java index d1fd84167..0e8783842 100644 --- a/backend/src/main/java/de/bund/digitalservice/ris/norms/application/service/CreateNewVersionOfNormService.java +++ b/backend/src/main/java/de/bund/digitalservice/ris/norms/application/service/CreateNewVersionOfNormService.java @@ -53,7 +53,11 @@ public CreateNewExpressionResult createNewExpression(Norm norm, LocalDate date) date, newExpression.getExpressionEli().getLanguage() ); - var newManifestationEli = ManifestationEli.fromExpressionEli(newExpressionEli, LocalDate.now()); + var newManifestationEli = ManifestationEli.fromExpressionEli( + newExpressionEli, + LocalDate.now(), + "xml" + ); setNewExpressionMetadata(newExpression, newExpressionEli); setNewManifestationMetadata(newExpression, newManifestationEli); @@ -85,7 +89,8 @@ public Norm createNewManifestation(Norm norm, LocalDate pointInTimeManifestation var newManifestation = new Norm(norm); var newManifestationEli = ManifestationEli.fromExpressionEli( newManifestation.getExpressionEli(), - pointInTimeManifestation + pointInTimeManifestation, + "xml" ); setNewManifestationMetadata(newManifestation, newManifestationEli); diff --git a/backend/src/main/java/de/bund/digitalservice/ris/norms/domain/entity/eli/ManifestationEli.java b/backend/src/main/java/de/bund/digitalservice/ris/norms/domain/entity/eli/ManifestationEli.java index 7837e7b80..14392a063 100644 --- a/backend/src/main/java/de/bund/digitalservice/ris/norms/domain/entity/eli/ManifestationEli.java +++ b/backend/src/main/java/de/bund/digitalservice/ris/norms/domain/entity/eli/ManifestationEli.java @@ -15,7 +15,7 @@ * European legislation identifier on manifestation level * *
This class can be used to extract the eli from a path that includes a section like
- * "/eli/bund/{agent}/{year}/{naturalIdentifier}/{pointInTime}/{version}/{language}/{pointInTimeManifestation}/{subtype}.xml".
+ * "/eli/bund/{agent}/{year}/{naturalIdentifier}/{pointInTime}/{version}/{language}/{pointInTimeManifestation}/{subtype}.{fileExtension}".
*/
@Getter
@Setter
@@ -31,6 +31,7 @@ public final class ManifestationEli implements Eli {
private String language;
private LocalDate pointInTimeManifestation;
private String subtype;
+ private String format = "xml";
public ManifestationEli(
String agent,
@@ -39,9 +40,10 @@ public ManifestationEli(
LocalDate pointInTime,
Integer version,
String language,
- String subtype
+ String subtype,
+ String format
) {
- this(agent, year, naturalIdentifier, pointInTime, version, language, null, subtype);
+ this(agent, year, naturalIdentifier, pointInTime, version, language, null, subtype, format);
}
/**
@@ -56,18 +58,19 @@ public boolean hasPointInTimeManifestation() {
@Override
public String toString() {
if (!hasPointInTimeManifestation()) {
- return "eli/bund/%s/%s/%s/%s/%d/%s/%s.xml".formatted(
+ return "eli/bund/%s/%s/%s/%s/%d/%s/%s.%s".formatted(
getAgent(),
getYear(),
getNaturalIdentifier(),
getPointInTime().format(DateTimeFormatter.ISO_LOCAL_DATE),
getVersion(),
getLanguage(),
- getSubtype()
+ getSubtype(),
+ getFormat()
);
}
- return "eli/bund/%s/%s/%s/%s/%d/%s/%s/%s.xml".formatted(
+ return "eli/bund/%s/%s/%s/%s/%d/%s/%s/%s.%s".formatted(
getAgent(),
getYear(),
getNaturalIdentifier(),
@@ -75,7 +78,8 @@ public String toString() {
getVersion(),
getLanguage(),
getPointInTimeManifestation().format(DateTimeFormatter.ISO_LOCAL_DATE),
- getSubtype()
+ getSubtype(),
+ getFormat()
);
}
@@ -106,7 +110,8 @@ public ManifestationEli withoutPointInTimeManifestation() {
getPointInTime(),
getVersion(),
getLanguage(),
- getSubtype()
+ getSubtype(),
+ getFormat()
);
}
@@ -145,7 +150,7 @@ public WorkEli asWorkEli() {
public static ManifestationEli fromString(String manifestationEli) {
Matcher matcher = Pattern
.compile(
- "eli/bund/(?