======Post-Commit-Hook design====== A method for running a script on session data is needed on session-commit (possibly also discard?) in order to for example be able to post data to external databases when the data are commit to the pracro database. The post-commit-hook scripts are to be executed //after// the commit has been performed successfully to the database. The mechanism should be designed so that it is also able to handle journal commits to pcpraxis (currently handled in c++ via upload server) and thereby replacing part of the functionality in the existing '''' tag: . . . =====Script namespace===== What should be available to the scripts on run-time? All committed values from all template macros. Each macro should have the values stored separately so that overlapping names do not overshadow each others values. All generated resume texts must equally be available in order for the script to be able to commit data to the pcpraxis journal. The data can therefore be made available in a preloaded map hierarchy of macros/names/value in the following manner: value = vars['macro1']['name'] All resume texts are stored with the '''resume''' name making it possible iterate the macros and producing the complete journal text by simple concatenation. An important feature of this list is that the native order of the macros are the same as in the template - **NOT** sorted alphabetically or similar!. It is considered to read out value fields using a function instead in order to prevent setting the values: value = getValue('macro1', 'name') This method will also require a function to retrieve the macro list as well as field list from a specific macro since the above function also prevents macro iteration: macrolist = getMacroList() fieldlist = getFieldList('macro1') This solution is however fairly ugly. Setting the map from the first method to read-only (or const if you will) would much be prefered. =====Script placement===== A single scripting section should be stored in the template file. Scripting sections should be included from each macro file in order to the macro-specific scripts where they belong (also share if the macro is used in multiple templates).