2 # -----------------------------------------------------------------------
3 # Copyright (C) 2008 Laurentian University
4 # Dan Scott <dscott@laurentian.ca>
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License
8 # as published by the Free Software Foundation; either version 2
9 # of the License, or (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 # -----------------------------------------------------------------------
17 # calculate the proximity of organizations in the organization tree
21 use OpenSRF::AppSession;
23 use OpenILS::Utils::Fieldmapper;
24 use OpenSRF::Utils::SettingsClient;
26 die "usage: perl org_tree_proximity.pl <bootstrap_config>" unless $ARGV[0];
27 OpenSRF::System->bootstrap_client(config_file => $ARGV[0]);
29 Fieldmapper->import(IDL => OpenSRF::Utils::SettingsClient->new->config_value("IDL"));
31 my $ses = OpenSRF::AppSession->create("open-ils.storage");
32 my $result = $ses->request("open-ils.storage.actor.org_unit.refresh_proximity");
35 print "Successfully updated the organization proximity";
37 print "Failed to update the organiziation proximity";