From 07a6cf05aaae80e27bdeb872f4712855d7c9e0eb Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Thu, 20 Dec 2012 11:36:42 -0500 Subject: [PATCH] Update "Adding a data source to the reporter" docs A little bit of formatting clean-up, a little bit of extra information. Signed-off-by: Dan Scott --- docs/reports/reporter_add_data_source.txt | 86 +++++++++++++++-------- 1 file changed, 58 insertions(+), 28 deletions(-) diff --git a/docs/reports/reporter_add_data_source.txt b/docs/reports/reporter_add_data_source.txt index b9d3a71242..df97c45133 100644 --- a/docs/reports/reporter_add_data_source.txt +++ b/docs/reports/reporter_add_data_source.txt @@ -93,32 +93,34 @@ u.expire_date, ms_balance_owed from actor.usr u join permission.grp_tree grp - on (u.profile = grp.id and (grp.parent = 2 or grp.name = 'patron')) + on (u.profile = grp.id and (grp.parent = 2 or grp.name = 'patron')) join actor.org_unit hl on (u.home_ou = hl.id) left join money.open_usr_summary ms - on (ms.usr = u.id) + on (ms.usr = u.id) left join actor.stat_cat_entry_usr_map rl - on (u.id = rl.target_usr and rl.stat_cat = 4) + on (u.id = rl.target_usr and rl.stat_cat = 4) left join actor.stat_cat_entry_usr_map bt - on (u.id = bt.target_usr and bt.stat_cat = 3) + on (u.id = bt.target_usr and bt.stat_cat = 3) left join actor.stat_cat_entry_usr_map gr - on (u.id = gr.target_usr and gr.stat_cat = 2) + on (u.id = gr.target_usr and gr.stat_cat = 2) left join actor.stat_cat_entry_usr_map gr - on (u.id = gr.target_usr and gr.stat_cat = 2) + on (u.id = gr.target_usr and gr.stat_cat = 2) left join actor.stat_cat_entry_usr_map ag - on (u.id = ag.target_usr and ag.stat_cat = 1) + on (u.id = ag.target_usr and ag.stat_cat = 1) where u.active = 't' and u.deleted <> 't'; ----------- Add a new class to fm_IDL.xml for your data source --------------------------------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Once you have your data source, the next step is to add that data source as a new class in _fm_IDL.xml_. indexterm:[fm_IDL.xml] +indexterm:[fieldmapper] +indexterm:[report sources] -You will need to add the following attributes for the class definition +You will need to add the following attributes for the class definition: * *id*. You should follow a consistent naming convention for your class names that won't create conflicts in the future with any standard classes added in @@ -139,7 +141,7 @@ based on a PostgreSQL view or table, add the table name here. You don't need this attribute is your class is an IDL-only view. For each column in the view or query output, add field element and set the -following attributes. The fields should be wrapped with _ _ +following attributes. The fields should be wrapped with _ _: * *reporter:label*. This is the name that appears in the Evergreen reporter. * *name*. This should match the column name in the view or query output. @@ -147,7 +149,8 @@ following attributes. The fields should be wrapped with _ _ interval, float, text, timestamp, or link) For each linking field, add a link element with the following attributes. The -elements should be wrapped with _ _ +elements should be wrapped with _ _: + * *field* (should match field.name) * *reltype* (“has_a”, “might_have”, or “has_many”) * *map* (“”) @@ -172,16 +175,16 @@ reporter:label="Patron Statistics" reporter:core="true"> + reporter:datatype="link" /> + reporter:datatype="text" /> + reporter:datatype="timestamp" /> + reporter:datatype="timestamp" /> + reporter:datatype="money" /> @@ -200,40 +203,67 @@ copy of you local class definitions so that you can reapply the changes to _fm_IDL.xml_ after Evergreen upgrades. Restart the affected services to see the new data source in the reporter ------------------------------------------------------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The following steps are needed to for Evergreen to recognize the changes to _fm_IDL.xml_ -. Copy the updated _fm_IDL.xml_ Update _/openils/conf/fm_IDL.xml_ to -_/openils/var/web/reports/fm_IDL.xml_ +. Copy the updated _fm_IDL.xml_ into place: ++ +------------- +cp fm_IDL.xml /openils/conf/. +------------- ++ +. (Optional) Make the reporter version of fm_IDL.xml match the core version. +Evergreen systems supporting only one interface language will normally find +that _/openils/var/web/reports/fm_IDL.xml_ is a symbolic link pointing to +_/openils/conf/fm_IDL.xml_, so no action will be required. However, systems +supporting multiple interfaces will have a different version of _fm_IDL.xml_ in +the _/openils/var/web/reports_ directory. The _right_ way to update this is to +go through the Evergreen internationalization build process to create the +entity form of _fm_IDL.xml_ and the updated _fm_IDL.dtd_ files for each +supported language. However, that is outside the scope of this document. If you +can accept the reporter interface supporting only one language, then you can +simply copy your updated version of _fm_IDL.xml_ into the +_/openils/var/web/reports_ directory: + ------------- -cp _/openils/conf/fm_IDL.xml /openils/var/web/reports/fm_IDL.xml +cp /openils/conf/fm_IDL.xml /openils/var/web/reports/. ------------- + -. Run Autogen to to update the Javascript versions of the fieldmapper definitions. +. As the *opensrf* user, run Autogen to to update the Javascript versions of +the fieldmapper definitions. + ------------- /openils/bin/autogen.sh ------------- + -. Restart C services +. As the *opensrf* user, restart Perl services: ++ +------------- +osrf_ctl.sh -l -a restart_perl +------------- ++ +. As the *opensrf* user, restart C services: + ------------- osrf_ctl.sh -l -a restart_c ------------- + -. Restart the Evergreen reporter. You may need to modify this command depending -on your system configuration and pid path +. As the *root* user, restart the Apache web server: ++ +------------- +service apache2 restart +------------- ++ +. As the *opensrf* user, restart the Evergreen reporter. You may need to modify +this command depending on your system configuration and PID path: + ------------ opensrf-perl.pl -l -action restart -service open-ils.reporter \ -config /openils/conf/opensrf_core.xml -pid-dir /openils/var/run ------------ + -. Restart the Evergreen application or _use Admin --> For Developers --> Clear -Cache_ - - +. Restart the Evergreen staff client, or use *Admin --> For Developers --> + Clear Cache* -- 2.43.2