stable

Clone or download

Read-only

Documents uploaded via the tus endpoint are added to the document manager

Once the upload is completed, the file automatically added to the document manager. To test, you need to: 1. Reserve the document entry in the database 2. Upload the document to /uploads/docman/file/<item_id> using a tus client You can reserve the entry in the dabatase and get the assigned ID back with the following queries: INSERT INTO plugin_docman_item_id VALUES (NULL); INSERT INTO plugin_docman_new_document_upload VALUES ( LAST_INSERT_ID(), UNIX_TIMESTAMP(DATE_ADD(NOW(), INTERVAL 2 HOUR)), <parent_id>, 'Title', 'Description', <user_id>, 'file.zip', <file_size> ); SELECT LAST_INSERT_ID(); See 426ca739d33e52787ad1439f52a5c8d658d56c8d to have an example on how to get and use a tus client. Note that table listing document being uploaded is not cleand for now. This is part of story #12612: upload document via REST route Change-Id: I071896ad1c81c7f5e7600bdcf4105c701258d130

Modified Files

Name
M plugins/docman/include/Docman_ItemDao.class.php +14 −12 Go to diff View file
M plugins/docman/include/Docman_ItemFactory.class.php +6 −3 Go to diff View file
M plugins/docman/include/Tus/TusServer.php +3 −1 Go to diff View file
A plugins/docman/include/Upload/DocumentAlreadyUploaded.php +63 −0 Go to diff View file
M plugins/docman/include/Upload/DocumentOngoingUploadDAO.php +22 −0 Go to diff View file
M plugins/docman/include/Upload/DocumentToUploadProvider.php +50 −12 Go to diff View file
A plugins/docman/include/Upload/DocumentUploadPathAllocator.php +40 −0 Go to diff View file
M plugins/docman/include/Upload/DocumentUploaded.php +182 −5 Go to diff View file
M plugins/docman/include/Upload/FileUploadController.php +3 −1 Go to diff View file
M plugins/docman/include/docmanPlugin.class.php +21 −3 Go to diff View file
A plugins/docman/phpunit/Upload/DocumentToUploadProviderTest.php +127 −0 Go to diff View file
M tests/phpunit/phpunit.xml +1 −0 Go to diff View file