root / pykota / trunk / docs / dumpykota.sgml @ 2413

Revision 2266, 4.9 kB (checked in by jerome, 20 years ago)

Now dumpykota and dumpykota.cgi accept start= and end=
to specify the starting and ending dates when dumping the
history.
Syntax allowed is :

start|end=YYYY[MM[DD[hh[mm[ss]]]]]

and this is REALLY powerful !

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1<!-- $Id$ -->
2
3<chapter>
4  <title>Export datas to other software with dumpykota</title>
5  <para>Last modified on $Date$</para>
6 
7  <para>
8    If you want to reuse <application>PyKota</application> datas from another
9    software, but don't want to modify your existing application to
10    have it connect to <application>PyKota</application>'s database, your
11    best option is the new <command>dumpykota</command> command.
12  </para>
13 
14  <para>
15    <command>dumpykota</command> can export <application>PyKota</application>
16    datas in a number of formats. The supported output formats are
17    comma separated values, semicolon separated values, tab separated values, and <acronym>XML</acronym>.
18  </para> 
19 
20  <para>
21    For the print job history's datas, a special format identical to <application>CUPS</application>' <literal>page_log</literal>
22    format is also supported.
23    This allows you to interface <application>PyKota</application> with third party tools like
24    <application>phpPrintAnalyzer</application> which is a logfile analyzer for <application>CUPS</application>,
25    even in the case where you use <application>LPRng</application> instead of <application>CUPS</application>.
26  </para> 
27 
28  <para>
29    More formats may be added in the future. In particular,
30    <acronym>SQL</acronym> and <acronym>LDIF</acronym> are planned, but
31    are currently not implemented.
32  </para>
33 
34  <para>
35    <command>dumpykota</command> can't dump all datas at once though, you have
36    to specify which type of datas you want. The possible types are :
37    <itemizedlist>
38      <listitem><para>Users</para></listitem>
39      <listitem><para>Users groups</para></listitem>
40      <listitem><para>Printers</para></listitem>
41      <listitem><para>Printers groups membership</para></listitem>
42      <listitem><para>Users groups membership</para></listitem>
43      <listitem><para>Users print quota entries</para></listitem>
44      <listitem><para>Users groups print quota entries</para></listitem>
45      <listitem><para>History of payments</para></listitem>
46      <listitem><para>History of print jobs</para></listitem>
47    </itemizedlist> 
48  </para>
49 
50  <para>
51    You can then import the dumped datas into a spreadsheet for example,
52    if you want to create complex reports with nice looking graphs and
53    the like.
54  </para>
55 
56  <para>
57    An important feature of this command is the possibility to use
58    a simple but powerful filtering mechanism to only export the datas
59    you want. You can pass any number of filter expressions which will
60    be ANDed together to select only certain records in the database.
61    For example the filter expression <literal>username=jerome</literal>
62    would only dump datas pertaining to user <literal>jerome</literal>
63    while the filter expression <literal>start=2005</literal> used
64    when dumping the history would only dump jobs printed during
65    the year <literal>2005</literal>.
66  </para>
67 
68  <para>
69    Several keys like <literal>username</literal> are possible, but some
70    only apply to certain data types. Using a key which is not supported
71    for a particular data type may return an incorrect result.
72    <tip><title>Tip</title>
73      <para>
74        Please refer to dumpykota's help or manual page to obtain
75        the complete list of supported keys.
76      </para>
77    </tip> 
78  </para>
79 
80  <para>
81    This command could also be used if you plan to write your own management
82    tools : just write wrappers around the <command>pkprinters</command>,
83    <command>edpykota</command>, and <command>dumpykota</command>
84    tools, and your own tools will automatically benefit from <application>PyKota</application>
85    database backend independance layer.
86    This is exactly what the third party software <application>phpPykotaAdmin</application> does.
87  </para>
88 
89  <para>
90    Finally, <command>dumpykota</command>'s functionnality is now also available remotely through
91    the use of the <filename>dumpykota.cgi</filename> <acronym>CGI</acronym> script.
92  </para>
93 
94  <warning>
95    <title>Warning</title>
96    <para>
97      Only <application>PyKota</application> administrators can dump PyKota's datas.
98    </para>
99  </warning> 
100       
101  <sect1>
102    <title>Reference</title>
103    <para>
104      <cmdsynopsis>
105        <command>dumpykota</command>
106        <group choice="opt"><arg>-v</arg><arg>--version</arg></group>
107        <group choice="opt"><arg>-h</arg><arg>--help</arg></group>
108        <group choice="opt">
109          <arg>-f <replaceable>outputformat</replaceable></arg>
110          <arg>--format <replaceable>outputformat</replaceable></arg>
111        </group>
112        <group choice="opt">
113          <arg>-o <replaceable>filename</replaceable></arg>
114          <arg>--output <replaceable>filename</replaceable></arg>
115        </group>
116        <group choice="req">
117          <arg>-d <replaceable>datatype</replaceable></arg>
118          <arg>--data <replaceable>datatype</replaceable></arg>
119        </group>
120      </cmdsynopsis>
121    </para>
122  </sect1>
123</chapter>
124
Note: See TracBrowser for help on using the browser.