Skip to content

Commit b26a14d

Browse files
committed
Refactor: GetDatasetVersionSummariesCommand to include explanatory method doc and removed unused exception throws
1 parent da66035 commit b26a14d

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/main/java/edu/harvard/iq/dataverse/engine/command/impl/GetDatasetVersionSummariesCommand.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import edu.harvard.iq.dataverse.engine.command.CommandContext;
88
import edu.harvard.iq.dataverse.engine.command.DataverseRequest;
99
import edu.harvard.iq.dataverse.engine.command.RequiredPermissions;
10-
import edu.harvard.iq.dataverse.engine.command.exception.CommandException;
1110

1211
import java.util.EnumSet;
1312
import java.util.List;
@@ -26,8 +25,19 @@ public GetDatasetVersionSummariesCommand(DataverseRequest request, Dataset datas
2625
this.dataset = dataset;
2726
}
2827

28+
/**
29+
* Executes the command to retrieve a paginated list of dataset version summaries.
30+
* <p>
31+
* This method first checks if the user has permission to view unpublished
32+
* versions of the dataset. It then fetches the appropriate {@link DatasetVersion}s,
33+
* respecting pagination parameters (limit and offset), and converts each
34+
* version into a {@link DatasetVersionSummary}.
35+
*
36+
* @param ctxt The command context.
37+
* @return A list of {@link DatasetVersionSummary} objects.
38+
*/
2939
@Override
30-
public List<DatasetVersionSummary> executeCommand(CommandContext ctxt) throws CommandException {
40+
public List<DatasetVersionSummary> executeCommand(CommandContext ctxt) {
3141
boolean canViewUnpublished = ctxt.permissions().hasPermissionsFor(
3242
getRequest().getUser(),
3343
dataset,

0 commit comments

Comments
 (0)