-
Notifications
You must be signed in to change notification settings - Fork 493
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added: returning imageUrl with new associated endpoint for retrieving…
… the featured item image from the client
- Loading branch information
Showing
7 changed files
with
91 additions
and
45 deletions.
There are no files selected for viewing
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
37 changes: 37 additions & 0 deletions
37
...in/java/edu/harvard/iq/dataverse/engine/command/impl/GetDataverseFeaturedItemCommand.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,37 @@ | ||
package edu.harvard.iq.dataverse.engine.command.impl; | ||
|
||
import edu.harvard.iq.dataverse.DataverseFeaturedItem; | ||
import edu.harvard.iq.dataverse.authorization.Permission; | ||
import edu.harvard.iq.dataverse.engine.command.AbstractCommand; | ||
import edu.harvard.iq.dataverse.engine.command.CommandContext; | ||
import edu.harvard.iq.dataverse.engine.command.DataverseRequest; | ||
import edu.harvard.iq.dataverse.engine.command.exception.CommandException; | ||
|
||
import java.util.Collections; | ||
import java.util.Map; | ||
import java.util.Set; | ||
|
||
/** | ||
* Retrieves a particular featured item {@link DataverseFeaturedItem}. | ||
*/ | ||
public class GetDataverseFeaturedItemCommand extends AbstractCommand<DataverseFeaturedItem> { | ||
|
||
private final DataverseFeaturedItem dataverseFeaturedItem; | ||
|
||
public GetDataverseFeaturedItemCommand(DataverseRequest request, DataverseFeaturedItem dataverseFeaturedItem) { | ||
super(request, dataverseFeaturedItem.getDataverse()); | ||
this.dataverseFeaturedItem = dataverseFeaturedItem; | ||
} | ||
|
||
@Override | ||
public DataverseFeaturedItem execute(CommandContext ctxt) throws CommandException { | ||
return dataverseFeaturedItem; | ||
} | ||
|
||
@Override | ||
public Map<String, Set<Permission>> getRequiredPermissions() { | ||
return Collections.singletonMap("", | ||
dataverseFeaturedItem.getDataverse().isReleased() ? Collections.emptySet() | ||
: Collections.singleton(Permission.ViewUnpublishedDataverse)); | ||
} | ||
} |
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