Univention Bugzilla – Bug 39239
remove dependency to texlive in univention-directory-reports (use python-reportlab? for creating PDF's instead)
Last modified: 2023-11-02 16:38:25 CET
We should get rid of the all the texlive packages. Why: * installing/updating takes a long time * save ~190 MB of disk space * texlive packages caused many update/installing problems in the past, problems we wouldn't have had without the texlive packages * Keep in mind, univention-apps also benefit from smaller images and faster setup. Alternatives: * python-reportlab from reportlab.pdfgen import canvas c = canvas.Canvas("hello.pdf") c.drawString(100,750,"Welcome to Reportlab!") c.save() http://www.blog.pythonlibrary.org/2010/03/08/a-simple-step-by-step-reportlab-tutorial/ * ???
yes, that would be cool.
Alternatives: * python-trml2pdf Tiny RML2PDF is a tool to easily create PDF document without programming. It can be used as a Python library or as a standalone binary. It converts a RML, an XML dialect that lets you define the precise appearance of a printed document, to a PDF. You can use your existing tools to generate an input file that exactly describes the layout of a printed document, and RML2PDF converts it into PDF. RML is a much more powerful and flexible alternative to XSL:FO.
Maybe GrailTeX would be an option? "GrailTeX is a small TeX distribution based on LaTeX and designed to build web-based applications." https://github.com/nagybence/grailtex
Created attachment 8928 [details] patch I implemented a solution based on the suggested RML: Further reference documents are: http://www.reportlab.com/docs/rml-for-idiots.pdf http://www.reportlab.com/docs/rml2pdf-userguide.pdf http://www.reportlab.com/software/rml-reference/ http://www.reportlab.com/snippets/ http://www.reportlab.com/documentation/rml-samples/ The attached patch is backwards compatible to LaTex but moves all the dependencies to a new package univention-directory-reports-latex which is not installed by default. FYI: Latex is much more simple and flexible than RML!
*** Bug 24986 has been marked as a duplicate of this bug. ***
*** Bug 24359 has been marked as a duplicate of this bug. ***
The patch has been applied. univention-management-console-module-udm (7.0.10-5): r80356 | Bug #39239: improove report creation univention-management-console-module-udm.yaml: r80367 | YAML Bug #1567, Bug #39239 univention-directory-reports (9.0.1-1): r80355 | Bug #39239: remove dependency to latex univention-directory-reports.yaml: r80368 | YAML Bug #39239
Cherry picked package python-trml2pdf[62302] version 1.2-3 from 4.0-0-0[75]/None[0] to 4.2[78]/errata4.2-1[492] Added the package to the triggers list: r80387 | Bug #39239: add python-trml2pdf to maintained / copy trigger list to errata r80386 | Bug #39239: add python-trml2pdf to maintained Successful build Package: python-trml2pdf Version: 1.2-3A~4.2.0.201706211305 Branch: ucs_4.2-0 Scope: errata4.2-1 I tried to create the new package list with the steps from: https://hutten.knut.univention.de/mediawiki/index.php/Debian_Installer#debian-cd_-_Maintained_packages_list https://hutten.knut.univention.de/mediawiki/index.php/Errata-Updates#Ein_neues_Paket_als_Erratum_nach_maintained_.C3.BCbernehmen First I got this: CRITICAL:root:Failed to read "/home/fbest/src/triggers/ucs_4.2-0-errata4.2-1.txt": [Errno 2] No such file or directory: '/home/fbest/src/triggers/ucs_4.2-0-errata4.2-1.txt' Traceback (most recent call last): File "/usr/lib/pymodules/python2.6/univention/repong/repo_apt.py", line 457, in read_packages filename, self.options.arch, self.source_packages)) File "/usr/lib/pymodules/python2.6/univention/repong/repo_util.py", line 93, in read_trigger_file with open(filename, 'r', encoding=ENCODING) as src_pkg: File "/usr/lib/python2.6/codecs.py", line 881, in open file = __builtin__.open(filename, mode, buffering) IOError: [Errno 2] No such file or directory: '/home/fbest/src/triggers/ucs_4.2-0-errata4.2-1.txt' Now I get this: Traceback (most recent call last): File "/usr/lib/python2.6/runpy.py", line 122, in _run_module_as_main "__main__", fname, loader, pkg_name) File "/usr/lib/python2.6/runpy.py", line 34, in _run_code exec code in run_globals File "/usr/lib/pymodules/python2.6/univention/repong/repo_apt.py", line 648, in <module> main() File "/usr/lib/pymodules/python2.6/univention/repong/repo_apt.py", line 71, in main with dep.apt as dep.cache: File "/usr/lib/pymodules/python2.6/univention/repong/repo_apt.py", line 218, in __enter__ return super(AptCommonSource, self).__enter__() File "/usr/lib/pymodules/python2.6/univention/repong/repo_apt.py", line 179, in __enter__ cache.update() File "/usr/lib/python2.6/dist-packages/apt/deprecation.py", line 98, in deprecated_function return func(*args, **kwds) File "/usr/lib/python2.6/dist-packages/apt/cache.py", line 364, in update raise FetchFailedException(e) apt.cache.FetchFailedException: W:Failed to fetch file:/var/univention/buildsystem2/apt/ucs_4.2-0-errata4.2-1/dists/ucs420/main/binary-amd64/Packages.gz Datei nicht gefunden , W:Failed to fetch file:/var/univention/buildsystem2/apt/ucs_4.2-0-errata4.2-1/dists/ucs420/main/debian-installer/binary-amd64/Packages.gz Datei nicht gefunden , E:Some index files failed to download, they have been ignored, or old ones used instead.
The package list generation has succeeded now, thanks Philipp.
The content of the old and new reports is identical. I noticed a few translation errors: - The title in the CreateReportDialog is not translated. (e.g. "Report for user") - The text "This may take a while" in the CreateReportDialog when creating the report is not translated. - The selection "PDF Document" is not translated. - The date in the german pdf document is not translated (if you create the report via command line it is translated) Computer report: - The report for a computer object does not have a header like the user or group report (e.g. for users: "User report: <last name>, <first name>) User report: - The 'disabled' attribute ('Account deactivation') and 'locked' attribute ('Locked login methods') in the Account settings are not translated - 'Employee type' is translated 'Mitarbeiterkategorie' in the UMC but in the Report it is 'Mitarbeitertyp' - The 'inherited' ('Ererbt') attribute is not translated in the german report but only when creating the report via command line Group report look OK
(In reply to Johannes Keiser from comment #10) > The content of the old and new reports is identical. > > I noticed a few translation errors: > > - The title in the CreateReportDialog is not translated. (e.g. "Report for > user") fixed, Translation error from Bug #42220. > - The text "This may take a while" in the CreateReportDialog when creating > the report is not translated. fixed, Translation error from Bug #42220. > - The selection "PDF Document" is not translated. The UCR variables have no translation, therefor I translate it in the module. > - The date in the german pdf document is not translated (if you create the > report via command line it is translated) fixed. This is because LC_TIME was not set in the module process. I hope this doesn't cause any regressions in UMC-UDM. > Computer report: > - The report for a computer object does not have a header like the user or > group report (e.g. for users: "User report: <last name>, <first name>) Yes, the previous reports only had a caption "Computer report". I don't know how to add such thing in RML on each page. > User report: > - The 'disabled' attribute ('Account deactivation') and 'locked' attribute > ('Locked login methods') in the Account settings are not translated Yes, the values are 'none', 'windows', 'kerberos', 'kerberos_posix', 'windows_posix', ... and not translated with the syntax class. It's not a regression so I ignore this for now as it's not so easy to fix. > - 'Employee type' is translated 'Mitarbeiterkategorie' in the UMC but in the > Report it is 'Mitarbeitertyp' fixed > - The 'inherited' ('Ererbt') attribute is not translated in the german > report but only when creating the report via command line TODO univention-management-console-module-udm (7.0.10-10): r80490 | Bug #39239: fix some translations univention-directory-reports (9.0.1-2): r80491 | Bug #39239: fix some translations
(In reply to Florian Best from comment #11) > > - The 'inherited' ('Ererbt') attribute is not translated in the german > > report but only when creating the report via command line > TODO fixed! univention-directory-reports (9.0.1-3): r80492 | Bug #39239: fix locale of _ instances
OK looks good now YAML: OK -> verified
<http://errata.software-univention.de/ucs/4.2/71.html> <http://errata.software-univention.de/ucs/4.2/75.html> <http://errata.software-univention.de/ucs/4.2/76.html>