out='''<p>The migration of your behaviours has been done.</p>'''
else:
out='''<p>The result of the migration is: %s</p>'''%status
out+='''
<p>The behaviours have been moved to a new kind
of configuration file, called "<i>Output Format</i>". If you
have not used particular syntax in your behaviours, the output
formats should behave the same way. We advice you to check
this point and modify the output formats if necessary.</p>'''
out+='''
<p>You can go back to the main <a href="%s/admin/bibformat/bibformatadmin.py?ln=%s">BibFormat administration page</a> or
proceed with the <a href="%s/admin/bibformat/bibformat_migration_kit_assistant.py/migrate_formats?ln=%s">
next step (Migration of formats) >>></a></p>'''%(weburl,ln,weburl,ln)
returnindent_text(out)
deftmpl_admin_migrate_formats(self,ln):
"""
Basic page to warn user that migration of formats to format templates
is not straightforward
"""
_=gettext_set_language(ln)# load the right message language
out='''<p>The migration of format is not completely
staightforward. Here are some advice for the migration:</p>
<ol>
<li>If you do not have modified original formats provided by
default in CDS Invenio (formerly CDSware), then you should not
proceed with this step.</li>
<li>If you have only made small
changes to the original formats provided by default in CDS
Invenio (formerly CDSware), then you should not proceed with
this step, but compare your modified files with the new
provided files and make changes manually.</li>
<li>If you have
created totally new formats or made large modifications to the
provided one, we still advice you not to use this tool and
make changes by yourself. However, you can try to run this
translation tool as a starting point. If you have made HTML
prototypes of the formats, then you would better start from
the prototypes.</li>
</ol>
<p>In any case you should fill the
table that maps text labels to a Marc codes BEFORE doing this migration, which should help
you to write new formats (and also help you manage fields of
the system).<br/> Here are some explanations that can help you
understand why we advice you to rewrite format manually:</p>
<p>The new BibFormat now uses format files that separate the presentation
from the business logic, which is something that cannot be
completely automated. The formats will be moved to new kinds
of configuration files, called "<i>Format templates</i> (for
the presentation) and "<i>Format elements</i> (for the part
that binds the record in database to the format
template). Format templates are written in HTML. Format
elements are written in Python. However basic format elements
do not even need to be written, as BibFormat can guess which
field of a record it has to retrieve by looking at an internal
mapping table (maps a label to a marc code). It is why it is
important that you fill this table correctly BEFORE running
the translation of the formats. </p>
<p>This migration tool will do as much as possible to translate your formats in these new
kind of files. It will create format templates files
corresponding to your formats, and will include an attempt of
translation + the original code as comment. Empty format
elements files will be created whenever necessary.</p>'''
out+='''
<p><a href="%s/admin/bibformat/bibformat_migration_kit_assistant.py/migrate_formats_do?ln=%s">Click here to migrate your format automatically</a>, despite the above recommendations.</p>
'''%(weburl,ln)
returnindent_text(out)
deftmpl_admin_migrate_formats_do(self,ln):
"""
Basic page to report the status of the migration of formats to format templates
"""
_=gettext_set_language(ln)# load the right message language
out='''<p>Migration of formats has been done.</p>'''
out+='''<p>To check and edit format templates,
use the <a href="%s/admin/bibformat/bibformatadmin.py/format_templates_manage">Format template management console</a> or edit files directly in directory etc/bibformat/templates/ of your CDS Invenio installation base.</p>'''%weburl
out+='''<p>To check and edit your format elements, open files in lib/python/invenio/bibformat_elements directory of your CDS Invenio installation base</p>'''
out+='''<a href="%s/admin/bibformat/bibformatadmin.py">Click here to go back to main BibFormat administration page</a>'''%weburl