Client should use file types from server

Description

The original plan for this task was to push all file types by default (hence the name of the feature branch: ZNTA-1023-push-all-file-types), but on reflection, we have realised that pushing all file types would lead to unpredictable behaviour, especially since the list of supported file types will change/grow over time.

The plan now:

  • implement push --list-file-types

  • fetch all file types and associated extensions at runtime from the server - (ie don't use DocumentType in the client)

  • file types to push will be decided by type name, not extension - no ambiguity

  • default extensions for each type will be kept minimal - avoid non-standard extensions

  • default extensions for XLIFF will be .xlf, but not .xml - NB: this will require a config change for any projects using XLIFF for .xml, ie spacewalk

  • other extensions won't change

  • don't add keyword "DEFAULTS" - file types will only be active if requested

EDIT: additional extension .xliff removed from XLIFF - .xlf is the recommended extension according to XLIFF FAQ.

Original description follows:

--If no --file-types are specified when pushing a File project type, all the file types should be found and pushed.--

--Remove the list of types from help, replace with saying the command to list the types from the server.--

--Add an option to list the types and associated extensions from the server that will be used for defaults.--
--zanata-cli push --list-file-types--

  • --if any file-types are specified on the command-line:--

    • --the specified types only are used, with no defaults--

    • --if the keyword "DEFAULTS" is specified as well, the defaults will be used for all types that are not specified on the command line, and only for extensions that are not specified for any file type on the command line--

  • --types should use their default extensions--

  • --ambiguous extensions should cause a warning to be shown, and should use a consistent type for them (decided here)--

    • --.properties extension is to be treated as standard (Latin 1) properties, not utf8_properties--

    • --.xml files should be made not ambiguous by changing the DTD type default extension to .dtd and changing the XLIFF type to .xlf and .xliff--

  • --if .properties files are found before push, show a warning that they will be pushed as Latin 1. Show a note that they can specify utf8 properties type--

--For an example of overriding the defaults, with this command:--

--zanata-cli push '--file-types=DEFAULTS,PLAIN_TEXT[html]'--

--The PLAIN_TEXT type will not be used for .txt any more since PLAIN_TEXT is overridden.--
--.htm files will be treated as HTML type, but .html files will not be treated as HTML because it is used in PLAIN_TEXT. All other types will use their default extensions.--

Activity

Show:

Sean Flanigan 22 July 2016 at 02:42


I was going to add a default implementation for the new API interface method FileResource.fileTypeInfoList() to ensure source compatibility and avoid breaking builds, but I just remembered API is still compiled with Java 7. We can't try tricks like that until https://github.com/zanata/zanata-api/pull/46 goes in.

Ready for Release

Details

Assignee

Reporter

Story Points

Time remaining

2d

Components

Sprint

Fix versions

Priority

Created 13 April 2016 at 04:25
Updated 27 June 2018 at 02:21
Resolved 16 August 2016 at 04:49