42 |
|
|
43 |
[[SproutPm]] object for the database being loaded. |
[[SproutPm]] object for the database being loaded. |
44 |
|
|
|
=item source |
|
|
|
|
|
[[FigPm]] object used to access the source data. If this parameter is undefined, |
|
|
it will be created the first time the L</source> method is called. |
|
|
|
|
45 |
=item options |
=item options |
46 |
|
|
47 |
Reference to a hash of command-line options. |
Reference to a hash of command-line options. |
56 |
|
|
57 |
sub new { |
sub new { |
58 |
# Get the parameters. |
# Get the parameters. |
59 |
my ($class, $erdb, $source, $options) = @_; |
my ($class, $erdb, $options) = @_; |
60 |
# Create the table list. |
# Create the table list. |
61 |
my @tables = sort qw(Annotation IsTargetOfAnnotation SproutUser MadeAnnotation); |
my @tables = sort qw(Annotation IsTargetOfAnnotation SproutUser MadeAnnotation); |
62 |
# Create the BaseSproutLoader object. |
# Create the BaseSproutLoader object. |
63 |
my $retVal = BaseSproutLoader::new($class, $erdb, $source, $options, @tables); |
my $retVal = BaseSproutLoader::new($class, $erdb, $options, @tables); |
64 |
# Return it. |
# Return it. |
65 |
return $retVal; |
return $retVal; |
66 |
} |
} |
103 |
for my $tuple (@annotations) { |
for my $tuple (@annotations) { |
104 |
# Get the annotation tuple. |
# Get the annotation tuple. |
105 |
my ($peg, $timestamp, $user, $text) = @{$tuple}; |
my ($peg, $timestamp, $user, $text) = @{$tuple}; |
|
# Here we fix up the annotation text. "\r" is removed, |
|
|
# and "\t" and "\n" are escaped. Note we use the "gs" |
|
|
# modifier so that new-lines inside the text do not |
|
|
# stop the substitution search. |
|
|
$text =~ s/\r//gs; |
|
|
$text =~ s/\t/\\t/gs; |
|
|
$text =~ s/\n/\\n/gs; |
|
106 |
# Change assignments by the master user to FIG assignments. |
# Change assignments by the master user to FIG assignments. |
107 |
$text =~ s/Set master function/Set FIG function/s; |
$text =~ s/Set master function/Set FIG function/s; |
108 |
# Insure the time stamp is valid. |
# Insure the time stamp is valid. |
116 |
my $annotationID = "$peg:$keyStamp"; |
my $annotationID = "$peg:$keyStamp"; |
117 |
$seenTimestamps{$annotationID} = 1; |
$seenTimestamps{$annotationID} = 1; |
118 |
# Insure the user exists. |
# Insure the user exists. |
119 |
$self->PutE(SproutUser => $user, name => "SEED user"); |
$self->PutE(SproutUser => $user, description => "SEED user"); |
120 |
# Generate the annotation. |
# Generate the annotation. |
121 |
$self->putE(Annotation => $annotationID, time => $timestamp, |
$self->PutE(Annotation => $annotationID, time => $timestamp, |
122 |
annotation => $text); |
annotation => $text); |
123 |
$self->PutR(IsTargetOfAnnotation => $peg, $annotationID); |
$self->PutR(IsTargetOfAnnotation => $peg, $annotationID); |
124 |
$self->PutR(MadeAnnotation => $user, $annotationID); |
$self->PutR(MadeAnnotation => $user, $annotationID); |