-
Notifications
You must be signed in to change notification settings - Fork 532
Extended io.gdcc.dataverse-spi (ExportDataProvider) interface #11767
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
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
36f36f7
Expanding the ExportDataProvider interface to add hooks for more
landreev f9963ca
cosmetic #11766
landreev 409f77d
update Maven snapshot release id and URL #11766 #11512
pdurbin 4ed1879
explain how to publish a maven snapshot locally #11766 #11512
pdurbin f570aaa
add TODO comments to spi workflow #11766 #11512
pdurbin 0500d7e
Another experimental approach (#11766)
landreev 75d99d0
another experimental iteration of the updated export data spi. #11766
landreev cb06d89
the new context object (was missing from the previous commit in error…
landreev fdf75cd
removing some experimental lines from the Exporter interface #11766
landreev 862522e
a release note for the dataverse-spi update. #11766
landreev 5bd0595
Merge pull request #11774 from IQSS/11766-11512-spi
landreev 97e3803
switch from ossrh to central #11766 #11512
pdurbin 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
This file contains hidden or 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 hidden or 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,2 @@ | ||
| The ExportDataProvider framework in the dataverse-spi package has been extended, adding some extra options for developers of metadata exporter plugins. | ||
| See the [documentation](https://guides.dataverse.org/en/latest/developers/metadataexport.html#building-an-exporter) in the Metadata Export guide for details. |
This file contains hidden or 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 hidden or 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
61 changes: 61 additions & 0 deletions
61
modules/dataverse-spi/src/main/java/io/gdcc/spi/export/ExportDataContext.java
This file contains hidden or 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,61 @@ | ||
| package io.gdcc.spi.export; | ||
|
|
||
| /** | ||
| * | ||
| * @author landreev | ||
| * Provides an optional mechanism for defining various data retrieval options | ||
| * for the export subsystem in a way that should allow us adding support for | ||
| * more options going forward with minimal or no changes to the already | ||
| * implemented export plugins. | ||
| */ | ||
| public class ExportDataContext { | ||
| private boolean datasetMetadataOnly = false; | ||
| private boolean publicFilesOnly = false; | ||
| private Integer offset = null; | ||
| private Integer length = null; | ||
|
|
||
| private ExportDataContext() { | ||
|
|
||
| } | ||
|
|
||
| public static ExportDataContext context() { | ||
| ExportDataContext context = new ExportDataContext(); | ||
| return context; | ||
| } | ||
|
|
||
| public ExportDataContext withDatasetMetadataOnly() { | ||
| this.datasetMetadataOnly = true; | ||
| return this; | ||
| } | ||
|
|
||
| public ExportDataContext withPublicFilesOnly() { | ||
| this.publicFilesOnly = true; | ||
| return this; | ||
| } | ||
|
|
||
| public ExportDataContext withOffset(Integer offset) { | ||
| this.offset = offset; | ||
| return this; | ||
| } | ||
|
|
||
| public ExportDataContext withLength(Integer length) { | ||
| this.length = length; | ||
| return this; | ||
| } | ||
|
|
||
| public boolean isDatasetMetadataOnly() { | ||
| return datasetMetadataOnly; | ||
| } | ||
|
|
||
| public boolean isPublicFilesOnly() { | ||
| return publicFilesOnly; | ||
| } | ||
|
|
||
| public Integer getOffset() { | ||
| return offset; | ||
| } | ||
|
|
||
| public Integer getLength() { | ||
| return length; | ||
| } | ||
| } |
51 changes: 51 additions & 0 deletions
51
modules/dataverse-spi/src/main/java/io/gdcc/spi/export/ExportDataOption.java
This file contains hidden or 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,51 @@ | ||
| package io.gdcc.spi.export; | ||
|
|
||
| /** | ||
| * | ||
| * @author landreev | ||
| * Provides a mechanism for defining various data retrieval options for the | ||
| * export subsystem in a way that should allow us adding support for more | ||
| * options going forward with minimal or no changes to the existing code in | ||
| * export plugins. | ||
| */ | ||
| @Deprecated | ||
| public class ExportDataOption { | ||
|
|
||
| public enum SupportedOptions { | ||
| DatasetMetadataOnly, | ||
| PublicFilesOnly; | ||
| } | ||
|
|
||
| private SupportedOptions optionType; | ||
|
|
||
| /*public static ExportDataOption addOption(String option) { | ||
| ExportDataOption ret = new ExportDataOption(); | ||
|
|
||
| for (SupportedOptions supported : SupportedOptions.values()) { | ||
| if (supported.toString().equals(option)) { | ||
| ret.optionType = supported; | ||
| } | ||
| } | ||
| return ret; | ||
| }*/ | ||
|
|
||
| public static ExportDataOption addDatasetMetadataOnly() { | ||
| ExportDataOption ret = new ExportDataOption(); | ||
| ret.optionType = SupportedOptions.DatasetMetadataOnly; | ||
| return ret; | ||
| } | ||
|
|
||
| public static ExportDataOption addPublicFilesOnly() { | ||
| ExportDataOption ret = new ExportDataOption(); | ||
| ret.optionType = SupportedOptions.PublicFilesOnly; | ||
| return ret; | ||
| } | ||
|
|
||
| public boolean isDatasetMetadataOnly() { | ||
| return SupportedOptions.DatasetMetadataOnly.equals(optionType); | ||
| } | ||
|
|
||
| public boolean isPublicFilesOnly() { | ||
| return SupportedOptions.PublicFilesOnly.equals(optionType); | ||
| } | ||
| } | ||
This file contains hidden or 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 hidden or 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
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
Looks like this is a new unused class. Instead of Deprecating why not just remove it?
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.
I just saw your comment (ExportDataOption.java is still checked in for reference). I don't think checking in unused code is good. Also, there are no tests included. Does this lower the code coverage? I'm not sure if code not under src/ is included in code coverage.
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.
@stevenwinship Thanks for reviewing this. Unfortunately, I missed your comments above yesterday. Yes, it would have been ideal to remove this before merging. I may make a quick followup pr removing it, before the interface jar is published on maven central.
And yes, I only left it in place for the sake of showing the reviewers an alternative implementation I first tried.