Skip to content

Commit

Permalink
Merge pull request #254 from NDLANO/remove-partial-publishing
Browse files Browse the repository at this point in the history
Remove partial publishing
  • Loading branch information
gunnarvelle authored Jun 27, 2024
2 parents 4e8516a + 838967f commit 5a0efb5
Show file tree
Hide file tree
Showing 13 changed files with 18 additions and 1,276 deletions.
42 changes: 0 additions & 42 deletions src/main/java/no/ndla/taxonomy/config/SchedulingConfig.java

This file was deleted.

4 changes: 2 additions & 2 deletions src/main/java/no/ndla/taxonomy/domain/NodeConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ public Optional<Boolean> isPrimary() {
public void setPrimary(boolean isPrimary) {
var childType = this.child.getNodeType();
if (childType == NodeType.TOPIC && !isPrimary) {
throw new UnsupportedOperationException(
"NodeConnection with child of type '" + childType.toString() + "' can not be non-primary");
throw new IllegalArgumentException(
"NodeConnection with child of type '" + childType + "' cannot be non-primary");
}

this.isPrimary = isPrimary;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ protected ResponseEntity<String> handleConflictExceptions(RuntimeException excep
return new ResponseEntity<>(createErrorBody(exception), createHeaders(), HttpStatus.CONFLICT);
}

@ExceptionHandler({UnsupportedOperationException.class})
protected ResponseEntity<String> handleUnsupportedExceptions(RuntimeException exception) {
return new ResponseEntity<>(createErrorBody(exception), createHeaders(), HttpStatus.GONE);
}

@ExceptionHandler({
IdFormatException.class,
InvalidArgumentServiceException.class,
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/no/ndla/taxonomy/rest/v1/Nodes.java
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ public void updateNode(
@ResponseStatus(HttpStatus.ACCEPTED)
@PreAuthorize("hasAuthority('TAXONOMY_ADMIN')")
@Transactional
@Deprecated
public void publishNode(
@PathVariable("id") URI id,
@Parameter(
Expand All @@ -273,7 +274,7 @@ public void publishNode(
@Parameter(description = "Version id to publish to.", example = "urn:version:2")
@RequestParam(value = "targetId")
URI targetId) {
nodeService.publishNode(id, sourceId, targetId, true, false);
throw new UnsupportedOperationException("This endpoint is deprecated");
}

@GetMapping("/{id}/nodes")
Expand Down
113 changes: 0 additions & 113 deletions src/main/java/no/ndla/taxonomy/service/ChangelogService.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,11 @@
package no.ndla.taxonomy.service;

import java.net.URI;
import java.util.Optional;
import no.ndla.taxonomy.domain.DomainEntity;
import no.ndla.taxonomy.domain.Node;
import no.ndla.taxonomy.repositories.TaxonomyRepository;

public interface DomainEntityHelperService {
Node getNodeByPublicId(URI publicId);

DomainEntity getEntityByPublicId(URI publicId);

TaxonomyRepository<DomainEntity> getRepository(URI publicId);

void buildPathsForEntity(URI publicId);

void deleteEntityByPublicId(URI publicId);

Optional<DomainEntity> getProcessedEntityByPublicId(URI publicId, boolean addIsPublishing, boolean cleanUp);

Optional<DomainEntity> updateEntity(DomainEntity domainEntity, boolean cleanUp);
}
Loading

0 comments on commit 5a0efb5

Please sign in to comment.