]> git.evergreen-ils.org Git - working/Evergreen.git/blob - installation/edi_setup.txt
Add edi setup.
[working/Evergreen.git] / installation / edi_setup.txt
1 Setting Up EDI Acquisitions\r
2 ---------------------------\r
3 \r
4 Introduction\r
5 ~~~~~~~~~~~~\r
6 \r
7 Electronic Data Interchange (EDI) is used to exchange information between \r
8 participating vendors and Evergreen. This chapter contains technical \r
9 information for installation and configuration of the components necessary \r
10 to run EDI Acquisitions for Evergreen.\r
11 \r
12 Installation\r
13 ~~~~~~~~~~~~\r
14 \r
15 Install EDI Translator\r
16 ^^^^^^^^^^^^^^^^^^^^^^\r
17 \r
18 The EDI Translator is used to convert data into EDI format. It runs\r
19 on localhost and listens on port 9191 by default. This is controlled via \r
20 the edi_webrick.cnf file located in the edi_translator directory. It should\r
21 not be necessary to edit this configuration if you install EDI Translator \r
22 on the same server used for running Action/Triggers events.\r
23 \r
24 [NOTE]\r
25 If you are running Evergreen with a multi-server configuration, make sure\r
26 to install EDI Translator on the same server used for Action/Trigger event\r
27 generation.\r
28 \r
29 .Steps for Installing\r
30 \r
31 1. As the *opensrf* user, copy the EDI Translator code found in \r
32    Open-ILS/src/edi_translator to somewhere accessible \r
33    (for example, /openils/var/edi):\r
34 +\r
35 [source, bash]\r
36 --------------------------------------------------\r
37 cp -r Open-ILS/src/edi_translator /openils/var/edi\r
38 --------------------------------------------------\r
39 2. Navigate to where you have saved the code to begin next step:\r
40 +\r
41 [source, bash]\r
42 -------------------\r
43 cd /openils/var/edi\r
44 -------------------\r
45 3. Next, as the *root* user (or a user with sudo rights), install the \r
46    dependencies, via "install.sh". This will perform some apt-get routines \r
47    to install the code needed for the EDI translator to function. \r
48    (Note: subversion must be installed first)\r
49 +\r
50 [source, bash]\r
51 -----------\r
52 ./install.sh\r
53 -----------\r
54 4. Now, we're ready to start "edi_webrick.bash" which is the script that calls \r
55    the "Ruby" code to translate EDI. This script needs to be started in \r
56    order for EDI to function so please take appropriate measures to ensure this \r
57    starts following reboots/upgrades/etc. As the *opensrf* user:\r
58 +\r
59 [source, bash]\r
60 -----------------\r
61 ./edi_webrick.bash\r
62 -----------------\r
63 5. You can check to see if EDI translator is running.\r
64    * Using the command "ps aux | grep edi" should show you something similar \r
65      if the script is running properly:\r
66 +\r
67 [source, bash]\r
68 ------------------------------------------------------------------------------------------\r
69 root    30349  0.8  0.1  52620 10824 pts/0      S       13:04   0:00 ruby ./edi_webrick.rb\r
70 ------------------------------------------------------------------------------------------\r
71    * To shutdown EDI Translator you can use something like pkill (assuming \r
72      no other ruby processes are running on that server):\r
73 +\r
74 [source, bash]\r
75 -----------------------\r
76 kill -INT $(pgrep ruby)\r
77 -----------------------\r
78 \r
79 Install EDI Scripts\r
80 ^^^^^^^^^^^^^^^^^^^\r
81 \r
82 The EDI scripts are "edi_pusher.pl" and "edi_fetcher.pl" and are used to\r
83 "push" and "fetch" EDI messages for configured EDI accounts.\r
84 \r
85 1. As the *opensrf* user, copy edi_pusher.pl and edi_fetcher.pl from\r
86    Open-ILS/src/support-scripts into /openils/bin:\r
87 +\r
88 [source, bash]\r
89 --------------------------------------------------\r
90 cp Open-ILS/src/support-scripts/edi_pusher.pl /openils/bin\r
91 cp Open-ILS/src/support-scripts/edi_fetcher.pl /openils/bin\r
92 --------------------------------------------------\r
93 2. Setup the edi_pusher.pl and edi_fetcher.pl scripts to run as cron jobs\r
94    in order to regularly push and receive EDI messages.\r
95    * Add to the opensrf user's crontab the following entries:\r
96 +\r
97 [source, bash]\r
98 -----------------------------------------------------------------------\r
99 10 * * * * cd /openils/bin && /usr/bin/perl ./edi_pusher.pl > /dev/null\r
100 0 1 * * * cd /openils/bin && /usr/bin/perl ./edi_fetcher.pl > /dev/null\r
101 -----------------------------------------------------------------------\r
102    * The example for edi_pusher.pl sets the script to run at \r
103      10 minutes past the hour, every hour.\r
104    * The example for edi_fetcher.pl sets the script to run at\r
105      1 AM every night.\r
106 \r
107 [NOTE]\r
108 You may choose to run the EDI scripts more or less frequently based on the \r
109 necessary response times from your vendors.\r
110 \r
111 Configuration\r
112 ~~~~~~~~~~~~~\r
113 \r
114 Configuring Providers\r
115 ^^^^^^^^^^^^^^^^^^^^^\r
116 \r
117 Look in Admin > Server Administration > Acquisitions > Providers\r
118 \r
119 [options="header"]\r
120 |======================================================================================\r
121 |Column              |Description/Notes\r
122 |Provider Name       |A unique name to identify the provider\r
123 |Code                |A unique code to identify the provider\r
124 |Owner               |The org unit who will "own" the provider.\r
125 |Currency            |The currency format the provider accepts\r
126 |Active              |Whether or not the Provider is "active" for use\r
127 |Default Claim Policy|??\r
128 |EDI Default         |The default "EDI Account" to use (see EDI Accounts Configuration)\r
129 |Email               |The email address for the provider\r
130 |Fax Phone           |A fax number for the provider\r
131 |Holdings Tag        |The holdings tag to be utilized (usually 852, for Evergreen)\r
132 |Phone               |A phone number for the provider\r
133 |Prepayment Required |Whether or not prepayment is required\r
134 |SAN                 |The vendor provided, org unit specific SAN code\r
135 |URL                 |The vendor website\r
136 |======================================================================================\r
137 \r
138 Configuring EDI Accounts\r
139 ^^^^^^^^^^^^^^^^^^^^^^^^\r
140 \r
141 Look in Admin > Server Administration > Acquisitions > EDI Accounts\r
142 \r
143 [options="header"]\r
144 |===============================================================================================================\r
145 |Column               |Description/Notes\r
146 |Label                |A unique name to identify the provider\r
147 |Host                 |FTP/SFTP/SSH hostname - vendor assigned\r
148 |Username             |FTP/SFTP/SSH username - vendor assigned\r
149 |Password             |FTP/SFTP/SSH password - vendor assigned\r
150 |Account              |Vendor assigned account number associated with your organization\r
151 |Owner                |The organizational unit who owns the EDI account\r
152 |Last Activity        |The date of last activity for the account\r
153 |Provider             |This is a link to one of the "codes" in the "Providers" interface\r
154 |Path                 |The path on the vendor's server where Evergreen will send it's outgoing .epo files\r
155 |Incoming Directory   |The path on the vendor's server where "incoming" .epo files are stored\r
156 |Vendor Account Number|Vendor assigned account number.\r
157 |Vendor Assigned Code |Usually a sub-account designation. Can be used with or without the Vendor Account Number.\r
158 |===============================================================================================================\r
159 \r
160 Configuring Organizational Unit SAN code\r
161 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r
162 \r
163 Look in Admin > Server Settings > Organizational Units\r
164 \r
165 This interface allows a library to configure their SAN, alongside \r
166 their address, phone, etc.\r
167 \r
168 Troubleshooting\r
169 ~~~~~~~~~~~~~~~\r
170 \r
171 PO JEDI Template Issues\r
172 ^^^^^^^^^^^^^^^^^^^^^^^\r
173 \r
174 Some libraries may run into issues with the action/trigger (PO JEDI). \r
175 The template has to be modified to handle different vendor codes that \r
176 may be used. For instance, if you use "ingra" instead of INGRAM this \r
177 may cause a problem because they are hardcoded in the template. The \r
178 following is an example of one modification that seems to work.\r
179 \r
180 .Original template has:\r
181 \r
182 [source, bash]\r
183 ----------------------------------------------------------------------------------------------------------------------------------------------\r
184 "buyer":[\r
185     [%   IF   target.provider.edi_default.vendcode && (target.provider.code == 'BT' || target.provider.name.match('(?i)^BAKER & TAYLOR'))  -%]\r
186         {"id-qualifier": 91, "id":"[% target.ordering_agency.mailing_address.san _ ' ' _ target.provider.edi_default.vendcode %]"}\r
187     [%- ELSIF target.provider.edi_default.vendcode && target.provider.code == 'INGRAM' -%]\r
188         {"id":"[% target.ordering_agency.mailing_address.san %]"},\r
189         {"id-qualifier": 91, "id":"[% target.provider.edi_default.vendcode %]"}\r
190     [%- ELSE -%]\r
191         {"id":"[% target.ordering_agency.mailing_address.san %]"}\r
192     [%- END -%]\r
193 ],\r
194 ----------------------------------------------------------------------------------------------------------------------------------------------\r
195 \r
196 .Modified template has the following where it matches on provider SAN instead of code:\r
197 \r
198 [source, bash]\r
199 ------------------------------------------------------------------------------------------------------------------------------------------\r
200 "buyer":[\r
201     [%   IF   target.provider.edi_default.vendcode && (target.provider.san == '1556150')  -%]\r
202         {"id-qualifier": 91, "id":"[% target.ordering_agency.mailing_address.san _ ' ' _ target.provider.edi_default.vendcode %]"}\r
203         {"id-qualifier": 91, "id":"[% target.ordering_agency.mailing_address.san _ ' ' _ target.provider.edi_default.vendcode %]"}\r
204     [%- ELSIF target.provider.edi_default.vendcode && (target.provider.san == '1697978')  -%]\r
205         {"id":"[% target.ordering_agency.mailing_address.san %]"},\r
206         {"id-qualifier": 91, "id":"[% target.provider.edi_default.vendcode %]"}\r
207     [%- ELSE -%]\r
208         {"id":"[% target.ordering_agency.mailing_address.san %]"}\r
209     [%- END -%]\r
210 ],\r
211 ------------------------------------------------------------------------------------------------------------------------------------------\r
212 \r