Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Files plugin: upload to arbitrary directory (#289)
The existing file repository (that is managed by the Proxy plugin) is used as the repository for uploaded files as well. There are not two different repositories anymore. So, the recently introduced dm4.files.path POM property is dropped. Any location inside the Proxy plugin's file repository can be the upload target. (The file repository's root directory is still configured by the dm4.proxy.files.path POM property.) The "Upload File" menu item is dropped from the Create menu. Instead every Folder topic (as revealed through the File Browser) provides an "Uplaod File" button. This button invokes the Upload Dialog. The uploaded file is stored in the directory represented by the respective Folder topic. Hints for plugin developers: The method for invoking the Upload Dialog is renamed and takes another mandatory parameter: {{{ dm4c.upload_dialog.open(storage_path, callback) }}} The new "storage_path" parameter is the storage location for the uploaded file. The storage path is relative to dm4.proxy.files.path and must begin with a slash. At REST API level the storage path is appended to the /files request path {{{ POST /files//store/file/here }}} Note the double slash. The first slash separates the storage_path parameter, the second slash is part of the storage_path parameter (which always begins with slash as aforesaid). Example: assume this POM setting: {{{ <dm4.proxy.files.path>/home/terry/deepamehta-files</dm4.proxy.files.path> }}} When posting a multipart/form-data request with a single file part (let's say image.png) to the URI above the file will be stored at {{{ /home/terry/deepamehta-files/store/file/here/image.png }}} See ticket 289.
- Loading branch information
Showing
10 changed files
with
95 additions
and
63 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
10 changes: 0 additions & 10 deletions
10
modules/dm4-files/src/main/java/de/deepamehta/plugins/files/FileRepositoryContext.java
This file was deleted.
Oops, something went wrong.
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
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