Details
-
New Feature
-
Resolution: Fixed
-
Major
-
1.1.6
-
None
Description
Files are XWiki documents that have an object of type FileClass and an attachment. The URL to access a file will look like this:
/xwiki/bin/get/drive/file
This is also the URL that will expose the web service, which is going to be implemented in FileSheet. A drive is an XWiki space where the File Manager looks for files and folders. The following operations should be possible on a file:
- get
GET /xwiki/bin/get/drive/file
The response should be in JSON format and should contain information about the file (meta data).
- update
POST /xwiki/bin/get/drive/file
The response should be redirected to the get URL which should provide the updated information. This action can be used to update the file meta data or the file itself (e.g. upload a new version).
- label (add a new parent folder)
/xwiki/bin/get/drive/file?action=label&parent=AnotherParent
- move to a different folder and/or rename
/xwiki/bin/get/drive/file?action=move&parent=NewParent&name=NewName
The response should be redirected to the new URL:
/xwiki/bin/get/drive/NewName
Note that the new id may be suffixed by a counter in case there is already a file or folder with the same name in another place on the same drive (XWiki space).
- copy to a different folder and/or a different name
/xwiki/bin/get/drive/file?action=copy&parent=OtherParent&name=OtherName
- delete
/xwiki/bin/get/drive/file?action=delete
Additional parameters are needed to determine if the file should be removed from all its parent folders or just from one of them.