-
Notifications
You must be signed in to change notification settings - Fork 490
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: MetadataBlock refactoring #9932
Open
johannes-darms
wants to merge
9
commits into
IQSS:develop
Choose a base branch
from
johannes-darms:refactor-metadatablock
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+118
−626
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
68e2136
Refactor MetadataBlock
johannes-darms c1126a2
Added some javadoc documentation to the DatasetFieldType
johannes-darms 8475749
Remove unused `DatasetDistributor`, `DefaultValueSet` and `DatasetFie…
johannes-darms e0d42df
Fix checkstyle warning
johannes-darms d377dde
Renamed variable to proper name
johannes-darms 526d629
Remove further unused classes related to Datasets
johannes-darms c92838c
merge develop into PR
johannes-darms 4ffebe0
merge develop into PR
johannes-darms a61717b
add javadoc to classes
johannes-darms File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
97 changes: 0 additions & 97 deletions
97
src/main/java/edu/harvard/iq/dataverse/DatasetDistributor.java
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
136 changes: 0 additions & 136 deletions
136
src/main/java/edu/harvard/iq/dataverse/DatasetFieldDefaultValue.java
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
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 |
---|---|---|
|
@@ -17,7 +17,21 @@ | |
import jakarta.persistence.*; | ||
|
||
/** | ||
* Defines the meaning and constraints of a metadata field and its values. | ||
* A DatasetFieldType belongs to a MetadataBlock (c.f. @MetadataBlock) and defines semantic meaning and constraints of a | ||
* metadata property. | ||
* | ||
* Each DatasetFieldType is uniquely identifiable by an identifier and name (beware: globally unique name!) and defines | ||
* instance-wide properties of a metadata item, like descriptive information and allowed values. DatasetFieldType allow | ||
* the definition of tree like metadata structure via parent-child relationships. The domain model does not contain the | ||
* nesting level. Nodes with children are called `compound` and act as a container, while leaves are named `primitive`. | ||
* Only for the latter data capture and storage (c.f. @DatasetField) is possible, for the former not. | ||
* | ||
* The DatasetFieldType obligation (mandatory data capture or not) [c.f. #isRequired] and activation [c.f. #isIncluded] | ||
* can be configured on a per dataverse level (c.f. @DataverseFieldTypeInputLevel). If configured this has precedence over | ||
* the instance-wide DatasetFieldType definition. Similarly, search facet configuration can be overridden (c.f. DataverseFacet). | ||
* | ||
* | ||
* | ||
* @author Stephen Kraffmiller | ||
*/ | ||
@NamedQueries({ | ||
|
@@ -87,9 +101,18 @@ public void setId(Long id) { | |
|
||
private String validationFormat; | ||
|
||
/** | ||
* The user can configure facets and their order on a per dataverse basis. | ||
* This member setups the needed connection in the domain model. | ||
*/ | ||
@OneToMany(mappedBy = "datasetFieldType") | ||
private Set<DataverseFacet> dataverseFacets; | ||
|
||
|
||
/** | ||
* If the definition of the DatasetFieldType does not already define `required` the user can change the obligation per dataverse. | ||
* Furthermore, the user can `hide` DatasetFields on a per dataverse basis. | ||
* This member setups the needed connection in the domain model. | ||
*/ | ||
@OneToMany(mappedBy = "datasetFieldType") | ||
private Set<DataverseFieldTypeInputLevel> dataverseFieldTypeInputLevels; | ||
|
||
|
@@ -322,10 +345,10 @@ public JsonLDTerm getJsonLDTerm() { | |
public void setUri(String uri) { | ||
this.uri=uri; | ||
} | ||
|
||
/** | ||
* The list of controlled vocabulary terms that may be used as values for | ||
* fields of this field type. | ||
* If the definition of the DatasetFieldType includes a definition for a controlled Vocabulary, i.e. a list of allowed values. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not a complete sentence – I expect another part starting with "then", because of "If". |
||
* This member setups the needed connection in the domain model. | ||
*/ | ||
@OneToMany(mappedBy = "datasetFieldType", cascade = {CascadeType.REMOVE, CascadeType.MERGE, CascadeType.PERSIST}) | ||
@OrderBy("displayOrder ASC") | ||
|
@@ -356,6 +379,7 @@ public ControlledVocabularyValue getControlledVocabularyValue( String strValue ) | |
* Collection of field types that are children of this field type. | ||
* A field type may consist of one or more child field types, but only one | ||
* parent. | ||
* Definition of the value via `parentDatasetFieldType` | ||
*/ | ||
@OneToMany(mappedBy = "parentDatasetFieldType", cascade = {CascadeType.REMOVE, CascadeType.MERGE, CascadeType.PERSIST}) | ||
@OrderBy("displayOrder ASC") | ||
|
@@ -369,6 +393,9 @@ public void setChildDatasetFieldTypes(Collection<DatasetFieldType> childDatasetF | |
this.childDatasetFieldTypes = childDatasetFieldTypes; | ||
} | ||
|
||
/** | ||
* Defines the parent of this DatasetFieldType, if no parent is defined `null` is used. | ||
*/ | ||
@ManyToOne(cascade = CascadeType.MERGE) | ||
private DatasetFieldType parentDatasetFieldType; | ||
|
||
|
@@ -490,8 +517,8 @@ public boolean equals(Object object) { | |
} | ||
|
||
/** | ||
* List of fields that use this field type. If this field type is removed, | ||
* these fields will be removed too. | ||
* If DatasetFieldType is used by a DatasetField to gather metadata we reference the type. | ||
* This member setups the needed connection in the domain model, but is not activilty used. | ||
*/ | ||
@OneToMany(mappedBy = "datasetFieldType", cascade = {CascadeType.REMOVE, CascadeType.MERGE, CascadeType.PERSIST}) | ||
private List<DatasetField> datasetFields; | ||
|
@@ -504,17 +531,6 @@ public void setDatasetFields(List<DatasetField> datasetFieldValues) { | |
this.datasetFields = datasetFieldValues; | ||
} | ||
|
||
@OneToMany(mappedBy = "datasetField", cascade = {CascadeType.REMOVE, CascadeType.MERGE, CascadeType.PERSIST}) | ||
private List<DatasetFieldDefaultValue> datasetFieldDefaultValues; | ||
|
||
public List<DatasetFieldDefaultValue> getDatasetFieldDefaultValues() { | ||
return datasetFieldDefaultValues; | ||
} | ||
|
||
public void setDatasetFieldDefaultValues(List<DatasetFieldDefaultValue> datasetFieldDefaultValues) { | ||
this.datasetFieldDefaultValues = datasetFieldDefaultValues; | ||
} | ||
|
||
@Override | ||
public int compareTo(DatasetFieldType o) { | ||
return Integer.compare(this.getDisplayOrder(), (o.getDisplayOrder())); | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should add the
@deprecated
tag to the javadoc and provide a reason in the@Deprecated
annotation, according to Sonarcloud.