From 77598f67afec187ed67a3f2811ce1bc6903e45c0 Mon Sep 17 00:00:00 2001 From: konrad Date: Sat, 22 Mar 2008 10:54:56 +0000 Subject: [PATCH] more on templates and orders git-svn-id: https://silmor.de/svn/softmagic/smoke/trunk@135 6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33 --- doc/index.html | 6 +++- doc/prog_odttemplate.html | 2 +- doc/prog_protocol.html | 40 ++++++++++++++++++++++++++++- doc/prog_tickettemplate.html | 57 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 102 insertions(+), 3 deletions(-) diff --git a/doc/index.html b/doc/index.html index f59a222..41ae20a 100644 --- a/doc/index.html +++ b/doc/index.html @@ -19,7 +19,11 @@ to be written: diff --git a/doc/prog_odttemplate.html b/doc/prog_odttemplate.html index 52d4948..95c59c1 100644 --- a/doc/prog_odttemplate.html +++ b/doc/prog_odttemplate.html @@ -3,7 +3,7 @@

Magic Smoke ODT Templates

-This text describes how ODT templates are generated and which ones exist. +This text describes how ODT templates are generated and which ones exist. ODT templates always use the suffix ".odtt".

Creating a Template

diff --git a/doc/prog_protocol.html b/doc/prog_protocol.html index 8a78c67..2109eb4 100644 --- a/doc/prog_protocol.html +++ b/doc/prog_protocol.html @@ -37,6 +37,9 @@ Possible status codes are: SyntaxErrorThere was a syntactical error in the request data. Some details might follow in the response body. +

Server Info

A serverinfo-request can be sent by any client in order to get basic information @@ -56,6 +59,9 @@ The server version number in the ServerVersion tags text is a the software versi The protocol version described in this document is 0000. +

Authentication protocol

First the client requests the hash-algorithm from the server. Possible @@ -116,6 +122,9 @@ Both, user names and roles, are restricted to letters, digits and "_". Leading a Each role corresponds to a function that can be called and executed remotely through the machine interface. Roles beginning with "_" are reserved keywords that can alter the behaviour of other roles and must not be used to name functions. +

Basic Requests

Getting ACL info

@@ -128,6 +137,9 @@ Special rights are:
+

Event Related Requests

Getting a List of Events

@@ -207,6 +219,9 @@ The eventsummary transaction returns summary data for an event. The req +

Room related Transactions

Getting Rooms

@@ -252,6 +267,9 @@ The setroomdata transaction is used to create/change one or more rooms, The response simply contains the status "Ok" or "Error". +

ACL related Transactions

Getting User Info

@@ -373,6 +391,9 @@ The deletehost transaction deletes one single host. The request contain FIXME: special hosts (beginning with "_") return errors. Non-existing hosts are silently ignored. +

Customers

Getting List of Customers

@@ -400,6 +421,9 @@ The getcustomer transaction returns detailed information about a custom The "mail" attribute is optional - it is only reported for customers that have a web-interface account. +

Orders and Sales

The order XML representation looks as follows: @@ -505,8 +529,22 @@ Ticket status for checks: (1)Attention: the return code "ok" means the order would have succeeded at the time of the check, it may still fail when it is actually placed
(2)if two or more tickets contradict on this state the order is returned as failed

+

Getting an Overview List of Orders

- +The getorderlist transaction can be used to get a list of all currently stored orders. The request does not contain any data, the response looks like:

+ +

+<OrderList>
+  <Order id="orderid" customer="customerid" status="orderstatus"
+       totalprice="amountDueInCent" paid="amountPaidInCent"/>
+  ...
+</OrderList>
+
+(this is a small subset of the full order object) + +

Templates

Templates are used for printouts and documents. There are several types of templates:

diff --git a/doc/prog_tickettemplate.html b/doc/prog_tickettemplate.html index 74182e5..dfdbcf0 100644 --- a/doc/prog_tickettemplate.html +++ b/doc/prog_tickettemplate.html @@ -3,5 +3,62 @@

Magic Smoke Ticket Templates

+The ticket template file must be called ticket.xtt.

+ +Templates for Tickets are ZIP archive files that contain a description of the ticket layout as XML and all necessary pictures and optionally font files. The XML description must link all other resources in the archive file to make them visible to the system.

+ +The description file must be called template.xml and must be in the root directory of the archive. + +

XML format

+ +The template.xml file describes the painting operations that form the ticket. The operations are executed in the order that appears in the template file - that means an element that appears later in the file can erase an earlier element if it occupies the same position. The XML format looks like:

+ +

+<TicketTemplate unit="mm|in|px" size="11 22">
+  <LoadFont file="nameInsideArchive.ttf"/>
+  <Picture file="nameInsideArchive.png" size="11 22" offset="33 44" smooth="1"/>
+  <Text font="fontFamilyName" embeddedFont="fontFamilyName" fontsize="sizeInPt"
+      offset="11 22" align="left|right|center" valign="top|bottom|center"
+      >some string with @VARIABLES@ to print</Text>
+  <Barcode offset="11 22" size="33 44"/>
+  ...
+</TicketTemplate>
+
+ +The elements are: + + + + + + + +
ElementDescription
TicketTemplatethis is the document element, it describes the complete ticket
LoadFontloads a font file (only TTF is supported) that is stored in the template ZIP file into the internal font database - it is removed from it after the ticket is rendered
Picturepaints a picture file that is stored in the template ZIP onto the ticket; a number of formats are supported, but it is recommended to use PNG; if size is present it is scaled first - it is recommended to scale, since different printers can have different resolutions and hence the picture will have different sizes; the default scaling algorithm is smooth
Textdescribes text that is rendered on the ticket
Barcodegenerates a code-39 barcode from the ticket-ID and scales it onto the ticket

+ +The attributes are + + + + + + + + + + + + +
AttributeDescription
unitdescribes in what unit sizes and offsets are described in the template, possible values are "mm" (Millimeter), "in" (Inches), "px" (Pixels), the default is "mm". Except for "px" all of them are allowed to use fractions.
sizedescribes the size the element is scaled to (or in the case of the complete ticket: its total size), it is two positive numbers separated by a space: "width height"
offsetdescribes the position of the element as "X Y" coordinates. Positive numbers describe the distance from the upper left corner, negative numbers the distance from the lower right corner.
filea relative file name within the template ZIP file
smoothfor Pictures: describes whether the scaling should be done using edged (0) or smooth (1) scaling
fontcontains the name of a font family that is used for rendering the text (eg. "Helvetica"), the font is searched in the complete font database of the host
embeddedFontcontains the name of a font family that is used for rendering the text, it is searched in the dynmically loaded fonts that are embedded in the template ZIP file; if font and embeddedFont are present, embeddedFont takes precedence
fontsizethe height of the text to render in pt (default is 10)
alignhorizontal alignment of the text: "left" starts the text at its offset, "right" places the text left of its offset, "center" puts the horizontal center of the text on the offset
valignvertical alignment of the text: "top" puts the text below its offset, "bottom" places the text above of its offset, "center" puts the vertical center of the text on the offset

+ +Variables for Text elements are enclosed in "@" signs (eg. @VARNAME@). The following variables exist: + + + + + + + + +
VariableDescription
TICKETIDthe ID of the ticket
PRICEthe price of the ticket
ROOMthe room of the tickets event
TITLEthe title of the tickets event
DATETIMEthe localized date and time when the event starts
ARTISTthe artist for this event
\ No newline at end of file -- 1.7.2.5