-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #243 from NDLANO/expand-context
Expand taxonomycontext with parent contextids
- Loading branch information
Showing
10 changed files
with
130 additions
and
133 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
src/main/java/no/ndla/taxonomy/domain/TaxonomyContext.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Part of NDLA taxonomy-api | ||
* Copyright (C) 2023 NDLA | ||
* | ||
* See LICENSE | ||
*/ | ||
|
||
package no.ndla.taxonomy.domain; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
/** | ||
* Identifies a unique context for any node. A context is a position for a node in the structure, identified by root | ||
* node and parent-connection | ||
* | ||
* @param rootId The publicId of the node at the root of the context. | ||
* @param rootName The name of the root. | ||
* @param path The path for this connection. | ||
* @param breadcrumbs Breadcrumbs corresponding with the path. | ||
* @param contextType Type resource. Fetched from node. | ||
* @param parentIds Parents ids. | ||
* @param parentContextIds Parents context ids. | ||
* @param isVisible Metadata from node. | ||
* @param isActive Metadata from node. True if subjectCategory is active or otherResources. | ||
* @param isPrimary Is this context marked as primary. From nodeConnection. | ||
* @param relevanceId ID of relevance. From nodeConnection. | ||
* @param contextId Hash of root publicId + nodeConnection publicId. Unique for this context. | ||
* @param rank The rank of the context. From nodeConnection. | ||
* @param connectionId The id of the connection. From nodeConnection. | ||
*/ | ||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
public record TaxonomyContext( | ||
String rootId, | ||
LanguageField<String> rootName, | ||
String path, | ||
LanguageField<List<String>> breadcrumbs, | ||
Optional<String> contextType, | ||
List<String> parentIds, | ||
List<String> parentContextIds, | ||
boolean isVisible, | ||
boolean isActive, | ||
boolean isPrimary, | ||
String relevanceId, | ||
String contextId, | ||
int rank, | ||
String connectionId) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.