more on templates and orders
authorkonrad <konrad@6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33>
Sat, 22 Mar 2008 10:54:56 +0000 (10:54 +0000)
committerkonrad <konrad@6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33>
Sat, 22 Mar 2008 10:54:56 +0000 (10:54 +0000)
git-svn-id: https://silmor.de/svn/softmagic/smoke/trunk@135 6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33

doc/index.html
doc/prog_odttemplate.html
doc/prog_protocol.html
doc/prog_tickettemplate.html

index f59a222..41ae20a 100644 (file)
@@ -19,7 +19,11 @@ to be written:
 
 <ul>
 <li><a href="install_web.html">Installing the Web Components</a></li>
-<li><a href="template.html">Template Design</a></li>
+<li>Templates:<ul>
+ <li><a href="template.html">Web Template Design</a></li>
+ <li><a href="prog_odttemplate.html">ODT Template Design</a></li>
+ <li><a href="prog_tickettemplate.html">Ticket Template Design</a></li>
+</ul></li>
 <li><a href="build_prog.html">Building the Program</a></li>
 <li><a href="install_prog.html">Installing the Program</a></li>
 </ul>
index 52d4948..95c59c1 100644 (file)
@@ -3,7 +3,7 @@
 <body>
 <h1>Magic Smoke ODT Templates</h1>
 
-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".
 
 <h2>Creating a Template</h2>
 
index 8a78c67..2109eb4 100644 (file)
@@ -37,6 +37,9 @@ Possible status codes are:
 <tr><td>SyntaxError</td><td>There was a syntactical error in the request data. Some details might follow in the response body.</td></tr>
 </table>
 
+<!-- ************************************************************************************
+     ************************************************************************************
+     ************************************************************************************ -->
 <h2>Server Info</h2>
 
 A <tt>serverinfo</tt>-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 <tt>0000</tt>.
 
+<!-- ************************************************************************************
+     ************************************************************************************
+     ************************************************************************************ -->
 <h2>Authentication protocol</h2>
 
 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.
 
+<!-- ************************************************************************************
+     ************************************************************************************
+     ************************************************************************************ -->
 <h2>Basic Requests</h2>
 
 <h3>Getting ACL info</h3>
@@ -128,6 +137,9 @@ Special rights are:<br>
 </table>
 
 
+<!-- ************************************************************************************
+     ************************************************************************************
+     ************************************************************************************ -->
 <h2>Event Related Requests</h2>
 
 <h3>Getting a List of Events</h3>
@@ -207,6 +219,9 @@ The <tt>eventsummary</tt> transaction returns summary data for an event. The req
 </pre>
 
 
+<!-- ************************************************************************************
+     ************************************************************************************
+     ************************************************************************************ -->
 <h2>Room related Transactions</h2>
 
 <h3>Getting Rooms</h3>
@@ -252,6 +267,9 @@ The <tt>setroomdata</tt> transaction is used to create/change one or more rooms,
 
 The response simply contains the status "Ok" or "Error".
 
+<!-- ************************************************************************************
+     ************************************************************************************
+     ************************************************************************************ -->
 <h2>ACL related Transactions</h2>
 
 <h3>Getting User Info</h3>
@@ -373,6 +391,9 @@ The <tt>deletehost</tt> transaction deletes one single host. The request contain
 
 FIXME: special hosts (beginning with "_") return errors. Non-existing hosts are silently ignored.
 
+<!-- ************************************************************************************
+     ************************************************************************************
+     ************************************************************************************ -->
 <h2>Customers</h2>
 
 <h3>Getting List of Customers</h3>
@@ -400,6 +421,9 @@ The <tt>getcustomer</tt> transaction returns detailed information about a custom
 
 The "mail" attribute is optional - it is only reported for customers that have a web-interface account.
 
+<!-- ************************************************************************************
+     ************************************************************************************
+     ************************************************************************************ -->
 <h2>Orders and Sales</h2>
 
 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<br/>
 (2)if two or more tickets contradict on this state the order is returned as failed<p/>
 
+<h3>Getting an Overview List of Orders</h3>
 
-<!-- ***************************************** -->
+The <tt>getorderlist</tt> transaction can be used to get a list of all currently stored orders. The request does not contain any data, the response looks like:<p>
+
+<pre>
+&lt;OrderList>
+  &lt;Order id="orderid" customer="customerid" status="orderstatus"
+       totalprice="amountDueInCent" paid="amountPaidInCent"/>
+  ...
+&lt;/OrderList>
+</pre>
+(this is a small subset of the full order object)
+
+<!-- ************************************************************************************
+     ************************************************************************************
+     ************************************************************************************ -->
 <h2>Templates</h2>
 
 Templates are used for printouts and documents. There are several types of templates:<p>
index 74182e5..dfdbcf0 100644 (file)
@@ -3,5 +3,62 @@
 <body>
 <h1>Magic Smoke Ticket Templates</h1>
 
+The ticket template file must be called <tt>ticket.xtt</tt>.<p>
+
+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.<p>
+
+The description file must be called <tt>template.xml</tt> and must be in the root directory of the archive.
+
+<h2>XML format</h2>
+
+The <tt>template.xml</tt> 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:<p>
+
+<pre>
+&lt;TicketTemplate unit="mm|in|px" size="11 22">
+  &lt;LoadFont file="nameInsideArchive.ttf"/>
+  &lt;Picture file="nameInsideArchive.png" size="11 22" offset="33 44" smooth="1"/>
+  &lt;Text font="fontFamilyName" embeddedFont="fontFamilyName" fontsize="sizeInPt"
+      offset="11 22" align="left|right|center" valign="top|bottom|center"
+      >some string with @VARIABLES@ to print&lt;/Text>
+  &lt;Barcode offset="11 22" size="33 44"/>
+  ...
+&lt;/TicketTemplate>
+</pre>
+
+The elements are:
+<table frame="1" border="1">
+<tr><td><b>Element</b></td><td><b>Description</b></td></tr>
+<tr><td>TicketTemplate</td><td>this is the document element, it describes the complete ticket</td></tr>
+<tr><td>LoadFont</td><td>loads 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</td></tr>
+<tr><td>Picture</td><td>paints 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</td></tr>
+<tr><td>Text</td><td>describes text that is rendered on the ticket</td></tr>
+<tr><td>Barcode</td><td>generates a code-39 barcode from the ticket-ID and scales it onto the ticket</td></tr>
+</table><p>
+
+The attributes are
+<table frame="1" border="1">
+<tr><td><b>Attribute</b></td><td><b>Description</b></td></tr>
+<tr><td>unit</td><td>describes 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.</td></tr>
+<tr><td>size</td><td>describes 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"</td></tr>
+<tr><td>offset</td><td>describes 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.</td></tr>
+<tr><td>file</td><td>a relative file name within the template ZIP file</td></tr>
+<tr><td>smooth</td><td>for Pictures: describes whether the scaling should be done using edged (0) or smooth (1) scaling</td></tr>
+<tr><td>font</td><td>contains 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</td></tr>
+<tr><td>embeddedFont</td><td>contains 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</td></tr>
+<tr><td>fontsize</td><td>the height of the text to render in pt (default is 10)</td></tr>
+<tr><td>align</td><td>horizontal 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</td></tr>
+<tr><td>valign</td><td>vertical 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</td></tr>
+</table><p>
+
+Variables for Text elements are enclosed in "@" signs (eg. @VARNAME@). The following variables exist:
+<table frame="1" border="1">
+<tr><td><b>Variable</b></td><td><b>Description</b></td></tr>
+<tr><td>TICKETID</td><td>the ID of the ticket</td></tr>
+<tr><td>PRICE</td><td>the price of the ticket</td></tr>
+<tr><td>ROOM</td><td>the room of the tickets event</td></tr>
+<tr><td>TITLE</td><td>the title of the tickets event</td></tr>
+<tr><td>DATETIME</td><td>the localized date and time when the event starts</td></tr>
+<tr><td>ARTIST</td><td>the artist for this event</td></tr>
+</table>
 
 </html>
\ No newline at end of file