[1744] | 1 | <!-- $Id$ --> |
---|
| 2 | |
---|
| 3 | <chapter> |
---|
[2170] | 4 | <title>Export datas to other software with dumpykota</title> |
---|
[1744] | 5 | <para>Last modified on $Date$</para> |
---|
[3413] | 6 | |
---|
[1744] | 7 | <para> |
---|
[2115] | 8 | If you want to reuse <application>PyKota</application> datas from another |
---|
[1744] | 9 | software, but don't want to modify your existing application to |
---|
| 10 | have it connect to <application>PyKota</application>'s database, your |
---|
[2115] | 11 | best option is the new <command>dumpykota</command> command. |
---|
[1744] | 12 | </para> |
---|
[3413] | 13 | |
---|
[1744] | 14 | <para> |
---|
[2115] | 15 | <command>dumpykota</command> can export <application>PyKota</application> |
---|
[1783] | 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>. |
---|
[3413] | 18 | </para> |
---|
| 19 | |
---|
[2115] | 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 |
---|
[2478] | 24 | <application>phpPrintAnalyzer</application> which is a logfile analyzer for <application>CUPS</application>. |
---|
[3413] | 25 | </para> |
---|
| 26 | |
---|
[2115] | 27 | <para> |
---|
[3413] | 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. |
---|
[1744] | 31 | </para> |
---|
[3413] | 32 | |
---|
[1744] | 33 | <para> |
---|
[2115] | 34 | <command>dumpykota</command> can't dump all datas at once though, you have |
---|
[1744] | 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> |
---|
[3413] | 46 | </itemizedlist> |
---|
[1744] | 47 | </para> |
---|
[3413] | 48 | |
---|
[1744] | 49 | <para> |
---|
[3413] | 50 | You can then import the dumped datas into a spreadsheet for example, |
---|
[1744] | 51 | if you want to create complex reports with nice looking graphs and |
---|
| 52 | the like. |
---|
| 53 | </para> |
---|
[3413] | 54 | |
---|
[1744] | 55 | <para> |
---|
[2236] | 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> |
---|
[2266] | 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>. |
---|
[2236] | 65 | </para> |
---|
[3413] | 66 | |
---|
[2236] | 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 |
---|
[2266] | 70 | for a particular data type may return an incorrect result. |
---|
[2236] | 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> |
---|
[3413] | 76 | </tip> |
---|
[2236] | 77 | </para> |
---|
[3413] | 78 | |
---|
[2236] | 79 | <para> |
---|
[1744] | 80 | This command could also be used if you plan to write your own management |
---|
[2115] | 81 | tools : just write wrappers around the <command>pkprinters</command>, |
---|
| 82 | <command>edpykota</command>, and <command>dumpykota</command> |
---|
[1744] | 83 | tools, and your own tools will automatically benefit from <application>PyKota</application> |
---|
| 84 | database backend independance layer. |
---|
[2115] | 85 | This is exactly what the third party software <application>phpPykotaAdmin</application> does. |
---|
[1744] | 86 | </para> |
---|
[3413] | 87 | |
---|
[2115] | 88 | <para> |
---|
| 89 | Finally, <command>dumpykota</command>'s functionnality is now also available remotely through |
---|
[2551] | 90 | the use of the <command>dumpykota.cgi</command> <acronym>CGI</acronym> script. |
---|
[2115] | 91 | </para> |
---|
[3413] | 92 | |
---|
[1744] | 93 | <warning> |
---|
| 94 | <title>Warning</title> |
---|
| 95 | <para> |
---|
[1783] | 96 | Only <application>PyKota</application> administrators can dump PyKota's datas. |
---|
[1744] | 97 | </para> |
---|
[3413] | 98 | </warning> |
---|
| 99 | |
---|
[1744] | 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> |
---|
[1783] | 111 | <group choice="opt"> |
---|
| 112 | <arg>-o <replaceable>filename</replaceable></arg> |
---|
| 113 | <arg>--output <replaceable>filename</replaceable></arg> |
---|
| 114 | </group> |
---|
[1744] | 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 | |
---|