A Utility for Fine-grained Export/Import of PEP Device Code Sets ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Index: ~~~~~~ Propose Requirements Packing List v1.04 Changes from the Previous Release Installation Operation A Word About the "Prune" Button Warranty Restrictions Known Issues and Workarounds License and Contact Details Propose: ~~~~~~~~ This program loads instances of "My Database" exported by the Phillips Pronto Edit Professional (PEP) program, version 1.1 and provides the ability to select a codeset for export as an XML file. Exported codesets may be imported to other My Database backups, effectively adding the single codeset to the user's database once the backup is "restored" inside PEP. It came about due to some dissatisfaction with the "all or nothing" export/import provided by PEP, and the consequent intellectual challenge of building something to address the perceived problem. Requirements: ~~~~~~~~~~~~~ PEP uses SQLite3 as the embedded database engine to hold code sets. SQLite3 is claimed to be the most widely used embedded SQL database tool in the world. It is an open source, freely available product with language bindings for C and Tcl/Tk. For obscure reasons, the latter was chosen to build this utility. Although RDBMan (Ron's (PEP) Database Manager) will execute on all common desktop platforms such as Win32, Linux, or even Mac OS X, this guide assumes a Win32 environment as that is the running environment for PEP itself. The program has been validated under Windows XP Pro, SP3. Users will need: ActiveState Tcl/Tl This is available free from: http://www.activestate.com/downloads/index.mhtml Select ActiveTcl This Tcl install includes both the SQLite3 and tDOM XML libraries which are used by RDBMan. Native Linux distros may not have these, but they are freely available. As the ActiveState license permits redistribution, the zip file that contained this README include the Tcl/Tk installer, but you may wish to check the URL above to see if a later version is available. Packing List v1.04: ~~~~~~~~~~~~~~~~~~~ ActiveTclx.exe ActiveState Tcl installer version "x" README.txt This file rdbman_x_x.tcl The program script (source) version "_x_x" foxtel_iq1.xml The Australian Foxtel "IQ-1" remote eva8000.xml Netgear EVA-8000 Digital Entertainer dmrbw500.xml Panasonic Blu-ray recorder sony_es777cx Sony's 400 DVD carosel (corrected) Changes from the Initial Release: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1. File browse capability added for database and XML export/import files added. 2. Paths for files are preserved between use so "Browse..." will always open the last directory you accessed. 3. Files are checked for being writable when required and some button state management has been implemented. 4. A menu bar added with alternates to the buttons and a Help item that provides info about the program and on-line access to this file. 5. Add ability to create a new, empty database suitable for PEP "restore" Installation: ~~~~~~~~~~~~~ 1. Download and install ActiveState Tcl. 2. Copy the RDBman script (RDBMan.tcl) and README.txt to some place nice. The PEP directory will be fine. They must be located in the same directory for Help to work. 3. Launch by double-clicking the RDBMan.tcl file in Windows file explorer. Operation: ~~~~~~~~~~ Before you start, export your PEP database (File|Backup My Database) to some Location. PEP flags exports as "read only" so right-click on it and change the properties to allow writing to the file. Launch the utility and type the name of the "backup" into the field at the top, or use the "Browse..." file selector to locate a PEP backup file. If you used manual entry, press the "Load" button (or press enter) to open and read the database. Using the "Browse.." will invoke this automatically. If the file can be read and is a SQLite database, the central window will display all the codesets, prefixed with a number. To export, enter the number of the code set in the field at the lower left, then provide a name for it in the center bottom field. Exports are written as XML with the extension ".xml", but you may omit this if you wish. Press "Export" to write the file. To Import, load a database (if you have not already) and enter the name of a RDBMan export in the center bottom field, then press "Import". NOTE! If a codeset of the same Brand + Type + Model exists, it will be deleted before the export one is inserted. You will be warned of this and have the chance to cancel. The import is handled as a transaction, so in theory, if something goes wrong, any incremental changes will be rolled back. To complete, go back to PEP and use the "File|Restore My Database" option to load the modified database. Check that you can see the newly imported code set. A Word About the "Prune" Button: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PEP adds brand names to the m_brands table as required when adding a code set from the factory database, but does not delete unreferenced brand names. This is not a bad thing, except the Brands pull down in PEP will show the unused names even though there are no devices available in the last pulldown. Some (me) find this confusing, so the "Prune" button will remove any orphan brand names. They will be re-added if encountered again, so no harm is done. For convenience, you can create a new, empty, PEP compatible My Database Using the File|New option, then populate it with codesets using Import. Warranty: ~~~~~~~~~ You're joking. This program is worth exactly what you paid for it, and I don't warrant it will do anything at all. It has undergone an extensive 10 minute test schedule and seemed to work for me, but I strongly suggest you keep a separate, read-only copy of your My Database so you can revert if something goes wrong. Restrictions: ~~~~~~~~~~~~~ 1. The PEP database permits code sets to contain RS232 and Ethernet codes as well as Infra-red Hex codes. These are exported if they exist, but not imported. As far as we can see, none exist. 2. No attempt is made to read the "AKA" tables for devices that form part of the My Database schema, but then, we have no evidence that these are ever used by PEP V1.1 either. 3. The database schema is proprietary and RDBMan was written by inspection of the table schema for PEP V1.1. This may change at any time. The XML export contains an attribute to identify the exports as PEP V1.1, though this is not checked during import at this time. Known Issues and Workarounds: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1. The "version" column of table m_setofcodes is NUMERIC according to the SQLite3 schema command, but factory codes contain very non-numeric values such as "1.1.2.0". We attempt to retain these, but something may break. 2. RS232 and Ethernet codes are not imported. License: ~~~~~~~~ This code is provided under a Creative Commons Attribution-Noncommercial- Share Alike 3.0 License. (See http://creativecommons.org/licenses/by-nc-sa/3.0) That is, you can do what you like with it except ask money for it, or any modified form of it, and must acknowledge the original author. Feel free to improve it and pass on your code. I can be contacted as ron@modelenginenews.org, or chernich@itee.uq.edu.au Finally: as a language, Tcl/Tk is not awful, but I don't plan to make a habit of it! Ron Chernich, Brisbane, Australia, 2008-08-21