root / pykota / tags / 1.23 / docs / dumpykota.sgml

Revision 2551, 4.8 kB (checked in by jerome, 19 years ago)

Replaced some 'filename' tags with 'command' tags.
Improved pkbcodes' documentation.

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