24.04.20081 open source tools and ingres steffen weigert international telecommunication union ...

31
24.04.2008 24.04.2008 1 Open Source Tools and Ingres Open Source Tools and Ingres Steffen Weigert Steffen Weigert International Telecommunication Union International Telecommunication Union www.itu.int www.itu.int [email protected] [email protected] "Ingres Benutzerkonferenz in der OpenSource- World 2008" am 23. und 24. April in Kassel

Upload: duane-arnold

Post on 16-Dec-2015

213 views

Category:

Documents


1 download

TRANSCRIPT

24.04.200824.04.2008 11

Open Source Tools and IngresOpen Source Tools and Ingres

Steffen WeigertSteffen Weigert

International Telecommunication UnionInternational Telecommunication Union

www.itu.intwww.itu.int

[email protected]@itu.int

"Ingres Benutzerkonferenz in der OpenSource-World 2008"

am 23. und 24. April in Kassel

24.04.200824.04.2008 22

AgendaAgenda

HTMLDOC – creation of PDF filesHTMLDOC – creation of PDF files Lout – creation of PDF filesLout – creation of PDF files csv2xls – creation of Excel filescsv2xls – creation of Excel files Metasend – email incl. HTML, PDF, Metasend – email incl. HTML, PDF,

……

24.04.200824.04.2008 33

HTMLDOCHTMLDOC

What is HTMLDOC ?What is HTMLDOC ? How does it work ?How does it work ? HTMLDOC helpHTMLDOC help HTMLDOC supports special HTML HTMLDOC supports special HTML

commentscomments HTMLDOC downloadHTMLDOC download

24.04.200824.04.2008 44

What is HTMLDOC ?What is HTMLDOC ? HTMLDOC converts Hyper-Text Markup Language HTMLDOC converts Hyper-Text Markup Language

("HTML") input files into indexed HTML, Adobe("HTML") input files into indexed HTML, Adobe®® PostScriptPostScript®®, or Adobe Portable Document Format , or Adobe Portable Document Format ("PDF") files. ("PDF") files.

HTMLDOC supports most HTML 3.2 elements, some HTMLDOC supports most HTML 3.2 elements, some HTML 4.0 elements, and can generate title and HTML 4.0 elements, and can generate title and table of contents pages. It does not currently table of contents pages. It does not currently support stylesheets.support stylesheets.

HTMLDOC can be used as a standalone application, HTMLDOC can be used as a standalone application, in a batch document processing environment, or in a batch document processing environment, or as a web-based report generation application.as a web-based report generation application.

HTMLDOC is available both as open source HTMLDOC is available both as open source software under the terms of the GNU General software under the terms of the GNU General Public License and as commercial software under Public License and as commercial software under the terms of a traditional commercial End-User the terms of a traditional commercial End-User License Agreement.License Agreement.

24.04.200824.04.2008 55

How does it work ?How does it work ?ServerServer

Unix script (shell commands,sqlexp, awk)

PDF file

htmldoc --webpage -t pdf14 in.html > out.pdf

HTML file

ClientClient

Web browser

HTML

PDF

24.04.200824.04.2008 66

HTMLDOC helpHTMLDOC help htmldoc –helphtmldoc –help --batch filename.book--batch filename.book --bodycolor color--bodycolor color --bodyfont {courier,times,helvetica}--bodyfont {courier,times,helvetica} --bodyimage filename.{gif,jpg,png}--bodyimage filename.{gif,jpg,png} --book--book --bottom margin{in,cm,mm}--bottom margin{in,cm,mm} --browserwidth pixels--browserwidth pixels ----charset {cp-874...1258,iso-8859-1...8859-15,koi8-r}charset {cp-874...1258,iso-8859-1...8859-15,koi8-r} --color--color ……

24.04.200824.04.2008 77

HTMLDOC special HTML HTMLDOC special HTML commentscomments HTMLDOC supports many special HTML comments to HTMLDOC supports many special HTML comments to

initiate page breaks, set the header and footer text, initiate page breaks, set the header and footer text, and control the current media options:and control the current media options:

<!-- FOOTER LEFT "foo" --><!-- FOOTER LEFT "foo" --> Sets the left footer text; the test is applied to the current page Sets the left footer text; the test is applied to the current page

if empty, or the next page otherwise. if empty, or the next page otherwise. <!-- FOOTER CENTER "foo" --><!-- FOOTER CENTER "foo" -->

Sets the center footer text; the test is applied to the current Sets the center footer text; the test is applied to the current page if empty, or the next page otherwise. page if empty, or the next page otherwise.

<!-- HEADER LEFT "foo" --><!-- HEADER LEFT "foo" --> Sets the left header text; the test is applied to the current page Sets the left header text; the test is applied to the current page

if empty, or the next page otherwise. if empty, or the next page otherwise. <!-- PAGE BREAK --><!-- PAGE BREAK -->

Break to the next page Break to the next page ……....

24.04.200824.04.2008 88

HTMLDOC downloadHTMLDOC download

http://http://www.htmldoc.org/software.phpwww.htmldoc.org/software.php Source codeSource code

http://http://www.easysw.com/htmldoc/software.phpwww.easysw.com/htmldoc/software.php Binaries (commercial product)Binaries (commercial product)

24.04.200824.04.2008 99

24.04.200824.04.2008 1010

24.04.200824.04.2008 1111

LoutLout

What is Lout ?What is Lout ? How does it work ?How does it work ? Lout codeLout code Lout downloadLout download

24.04.200824.04.2008 1212

What is Lout ?What is Lout ? Lout is a high-level language for document formatting. It Lout is a high-level language for document formatting. It

includes facilities for typesetting complex documents includes facilities for typesetting complex documents containing floating figures, tables, diagrams, rotated and containing floating figures, tables, diagrams, rotated and scaled text or graphics, footnotes, running headers, scaled text or graphics, footnotes, running headers, footers, an index, table of contents and bibliography, cross-footers, an index, table of contents and bibliography, cross-references, mathematical equations and statistical graphs. references, mathematical equations and statistical graphs. Lout's capabilities can be extended with definitions which Lout's capabilities can be extended with definitions which are easier to write than similar markup languages. are easier to write than similar markup languages.

Lout is multilingual, supporting (with hyphenation) Czech, Lout is multilingual, supporting (with hyphenation) Czech, Danish, Dutch, English, Finnish, French, German, Danish, Dutch, English, Finnish, French, German, Norwegian, Russia, Slovenian, Spanish and Swedish. Some Norwegian, Russia, Slovenian, Spanish and Swedish. Some of these languages are available as separate packages of these languages are available as separate packages because they need more than the 13 standard Adobe because they need more than the 13 standard Adobe fonts. Further languages can be added easilyfonts. Further languages can be added easily

Lout is free software, distributed under the terms of the Lout is free software, distributed under the terms of the GNU General Public License, Version 2. Documents GNU General Public License, Version 2. Documents generated by Lout is not subject to GNU GPL. However, if generated by Lout is not subject to GNU GPL. However, if you were to use install and use additional fonts in your you were to use install and use additional fonts in your documents, please check and comply with their licensing documents, please check and comply with their licensing terms. terms.

24.04.200824.04.2008 1313

How does it work ?How does it work ?ServerServer

Unix script (shell commands,sqlexp, awk, lout code)

PDF file

GhostScript interpreter to convert PostScript to PDF:gs -q -sDEVICE=pdfwrite -sOutputFile=- - > out.pdf

ClientClient

Web browser

PDF

PostScript

24.04.200824.04.2008 1414

Lout codeLout code@LLP @LLP {BarCode Base +2p} @Font { *$_addressid* }{BarCode Base +2p} @Font { *$_addressid* }@LLP @LLP {*$_addressid* } {*$_addressid* } @LLP @LLP @CurveBox {@LLP @LLP @CurveBox {$_addr1 @LLP $_addr2 @LLP $_addr3 } $_addr1 @LLP $_addr2 @LLP $_addr3 } @PP @LP @PP @LP {Helvetica Bold +1p} {Helvetica Bold +1p} @Font { "IMPORTANT:" } @Font { "IMPORTANT:" } @IndentedDisplay { @Lozenge No refund or cancellation @IndentedDisplay { @Lozenge No refund or cancellation

possible. @LP @Lozenge Please present this receipt at possible. @LP @Lozenge Please present this receipt at any visitor registration desk on-site to be issued with any visitor registration desk on-site to be issued with an entry pass. Holders of a weekly pass who an entry pass. Holders of a weekly pass who registered on-line before $ers_reg_beforedate will registered on-line before $ers_reg_beforedate will receive their entry pass by mail. } receive their entry pass by mail. }

24.04.200824.04.2008 1515

Lout downloadLout download

Primary sitePrimary site ftp://ftp://ftp.cs.usyd.edu.au/jeff/loutftp.cs.usyd.edu.au/jeff/lout//

Secondary siteSecondary site (mirror + archives) (mirror + archives) ftp://ftp://ftp.ptc.spbu.ru/pub/textproc/loutftp.ptc.spbu.ru/pub/textproc/lout//

24.04.200824.04.2008 1616

24.04.200824.04.2008 1717

csv2xlscsv2xls

What is csv2xls ?What is csv2xls ? How does it work ?How does it work ? codecode csv2xls downloadcsv2xls download

24.04.200824.04.2008 1818

What is csv2xls ?What is csv2xls ?

Converts text file in delimiter-Converts text file in delimiter-separated format to Excel binary separated format to Excel binary formatformat

csv2xls is written in perl csv2xls is written in perl csv2xls This module is free software. csv2xls This module is free software.

It may be used, redistributed and/or It may be used, redistributed and/or modified under the same terms as modified under the same terms as Perl itself. Perl itself.

24.04.200824.04.2008 1919

How does it work ?How does it work ?ServerServer

Unix script (shell commands,sqlexp)

Excel file

csv2xls fi.csv fi.xls

ClientClient

Web browser

Excel file

csv file

24.04.200824.04.2008 2020

CodeCode # select data and write csv file# select data and write csv file

sqlexp $DATABASE < $workdir/export.sql | sed "s/\"/\"\"/g" | sqlexp $DATABASE < $workdir/export.sql | sed "s/\"/\"\"/g" | sed "s/@\~@/\"/g" > $workdir/addr.csvsed "s/@\~@/\"/g" > $workdir/addr.csv

# convert to Excel# convert to Excelcsv2xls $workdir/exh.csv $workdir/addr.xlscsv2xls $workdir/exh.csv $workdir/addr.xls

# file export.sql# file export.sqlSelect '@~@name@~@','@~@stadt@~@‘;Select '@~@name@~@','@~@stadt@~@‘;Select '@~@’+name+’@~@',‘@~@’+city+’@~@‘ FROM addr;Select '@~@’+name+’@~@',‘@~@’+city+’@~@‘ FROM addr;

# file addr.csv# file addr.csv““name”,”stadt”name”,”stadt”““Meier”,”Kassel”Meier”,”Kassel”

# convert to Excel# convert to Excel csv2xls addr.csv addr.xlscsv2xls addr.csv addr.xls

24.04.200824.04.2008 2121

csv2xls downloadcsv2xls download

http://www.ensoft.de/xlsgen/xlsgen.htmhttp://www.ensoft.de/xlsgen/xlsgen.htm http://search.cpan.org/src/JMCNAMAhttp://search.cpan.org/src/JMCNAMA

RA/Spreadsheet-WriteExcel-2.11/lib/RA/Spreadsheet-WriteExcel-2.11/lib/Spreadsheet/WriteExcel.pmSpreadsheet/WriteExcel.pm

24.04.200824.04.2008 2222

24.04.200824.04.2008 2323

metasendmetasend

What is metasend ?What is metasend ? How does it work ?How does it work ? codecode metasend downloadmetasend download

24.04.200824.04.2008 2424

What is metasend ?What is metasend ?

Scripts to send mail with file Scripts to send mail with file attachments of different mime-typesattachments of different mime-types

From, To, CC can be setFrom, To, CC can be set

24.04.200824.04.2008 2525

How does it work ?How does it work ?ServerServer

Unix script (shell commands,sqlexp)

Mail with attachments

metasend -b -f txt, pdf, html, jpg-m <mime type>

ClientClient

Mail client

Mail

Files: txt, pdf, html, jpg, …

24.04.200824.04.2008 2626

Code for HTML, PDF Code for HTML, PDF attachmentattachment metasend -b metasend -b

-e quoted-printable-e quoted-printable -f pdf/-f pdf/$taskno$taskno.html.html -m 'text/html; charset="iso-8859-1"' -m 'text/html; charset="iso-8859-1"' -n -e base64 -n -e base64 -f pdf/-f pdf/$taskno$taskno.pdf.pdf -S '5242880' -S '5242880' -m 'application/pdf; name="'"-m 'application/pdf; name="'"$taskno$taskno.pdf"'"'.pdf"'"' -F '<[email protected]>' -F '<[email protected]>' -t '<[email protected]>' -t '<[email protected]>' -c '<[email protected]>' -c '<[email protected]>' -s "metasend: HTML, PDF; Data Format:-s "metasend: HTML, PDF; Data Format: $format$format""

24.04.200824.04.2008 2727

Code for Text, PDF attachmentCode for Text, PDF attachment metasend -b metasend -b

-e quoted-printable -e quoted-printable -f-f $taskno$taskno.txt.txt -m 'text/plain; charset="iso-8859-1"'-m 'text/plain; charset="iso-8859-1"' -n -e base64-n -e base64 -f pdf/-f pdf/$taskno$taskno.pdf.pdf -S '5242880' -S '5242880' -m 'application/pdf; name="'"$-m 'application/pdf; name="'"$tasknotaskno.pdf"'"'.pdf"'"' -F '<[email protected]>' -F '<[email protected]>' -t '<[email protected]>' -t '<[email protected]>' -c '<[email protected]>' -c '<[email protected]>' --s "metasend: HTML, PDF; Data Format:s "metasend: HTML, PDF; Data Format: $format$format""

24.04.200824.04.2008 2828

metasend downloadmetasend download

http://www.shelldorado.com/articles/http://www.shelldorado.com/articles/mailattachments.htmlmailattachments.html

24.04.200824.04.2008 2929

24.04.200824.04.2008 3030

24.04.200824.04.2008 3131

Questions & AnswersQuestions & Answers

HTMLDOCHTMLDOC LoutLout csv2xlscsv2xls metasendmetasend