Skip to content

Commit

Permalink
Merge pull request #1047 from digitalservicebund/remove-delta
Browse files Browse the repository at this point in the history
remove-delta
  • Loading branch information
malte-laukoetter authored Feb 28, 2025
2 parents 612b037 + 6a99e0a commit a2d9a8e
Show file tree
Hide file tree
Showing 17 changed files with 2,032 additions and 4,271 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package de.bund.digitalservice.ris.norms.application.service;

import de.bund.digitalservice.ris.norms.domain.entity.EIdPart;
import de.bund.digitalservice.ris.norms.domain.entity.Mod;
import de.bund.digitalservice.ris.norms.domain.entity.Norm;
import de.bund.digitalservice.ris.norms.domain.entity.Regelungstext;
import de.bund.digitalservice.ris.norms.utils.NodeCreator;
Expand Down Expand Up @@ -33,16 +32,7 @@ public void findAndCreateReferences(final Norm norm) {
* @param regelungstext - the regelungstext to be analyzed
*/
public void findAndCreateReferences(final Regelungstext regelungstext) {
if (regelungstext.getMods().stream().anyMatch(Mod::containsRef)) {
return;
}

regelungstext
.getMods()
.forEach(mod -> {
mod.getSecondQuotedText().ifPresent(this::findAndCreateReferencesInNode);
mod.getQuotedStructure().ifPresent(this::findAndCreateReferencesInNode);
});
findAndCreateReferencesInNode(regelungstext.getDocument());
}

private void findAndCreateReferencesInNode(final Node node) {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import de.bund.digitalservice.ris.norms.domain.entity.eli.DokumentExpressionEli;
import de.bund.digitalservice.ris.norms.utils.NodeParser;
import java.util.List;
import java.util.Optional;
import java.util.UUID;
import lombok.AllArgsConstructor;
Expand Down Expand Up @@ -105,19 +104,6 @@ public Optional<String> getRefersTo() {
return NodeParser.getValueFromExpression("./@refersTo", this.element);
}

/**
* Extracts the {@link Mod} for this article.
*
* @return the {@link Mod}
*/
public List<Mod> getMods() {
return NodeParser
.getElementsFromExpression("./*//mod", this.element)
.stream()
.map(Mod::new)
.toList();
}

/**
* Checks weather the {@link Article} refers to a Geltungszeitregel (which would define when a law e.g. enters
* into force)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,35 +105,6 @@ public Lifecycle getOrCreateLifecycle() {
}
}

/**
* Returns a {@link Analysis} instance from the {@link Meta}.
*
* @return the Analysis node as {@link Analysis}
*/
public Optional<Analysis> getAnalysis() {
return NodeParser.getElementFromExpression("./analysis", element).map(Analysis::new);
}

/**
* Gets the akn:analysis element of the norm, or creates it if it does not yet exist.
*
* @return the akn:analysis element of the norm
*/
public Analysis getOrCreateAnalysis() {
return getAnalysis()
.orElseGet(() -> {
final var newElement = NodeCreator.createElementWithEidAndGuid("akn:analysis", element);
newElement.setAttribute(SOURCE_ATTIBUTE, ATTRIBUTSEMANTIK_NOCH_UNDEFINIERT);

// Metadata needs to be in the correct order, so we're inserting it before temporal data, which is the
// element that has to follow the analysis in a valid document.
final var insertInOrderSiblibg = getOrCreateTemporalData().getElement();
element.insertBefore(newElement, insertInOrderSiblibg);

return new Analysis(newElement);
});
}

/**
* Gets the akn:proprietary element of the norm, or creates it if it does not yet exist.
*
Expand Down
Loading

0 comments on commit a2d9a8e

Please sign in to comment.