Bug 864277

Summary: [RFE] Allow upload and download of txt, dtd and open document format through REST interface
Product: [Retired] Zanata Reporter: David Mason <damason>
Component: ProjectType-DocsAssignee: David Mason <damason>
Status: CLOSED CURRENTRELEASE QA Contact: Ding-Yi Chen <dchen>
Severity: medium Docs Contact:
Priority: unspecified    
Version: developmentCC: sflaniga, zanata-bugs
Target Milestone: ---   
Target Release: 2.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 2.0.3-SNAPSHOT (20121119-0019) Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-26 03:46:17 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 886711    
Bug Blocks: 864280, 884347    

Description David Mason 2012-10-09 03:26:16 UTC
Description of problem:
Implement upload and download through the REST interface for documents of type DTD, plain text (.txt), and Open Document Format (odt, ods, odp, etc.).

Expected results:
Available REST methods for upload and download of source and translated documents of the above formats.

Comment 1 Ding-Yi Chen 2012-10-11 03:51:47 UTC
The format (extenstion filename) supported:
"odt", "fodt", "odp", "fodp", "ods", "fods", "odg", "fodg", "odb", "odf"

Comment 2 Ding-Yi Chen 2012-10-11 04:15:30 UTC
Test will be perform with following command:

curl -F type=txt -F file= -F hash=`md5sum document.txt | awk '{print $1}'`   -F first=true -F last=true   -H "X-Auth-User:USERNAME" -H "X-Auth-Token:API_KEY"    "SERVER/rest/file/source/PROJECT_SLUG/VERSION_SLUG?docId=document

Comment 3 Ding-Yi Chen 2012-10-15 03:57:29 UTC
VERIFIED with Zanata version 1.8.0-SNAPSHOT (20121012-0031)

Comment 4 Ding-Yi Chen 2012-10-15 04:53:33 UTC
Soory, this should be reassign as I found:

1. After I click Download as text link, Firefox shows File not found; and
2. The Content-Type of Download as po link is application/octet-stream, which should be text/plain

Comment 5 David Mason 2012-10-17 05:53:11 UTC
Added documentation of REST interface methods, see http://github.com/zanata/zanata/wiki/Raw-File-REST-API

Comment 6 Ding-Yi Chen 2012-11-19 05:10:17 UTC
VERIFIED 
with Zanata version 2.1-SNAPSHOT (20121119-1207) 
and Zanata version 2.0.3-SNAPSHOT (20121119-0019)