Presentation is loading. Please wait.

Presentation is loading. Please wait.

Printing v.15 e-Seminar Motke Keshet www.exlibrisgroup.com.

Similar presentations


Presentation on theme: "Printing v.15 e-Seminar Motke Keshet www.exlibrisgroup.com."— Presentation transcript:

1 Printing v.15 e-Seminar Motke Keshet www.exlibrisgroup.com

2 v.15 Seminar v.15 Printing Old System

3 v.15 Seminar v.15 Printing Why a New Report System ?

4 v.15 Seminar v.15 Printing Why XML / XSL ? Built in support of UTF-8 (= any language can be displayed) Fast growing standard – help and support readily available. Regular text file – regular editor (vi, notepad) needed for maintenance. XML contains all potential data from any relevant Z table. Adding data to display trivial. XSL full language and support include files – common blocks can be encapsulated in common functions

5 v.15 Seminar v.15 Printing XML Background XML – A standard for representing Data and its meaning Like HTML – every data element is surrounded by tags Unlike HTML – the tags are not standard, they are defined by the author of the XML document Unlike HTML – the tags have semantic meaning, no visual meaning, I.e. they say nothing about how the data should be presented.

6 v.15 Seminar v.15 Printing XML Example <?xml-stylesheet href="pres.xsl" type="text/xsl" encoding="utf-8" ?> John Smith 15/4/1975 George Dupont 17/6/1985

7 v.15 Seminar v.15 Printing XSL Background We use another standard / language – XSL – to convert the XML data to HTML presentation. XSL syntax is based on XML – tags everywhere. Here is a small XSL program for converting our XML example to HTML:

8 v.15 Seminar v.15 Printing XSL Example <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> First Name: Last Name: Birth Date:

9 v.15 Seminar v.15 Printing And the combination gives

10 v.15 Seminar v.15 Printing How Is It Combined You run an XSL parser called saxon, as follows: Saxon –o output.html input.xml input.xsl And get in output.html the previous slide.

11 v.15 Seminar v.15 Printing A closer look Let’s look at the following: We tell XSL to go through all the “employee” records, and for each of them display: Literally ‘ First Name: ’ The actual value of the current Literally ‘ That is: we combine: literal values, including HTML elements, Values to be taken from the contents of the XML file. First Name:

12 v.15 Seminar v.15 Printing A Broader View So, if we can add HTML elements to the rendering, we can do anything HTML we want, such as presenting data in grids, deciding on fonts and sizes etc. More than that: XSL also contains functions. So it is possible to encapsulate report sections that appear more than once (e.g. Sublibrary address, patron address, bib-info etc.) in functions and invoke them whenever they are needed.

13 v.15 Seminar v.15 Printing XSL in Aleph The report data in Aleph (starting 15.2) are contained in XML files. For each report an XSL file is defined (=Template). This template determines: what fields of the XML are part of the report how they should be displayed.

14 v.15 Seminar v.15 Printing XSL in Aleph – Cont’ In addition, there are several XSL files which are common to all reports, and they are referred to by all the specific XSL templates. They contain definitions for the rendering of common report blocks such as the standard salutations, signatures, sublibrary address, patron address etc. In principle the system librarian can maintain (=translate, add/remove fields etc.) without actually knowing XSL, and rely on the patterns found in Aleph default XSLs.

15 v.15 Seminar v.15 Printing Report Generation clientserver DBtables translation XML Query XML XSL Parser + HTML

16 v.15 Seminar v.15 Printing A Report Sublib Address Bib-info Header

17 v.15 Seminar v.15 Printing Its XML

18 v.15 Seminar v.15 Printing <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> Its XSL (Part 1)

19 v.15 Seminar v.15 Printing Its XSL (Cont’)

20 v.15 Seminar v.15 Printing Comments ‘header-gen’, ‘sublib-address’, ‘display-gen’ are XSL functions that handle the actual display All of them are implemented in funcs.xsl or one of the XSL files included in it All specific templates contain the line ‘ ’ so they all can invoke the common functions. Now to Customization …

21 v.15 Seminar v.15 Printing Customization There are 2 basic customization: Changing (or translating) labels Adding or removing data (=Z table columns etc.) A more advanced customization - layout change – will be explained later.

22 v.15 Seminar v.15 Printing Changing Labels Since the XSL file is a regular ASCII file you just edit it and make the changes you want.

23 v.15 Seminar v.15 Printing Removing Fields Examine the following snippet: To remove a field, e.g z68-doc-number, simply delete the lines from ‘ ’ To ‘ ’ that contain it (= The blue lines)

24 v.15 Seminar v.15 Printing Adding Fields To add a field, “cut and paste” the same range of lines, then change “label” and “value” accordingly. E.g:

25 v.15 Seminar v.15 Printing Changing Relative Position The data will be displayed in the order it appears in the XSL file. So to change the order in print, simply change the order in the XSL.

26 v.15 Seminar v.15 Printing Clarifying Some Terms Each XML section can be displayed in one of three layouts: Free Grid Split

27 v.15 Seminar v.15 Printing Free Layout

28 v.15 Seminar v.15 Printing Split Layout

29 v.15 Seminar v.15 Printing Grid Layout

30 v.15 Seminar v.15 Printing Common Funcs - 1

31 v.15 Seminar v.15 Printing Common Funcs : Comment The function ‘display-gen’ is responsible for displaying most of the data in non-grid format. There are, however several options for displaying: Display the label only if there is data attached to it (default) Display the label even without data Display the data right justified (numbers) Display barcode with special barcode font And several combinations In order to implement all options, display-gen can be invoked using arguments. Since most of the times only the default is used, it is usually called with just the 2 basic Arguments, namely ‘label’ and ‘value’.

32 v.15 Seminar v.15 Printing Aleph Reports Environment Server All XSL templates are stored in the server in /usm01/form_LNG. After any change you have to run: util I 6 This prepares a package to be downloaded when the client start running. To tell ALEPH to use XSL for printing, edit: aleph/a50_5/usm50/tab/form_print_method Client All XSL templates are downloaded to alephcom\files\USM50\Print Templates\LNG The XSL parser (saxon) is in alephcom\bin


Download ppt "Printing v.15 e-Seminar Motke Keshet www.exlibrisgroup.com."

Similar presentations


Ads by Google