caruby-core 1.4.1 → 1.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/History.txt CHANGED
@@ -2,3 +2,7 @@
2
2
 
3
3
  * Initial public release
4
4
 
5
+ === 1.4.2 / 2010-11-30
6
+
7
+ * Minor Migrator fixes
8
+
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2010 Oregon Health & Science University Knight Cancer Institute
1
+ Copyright (c) 2010 Oregon Health & Science University
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person
4
4
  obtaining a copy of this software and associated documentation
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  caRuby: Simplifying caBIG(TM)
2
2
  =============================
3
3
 
4
- **Home**: [http://caruby.rubyforge.com](http://caruby.rubyforge.com)
5
- **Git**: [http://github.com/caruby/core](http://github.com/caruby/core)
4
+ **Home**: [http://caruby.rubyforge.org](http://caruby.rubyforge.org)
5
+ **Git**: [http://github.com/caruby/core](http://github.com/caruby/core)
6
6
  **Author**: OHSU Knight Cancer Institute
7
7
  **Copyright**: 2010
8
8
  **License**: MIT License
@@ -35,7 +35,7 @@ is installed.
35
35
  Usage
36
36
  -----
37
37
 
38
- See the project [http://caruby.rubyforge.com](Home) Page for usage examples.
38
+ See the project [Home](http://caruby.rubyforge.org) Page for usage examples.
39
39
 
40
40
  Changelog
41
41
  ---------
@@ -46,6 +46,6 @@ Changelog
46
46
  Copyright
47
47
  ---------
48
48
 
49
- caRuby © 2010 by [Oregon Health & Science University](mailto:loneyf@ohsu.edu).
49
+ caRuby © 2010 by [Oregon Health & Science University](http://www.ohsu.edu/xd/health/services/cancer/index.cfm).
50
50
  caRuby is licensed under the MIT license. Please see the LICENSE and LEGAL
51
51
  files for more information.
@@ -42,29 +42,43 @@ module CaRuby
42
42
  #
43
43
  # @param [(<Symbol>, <String, Class>)] specs the arguments and options
44
44
  # described above
45
- # @yield [hash] the command executor
46
- # @yieldparam [{Symbol => Object}] the argument and option symbol => value hash
45
+ # @yield (see #run)
46
+ # @yieldparam (see #run)
47
47
  def initialize(specs=[], &executor)
48
- unless block_given? then
49
- raise ArgumentError.new("Command #{self.class} is missing the required execution block" )
50
- end
51
48
  @executor = executor
52
49
  @opt_specs, @arg_specs = specs.partition { |spec| spec[1][0, 1] == '-' }
53
50
  @opt_specs.concat(DEF_OPTS)
54
51
  super($0)
55
52
  end
56
53
 
57
- # Runs this command by calling the +execute+ method on the parsed command line
54
+ # Runs this command by calling the block given to this method, if provided,
55
+ # otherwise the block given to {#initialize}
58
56
  # option or argument symbol => value hash.
57
+ # @yield [hash] the command execution block
58
+ # @yieldparam [{Symbol => Object}] hash the argument and option symbol => value hash
59
59
  def run
60
60
  # the option => value hash
61
- hash = get_opts
61
+ opts = get_opts
62
62
  # this base class's options
63
- handle_caruby_options(hash)
63
+ handle_options(opts)
64
64
  # add the argument => value hash
65
- hash.merge!(get_args)
65
+ opts.merge!(get_args)
66
66
  # call the block
67
- @executor.call(hash)
67
+ block_given? ? yield(opts) : call_executor(opts)
68
+ end
69
+
70
+ private
71
+
72
+ DEF_OPTS = [
73
+ [:help, "--help", "Displays this help message"],
74
+ [:file, "--file FILE", "Configuration file containing other options"],
75
+ [:log, "--log FILE", "Log file"],
76
+ [:debug, "--debug", "Displays debug log messages"],
77
+ ]
78
+
79
+ def call_executor(opts)
80
+ if @executor.nil? then raise CommandError.new("Command #{self} does not have an execution block") end
81
+ @executor.call(opts)
68
82
  end
69
83
 
70
84
  # Collects the command line options.
@@ -104,15 +118,6 @@ module CaRuby
104
118
  end
105
119
  args
106
120
  end
107
-
108
- private
109
-
110
- DEF_OPTS = [
111
- [:help, "--help", "Displays this help message"],
112
- [:file, "--file FILE", "Configuration file containing other options"],
113
- [:log, "--log FILE", "Log file"],
114
- [:debug, "--debug", "Displays debug log messages"],
115
- ]
116
121
 
117
122
  # @param [OptionParser] parser the option parser
118
123
  # @return [{Symbol => Object}] the option => value hash
@@ -129,7 +134,7 @@ module CaRuby
129
134
  # Processes the built-in options.
130
135
  #
131
136
  # @param [{Symbol => Object}] the option => value hash
132
- def handle_caruby_options(opts)
137
+ def handle_options(opts)
133
138
  # if help, then print usage and exit
134
139
  if opts[:help] then halt end
135
140
 
@@ -139,7 +144,7 @@ module CaRuby
139
144
  if log then
140
145
  CaRuby::Log.instance.open(log, :debug => debug)
141
146
  elsif debug then
142
- CaRuby::logger.level = Logger::DEBUG
147
+ logger.level = Logger::DEBUG
143
148
  end
144
149
 
145
150
  # if there is a file option, then load additional options from the file
@@ -118,7 +118,8 @@ module CaRuby
118
118
  def changed_attributes
119
119
  if @snapshot then
120
120
  ovh = value_hash(self.class.updatable_attributes)
121
- @snapshot.diff(ovh).keys
121
+ diff = @snapshot.diff(ovh) { |attr, v, ov| Resource.value_equal?(v, ov) }
122
+ diff.keys
122
123
  else
123
124
  self.class.updatable_attributes
124
125
  end
@@ -284,6 +285,17 @@ module CaRuby
284
285
  def snapshot_equal_content?
285
286
  vh = @snapshot
286
287
  ovh = value_hash(self.class.updatable_attributes)
288
+
289
+
290
+ # KLUDGE TODO - fix
291
+ # In Galena frozen migration example, SpecimenPosition snapshot doesn't include identifier; work around this here
292
+ if ovh[:identifier] and not @snapshot[:identifier] then
293
+ @snapshot[:identifier] = ovh[:identifier]
294
+ end
295
+ # END OF KLUDGE
296
+
297
+
298
+
287
299
  if vh.size < ovh.size then
288
300
  attr, oval = ovh.detect { |a, v| not vh.has_key?(a) }
289
301
  logger.debug { "#{qp} is missing snapshot #{attr} compared to the current value #{oval.qp}." }
@@ -139,7 +139,7 @@ module CaRuby
139
139
  elsif obj.collection? then
140
140
  obj.all? { |item| exists?(item) }
141
141
  else
142
- obj.identifier or find(obj)
142
+ obj.identifier or (obj.searchable? and find(obj))
143
143
  end
144
144
  end
145
145
 
@@ -131,7 +131,7 @@ module CaRuby
131
131
  # Raises DatabaseError if obj could not be created.
132
132
  # The return value is undefined.
133
133
  def ensure_exists(obj)
134
- raise ArgumentError.new("Database ensure_exists is missing a domain object argument.") if obj.nil_or_empty?
134
+ raise ArgumentError.new("Database ensure_exists is missing a domain object argument") if obj.nil_or_empty?
135
135
  obj.enumerate { |ref| find(ref, :create) unless ref.identifier }
136
136
  end
137
137
 
@@ -77,6 +77,11 @@ module CaRuby
77
77
  def inverse
78
78
  @inv_md.to_sym if @inv_md
79
79
  end
80
+
81
+ # @return [Boolean] whether this attribute does not have an inverse
82
+ def unidirectional?
83
+ inverse.nil?
84
+ end
80
85
 
81
86
  # Creates a new declarer attribute which restricts this attribute {#type} to the given type.
82
87
  #
@@ -125,6 +125,10 @@ module CaRuby
125
125
  def logical_dependent_attributes
126
126
  @log_dep_attrs ||= dependent_attributes.compose { |attr_md| attr_md.logical? }
127
127
  end
128
+
129
+ def unidirectional_dependent_attributes
130
+ @uni_dep_attrs ||= dependent_attributes.compose { |attr_md| attr_md.unidirectional? }
131
+ end
128
132
 
129
133
  # @return [<Symbol>] the auto-generated attributes
130
134
  # @see AttributeMetadata#autogenerated?
@@ -234,17 +238,6 @@ module CaRuby
234
238
  def storable_prerequisite_attributes
235
239
  @stbl_prereq_dom_attrs ||= attribute_filter { |attr_md| attr_md.storable_prerequisite? }
236
240
  end
237
-
238
- # Returns the domain attributes which are copied to create a storable template.
239
- # The default is the {#nondomain_attributes}. An individual Resource class can
240
- # override this to provide special reference attributes which must be set in
241
- # a save operation.
242
- #
243
- # @param [Symbol] attribute the refernce attribute of the domain object being copied
244
- def storable_copy_attributes(attribute)
245
- attrs = @stbl_cp_attrs[attribute] if @stbl_cp_attrs
246
- attrs || Array::EMPTY_ARRAY
247
- end
248
241
 
249
242
  # @return [<Symbol>] the attributes which are populated from the database
250
243
  # @see AttributeMetadata#fetched?
@@ -430,13 +423,6 @@ module CaRuby
430
423
  def add_mandatory_attributes(*attributes)
431
424
  attributes.each { |attr| @local_mndty_attrs << standard_attribute(attr) }
432
425
  end
433
-
434
- # @param [Symbol] ref_attr the reference attribute of the domain object being copied
435
- # @param [<Symbol>] copy_attrs the domain attributes to copy
436
- def add_storable_copy_attributes(ref_attr, copy_attrs)
437
- @stbl_cp_attrs ||= {}
438
- @stbl_cp_attrs[ref_attr] = copy_attrs
439
- end
440
426
 
441
427
  # Marks the given attribute with flags supported by {AttributeMetadata#qualify}.
442
428
  def qualify_attribute(attribute, *flags)
@@ -483,14 +469,6 @@ module CaRuby
483
469
  attribute_metadata_hash.each_value(&block)
484
470
  end
485
471
 
486
- # Makes a new synthetic attribute for each _method_ => _original_ hash entry.
487
- #
488
- # @param (see Class#offset_attr_accessor)
489
- def offset_attribute(hash, offset=nil)
490
- offset_attr_accessor(hash, offset)
491
- hash.each { |attr, original| add_attribute(attr, attribute_metadata(original).type) }
492
- end
493
-
494
472
  # Collects the {AttributeMetadata#fetched_dependent?} and {AttributeMetadata#fetched_independent?}
495
473
  # standard domain attributes.
496
474
  #
@@ -106,7 +106,7 @@ module CaRuby
106
106
  def add_owner(klass, attribute=nil, inverse=nil)
107
107
  logger.debug { "Adding #{qp} owner #{klass.qp}..." }
108
108
  if @owner_attr_hash then
109
- raise MetadataError.new("Can't add #{qp} owner #{klass.qp} after dependencies have been accessed.")
109
+ raise MetadataError.new("Can't add #{qp} owner #{klass.qp} after dependencies have been accessed")
110
110
  end
111
111
  @local_owner_attr_hash ||= {}
112
112
  @local_owner_attr_hash[klass] = attribute ||= detect_owner_attribute(klass, inverse)
@@ -129,6 +129,14 @@ module CaRuby
129
129
  add_alias(aliaz, attribute)
130
130
  end
131
131
 
132
+ # Makes a new synthetic attribute for each _method_ => _original_ hash entry.
133
+ #
134
+ # @param (see Class#offset_attr_accessor)
135
+ def offset_attribute(hash, offset=nil)
136
+ offset_attr_accessor(hash, offset)
137
+ hash.each { |attr, original| add_attribute(attr, attribute_metadata(original).type) }
138
+ end
139
+
132
140
  # Modifies the given attribute writer method if necessary to update the given inverse_attr value.
133
141
  # This method is called on dependent and attributes qualified as inversible.
134
142
  #
@@ -102,7 +102,8 @@ module CaRuby
102
102
  # for the _attribute_ to modify.
103
103
  #
104
104
  # The migratable reference attributes consist of the non-collection
105
- # {ResourceAttributes#saved_independent_attributes} which don't already have a value.
105
+ # {ResourceAttributes#saved_independent_attributes} and
106
+ # {ResourceAttributes#unidirectional_dependent_attributes} which don't already have a value.
106
107
  # For each such migratable attribute, if there is a single instance of the attribute
107
108
  # type in the given migrated domain objects, then the attribute is set to that
108
109
  # migrated instance.
@@ -121,6 +122,10 @@ module CaRuby
121
122
  ref = migratable__reference_value(attr, migrated)
122
123
  migratable__set_reference(attr, ref, row, mth_hash) if ref
123
124
  end
125
+ self.class.unidirectional_dependent_attributes.each do |attr|
126
+ ref = migratable__reference_value(attr, migrated)
127
+ migratable__set_reference(attr, ref, row, mth_hash) if ref
128
+ end
124
129
  end
125
130
 
126
131
  private
@@ -27,11 +27,12 @@ module CaRuby
27
27
  # Creates a new Migrator.
28
28
  #
29
29
  # @param [{Symbol => Object}] opts the migration options
30
- # @option opts [String] :database target application {CaRuby::Database}
30
+ # @option opts [String] :database required application {CaRuby::Database}
31
31
  # @option opts [String] :target required target domain class
32
+ # @option opts [String] :mapping required input field => caTissue attribute mapping file
32
33
  # @option opts [String] :input required source file to migrate
33
34
  # @option opts [String] :shims optional array of shim files to load
34
- # @option opts [String] :bad write each invalid record to the given file and continue migration
35
+ # @option opts [String] :bad optional invalid record file
35
36
  # @option opts [String] :offset zero-based starting source record number to process (default 0)
36
37
  def initialize(opts)
37
38
  parse_options(opts)
@@ -57,7 +58,7 @@ module CaRuby
57
58
  # @yield [target] operation performed on the migration target
58
59
  # @yieldparam [Resource] target the migrated target domain object
59
60
  def migrate(&block)
60
- raise MigrationError.new("No migration block") unless block_given?
61
+ raise MigrationError.new("The caRuby Migrator migrate block is missing") unless block_given?
61
62
  migrate_rows(&block)
62
63
  end
63
64
 
@@ -307,7 +308,7 @@ module CaRuby
307
308
  logger.warn("Migration not performed on record #{rec_no}.")
308
309
  @loader.reject(row)
309
310
  else
310
- raise MigrationError.new("Migration not performed on record #{rec_no}.")
311
+ raise MigrationError.new("Migration not performed on record #{rec_no}")
311
312
  end
312
313
  end
313
314
  rec_cnt += 1
@@ -437,7 +438,7 @@ module CaRuby
437
438
  # @return [Resource, nil] obj if the save is successful, nil otherwise
438
439
  def save(obj, database)
439
440
  logger.debug { "Migrator saving #{obj}..." }
440
- database.create(obj)
441
+ database.save(obj)
441
442
  logger.debug { "Migrator saved #{obj}." }
442
443
  end
443
444
 
@@ -84,6 +84,11 @@ module CaRuby
84
84
  @validated = true
85
85
  self
86
86
  end
87
+
88
+ # @return [Boolean] whether this domain object has {#searchable_attributes}
89
+ def searchable?
90
+ not searchable_attributes.nil?
91
+ end
87
92
 
88
93
  # Returns the attributes to use for a search using this domain object as a template, determined
89
94
  # as follows:
@@ -338,14 +343,21 @@ module CaRuby
338
343
  match_in(others) or others.detect { |other| match_without_owner_attribute(other) }
339
344
  end
340
345
 
346
+ # Returns whether the other domain object matches this domain object on a secondary
347
+ # key without owner attributes. Defaults are added to this object in order to pick up
348
+ # potential secondary key values.
349
+ #
341
350
  # @param [<Resource>] other the domain object to match against
342
- # @return [Boolean] whether the other domain object matches this domain object on a secondary
343
- # key without owner attributes
351
+ # @return [Boolean] whether the other domain object matches this domain object on a
352
+ # secondary key without owner attributes
344
353
  def match_without_owner_attribute(other)
345
354
  oattrs = self.class.owner_attributes
346
355
  return if oattrs.empty?
356
+ # add defaults to pick up potential secondary key value
357
+ add_defaults_local
358
+ # match on the secondary key
347
359
  self.class.secondary_key_attributes.all? do |attr|
348
- matches_attribute_value?(other, attr, send(attr))
360
+ oattrs.include?(attr) or matches_attribute_value?(other, attr, send(attr))
349
361
  end
350
362
  end
351
363
 
@@ -306,7 +306,7 @@ class Visitor
306
306
  def visit(*nodes)
307
307
  if nodes.size == 1 then
308
308
  nodes = nodes.first
309
- raise ArgumentError.new("Sync visitor requires a pair of entry nodes.") unless nodes.size == 2
309
+ raise ArgumentError.new("Sync visitor requires a pair of entry nodes") unless nodes.size == 2
310
310
  end
311
311
  super(nodes)
312
312
  end
@@ -318,7 +318,7 @@ class Visitor
318
318
  def to_enum(*nodes)
319
319
  if nodes.size == 1 then
320
320
  nodes = nodes.first
321
- raise ArgumentError.new("Sync visitor requires a pair of entry nodes.") unless nodes.size == 2
321
+ raise ArgumentError.new("Sync visitor requires a pair of entry nodes") unless nodes.size == 2
322
322
  end
323
323
  super(nodes)
324
324
  end
@@ -1,3 +1,3 @@
1
1
  module CaRuby
2
- VERSION = "1.4.1"
2
+ VERSION = "1.4.2"
3
3
  end
metadata CHANGED
@@ -6,23 +6,14 @@ executables: []
6
6
 
7
7
  version: !ruby/object:Gem::Version
8
8
  prerelease: false
9
- version: 1.4.1
9
+ version: 1.4.2
10
10
  segments:
11
11
  - 1
12
12
  - 4
13
- - 1
13
+ - 2
14
14
  post_install_message:
15
- date: 2010-10-17 07:00:00 +00:00
15
+ date: 2010-11-30 08:00:00 +00:00
16
16
  files:
17
- - doc/website/index.html
18
- - doc/website/install.html
19
- - doc/website/quick_start.html
20
- - doc/website/tissue.html
21
- - doc/website/uom.html
22
- - doc/website/css/site.css
23
- - doc/website/images/avatar.png
24
- - doc/website/images/favicon.ico
25
- - doc/website/images/logo.png
26
17
  - lib/caruby.rb
27
18
  - lib/caruby/database.rb
28
19
  - lib/caruby/resource.rb
@@ -106,13 +97,13 @@ signing_key:
106
97
  cert_chain: []
107
98
 
108
99
  name: caruby-core
109
- has_rdoc: true
100
+ has_rdoc: yard
110
101
  platform: ruby
111
102
  summary: Ruby facade for caBIG applications.
112
103
  default_executable:
113
104
  bindir: bin
114
- licenses: []
115
-
105
+ licenses:
106
+ - MIT
116
107
  required_rubygems_version: !ruby/object:Gem::Requirement
117
108
  none: false
118
109
  requirements:
@@ -1 +0,0 @@
1
-
2
- ---------------------------------------------- */
3
- ---------------------------------------------- */
4
- ---------------------------------------------- */
5
- ---------------------------------------------- */
6
- ----------------------------------------------- */
Binary file
Binary file
Binary file
@@ -1,82 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
4
- <head>
5
- <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
6
- <meta name="author" content="Fred Loney, OHSU" />
7
- <meta name="keywords" content="caRuby, caBIG, caSmall, Ruby, JRuby" />
8
- <meta name="description" content="caRuby landing page." />
9
- <meta name="robots" content="all" />
10
- <title>caRuby: caBIG Simplified</title>
11
-
12
- <!-- to correct the unsightly Flash of Unstyled Content. http://www.bluerobot.com/web/css/fouc.asp -->
13
- <script type="text/javascript"></script>
14
-
15
- <style type="text/css" title="currentStyle" media="screen">
16
- @import "/css/site.css";
17
- </style>
18
- <link rel='stylesheet' href='css/site.css' type='text/css' media="screen, projection">
19
- <link rel="Shortcut Icon" href="images/favicon.ico" />
20
- </head>
21
-
22
- <body id="caruby">
23
-
24
- <div id="container">
25
- <div id="head">
26
- <h1><a href="index.html">caRuby:</a></h1>
27
- <h2><a href="http://cabig.nci.nih.gov">caBIG&reg;</a> Simplified</h2>
28
- <ul>
29
- <li><span class="currentPage">Home</li>
30
- <li><a href='quick_start.html'><em>Quick Start</em></a></li>
31
- <li><a href='http://caruby.tenderapp.com/'>Help</a></li>
32
- <li><a href='http://github.com/caruby'>Source</a></li>
33
- <li><a href='/about.html'>About</a></li>
34
- </ul>
35
- <img src="images/logo.png"/>
36
- </div>
37
-
38
- <div id="features">
39
- <h3>Features</h3>
40
- <ul>
41
- <li><a href="/api.html">API</a></li>
42
- <li><a href="/tissue.html">Tissue</a></li>
43
- <li><a href="/migrator.html">Migrator</a></li>
44
- <li><a href="/casmall.html">caSmall</a></li>
45
- </ul>
46
- </div>
47
-
48
- <div id="supportingText">
49
- <h3>Overview</h3>
50
- <p>
51
- caRuby simplifies interaction with <a href="http://cabig.nci.nih.gov">caBIG&reg;</a> application
52
- services. caRuby presents a <a href="http://jruby.org">JRuby</a> caBIG fa&ccedil;ade that
53
- supports the following uses:
54
- <ul>
55
- <li>Migration from legacy systems</li>
56
- <li>Incremental update from source applications</li>
57
- <li>Extract from a caBIG database</li>
58
- <li>Utility administrative tasks</li>
59
- <li>Workflow data transformations</li>
60
- <li>Lightweight web services</li>
61
- <li>Site-specific user interfaces</li>
62
- </ul>
63
- </p>
64
- <h3>Getting Started</h3>
65
- <p>
66
- <ol>
67
- <li>Peruse the <strong>Features</strong> to see what caRuby offers.</li>
68
- <li>Follow the <a href='/quick_start.html'>Quick Start</a> instructions to install caRuby.</li>
69
- <li>Consult the <a href='/faq.html'>FAQ</a> for usage tips.</li>
70
- <li>Visit caRuby <a href='http://caruby.tenderapp.com/'>Support</a> if you run into a problem.</li>
71
- <li><a href='/contribute.html'>Contribute</a> a solution if you're feeling ambitious!</li>
72
- <li><a href='mailto:caruby.org@gmail.com'>Let us know</a> what you think.</li>
73
- </ol>
74
- </p>
75
-
76
- <div id="footer">
77
- </div>
78
- </div>
79
- </div>
80
-
81
- </body>
82
- </html>
@@ -1,87 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
4
- <head>
5
- <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
6
- <meta name="author" content="Fred Loney, OHSU" />
7
- <meta name="keywords" content="caRuby" />
8
- <meta name="description" content="caRuby Quick Start page." />
9
- <meta name="robots" content="all" />
10
- <title>caRuby: Installation</title>
11
-
12
- <!-- to correct the unsightly Flash of Unstyled Content. http://www.bluerobot.com/web/css/fouc.asp -->
13
- <script type="text/javascript"></script>
14
-
15
- <style type="text/css" title="currentStyle" media="screen">
16
- @import "/css/site.css";
17
- </style>
18
- <link rel='stylesheet' href='css/site.css' type='text/css' media="screen, projection">
19
- <link rel="Shortcut Icon" href="images/favicon.ico" />
20
- </head>
21
-
22
- <body id="quick_start">
23
-
24
- <div id="container">
25
- <div id="head">
26
- <h1><a href="index.html">caRuby:</a></h1>
27
- <h2><a href="http://cabig.nci.nih.gov">caBIG&reg;</a> Simplified</h2>
28
- <ul>
29
- <li><a href="/index.html">Home</a></li>
30
- <li><span class="currentPage"><em>Quick Start</em></li>
31
- <li><a href='http://caruby.tenderapp.com/'>Help</a></li>
32
- <li><a href='http://github.com/caruby'>Source</a></li>
33
- <li><a href='/about.html'>About</a></li>
34
- </ul>
35
- <img src="images/logo.png"/>
36
- </div>
37
-
38
- <div id="features">
39
- <h3>Features</h3>
40
- <ul>
41
- <li><a href="/api.html">API</a></li>
42
- <li><a href="/tissue.html">Tissue</a></li>
43
- <li><a href="/migrator.html">Migrator</a></li>
44
- <li><a href="/casmall.html">caSmall</a></li>
45
- </ul>
46
- </div>
47
-
48
- <div id="supportingText">
49
- <p>
50
- Each caRuby <a href="/components.html">component</a> is packaged as a standard Ruby <a href="http://docs.rubygems.org/shelf/index">gem</a>.
51
- Once you've installed <a href="http://jruby.org">JRuby</a> and the target caBIG application API, installing a caRuby gem is done with a one-line
52
- command. caRuby runs on any on any workstation or server that supports the target caBIG application Java API.
53
- Set up a caRuby environment as follows:
54
- <ol>
55
- <li>Install the target caBIG application Java API client.
56
- Consult the caBIG application Technical Guide for details, available from the caBIG application
57
- <a href="https://cabig-kc.nci.nih.gov/MediaWiki/index.php/Knowledge_Center_Index">Knowledge Center</a>.
58
- </li>
59
- <li>Install <a href="http://jruby.org">JRuby</a>.</li>
60
- <li>Open a command console and enter the following:
61
- <pre>
62
- gem install rubygems
63
- </pre>
64
- </li>
65
- </ol>
66
- </p>
67
- <p>
68
- The preceding steps set up a standard JRuby environment. Now the desired caRuby gem is installed using the <code>gem install</code> command, e.g.:
69
- <pre>
70
- gem install caruby-tissue
71
- </pre>
72
- </p>
73
- <p>
74
- and updated using the <code>gem update</code> command, e.g.:
75
- <pre>
76
- gem update caruby-tissue
77
- </pre>
78
- </p>
79
- <p>The caRuby gem is now ready for use. Consult the gem <a href="/documentation.html">documentation</a> for usage and examples.
80
- </p>
81
- <div id="footer">
82
- </div>
83
- </div>
84
- </div>
85
-
86
- </body>
87
- </html>
@@ -1,87 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
4
- <head>
5
- <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
6
- <meta name="author" content="Fred Loney, OHSU" />
7
- <meta name="keywords" content="caRuby" />
8
- <meta name="description" content="caRuby Quick Start page." />
9
- <meta name="robots" content="all" />
10
- <title>caRuby: Quick Start</title>
11
-
12
- <!-- to correct the unsightly Flash of Unstyled Content. http://www.bluerobot.com/web/css/fouc.asp -->
13
- <script type="text/javascript"></script>
14
-
15
- <style type="text/css" title="currentStyle" media="screen">
16
- @import "/css/site.css";
17
- </style>
18
- <link rel='stylesheet' href='css/site.css' type='text/css' media="screen, projection">
19
- <link rel="Shortcut Icon" href="images/favicon.ico" />
20
- </head>
21
-
22
- <body id="quick_start">
23
-
24
- <div id="container">
25
- <div id="head">
26
- <h1><a href="index.html">caRuby:</a></h1>
27
- <h2><a href="http://cabig.nci.nih.gov">caBIG&reg;</a> Simplified</h2>
28
- <ul>
29
- <li><a href="/index.html">Home</a></li>
30
- <li><span class="currentPage"><em>Quick Start</em></li>
31
- <li><a href='http://caruby.tenderapp.com/'>Help</a></li>
32
- <li><a href='http://github.com/caruby'>Source</a></li>
33
- <li><a href='/about.html'>About</a></li>
34
- </ul>
35
- <img src="images/logo.png"/>
36
- </div>
37
-
38
- <div id="features">
39
- <h3>Features</h3>
40
- <ul>
41
- <li><a href="/api.html">API</a></li>
42
- <li><a href="/tissue.html">Tissue</a></li>
43
- <li><a href="/migrator.html">Migrator</a></li>
44
- <li><a href="/casmall.html">caSmall</a></li>
45
- </ul>
46
- </div>
47
-
48
- <div id="supportingText">
49
- <p>
50
- Each caRuby <a href="/components.html">component</a> is packaged as a standard Ruby <a href="http://docs.rubygems.org/shelf/index">gem</a>.
51
- Once you've installed <a href="http://jruby.org">JRuby</a> and the target caBIG application API, installing a caRuby gem is done with a one-line
52
- command. caRuby runs on any on any workstation or server that supports the target caBIG application Java API.
53
- Set up a caRuby environment as follows:
54
- <ol>
55
- <li>Install the target caBIG application Java API client.
56
- Consult the caBIG application Technical Guide for details, available from the caBIG application
57
- <a href="https://cabig-kc.nci.nih.gov/MediaWiki/index.php/Knowledge_Center_Index">Knowledge Center</a>.
58
- </li>
59
- <li>Install <a href="http://jruby.org">JRuby</a>.</li>
60
- <li>Open a command console and enter the following:
61
- <pre>
62
- gem install rubygems
63
- </pre>
64
- </li>
65
- </ol>
66
- </p>
67
- <p>
68
- The preceding steps set up a standard JRuby environment. Now the desired caRuby gem is installed using the <code>gem install</code> command, e.g.:
69
- <pre>
70
- gem install caruby-tissue
71
- </pre>
72
- </p>
73
- <p>
74
- and updated using the <code>gem update</code> command, e.g.:
75
- <pre>
76
- gem update caruby-tissue
77
- </pre>
78
- </p>
79
- <p>The caRuby gem is now ready for use. Consult the gem <a href="/documentation.html">documentation</a> for usage and examples.
80
- </p>
81
- <div id="footer">
82
- </div>
83
- </div>
84
- </div>
85
-
86
- </body>
87
- </html>
@@ -1,85 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
4
- <head>
5
- <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
6
- <meta name="author" content="Fred Loney, OHSU" />
7
- <meta name="keywords" content="caRuby, caTissue" />
8
- <meta name="description" content="caRuby Tissue page." />
9
- <meta name="robots" content="all" />
10
- <title>caRuby: Quick Start</title>
11
-
12
- <!-- to correct the unsightly Flash of Unstyled Content. http://www.bluerobot.com/web/css/fouc.asp -->
13
- <script type="text/javascript"></script>
14
-
15
- <style type="text/css" title="currentStyle" media="screen">
16
- @import "/css/site.css";
17
- </style>
18
- <link rel='stylesheet' href='css/site.css' type='text/css' media="screen, projection">
19
- <link rel="Shortcut Icon" href="images/favicon.ico" />
20
- </head>
21
-
22
- <body id="tissue">
23
-
24
- <div id="container">
25
- <div id="head">
26
- <h1><a href="index.html">caRuby:</a></h1>
27
- <h2>Tissue</h2>
28
- <ul>
29
- <li><a href='quick_start.html'><em>Quick Start</em></a></li>
30
- <li><a href='faq.html'>FAQ</a></li>
31
- <li><a href='http://caruby.tenderapp.com/'>Help</a></li>
32
- <li><a href='contribute.html'>Contribute</a></li>
33
- <li><a href='about.html'>About</a></li>
34
- </ul>
35
- <img src="images/logo.png"/>
36
- </div>
37
-
38
- <div id="supportingText">
39
- <p>
40
- The caRuby Tissue component applies the caRuby facade to the
41
- <a href="https://cabig-kc.nci.nih.gov/Biospecimen/KC/index.php/CaTissue_Suite">caTissue</a>
42
- application. This offers the following features:
43
- <ul>
44
- <li>flexible server interaction</li>
45
- <li>data migration and extraction</li>
46
- <li>a foundation for a <a href="casmall.html">caSmall</a> framework</li>
47
- </ul>
48
- </p>
49
- <p>
50
- Since the caRuby Tissue component is built on the caTissue API, all of the caTissue business logic applies.
51
- In addition, caRuby augments the API as follows:
52
- <ul>
53
- <li>supplies default attribute values</li>
54
- <li>validates mandatory attributes before submission to caTissue</li>
55
- <li>validates additional attributes which are permitted by the caTissue API but corrupt the database</li>
56
- <li>migrates an input CSV record to a caTissue object based on one simple configuration file</li>
57
- <li>validates migration input diagnosis and tissue site permissible values</li>
58
- <li>optionally maps diagnosis and tissue site migration input values to caTissue permissible values</li>
59
- <li>determines how to save the caTissue object based on the caTissue object model</li>
60
- <li>finds referenced objects based on secondary keys and alternative search strategies</li>
61
- <li>creates whatever needs to be created in the required order based on the data model associations</li>
62
- <li>works around caCORE and caTissue bugs and traps</li>
63
- <li>provides helper methods for common tasks, e.g. aliquoting</li>
64
- </ul>
65
- </p>
66
- <p>
67
- The sole configuration is the migration mapping file and a small caTissue server access properties file.
68
- The defaults and other metadata are defined in Ruby declarations rather than a configuration.
69
- These declarations express basic model characteristics, and are expected to be stable and sufficient for most uses.
70
- They can, however, be modified in small Ruby shim files.
71
- Special-purpose migration code can be added in the shim files as well, as described in the
72
- <a href='shims.html'>Shims</a> description.
73
- </p>
74
- <p>
75
- There is almost no class-specific caRuby business logic code similar to that found in caTissue.
76
- Rather, there are basic design patterns driven by the model characteristics defined in the Ruby declarations.
77
- </p>
78
- <div id="footer">
79
- </div>
80
- </div>
81
- </div>
82
-
83
- </body>
84
- </html>
85
-
data/doc/website/uom.html DELETED
@@ -1,10 +0,0 @@
1
- UOM implements Units of Measurement based on the
2
- <a href=http://physics.nist.gov/Pubs/SP330/sp330.pdf>International System of Units (SI)</a>.
3
- The base SI units, metric scalar factors and all possible combinations of these units are supported out of the box.
4
-
5
- Common alternative non-metric measurement systems, e.g. US Customary units, are supported with conversions between
6
- these units and the SI units. Additional units can be defined with conversion to an existing unit. UOM infers
7
- full conversion capability between units of the same dimension from the minimal number of conversion definitions.
8
-
9
- Arithmetic operations between UOM Measurement objects converts the measurement units and scalar factors as necessary,
10
- including unit products, quotients and powers of arbitrary complexity.