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

4813 allow duplicate files #6924

Merged
merged 83 commits into from
Aug 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
f311312
#4813 allow duplicate files to be uploaded
sekmiller May 12, 2020
cfe629d
Merge branch 'develop' into 4813-allow-duplicate-files
sekmiller May 12, 2020
abcaa3b
#4813 Allow replacement with the same file
sekmiller May 13, 2020
ce34432
Merge branch 'develop' into 4813-allow-duplicate-files
sekmiller May 15, 2020
4743b23
#4813 update comments
sekmiller May 15, 2020
ca7ba78
#4813 update test and bundle
sekmiller May 15, 2020
17869df
#4813 fix failing test
sekmiller May 18, 2020
34ce725
Merge branch 'develop' into 4813-allow-duplicate-files
sekmiller May 20, 2020
9b4152c
#4813 fix filemetadata testing
sekmiller May 20, 2020
801d4bb
Create 4813-allow-duplicate-files.md
djbrooke May 20, 2020
d1139a9
Merge branch 'develop' into 4813-allow-duplicate-files
sekmiller May 20, 2020
aa02d34
#4813 remove extraneous logging
sekmiller May 20, 2020
0cea0da
#4813 fix display of file names in popup
sekmiller May 29, 2020
2997792
Merge branch 'develop' into 4813-allow-duplicate-files
sekmiller May 29, 2020
121620c
#4813 Do not allow replace with same file
sekmiller May 29, 2020
5012eb6
Merge branch 'develop' into 4813-allow-duplicate-files
sekmiller May 29, 2020
b24b3c2
#4813 modify inline error message for dupes
sekmiller Jun 1, 2020
1182c54
#4813 add more detail to duplicate messages
sekmiller Jun 2, 2020
6fb7c93
#4813 grammar
sekmiller Jun 2, 2020
86294eb
Merge branch 'develop' into 4813-allow-duplicate-files
sekmiller Jun 3, 2020
21a2a7f
#4813 update button label
sekmiller Jun 3, 2020
f82ca33
Merge branch 'develop' into 4813-allow-duplicate-files
sekmiller Jun 9, 2020
a323db5
#4813 add note about duplicate file path/name
sekmiller Jun 9, 2020
178b6a4
#4813 add doc for duplicate file content/name
sekmiller Jun 9, 2020
640325c
#4813 add link to user guide to popup
sekmiller Jun 9, 2020
eec2854
#4813 reword inline warning message
sekmiller Jun 9, 2020
0273d86
Merge branch 'develop' into 4813-allow-duplicate-files
sekmiller Jun 11, 2020
fae5dc1
#4813 add warning if replacement file is dup of existing file
sekmiller Jun 12, 2020
d36c046
#4813 show replace with dup message on upload component
sekmiller Jun 15, 2020
847fd62
updating rules, need to check with @sekmiller
djbrooke Jun 23, 2020
6eddfc3
Merge branch 'develop' into 4813-allow-duplicate-files
sekmiller Jun 23, 2020
954b3b7
update release notes for dupe file handling
djbrooke Jun 23, 2020
0328487
update duplicate file explanation as it pertains to replace
djbrooke Jun 23, 2020
0e90ce8
typo, thanks @jggautier
djbrooke Jun 23, 2020
911cd0e
#4813 update replace rules
sekmiller Jun 23, 2020
c8f358f
#4813 update bundle to reflect new section in User Guide
sekmiller Jun 23, 2020
d8dcb17
Merge branch 'develop' into 4813-allow-duplicate-files
sekmiller Jun 30, 2020
a8629f4
Merge branch 'develop' into 4813-allow-duplicate-files
sekmiller Jul 1, 2020
2d79816
Merge branch 'develop' into 4813-allow-duplicate-files
sekmiller Jul 8, 2020
70820ba
Merge branch 'develop' into 4813-allow-duplicate-files
sekmiller Jul 9, 2020
dcf2d73
adding a
djbrooke Jul 9, 2020
1b68d11
Merge branch 'develop' into 4813-allow-duplicate-files
sekmiller Jul 10, 2020
f1f18a0
#4813 update formatting of inline message
sekmiller Jul 10, 2020
e9f24cf
Merge branch 'develop' into 4813-allow-duplicate-files
sekmiller Jul 13, 2020
dfe9af5
#4813 add render logic to inline warning
sekmiller Jul 13, 2020
6af0f3e
#4813 get update button to display after upload
sekmiller Jul 13, 2020
117b321
Merge branch 'develop' into 4813-allow-duplicate-files
sekmiller Jul 13, 2020
77ad2e3
#4813 update popup messages
sekmiller Jul 14, 2020
dab96ab
Merge branch 'develop' into 4813-allow-duplicate-files
sekmiller Jul 14, 2020
6e7c3b9
#4813 add warnings when dup content added in same upload session
sekmiller Jul 15, 2020
ea85d9f
Merge branch 'develop' into 4813-allow-duplicate-files
sekmiller Jul 15, 2020
1ebd566
Cleaned up upload/edit file table layout to fix padding and margin is…
mheppler Jul 15, 2020
f64d4c6
#4813 change replace with dup to error. no popup.
sekmiller Jul 15, 2020
40701b9
Correct guides typo, fix guides link, ui clean up for duplidate files…
mheppler Jul 16, 2020
9fe91e1
#4813 fix file replace dupe messaging
sekmiller Jul 16, 2020
6eb7b52
Merge branch 'develop' into 4813-allow-duplicate-files
sekmiller Jul 16, 2020
c69ef84
#4813 remove unused code
sekmiller Jul 16, 2020
9350502
#4813 fix button refresh on file delete
sekmiller Jul 16, 2020
54011d7
#4813 fix failing test
sekmiller Jul 16, 2020
d0f5adc
Merge branch 'develop' into 4813-allow-duplicate-files
sekmiller Jul 16, 2020
36a0d76
#4813 clean up some message code
sekmiller Jul 17, 2020
e9d58aa
Merge branch 'develop' into 4813-allow-duplicate-files
sekmiller Jul 17, 2020
77edbb6
Merge branch 'develop' into 4813-allow-duplicate-files
sekmiller Jul 20, 2020
14d24f5
#4813 fix popup header
sekmiller Jul 20, 2020
60f2750
#4813 include new files in dupe name search
sekmiller Jul 20, 2020
8a3ed9b
Merge branch 'develop' into 4813-allow-duplicate-files
sekmiller Jul 20, 2020
21f98be
#4813 fix replace with multiple matching files
sekmiller Jul 20, 2020
0e531ee
Merge branch 'develop' into 4813-allow-duplicate-files
sekmiller Jul 21, 2020
7126aaa
Merge branch 'develop' into 4813-allow-duplicate-files
sekmiller Jul 27, 2020
5522e5d
#4813 add note about multiples to inline message
sekmiller Jul 27, 2020
2d60309
#4813 update messaging
sekmiller Jul 28, 2020
f87c9d9
Merge branch 'develop' into 4813-allow-duplicate-files
sekmiller Jul 28, 2020
0f41e9d
#4813 more message updates
sekmiller Jul 28, 2020
8169a1b
Merge branch 'develop' into 4813-allow-duplicate-files
sekmiller Jul 29, 2020
cef57dc
#4813 redo update buttons
sekmiller Jul 29, 2020
031b253
#4813 remove file names from delete success msg
sekmiller Jul 29, 2020
a4be5eb
Merge branch 'develop' into 4813-allow-duplicate-files
sekmiller Jul 29, 2020
46badd3
#4813 code cleanup
sekmiller Jul 30, 2020
90edc9e
Merge branch 'develop' into 4813-allow-duplicate-files
sekmiller Jul 30, 2020
0e99e15
#4813 clarify file name/path editing rules
sekmiller Jul 30, 2020
d0bfd3d
#4813 removing out of date comments
sekmiller Jul 30, 2020
82f9825
#4813 remove marked as dup from file metadata
sekmiller Jul 30, 2020
57ab613
#4813 separate retrieval of files for Deletion
sekmiller Jul 30, 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
1 change: 1 addition & 0 deletions doc/release-notes/4813-allow-duplicate-files.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
We should note that duplicate files are now allowed, and installations may want to contact people now that this is available. Point to rules in the Guides.
17 changes: 15 additions & 2 deletions doc/sphinx-guides/source/user/dataset-management.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ You can upload files to a dataset while first creating that dataset. You can als

Certain file types in Dataverse are supported by additional functionality, which can include downloading in different formats, previews, file-level metadata preservation, file-level data citation with UNFs, and exploration through data visualization and analysis. See the :ref:`File Handling <file-handling>` section of this page for more information.


HTTP Upload
-----------

Expand Down Expand Up @@ -147,6 +146,20 @@ File Handling

Certain file types in Dataverse are supported by additional functionality, which can include downloading in different formats, previews, file-level metadata preservation, file-level data citation; and exploration through data visualization and analysis. See the sections below for information about special functionality for specific file types.

.. _duplicate-files:

Duplicate Files
===============

Beginning with Dataverse 5.0, the way Dataverse handles duplicate files (filename and checksums) is changing to be more flexible. Specifically:

- Files with the same checksum can be included in a dataset, even if the files are in the same directory.
- Files with the same filename can be included in a dataset as long as the files are in different directories.
- If a user uploads a file to a directory where a file already exists with that directory/filename combination, Dataverse will adjust the file path and names by adding "-1" or "-2" as applicable. This change will be visible in the list of files being uploaded.
- If the directory or name of an existing or newly uploaded file is edited in such a way that would create a directory/filename combination that already exists, Dataverse will display an error.
- If a user attempts to replace a file with another file that has the same checksum, an error message will be displayed and the file will not be able to be replaced.
- If a user attempts to replace a file with a file that has the same checksum as a different file in the dataset, a warning will be displayed.

File Previews
-------------

Expand Down Expand Up @@ -268,7 +281,7 @@ Variable Metadata can be edited directly through an API call (:ref:`API Guide: E
File Path
---------

The File Path metadata field is Dataverse's way of representing a file's location in a folder structure. When a user uploads a .zip file containing a folder structure, Dataverse automatically fills in the File Path information for each file contained in the .zip. If a user downloads the full dataset or a selection of files from it, they will receive a folder structure with each file positioned according to its File Path.
The File Path metadata field is Dataverse's way of representing a file's location in a folder structure. When a user uploads a .zip file containing a folder structure, Dataverse automatically fills in the File Path information for each file contained in the .zip. If a user downloads the full dataset or a selection of files from it, they will receive a folder structure with each file positioned according to its File Path. Only one file with a given path and name may exist in a dataset. Editing a file to give it the same path and name as another file already existing in the dataset will cause an error.

A file's File Path can be manually added or edited on the Edit Files page. Changing a file's File Path will change its location in the folder structure that is created when a user downloads the full dataset or a selection of files from it.

Expand Down
31 changes: 31 additions & 0 deletions src/main/java/edu/harvard/iq/dataverse/DataFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,37 @@ public boolean isDeleted() {
public void setDeleted(boolean deleted) {
this.deleted = deleted;
}

/*
For use during file upload so that the user may delete
files that have already been uploaded to the current dataset version
*/

@Transient
private boolean markedAsDuplicate;

public boolean isMarkedAsDuplicate() {
return markedAsDuplicate;
}

public void setMarkedAsDuplicate(boolean markedAsDuplicate) {
this.markedAsDuplicate = markedAsDuplicate;
}

@Transient
private String duplicateFilename;

public String getDuplicateFilename() {
return duplicateFilename;
}

public void setDuplicateFilename(String duplicateFilename) {
this.duplicateFilename = duplicateFilename;
}





/**
* All constructors should use this method
Expand Down
Loading