echi-converter 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +12 -0
- data/config/application.yml +2 -1
- data/db/migrate/001_create_echi_records.rb +2 -2
- data/lib/echi-converter.rb +18 -2
- data/lib/echi-converter/version.rb +1 -1
- data/lib/main.rb +0 -7
- data/website/index.html +3 -4
- data/website/index.txt +1 -2
- metadata +2 -2
data/History.txt
CHANGED
@@ -3,3 +3,15 @@
|
|
3
3
|
* 1 major enhancement:
|
4
4
|
* Initial release
|
5
5
|
* Alpha phase
|
6
|
+
|
7
|
+
== 0.0.2 2007-08-01
|
8
|
+
|
9
|
+
* Minor enhancement(s):
|
10
|
+
* Added config/extended_version13.yml for ECHI version 13 support
|
11
|
+
* Added examples/schemas/oracle_echi.sql example schema
|
12
|
+
* Changed BOOLEAN fields to char(1) with Y/N possible values (FR#12741)
|
13
|
+
* Added the ability to toggle deleting or leaving the FTP files (FR#12702)
|
14
|
+
* Removed some extraneous debug info
|
15
|
+
* 1 bug fix:
|
16
|
+
* Bug # 12528 - Handle segstart/segstop dates properly
|
17
|
+
* Bug #12746 - Properly parse Bytearray for Boolean fields
|
data/config/application.yml
CHANGED
@@ -8,7 +8,8 @@ echi_password: sanfran2007!
|
|
8
8
|
echi_connect_type: ftp #only ftp supported now, possible for ssh in the future
|
9
9
|
echi_ftp_directory: /Users/ftp/anonymous
|
10
10
|
echi_ftp_retry: 3
|
11
|
-
|
11
|
+
echi_ftp_delete: Y #to not delete the files off of the FTP server set to N
|
12
|
+
echi_schema: extended_version13.yml
|
12
13
|
|
13
14
|
#Currently only ftp supported, but may want to add UUCP/Serial later
|
14
15
|
echi_xfer_type: ftp
|
@@ -11,9 +11,9 @@ class CreateEchiRecords < ActiveRecord::Migration
|
|
11
11
|
when 'datetime'
|
12
12
|
t.column field["name"], :datetime
|
13
13
|
when 'bool'
|
14
|
-
t.column field["name"], :
|
14
|
+
t.column field["name"], :string, :limit => 1
|
15
15
|
when 'bool_int'
|
16
|
-
t.column field["name"], :
|
16
|
+
t.column field["name"], :string, :limit => 1
|
17
17
|
end
|
18
18
|
end
|
19
19
|
end
|
data/lib/echi-converter.rb
CHANGED
@@ -76,6 +76,7 @@ module EchiConverter
|
|
76
76
|
case length
|
77
77
|
when 4
|
78
78
|
value = @binary_file.read(length).unpack("l").first.to_i
|
79
|
+
value = Time.at(value)
|
79
80
|
end
|
80
81
|
#Process strings
|
81
82
|
when 'str'
|
@@ -86,6 +87,12 @@ module EchiConverter
|
|
86
87
|
#Process that one wierd boolean that is actually an int, instead of a bit
|
87
88
|
when 'bool_int'
|
88
89
|
value = @binary_file.read(length).unpack("U").first.to_i
|
90
|
+
#Change the values of the field to Y/N for the varchar(1) representation of BOOLEAN
|
91
|
+
if value == 1
|
92
|
+
value = 'Y'
|
93
|
+
else
|
94
|
+
value = 'N'
|
95
|
+
end
|
89
96
|
end
|
90
97
|
return value
|
91
98
|
end
|
@@ -118,9 +125,15 @@ module EchiConverter
|
|
118
125
|
#We handle the 'boolean' fields differently, as they are all encoded as bits in a single 8-bit byte
|
119
126
|
if field["type"] == 'bool'
|
120
127
|
if bool_cnt == 0
|
121
|
-
|
128
|
+
bytearray = dump_binary field["type"], field["length"]
|
129
|
+
end
|
130
|
+
#Ensure we parse the bytearray and set the appropriate flags
|
131
|
+
if bytearray != nil
|
132
|
+
value = bytearray.slice(bool_cnt,1)
|
133
|
+
else
|
134
|
+
value = 'N'
|
122
135
|
end
|
123
|
-
|
136
|
+
@log.debug "Boolie: " + bool_cnt.to_s
|
124
137
|
bool_cnt += 1
|
125
138
|
if bool_cnt == 8
|
126
139
|
bool_cnt = 0
|
@@ -200,6 +213,9 @@ module EchiConverter
|
|
200
213
|
local_filename = @workingdirectory + '/../files/to_process/' + remote_filename
|
201
214
|
ftp_session.getbinaryfile(remote_filename, local_filename)
|
202
215
|
files_to_process[file_cnt] = remote_filename
|
216
|
+
if @config["echi_ftp_delete"] == 'Y'
|
217
|
+
ftp_session.delete(remote_filename)
|
218
|
+
end
|
203
219
|
file_cnt += 1
|
204
220
|
end
|
205
221
|
ftp_session.close
|
data/lib/main.rb
CHANGED
@@ -26,13 +26,6 @@ if @config["export_type"] == 'database' || @config["export_type"] == 'both'
|
|
26
26
|
connect_database
|
27
27
|
end
|
28
28
|
|
29
|
-
if ActiveRecord::Base.connected?
|
30
|
-
@log.info 'Connected'
|
31
|
-
else
|
32
|
-
@log.info 'Not connected'
|
33
|
-
#exit
|
34
|
-
end
|
35
|
-
|
36
29
|
@log.info "Running..."
|
37
30
|
|
38
31
|
loop do
|
data/website/index.html
CHANGED
@@ -33,7 +33,7 @@
|
|
33
33
|
<h1>ECHI Converter</h1>
|
34
34
|
<div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/echi-converter"; return false'>
|
35
35
|
<p>Get Version</p>
|
36
|
-
<a href="http://rubyforge.org/projects/echi-converter" class="numbers">0.0.
|
36
|
+
<a href="http://rubyforge.org/projects/echi-converter" class="numbers">0.0.2</a>
|
37
37
|
</div>
|
38
38
|
<h1>→ ‘echi-converter’</h1>
|
39
39
|
|
@@ -47,7 +47,7 @@
|
|
47
47
|
<h2>Status</h2>
|
48
48
|
|
49
49
|
|
50
|
-
<p>This is the initial alpha release that will under go extensive testing in the coming weeks. Therefore it is recommended to wait for version 0.0
|
50
|
+
<p>This is the initial alpha release that will under go extensive testing in the coming weeks. Therefore it is recommended to wait for version 0.1.0 before any production use.</p>
|
51
51
|
|
52
52
|
|
53
53
|
<h2>Features</h2>
|
@@ -176,7 +176,6 @@
|
|
176
176
|
|
177
177
|
<ol>
|
178
178
|
<li>‘echi-converter-create’ works fine with <span class="caps">OSX</span>/Linux, need to test validate with a Win32 platform</li>
|
179
|
-
<li>Determine what to do with the files on the <span class="caps">FTP</span> server of the Avaya <span class="caps">CMS</span>, delete them or leave them and add methods to ensure no duplication</li>
|
180
179
|
</ol>
|
181
180
|
|
182
181
|
|
@@ -206,7 +205,7 @@
|
|
206
205
|
|
207
206
|
<p>Comments are welcome. Send an email to <a href="mailto:jason@goecke.net">jason [at] goecke.net</a>.</p>
|
208
207
|
<p class="coda">
|
209
|
-
<a href="mailto:drnicwilliams@gmail.com">Dr Nic</a>,
|
208
|
+
<a href="mailto:drnicwilliams@gmail.com">Dr Nic</a>, 2nd August 2007<br>
|
210
209
|
Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
|
211
210
|
</p>
|
212
211
|
</div>
|
data/website/index.txt
CHANGED
@@ -9,7 +9,7 @@ Provides a Ruby based utility for fetching Avaya CMS / ECHI files in binary form
|
|
9
9
|
|
10
10
|
h2. Status
|
11
11
|
|
12
|
-
This is the initial alpha release that will under go extensive testing in the coming weeks. Therefore it is recommended to wait for version 0.0
|
12
|
+
This is the initial alpha release that will under go extensive testing in the coming weeks. Therefore it is recommended to wait for version 0.1.0 before any production use.
|
13
13
|
|
14
14
|
|
15
15
|
h2. Features
|
@@ -95,7 +95,6 @@ h2. ToDo
|
|
95
95
|
Items to be done to move this out of alpha stage:
|
96
96
|
|
97
97
|
# 'echi-converter-create' works fine with OSX/Linux, need to test validate with a Win32 platform
|
98
|
-
# Determine what to do with the files on the FTP server of the Avaya CMS, delete them or leave them and add methods to ensure no duplication
|
99
98
|
|
100
99
|
|
101
100
|
h2. Forum
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
|
|
3
3
|
specification_version: 1
|
4
4
|
name: echi-converter
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.0.
|
7
|
-
date: 2007-
|
6
|
+
version: 0.0.2
|
7
|
+
date: 2007-08-02 00:00:00 -07:00
|
8
8
|
summary: ECHI Conversion Utility - Provides a utility to fetch Avaya CMS / ECHI binary files, convert them and insert into a database table via ActiveRecord
|
9
9
|
require_paths:
|
10
10
|
- lib
|