Index: openacs-4/packages/attendance/bin/trml2pdf/COPYRIGHT.txt =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attendance/bin/trml2pdf/COPYRIGHT.txt,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/attendance/bin/trml2pdf/COPYRIGHT.txt 2 Apr 2006 21:21:06 -0000 1.1 @@ -0,0 +1,3 @@ +This code is copyrighted by Fabien Pinckaers (http://tiny.be) + +This is released under L-GPL License (see LICENSE.TXT). Index: openacs-4/packages/attendance/bin/trml2pdf/INSTALL.txt =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attendance/bin/trml2pdf/INSTALL.txt,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/attendance/bin/trml2pdf/INSTALL.txt 2 Apr 2006 21:21:06 -0000 1.1 @@ -0,0 +1,11 @@ +Installing Tiny RML2PDF + +Dependencies: + - Reportlab PDF-Toolkit current version + - Python-Imaging (PIL) if you use bitmap pictures + +To install Tiny RML2PDF, copy the directory trml2pdf where you want! + +That's all folks :) + +This Software is only tested with Linux and Python-2.2 Index: openacs-4/packages/attendance/bin/trml2pdf/LICENSE.txt =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attendance/bin/trml2pdf/LICENSE.txt,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/attendance/bin/trml2pdf/LICENSE.txt 2 Apr 2006 21:21:06 -0000 1.1 @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + Index: openacs-4/packages/attendance/bin/trml2pdf/README.txt =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attendance/bin/trml2pdf/README.txt,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/attendance/bin/trml2pdf/README.txt 2 Apr 2006 21:21:06 -0000 1.1 @@ -0,0 +1,54 @@ +Name +---- + +trml2pdf - convert a Report Markup Langage (RML) file to a PDF + + +Synopsis +-------- + + trml2pdf --help + trml2pdf ouput.pdf + +Description +----------- + +Tiny RML2PDF is a tool to easily create PDF document without programming. It +can be used as a Python library or as a standalone binary. It converts a RML, +an XML dialect that lets you define the precise appearance of a printed +document, to a PDF. You can use your existing tools to generate an input file +that exactly describes the layout of a printed document, and RML2PDF converts +it into PDF. RML is a much more powerfull and flexible alternative to XSL:FO. + +The executable read a RML file to the standard input and output a PDF file to +the standard output. + + +Command-line options +-------------------- + + --help: command line options + +Examples +-------- + +Create a PDF file: + + trml2pdf + + + + + + + + + + + + + + + + http://art-in-europe.com + Artistes et galeries d'art + http://antique-in-europe.com + Antiquaires + http://auction-in-europe.com + Salles de ventes publiques + + + Depuis toujours nos sites sont en avance sur leur temps. + Depuis toujours nos sites sont en avance sur leur temps. + Depuis toujours nos sites sont en avance sur leur temps. + Depuis toujours nos sites sont en avance sur leur temps. + Depuis toujours nos sites sont en avance sur leur temps. + Depuis toujours nos sites sont en avance sur leur temps. + Depuis toujours nos sites sont en avance sur leur temps. + Depuis toujours nos sites sont en avance sur leur temps. + Depuis toujours nos sites sont en avance sur leur temps. + Depuis toujours nos sites sont en avance sur leur temps. + Depuis toujours nos sites sont en avance sur leur temps. + Depuis toujours nos sites sont en avance sur leur temps. + Depuis toujours nos sites sont en avance sur leur temps. + Depuis toujours nos sites sont en avance sur leur temps. + Depuis toujours nos sites sont en avance sur leur temps. + Depuis toujours nos sites sont en avance sur leur temps. + Depuis toujours nos sites sont en avance sur leur temps. + + + Base de donnee + 90.000 oeuvres, 23.000 photos + 300 artistes contemporains + 8.000 objets a vendre par mois + 250 ventes directes/mois + Base de donnee + 90.000 oeuvres, 23.000 photos + 300 artistes contemporains + 8.000 objets a vendre par mois + 250 ventes directes/mois + Base de donnee + 90.000 oeuvres, 23.000 photos + 8.000 objets a vendre par mois + 250 ventes directes/mois + (*) chiffres calcules le 12/12/2003 + + + Flagey.com, ArthusGallery.com, Ferraton.be, python.org + Flagey.com, Zope.org, Ferraton.be, Debian.org + Flagey.com, Ferraton.be, Google.com + Flagey.com, Google.be, Ferraton.be, + Flagey.com, ArthusGallery.com, Ferraton.be, + Flagey.com, ArthusGallery.com, Ferraton.be, python.org + Flagey.com, Zope.org, Debian.org + + + - Test des bullets fds fkldsjf dslksfdjmlsfd fdsjhdkj kljsfd lmsfd jsfmdlk j jsdhks djhskls djfk. + - Test des bullets kljsfd lmsfd jsfmdlk j jsdhks djhskls djfk. + - Test des bullets + (*) chiffres calcules le 12/12/2003 + + + Index: openacs-4/packages/attendance/bin/trml2pdf/rmls/devis.pdf =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attendance/bin/trml2pdf/rmls/devis.pdf,v diff -u Binary files differ Index: openacs-4/packages/attendance/bin/trml2pdf/rmls/devis.rml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attendance/bin/trml2pdf/rmls/devis.rml,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/attendance/bin/trml2pdf/rmls/devis.rml 2 Apr 2006 21:21:06 -0000 1.1 @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + Fabien Pinckaers +Rue Joseph Mathieu 28 +1300 Limal +Tel: 010.68.94.39 + + + + Document: Devis impression sur textile + + + + Madame, Monsieur, + + + + Vous trouverez ci-join le devis suite a votre demande faite sur notre site. + + + + + DescriptionPrix Unit.QtyPrix HTVA + + Chemises23.0032 345.00 + + T-shirts23.0032 345.00 + + HTVA:100.00 + + TVA:20.00 + + TVAC:120.00 + + + + + Tout acceptation de ce devis necessite le renvoi de ce dernier apres avoir ete date et signe et + suivi des mentions suivantes : "lu et approuve" et "bon pour accord". + + + + Tout contrat conclu avec notre societe est exclusivement regi par nos + conditions generales. + + + Index: openacs-4/packages/attendance/bin/trml2pdf/rmls/ex1.pdf =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attendance/bin/trml2pdf/rmls/ex1.pdf,v diff -u Binary files differ Index: openacs-4/packages/attendance/bin/trml2pdf/rmls/ex1.rml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attendance/bin/trml2pdf/rmls/ex1.rml,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/attendance/bin/trml2pdf/rmls/ex1.rml 2 Apr 2006 21:21:06 -0000 1.1 @@ -0,0 +1,11 @@ + + + + + + + Hello World. + + + + Index: openacs-4/packages/attendance/bin/trml2pdf/rmls/ex10.pdf =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attendance/bin/trml2pdf/rmls/ex10.pdf,v diff -u Binary files differ Index: openacs-4/packages/attendance/bin/trml2pdf/rmls/ex10.rml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attendance/bin/trml2pdf/rmls/ex10.rml,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/attendance/bin/trml2pdf/rmls/ex10.rml 2 Apr 2006 21:21:06 -0000 1.1 @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Example 10 - colors and fonts in tables + + + Cell 0,0Cell 1,0Cell 2,0Cell 3,0 + Cell 0,1Cell 1,1Cell 2,1Cell 3,1 + Cell 0,2Cell 1,2Cell 2,2Cell 3,2 + Cell 0,3Cell 1,3Cell 2,3Cell 3,3 + Cell 0,4Cell 1,4Cell 2,4Cell 3,4 + Cell 0,5Cell 1,5Cell 2,5Cell 3,5 + Cell 0,6Cell 1,6Cell 2,6Cell 3,6 + + + + Index: openacs-4/packages/attendance/bin/trml2pdf/rmls/ex11.pdf =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attendance/bin/trml2pdf/rmls/ex11.pdf,v diff -u Binary files differ Index: openacs-4/packages/attendance/bin/trml2pdf/rmls/ex11.rml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attendance/bin/trml2pdf/rmls/ex11.rml,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/attendance/bin/trml2pdf/rmls/ex11.rml 2 Apr 2006 21:21:06 -0000 1.1 @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Example 11 - lines and alignment in tables + + + + (a=LEFT)(VA=TOP) + (VA=TOP) + (VA="TOP") + (a=RIGHT)(VA=TOP) + + + (a=LEFT) + 1,1 + Cell 2,1 + (a=RIGHT) + + + (a=LEFT) + 1,2 + (VA=MIDDLE) + (a=RIGHT) + + + (a=LEFT) + 1,3 + (VA=MIDDLE) + (VA=MDL)(a=RIGHT) + + + (a=LEFT) + 1,4 + 2,4 + (a=RIGHT) + + + (a=LEFT) + 1,5 + 2,5 + (a=RIGHT) + + + (a=LEFT) + 1,6 + 2,6 + (a=RIGHT) + + + +a=value for blockAlignment +VA=value for blockValign +MDLE=MIDDLE for VA in cells 3,2 and 3,3 + + + Index: openacs-4/packages/attendance/bin/trml2pdf/rmls/ex12.pdf =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attendance/bin/trml2pdf/rmls/ex12.pdf,v diff -u Binary files differ Index: openacs-4/packages/attendance/bin/trml2pdf/rmls/ex12.rml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attendance/bin/trml2pdf/rmls/ex12.rml,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/attendance/bin/trml2pdf/rmls/ex12.rml 2 Apr 2006 21:21:06 -0000 1.1 @@ -0,0 +1,214 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Example 12 - pict and padding in tables + + + + + + + + + 0 0 141 0 + 141 0 141 90 + 141 90 0 90 + 0 90 0 0 + + + + + + + + + 0 0 141 0 + 141 0 141 90 + 141 90 0 90 + 0 90 0 0 + + + + + + + + + 0 0 141 0 + 141 0 141 90 + 141 90 0 90 + 0 90 0 0 + + + + + + + + blockLeftPadding with blockBottomPadding + + + + + just blockBottomPadding + + + + + blockRightPadding with blockBottomPadding + + + + + + + + + + 0 0 141 0 + 141 0 141 90 + 141 90 0 90 + 0 90 0 0 + + + + + + + + + 0 0 141 0 + 141 0 141 90 + 141 90 0 90 + 0 90 0 0 + + + + + + + + + 0 0 141 0 + 141 0 141 90 + 141 90 0 90 + 0 90 0 0 + + + + + + + + blockLeftPadding with blockTopPadding + + + + + just blockTopPadding + + + + + blockRightPadding with blockTopPadding + + + + + + + + + + 0 0 141 0 + 141 0 141 90 + 141 90 0 90 + 0 90 0 0 + + + + + + + + + 0 0 141 0 + 141 0 141 90 + 141 90 0 90 + 0 90 0 0 + + + + + + + + + 0 0 141 0 + 141 0 141 90 + 141 90 0 90 + 0 90 0 0 + + + + + + + + blockLeftPadding with blockTopPadding + + + + + no padding + + + + + blockRightPadding with blockBottomPadding + + + + + + Index: openacs-4/packages/attendance/bin/trml2pdf/rmls/ex2.pdf =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attendance/bin/trml2pdf/rmls/ex2.pdf,v diff -u Binary files differ Index: openacs-4/packages/attendance/bin/trml2pdf/rmls/ex2.rml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attendance/bin/trml2pdf/rmls/ex2.rml,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/attendance/bin/trml2pdf/rmls/ex2.rml 2 Apr 2006 21:21:06 -0000 1.1 @@ -0,0 +1,22 @@ + + + + + + + + + This is the "story". This is the part of the RML document where + your text is placed. + + + It should be enclosed in "para" and "/para" tags to turn it into + paragraphs. + + + + Index: openacs-4/packages/attendance/bin/trml2pdf/rmls/ex3.pdf =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attendance/bin/trml2pdf/rmls/ex3.pdf,v diff -u Binary files differ Index: openacs-4/packages/attendance/bin/trml2pdf/rmls/ex3.rml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attendance/bin/trml2pdf/rmls/ex3.rml,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/attendance/bin/trml2pdf/rmls/ex3.rml 2 Apr 2006 21:21:06 -0000 1.1 @@ -0,0 +1,99 @@ + + + + + + + + + + Index: openacs-4/packages/attendance/bin/trml2pdf/rmls/ex4.pdf =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attendance/bin/trml2pdf/rmls/ex4.pdf,v diff -u Binary files differ Index: openacs-4/packages/attendance/bin/trml2pdf/rmls/ex4.rml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attendance/bin/trml2pdf/rmls/ex4.rml,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/attendance/bin/trml2pdf/rmls/ex4.rml 2 Apr 2006 21:21:06 -0000 1.1 @@ -0,0 +1,208 @@ + + + + + + + + + + + Index: openacs-4/packages/attendance/bin/trml2pdf/rmls/ex5.pdf =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attendance/bin/trml2pdf/rmls/ex5.pdf,v diff -u Binary files differ Index: openacs-4/packages/attendance/bin/trml2pdf/rmls/ex5.rml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attendance/bin/trml2pdf/rmls/ex5.rml,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/attendance/bin/trml2pdf/rmls/ex5.rml 2 Apr 2006 21:21:06 -0000 1.1 @@ -0,0 +1,135 @@ + + + + + + + + + + + + + + + + + + +

+ +

+ + This is the contents for column one. + + + It uses the default style for paragraph. + + + Does it come out OK? + + + There now follows some random text to see how these paragraphs + look with longer content: + + + Blah blah morale blah benchmark blah blah blah blah blah blah + communication blah blah blah blah blah blah blah blah blah + blah stretch the envelope blah blah blah. + + + Blah blah blah blah blah blah blah blah blah blah blah blah + architect blah inter active backward-compatible blah blah blah + blah blah. Blah blah blah blah value-added. + + + Blah blah blah blah blah blah blah blah blah re-factoring + phase blah knowledge management blah blah. Blah blah blah blah + interactive blah vision statement blah. + + + Blah blah blah blah blah blah conceptualize blah downsize blah + blah blah blah. Blah blah blah blah blah blah blah blah blah + blah blah blah synergy client-centered vision statement. + + + Blah blah dysfunctional blah blah blah blah blah blah blah + appropriate blah blah blah blah blah blah blah blah + re-factoring go the extra mile blah blah blah blah. + + + +

+ +

+ + This is the contents for column two. + + + It uses the paragraph style we have called "body". + + + Does it come out OK? + + + There now follows some random text to see how these paragraphs + look with longer content: + + + Blah OS/2 blah blah blah blah coffee blah blah blah blah + Windows blah blah blah blah blah blah blah. Blah blah blah + blah blah blah blah Modula-3 blah blah blah. Blah blah bug + report blah blah blah blah blah memory blah blah TeX TCP/IP + SMTP blah blah. + + + Blah blah blah blah blah Em blah letterform blah blah blah + blah blah blah blah blah blah letterform blah blah. Blah blah + blah blah leader blah blah blah blah. + + + Blah blah blah blah blah uppercase blah blah right justified + blah blah blah flush-right blah blah blah. Blah blah blah blah + blah blah spot-colour blah Em. + + + Blah dingbat blah blah blah blah blah blah blah blah blah blah + blah blah blah blah blah. Blah blah blah blah blah drop-cap + blah blah blah blah blah blah blah. + +
+
+ Index: openacs-4/packages/attendance/bin/trml2pdf/rmls/ex6.pdf =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attendance/bin/trml2pdf/rmls/ex6.pdf,v diff -u Binary files differ Index: openacs-4/packages/attendance/bin/trml2pdf/rmls/ex6.rml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attendance/bin/trml2pdf/rmls/ex6.rml,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/attendance/bin/trml2pdf/rmls/ex6.rml 2 Apr 2006 21:21:06 -0000 1.1 @@ -0,0 +1,133 @@ + + + + + + + +

+ seq in seq, seqDefault and seqReset +

+ copied: , , . +Reset. , , +. +

+ simple use of seq +

+ + First seq: + + + Second seq: + + + + + We have just done a <seqReset"/> + + + + First seq after seqReset: + + + second seq after seqReset: + + + + If you are going to use multiple seq tags, you need to use the "id" attribute. + +

+ Better use of seq +

+ + + We have just done a <seqDefault id="test"/> + + + + We have just done a <seqReset id="test"/> + + + + First seq: + + + Second seq: + + + + + We have just done a <seqReset id="test"/> + + + + First seq after seqReset: + + + second seq after seqReset: + +

+ Using two seqs independently +

+ + + We have just done a <seqReset id="testOne"/> + + + + We have just done a <seqReset id="testTwo"/> + + + + First seq for testOne: + + + Second seq for testOne: + + + + First seq for testTwo: + + + Second seq for testTwo: + + + + + We have just done a <seqReset id="testOne"/> + + + + First seq after seqReset for testOne: + + + second seq after seqReset for testOne: + + + + First seq after seqReset for testTwo: + + + second seq after seqReset for testTwo: + + + + Notice how resetting testOne doesn't affect testTwo at all. + +
+
+ Index: openacs-4/packages/attendance/bin/trml2pdf/rmls/ex7.pdf =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attendance/bin/trml2pdf/rmls/ex7.pdf,v diff -u Binary files differ Index: openacs-4/packages/attendance/bin/trml2pdf/rmls/ex7.rml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attendance/bin/trml2pdf/rmls/ex7.rml,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/attendance/bin/trml2pdf/rmls/ex7.rml 2 Apr 2006 21:21:06 -0000 1.1 @@ -0,0 +1,51 @@ + + + + + + + + + + + Index: openacs-4/packages/attendance/bin/trml2pdf/rmls/ex7b.pdf =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attendance/bin/trml2pdf/rmls/ex7b.pdf,v diff -u Binary files differ Index: openacs-4/packages/attendance/bin/trml2pdf/rmls/ex7b.rml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attendance/bin/trml2pdf/rmls/ex7b.rml,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/attendance/bin/trml2pdf/rmls/ex7b.rml 2 Apr 2006 21:21:06 -0000 1.1 @@ -0,0 +1,31 @@ + + + + + + + + + + 247 172 + 147 172 + 147 272 + 247 272 + 247 372 + 347 372 + 347 372 + 347 272 + 447 272 + 447 172 + 347 172 + 347 72 + 267 572 + 277 612 + + 147 585 147 687 297 792 + 447 687 447 585 317 612 + + 327 572 + + + Index: openacs-4/packages/attendance/bin/trml2pdf/rmls/ex9.pdf =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attendance/bin/trml2pdf/rmls/ex9.pdf,v diff -u Binary files differ Index: openacs-4/packages/attendance/bin/trml2pdf/rmls/ex9.rml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attendance/bin/trml2pdf/rmls/ex9.rml,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/attendance/bin/trml2pdf/rmls/ex9.rml 2 Apr 2006 21:21:06 -0000 1.1 @@ -0,0 +1,72 @@ + + + + + + + + + + Example 9 + + This is a page which shows you how illustrations, grids and the place tag work. + + + + + + This is an illustration + + + The red circle you can see is an illustration, not a pageGraphic. + + + + + + + + + So is the teal colored one. + + + These are all flowables in the story. + + + + Index: openacs-4/packages/attendance/bin/trml2pdf/rmls/pict/devis_logo.jpg =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attendance/bin/trml2pdf/rmls/pict/devis_logo.jpg,v diff -u Binary files differ Index: openacs-4/packages/attendance/bin/trml2pdf/rmls/pict/logo.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attendance/bin/trml2pdf/rmls/pict/logo.png,v diff -u Binary files differ Index: openacs-4/packages/attendance/bin/trml2pdf/rmls/pict/replogo.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attendance/bin/trml2pdf/rmls/pict/replogo.gif,v diff -u Binary files differ Index: openacs-4/packages/attendance/bin/trml2pdf/rmls/pict/screenshot.jpg =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attendance/bin/trml2pdf/rmls/pict/screenshot.jpg,v diff -u Binary files differ Index: openacs-4/packages/attendance/bin/trml2pdf/rmls/pict/tiny_logo.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attendance/bin/trml2pdf/rmls/pict/tiny_logo.png,v diff -u Binary files differ Index: openacs-4/packages/attendance/bin/trml2pdf/trml2pdf/__init__.py =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attendance/bin/trml2pdf/trml2pdf/__init__.py,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/attendance/bin/trml2pdf/trml2pdf/__init__.py 2 Apr 2006 21:21:06 -0000 1.1 @@ -0,0 +1,18 @@ +# trml2pdf - An RML to PDF converter +# Copyright (C) 2003, Fabien Pinckaers, UCL, FSA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +from trml2pdf import parseString Index: openacs-4/packages/attendance/bin/trml2pdf/trml2pdf/color.py =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attendance/bin/trml2pdf/trml2pdf/color.py,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/attendance/bin/trml2pdf/trml2pdf/color.py 2 Apr 2006 21:21:06 -0000 1.1 @@ -0,0 +1,36 @@ +# trml2pdf - An RML to PDF converter +# Copyright (C) 2003, Fabien Pinckaers, UCL, FSA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +from reportlab.lib import colors +import re + +allcols = colors.getAllNamedColors() + +regex_t = re.compile('\(([0-9\.]*),([0-9\.]*),([0-9\.]*)\)') +regex_h = re.compile('#([0-9a-zA-Z][0-9a-zA-Z])([0-9a-zA-Z][0-9a-zA-Z])([0-9a-zA-Z][0-9a-zA-Z])') + +def get(col_str): + global allcols + if col_str in allcols.keys(): + return allcols[col_str] + res = regex_t.search(col_str, 0) + if res: + return (float(res.group(1)),float(res.group(2)),float(res.group(3))) + res = regex_h.search(col_str, 0) + if res: + return tuple([ float(int(res.group(i),16))/255 for i in range(1,4)]) + return colors.red Index: openacs-4/packages/attendance/bin/trml2pdf/trml2pdf/color.pyc =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attendance/bin/trml2pdf/trml2pdf/color.pyc,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/attendance/bin/trml2pdf/trml2pdf/color.pyc 2 Apr 2006 21:21:06 -0000 1.1 @@ -0,0 +1,6 @@ +;� +�/Dc@sMdklZdkZei�aeid�Zeid�Zd�ZdS((scolorsNs$\(([0-9\.]*),([0-9\.]*),([0-9\.]*)\)sI#([0-9a-zA-Z][0-9a-zA-Z])([0-9a-zA-Z][0-9a-zA-Z])([0-9a-zA-Z][0-9a-zA-Z])cCs�|ti�jo t|Snti|d�}|o>t|id��t|id��t|id��fSnti|d�}|oTt gi +}t dd�D],}|tt|i|�d��d�q�~�SntiSdS(Niiiiiii�(scol_strsallcolsskeyssregex_tssearchsressfloatsgroupsregex_hstuplesappends_[1]srangesisintscolorssred(scol_strsisress_[1]((sI/var/lib/aolserver/hub/packages/attendance/bin/trml2pdf/trml2pdf/color.pysgets >T( s +reportlab.libscolorssresgetAllNamedColorssallcolsscompilesregex_tsregex_hsget(sregex_tsgetsrescolorssregex_h((sI/var/lib/aolserver/hub/packages/attendance/bin/trml2pdf/trml2pdf/color.pys?s + +   \ No newline at end of file Index: openacs-4/packages/attendance/bin/trml2pdf/trml2pdf/trml2pdf.py =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attendance/bin/trml2pdf/trml2pdf/trml2pdf.py,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/attendance/bin/trml2pdf/trml2pdf/trml2pdf.py 2 Apr 2006 21:21:06 -0000 1.1 @@ -0,0 +1,554 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# trml2pdf - An RML to PDF converter +# Copyright (C) 2003, Fabien Pinckaers, UCL, FSA +# Contributors +# Richard Waid +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +import sys +import StringIO +import xml.dom.minidom +import copy + +import reportlab +from reportlab.pdfgen import canvas +from reportlab import platypus + +import utils +import color + +# +# Change this to UTF-8 if you plan tu use Reportlab's UTF-8 support +# +encoding = 'latin1' + +def _child_get(node, childs): + clds = [] + for n in node.childNodes: + if (n.nodeType==n.ELEMENT_NODE) and (n.localName==childs): + clds.append(n) + return clds + +class _rml_styles(object): + def __init__(self, nodes): + self.styles = {} + self.names = {} + self.table_styles = {} + for node in nodes: + for style in node.getElementsByTagName('blockTableStyle'): + self.table_styles[style.getAttribute('id')] = self._table_style_get(style) + for style in node.getElementsByTagName('paraStyle'): + self.styles[style.getAttribute('name')] = self._para_style_get(style) + for variable in node.getElementsByTagName('initialize'): + for name in variable.getElementsByTagName('name'): + self.names[ name.getAttribute('id')] = name.getAttribute('value') + + def _para_style_update(self, style, node): + for attr in ['textColor', 'backColor', 'bulletColor']: + if node.hasAttribute(attr): + style.__dict__[attr] = color.get(node.getAttribute(attr)) + for attr in ['fontName', 'bulletFontName', 'bulletText']: + if node.hasAttribute(attr): + style.__dict__[attr] = node.getAttribute(attr) + for attr in ['fontSize', 'leftIndent', 'rightIndent', 'spaceBefore', 'spaceAfter', 'firstLineIndent', 'bulletIndent', 'bulletFontSize', 'leading']: + if node.hasAttribute(attr): + style.__dict__[attr] = utils.unit_get(node.getAttribute(attr)) + if node.hasAttribute('alignment'): + align = { + 'right':reportlab.lib.enums.TA_RIGHT, + 'center':reportlab.lib.enums.TA_CENTER, + 'justify':reportlab.lib.enums.TA_JUSTIFY + } + style.alignment = align.get(node.getAttribute('alignment').lower(), reportlab.lib.enums.TA_LEFT) + return style + + def _table_style_get(self, style_node): + styles = [] + for node in style_node.childNodes: + if node.nodeType==node.ELEMENT_NODE: + start = utils.tuple_int_get(node, 'start', (0,0) ) + stop = utils.tuple_int_get(node, 'stop', (-1,-1) ) + if node.localName=='blockValign': + styles.append(('VALIGN', start, stop, str(node.getAttribute('value')))) + elif node.localName=='blockFont': + styles.append(('FONT', start, stop, str(node.getAttribute('name')))) + elif node.localName=='blockTextColor': + styles.append(('TEXTCOLOR', start, stop, color.get(str(node.getAttribute('colorName'))))) + elif node.localName=='blockLeading': + styles.append(('LEADING', start, stop, utils.unit_get(node.getAttribute('length')))) + elif node.localName=='blockAlignment': + styles.append(('ALIGNMENT', start, stop, str(node.getAttribute('value')))) + elif node.localName=='blockLeftPadding': + styles.append(('LEFTPADDING', start, stop, utils.unit_get(node.getAttribute('length')))) + elif node.localName=='blockRightPadding': + styles.append(('RIGHTPADDING', start, stop, utils.unit_get(node.getAttribute('length')))) + elif node.localName=='blockTopPadding': + styles.append(('TOPPADDING', start, stop, utils.unit_get(node.getAttribute('length')))) + elif node.localName=='blockBottomPadding': + styles.append(('BOTTOMPADDING', start, stop, utils.unit_get(node.getAttribute('length')))) + elif node.localName=='blockBackground': + styles.append(('BACKGROUND', start, stop, color.get(node.getAttribute('colorName')))) + if node.hasAttribute('size'): + styles.append(('FONTSIZE', start, stop, utils.unit_get(node.getAttribute('size')))) + elif node.localName=='lineStyle': + kind = node.getAttribute('kind') + kind_list = [ 'GRID', 'BOX', 'OUTLINE', 'INNERGRID', 'LINEBELOW', 'LINEABOVE','LINEBEFORE', 'LINEAFTER' ] + assert kind in kind_list + thick = 1 + if node.hasAttribute('thickness'): + thick = float(node.getAttribute('thickness')) + styles.append((kind, start, stop, thick, color.get(node.getAttribute('colorName')))) + return platypus.tables.TableStyle(styles) + + def _para_style_get(self, node): + styles = reportlab.lib.styles.getSampleStyleSheet() + style = copy.deepcopy(styles["Normal"]) + self._para_style_update(style, node) + return style + + def para_style_get(self, node): + style = False + if node.hasAttribute('style'): + if node.getAttribute('style') in self.styles: + style = copy.deepcopy(self.styles[node.getAttribute('style')]) + else: + sys.stderr.write('Warning: style not found, %s - setting default!\n' % (node.getAttribute('style'),) ) + if not style: + styles = reportlab.lib.styles.getSampleStyleSheet() + style = copy.deepcopy(styles['Normal']) + return self._para_style_update(style, node) + +class _rml_doc(object): + def __init__(self, data): + self.dom = xml.dom.minidom.parseString(data) + self.filename = self.dom.documentElement.getAttribute('filename') + + def docinit(self, els): + from reportlab.lib.fonts import addMapping + from reportlab.pdfbase import pdfmetrics + from reportlab.pdfbase.ttfonts import TTFont + + for node in els: + for font in node.getElementsByTagName('registerFont'): + name = font.getAttribute('fontName').encode('ascii') + fname = font.getAttribute('fontFile').encode('ascii') + pdfmetrics.registerFont(TTFont(name, fname )) + addMapping(name, 0, 0, name) #normal + addMapping(name, 0, 1, name) #italic + addMapping(name, 1, 0, name) #bold + addMapping(name, 1, 1, name) #italic and bold + + def render(self, out): + el = self.dom.documentElement.getElementsByTagName('docinit') + if el: + self.docinit(el) + + el = self.dom.documentElement.getElementsByTagName('stylesheet') + self.styles = _rml_styles(el) + + el = self.dom.documentElement.getElementsByTagName('template') + if len(el): + pt_obj = _rml_template(out, el[0], self) + pt_obj.render(self.dom.documentElement.getElementsByTagName('story')[0]) + else: + self.canvas = canvas.Canvas(out) + pd = self.dom.documentElement.getElementsByTagName('pageDrawing')[0] + pd_obj = _rml_canvas(self.canvas, None, self) + pd_obj.render(pd) + self.canvas.showPage() + self.canvas.save() + +class _rml_canvas(object): + def __init__(self, canvas, doc_tmpl=None, doc=None): + self.canvas = canvas + self.styles = doc.styles + self.doc_tmpl = doc_tmpl + self.doc = doc + + def _textual(self, node): + rc = '' + for n in node.childNodes: + if n.nodeType == n.ELEMENT_NODE: + if n.localName=='pageNumber': + rc += str(self.canvas.getPageNumber()) + elif (n.nodeType == node.CDATA_SECTION_NODE): + rc += n.data + elif (n.nodeType == node.TEXT_NODE): + rc += n.data + return rc.encode(encoding) + + def _drawString(self, node): + self.canvas.drawString(text=self._textual(node), **utils.attr_get(node, ['x','y'])) + def _drawCenteredString(self, node): + self.canvas.drawCentredString(text=self._textual(node), **utils.attr_get(node, ['x','y'])) + def _drawRightString(self, node): + self.canvas.drawRightString(text=self._textual(node), **utils.attr_get(node, ['x','y'])) + def _rect(self, node): + if node.hasAttribute('round'): + self.canvas.roundRect(radius=utils.unit_get(node.getAttribute('round')), **utils.attr_get(node, ['x','y','width','height'], {'fill':'bool','stroke':'bool'})) + else: + self.canvas.rect(**utils.attr_get(node, ['x','y','width','height'], {'fill':'bool','stroke':'bool'})) + def _ellipse(self, node): + x1 = utils.unit_get(node.getAttribute('x')) + x2 = utils.unit_get(node.getAttribute('width')) + y1 = utils.unit_get(node.getAttribute('y')) + y2 = utils.unit_get(node.getAttribute('height')) + self.canvas.ellipse(x1,y1,x2,y2, **utils.attr_get(node, [], {'fill':'bool','stroke':'bool'})) + def _curves(self, node): + line_str = utils.text_get(node).split() + lines = [] + while len(line_str)>7: + self.canvas.bezier(*[utils.unit_get(l) for l in line_str[0:8]]) + line_str = line_str[8:] + def _lines(self, node): + line_str = utils.text_get(node).split() + lines = [] + while len(line_str)>3: + lines.append([utils.unit_get(l) for l in line_str[0:4]]) + line_str = line_str[4:] + self.canvas.lines(lines) + def _grid(self, node): + xlist = [utils.unit_get(s) for s in node.getAttribute('xs').split(',')] + ylist = [utils.unit_get(s) for s in node.getAttribute('ys').split(',')] + self.canvas.grid(xlist, ylist) + def _translate(self, node): + dx = 0 + dy = 0 + if node.hasAttribute('dx'): + dx = utils.unit_get(node.getAttribute('dx')) + if node.hasAttribute('dy'): + dy = utils.unit_get(node.getAttribute('dy')) + self.canvas.translate(dx,dy) + + def _circle(self, node): + self.canvas.circle(x_cen=utils.unit_get(node.getAttribute('x')), y_cen=utils.unit_get(node.getAttribute('y')), r=utils.unit_get(node.getAttribute('radius')), **utils.attr_get(node, [], {'fill':'bool','stroke':'bool'})) + + def _place(self, node): + flows = _rml_flowable(self.doc).render(node) + infos = utils.attr_get(node, ['x','y','width','height']) + + infos['y']+=infos['height'] + for flow in flows: + w,h = flow.wrap(infos['width'], infos['height']) + if w<=infos['width'] and h<=infos['height']: + infos['y']-=h + flow.drawOn(self.canvas,infos['x'],infos['y']) + infos['height']-=h + else: + raise ValueError, "Not enough space" + + def _line_mode(self, node): + ljoin = {'round':1, 'mitered':0, 'bevelled':2} + lcap = {'default':0, 'round':1, 'square':2} + if node.hasAttribute('width'): + self.canvas.setLineWidth(utils.unit_get(node.getAttribute('width'))) + if node.hasAttribute('join'): + self.canvas.setLineJoin(ljoin[node.getAttribute('join')]) + if node.hasAttribute('cap'): + self.canvas.setLineCap(lcap[node.getAttribute('cap')]) + if node.hasAttribute('miterLimit'): + self.canvas.setDash(utils.unit_get(node.getAttribute('miterLimit'))) + if node.hasAttribute('dash'): + dashes = node.getAttribute('dash').split(',') + for x in range(len(dashes)): + dashes[x]=utils.unit_get(dashes[x]) + self.canvas.setDash(node.getAttribute('dash').split(',')) + + def _image(self, node): + import urllib + from reportlab.lib.utils import ImageReader + u = urllib.urlopen(str(node.getAttribute('file'))) + s = StringIO.StringIO() + s.write(u.read()) + s.seek(0) + img = ImageReader(s) + (sx,sy) = img.getSize() + + args = {} + for tag in ('width','height','x','y'): + if node.hasAttribute(tag): + args[tag] = utils.unit_get(node.getAttribute(tag)) + if ('width' in args) and (not 'height' in args): + args['height'] = sy * args['width'] / sx + elif ('height' in args) and (not 'width' in args): + args['width'] = sx * args['height'] / sy + elif ('width' in args) and ('height' in args): + if (float(args['width'])/args['height'])>(float(sx)>sy): + args['width'] = sx * args['height'] / sy + else: + args['height'] = sy * args['width'] / sx + self.canvas.drawImage(img, **args) + + def _path(self, node): + self.path = self.canvas.beginPath() + self.path.moveTo(**utils.attr_get(node, ['x','y'])) + for n in node.childNodes: + if n.nodeType == node.ELEMENT_NODE: + if n.localName=='moveto': + vals = utils.text_get(n).split() + self.path.moveTo(utils.unit_get(vals[0]), utils.unit_get(vals[1])) + elif n.localName=='curvesto': + vals = utils.text_get(n).split() + while len(vals)>5: + pos=[] + while len(pos)<6: + pos.append(utils.unit_get(vals.pop(0))) + self.path.curveTo(*pos) + elif (n.nodeType == node.TEXT_NODE): + data = n.data.split() # Not sure if I must merge all TEXT_NODE ? + while len(data)>1: + x = utils.unit_get(data.pop(0)) + y = utils.unit_get(data.pop(0)) + self.path.lineTo(x,y) + if (not node.hasAttribute('close')) or utils.bool_get(node.getAttribute('close')): + self.path.close() + self.canvas.drawPath(self.path, **utils.attr_get(node, [], {'fill':'bool','stroke':'bool'})) + + def render(self, node): + tags = { + 'drawCentredString': self._drawCenteredString, + 'drawRightString': self._drawRightString, + 'drawString': self._drawString, + 'rect': self._rect, + 'ellipse': self._ellipse, + 'lines': self._lines, + 'grid': self._grid, + 'curves': self._curves, + 'fill': lambda node: self.canvas.setFillColor(color.get(node.getAttribute('color'))), + 'stroke': lambda node: self.canvas.setStrokeColor(color.get(node.getAttribute('color'))), + 'setFont': lambda node: self.canvas.setFont(node.getAttribute('name'), utils.unit_get(node.getAttribute('size'))), + 'place': self._place, + 'circle': self._circle, + 'lineMode': self._line_mode, + 'path': self._path, + 'rotate': lambda node: self.canvas.rotate(float(node.getAttribute('degrees'))), + 'translate': self._translate, + 'image': self._image + } + for nd in node.childNodes: + if nd.nodeType==nd.ELEMENT_NODE: + for tag in tags: + if nd.localName==tag: + tags[tag](nd) + break + +class _rml_draw(object): + def __init__(self, node, styles): + self.node = node + self.styles = styles + self.canvas = None + + def render(self, canvas, doc): + canvas.saveState() + cnv = _rml_canvas(canvas, doc, self.styles) + cnv.render(self.node) + canvas.restoreState() + +class _rml_flowable(object): + def __init__(self, doc): + self.doc = doc + self.styles = doc.styles + + def _textual(self, node): + rc = '' + for n in node.childNodes: + if n.nodeType == node.ELEMENT_NODE: + if n.localName=='getName': + newNode = self.doc.dom.createTextNode(self.styles.names.get(n.getAttribute('id'),'Unknown name')) + node.insertBefore(newNode, n) + node.removeChild(n) + if n.localName=='pageNumber': + rc+='' # TODO: change this ! + else: + self._textual(n) + rc += n.toxml() + elif (n.nodeType == node.CDATA_SECTION_NODE): + rc += n.data + elif (n.nodeType == node.TEXT_NODE): + rc += n.data + return rc.encode(encoding) + + def _table(self, node): + length = 0 + colwidths = None + rowheights = None + data = [] + for tr in _child_get(node,'tr'): + data2 = [] + for td in _child_get(tr, 'td'): + flow = [] + for n in td.childNodes: + if n.nodeType==node.ELEMENT_NODE: + flow.append( self._flowable(n) ) + if not len(flow): + flow = self._textual(td) + data2.append( flow ) + if len(data2)>length: + length=len(data2) + for ab in data: + while len(ab)output.pdf' + print 'Render the standard input (RML) and output a PDF file' + sys.exit(0) + +if __name__=="__main__": + if len(sys.argv)>1: + if sys.argv[1]=='--help': + trml2pdf_help() + print parseString(file(sys.argv[1], 'r').read()), + else: + print 'Usage: trml2pdf input.rml >output.pdf' + print 'Try \'trml2pdf --help\' for more information.' Index: openacs-4/packages/attendance/bin/trml2pdf/trml2pdf/utils.py =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attendance/bin/trml2pdf/trml2pdf/utils.py,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/attendance/bin/trml2pdf/trml2pdf/utils.py 2 Apr 2006 21:21:06 -0000 1.1 @@ -0,0 +1,65 @@ +# trml2pdf - An RML to PDF converter +# Copyright (C) 2003, Fabien Pinckaers, UCL, FSA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +import re +import reportlab + +def text_get(node): + rc = '' + for node in node.childNodes: + if node.nodeType == node.TEXT_NODE: + rc = rc + node.data + return rc + +units = [ + (re.compile('^(-?[0-9\.]+)\s*in$'), reportlab.lib.units.inch), + (re.compile('^(-?[0-9\.]+)\s*cm$'), reportlab.lib.units.cm), + (re.compile('^(-?[0-9\.]+)\s*mm$'), reportlab.lib.units.mm), + (re.compile('^(-?[0-9\.]+)\s*$'), 1) +] + +def unit_get(size): + global units + for unit in units: + res = unit[0].search(size, 0) + if res: + return unit[1]*float(res.group(1)) + return False + +def tuple_int_get(node, attr_name, default=None): + if not node.hasAttribute(attr_name): + return default + res = [int(x) for x in node.getAttribute(attr_name).split(',')] + return res + +def bool_get(value): + return (str(value)=="1") or (value.lower()=='yes') + +def attr_get(node, attrs, dict={}): + res = {} + for name in attrs: + if node.hasAttribute(name): + res[name] = unit_get(node.getAttribute(name)) + for key in dict: + if node.hasAttribute(key): + if dict[key]=='str': + res[key] = str(node.getAttribute(key)) + elif dict[key]=='bool': + res[key] = bool_get(node.getAttribute(key)) + elif dict[key]=='int': + res[key] = int(node.getAttribute(key)) + return res Index: openacs-4/packages/attendance/bin/trml2pdf/trml2pdf/utils.pyc =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attendance/bin/trml2pdf/trml2pdf/utils.pyc,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/attendance/bin/trml2pdf/trml2pdf/utils.pyc 2 Apr 2006 21:21:06 -0000 1.1 @@ -0,0 +1,13 @@ +;� +�/Dc@s�dkZdkZd�Zeid�eiiifeid�eiiifeid�eiiifeid�dfgad�Z e +d�Z d �Z hd +�Z +dS( NcCsFd}x5|iD]*}|i|ijo||i}qqW|SdS(Ns(srcsnodes +childNodessnodeTypes TEXT_NODEsdata(snodesrc((sI/var/lib/aolserver/hub/packages/attendance/bin/trml2pdf/trml2pdf/utils.pystext_gets  +s^(-?[0-9\.]+)\s*in$s^(-?[0-9\.]+)\s*cm$s^(-?[0-9\.]+)\s*mm$s^(-?[0-9\.]+)\s*$icCsUxJtD]B}|di|d�}|o|dt|id��SqqWtSdS(Nii(sunitssunitssearchssizesressfloatsgroupsFalse(ssizesressunit((sI/var/lib/aolserver/hub/packages/attendance/bin/trml2pdf/trml2pdf/utils.pysunit_get#s#cCs`|i|� o|Sngi}|i|�id�D]}|t |��q9~}|SdS(Ns,( snodes hasAttributes attr_namesdefaultsappends_[1]s getAttributessplitsxsintsres(snodes attr_namesdefaultsress_[1]sx((sI/var/lib/aolserver/hub/packages/attendance/bin/trml2pdf/trml2pdf/utils.pys +tuple_int_get+s?cCs't|�djp|i�djSdS(Ns1syes(sstrsvalueslower(svalue((sI/var/lib/aolserver/hub/packages/attendance/bin/trml2pdf/trml2pdf/utils.pysbool_get1scCs�h}x;|D]3}|i|�ot|i|��|| + + + + + + + + + + + + + + + + + + + + + + + + + @certificate@ + + + @this_certifies@ + + + @users.name@ + + + @attended@ + + + @community_name@ + + + @instructors@ + + + @date@ + + + @description_label@ @course_description@ + + + + + @signature_1;noquote@ + @signature_2;noquote@ + @signature_3;noquote@ + + + @signature_4;noquote@ + @signature_5;noquote@ + @signature_6;noquote@ + + + + + @continuing_ed_credit_info@ + + + + + \ No newline at end of file Index: openacs-4/packages/attendance/lib/attendance-portrait.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attendance/lib/attendance-portrait.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/attendance/lib/attendance-portrait.tcl 2 Apr 2006 21:21:07 -0000 1.1 @@ -0,0 +1 @@ +#placeholder \ No newline at end of file Index: openacs-4/packages/attendance/tcl/certificate-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attendance/tcl/certificate-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/attendance/tcl/certificate-procs.tcl 2 Apr 2006 21:21:07 -0000 1.1 @@ -0,0 +1,30 @@ +ad_library { + Procedures to support certificate printing +} + +namespace eval attendance_certificate {} + +ad_proc -private attendance_certificate::reportlab_available_p { +} { + Check if reportlab is avialable +} { + catch {exec python -V} python + + set python_version [lindex [split $python] 1] + set python_version [split $python_version .] + set python_path "python[join [lrange $python_version 0 1] .]" + foreach p {/usr/lib/ /usr/local/ /usr/local/lib/} { + if {[file exists ${p}${python_path}/site-packages/reportlab]} { + return 1 + } + } + + return 0 +} + +ad_proc -private attendance_certificate::trml2pdf_command { +} { + comand to pass to exec for trml2pdf +} { + +} \ No newline at end of file Index: openacs-4/packages/attendance/www/image.vuh =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attendance/www/image.vuh,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/attendance/www/image.vuh 2 Apr 2006 21:21:07 -0000 1.1 @@ -0,0 +1,6 @@ +ad_page_contract { + diplay certificate logo image +} + +set image_id [string trim [ad_conn path_info] /] +cr_write_content -item_id $image_id \ No newline at end of file Index: openacs-4/packages/attendance/www/admin/certificates.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attendance/www/admin/certificates.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/attendance/www/admin/certificates.adp 2 Apr 2006 21:21:07 -0000 1.1 @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current logo image:
Upload logo image:
+ +
+ +
+Participant Name Goes Here +
+ +
+ +
+ +
+Instructors
+ +
+  +
+Enter signature information +
+ +
+

+
\ No newline at end of file Index: openacs-4/packages/attendance/www/admin/certificates.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attendance/www/admin/certificates.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/attendance/www/admin/certificates.tcl 2 Apr 2006 21:21:07 -0000 1.1 @@ -0,0 +1,196 @@ +ad_page_contract { + Generate PDF for certificates +} -query { + community_id:integer,optional + user_id:multiple,optional + image_file:trim,optional + image_file.tmpfile:tmpfile,optional +} + +if {![attendance_certificate::reportlab_available_p]} { + ad_return_complaint 1 "ReportLab is not available. Please contact your system administrator." + ad_script_abort +} +if {![exists_and_not_null community_id]} { + set community_id [dotlrn_community::get_community_id_from_url] +} +if {![exists_and_not_null user_id]} { + ad_returnredirect -message "Please select one or more users." "summary" + ad_script_abort +} +# setup course section info + +set package_id [ad_conn package_id] +# setup multirow of user data + +ad_form -name certificates \ + -html { enctype multipart/form-data } \ + -export {user_id community_id} \ + -form { + {image_info:text(inform),optional {label "Current logo image"}} + {image_file:file(file),optional {label "Upload logo image"}} + } +set site_wide_admin_p [permission::permission_p \ + -object_id [acs_magic_object "security_context_root"] \ + -party_id [ad_conn user_id] \ + -privilege "admin"] +if {$site_wide_admin_p} { + ad_form -extend -name certificates -form { + {set_sw_submit:text(submit) {label "Make site wide default"}} + } +} +ad_form -extend -name certificates -form { + {use_sw_submit:text(submit) {label "Use site wide default"}} + {certificate:text,optional {label ""} {html {size 60}}} + {this_certifies:text,optional {label ""} {html {size 60}}} + {attended:text,optional {label ""} {html {size 60}}} + {community_name:text,optional {label ""} {html {size 60}}} + {instructors:text(textarea),optional {label ""} {html {cols 60}}} + {date:text,optional {label ""} {html {size 30}}} + {description_label:text,optional {label ""} {html {size 30}}} + {course_description:text(textarea),optional {label ""} {html {cols 60}}} + {signature_1:text(textarea),optional {label ""} {html {cols 30}}} + {signature_2:text(textarea),optional {label ""} {html {cols 30}}} + {signature_3:text(textarea),optional {label ""} {html {cols 30}}} + {signature_4:text(textarea),optional {label ""} {html {cols 30}}} + {signature_5:text(textarea),optional {label ""} {html {cols 30}}} + {signature_6:text(textarea),optional {label ""} {html {cols 30}}} + {continuing_ed_credit_info:text(textarea) {label ""} {html {cols 70 rows 6}}} +} -on_request { + set image_id [db_string get_image_info "select item_id from cr_items where parent_id=:package_id" -default ""] + if {$image_id ne ""} { + set image_info "Certificate logo image" + } else { + set image_info "No current logo image" + } + + set certificate [_ attendance.CERTIFICATE_OF_ATTENDANCE] + set this_certifies [_ attendance.This_certifies_that] + set attended [_ attendance.Attended] + set date [_ attendance.Date] + set description_label [_ attendance.Description] + set continuing_ed_credit_info [_ attendance.Continuting_Education_Credit_Information] + + set community_name [dotlrn_community::get_community_name $community_id] + set course_description [dotlrn_community::get_community_description -community_id $community_id] + set instructors [dotlrn_ecommerce::section::instructors $community_id ""] + +} -on_submit { + # setup new image if uploaded + set image_id [db_string get_image_info "select item_id from cr_items where parent_id=:package_id" -default ""] + if {[info exists image_file] \ + && [set tmp_filename [template::util::file::get_property tmp_filename $image_file]] ne ""} { + set filename [template::util::file::get_property filename $image_file] + if {$image_id ne ""} { + set image_revision_id \ + [cr_import_content \ + -storage_type file \ + -image_only \ + -title $filename \ + -package_id $package_id \ + -item_id $image_id \ + $package_id \ + $tmp_filename \ + [file size $tmp_filename] \ + [template::util::file::get_property mime_type $image_file] \ + $filename] + } else { + set image_revision_id \ + [cr_import_content \ + -storage_type file \ + -image_only \ + -title $filename \ + -package_id $package_id \ + $package_id \ + $tmp_filename \ + [file size $tmp_filename] \ + [template::util::file::get_property mime_type $image_file] \ + $filename] + } + content::item::set_live_revision -revision_id $image_revision_id + if {$image_id eq ""} { + set image_id [content::revision::item_id -revision_id $image_revision_id] + } + } + + if {[info exists use_sw_submit] && $use_sw_submit ne ""} { + if {$image_id eq ""} { + set image_id [content::item::new \ + -name [ns_mktemp XXXXXX] \ + -parent_id $package_id \ + -content_type "image"] + } + content::revision::copy \ + -revision_id [content::item::get_latest_revision \ + -item_id \ + [content::item::get_id \ + -item_path "__attendance_default_logo_image" \ + -root_folder_id [dotlrn::get_package_id]]] \ + -target_item_id $image_id + + ad_returnredirect -message "Using site wide default" [export_vars -base "certificates" {user_id community_id}] + } + + if {[info exists set_sw_submit] && $set_sw_submit ne ""} { + # handle site-wide-image button + # check permissions + permission::require_permission \ + -object_id [acs_magic_object "security_context_root"] \ + -party_id [ad_conn user_id] \ + -privilege "admin" + if {$image_id ne ""} { + # can't use content::item::copy it only allows folder parents + set site_wide_image_id \ + [content::item::new \ + -name "__attendance_default_logo_image" \ + -parent_id [dotlrn::get_package_id] \ + -content_type image] + content::revision::copy \ + -revision_id [content::item::get_live_revision \ + -item_id $image_id] \ + -target_item_id $site_wide_image_id + + } + ad_returnredirect -message "Image set as site wide default" [export_vars -base "certificates" {user_id community_id}] + + } + + set user_id [split $user_id] + template::multirow create users name + foreach user $user_id { + acs_user::get -user_id $user -array user_array + template::multirow append users $user_array(name) + } + + set vars [list community_name $community_name course_description $course_description instructors $instructors &users users certificate $certificate this_certifies $this_certifies attended $attended date $date description_label $description_label continuing_ed_credit_info $continuing_ed_credit_info] + + if {$image_id ne ""} { + set image_cr_file_path [cr_fs_path][db_string get_path "select content from cr_revisions cr, cr_items ci where ci.item_id=:image_id and ci.live_revision=cr.revision_id" -default ""] + lappend vars image_cr_file_path $image_cr_file_path + } + + foreach i {1 2 3 4 5 6} { + set signature_${i} [string map {"&" "&" "<" "<" ">" ">" "\n" {}} [set signature_${i}]] + lappend vars signature_${i} [set signature_${i}] + } + + set rml [template::adp_include /packages/attendance/lib/attendance-portrait $vars] + + set rml_tmpname [ns_mktemp /var/tmp/attendance_rml_XXXXXX] + set fd [open $rml_tmpname w] + puts $fd $rml + close $fd + set pdf_tmpname [ns_mktemp /var/tmp/attendance_pdf_XXXXXX].pdf + if {[catch {exec [acs_root_dir]/packages/attendance/bin/trml2pdf/trml2pdf/trml2pdf.py ${rml_tmpname} >> $pdf_tmpname} errmsg]} { + + ad_return_complaint 1 "$errmsg" + + } + ns_set put [ad_conn outputheaders] file-disposition "certificates.pdf" + ns_returnfile 200 application/pdf $pdf_tmpname + file delete $rml_tmpname + file delete $pdf_tmpname + ad_script_abort +} + +ad_return_template \ No newline at end of file Index: openacs-4/packages/attendance/www/admin/summary.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attendance/www/admin/summary.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/attendance/www/admin/summary.tcl 13 Mar 2006 02:17:32 -0000 1.5 +++ openacs-4/packages/attendance/www/admin/summary.tcl 2 Apr 2006 21:21:07 -0000 1.6 @@ -34,28 +34,34 @@ ad_script_abort } +if {[attendance_certificate::reportlab_available_p]} { + set bulk_actions {"Print Certificates" "certificates" "Print Course Completion Certificates"} +} else { + set bulk_actions "" +} template::list::create \ -name summary \ -multirow summary \ + -bulk_actions $bulk_actions \ -actions { "Back to Attendance Tasks" "index" "" } -key user_id \ -no_data "No summary" \ -elements { member_name { label "Student" } attendance { label "Attendance" } - rate { label "Rate" } + rate { label "Rate" display_template {
@summary.rate@
}} } set users [dotlrn_community::list_users $community_id] -template::multirow create summary member_name attendance rate +template::multirow create summary member_name attendance rate user_id foreach user $users { set user_id [ns_set get $user user_id] set attendance [db_string "count" "select count(user_id) from attendance_cal_item_map where user_id = :user_id and cal_item_id in (select cal_item_id from cal_items where on_which_calendar = :calendar_id and item_type_id = :item_type_id )" ] - if { $num_sessions == 0 } { set rate "0" } else { set rate [format "% .2f" [expr (${attendance}.0/$num_sessions)*100]] } - if {$attendance >= $min_days} { template::multirow append summary "[ns_set get $user first_names] [ns_set get $user last_name]" "$attendance of $num_sessions" "$rate %" + if { $num_sessions == 0 } { set rate "0" } else { set rate [format "% .0f" [expr (${attendance}.0/$num_sessions)*100]] } + if {$attendance >= $min_days} { template::multirow append summary "[ns_set get $user first_names] [ns_set get $user last_name]" "$attendance of $num_sessions" "$rate %" $user_id } }