#720: BibFormat: release output format naming convention constraints
-----------------------+-----------------
 Reporter:  simko      |      Owner:
     Type:  defect     |     Status:  new
 Priority:  major      |  Milestone:
Component:  BibFormat  |    Version:
 Keywords:             |
-----------------------+-----------------
 In the distant past, we used to use output format conventions that were
 indicating output format type.  Notably, leading //h// meant HTML output
 format, leading //x// XML output format, leading //t// meant plain Text
 output format.

 Some years ago, we switched to a configurable content/type setup, so that
 people can name output formats without this naming convention constraint.

 However, many parts of the code base still rely on the old technique, so
 do things like:

 {{{
    if output_format.startswith('x'):
        do_xml_stuff()
 }}}

 while only some parts of the code base switched to the new technique:

 {{{
    if get_output_format_content_type(output_format) == 'text/xml':
        do_xml_stuff()
 }}}

 We should (1) walk through our whole code base and replace the old
 technique by the new technique in order to use solely
 `get_output_format_content_type()`; (2) in order to speed up migrations,
 we may move start-by-letter-x check into
 `get_output_format_content_type()` in case the format is not defined in
 the format table; (3) we should use data cacher so that this information
 can be served speedily, not having to go to the DB every time.

 This task therefore touches BibFormat (somewhat) as well as many other
 Invenio modules (mostly).

-- 
Ticket URL: <http://invenio-software.org/ticket/720>
Invenio <http://invenio-software.org>

Reply via email to