Skip to content

Commit

Permalink
LONGTERM_ARCHIVED
Browse files Browse the repository at this point in the history
  • Loading branch information
ffritze committed Mar 11, 2024
1 parent f9ffc7d commit 215af54
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/main/java/edu/harvard/iq/dataverse/DatasetVersion.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public int compare(DatasetVersion o1, DatasetVersion o2) {
//IMPORTANT: If you add a new value to this enum, you will also have to modify the
// StudyVersionsFragment.xhtml in order to display the correct value from a Resource Bundle
public enum VersionState {
DRAFT, RELEASED, ARCHIVED, DEACCESSIONED
DRAFT, RELEASED, ARCHIVED, DEACCESSIONED, LONGTERM_ARCHIVED
}

public static final int ARCHIVE_NOTE_MAX_LENGTH = 1000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,17 @@ public ArchiveDatasetResult execute(CommandContext ctxt) throws CommandException

if (theDataset.getPublicationDate() == null) {
// First Release
theDataset.getLatestVersion().setVersionNumber(new Long(1)); // minor release is blocked by #verifyCommandArguments
theDataset.getLatestVersion().setMinorVersionNumber(new Long(0));
theDataset.getLatestVersion().setVersionNumber(Long.valueOf(1)); // minor release is blocked by #verifyCommandArguments
theDataset.getLatestVersion().setMinorVersionNumber(Long.valueOf(0));

} else if ( minorRelease ) {
theDataset.getLatestVersion().setVersionNumber(new Long(theDataset.getVersionNumber()));
theDataset.getLatestVersion().setMinorVersionNumber(new Long(theDataset.getMinorVersionNumber() + 1));
theDataset.getLatestVersion().setVersionNumber(Long.valueOf(theDataset.getVersionNumber()));
theDataset.getLatestVersion().setMinorVersionNumber(Long.valueOf(theDataset.getMinorVersionNumber() + 1));

} else {
// major, non-first release
theDataset.getLatestVersion().setVersionNumber(new Long(theDataset.getVersionNumber() + 1));
theDataset.getLatestVersion().setMinorVersionNumber(new Long(0));
theDataset.getLatestVersion().setVersionNumber(Long.valueOf(theDataset.getVersionNumber() + 1));
theDataset.getLatestVersion().setMinorVersionNumber(Long.valueOf(0));
}

// Perform any optional validation steps, if defined:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public Dataset execute(CommandContext ctxt) throws CommandException {

// validate the physical files before we do anything else:
// (unless specifically disabled; or a minor version)
if (theDataset.getLatestVersion().getVersionState() != RELEASED
if (theDataset.getLatestVersion().getVersionState() != LONGTERM_ARCHIVED
&& theDataset.getLatestVersion().getMinorVersionNumber() != null
&& theDataset.getLatestVersion().getMinorVersionNumber().equals((long) 0)
&& ctxt.systemConfig().isDatafileValidationOnPublishEnabled()) {
Expand Down Expand Up @@ -185,7 +185,7 @@ public Dataset execute(CommandContext ctxt) throws CommandException {
ctxt.engine().submit(new DeletePrivateUrlCommand(getRequest(), theDataset));
}

if (theDataset.getLatestVersion().getVersionState() != RELEASED) {
if (theDataset.getLatestVersion().getVersionState() != LONGTERM_ARCHIVED) {
// some imported datasets may already be released.

if (!datasetExternallyReleased) {
Expand All @@ -196,7 +196,7 @@ public Dataset execute(CommandContext ctxt) throws CommandException {
// a failure - it will remove any locks, and it will send a
// proper notification to the user(s).
}
theDataset.getLatestVersion().setVersionState(RELEASED);
theDataset.getLatestVersion().setVersionState(LONGTERM_ARCHIVED);
}

final Dataset ds = ctxt.em().merge(theDataset);
Expand Down

0 comments on commit 215af54

Please sign in to comment.