Skip to content
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

6684 dataset pg btn responsive #6909

Merged
merged 66 commits into from
Jun 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
f6a38ee
Initial commit for new dataset pg action btn responsive layout [ref #…
mheppler Mar 12, 2020
b1d7f7a
Added new responsive Publish btn dropdown [ref #6684]
mheppler Mar 16, 2020
139e040
Improve responsive widths of dataset pg btns for sm, xs layouts [ref …
mheppler Mar 16, 2020
9d5699d
Improved responsive layout of thumbnail and citation on datatset pg […
mheppler Mar 18, 2020
959748d
Additional responsive cleanup of action btns, citation, metrics, summ…
mheppler Mar 25, 2020
4e2802b
Intial commit for responsive btns on file pg [ref #6684]
mheppler Mar 25, 2020
b638760
Additional responsive btn improvements to file pg [ref #6684]
mheppler Mar 26, 2020
f3f36d8
Initial file pg responsive btn with duplicate btns on dataset pg file…
mheppler Mar 30, 2020
1e55990
Merge branch 'develop' into 6684-dataset-pg-btn-responsive
mheppler Mar 30, 2020
25a44b8
New icon only styling to file table btns on dataset pg [ref #6684]
mheppler Apr 1, 2020
b3e5952
Dataset and file pg action btn render logic, accessibility improveme…
mheppler Apr 9, 2020
5151b4f
Added disabled attribute and classes to publish btns on dataset pg [r…
mheppler Apr 9, 2020
6f61923
#6684 move publish button group logic
sekmiller Apr 10, 2020
bf730de
Dataset and file pg btn updates, bundle text, styles [ref #6684]
mheppler Apr 10, 2020
21968d8
Dataset/file pg dropdown btn caret icon fix [ref #6684]
mheppler Apr 10, 2020
11ddde0
Fixed dataset and file pg btn dropdown align and margin issues [ref #…
mheppler Apr 13, 2020
b268b75
Fixed edit btn render logic for deaccession datasets [ref #6684]
mheppler Apr 15, 2020
be44a82
change DEFAULT_THUMBNAIL_SIZE from 64 to 140 #6769
pdurbin Apr 14, 2020
f7017e5
Fixed size of file thumbnail on dataset pg, edit file pg, replace fil…
mheppler Apr 15, 2020
aed6d83
new dataset thumbnail variable, revert previous #6769
pdurbin Apr 16, 2020
17ae5e1
reverts docs to 64 pixels wide #6769
pdurbin Apr 16, 2020
76449b9
Merge pull request #6830 from IQSS/6684-thumbnails
mheppler Apr 16, 2020
4254a0f
Making the size of the dataset thumbnail flexible.
landreev Apr 17, 2020
8c66e11
Render logic for disabled btns improved on file and dataset pg, clean…
mheppler Apr 17, 2020
2578ac5
fixed the dataset thumbnail test in SearchIT; (the APIs will continue…
landreev Apr 20, 2020
ee7a2f4
Render logic fix for publish and access btns on dataset pg [ref #6684]
mheppler Apr 21, 2020
95d7e04
don't show breadcrumbs for direct child of root datasets #6684
pdurbin Apr 21, 2020
bdce073
Fixed render logic and style class for Access File btn dropdown optio…
mheppler Apr 21, 2020
47d8b9f
#6684 modularize/centralize publish button rendering
sekmiller Apr 22, 2020
806f20d
Added UI hack to Access File dropdown download submenu options on fil…
mheppler Apr 22, 2020
4939e39
Fixed deaccession render logic for download on file pg [ref #6684]
mheppler Apr 22, 2020
237f9a7
#6684 additional render logic for Access Dataset
sekmiller Apr 22, 2020
bab5280
Removed hardcoded image size on dataset thumbnail + widgets pg [ref #…
mheppler May 6, 2020
84012f7
Hide dataset thumbnail for deaccessioned dataset pg, result cards [re…
mheppler May 6, 2020
f4c2e1b
Dataset pg render logic and various code clean up [ref #6684]
mheppler May 6, 2020
e0e688d
Fixed locked render logic on btn on dataset, fixed CSS icon link btn …
mheppler May 8, 2020
9cc3f91
Merge branch 'develop' into 6684-dataset-pg-btn-responsive #6684
mheppler May 8, 2020
6e5f069
Fixed col width issue on dataset theme form due to larger thumbnails …
mheppler May 12, 2020
2669539
Code clean up, stylesheets for file action btns [ref #6684]
mheppler May 12, 2020
31fe93c
Responsive, widgetView layout improvements to citation block, footer …
mheppler May 14, 2020
3902707
Fixed thumbnail size in dataset citation block [ref #6684]
mheppler May 14, 2020
136665c
Fixed render logic for Access File btn on file pg, fixed analytics bu…
mheppler May 26, 2020
b3872b2
Moved inline styles for new button UI to stylesheet [ref #6684]
mheppler May 27, 2020
f147041
Added new shared text to file pg, added min-height for dataset thumb …
mheppler May 27, 2020
c3a7387
Merge branch 'develop' into 6684-dataset-pg-btn-responsive
mheppler May 27, 2020
3d0043f
Resolved double cancel btn on dataset form [ref #6684]
mheppler May 27, 2020
4e64507
Fixed spacing issue for caret on configure icon btn in file table on …
mheppler May 27, 2020
abb6b66
adding release note
djbrooke May 28, 2020
ae05dde
Changed viewParam for fileId on file pg to OmniFaces component to fix…
mheppler May 28, 2020
22c9732
Restored original background colors to publication status labels on d…
mheppler May 28, 2020
c114f51
Moved ingest error popover on file pg to bottom of icon [ref #6684]
mheppler May 29, 2020
2a95581
Added render logic to Access Dataset btn and ui:remove to Download pl…
mheppler May 29, 2020
3d23d75
Increase font size of learn about citations link on dataset and file …
mheppler Jun 1, 2020
fbd5e8b
Removed extra dropdown submen for download and explore options under …
mheppler Jun 1, 2020
5110ad7
#6684 get disable publish button from page bean
sekmiller Jun 2, 2020
a8367f5
#6684 make sure lock test catches any new locks added
sekmiller Jun 3, 2020
864ed46
#6684 update render logic for publish buttons
sekmiller Jun 4, 2020
e837839
Cleaned up publish/submit for review/return to author links under new…
mheppler Jun 4, 2020
7910d21
Added new single-click verion of publish btn to dataset pg, needs ren…
mheppler Jun 4, 2020
69e9626
#6684 finalize?! publish button rendering
sekmiller Jun 4, 2020
f8cdb17
Swapped two publish btns for one with new components for dynamic attr…
mheppler Jun 5, 2020
2cdedea
#6684 check for Create mode on showSubmitForReviewLink
sekmiller Jun 5, 2020
1a1479e
Merge branch 'develop' into 6684-dataset-pg-btn-responsive
sekmiller Jun 8, 2020
a16adff
Fixed merge conflict related to request access javascript [ref #6684,…
mheppler Jun 8, 2020
e7ebdd6
#6684 consolidate publish popups
sekmiller Jun 8, 2020
90ac3a6
Fixed unnecessary duplicate file download javascript [ref #6684, #6943]
mheppler Jun 8, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,8 @@ scripts/installer/default.config
tests/node_modules
tests/package-lock.json
venv

# from thumbnail tests in SearchIT
scripts/search/data/binary/trees.png.thumb140
src/main/webapp/resources/images/cc0.png.thumb140
src/main/webapp/resources/images/dataverseproject.png.thumb140
1 change: 1 addition & 0 deletions doc/release-notes/6684-buttons
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Note about how the buttons are the next steps towards the dataset and file redesign, mention previews on page, filtering/sorting options, tree view.
4 changes: 2 additions & 2 deletions doc/sphinx-guides/source/api/dataaccess.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ the following parameter values are supported (for image and pdf files only):
============== ===========
Value Description
============== ===========
true Generates a thumbnail image, by rescaling to the default thumbnail size (64 pixels)
``N`` Rescales the image to ``N`` pixels.
true Generates a thumbnail image by rescaling to the default thumbnail size (64 pixels wide).
``N`` Rescales the image to ``N`` pixels wide. ``imageThumb=true`` and ``imageThumb=64`` are equivalent.
============== ===========

Multiple File ("bundle") download
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/edu/harvard/iq/dataverse/Dataset.java
Original file line number Diff line number Diff line change
Expand Up @@ -845,8 +845,8 @@ public boolean isAncestorOf( DvObject other ) {
return equals(other) || equals(other.getOwner());
}

public DatasetThumbnail getDatasetThumbnail() {
return DatasetUtil.getThumbnail(this);
public DatasetThumbnail getDatasetThumbnail(int size) {
return DatasetUtil.getThumbnail(this, size);
}

/**
Expand All @@ -857,8 +857,8 @@ public DatasetThumbnail getDatasetThumbnail() {
* @param datasetVersion
* @return A thumbnail of the dataset (may be {@code null}).
*/
public DatasetThumbnail getDatasetThumbnail(DatasetVersion datasetVersion) {
return DatasetUtil.getThumbnail(this, datasetVersion);
public DatasetThumbnail getDatasetThumbnail(DatasetVersion datasetVersion, int size) {
return DatasetUtil.getThumbnail(this, datasetVersion, size);
}

}
144 changes: 121 additions & 23 deletions src/main/java/edu/harvard/iq/dataverse/DatasetPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ public String getThumbnailString() {
}

if (!readOnly) {
DatasetThumbnail datasetThumbnail = dataset.getDatasetThumbnail();
DatasetThumbnail datasetThumbnail = dataset.getDatasetThumbnail(ImageThumbConverter.DEFAULT_DATASETLOGO_SIZE);
mheppler marked this conversation as resolved.
Show resolved Hide resolved
if (datasetThumbnail == null) {
thumbnailString = "";
return null;
Expand All @@ -391,7 +391,10 @@ public String getThumbnailString() {

thumbnailString = datasetThumbnail.getBase64image();
} else {
thumbnailString = thumbnailServiceWrapper.getDatasetCardImageAsBase64Url(dataset, workingVersion.getId(),!workingVersion.isDraft());
thumbnailString = thumbnailServiceWrapper.getDatasetCardImageAsBase64Url(dataset,
workingVersion.getId(),
!workingVersion.isDraft(),
ImageThumbConverter.DEFAULT_DATASETLOGO_SIZE);
if (thumbnailString == null) {
thumbnailString = "";
return null;
Expand Down Expand Up @@ -1057,6 +1060,17 @@ public boolean canComputeAllFiles(boolean isCartCompute){
}
return true;
}

public boolean canDownloadFiles(){
//returns true if the page user has permission to download at least one file
for (FileMetadata fmd : workingVersion.getFileMetadatas()) {
if (fileDownloadHelper.canDownloadFile(fmd)) {
return true;
}
}
return false;
}

/*
in getComputeUrl(), we are sending the container/dataset name and the exipiry and signature
for the temporary url of only ONE datafile within the dataset. This is because in the
Expand Down Expand Up @@ -1802,7 +1816,7 @@ private String init(boolean initFull) {
String nonNullDefaultIfKeyNotFound = "";
protocol = settingsWrapper.getValueForKey(SettingsServiceBean.Key.Protocol, nonNullDefaultIfKeyNotFound);
authority = settingsWrapper.getValueForKey(SettingsServiceBean.Key.Authority, nonNullDefaultIfKeyNotFound);
if (dataset.getId() != null || versionId != null || persistentId != null) { // view mode for a dataset
if (this.getId() != null || versionId != null || persistentId != null) { // view mode for a dataset

DatasetVersionServiceBean.RetrieveDatasetVersionResponse retrieveDatasetVersionResponse = null;

Expand Down Expand Up @@ -2418,22 +2432,6 @@ public void edit(EditMode editMode) {
this.readOnly = false;
}

public String releaseDraft() {
if (releaseRadio == 1) {
return releaseDataset(true);
} else if(releaseRadio ==2) {
return releaseDataset(false);
} else if(releaseRadio ==3) {
return updateCurrentVersion();
} else {
return "Invalid Choice";
}
}

public String releaseMajor() {
return releaseDataset(false);
}

public String sendBackToContributor() {
try {
//FIXME - Get Return Comment from sendBackToContributor popup
Expand Down Expand Up @@ -2484,7 +2482,22 @@ public String releaseParentDVAndDataset(){
}

public String releaseDataset() {
return releaseDataset(false);
if(!dataset.getOwner().isReleased()){
releaseParentDV();
}
if(publishDatasetPopup()|| publishBothPopup() || !dataset.getLatestVersion().isMinorUpdate()){
return releaseDataset(false);
}
switch (releaseRadio) {
case 1:
return releaseDataset(true);
case 2:
return releaseDataset(false);
case 3:
return updateCurrentVersion();
default:
return "Invalid Choice";
}
}

private void releaseParentDV(){
Expand Down Expand Up @@ -3764,17 +3777,95 @@ public boolean isLockedForAnyReason() {
}
return false;
}

public void processPublishButton() {
if (dataset.isReleased()) {
PrimeFaces.current().executeScript("PF('publishDataset').show()");
}

if (!dataset.isReleased()) {
if (dataset.getOwner().isReleased()) {
PrimeFaces.current().executeScript("PF('publishDataset').show()");
return;
}
if (!dataset.getOwner().isReleased()) {
if (canPublishDataverse()) {
if (dataset.getOwner().getOwner() == null
|| (dataset.getOwner().getOwner() != null && dataset.getOwner().getOwner().isReleased())) {
PrimeFaces.current().executeScript("PF('publishDataset').show()");
return;
}
if ((dataset.getOwner().getOwner() != null && !dataset.getOwner().getOwner().isReleased())) {
PrimeFaces.current().executeScript("PF('maynotPublishParent').show()");
}

} else {
PrimeFaces.current().executeScript("PF('mayNotRelease').show()");
}
}
}
}

public boolean releaseDraftPopup(){
return dataset.isReleased();
}

public boolean publishDatasetPopup(){
if (!dataset.isReleased()) {
return dataset.getOwner().isReleased();
}
return false;
}

public boolean publishBothPopup() {
if (!dataset.getOwner().isReleased()) {
if (canPublishDataverse()) {
if (dataset.getOwner().getOwner() == null
|| (dataset.getOwner().getOwner() != null && dataset.getOwner().getOwner().isReleased())) {
return true;
}
}
}
return false;
}

public String getPublishButtonLabel(){
if(publishDatasetPopup() || releaseDraftPopup()){
BundleUtil.getStringFromBundle("continue");
}
if(publishBothPopup()){
BundleUtil.getStringFromBundle("dataset.mayNotBePublished.both.button");
}
return "";
}

private Boolean lockedFromEditsVar;
private Boolean lockedFromDownloadVar;
private boolean lockedDueToDcmUpload;
private Boolean lockedDueToIngestVar;
private Boolean lockedFromPublishingVar;

/**
* Authors are not allowed to publish but curators are allowed - when Dataset is inReview
* For all other locks edit should be locked for all editors.
*/
public boolean isLockedFromPublishing() {
if (null == lockedFromPublishingVar || stateChanged) {
try {
permissionService.checkPublishDatasetLock(dataset, dvRequestService.getDataverseRequest(), new PublishDatasetCommand(dataset, dvRequestService.getDataverseRequest(), true));
lockedFromPublishingVar = false;
} catch (IllegalCommandException ex) {
lockedFromPublishingVar = true;
}
}
return lockedFromPublishingVar;
}
/**
* Authors are not allowed to edit but curators are allowed - when Dataset is inReview
* For all other locks edit should be locked for all editors.
*/
public boolean isLockedFromEdits() {
if(null == lockedFromEditsVar || stateChanged) {
if (null == lockedFromEditsVar || stateChanged) {
try {
permissionService.checkEditDatasetLock(dataset, dvRequestService.getDataverseRequest(), new UpdateDatasetVersionCommand(dataset, dvRequestService.getDataverseRequest()));
lockedFromEditsVar = false;
Expand All @@ -3783,6 +3874,7 @@ public boolean isLockedFromEdits() {
}
}
return lockedFromEditsVar;

}

/**
Expand Down Expand Up @@ -4076,12 +4168,18 @@ private List<DatasetVersion> resetReleasedVersionTabList() {
}
return retList;
}

public boolean isDisplayPublishPopupCustomText() {
if (dataset.isReleased()) {
return isDatasetPublishPopupCustomTextOnAllVersions() && !getDatasetPublishCustomText().isEmpty();
}
return !getDatasetPublishCustomText().isEmpty();
}

public String getDatasetPublishCustomText(){
String datasetPublishCustomText = settingsWrapper.getValueForKey(SettingsServiceBean.Key.DatasetPublishPopupCustomText);
if( datasetPublishCustomText!= null && !datasetPublishCustomText.isEmpty()){
return datasetPublishCustomText;

return datasetPublishCustomText;
}
return "";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ public Dataset setNonDatasetFileAsThumbnail(Dataset dataset, InputStream inputSt
logger.fine("In setNonDatasetFileAsThumbnail but inputStream is null! Returning null.");
return null;
}
dataset = DatasetUtil.persistDatasetLogoToStorageAndCreateThumbnail(dataset, inputStream);
dataset = DatasetUtil.persistDatasetLogoToStorageAndCreateThumbnails(dataset, inputStream);
dataset.setThumbnailFile(null);
return merge(dataset);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ public String init() {
if (!permissionsWrapper.canIssueCommand(dataset, UpdateDatasetVersionCommand.class)) {
return permissionsWrapper.notAuthorized();
}
datasetThumbnails = DatasetUtil.getThumbnailCandidates(dataset, considerDatasetLogoAsCandidate);
datasetThumbnail = dataset.getDatasetThumbnail();
datasetThumbnails = DatasetUtil.getThumbnailCandidates(dataset, considerDatasetLogoAsCandidate, ImageThumbConverter.DEFAULT_DATASETLOGO_SIZE);
datasetThumbnail = dataset.getDatasetThumbnail(ImageThumbConverter.DEFAULT_DATASETLOGO_SIZE);
if (datasetThumbnail != null) {
DataFile dataFile = datasetThumbnail.getDataFile();
if (dataFile != null) {
Expand Down Expand Up @@ -117,7 +117,7 @@ public void setDatasetFileThumbnailToSwitchTo(DataFile datasetFileThumbnailToSwi
public void setDataFileAsThumbnail() {
logger.fine("setDataFileAsThumbnail clicked");
updateDatasetThumbnailCommand = new UpdateDatasetThumbnailCommand(dvRequestService.getDataverseRequest(), dataset, UpdateDatasetThumbnailCommand.UserIntent.setDatasetFileAsThumbnail, datasetFileThumbnailToSwitchTo.getId(), null);
String base64image = ImageThumbConverter.getImageThumbnailAsBase64(datasetFileThumbnailToSwitchTo, ImageThumbConverter.DEFAULT_CARDIMAGE_SIZE);
String base64image = ImageThumbConverter.getImageThumbnailAsBase64(datasetFileThumbnailToSwitchTo, ImageThumbConverter.DEFAULT_DATASETLOGO_SIZE);
datasetThumbnail = new DatasetThumbnail(base64image, datasetFileThumbnailToSwitchTo);
}

Expand Down Expand Up @@ -146,7 +146,7 @@ public void handleImageFileUpload(FileUploadEvent event) {
Logger.getLogger(DatasetWidgetsPage.class.getName()).log(Level.SEVERE, null, ex);
return;
}
String base64image = ImageThumbConverter.generateImageThumbnailFromFileAsBase64(file, ImageThumbConverter.DEFAULT_CARDIMAGE_SIZE);
String base64image = ImageThumbConverter.generateImageThumbnailFromFileAsBase64(file, ImageThumbConverter.DEFAULT_DATASETLOGO_SIZE);
if (base64image != null) {
datasetThumbnail = new DatasetThumbnail(base64image, datasetFileThumbnailToSwitchTo);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2512,7 +2512,7 @@ public void deleteDatasetLogoAndUseThisDataFileAsThumbnailInstead() {
}

public boolean isThumbnailIsFromDatasetLogoRatherThanDatafile() {
DatasetThumbnail datasetThumbnail = dataset.getDatasetThumbnail();
DatasetThumbnail datasetThumbnail = dataset.getDatasetThumbnail(ImageThumbConverter.DEFAULT_CARDIMAGE_SIZE);
return datasetThumbnail != null && !datasetThumbnail.isFromDataFile();
}

Expand Down
44 changes: 39 additions & 5 deletions src/main/java/edu/harvard/iq/dataverse/PermissionServiceBean.java
Original file line number Diff line number Diff line change
Expand Up @@ -708,28 +708,62 @@ public List<Long> getDvObjectIdsUserHasRoleOn(User user, List<DataverseRole> rol

public void checkEditDatasetLock(Dataset dataset, DataverseRequest dataverseRequest, Command command) throws IllegalCommandException {
if (dataset.isLocked()) {
if (dataset.isLockedFor(DatasetLock.Reason.Ingest)) {
throw new IllegalCommandException(BundleUtil.getStringFromBundle("dataset.message.locked.editNotAllowed"), command);
}
if (dataset.isLockedFor(DatasetLock.Reason.finalizePublication)) {
throw new IllegalCommandException(BundleUtil.getStringFromBundle("dataset.message.locked.editNotAllowed"), command);
}
// TODO: Do we need to check for "Workflow"? Should the message be more specific?
if (dataset.isLockedFor(DatasetLock.Reason.Workflow)) {
throw new IllegalCommandException(BundleUtil.getStringFromBundle("dataset.message.locked.editNotAllowed"), command);
}
// TODO: Do we need to check for "DcmUpload"? Should the message be more specific?
if (dataset.isLockedFor(DatasetLock.Reason.DcmUpload)) {
throw new IllegalCommandException(BundleUtil.getStringFromBundle("dataset.message.locked.editNotAllowed"), command);
}
if (dataset.isLockedFor(DatasetLock.Reason.EditInProgress)) {
throw new IllegalCommandException(BundleUtil.getStringFromBundle("dataset.message.locked.editNotAllowed"), command);
}
if (dataset.isLockedFor(DatasetLock.Reason.InReview)) {
// The "InReview" lock is not really a lock for curators. They can still make edits.
if (!isUserAllowedOn(dataverseRequest.getUser(), new PublishDatasetCommand(dataset, dataverseRequest, true), dataset)) {
throw new IllegalCommandException(BundleUtil.getStringFromBundle("dataset.message.locked.editNotAllowedInReview"), command);
}
} else {
//catch all for locked for any other reason
throw new IllegalCommandException(BundleUtil.getStringFromBundle("dataset.message.locked.editNotAllowed"), command);
}
}
}

public void checkPublishDatasetLock(Dataset dataset, DataverseRequest dataverseRequest, Command command) throws IllegalCommandException {
if (dataset.isLocked()) {
if (dataset.isLockedFor(DatasetLock.Reason.Ingest)) {
throw new IllegalCommandException(BundleUtil.getStringFromBundle("dataset.message.locked.editNotAllowed"), command);
throw new IllegalCommandException(BundleUtil.getStringFromBundle("dataset.message.locked.publishNotAllowed"), command);
}
if (dataset.isLockedFor(DatasetLock.Reason.finalizePublication)) {
throw new IllegalCommandException(BundleUtil.getStringFromBundle("dataset.message.locked.editNotAllowed"), command);
throw new IllegalCommandException(BundleUtil.getStringFromBundle("dataset.message.locked.publishNotAllowed"), command);
}
// TODO: Do we need to check for "Workflow"? Should the message be more specific?
if (dataset.isLockedFor(DatasetLock.Reason.Workflow)) {
throw new IllegalCommandException(BundleUtil.getStringFromBundle("dataset.message.locked.editNotAllowed"), command);
throw new IllegalCommandException(BundleUtil.getStringFromBundle("dataset.message.locked.publishNotAllowed"), command);
}
// TODO: Do we need to check for "DcmUpload"? Should the message be more specific?
if (dataset.isLockedFor(DatasetLock.Reason.DcmUpload)) {
throw new IllegalCommandException(BundleUtil.getStringFromBundle("dataset.message.locked.editNotAllowed"), command);
throw new IllegalCommandException(BundleUtil.getStringFromBundle("dataset.message.locked.publishNotAllowed"), command);
}
if (dataset.isLockedFor(DatasetLock.Reason.EditInProgress)) {
throw new IllegalCommandException(BundleUtil.getStringFromBundle("dataset.message.locked.editNotAllowed"), command);
throw new IllegalCommandException(BundleUtil.getStringFromBundle("dataset.message.locked.publishNotAllowed"), command);
}
if (dataset.isLockedFor(DatasetLock.Reason.InReview)) {
// The "InReview" lock is not really a lock for curators. They can still publish
if (!isUserAllowedOn(dataverseRequest.getUser(), new PublishDatasetCommand(dataset, dataverseRequest, true), dataset)) {
throw new IllegalCommandException(BundleUtil.getStringFromBundle("dataset.message.locked.publishNotAllowed"), command);
}
} else {
//catch all for locked for some other reason
throw new IllegalCommandException(BundleUtil.getStringFromBundle("dataset.message.locked.publishNotAllowed"), command);
}
}
}
Expand Down
Loading