You can subscribe to this list here.
2009 |
Jan
|
Feb
|
Mar
(1) |
Apr
(14) |
May
(36) |
Jun
(148) |
Jul
(33) |
Aug
(2) |
Sep
(17) |
Oct
(42) |
Nov
(137) |
Dec
(88) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2010 |
Jan
(89) |
Feb
(80) |
Mar
(217) |
Apr
(76) |
May
(5) |
Jun
(39) |
Jul
(35) |
Aug
(4) |
Sep
(7) |
Oct
(14) |
Nov
(12) |
Dec
(9) |
2011 |
Jan
(6) |
Feb
(4) |
Mar
(11) |
Apr
(55) |
May
(90) |
Jun
(39) |
Jul
(15) |
Aug
(15) |
Sep
(23) |
Oct
(12) |
Nov
(17) |
Dec
(20) |
2012 |
Jan
(22) |
Feb
(63) |
Mar
|
Apr
(1) |
May
(6) |
Jun
(3) |
Jul
(1) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
(3) |
Feb
(6) |
Mar
|
Apr
|
May
|
Jun
(4) |
Jul
(1) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
(7) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <rv...@us...> - 2009-11-23 14:10:59
|
Revision: 292 http://treebase.svn.sourceforge.net/treebase/?rev=292&view=rev Author: rvos Date: 2009-11-23 14:10:51 +0000 (Mon, 23 Nov 2009) Log Message: ----------- Added POD Modified Paths: -------------- trunk/treebase-core/src/main/perl/lib/CIPRES/TreeBase/TreeBaseObjects.pm Modified: trunk/treebase-core/src/main/perl/lib/CIPRES/TreeBase/TreeBaseObjects.pm =================================================================== --- trunk/treebase-core/src/main/perl/lib/CIPRES/TreeBase/TreeBaseObjects.pm 2009-11-23 14:07:38 UTC (rev 291) +++ trunk/treebase-core/src/main/perl/lib/CIPRES/TreeBase/TreeBaseObjects.pm 2009-11-23 14:10:51 UTC (rev 292) @@ -2,11 +2,6 @@ require CIPRES::TreeBase::VeryBadORM; -sub CIPRES::TreeBase::TreeBaseObjects::set_db_connection { - my $class = shift; - CIPRES::TreeBase::VeryBadORM->set_db_connection(@_); -} - =head1 NAME CIPRES::TreeBase::TreeBaseObjects @@ -23,6 +18,23 @@ =back +=head1 PACKAGE METHODS + +=over + +=item set_db_connection() + +Aliases to CIPRES::TreeBase::VeryBadORM::set_db_connection + +=back + +=cut + +sub CIPRES::TreeBase::TreeBaseObjects::set_db_connection { + my $class = shift; + CIPRES::TreeBase::VeryBadORM->set_db_connection(@_); +} + =head1 OBJECTS =cut This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2009-11-23 14:07:46
|
Revision: 291 http://treebase.svn.sourceforge.net/treebase/?rev=291&view=rev Author: rvos Date: 2009-11-23 14:07:38 +0000 (Mon, 23 Nov 2009) Log Message: ----------- Adding CPAN-style supporting scripts (Makefile.PL, test suite) Added Paths: ----------- trunk/treebase-core/src/main/perl/Makefile.PL trunk/treebase-core/src/main/perl/t/ trunk/treebase-core/src/main/perl/t/pod-coverage.t trunk/treebase-core/src/main/perl/t/pod.t Added: trunk/treebase-core/src/main/perl/Makefile.PL =================================================================== --- trunk/treebase-core/src/main/perl/Makefile.PL (rev 0) +++ trunk/treebase-core/src/main/perl/Makefile.PL 2009-11-23 14:07:38 UTC (rev 291) @@ -0,0 +1,11 @@ +use ExtUtils::MakeMaker; + +WriteMakefile( + 'NAME' => 'CIPRES-TreeBase', + 'AUTHOR' => 'Rutger Vos <rut...@gm...>', + 'PL_FILES' => {}, + 'EXE_FILES' => [], + 'VERSION_FROM' => 'lib/CIPRES/TreeBase/TreeBaseObjects.pm', + 'clean' => {}, + 'dist' => { 'COMPRESS' => 'gzip -9f', 'SUFFIX' => 'gz', }, +); Added: trunk/treebase-core/src/main/perl/t/pod-coverage.t =================================================================== --- trunk/treebase-core/src/main/perl/t/pod-coverage.t (rev 0) +++ trunk/treebase-core/src/main/perl/t/pod-coverage.t 2009-11-23 14:07:38 UTC (rev 291) @@ -0,0 +1,5 @@ +use Test::More; +eval "use Test::Pod::Coverage"; +plan skip_all => "Test::Pod::Coverage required for testing POD coverage" + if $@; +all_pod_coverage_ok(); \ No newline at end of file Added: trunk/treebase-core/src/main/perl/t/pod.t =================================================================== --- trunk/treebase-core/src/main/perl/t/pod.t (rev 0) +++ trunk/treebase-core/src/main/perl/t/pod.t 2009-11-23 14:07:38 UTC (rev 291) @@ -0,0 +1,4 @@ +use Test::More; +eval "use Test::Pod"; +plan skip_all => "Test::Pod required for testing POD" if $@; +all_pod_files_ok(); \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2009-11-23 14:07:18
|
Revision: 290 http://treebase.svn.sourceforge.net/treebase/?rev=290&view=rev Author: rvos Date: 2009-11-23 14:07:09 +0000 (Mon, 23 Nov 2009) Log Message: ----------- Added POD to TreeBaseObjects Modified Paths: -------------- trunk/treebase-core/src/main/perl/lib/CIPRES/TreeBase/TreeBaseObjects.pm Modified: trunk/treebase-core/src/main/perl/lib/CIPRES/TreeBase/TreeBaseObjects.pm =================================================================== --- trunk/treebase-core/src/main/perl/lib/CIPRES/TreeBase/TreeBaseObjects.pm 2009-11-19 20:29:36 UTC (rev 289) +++ trunk/treebase-core/src/main/perl/lib/CIPRES/TreeBase/TreeBaseObjects.pm 2009-11-23 14:07:09 UTC (rev 290) @@ -1,3 +1,5 @@ +$CIPRES::TreeBase::VERSION=0.1; + require CIPRES::TreeBase::VeryBadORM; sub CIPRES::TreeBase::TreeBaseObjects::set_db_connection { @@ -5,17 +7,56 @@ CIPRES::TreeBase::VeryBadORM->set_db_connection(@_); } +=head1 NAME + +CIPRES::TreeBase::TreeBaseObjects + +=head1 DESCRIPTION + +=over + +=item %r_attr + +=item %r2_attr + +=item %subobject + +=back + +=head1 OBJECTS + +=cut + #################################################################################################### package Analysis; CIPRES::TreeBase::VeryBadORM->register(); our %r_attr = ( 'analysissteps' => 'AnalysisStep' ); +=head2 Analysis + +Object representation of a TreeBASE analysis, which is referred to by +L<AnalysisStep> objects. + +=over + +=item to_str() + +Stringification method for invocant analysis. + +=cut + sub to_str { my $self = shift(); my $s = $self->SUPER::to_str(); return $self->name ? qq{$s "} . $self->name . qq{"} : $s; } +=item recurse() + +Traverses all associated analysis steps and dumps them. + +=cut + sub recurse { my $self = shift(); for my $as ($self->analysissteps) { @@ -23,14 +64,27 @@ } } +=item analysis_steps() + +Convenience alias for analysisteps(). + +=cut + # Convenience alias sub analysis_steps { return $_[0]->analysissteps; } +=item analyzed_matrices() + +Getter for retrieving all analyzed matrices (input and output) +from all analysis steps associated with the invocant analysis. + +=cut + sub analyzed_matrices { my $self = shift; - unless ($self->{analyzed_matrices}) { + unless ($self->{'analyzed_matrices'}) { my @matrices; for my $as ($self->analysis_steps) { for my $ad ($as->analyzeddata) { @@ -38,14 +92,21 @@ push @matrices, $matrix if defined $matrix; } } - $self->{analyzed_matrices} = \@matrices; + $self->{'analyzed_matrices'} = \@matrices; } - return @{$self->{analyzed_matrices}}; + return @{$self->{'analyzed_matrices'}}; } +=item analyzed_trees() + +Getter for retrieving all analyzed trees (input and output) +from all analysis steps associated with the invocant analysis. + +=cut + sub analyzed_trees { my $self = shift; - unless ($self->{analyzed_trees}) { + unless ($self->{'analyzed_trees'}) { my @trees; for my $as ($self->analysis_steps) { for my $ad ($as->analyzeddata) { @@ -53,16 +114,31 @@ push @trees, $tree if defined $tree; } } - $self->{analyzed_trees} = \@trees; + $self->{'analyzed_trees'} = \@trees; } - return @{$self->{analyzed_trees}}; + return @{$self->{'analyzed_trees'}}; } +=item analyzed_data() + +Getter for retrieving all analyzed data (matrices and trees, input and output) +from all analysis steps associated with the invocant analysis. + +=cut + sub analyzed_data { my $self = shift; return $self->analyzed_matrices, $self->analyzed_trees; } +=item consistent() + +Consistency check on the invocant analysis. An analysis is considered consistent +if all analysis steps have one or more analyzed trees, one or more analyzed matrices and one +or more taxonlabel sets. + +=cut + sub consistent { my $self = shift; my %attr = @_; @@ -100,17 +176,40 @@ return $OK; } +=back + +=cut + #################################################################################################### package AnalysisStep; CIPRES::TreeBase::VeryBadORM->register(); -our %r_attr = qw(analyzeddata AnalyzedData); +our %r_attr = ('analyzeddata' => 'AnalyzedData'); +=head2 AnalysisStep + +Object representation of a TreeBASE analysis step, which is referred to by +L<AnalyzedData> objects. + +=over + +=item to_str() + +Stringification method for invocant analysis step. + +=cut + sub to_str { my $self = shift(); my $s = $self->SUPER::to_str(); return $self->name ? qq{$s "} . $self->name . qq{"} : $s; } +=item recurse() + +Stringification method for invocant analysis step. + +=cut + sub recurse { my $self = shift(); for my $ad ($self->analyzeddata) { @@ -118,10 +217,28 @@ } } +=back + +=cut + #################################################################################################### package AnalyzedData; CIPRES::TreeBase::VeryBadORM->register(); +=head2 AnalyzedData + +Object representation of a TreeBASE analyzed data object, which is +essentially a wrapper around either a matrix or a tree (accessed +internally in that order). + +=over + +=item recurse() + +Traverses internal data object, which is either a matrix or a tree. + +=cut + sub recurse { my $self = shift(); if (my $matrix = $self->matrix) { @@ -131,11 +248,21 @@ } } +=item tree() + +Alias method for phylotree() + +=cut + # Convenience alias sub tree { return $_[0]->phylotree; } +=back + +=cut + #################################################################################################### package Citation; our %r2_attr = ( @@ -143,6 +270,20 @@ ); CIPRES::TreeBase::VeryBadORM->register(); +=head2 Citation + +Object representation of a TreeBASE citation object, which are associated +with L<Person> objects through the citation_author intersection table. These +Person objects are retrieved by accessing the Citation::authors() method. + +=over + +=item recurse() + +Traverses the associated authors (Person objects) and dumps them. + +=cut + sub recurse { my $self = shift(); for my $author ($self->authors) { @@ -150,6 +291,13 @@ } } +=item consistent() + +A Citation is considered consistent if it contains one or more +authors with no duplicates. + +=cut + sub consistent { my $self = shift(); my %attr = @_; @@ -157,7 +305,7 @@ my $OK = 1; for my $author ($self->authors) { if (++$author_count{$author->id} == 2) { - push @{$attr{warnings}}, + push @{$attr{'warnings'}}, "Citation " . $self->id . " contains author " @@ -169,6 +317,10 @@ return $OK; } +=back + +=cut + #################################################################################################### package Matrix; CIPRES::TreeBase::VeryBadORM->register(); @@ -177,12 +329,31 @@ 'columns' => 'MatrixColumn', ); +=head2 Matrix + +Object representation of a TreeBASE character state matrix object. +This object is referenced by L<MatrixRow> and L<MatrixColumn> objects. + +=over + +=item to_str() + +Stringification method for the invocant matrix. + +=cut + sub to_str { my $self = shift(); my $s = $self->SUPER::to_str(); return "$s (was " . $self->tb_matrixid . " " . $self->title . ")"; } +=item recurse() + +Traverses associated matrix kind and matrix rows and dumps them. + +=cut + sub recurse { my $self = shift(); my $mk = $self->matrixkind; @@ -192,21 +363,42 @@ } } +=item taxonlabels() + +Returns taxon labels associated with the matrix rows. + +=cut + sub taxonlabels { my $self = shift; - unless ($self->{taxonlabels}) { - $self->{taxonlabels} = [ map { $_->taxonlabel } $self->rows ]; + unless ($self->{'taxonlabels'}) { + $self->{'taxonlabels'} = [ map { $_->taxonlabel } $self->rows ]; } - return @{$self->{taxonlabels}}; + return @{$self->{'taxonlabels'}}; } +=item nexusfile() + +Returns NexusFile object from which the invocant matrix was parsed. + +=cut + sub nexusfile { my $self = shift; - return $self->{nexusfile} if $self->{nexusfile}; + return $self->{'nexusfile'} if $self->{'nexusfile'}; my $nfn = $self->nexusfilename; - return $self->{nexusfile} = NexusFile->new_by_name($nfn); + return $self->{'nexusfile'} = NexusFile->new_by_name($nfn); } +=item consistent() + +Consistency check on the invocant matrix object. A Matrix is considered consistent +if: the ntax field matches the row count and the matrix has more than 0 rows, nchar +matches the column count and the matrix has more than 0 columns, and if the matrix +kind and matrix title are defined. + +=cut + sub consistent { my $self = shift; my %attr = @_; @@ -216,22 +408,22 @@ my $rows = $self->rows; unless ($rows == $self->ntax) { - push @{$attr{warnings}}, "Matrix " . $self->id . " has $rows rows but ntax=" . $self->ntax; - $OK = 0; + push @{$attr{warnings}}, "Matrix " . $self->id . " has $rows rows but ntax=" . $self->ntax; + $OK = 0; } if ($rows == 0) { - push @{$attr{warnings}}, "Matrix " . $self->id . " has no rows\n"; - $OK = 0; + push @{$attr{warnings}}, "Matrix " . $self->id . " has no rows\n"; + $OK = 0; } my $columns = $self->columns; unless ($columns == $self->nchar) { - push @{$attr{warnings}}, "Matrix " . $self->id . " has $columns rows but nchar=" . $self->nchar; - $OK = 0; + push @{$attr{warnings}}, "Matrix " . $self->id . " has $columns rows but nchar=" . $self->nchar; + $OK = 0; } if ($columns == 0) { - push @{$attr{warnings}}, "Matrix " . $self->id . " has no columns\n"; - $OK = 0; + push @{$attr{warnings}}, "Matrix " . $self->id . " has no columns\n"; + $OK = 0; } unless (defined $self->matrixkind) { @@ -247,42 +439,115 @@ return $OK; } +=back + +=cut + #################################################################################################### package MatrixColumn; CIPRES::TreeBase::VeryBadORM->register(); +=head2 MatrixColumn + +Object representation of a TreeBASE character state matrix column object. + +=cut + + #################################################################################################### package MatrixKind; CIPRES::TreeBase::VeryBadORM->register(); +=head2 MatrixKind + +Object representation of a TreeBASE character state matrix kind object. + +=over + +=item to_str() + +Stringification method for the invocant matrix kind. + +=cut + sub to_str { my $self = shift(); my $s = $self->SUPER::to_str(); return $self->description ? qq{$s "} . $self->description . qq{"} : $s; } +=back + +=cut + #################################################################################################### package MatrixRow; CIPRES::TreeBase::VeryBadORM->register(); + +=head2 MatrixRow + +Object representation of a TreeBASE character state matrix row object. + +=over + +=item recurse() + +Fetches the associated taxon label object and dumps it. + +=cut + sub recurse { my $self = shift(); my $tl = $self->taxonlabel; $tl->dump(@_) if $tl; } +=item consistent() + +Consistency check on a matrix row object. A row is considered consistent +if the matrix it belong to is consistent. + +=cut + sub consistent { my $self = shift; my %attr = @_; - return $attr{attr_check}->($self, 'Matrix', \%attr); + return $attr{'attr_check'}->($self, 'Matrix', \%attr); } +=back + +=cut + #################################################################################################### package NexusFile; CIPRES::TreeBase::VeryBadORM->register(); our %subobject = ('study' => 'Study'); +=head2 NexusFile + +Object representation of a stored TreeBASE nexus file. NexusFile +objects refer to L<Study> objects. + +=over + +=item table() + +Helper method to specify the table in which the nexus file data +is stored. + +=cut + sub table { "Study_NexusFile" } # XXX check to see if this casing makes sense +=item new_by_name() + +Constructor for nexus file objects. This is a special constructor that +exists because nexus data is stored in large blobs which we don't want +to retrieve by default. + +=cut + sub new_by_name { my ($class, $filename, $study_id) = @_; my $self = bless { @@ -294,10 +559,28 @@ return $self; } +=back + +=cut + #################################################################################################### package Person; CIPRES::TreeBase::VeryBadORM->register(); +=head2 Person + +Object representation of a TreeBASE person. TreeBASE persons include +authors and editors. + +=over + +=item to_str() + +Stringification method. A string representation of a Person includes +first name, middle name, last name and email address. + +=cut + sub to_str { my $self = shift; my $s = $self->SUPER::to_str(); @@ -309,12 +592,34 @@ return $s; } +=back + +=cut + #################################################################################################### package PhyloTree; CIPRES::TreeBase::VeryBadORM->register(); -our %subobject = ('rootnode' => 'PhyloTreeNode', 'treetype' => 'TreeType'); +our %subobject = ( + 'rootnode' => 'PhyloTreeNode', + 'treetype' => 'TreeType' +); our %r_attr = ('treeblock' => 'TreeBlock'); +=head2 PhyloTree + +Object representation of a TreeBASE phylotree. TreeBASE phylotrees contain +at least a reference to a L<PhyloTreeNode> root and a L<TreeType>. They also +have a back-reference to a L<TreeBlock> object. + +=over + +=item to_str() + +Stringification method. A string representation of a PhyloTree includes +its TreeBASE1 identifier, its title and its label. + +=cut + sub to_str { my $self = shift; my $s = $self->SUPER::to_str(@_); @@ -327,6 +632,13 @@ return $s; } +=item recurse() + +Traverses the associated L<TreeType> and L<PhyloTreeNode> root objects +and dumps them. + +=cut + sub recurse { my $self = shift(); @@ -337,6 +649,14 @@ $root->dump(@_) if $root; } +=item consistent() + +Consistency check on invocant PhyloTree object. A PhyloTree is considered consistent if: +its quality, kind and type fields are defined, its label and title are defined, its +ntax field and tip count match and it has more than 0 tips. + +=cut + sub consistent { my $self = shift; my %attr = @_; @@ -355,18 +675,18 @@ for my $a (qw(label title)) { unless (defined $self->$a) { - push @{$attr{warnings}}, "PhyloTree " . $self->id . " has null $a"; + push @{$attr{'warnings'}}, "PhyloTree " . $self->id . " has null $a"; $OK = 0; } } my $leaves = $self->leaves; unless ($leaves == $self->ntax) { - push @{$attr{warnings}}, "PhyloTree " . $self->id . " has $leaves leaf nodes but ntax=" . $self->ntax; + push @{$attr{'warnings'}}, "PhyloTree " . $self->id . " has $leaves leaf nodes but ntax=" . $self->ntax; $OK = 0; } if ($leaves == 0) { - push @{$attr{warnings}}, "PhyloTree " . $self->id . " has no nodes"; + push @{$attr{'warnings'}}, "PhyloTree " . $self->id . " has no nodes"; $OK = 0; } @@ -375,9 +695,15 @@ return $OK; } +=item nodes() + +Returns all nodes (internal and terminal) associated with the invocant tree. + +=cut + sub nodes { my $self = shift; - return @{$self->{nodes}} if $self->{nodes}; + return @{$self->{'nodes'}} if $self->{'nodes'}; my @nodeset = (); my @queue = $self->rootnode; while (@queue) { @@ -385,32 +711,53 @@ push @nodeset, $cur; push @queue, $cur->children; } - $self->{nodes} = \@nodeset; + $self->{'nodes'} = \@nodeset; return @nodeset; } +=item leaves() + +Returns terminal nodes associated with the invocant tree. + +=cut + sub leaves { my $self = shift; return grep {$_->is_leaf} $self->nodes; } +=item taxonlabels() +Returns the L<TaxonLabel> objects associated with the nodes in the invocant tree. + +=cut + sub taxonlabels { my $self = shift; - unless ($self->{taxonlabels}) { - $self->{taxonlabels} = [ map { $_->taxonlabel } $self->nodes ]; + unless ($self->{'taxonlabels'}) { + $self->{'taxonlabels'} = [ map { $_->taxonlabel } $self->nodes ]; } - return @{$self->{taxonlabels}}; + return @{$self->{'taxonlabels'}}; } +=item nexusfile() + +Returns the L<NexusFile> object from which the invocant PhyloTree object was parsed. + +=cut + sub nexusfile { my $self = shift; - return $self->{nexusfile} if $self->{nexusfile}; + return $self->{'nexusfile'} if $self->{'nexusfile'}; my $nfn = $self->nexusfilename; my $sid = $self->study->id; - return $self->{nexusfile} = NexusFile->new_by_name($nfn, $sid); + return $self->{'nexusfile'} = NexusFile->new_by_name($nfn, $sid); } +=back + +=cut + #################################################################################################### package PhyloTreeNode; CIPRES::TreeBase::VeryBadORM->register(); @@ -420,6 +767,21 @@ 'parent' => 'PhyloTreeNode', ); +=head2 PhyloTreeNode + +Object representation of a TreeBASE phylotreenode. TreeBASE phylotreenodes contain +references to child, sibling and parent nodes any of which can be undefined, depending +on where the invocant node is in the containing tree topology. + +=over + +=item to_str() + +Stringification method. A string representation of a PhyloTreeNode includes +its name. + +=cut + sub to_str { my $self = shift; my $s = $self->SUPER::to_str(@_); @@ -428,6 +790,14 @@ return $s; } +=item children() + +Returns all immediate descendants of the invocant node. These are fetched +by following the reference to the first child (as per the database's foreign +key) and its siblings (also as per the databases foreign keys for those). + +=cut + sub children { my $self = shift; my @children; @@ -437,11 +807,25 @@ return @children; } +=item is_leaf() + +Returns whether the invocant node is a terminal node. It decides this +by checking whether it has a child reference and negating that. + +=cut + sub is_leaf { my $self = shift; return not defined $self->child; } +=item recurse() + +Traverses the associated L<TaxonLabel> object and child objects and +dumps them. + +=cut + sub recurse { my $self = shift; my %attr = @_; @@ -452,25 +836,43 @@ } } +=item consistent() + +Consistency check on the invocant PhyloTreeNode object. The invocant is considered consistent if: +it is associated with a L<PhyloTree> object, if the associated child node refers to the correct +parent node and if the node, if terminal, has a valid L<TaxonLabel> reference. + +=cut + sub consistent { my $self = shift; my %attr = @_; - my $W = $attr{warnings}; + my $W = $attr{'warnings'}; my $OK = 1; - $OK &&= $attr{attr_check}->($self, 'PhyloTree', \%attr); + $OK &&= $attr{'attr_check'}->($self, 'PhyloTree', \%attr); for my $child ($self->children) { - $OK &&= $attr{attr_check}->($child, 'parent', $self->id, $W); + $OK &&= $attr{'attr_check'}->($child, 'parent', $self->id, $W); } if ($self->is_leaf && ! defined($self->taxonlabel)) { - push @{$attr{warnings}}, "PhyloTreeNode " . $self->id . " is a leaf but has no TaxonLabel"; + push @{$attr{'warnings'}}, "PhyloTreeNode " . $self->id . " is a leaf but has no TaxonLabel"; $OK = 0; } - return $OK; } +=item is_nested() + +Returns that the invocant is nested. Perhaps this means it refers to other instances of the same +class? + +=cut + sub is_nested { 1 } +=back + +=cut + #################################################################################################### package Study; CIPRES::TreeBase::VeryBadORM->register(); @@ -484,6 +886,21 @@ our %r2_attr = ('nexusfiles' => ['study_nexusfile', 'NexusFile']); +=head2 Study + +Object representation of a TreeBASE study. Studies contain references to L<Analysis>, L<Matrix>, +L<PhyloTree>, L<Submission> and L<TaxonLabelSet> objects. L<NexusFile> objects contain +backreferences to study objects. + +=over + +=item to_str() + +Stringification method. A string representation of a Study includes +its citation title (truncated to 30 characters) and its name and title. + +=cut + sub to_str { my $self = shift(); my $name = $self->name; @@ -497,6 +914,13 @@ return join " ", @items; } +=item recurse() + +Traverse associated L<Citation>, L<Analysis>, L<Matrix>, L<PhyloTree>, L<Submission> and +L<TaxonLabelSet> objects and dumps them all. + +=cut + sub recurse { my $self = shift(); @@ -520,20 +944,32 @@ } } +=item analysis_taxonlabels() + +Returns all taxon labels associated with all analyzed data. + +=cut + sub analysis_taxonlabels { my $self = shift; - unless (defined $self->{analysis_taxonlabels}) { + unless (defined $self->{'analysis_taxonlabels'}) { my %tl; for my $ad ($self->analyzed_data) { for my $tl ($ad->taxonlabels) { $tl{$tl->id} = $tl; } } - $self->{analysis_taxonlabels} = [ values %tl ]; + $self->{'analysis_taxonlabels'} = [ values %tl ]; } - return @{$self->{analysis_taxonlabels}}; + return @{$self->{'analysis_taxonlabels'}}; } +=item analysis_steps() + +Returns all associated analysis steps. + +=cut + sub analysis_steps { my $self = shift; my @as; @@ -543,6 +979,12 @@ return @as; } +=item analyzed_matrices() + +Returns all associated analyzed matrices. + +=cut + sub analyzed_matrices { my $self = shift; unless ($self->{analyzed_matrices}) { @@ -552,6 +994,12 @@ return @{$self->{analyzed_matrices}}; } +=item analyzed_trees() + +Returns all associated analyzed trees. + +=cut + sub analyzed_trees { my $self = shift; unless ($self->{analyzed_trees}) { @@ -561,17 +1009,39 @@ return @{$self->{analyzed_trees}}; } +=item analyzed_data() + +Returns all associated analyzed data. + +=cut + sub analyzed_data { my $self = shift; my @ad = ($self->analyzed_matrices, $self->analyzed_trees); return @ad; } +=item tls_taxonlabels() + +Returns all taxon labels from all associated taxon label sets. + +=cut + sub tls_taxonlabels { my $self = shift; map { $_->taxonlabels } $self->taxonlabelsets; } +=item consistent() + +Runs consistency check on the invocant Study. A study is considered consistent if: there is +exactly one associated submission and that submission refers back to the invocant study, the +associated trees and matrices are consistent, the associated taxon labels refer back to the +invocant study, there are no multiple taxon labels with the same name, and the study contains +a consistent citation. + +=cut + sub consistent { my $self = shift; my %attr = @_; @@ -585,8 +1055,8 @@ { my @submissions = $self->submissions; if (@submissions != 1) { - push @{$attr{warnings}}, "Study " . $self->id . " in " . @submissions . " submissions.\n"; - $OK = 0; + push @{$attr{warnings}}, "Study " . $self->id . " in " . @submissions . " submissions.\n"; + $OK = 0; } if (@submissions) { @@ -647,6 +1117,12 @@ return $OK; } +=item get_r2_subobject_no_check() + +Overrides SUPER::get_r2_subobject_no_check() to deal with nexus files. + +=cut + # Override this for nexusfiles, which are a little odd sub get_r2_subobject_no_check { my ($self, $attr) = @_; @@ -667,6 +1143,10 @@ } } +=back + +=cut + #################################################################################################### package Submission; CIPRES::TreeBase::VeryBadORM->register(); @@ -676,6 +1156,19 @@ matrices => ['sub_matrix', 'Matrix'], ); +=head2 Submission + +Object representation of a TreeBASE submission. Submissions contain references to L<TreeBlock>, +L<TaxonLabel> and L<Matrix> objects. + +=over + +=item recurse() + +Traverses associated study object and tree blocks and dumps them. + +=cut + sub recurse { my $self = shift(); my $study = $self->study; @@ -685,6 +1178,14 @@ } } +=item consistent() + +Consistency check for invocant submission object. A submission is considered consistent if: +associated matrices, trees and taxon labels refer to the right L<Study> object and refer back to the invocant +submission. + +=cut + sub consistent { my $OK = 1; my $self = shift; @@ -733,28 +1234,67 @@ return $OK; } +=back + +=cut + #################################################################################################### package Taxon; CIPRES::TreeBase::VeryBadORM->register(); +=head2 Taxon + +Object representation of a TreeBASE Taxon. + +=over + +=item to_str() + +Stringification method. A string representation of a Taxon includes its name. + +=cut + sub to_str { my $self = shift(); my $s = $self->SUPER::to_str(); return "$s " . $self->name; } +=back + +=cut + #################################################################################################### package TaxonLabel; CIPRES::TreeBase::VeryBadORM->register(); our %r_attr = ('treenodes' => 'PhyloTreeNode', 'rows' => 'MatrixRow'); our %r2_attr = ('taxonlabelsets' => ['taxonlabelset_taxonlabel', 'TaxonLabelSet']); +=head2 TaxonLabel + +Object representation of a TreeBASE TaxonLabel, which is referenced by L<PhyloTreeNode> and +L<MatrixRow> objects, and referred back to by the taxonlabelsets table. + +=over + +=item to_str() + +Stringification method. A string representation of a TaxonLabel includes its taxonlabel field. + +=cut + sub to_str { my $self = shift(); my $s = $self->SUPER::to_str(); return "$s " . $self->taxonlabel; } +=item recurse() + +Traverses and dumps associated L<TaxonVariant> object. + +=cut + sub recurse { my $self = shift(); my $tv = $self->taxonvariant; @@ -770,18 +1310,45 @@ # } } +=item consistent() + +Consistency check on invocant TaxonLabel object, which is considered consistent if the associated +L<Study> object is. + +=cut + sub consistent { my $self = shift; my %attr = @_; - return $attr{attr_check}->($self, 'Study', \%attr); + return $attr{'attr_check'}->($self, 'Study', \%attr); } +=back + +=cut + #################################################################################################### package TaxonLabelSet; CIPRES::TreeBase::VeryBadORM->register(); -our %r_attr = ('treeblocks' => 'TreeBlock', 'matrices' => 'Matrix'); +our %r_attr = ( + 'treeblocks' => 'TreeBlock', + 'matrices' => 'Matrix' +); our %r2_attr = ('taxonlabels' => ['taxonlabelset_taxonlabel', 'TaxonLabel']); +=head2 TaxonLabelSet + +Object representation of a TreeBASE taxonlabelset, which is referenced by L<TreeBlock> and +L<Matrix> objects, and referred back to by the taxonlabel table. + +=over + +=item to_str() + +Stringification method. A string representation of a TaxonLabelSet includes its title. + +=cut + sub to_str { my $self = shift; my $s = $self->SUPER::to_str(@_); @@ -790,6 +1357,12 @@ return $s; } +=item recurse() + +Travers associated L<TaxonLabel> objects and dumps them. + +=cut + sub recurse { my $self = shift(); for my $tl ($self->taxonlabels) { @@ -797,51 +1370,75 @@ } } +=item consistent() + +Consistency check on invocant TaxonLabelSet object, which is considered consistent if: the +associated study, matrices and tree blocks are consistent. + +=cut + sub consistent { my $self = shift; my %attr = @_; my $OK = 1; - $OK &&= $attr{attr_check}->($self, 'Study', \%attr); + $OK &&= $attr{'attr_check'}->($self, 'Study', \%attr); my $sid = $self->study_id; my %tl_id; for my $tl ($self->taxonlabels) { $tl_id{$tl->id} = 1; - $OK &&= $attr{attr_check}->($tl, 'Study', $sid, $attr{warnings}); + $OK &&= $attr{'attr_check'}->($tl, 'Study', $sid, $attr{'warnings'}); } for my $matrix ($self->matrices) { - $OK &&= $attr{attr_check}->($matrix, 'Study', $sid, $attr{warnings}); + $OK &&= $attr{'attr_check'}->($matrix, 'Study', $sid, $attr{'warnings'}); for my $row ($matrix->rows) { my $tl = $row->taxonlabel; next unless defined $tl; next if exists $tl_id{$tl->id}; - push @{$attr{warnings}}, "matrix " . $matrix->id . " references TLS " . $self->id . ", but its row " . $row->id . " contains TL " . $tl->id . " which is not in the set.\n"; + push @{$attr{'warnings'}}, "matrix " . $matrix->id . " references TLS " . $self->id . ", but its row " . $row->id . " contains TL " . $tl->id . " which is not in the set.\n"; $OK = 0; - } + } } for my $tb ($self->treeblocks) { - for my $tree ($tb->trees) { - $OK &&= $attr{attr_check}->($tree, 'Study', $sid, $attr{warnings}); - for my $node ($tree->nodes) { - my $tl = $node->taxonlabel; - next unless defined $tl; - next if exists $tl_id{$tl->id}; - push @{$attr{warnings}}, "tree " . $tree->id . " references TLS " . $self->id .", but its node " . $node->id . " contains TL " . $tl->id . " which is not in the set.\n"; - $OK = 0; + for my $tree ($tb->trees) { + $OK &&= $attr{'attr_check'}->($tree, 'Study', $sid, $attr{'warnings'}); + for my $node ($tree->nodes) { + my $tl = $node->taxonlabel; + next unless defined $tl; + next if exists $tl_id{$tl->id}; + push @{$attr{'warnings'}}, "tree " . $tree->id . " references TLS " . $self->id .", but its node " . $node->id . " contains TL " . $tl->id . " which is not in the set.\n"; + $OK = 0; } - } + } } return $OK; } +=back + +=cut + #################################################################################################### package TaxonVariant; CIPRES::TreeBase::VeryBadORM->register(); +=head2 TaxonVariant + +Object representation of a TreeBASE taxonvariant. + +=over + +=item to_str() + +Stringification method. A string representation of a TaxonVariant includes its name, full name and +lexical qualifier. + +=cut + sub to_str { my $self = shift(); my $s = $self->SUPER::to_str(); @@ -854,19 +1451,42 @@ $str; } +=item recurse() + +Traverses associated L<Taxon> object and dumps it. + +=cut + sub recurse { my $self = shift(); my $t = $self->taxon; $t->dump(@_) if $t; } +=back + +=cut + #################################################################################################### package TreeBlock; CIPRES::TreeBase::VeryBadORM->register(); our %r2_attr = ('submissions' => ['sub_treeblock', 'Submission']); our %r_attr = ('trees' => 'PhyloTree'); +=head2 TreeBlock +Object representation of a TreeBASE treeblock. A tree block is associated with a L<Submission> +through the sub_treeblock intersection table. L<PhyloTree> objects refer back to treeblock +objects. + +=over + +=item to_str() + +Stringification method. A string representation of a TaxonVariant includes its title. + +=cut + sub to_str { my $self = shift; my $s = $self->SUPER::to_str(@_); @@ -875,6 +1495,12 @@ return $s; } +=item recurse() + +Traverses associated taxon label sets, submissions and trees and dumps them. + +=cut + sub recurse { my $self = shift(); my %attr = @_; @@ -891,23 +1517,54 @@ } } +=item consistent() + +Consistency check on the invocant tree block, which is considered consistent if its associated +submission and taxon label set are. + +=cut + sub consistent { my $self = shift; my %attr = @_; my $OK = 1; - $OK &&= $attr{attr_check}->($self, 'Submissions', \%attr); - $OK &&= $attr{attr_check}->($self, 'TaxonLabelSet', \%attr); + $OK &&= $attr{'attr_check'}->($self, 'Submissions', \%attr); + $OK &&= $attr{'attr_check'}->($self, 'TaxonLabelSet', \%attr); return $OK; } +=back + +=cut + #################################################################################################### package TreeType; CIPRES::TreeBase::VeryBadORM->register(); +=head2 TreeType + +Object representation of a TreeBASE TreeType. + +=over + +=item to_str() + +Stringification method. A string representation of a TreeType includes its description. + +=cut + sub to_str { my $self = shift(); my $s = $self->SUPER::to_str(); return $self->description ? qq{$s "} . $self->description . qq{"} : $s; } +=back + +=head1 SEE ALSO + +L<VeryBadORM> + +=cut + 1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: SourceForge.net <no...@so...> - 2009-11-21 09:53:17
|
Bugs item #2897306, was opened at 2009-11-13 15:41 Message generated for change (Comment added) made by rvos You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1126676&aid=2897306&group_id=248804 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: data Group: None >Status: Closed Priority: 9 Private: No Submitted By: William Piel (sfrgpiel) Assigned to: Rutger Vos (rvos) Summary: Some Corrupted Trees Initial Comment: This is based on the treebasedb-dev.nescent.org build. Under the trees tab, search for "..2" and "NTAX". The result is 86 trees with only 1 taxon each -- basically, these are corrupted or missing trees. Not sure how best to fix these, but I can generate a new set of trees from TreeBASE1 if I can be given a list of *legacy* tree ids. ---------------------------------------------------------------------- >Comment By: Rutger Vos (rvos) Date: 2009-11-21 09:53 Message: Trees are uploaded. Example: http://treebasedb-dev.nescent.org:6666/treebase-web/search/study/trees.html?id=98 ---------------------------------------------------------------------- Comment By: Rutger Vos (rvos) Date: 2009-11-21 09:53 Message: Your bug has been resolved. Thanks for the report. ---------------------------------------------------------------------- Comment By: Rutger Vos (rvos) Date: 2009-11-20 16:47 Message: Also see #2692361 ---------------------------------------------------------------------- Comment By: Rutger Vos (rvos) Date: 2009-11-20 16:47 Message: Thanks for reporting this bug. We'll look into it as soon as possible. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1126676&aid=2897306&group_id=248804 |
From: SourceForge.net <no...@so...> - 2009-11-20 16:47:27
|
Bugs item #2897306, was opened at 2009-11-13 15:41 Message generated for change (Comment added) made by rvos You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1126676&aid=2897306&group_id=248804 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: data Group: None Status: Open Priority: 9 Private: No Submitted By: William Piel (sfrgpiel) >Assigned to: Rutger Vos (rvos) Summary: Some Corrupted Trees Initial Comment: This is based on the treebasedb-dev.nescent.org build. Under the trees tab, search for "..2" and "NTAX". The result is 86 trees with only 1 taxon each -- basically, these are corrupted or missing trees. Not sure how best to fix these, but I can generate a new set of trees from TreeBASE1 if I can be given a list of *legacy* tree ids. ---------------------------------------------------------------------- >Comment By: Rutger Vos (rvos) Date: 2009-11-20 16:47 Message: Also see #2692361 ---------------------------------------------------------------------- Comment By: Rutger Vos (rvos) Date: 2009-11-20 16:47 Message: Thanks for reporting this bug. We'll look into it as soon as possible. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1126676&aid=2897306&group_id=248804 |
From: SourceForge.net <no...@so...> - 2009-11-20 16:46:42
|
Bugs item #2692361, was opened at 2009-03-18 18:27 Message generated for change (Settings changed) made by rvos You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1126676&aid=2692361&group_id=248804 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: data Group: None >Status: Closed Priority: 9 Private: No Submitted By: Mark Dominus (mjdominus) Assigned to: Rutger Vos (rvos) Summary: Botched tree loading Initial Comment: Study #235 has 7 trees; each has only one phylotreenode. This is wrong. The trees are defined in the dump file treebase-data/tree/A160c2x6x96c17c39c42.tre, attached with this bug report. They are supposed to have around 13 leaf nodes each. The (erroneous) versions in the database now are as follows: | | | |-PhyloTree #4347 (T373c2x6x96c17c40c07) | | | |-PhyloTree #4348 (T374c2x6x96c17c40c12) | | | |-PhyloTree #4349 (T375c2x6x96c17c40c15) | | | |-PhyloTree #4350 (T376c2x6x96c17c40c18) | | | |-PhyloTree #4351 (T377c2x6x96c17c40c22) | | | |-PhyloTree #4352 (T378c2x6x96c17c40c25) | | | |-PhyloTree #4353 (T379c2x6x96c17c40c28) There may be many other such erroneous trees in the database; a query finds 86 trees with NTAX < 2. Figure out what went wrong. Reload the broken trees and reattach them to the studies. ---------------------------------------------------------------------- >Comment By: Rutger Vos (rvos) Date: 2009-11-20 16:46 Message: I now consider this as being subsumed by issue #2897306 so I am closing this one and close the other one once the trees are re-loaded. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1126676&aid=2692361&group_id=248804 |
From: SourceForge.net <no...@so...> - 2009-11-20 16:17:16
|
Bugs item #2810770, was opened at 2009-06-23 08:16 Message generated for change (Comment added) made by rvos You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1126676&aid=2810770&group_id=248804 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: data Group: None Status: Open >Priority: 7 Private: No Submitted By: Blaise Li (blaiseli) >Assigned to: Rutger Vos (rvos) Summary: Uncaught Exception for a tree Initial Comment: I get an uncaught exception when I try to see this: http://8ball.sdsc.edu:6666/treebase-web/search/downloadATree.html?id=2345&treeid=1652 (This link was given by a research on trees having 4 taxa. Tree title is Perralderia) ---------------------------------------------------------------------- >Comment By: Rutger Vos (rvos) Date: 2009-11-20 16:17 Message: I am still working on this. Initially it seemed like this had to do with other bug reports about incomplete tree loading, but it turns out that's not the case for this report. It looks like there is something idiosyncratic going on with this particular record. The tree structure itself looks sane in the database. ---------------------------------------------------------------------- Comment By: Rutger Vos (rvos) Date: 2009-11-20 16:17 Message: Thanks for reporting this bug. We'll look into it as soon as possible. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1126676&aid=2810770&group_id=248804 |
From: <yo...@us...> - 2009-11-19 20:29:43
|
Revision: 289 http://treebase.svn.sourceforge.net/treebase/?rev=289&view=rev Author: youjun Date: 2009-11-19 20:29:36 +0000 (Thu, 19 Nov 2009) Log Message: ----------- modify the formats of output, add null parameter check Modified Paths: -------------- trunk/oai-pmh_data_provider/data_provider_web/src/main/java/org/treebase/oai/web/controller/OAIPMHController.java trunk/oai-pmh_data_provider/data_provider_web/src/main/java/org/treebase/oai/web/validator/OAIPMHValidator.java trunk/oai-pmh_data_provider/data_provider_web/src/main/webapp/WEB-INF/vmFiles/head.vm trunk/oai-pmh_data_provider/data_provider_web/src/main/webapp/WEB-INF/vmFiles/oai_dc_record.vm trunk/oai-pmh_data_provider/data_provider_web/src/test/java/org/treebase/oai/web/controller/OAIPMHControllerTest.java Modified: trunk/oai-pmh_data_provider/data_provider_web/src/main/java/org/treebase/oai/web/controller/OAIPMHController.java =================================================================== --- trunk/oai-pmh_data_provider/data_provider_web/src/main/java/org/treebase/oai/web/controller/OAIPMHController.java 2009-11-19 15:16:50 UTC (rev 288) +++ trunk/oai-pmh_data_provider/data_provider_web/src/main/java/org/treebase/oai/web/controller/OAIPMHController.java 2009-11-19 20:29:36 UTC (rev 289) @@ -221,10 +221,12 @@ String publisher=null; //System.out.println("ctype: "+citation.getCitationType()); + try{ if(citation.getCitationType().toUpperCase().contains("BOOK")) - publisher=((BookCitation)citation).getPublisher(); + publisher=((BookCitation)citation).getPublisher(); else publisher=((ArticleCitation)citation).getJournal(); - + + List<Person> authors=citation.getAuthors(); @@ -242,6 +244,10 @@ map.put("identifier", "treebase.org/study/TB2:s"+study.getId()); map.put("datestamp", study.getReleaseDate()); + }catch(NullPointerException e){ + //study 253 citation= null, data should be fixed + System.err.println("study "+study.getId()+ + " citation= "+e.getMessage());} //map.put("type", "text"); //map.put("language", "en"); Modified: trunk/oai-pmh_data_provider/data_provider_web/src/main/java/org/treebase/oai/web/validator/OAIPMHValidator.java =================================================================== --- trunk/oai-pmh_data_provider/data_provider_web/src/main/java/org/treebase/oai/web/validator/OAIPMHValidator.java 2009-11-19 15:16:50 UTC (rev 288) +++ trunk/oai-pmh_data_provider/data_provider_web/src/main/java/org/treebase/oai/web/validator/OAIPMHValidator.java 2009-11-19 20:29:36 UTC (rev 289) @@ -19,16 +19,22 @@ String fPrefix = command.getMetadataPrefix(); ValidationUtils.rejectIfEmptyOrWhitespace(pError, "verb", "empyt verb"); - if(verb=="GetRecord") + + + if(verb!=null && verb.equals("GetRecord")) ValidationUtils.rejectIfEmptyOrWhitespace(pError, "identifier", "empyt id"); // check format prefix - - if(verb=="GetRecord"||verb=="ListIdentifiers"||verb=="ListRecords"){ - ValidationUtils.rejectIfEmptyOrWhitespace(pError, "metadataPrefix", "cannotDisseminateFormat"); - if(fPrefix!="oai_dc"&fPrefix!="dryad") - pError.rejectValue("metadataPrefix","cannotDisseminateFormat"); - } - } + if(verb!=null){ + if(verb.equals("GetRecord")||verb.equals("ListIdentifiers")||verb.equals("ListRecords")){ + + ValidationUtils.rejectIfEmptyOrWhitespace(pError, "metadataPrefix", "cannotDisseminateFormat"); + + if(fPrefix!=null) + if(!(fPrefix.equals("oai_dc")||fPrefix.equals("dryad"))) + pError.rejectValue("metadataPrefix","cannotDisseminateFormat"); + } + } + } } Modified: trunk/oai-pmh_data_provider/data_provider_web/src/main/webapp/WEB-INF/vmFiles/head.vm =================================================================== --- trunk/oai-pmh_data_provider/data_provider_web/src/main/webapp/WEB-INF/vmFiles/head.vm 2009-11-19 15:16:50 UTC (rev 288) +++ trunk/oai-pmh_data_provider/data_provider_web/src/main/webapp/WEB-INF/vmFiles/head.vm 2009-11-19 20:29:36 UTC (rev 289) @@ -11,4 +11,4 @@ #if($!requestParams.until)until="$!requestParams.until" #end #if($!requestParams.resumptionToken)resumptionToken="$!requestParams.resumptionToken" #end #if($!requestParams.set)set="$!requestParams.set" #end> -$!identify.BaseURL</request> \ No newline at end of file +$!identify.BaseURL</request> Modified: trunk/oai-pmh_data_provider/data_provider_web/src/main/webapp/WEB-INF/vmFiles/oai_dc_record.vm =================================================================== --- trunk/oai-pmh_data_provider/data_provider_web/src/main/webapp/WEB-INF/vmFiles/oai_dc_record.vm 2009-11-19 15:16:50 UTC (rev 288) +++ trunk/oai-pmh_data_provider/data_provider_web/src/main/webapp/WEB-INF/vmFiles/oai_dc_record.vm 2009-11-19 20:29:36 UTC (rev 289) @@ -61,4 +61,4 @@ #end </oai_dc:dc> </metadata> -</record> \ No newline at end of file +</record> Modified: trunk/oai-pmh_data_provider/data_provider_web/src/test/java/org/treebase/oai/web/controller/OAIPMHControllerTest.java =================================================================== --- trunk/oai-pmh_data_provider/data_provider_web/src/test/java/org/treebase/oai/web/controller/OAIPMHControllerTest.java 2009-11-19 15:16:50 UTC (rev 288) +++ trunk/oai-pmh_data_provider/data_provider_web/src/test/java/org/treebase/oai/web/controller/OAIPMHControllerTest.java 2009-11-19 20:29:36 UTC (rev 289) @@ -64,7 +64,7 @@ StringWriter writer=null; Template t=null; try { - t = ve.getTemplate("\\"+mav.getViewName()); + t = ve.getTemplate("\\"+mav.getViewName()+".vm"); VelocityContext context = new VelocityContext(); context.put("model", mav.getModel()); @@ -159,8 +159,8 @@ OAIPMHCommand params=new OAIPMHCommand(); params.setVerb("ListRecords"); - params.setFrom("2005-11-15T06:16:15Z"); - params.setUntil("2006-05-15T06:16:15Z"); + //params.setFrom("2005-11-15T06:16:15Z"); + params.setUntil("1996-11-04T06:16:15Z"); params.setMetadataPrefix("oai_dc"); Map model=new HashMap(); model.put("identify",identify ); @@ -199,40 +199,40 @@ System.out.println(mav.getViewName()+" " +mav.getModel().get("error_code") +": "+mav.getModel().get("error")); - this.assertEquals("error.vm", mav.getViewName()); + this.assertEquals("error", mav.getViewName()); params.setVerb("Identify"); mav=call(params); - this.assertEquals("Identify.vm", mav.getViewName()); + this.assertEquals("Identify", mav.getViewName()); params.setVerb("ListSets"); mav=call(params); System.out.println(mav.getViewName()+" " +mav.getModel().get("error_code") +": "+mav.getModel().get("error")); - this.assertEquals("error.vm", mav.getViewName()); + this.assertEquals("error", mav.getViewName()); params.setVerb("ListMetadataFormats"); mav=call(params); - this.assertEquals("ListMetadataFormats.vm", mav.getViewName()); + this.assertEquals("ListMetadataFormats", mav.getViewName()); params.setVerb("GetRecord"); params.setIdentifier("treebase.org/study/TB2:s1225"); params.setMetadataPrefix("oai_dc"); mav=call(params); - this.assertEquals("GetRecord.vm", mav.getViewName()); + this.assertEquals("GetRecord", mav.getViewName()); params.setVerb("ListIdentifiers"); params.setFrom("2005-11-15T06:16:15Z"); params.setUntil("2006-05-15T06:16:15Z"); mav=call(params); - this.assertEquals("oai_dc_ListIdentifiers.vm", mav.getViewName()); + this.assertEquals("oai_dc_ListIdentifiers", mav.getViewName()); params.setVerb("ListRecords"); params.setFrom("2005-11-15T06:16:15Z"); params.setUntil("2006-05-15T06:16:15Z"); mav=call(params); - this.assertEquals("ListRecords.vm", mav.getViewName()); + this.assertEquals("ListRecords", mav.getViewName()); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2009-11-19 15:17:01
|
Revision: 288 http://treebase.svn.sourceforge.net/treebase/?rev=288&view=rev Author: rvos Date: 2009-11-19 15:16:50 +0000 (Thu, 19 Nov 2009) Log Message: ----------- Porting from DB2 to PostgreSQL Modified Paths: -------------- trunk/treebase-core/src/main/perl/check/check trunk/treebase-core/src/main/perl/lib/CIPRES/TreeBase/TreeBaseObjects.pm trunk/treebase-core/src/main/perl/lib/CIPRES/TreeBase/VeryBadORM.pm Modified: trunk/treebase-core/src/main/perl/check/check =================================================================== --- trunk/treebase-core/src/main/perl/check/check 2009-11-19 10:51:20 UTC (rev 287) +++ trunk/treebase-core/src/main/perl/check/check 2009-11-19 15:16:50 UTC (rev 288) @@ -5,6 +5,8 @@ use Getopt::Std; use Getopt::Long; use Pod::Usage; +use Data::Dumper; +use Devel::StackTrace; # XXX only for developing, delete me use Carp 'croak'; our $indent = 0; @@ -67,25 +69,27 @@ $| = 1; $TERMINAL = 1; } -my %pod_usage_args = ( -exitval => 1, -verbose => 1 ); +my %pod_usage_args = ( '-exitval' => 1, '-verbose' => 1 ); my %opt; + +# processing command line arguments getopts('chasd:p:RC:X', \%opt) or pod2usage(%pod_usage_args); -if ($opt{X}) { list_known_classes(); } -if ($opt{h}) { pod2usage(%pod_usage_args) } -if ($opt{R}) { - if ($opt{d}) { pod2usage(%pod_usage_args, "-msg" => "-R and -d are incompatible") } - $opt{d} = 0; +if ($opt{'X'}) { list_known_classes(); } +if ($opt{'h'}) { pod2usage(%pod_usage_args) } +if ($opt{'R'}) { + if ($opt{'d'}) { pod2usage(%pod_usage_args, '-msg' => '-R and -d are incompatible') } + $opt{'d'} = 0; } -if ($opt{c}) { - if ($opt{C}) { pod2usage(%pod_usage_args, "-msg" => "-c and -C are inconsistent") } - $opt{C} = ""; # set, but no classes +if ($opt{'c'}) { + if ($opt{'C'}) { pod2usage(%pod_usage_args, '-msg' => '-c and -C are inconsistent') } + $opt{'C'} = ""; # set, but no classes } -my %prune = map { $_ => 1 } split /,\s*/, $opt{p}; -my $all_consistency_checks = ! defined $opt{C}; -my %consistency_check = map { $_ => 1 } split /,\s*/, $opt{C}; +my %prune = map { $_ => 1 } split /,\s*/, $opt{'p'}; +my $all_consistency_checks = ! defined $opt{'C'}; +my %consistency_check = map { $_ => 1 } split /,\s*/, $opt{'C'}; -if ($opt{s}) { +if ($opt{'s'}) { # prune out "small" classes $prune{$_} = 1 for qw(MatrixRow PhyloTreeNode TaxonLabel MatrixKind TreeType); } @@ -94,10 +98,11 @@ my $id = shift or pod2usage(%pod_usage_args); $id =~ s/^#//; +# creating database handle my $dbh = CIPRES::TreeBase::DBIUtil->dbh or die "Couldn't connect to database: " . DBI->errstr; CIPRES::TreeBase::TreeBaseObjects->set_db_connection($dbh); -$dbh->{ShowErrorStatement} = 1; +$dbh->{'ShowErrorStatement'} = 1; sub full_str { my $self = shift; @@ -107,17 +112,24 @@ return join ", ", @components; } +# this is a handler that is passed around during consistency checks sub attr_check { my ($obj, $attr_name, $attr, $warnings) = @_; -# warn "checking to see that this object has $attr_name = $attr->{$attr_name}\n"; + print Dumper($attr); + if ( ref $attr eq 'ARRAY' ) { + print Dumper($attr); + my $trace = Devel::StackTrace->new; + print $trace->as_string; # like carp + return 1; + } # If $attr is just a scalar, fake up an attr hash with one attribute unless (ref $attr) { - $attr = { $attr_name => $attr }; + $attr = { $attr_name => $attr }; } unless ($warnings || $attr->{warnings}) { - croak "No warning target variable specified"; + croak "No warning target variable specified"; } return 1 unless exists $attr->{$attr_name}; @@ -146,13 +158,13 @@ my $OK = 1; my @warnings; $type->new($id)->dump( - action => \&prt, - seen => {}, - prune => \%prune, - show_all => $opt{a}, - warnings => \@warnings, - attr_check => \&attr_check, - defined($opt{d}) ? (maxdepth => $opt{d}) : (), + 'action' => \&prt, + 'seen' => {}, + 'prune' => \%prune, + 'show_all' => $opt{a}, + 'warnings' => \@warnings, + 'attr_check' => \&attr_check, + defined($opt{d}) ? ('maxdepth' => $opt{d}) : (), ); for my $w (@warnings) { @@ -174,7 +186,6 @@ my $consistent; my ($class, $id) = ($self->class, $self->id); - if (! $seen) { my $z; if ($TERMINAL) { Modified: trunk/treebase-core/src/main/perl/lib/CIPRES/TreeBase/TreeBaseObjects.pm =================================================================== --- trunk/treebase-core/src/main/perl/lib/CIPRES/TreeBase/TreeBaseObjects.pm 2009-11-19 10:51:20 UTC (rev 287) +++ trunk/treebase-core/src/main/perl/lib/CIPRES/TreeBase/TreeBaseObjects.pm 2009-11-19 15:16:50 UTC (rev 288) @@ -5,9 +5,10 @@ CIPRES::TreeBase::VeryBadORM->set_db_connection(@_); } +#################################################################################################### package Analysis; CIPRES::TreeBase::VeryBadORM->register(); -our %r_attr = qw(ANALYSISSTEPS AnalysisStep); +our %r_attr = ( 'analysissteps' => 'AnalysisStep' ); sub to_str { my $self = shift(); @@ -33,8 +34,8 @@ my @matrices; for my $as ($self->analysis_steps) { for my $ad ($as->analyzeddata) { - my $matrix = $ad->matrix; - push @matrices, $matrix if defined $matrix; + my $matrix = $ad->matrix; + push @matrices, $matrix if defined $matrix; } } $self->{analyzed_matrices} = \@matrices; @@ -48,8 +49,8 @@ my @trees; for my $as ($self->analysis_steps) { for my $ad ($as->analyzeddata) { - my $tree = $ad->tree; - push @trees, $tree if defined $tree; + my $tree = $ad->tree; + push @trees, $tree if defined $tree; } } $self->{analyzed_trees} = \@trees; @@ -68,14 +69,14 @@ my %tlset_ids; my $OK = 1; for my $tree ($self->analyzed_trees) { - if ($tree->treeblock && $tree->treeblock->taxonlabelset) { - $tlset_ids{$tree->treeblock->taxonlabelset->id} ++; - } + if ($tree->treeblock && $tree->treeblock->taxonlabelset) { + $tlset_ids{$tree->treeblock->taxonlabelset->id} ++; + } } for my $matrix ($self->analyzed_matrices) { - if ($matrix->taxonlabelset) { - $tlset_ids{$matrix->taxonlabelset->id} ++; - } + if ($matrix->taxonlabelset) { + $tlset_ids{$matrix->taxonlabelset->id} ++; + } } my @ids = keys(%tlset_ids); if (@ids == 1) { @@ -99,10 +100,10 @@ return $OK; } - +#################################################################################################### package AnalysisStep; CIPRES::TreeBase::VeryBadORM->register(); -our %r_attr = qw(ANALYZEDDATA AnalyzedData); +our %r_attr = qw(analyzeddata AnalyzedData); sub to_str { my $self = shift(); @@ -117,6 +118,7 @@ } } +#################################################################################################### package AnalyzedData; CIPRES::TreeBase::VeryBadORM->register(); @@ -134,9 +136,11 @@ return $_[0]->phylotree; } +#################################################################################################### package Citation; -our %r2_attr = (AUTHORS => ['CITATION_AUTHOR', 'Person', 'AUTHORS_PERSON_ID'] - ); +our %r2_attr = ( + 'authors' => ['citation_author', 'Person', 'authors_person_id'] +); CIPRES::TreeBase::VeryBadORM->register(); sub recurse { @@ -152,18 +156,26 @@ my %author_count; my $OK = 1; for my $author ($self->authors) { - if (++$author_count{$author->id} == 2) { - push @{$attr{warnings}}, "Citation " . $self->id . " contains author " . $author->id . " multiple times.\n"; - $OK = 0; - } + if (++$author_count{$author->id} == 2) { + push @{$attr{warnings}}, + "Citation " + . $self->id + . " contains author " + . $author->id + . " multiple times.\n"; + $OK = 0; + } } return $OK; } +#################################################################################################### package Matrix; CIPRES::TreeBase::VeryBadORM->register(); -our %r_attr = qw(ROWS MatrixRow - COLUMNS MatrixColumn); +our %r_attr = ( + 'rows' => 'MatrixRow', + 'columns' => 'MatrixColumn', +); sub to_str { my $self = shift(); @@ -235,9 +247,11 @@ return $OK; } +#################################################################################################### package MatrixColumn; CIPRES::TreeBase::VeryBadORM->register(); +#################################################################################################### package MatrixKind; CIPRES::TreeBase::VeryBadORM->register(); @@ -247,6 +261,7 @@ return $self->description ? qq{$s "} . $self->description . qq{"} : $s; } +#################################################################################################### package MatrixRow; CIPRES::TreeBase::VeryBadORM->register(); sub recurse { @@ -261,22 +276,25 @@ return $attr{attr_check}->($self, 'Matrix', \%attr); } +#################################################################################################### package NexusFile; CIPRES::TreeBase::VeryBadORM->register(); -our %subobject = (STUDY => 'Study'); +our %subobject = ('study' => 'Study'); -sub table { "Study_NexusFile" } +sub table { "Study_NexusFile" } # XXX check to see if this casing makes sense sub new_by_name { my ($class, $filename, $study_id) = @_; - my $self = bless { FILENAME => $filename, - STUDY_ID => $study_id, - ID => "$study_id,$filename", - reified => 1, # don't try to retrieve the clob! + my $self = bless { + 'filename' => $filename, + 'study_id' => $study_id, + 'id' => "$study_id,$filename", + 'reified' => 1, # don't try to retrieve the clob! } => $class; return $self; } +#################################################################################################### package Person; CIPRES::TreeBase::VeryBadORM->register(); @@ -291,15 +309,16 @@ return $s; } +#################################################################################################### package PhyloTree; CIPRES::TreeBase::VeryBadORM->register(); -our %subobject = (ROOTNODE => 'PhyloTreeNode', TREETYPE => 'TreeType'); -our %r_attr = (TREEBLOCK => 'TreeBlock'); +our %subobject = ('rootnode' => 'PhyloTreeNode', 'treetype' => 'TreeType'); +our %r_attr = ('treeblock' => 'TreeBlock'); sub to_str { my $self = shift; my $s = $self->SUPER::to_str(@_); - my $tb1id = $self->TB1_TREEID(); + my $tb1id = $self->tb1_treeid(); $s .= qq{ (was $tb1id)} if $tb1id; my $title = $self->title; $s .= qq{ "$title"} if $title; @@ -322,23 +341,22 @@ my $self = shift; my %attr = @_; my $OK = 1; - $OK &&= $attr{attr_check}->($self, 'Study', \%attr); - $OK &&= $attr{attr_check}->($self, 'TreeBlock', \%attr); - $OK &&= $attr{attr_check}->($self->rootnode, 'parent', undef, - $attr{warnings}); + $OK &&= $attr{'attr_check'}->($self, 'Study', \%attr); + $OK &&= $attr{'attr_check'}->($self, 'TreeBlock', \%attr); + $OK &&= $attr{'attr_check'}->($self->rootnode, 'parent', undef, $attr{'warnings'}); for my $a (qw(quality kind type)) { my $meth = "tree$a\_id"; unless (defined $self->$meth) { - push @{$attr{warnings}}, "PhyloTree " . $self->id . " has null tree_$a"; - $OK = 0; + push @{$attr{'warnings'}}, "PhyloTree " . $self->id . " has null tree_$a"; + $OK = 0; } } for my $a (qw(label title)) { unless (defined $self->$a) { - push @{$attr{warnings}}, "PhyloTree " . $self->id . " has null $a"; - $OK = 0; + push @{$attr{warnings}}, "PhyloTree " . $self->id . " has null $a"; + $OK = 0; } } @@ -393,12 +411,14 @@ return $self->{nexusfile} = NexusFile->new_by_name($nfn, $sid); } +#################################################################################################### package PhyloTreeNode; CIPRES::TreeBase::VeryBadORM->register(); -our %subobject = (CHILD => 'PhyloTreeNode', - SIBLING => 'PhyloTreeNode', - PARENT => 'PhyloTreeNode', - ); +our %subobject = ( + 'child' => 'PhyloTreeNode', + 'sibling' => 'PhyloTreeNode', + 'parent' => 'PhyloTreeNode', +); sub to_str { my $self = shift; @@ -411,13 +431,9 @@ sub children { my $self = shift; my @children; - - for (my $child = $self->child; - $child; - $child = $child->sibling) { + for (my $child = $self->child; $child; $child = $child->sibling) { push @children, $child; } - return @children; } @@ -431,10 +447,8 @@ my %attr = @_; my $tl = $self->taxonlabel; $tl->dump(%attr) if $tl; - for (my $n = $self->child; - $n; - $n = $n->sibling) { - $n->dump(%attr); + for (my $n = $self->child; $n; $n = $n->sibling) { + $n->dump(%attr); } } @@ -457,17 +471,18 @@ sub is_nested { 1 } +#################################################################################################### package Study; CIPRES::TreeBase::VeryBadORM->register(); -our %r_attr = qw(ANALYSES Analysis - MATRICES Matrix - TREES PhyloTree - SUBMISSIONS Submission - TAXONLABELSETS TaxonLabelSet - ); +our %r_attr = ( + 'analyses' => 'Analysis', + 'matrices' => 'Matrix', + 'trees' => 'PhyloTree', + 'submissions' => 'Submission', + 'taxonlabelsets' => 'TaxonLabelSet', +); -our %r2_attr = (NEXUSFILES => ['STUDY_NEXUSFILE', 'NexusFile'] - ); +our %r2_attr = ('nexusfiles' => ['study_nexusfile', 'NexusFile']); sub to_str { my $self = shift(); @@ -652,11 +667,13 @@ } } +#################################################################################################### package Submission; CIPRES::TreeBase::VeryBadORM->register(); -our %r2_attr = (TREEBLOCKS => ['SUB_TREEBLOCK', 'TreeBlock'], - TAXONLABELS => ['SUB_TAXONLABEL', 'TaxonLabel'], - MATRICES => ['SUB_MATRIX', 'Matrix'], +our %r2_attr = ( + treeblocks => ['sub_treeblock', 'TreeBlock'], + taxonlabels => ['sub_taxonlabel', 'TaxonLabel'], + matrices => ['sub_matrix', 'Matrix'], ); sub recurse { @@ -716,7 +733,7 @@ return $OK; } - +#################################################################################################### package Taxon; CIPRES::TreeBase::VeryBadORM->register(); @@ -726,10 +743,11 @@ return "$s " . $self->name; } +#################################################################################################### package TaxonLabel; CIPRES::TreeBase::VeryBadORM->register(); -our %r_attr = qw(TREENODES PhyloTreeNode ROWS MatrixRow); -our %r2_attr = (TAXONLABELSETS => ['TAXONLABELSET_TAXONLABEL', 'TaxonLabelSet']); +our %r_attr = ('treenodes' => 'PhyloTreeNode', 'rows' => 'MatrixRow'); +our %r2_attr = ('taxonlabelsets' => ['taxonlabelset_taxonlabel', 'TaxonLabelSet']); sub to_str { my $self = shift(); @@ -758,10 +776,11 @@ return $attr{attr_check}->($self, 'Study', \%attr); } +#################################################################################################### package TaxonLabelSet; CIPRES::TreeBase::VeryBadORM->register(); -our %r_attr = qw(TREEBLOCKS TreeBlock MATRICES Matrix); -our %r2_attr = (TAXONLABELS => ['TAXONLABELSET_TAXONLABEL', 'TaxonLabel']); +our %r_attr = ('treeblocks' => 'TreeBlock', 'matrices' => 'Matrix'); +our %r2_attr = ('taxonlabels' => ['taxonlabelset_taxonlabel', 'TaxonLabel']); sub to_str { my $self = shift; @@ -819,6 +838,7 @@ return $OK; } +#################################################################################################### package TaxonVariant; CIPRES::TreeBase::VeryBadORM->register(); @@ -840,10 +860,11 @@ $t->dump(@_) if $t; } +#################################################################################################### package TreeBlock; CIPRES::TreeBase::VeryBadORM->register(); -our %r2_attr = (SUBMISSIONS => ['SUB_TREEBLOCK', 'Submission']); -our %r_attr = (TREES => 'PhyloTree'); +our %r2_attr = ('submissions' => ['sub_treeblock', 'Submission']); +our %r_attr = ('trees' => 'PhyloTree'); sub to_str { @@ -879,6 +900,7 @@ return $OK; } +#################################################################################################### package TreeType; CIPRES::TreeBase::VeryBadORM->register(); Modified: trunk/treebase-core/src/main/perl/lib/CIPRES/TreeBase/VeryBadORM.pm =================================================================== --- trunk/treebase-core/src/main/perl/lib/CIPRES/TreeBase/VeryBadORM.pm 2009-11-19 10:51:20 UTC (rev 287) +++ trunk/treebase-core/src/main/perl/lib/CIPRES/TreeBase/VeryBadORM.pm 2009-11-19 15:16:50 UTC (rev 288) @@ -2,7 +2,8 @@ package CIPRES::TreeBase::VeryBadORM; use Carp 'croak'; use strict 'vars'; - +use Devel::StackTrace; +use Data::Dumper; our %dbh; our $DBH; @@ -23,9 +24,9 @@ unless defined $DBH; unless (defined $id) { - croak("$class\::new: missing ID argument"); + croak("$class\::new: missing ID argument"); } - my $obj = bless { ID => $id } => $class; + my $obj = bless { 'id' => $id } => $class; $cache{$class}{$id} = $obj; return $obj; } @@ -36,34 +37,36 @@ our $AUTOLOAD; my ($package, $method) = $AUTOLOAD =~ /(.*)::(.*)/; if ($package->has_attr($method)) { - return $obj->get_no_check($method, @_); + return $obj->get_no_check($method, @_); } elsif ($package->has_subobject($method)) { - return $obj->get_subobject_no_check($method, @_); + return $obj->get_subobject_no_check($method, @_); } elsif ($package->has_r_attr($method)) { - return $obj->get_r_subobject_no_check($method, @_); + return $obj->get_r_subobject_no_check($method, @_); } elsif ($package->has_r2_attr($method)) { - return $obj->get_r2_subobject_no_check($method, @_); + return $obj->get_r2_subobject_no_check($method, @_); } else { - croak("Unknown attribute '$method' in class '$package'"); + my $trace = Devel::StackTrace->new; + print $trace->as_string; # like carp + croak("Unknown attribute '$method' in class '$package'"); } } sub has_attr { my $base = shift; my $class = ref($base) || $base; - return $class->attr_hash()->{uc shift()}; + return $class->attr_hash()->{shift()}; } sub has_r_attr { my $base = shift; my $class = ref($base) || $base; - return $class->r_class(uc shift()); + return $class->r_class(shift()); } sub has_r2_attr { my $base = shift; my $class = ref($base) || $base; - return $class->r2_class(uc shift()); + return $class->r2_class(shift()); } sub has_subobject { @@ -74,7 +77,7 @@ sub foreign_key { my $base = shift; - my $subobj = shift; + my $subobj = lc(shift); # XXX return $subobj . "_id"; } @@ -86,11 +89,10 @@ my $attr_list = $base->attr_list; if (@$attr_list) { - %$attr_hash = map { uc($_) => 1 } @$attr_list; - $attr_hash->{"$class\_id"} = 1; - return $attr_hash; + %$attr_hash = map { $_ => 1 } @$attr_list; + $attr_hash->{"$class\_id"} = 1; + return $attr_hash; } - return; } @@ -154,20 +156,20 @@ } elsif ($self->has_r_attr($attr)) { return $self->get_r_subobject_no_check($attr, @_); } + my $trace = Devel::StackTrace->new; + print $trace->as_string; # like carp croak($self->class . " has no attribute named '$attr'"); } sub get_no_check { my ($self, $attr) = @_; - $attr = uc $attr; - return $self->id if $attr eq "ID"; + return $self->id if $attr eq "id"; return $self->{$attr} if exists $self->{$attr}; return $self->{$attr} = $self->reify->{$attr}; } sub get_subobject_no_check { my ($self, $attr) = @_; - $attr = uc $attr; return $self->{$attr} if exists $self->{$attr}; my $id = $self->get($self->foreign_key($attr)); return unless defined $id; @@ -181,7 +183,7 @@ # and return a list of analysis objects sub get_r_subobject_no_check { my ($self, $attr) = @_; - $attr = uc $attr; + $attr = $attr; my $target_class = $self->r_class($attr); my $target_table = $target_class->table; my $field = $target_class->id_attr; @@ -235,8 +237,8 @@ my %attr = @_; return $self->class . " #" . $self->id; } -sub id { $_[0]{ID} } -sub id_attr { return uc($_[0]->class . "_id") }; +sub id { $_[0]{'id'} } +sub id_attr { return lc($_[0]->class . "_id") }; sub class { return ref($_[0]) || $_[0]; } my %known_class; @@ -247,8 +249,8 @@ my @classes = @_; @classes = scalar(caller()) unless @classes; for my $class (@classes) { - push @{"$class\::ISA"}, $my_class; - $class->known_class_hash->{uc $class} = $class; + push @{"$class\::ISA"}, $my_class; + $class->known_class_hash->{uc $class} = $class; } } @@ -261,7 +263,7 @@ my ($self, $subobj) = @_; my $subobj_class = \%{$self->class . "::subobject"}; return $subobj_class->{$subobj} if exists $subobj_class->{$subobj}; - return $self->alias($subobj) || ucfirst(lc $subobj); + return $self->alias($subobj) || $subobj;#ucfirst(lc($subobj)); } sub get_id_pair { @@ -272,17 +274,17 @@ sub table { return $_[0]->class; } sub r_class { my ($self, $r_attr) = @_; - return $self->r_attr_hash()->{uc $r_attr}; + return $self->r_attr_hash()->{$r_attr}; } sub r2_table { my ($self, $r_attr) = @_; - return $self->r2_attr_hash()->{uc $r_attr}->[0]; + return $self->r2_attr_hash()->{$r_attr}->[0]; } sub r2_class { my ($self, $r_attr) = @_; - return $self->r2_attr_hash()->{uc $r_attr}->[1]; + return $self->r2_attr_hash()->{$r_attr}->[1]; } sub dump { @@ -291,11 +293,11 @@ my ($class, $id) = ($self->class, $self->id); my $continue = 1; - $continue = $attr{action}->($self, %attr) if $attr{action}; + $continue = $attr{'action'}->($self, %attr) if $attr{'action'}; return unless $continue; - $attr{depth} += 1; - return if defined($attr{maxdepth}) && $attr{depth} > $attr{maxdepth}; + $attr{'depth'} += 1; + return if defined($attr{'maxdepth'}) && $attr{'depth'} > $attr{'maxdepth'}; $attr{$class} = $id; $self->recurse(%attr); delete $attr{$class}; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2009-11-19 10:51:27
|
Revision: 287 http://treebase.svn.sourceforge.net/treebase/?rev=287&view=rev Author: rvos Date: 2009-11-19 10:51:20 +0000 (Thu, 19 Nov 2009) Log Message: ----------- Reformatted some code Modified Paths: -------------- trunk/treebase-core/src/main/perl/check/check Modified: trunk/treebase-core/src/main/perl/check/check =================================================================== --- trunk/treebase-core/src/main/perl/check/check 2009-11-19 10:39:24 UTC (rev 286) +++ trunk/treebase-core/src/main/perl/check/check 2009-11-19 10:51:20 UTC (rev 287) @@ -145,13 +145,15 @@ my $OK = 1; my @warnings; -$type->new($id)->dump(action => \&prt, seen => {}, - prune => \%prune, - show_all => $opt{a}, - warnings => \@warnings, - attr_check => \&attr_check, - defined($opt{d}) ? (maxdepth => $opt{d}) : (), - ); +$type->new($id)->dump( + action => \&prt, + seen => {}, + prune => \%prune, + show_all => $opt{a}, + warnings => \@warnings, + attr_check => \&attr_check, + defined($opt{d}) ? (maxdepth => $opt{d}) : (), +); for my $w (@warnings) { print STDERR "*** $w\n"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2009-11-19 10:39:33
|
Revision: 286 http://treebase.svn.sourceforge.net/treebase/?rev=286&view=rev Author: rvos Date: 2009-11-19 10:39:24 +0000 (Thu, 19 Nov 2009) Log Message: ----------- Added POD and pod2usage documentation Modified Paths: -------------- trunk/treebase-core/src/main/perl/check/check Modified: trunk/treebase-core/src/main/perl/check/check =================================================================== --- trunk/treebase-core/src/main/perl/check/check 2009-11-19 02:13:56 UTC (rev 285) +++ trunk/treebase-core/src/main/perl/check/check 2009-11-19 10:39:24 UTC (rev 286) @@ -1,27 +1,83 @@ #!/usr/bin/perl - use strict; use CIPRES::TreeBase::DBIUtil; use CIPRES::TreeBase::TreeBaseObjects; use Getopt::Std; +use Getopt::Long; +use Pod::Usage; +use Carp 'croak'; our $indent = 0; +=head1 NAME + +check - check TreeBASE database consistency + +=head1 SYNOPSIS + + Usage: check [-X] [-acsR] [-d n] [-pClass1,Class2,...] [-CClasses...] Class IDnumber + +=head1 ARGUMENTS + +=over + +=item C<-a> + +show B<all> attributes of every object (default: pretty-print objects) + +=item C<-s> + +do not recurse into "small" objects (Currently: MatrixRow, PhyloTreeNode, TaxonLabel) + +=item C<-R> + +do not recurse at all, printing only the top object + +=item C<-c> + +Skip all consistency checking + +=item C<-d n> + +recurse only n levels deep + +=item C<-pClasses> + +'prune': do not display or recurse into objects of these classes. + +=item C<-CClasses> + +Perform consistency checking of these classes only + +=item C<-X> + +for a list of known classes + +=back + +=head1 DESCRIPTION + +Recursively print the contents of the specified object of the +specified class. For example, "check Study 1234" prints out study #1234 +and all of its trees, matrices, analyses, etc., and their contents. + +=cut + my $TERMINAL; if (-t STDOUT) { $| = 1; $TERMINAL = 1; } - +my %pod_usage_args = ( -exitval => 1, -verbose => 1 ); my %opt; -getopts('chasd:p:RC:X', \%opt) or usage(); +getopts('chasd:p:RC:X', \%opt) or pod2usage(%pod_usage_args); if ($opt{X}) { list_known_classes(); } -if ($opt{h}) { usage(); } +if ($opt{h}) { pod2usage(%pod_usage_args) } if ($opt{R}) { - if ($opt{d}) { die "-R and -d are incompatible\n"; } + if ($opt{d}) { pod2usage(%pod_usage_args, "-msg" => "-R and -d are incompatible") } $opt{d} = 0; } if ($opt{c}) { - if ($opt{C}) { die "-c and -C are inconsistent\n"; } + if ($opt{C}) { pod2usage(%pod_usage_args, "-msg" => "-c and -C are inconsistent") } $opt{C} = ""; # set, but no classes } @@ -34,15 +90,15 @@ $prune{$_} = 1 for qw(MatrixRow PhyloTreeNode TaxonLabel MatrixKind TreeType); } -my $type = shift or usage(); -my $id = shift or usage(); +my $type = shift or pod2usage(%pod_usage_args); +my $id = shift or pod2usage(%pod_usage_args); $id =~ s/^#//; my $dbh = CIPRES::TreeBase::DBIUtil->dbh or die "Couldn't connect to database: " . DBI->errstr; CIPRES::TreeBase::TreeBaseObjects->set_db_connection($dbh); $dbh->{ShowErrorStatement} = 1; -use Carp 'croak'; + sub full_str { my $self = shift; $self->reify; @@ -157,30 +213,4 @@ exit 0; } -sub usage { - print STDERR qq<Usage: $0 [-X] [-acsR] [-d n] [-pClass1,Class2,...] [-CClasses...] Class IDnumber - -Recursively print the contents of the specified object of the -specified class. For example, "$0 Study 1234" prints out study #1234 -and all of its trees, matrices, analyses, etc., and their contents. - -Use "$0 -X" for a list of known classes. - -Options: - -a: show *all* attributes of every object (default: pretty-print objects) - -s: do not recurse into "small" objects (Currently: MatrixRow, - PhyloTreeNode, TaxonLabel) - -R: do not recurse at all, printing only the top object - -c: Skip all consistency checking - - -d n: recurse only n levels deep - - -pClasses... : 'prune': do not display or recurse into objects of these - classes. - -CClasses... : Perform consistency checking of these classes only ->; - exit 1; -} - - 1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yo...@us...> - 2009-11-19 02:14:06
|
Revision: 285 http://treebase.svn.sourceforge.net/treebase/?rev=285&view=rev Author: youjun Date: 2009-11-19 02:13:56 +0000 (Thu, 19 Nov 2009) Log Message: ----------- fix templates variable name Modified Paths: -------------- trunk/oai-pmh_data_provider/data_provider_web/.classpath trunk/oai-pmh_data_provider/data_provider_web/pom.xml trunk/oai-pmh_data_provider/data_provider_web/src/main/java/org/treebase/oai/web/controller/OAIPMHController.java trunk/oai-pmh_data_provider/data_provider_web/src/main/java/org/treebase/oai/web/validator/OAIPMHValidator.java trunk/oai-pmh_data_provider/data_provider_web/src/main/webapp/WEB-INF/vmFiles/GetRecord.vm trunk/oai-pmh_data_provider/data_provider_web/src/main/webapp/WEB-INF/vmFiles/Identify.vm trunk/oai-pmh_data_provider/data_provider_web/src/main/webapp/WEB-INF/vmFiles/ListRecords.vm trunk/oai-pmh_data_provider/data_provider_web/src/main/webapp/WEB-INF/vmFiles/error.vm trunk/oai-pmh_data_provider/data_provider_web/src/main/webapp/WEB-INF/vmFiles/head.vm trunk/oai-pmh_data_provider/data_provider_web/src/main/webapp/WEB-INF/vmFiles/oai_dc_ListIdentifiers.vm trunk/oai-pmh_data_provider/data_provider_web/src/main/webapp/WEB-INF/vmFiles/oai_dc_record.vm Modified: trunk/oai-pmh_data_provider/data_provider_web/.classpath =================================================================== --- trunk/oai-pmh_data_provider/data_provider_web/.classpath 2009-11-18 21:08:06 UTC (rev 284) +++ trunk/oai-pmh_data_provider/data_provider_web/.classpath 2009-11-19 02:13:56 UTC (rev 285) @@ -11,5 +11,6 @@ </attributes> </classpathentry> <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/> + <classpathentry kind="lib" path="C:/Documents and Settings/youjun/.m2/repository/org/cipres/treebase/treebase-core/1.0-SNAPSHOT/treebase-core-1.0-SNAPSHOT.jar"/> <classpathentry kind="output" path="target/classes"/> </classpath> Modified: trunk/oai-pmh_data_provider/data_provider_web/pom.xml =================================================================== --- trunk/oai-pmh_data_provider/data_provider_web/pom.xml 2009-11-18 21:08:06 UTC (rev 284) +++ trunk/oai-pmh_data_provider/data_provider_web/pom.xml 2009-11-19 02:13:56 UTC (rev 285) @@ -246,11 +246,6 @@ <version>2.4</version> </dependency> <dependency> - <groupId>org.cipres.treebase</groupId> - <artifactId>treebase-core</artifactId> - <version>1.0-SNAPSHOT</version> - </dependency> - <dependency> <groupId>velocity-tools</groupId> <artifactId>velocity-tools</artifactId> <version>1.1</version> @@ -265,6 +260,11 @@ <artifactId>velocity-tools-view</artifactId> <version>1.1</version> </dependency> + <dependency> + <groupId>org.cipres.treebase</groupId> + <artifactId>treebase-core</artifactId> + <version>1.0-SNAPSHOT</version> + </dependency> </dependencies> <dependencyManagement> Modified: trunk/oai-pmh_data_provider/data_provider_web/src/main/java/org/treebase/oai/web/controller/OAIPMHController.java =================================================================== --- trunk/oai-pmh_data_provider/data_provider_web/src/main/java/org/treebase/oai/web/controller/OAIPMHController.java 2009-11-18 21:08:06 UTC (rev 284) +++ trunk/oai-pmh_data_provider/data_provider_web/src/main/java/org/treebase/oai/web/controller/OAIPMHController.java 2009-11-19 02:13:56 UTC (rev 285) @@ -85,17 +85,17 @@ if(errors.hasFieldErrors("metadataPrefix")){ model.put("error_code", "cannotDisseminateFormat"); model.put("error", "bad metadataPrefix"); - return new ModelAndView("error.vm",model); + return new ModelAndView("error",model); } if(errors.hasFieldErrors("verb")){ model.put("error_code", "badVerb"); model.put("error", "no verb was found"); - return new ModelAndView("error.vm",model); + return new ModelAndView("error",model); } if(errors.hasFieldErrors("identifier")){ model.put("error_code", "idDoesNotExist"); model.put("error", "no id was found"); - return new ModelAndView("error.vm",model); + return new ModelAndView("error",model); } } @@ -105,11 +105,11 @@ }catch(NoSuchMethodException nsme){ model.put("error_code", "badVerb"); model.put("error", "invalid verb"); - return new ModelAndView("error.vm",model); + return new ModelAndView("error",model); }catch(NullPointerException e){ model.put("error_code", "badVerb"); model.put("error", "missing verb"); - return (new ModelAndView("error.vm",model)); + return (new ModelAndView("error",model)); } return (ModelAndView) method.invoke(this, params, model); @@ -125,10 +125,10 @@ } catch (ParseException e) { model.put("error_code", "badArgument"); model.put("error", "invalid from or until format"); - return (new ModelAndView("error.vm",model)); + return (new ModelAndView("error",model)); } model.put("recordList", getRecordList(list)); - return (new ModelAndView("ListRecords.vm",model)); + return (new ModelAndView("ListRecords",model)); } @@ -142,10 +142,10 @@ } catch (ParseException e) { model.put("error_code", "badArgument"); model.put("error", "invalid from or until format"); - return (new ModelAndView("error.vm",model)); + return (new ModelAndView("error",model)); } model.put("recordList", getRecordList(list)); - return (new ModelAndView(params.getMetadataPrefix()+"_ListIdentifiers.vm",model)); + return (new ModelAndView(params.getMetadataPrefix()+"_ListIdentifiers",model)); } @@ -159,32 +159,32 @@ }catch(NumberFormatException nfe){ model.put("error_code", "badArgument"); model.put("error", "invalid id format"); - return (new ModelAndView("error.vm",model)); + return (new ModelAndView("error",model)); } catch (NullPointerException e){ model.put("error_code", "idDoesNotExist"); model.put("error", "invalid id"); - return (new ModelAndView("error.vm",model)); + return (new ModelAndView("error",model)); } model.put("record", getRecordMap(submission)); - return (new ModelAndView("GetRecord.vm",model)); + return (new ModelAndView("GetRecord",model)); } public ModelAndView Identify(OAIPMHCommand params, Map model){ - return (new ModelAndView("Identify.vm",model)); + return (new ModelAndView("Identify",model)); } public ModelAndView ListSets(OAIPMHCommand params, Map model){ model.put("error_code", "noSetHierarchy"); model.put("error", "This repository does not support sets"); - return (new ModelAndView("error.vm",model)); + return (new ModelAndView("error",model)); } @@ -198,16 +198,16 @@ }catch(NumberFormatException nfe){ model.put("error_code", "badArgument"); model.put("error", "invalid id format"); - return (new ModelAndView("error.vm",model)); + return (new ModelAndView("error",model)); } catch (NullPointerException e){ //id is optional for ListMetadataFormats - //return (new ModelAndView("idDoesNotExist.vm",model)); + //return (new ModelAndView("error",model)); } - return (new ModelAndView("ListMetadataFormats.vm",model)); + return (new ModelAndView("ListMetadataFormats",model)); } Modified: trunk/oai-pmh_data_provider/data_provider_web/src/main/java/org/treebase/oai/web/validator/OAIPMHValidator.java =================================================================== --- trunk/oai-pmh_data_provider/data_provider_web/src/main/java/org/treebase/oai/web/validator/OAIPMHValidator.java 2009-11-18 21:08:06 UTC (rev 284) +++ trunk/oai-pmh_data_provider/data_provider_web/src/main/java/org/treebase/oai/web/validator/OAIPMHValidator.java 2009-11-19 02:13:56 UTC (rev 285) @@ -24,10 +24,11 @@ // check format prefix - if(verb=="GetRecord"||verb=="ListIdentifiers"||verb=="ListRecords") - if(fPrefix!="oai_dc"&fPrefix!="dryad") - pError.rejectValue("metadataPrefix","cannotDisseminateFormat"); - + if(verb=="GetRecord"||verb=="ListIdentifiers"||verb=="ListRecords"){ + ValidationUtils.rejectIfEmptyOrWhitespace(pError, "metadataPrefix", "cannotDisseminateFormat"); + if(fPrefix!="oai_dc"&fPrefix!="dryad") + pError.rejectValue("metadataPrefix","cannotDisseminateFormat"); + } } } Modified: trunk/oai-pmh_data_provider/data_provider_web/src/main/webapp/WEB-INF/vmFiles/GetRecord.vm =================================================================== --- trunk/oai-pmh_data_provider/data_provider_web/src/main/webapp/WEB-INF/vmFiles/GetRecord.vm 2009-11-18 21:08:06 UTC (rev 284) +++ trunk/oai-pmh_data_provider/data_provider_web/src/main/webapp/WEB-INF/vmFiles/GetRecord.vm 2009-11-19 02:13:56 UTC (rev 285) @@ -1,6 +1,6 @@ #parse("head.vm") <GetRecord> -#if($!model.params.metadataPrefix=="oai_dc") +#if($!requestParams.metadataPrefix=="oai_dc") #parse("oai_dc_record.vm") #end </GetRecord> Modified: trunk/oai-pmh_data_provider/data_provider_web/src/main/webapp/WEB-INF/vmFiles/Identify.vm =================================================================== --- trunk/oai-pmh_data_provider/data_provider_web/src/main/webapp/WEB-INF/vmFiles/Identify.vm 2009-11-18 21:08:06 UTC (rev 284) +++ trunk/oai-pmh_data_provider/data_provider_web/src/main/webapp/WEB-INF/vmFiles/Identify.vm 2009-11-19 02:13:56 UTC (rev 285) @@ -1,12 +1,12 @@ #parse("head.vm") <Identify> - <repositoryName>${model.identify.repositoryName}</repositoryName> - <baseURL>${model.identify.baseURL}</baseURL> - <protocolVersion>${model.identify.protocolVersion}</protocolVersion> - <adminEmail>${model.identify.adminEmail}</adminEmail> - <earliestDatestamp>${model.identify.earliestDatestamp}</earliestDatestamp> - <deletedRecord>${model.identify.deletedRecord}</deletedRecord> - <granularity>${model.identify.granularity}</granularity> + <repositoryName>${identify.repositoryName}</repositoryName> + <baseURL>${identify.baseURL}</baseURL> + <protocolVersion>${identify.protocolVersion}</protocolVersion> + <adminEmail>${identify.adminEmail}</adminEmail> + <earliestDatestamp>${identify.earliestDatestamp}</earliestDatestamp> + <deletedRecord>${identify.deletedRecord}</deletedRecord> + <granularity>${identify.granularity}</granularity> <description> <oai-identifier @@ -16,9 +16,9 @@ "http://www.openarchives.org/OAI/2.0/oai-identifier http://www.openarchives.org/OAI/2.0/oai-identifier.xsd"> <scheme>oai</scheme> - <repositoryIdentifier>${model.identify.repositoryIdentifier}</repositoryIdentifier> - <delimiter>${model.identify.identifierDelimiter}</delimiter> - <sampleIdentifier>${model.identify.sampleIdentifier}</sampleIdentifier> + <repositoryIdentifier>${identify.repositoryIdentifier}</repositoryIdentifier> + <delimiter>${identify.identifierDelimiter}</delimiter> + <sampleIdentifier>${identify.sampleIdentifier}</sampleIdentifier> </oai-identifier> </description> </Identify> Modified: trunk/oai-pmh_data_provider/data_provider_web/src/main/webapp/WEB-INF/vmFiles/ListRecords.vm =================================================================== --- trunk/oai-pmh_data_provider/data_provider_web/src/main/webapp/WEB-INF/vmFiles/ListRecords.vm 2009-11-18 21:08:06 UTC (rev 284) +++ trunk/oai-pmh_data_provider/data_provider_web/src/main/webapp/WEB-INF/vmFiles/ListRecords.vm 2009-11-19 02:13:56 UTC (rev 285) @@ -1,7 +1,7 @@ #parse("head.vm") <ListRecords> -#if($!model.params.metadataPrefix=="oai_dc") -#foreach($record in $model.recordList) +#if($!requestParams.metadataPrefix=="oai_dc") +#foreach($record in $recordList) #parse("oai_dc_record.vm") #end #end Modified: trunk/oai-pmh_data_provider/data_provider_web/src/main/webapp/WEB-INF/vmFiles/error.vm =================================================================== --- trunk/oai-pmh_data_provider/data_provider_web/src/main/webapp/WEB-INF/vmFiles/error.vm 2009-11-18 21:08:06 UTC (rev 284) +++ trunk/oai-pmh_data_provider/data_provider_web/src/main/webapp/WEB-INF/vmFiles/error.vm 2009-11-19 02:13:56 UTC (rev 285) @@ -1,3 +1,3 @@ #parse("head.vm") -<error code="$!model.error_code">$!model.error</error> +<error code="$!error_code">$!error</error> </OAI-PMH> Modified: trunk/oai-pmh_data_provider/data_provider_web/src/main/webapp/WEB-INF/vmFiles/head.vm =================================================================== --- trunk/oai-pmh_data_provider/data_provider_web/src/main/webapp/WEB-INF/vmFiles/head.vm 2009-11-18 21:08:06 UTC (rev 284) +++ trunk/oai-pmh_data_provider/data_provider_web/src/main/webapp/WEB-INF/vmFiles/head.vm 2009-11-19 02:13:56 UTC (rev 285) @@ -3,12 +3,12 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd"> -<responseDate>${model.identify.getResponseDate()}</responseDate> -<request #if($!model.params.verb)verb="$!model.params.verb" #end -#if($!model.params.identifier)identifier="$!model.params.identifier" #end -#if($!model.params.metadataPrefix)metadataPrefix="$!model.params.metadataPrefix" #end -#if($!model.params.from)from="$!model.params.from" #end -#if($!model.params.until)until="$!model.params.until" #end -#if($!model.params.resumptionToken)resumptionToken="$!model.params.resumptionToken" #end -#if($!model.params.set)set="$!model.params.set" #end> -$!model.identify.BaseURL</request> +<responseDate>${identify.getResponseDate()}</responseDate> +<request #if($!requestParams.verb)verb="$!requestParams.verb" #end +#if($!requestParams.identifier)identifier="$!requestParams.identifier" #end +#if($!requestParams.metadataPrefix)metadataPrefix="$!requestParams.metadataPrefix" #end +#if($!requestParams.from)from="$!requestParams.from" #end +#if($!requestParams.until)until="$!requestParams.until" #end +#if($!requestParams.resumptionToken)resumptionToken="$!requestParams.resumptionToken" #end +#if($!requestParams.set)set="$!requestParams.set" #end> +$!identify.BaseURL</request> \ No newline at end of file Modified: trunk/oai-pmh_data_provider/data_provider_web/src/main/webapp/WEB-INF/vmFiles/oai_dc_ListIdentifiers.vm =================================================================== --- trunk/oai-pmh_data_provider/data_provider_web/src/main/webapp/WEB-INF/vmFiles/oai_dc_ListIdentifiers.vm 2009-11-18 21:08:06 UTC (rev 284) +++ trunk/oai-pmh_data_provider/data_provider_web/src/main/webapp/WEB-INF/vmFiles/oai_dc_ListIdentifiers.vm 2009-11-19 02:13:56 UTC (rev 285) @@ -1,6 +1,6 @@ #parse("head.vm") <ListIdentifiers> -#foreach ( $record in $model.recordList) +#foreach ( $record in $recordList) <header> <identifier>${record.identifier}</identifier> <datestamp>$!record.datestamp</datestamp> Modified: trunk/oai-pmh_data_provider/data_provider_web/src/main/webapp/WEB-INF/vmFiles/oai_dc_record.vm =================================================================== --- trunk/oai-pmh_data_provider/data_provider_web/src/main/webapp/WEB-INF/vmFiles/oai_dc_record.vm 2009-11-18 21:08:06 UTC (rev 284) +++ trunk/oai-pmh_data_provider/data_provider_web/src/main/webapp/WEB-INF/vmFiles/oai_dc_record.vm 2009-11-19 02:13:56 UTC (rev 285) @@ -1,62 +1,64 @@ <record> - <header> - <identifier>${model.record.identifier}</identifier> - <datestamp>$!model.record.datestamp</datestamp> - </header> - <metadata> - <oai_dc:dc - xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/ - http://www.openarchives.org/OAI/2.0/oai_dc.xsd"> - #if($model.record.title) - <dc:title>${model.record.title}</dc:title> - #end - #if($model.record.creator) - #foreach ($person in $model.record.creator) - <dc:creator>${person.lastName}, ${person.firstName}</dc:creator> - #end - #end - #if($model.record.subject) - <dc:subject>${model.record.subject}</dc:subject> - #end - #if($model.record.description) - <dc:description>${model.record.description}</dc:description> - #end - #if($model.record.publisher) - <dc:publisher>${model.record.publisher}</dc:publisher> - #end - #if($model.record.contributor) - <dc:contributor>${model.record.contributor}</dc:contributor> - #end - #if($model.record.date) - <dc:date>${model.record.date}</dc:date> - #end - #if($model.record.type) - <dc:type>${model.record.type}</dc:type> - #end - #if($model.record.format) - <dc:format>${model.record.format}</dc:format> +<header> +<identifier>${record.identifier}</identifier> +<datestamp>$!record.datestamp</datestamp> +</header> +<metadata> +<oai_dc:dc + xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/ + http://www.openarchives.org/OAI/2.0/oai_dc.xsd"> +#if($record.title) +<dc:title>${record.title}</dc:title> +#end +#if($record.creator) +#foreach ($person in $record.creator) +<dc:creator>${person.lastName}, ${person.firstName}</dc:creator> #end -##if($model.record.identifier) -##<dc:identifier>${model.record.identifier}</dc:identifier> +#end +#if($record.subject) +<dc:subject>${record.subject}</dc:subject> +#end +#if($record.description) +<dc:description>${record.description}</dc:description> +#end +#if($record.publisher) +<dc:publisher>${record.publisher}</dc:publisher> +#end +#if($record.contributor) +<dc:contributor>${record.contributor}</dc:contributor> +#end +#if($record.date) +<dc:date>${record.date}</dc:date> +#end +#if($record.type) +<dc:type>${record.type}</dc:type> +#end +#if($record.format) +<dc:format>${record.format}</dc:format> + +#end +##if($record.identifier) +##<dc:identifier>${record.identifier}</dc:identifier> ##end - #if($model.record.source) - <dc:source>{model.record.source}</dc:source> - #end - #if($model.record.language) - <dc:language>${model.record.language}</dc:language> - #end - #if($model.record.relation) - <dc:relation>${model.record.relation}</dc:relation> - #end - #if($model.record.coverage) - <dc:coverage>${model.record.coverage}</dc:coverage> - #end - #if($model.record.rights) - <dc:rights>${model.record.rights}</dc:rights> - #end - </oai_dc:dc> - </metadata> - </record> \ No newline at end of file + +#if($record.source) +<dc:source>{record.source}</dc:source> +#end +#if($record.language) +<dc:language>${record.language}</dc:language> +#end +#if($record.relation) +<dc:relation>${record.relation}</dc:relation> +#end +#if($record.coverage) +<dc:coverage>${record.coverage}</dc:coverage> +#end +#if($record.rights) +<dc:rights>${record.rights}</dc:rights> +#end +</oai_dc:dc> +</metadata> +</record> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yo...@us...> - 2009-11-18 21:08:13
|
Revision: 284 http://treebase.svn.sourceforge.net/treebase/?rev=284&view=rev Author: youjun Date: 2009-11-18 21:08:06 +0000 (Wed, 18 Nov 2009) Log Message: ----------- add 3 velocity tool dependencies Modified Paths: -------------- trunk/oai-pmh_data_provider/data_provider_web/pom.xml trunk/oai-pmh_data_provider/data_provider_web/src/main/java/org/treebase/oai/web/validator/OAIPMHValidator.java trunk/oai-pmh_data_provider/data_provider_web/src/main/webapp/WEB-INF/web.xml Modified: trunk/oai-pmh_data_provider/data_provider_web/pom.xml =================================================================== --- trunk/oai-pmh_data_provider/data_provider_web/pom.xml 2009-11-18 18:14:19 UTC (rev 283) +++ trunk/oai-pmh_data_provider/data_provider_web/pom.xml 2009-11-18 21:08:06 UTC (rev 284) @@ -250,7 +250,22 @@ <artifactId>treebase-core</artifactId> <version>1.0-SNAPSHOT</version> </dependency> - + <dependency> + <groupId>velocity-tools</groupId> + <artifactId>velocity-tools</artifactId> + <version>1.1</version> + </dependency> + <dependency> + <groupId>velocity-tools</groupId> + <artifactId>velocity-tools-generic</artifactId> + <version>1.1</version> + </dependency> + <dependency> + <groupId>velocity-tools</groupId> + <artifactId>velocity-tools-view</artifactId> + <version>1.1</version> + </dependency> + </dependencies> <dependencyManagement> <dependencies> Modified: trunk/oai-pmh_data_provider/data_provider_web/src/main/java/org/treebase/oai/web/validator/OAIPMHValidator.java =================================================================== --- trunk/oai-pmh_data_provider/data_provider_web/src/main/java/org/treebase/oai/web/validator/OAIPMHValidator.java 2009-11-18 18:14:19 UTC (rev 283) +++ trunk/oai-pmh_data_provider/data_provider_web/src/main/java/org/treebase/oai/web/validator/OAIPMHValidator.java 2009-11-18 21:08:06 UTC (rev 284) @@ -14,9 +14,10 @@ public void validate(Object pValidatable, Errors pError) { // ValidationUtils.rejectIfEmpty(e, "name", "name.empty"); OAIPMHCommand command = (OAIPMHCommand) pValidatable; - String verb = command.getVerb().trim(); - String fPrefix = command.getMetadataPrefix().trim(); + String verb = command.getVerb(); + String fPrefix = command.getMetadataPrefix(); + ValidationUtils.rejectIfEmptyOrWhitespace(pError, "verb", "empyt verb"); if(verb=="GetRecord") ValidationUtils.rejectIfEmptyOrWhitespace(pError, "identifier", "empyt id"); Modified: trunk/oai-pmh_data_provider/data_provider_web/src/main/webapp/WEB-INF/web.xml =================================================================== --- trunk/oai-pmh_data_provider/data_provider_web/src/main/webapp/WEB-INF/web.xml 2009-11-18 18:14:19 UTC (rev 283) +++ trunk/oai-pmh_data_provider/data_provider_web/src/main/webapp/WEB-INF/web.xml 2009-11-18 21:08:06 UTC (rev 284) @@ -35,7 +35,7 @@ <!-- DispatcherServlet --> <!-- ========================================================== --> <servlet> - <servlet-name>TOPServlet</servlet-name> + <servlet-name>top</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> @@ -57,8 +57,8 @@ <!-- url pattern that will be processed by DispatcherServlet --> <!-- ========================================================== --> <servlet-mapping> - <servlet-name>TOPServlet</servlet-name> - <url-pattern>/top/*</url-pattern> + <servlet-name>top</servlet-name> + <url-pattern>/top/oai</url-pattern> </servlet-mapping> <!-- ========================================================== --> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: SourceForge.net <no...@so...> - 2009-11-18 18:32:12
|
Bugs item #2717395, was opened at 2009-03-27 20:10 Message generated for change (Settings changed) made by rvos You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1126676&aid=2717395&group_id=248804 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: data Group: None Status: Open >Priority: 9 Private: No Submitted By: Mark Dominus (mjdominus) Assigned to: Nobody/Anonymous (nobody) Summary: Finish analyzing Consistency checker reports Initial Comment: The consistency checker last ran starting 20090327 and produced about 1000 reports of inconsistencies. These must all be resolved one way or another. ---------------------------------------------------------------------- Comment By: Mark Dominus (mjdominus) Date: 2009-03-30 18:15 Message: Complete report from run of 20090325-2009-0328 is now attached. The numbers in the previous comment are based on an incomplete version of this report. ---------------------------------------------------------------------- Comment By: Mark Dominus (mjdominus) Date: 2009-03-27 20:56 Message: Most of the reports are spurious: 821/945 concern analyses which contain more than one taxonlabelset. But this is not erroneous. Around 124 of the reports are legitimate. Of these, most are of the form: ** PhyloTreeNode 287115 is a leaf but has no TaxonLabel These are probably manifestations of bug #2692361. 25 further messages concern analyses with no trees, no matrices, or no taxonlabelsets. I have asked Bill about these. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1126676&aid=2717395&group_id=248804 |
From: SourceForge.net <no...@so...> - 2009-11-18 18:29:20
|
Bugs item #2810770, was opened at 2009-06-23 08:16 Message generated for change (Settings changed) made by rvos You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1126676&aid=2810770&group_id=248804 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: data Group: None Status: Open >Priority: 9 Private: No Submitted By: Blaise Li (blaiseli) Assigned to: Mark Dominus (mjdominus) Summary: Uncaught Exception for a tree Initial Comment: I get an uncaught exception when I try to see this: http://8ball.sdsc.edu:6666/treebase-web/search/downloadATree.html?id=2345&treeid=1652 (This link was given by a research on trees having 4 taxa. Tree title is Perralderia) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1126676&aid=2810770&group_id=248804 |
From: SourceForge.net <no...@so...> - 2009-11-18 18:25:02
|
Bugs item #2692361, was opened at 2009-03-18 18:27 Message generated for change (Settings changed) made by rvos You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1126676&aid=2692361&group_id=248804 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: data Group: None Status: Open >Priority: 9 Private: No Submitted By: Mark Dominus (mjdominus) >Assigned to: Rutger Vos (rvos) Summary: Botched tree loading Initial Comment: Study #235 has 7 trees; each has only one phylotreenode. This is wrong. The trees are defined in the dump file treebase-data/tree/A160c2x6x96c17c39c42.tre, attached with this bug report. They are supposed to have around 13 leaf nodes each. The (erroneous) versions in the database now are as follows: | | | |-PhyloTree #4347 (T373c2x6x96c17c40c07) | | | |-PhyloTree #4348 (T374c2x6x96c17c40c12) | | | |-PhyloTree #4349 (T375c2x6x96c17c40c15) | | | |-PhyloTree #4350 (T376c2x6x96c17c40c18) | | | |-PhyloTree #4351 (T377c2x6x96c17c40c22) | | | |-PhyloTree #4352 (T378c2x6x96c17c40c25) | | | |-PhyloTree #4353 (T379c2x6x96c17c40c28) There may be many other such erroneous trees in the database; a query finds 86 trees with NTAX < 2. Figure out what went wrong. Reload the broken trees and reattach them to the studies. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1126676&aid=2692361&group_id=248804 |
From: SourceForge.net <no...@so...> - 2009-11-18 18:23:53
|
Bugs item #2798604, was opened at 2009-05-29 21:21 Message generated for change (Comment added) made by rvos You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1126676&aid=2798604&group_id=248804 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: data Group: None Status: Open >Priority: 7 Private: No Submitted By: Blaise Li (blaiseli) >Assigned to: Rutger Vos (rvos) Summary: no block of taxa could be created from a MrBayes .con tree Initial Comment: The upoad of the attached file fails: it says it cannot generate a block of taxa. This is either a bug or a strong limitation: the file contains a nexus tree obtained from MrBayes; it should not be so special. ---------------------------------------------------------------------- >Comment By: Rutger Vos (rvos) Date: 2009-11-18 18:23 Message: This has been downgraded. We can't fix this unless mesquite gets fixed. If people want to upload mrbayes files they will have to run them through mesquite first on their own machines. ---------------------------------------------------------------------- Comment By: Rutger Vos (rvos) Date: 2009-06-27 07:31 Message: The issue is because, although mesquite *can* create a taxa block on the fly while reading a tree block without a translation table, it doesn't want to. It prods the user for feedback, which makes the import hang in headless mode. Bill has emailed the Maddisons about this, and it looks like the issue could certainly be fixed in their code (even if that would make it some sort of treebase special). But - then we have to fold that change into our previous treebase special version of mesquite, which was a snapshot roughly at version 2.1, and we're now at 2.6. I did some testing and some methods have changed or have been removed, so we would need to adapt our code base to that new api. ---------------------------------------------------------------------- Comment By: William Piel (sfrgpiel) Date: 2009-06-23 14:29 Message: This looks like a difficult bug to fix because the problem stems from Mesquite. I'm puzzled why Mesquite cannot create a default taxon block from a tree block that does not use a translation table. I've tried opening trees like this in Mesquite v. 2 with no success... ---------------------------------------------------------------------- Comment By: William Piel (sfrgpiel) Date: 2009-06-23 14:29 Message: Thanks for reporting this bug. We'll look into it as soon as possible. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1126676&aid=2798604&group_id=248804 |
From: SourceForge.net <no...@so...> - 2009-11-18 18:17:52
|
Bugs item #2897427, was opened at 2009-11-13 20:09 Message generated for change (Comment added) made by rvos You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1126676&aid=2897427&group_id=248804 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: ui Group: None >Status: Closed Priority: 9 Private: No Submitted By: William Piel (sfrgpiel) >Assigned to: Rutger Vos (rvos) Summary: Cannot create new submission Initial Comment: When I try to create a new submission in the nescent-dev build, I get a data access failure. (below) ================== Data Access Failure Could not execute JDBC batch update; nested exception is org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update org.springframework.dao.DataIntegrityViolationException: Could not execute JDBC batch update; nest ... [etc] ---------------------------------------------------------------------- >Comment By: Rutger Vos (rvos) Date: 2009-11-18 18:17 Message: The bug happened because IDs were not being autoincremented correctly. This has been fixed by changing the autoincrement strategy from AUTO (which was appropriate for DB2) to SEQUENCE (which is how postgres does it). ---------------------------------------------------------------------- Comment By: Rutger Vos (rvos) Date: 2009-11-18 18:17 Message: Your bug has been resolved. Thanks for the report. ---------------------------------------------------------------------- Comment By: Rutger Vos (rvos) Date: 2009-11-17 17:03 Message: I think this is due to the fact that EhCache (the plug in that caches stuff before committing) can't write its files to /tmp. This also affects searching, but clearly not in the same way. I have filed this as a support request to nescent, hopefully they can sort this out. ---------------------------------------------------------------------- Comment By: Rutger Vos (rvos) Date: 2009-11-17 17:03 Message: Thanks for reporting this bug. We'll look into it as soon as possible. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1126676&aid=2897427&group_id=248804 |
From: <rv...@us...> - 2009-11-18 18:14:30
|
Revision: 283 http://treebase.svn.sourceforge.net/treebase/?rev=283&view=rev Author: rvos Date: 2009-11-18 18:14:19 +0000 (Wed, 18 Nov 2009) Log Message: ----------- Added postgres sequences for autoincrementing id columns Modified Paths: -------------- trunk/treebase-core/src/main/resources/TBASE2_POSTGRES_CREATION.sql Modified: trunk/treebase-core/src/main/resources/TBASE2_POSTGRES_CREATION.sql =================================================================== --- trunk/treebase-core/src/main/resources/TBASE2_POSTGRES_CREATION.sql 2009-11-18 17:51:00 UTC (rev 282) +++ trunk/treebase-core/src/main/resources/TBASE2_POSTGRES_CREATION.sql 2009-11-18 18:14:19 UTC (rev 283) @@ -1732,6 +1732,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE algorithm OWNER TO postgres; +CREATE SEQUENCE algorithm_id_sequence; +ALTER TABLE algorithm ALTER COLUMN algorithm_id SET DEFAULT nextval('algorithm_id_sequence'); +-- alter sequence ancestralstate_id_sequence restart with 4519; -- CREATE TABLE JRUAN.ANALYSIS ( -- ANALYSIS_ID BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20) NOT NULL, @@ -1755,6 +1758,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE analysis OWNER TO postgres; +CREATE SEQUENCE analysis_id_sequence; +ALTER TABLE analysis ALTER COLUMN analysis_id SET DEFAULT nextval('analysis_id_sequence'); +-- alter sequence analysis_id_sequence restart with 4512; -- CREATE TABLE JRUAN.ANALYSISSTEP ( -- ANALYSISSTEP_ID BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20) NOT NULL, @@ -1784,6 +1790,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE analysisstep OWNER TO postgres; +CREATE SEQUENCE analysisstep_id_sequence; +ALTER TABLE analysisstep ALTER COLUMN analysisstep_id SET DEFAULT nextval('analysisstep_id_sequence'); +-- alter sequence analysisstep_id_sequence restart with 4517; -- CREATE TABLE JRUAN.ANALYZEDDATA ( -- TYPE CHARACTER(1) NOT NULL, @@ -1811,6 +1820,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE analyzeddata OWNER TO postgres; +CREATE SEQUENCE analyzeddata_id_sequence; +ALTER TABLE analyzeddata ALTER COLUMN analyzeddata_id SET DEFAULT nextval('analyzeddata_id_sequence'); +-- alter sequence analyzeddata_id_sequence restart with 10417; -- CREATE TABLE JRUAN.ANCESTRALSTATE ( -- TYPE CHARACTER(1) NOT NULL, @@ -1834,6 +1846,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE ancestralstate OWNER TO postgres; +CREATE SEQUENCE ancestralstate_id_sequence; +ALTER TABLE ancestralstate ALTER COLUMN ancestralstate_id SET DEFAULT nextval('ancestralstate_id_sequence'); +-- alter sequence ancestralstate_id_sequence restart with 1; -- CREATE TABLE JRUAN.ANCSTATESET ( -- ANCSTATESET_ID BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20) NOT NULL, @@ -1851,6 +1866,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE ancstateset OWNER TO postgres; +CREATE SEQUENCE ancstateset_id_sequence; +ALTER TABLE ancstateset ALTER COLUMN ancstateset_id SET DEFAULT nextval('ancstateset_id_sequence'); +-- alter sequence ancestralstate_id_sequence restart with 1; -- CREATE TABLE JRUAN.CHARGROUP_COLRANGE ( -- CHARGROUP_ID BIGINT NOT NULL, @@ -1881,6 +1899,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE chargroup OWNER TO postgres; +CREATE SEQUENCE chargroup_id_sequence; +ALTER TABLE chargroup ALTER COLUMN chargroup_id SET DEFAULT nextval('chargroup_id_sequence'); +-- alter sequence ancestralstate_id_sequence restart with 913; -- CREATE TABLE JRUAN.CHARPARTITION ( -- CHARPARTITION_ID BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20) NOT NULL, @@ -1898,6 +1919,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE charpartition OWNER TO postgres; +CREATE SEQUENCE charpartition_id_sequence; +ALTER TABLE charpartition ALTER COLUMN charpartition_id SET DEFAULT nextval('charpartition_id_sequence'); +-- alter sequence ancestralstate_id_sequence restart with 303; -- CREATE TABLE JRUAN.CHARSET_COLRANGE ( -- CHARSET_ID BIGINT NOT NULL, @@ -1930,6 +1954,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE charset OWNER TO postgres; +CREATE SEQUENCE charset_id_sequence; +ALTER TABLE charset ALTER COLUMN charset_id SET DEFAULT nextval('charset_id_sequence'); +-- alter sequence ancestralstate_id_sequence restart with 6190; -- CREATE TABLE JRUAN.CHARWEIGHT_COLRANGE ( -- CHARWEIGHT_ID BIGINT NOT NULL, @@ -1964,6 +1991,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE charweight OWNER TO postgres; +CREATE SEQUENCE charweight_id_sequence; +ALTER TABLE charweight ALTER COLUMN charweight_id SET DEFAULT nextval('charweight_id_sequence'); +-- alter sequence charweight_id_sequence restart with 1; -- CREATE TABLE JRUAN.CHARWEIGHTSET ( -- CHARWEIGHTSET_ID BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20) NOT NULL, @@ -1981,6 +2011,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE charweightset OWNER TO postgres; +CREATE SEQUENCE charweightset_id_sequence; +ALTER TABLE charweightset ALTER COLUMN charweightset_id SET DEFAULT nextval('charweightset_id_sequence'); +-- alter sequence charweightset_id_sequence restart with 113; -- CREATE TABLE JRUAN.CITATION_AUTHOR ( -- CITATION_ID BIGINT NOT NULL, @@ -2062,6 +2095,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE citation OWNER TO postgres; +CREATE SEQUENCE citation_id_sequence; +ALTER TABLE citation ALTER COLUMN citation_id SET DEFAULT nextval('citation_id_sequence'); +-- alter sequence citation_id_sequence restart with 2045; -- CREATE TABLE JRUAN.CITATIONSTATUS ( -- CITATIONSTATUS_ID BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20) NOT NULL, @@ -2077,6 +2113,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE citationstatus OWNER TO postgres; +CREATE SEQUENCE citationstatus_id_sequence; +ALTER TABLE citationstatus ALTER COLUMN citationstatus_id SET DEFAULT nextval('citationstatus_id_sequence'); +-- alter sequence citationstatus_id_sequence restart with 6; -- CREATE TABLE JRUAN.CODERECORD_COLRANGE ( -- GENETICCODERECORD_ID BIGINT NOT NULL, @@ -2159,6 +2198,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE codonpositionset OWNER TO postgres; +CREATE SEQUENCE codonpositionset_id_sequence; +ALTER TABLE codonpositionset ALTER COLUMN codonpositionset_id SET DEFAULT nextval('codonpositionset_id_sequence'); +-- alter sequence codonpositionset_id_sequence restart with 4320; -- CREATE TABLE JRUAN.COLUMNRANGE ( -- COLUMNRANGE_ID BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20) NOT NULL, @@ -2178,6 +2220,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE columnrange OWNER TO postgres; +CREATE SEQUENCE columnrange_id_sequence; +ALTER TABLE columnrange ALTER COLUMN columnrange_id SET DEFAULT nextval('columnrange_id_sequence'); +-- alter sequence columnrange_id_sequence restart with 255320; -- CREATE TABLE JRUAN.COMPOUND_ELEMENT ( -- COMPOUND_ID BIGINT NOT NULL, @@ -2223,6 +2268,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE cstreenode OWNER TO postgres; +CREATE SEQUENCE cstreenode_id_sequence; +ALTER TABLE cstreenode ALTER COLUMN cstreenode_id SET DEFAULT nextval('cstreenode_id_sequence'); +-- alter sequence cstreenode_id_sequence restart with 1; -- CREATE TABLE JRUAN.DISCRETECHARSTATE ( -- DISCRETECHARSTATE_ID BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20) NOT NULL, @@ -2248,6 +2296,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE discretecharstate OWNER TO postgres; +CREATE SEQUENCE discretecharstate_id_sequence; +ALTER TABLE discretecharstate ALTER COLUMN discretecharstate_id SET DEFAULT nextval('discretecharstate_id_sequence'); +-- alter sequence discretecharstate_id_sequence restart with 169616; -- CREATE TABLE JRUAN.DISTANCEMATRIXELEMENT ( -- DISTANCEMATRIXELEMENT_ID BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20) NOT NULL, @@ -2269,6 +2320,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE distancematrixelement OWNER TO postgres; +CREATE SEQUENCE distancematrixelement_id_sequence; +ALTER TABLE distancematrixelement ALTER COLUMN distancematrixelement_id SET DEFAULT nextval('distancematrixelement_id_sequence'); +-- alter sequence distancematrixelement_id_sequence restart with 1; -- CREATE TABLE JRUAN.EXPLAIN_ARGUMENT ( -- EXPLAIN_REQUESTER VARCHAR(128) NOT NULL, @@ -2463,6 +2517,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE gapmode OWNER TO postgres; +CREATE SEQUENCE gapmode_id_sequence; +ALTER TABLE gapmode ALTER COLUMN gapmode_id SET DEFAULT nextval('gapmode_id_sequence'); +-- alter sequence gapmode_id_sequence restart with 3; -- CREATE TABLE JRUAN.GENETICCODE ( -- GENETICCODE_ID BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20) NOT NULL, @@ -2488,6 +2545,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE geneticcode OWNER TO postgres; +CREATE SEQUENCE geneticcode_id_sequence; +ALTER TABLE geneticcode ALTER COLUMN geneticcode_id SET DEFAULT nextval('geneticcode_id_sequence'); +-- alter sequence geneticcode_id_sequence restart with 1; -- CREATE TABLE JRUAN.GENETICCODERECORD ( -- GENETICCODERECORD_ID BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20) NOT NULL, @@ -2505,6 +2565,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE geneticcoderecord OWNER TO postgres; +CREATE SEQUENCE geneticcoderecord_id_sequence; +ALTER TABLE geneticcoderecord ALTER COLUMN geneticcoderecord_id SET DEFAULT nextval('geneticcoderecord_id_sequence'); +-- alter sequence geneticcoderecord_id_sequence restart with 1; -- CREATE TABLE JRUAN.GENETICCODESET ( -- GENETICCODESET_ID BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20) NOT NULL, @@ -2524,8 +2587,10 @@ ) WITH (OIDS=FALSE); ALTER TABLE geneticcodeset OWNER TO postgres; +CREATE SEQUENCE geneticcodeset_id_sequence; +ALTER TABLE geneticcodeset ALTER COLUMN geneticcodeset_id SET DEFAULT nextval('geneticcodeset_id_sequence'); +-- alter sequence geneticcodeset_id_sequence restart with 1; - -- CREATE TABLE JRUAN.GEOSPOT ( -- GEOSPOT_ID BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20) NOT NULL, -- VERSION INTEGER, @@ -2548,6 +2613,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE geospot OWNER TO postgres; +CREATE SEQUENCE geospot_id_sequence; +ALTER TABLE geospot ALTER COLUMN geospot_id SET DEFAULT nextval('geospot_id_sequence'); +-- alter sequence geospot_id_sequence restart with 1; -- CREATE TABLE JRUAN.HELP ( -- HELP_ID BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20) NOT NULL, @@ -2565,6 +2633,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE help OWNER TO postgres; +CREATE SEQUENCE help_id_sequence; +ALTER TABLE help ALTER COLUMN help_id SET DEFAULT nextval('help_id_sequence'); +-- alter sequence help_id_sequence restart with 38; -- CREATE TABLE JRUAN.ITEMDEFINITION ( -- ITEMDEFINITION_ID BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20) NOT NULL, @@ -2580,6 +2651,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE itemdefinition OWNER TO postgres; +CREATE SEQUENCE itemdefinition_id_sequence; +ALTER TABLE itemdefinition ALTER COLUMN itemdefinition_id SET DEFAULT nextval('itemdefinition_id_sequence'); +-- alter sequence itemdefinition_id_sequence restart with 9; -- CREATE TABLE JRUAN.ITEMVALUE ( -- ITEMVALUE_ID BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20) NOT NULL, @@ -2597,6 +2671,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE itemvalue OWNER TO postgres; +CREATE SEQUENCE itemvalue_id_sequence; +ALTER TABLE itemvalue ALTER COLUMN itemvalue_id SET DEFAULT nextval('itemvalue_id_sequence'); +-- alter sequence itemvalue_id_sequence restart with 1; -- CREATE TABLE JRUAN.LEFTCHANGESET_CHARSTATE ( -- STATECHANGESET_ID BIGINT NOT NULL, @@ -2685,6 +2762,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE matrix OWNER TO postgres; +CREATE SEQUENCE matrix_id_sequence; +ALTER TABLE matrix ALTER COLUMN matrix_id SET DEFAULT nextval('matrix_id_sequence'); +-- alter sequence matrix_id_sequence restart with 3786; -- CREATE TABLE JRUAN.MATRIXCOLUMN_ITEMDEFINITION ( -- MATRIXCOLUMN_ID BIGINT NOT NULL, @@ -2719,6 +2799,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE matrixcolumn OWNER TO postgres; +CREATE SEQUENCE matrixcolumn_id_sequence; +ALTER TABLE matrixcolumn ALTER COLUMN matrixcolumn_id SET DEFAULT nextval('matrixcolumn_id_sequence'); +-- alter sequence matrixcolumn_id_sequence restart with 5681073; -- CREATE TABLE JRUAN.MATRIXDATATYPE ( -- MATRIXDATATYPE_ID BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20) NOT NULL, @@ -2736,6 +2819,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE matrixdatatype OWNER TO postgres; +CREATE SEQUENCE matrixdatatype_id_sequence; +ALTER TABLE matrixdatatype ALTER COLUMN matrixdatatype_id SET DEFAULT nextval('matrixdatatype_id_sequence'); +-- alter sequence matrixdatatype_id_sequence restart with 8; -- CREATE TABLE JRUAN.MATRIXELEMENT ( -- TYPE CHARACTER(1) NOT NULL, @@ -2769,6 +2855,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE matrixelement OWNER TO postgres; +CREATE SEQUENCE matrixelement_id_sequence; +ALTER TABLE matrixelement ALTER COLUMN matrixelement_id SET DEFAULT nextval('matrixelement_id_sequence'); +-- alter sequence matrixelement_id_sequence restart with 304732573; -- CREATE TABLE JRUAN.MATRIXKIND ( -- MATRIXKIND_ID BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20) NOT NULL, @@ -2784,6 +2873,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE matrixkind OWNER TO postgres; +CREATE SEQUENCE matrixkind_id_sequence; +ALTER TABLE matrixkind ALTER COLUMN matrixkind_id SET DEFAULT nextval('matrixkind_id_sequence'); +-- alter sequence matrixkind_id_sequence restart with 12; -- CREATE TABLE JRUAN.MATRIXROW ( -- MATRIXROW_ID BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20) NOT NULL, @@ -2805,6 +2897,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE matrixrow OWNER TO postgres; +CREATE SEQUENCE matrixrow_id_sequence; +ALTER TABLE matrixrow ALTER COLUMN matrixrow_id SET DEFAULT nextval('matrixrow_id_sequence'); +-- alter sequence matrixrow_id_sequence restart with 181845; -- CREATE TABLE JRUAN.NODEATTRIBUTE ( -- NODEATTRIBUTE_ID BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20) NOT NULL, @@ -2818,6 +2913,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE nodeattribute OWNER TO postgres; +CREATE SEQUENCE nodeattribute_id_sequence; +ALTER TABLE nodeattribute ALTER COLUMN nodeattribute_id SET DEFAULT nextval('nodeattribute_id_sequence'); +-- alter sequence nodeattribute_id_sequence restart with 1; -- CREATE TABLE JRUAN.PERSON ( -- PERSON_ID BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20) NOT NULL, @@ -2843,6 +2941,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE person OWNER TO postgres; +CREATE SEQUENCE person_id_sequence; +ALTER TABLE person ALTER COLUMN person_id SET DEFAULT nextval('person_id_sequence'); +-- alter sequence person_id_sequence restart with 4326; -- CREATE TABLE JRUAN.PHYLOCHAR ( -- TYPE CHARACTER(1) NOT NULL, @@ -2864,6 +2965,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE phylochar OWNER TO postgres; +CREATE SEQUENCE phylochar_id_sequence; +ALTER TABLE phylochar ALTER COLUMN phylochar_id SET DEFAULT nextval('phylochar_id_sequence'); +-- alter sequence phylochar_id_sequence restart with 32758; -- CREATE TABLE JRUAN.PHYLOTREE ( -- PHYLOTREE_ID BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20) NOT NULL, @@ -2909,6 +3013,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE phylotree OWNER TO postgres; +CREATE SEQUENCE phylotree_id_sequence; +ALTER TABLE phylotree ALTER COLUMN phylotree_id SET DEFAULT nextval('phylotree_id_sequence'); +-- alter sequence phylotree_id_sequence restart with 5614; -- CREATE TABLE JRUAN.PHYLOTREENODE ( -- PHYLOTREENODE_ID BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20) NOT NULL, @@ -2944,6 +3051,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE phylotreenode OWNER TO postgres; +CREATE SEQUENCE phylotreenode_id_sequence; +ALTER TABLE phylotreenode ALTER COLUMN phylotreenode_id SET DEFAULT nextval('phylotreenode_id_sequence'); +-- alter sequence phylotreenode_id_sequence restart with 430424; -- CREATE TABLE JRUAN.POLYTCOUNT ( -- POLYTCOUNT_ID BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20) NOT NULL, @@ -2959,6 +3069,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE polytcount OWNER TO postgres; +CREATE SEQUENCE polytcount_id_sequence; +ALTER TABLE polytcount ALTER COLUMN polytcount_id SET DEFAULT nextval('polytcount_id_sequence'); +-- alter sequence polytcount_id_sequence restart with 3; -- CREATE TABLE JRUAN.RIGHTCHANGESET_CHARSTATE ( -- STATECHANGESET_ID BIGINT NOT NULL, @@ -3023,6 +3136,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE rowsegment OWNER TO postgres; +CREATE SEQUENCE rowsegment_id_sequence; +ALTER TABLE rowsegment ALTER COLUMN rowsegment_id SET DEFAULT nextval('rowsegment_id_sequence'); +-- alter sequence rowsegment_id_sequence restart with 1; -- CREATE TABLE JRUAN.SOFTWARE ( -- SOFTWARE_ID BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20) NOT NULL, @@ -3044,6 +3160,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE software OWNER TO postgres; +CREATE SEQUENCE software_id_sequence; +ALTER TABLE software ALTER COLUMN software_id SET DEFAULT nextval('software_id_sequence'); +-- alter sequence software_id_sequence restart with 4499; -- CREATE TABLE JRUAN.SPECIMENLABEL ( -- SPECIMENLABEL_ID BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20) NOT NULL, @@ -3069,6 +3188,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE specimenlabel OWNER TO postgres; +CREATE SEQUENCE specimenlabel_id_sequence; +ALTER TABLE specimenlabel ALTER COLUMN specimenlabel_id SET DEFAULT nextval('specimenlabel_id_sequence'); +-- alter sequence specimenlabel_id_sequence restart with 4499; -- CREATE TABLE JRUAN.STATECHANGESET ( -- STATECHANGESET_ID BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20) NOT NULL, @@ -3086,6 +3208,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE statechangeset OWNER TO postgres; +CREATE SEQUENCE statechangeset_id_sequence; +ALTER TABLE statechangeset ALTER COLUMN statechangeset_id SET DEFAULT nextval('statechangeset_id_sequence'); +-- alter sequence statechangeset_id_sequence restart with 1; -- CREATE TABLE JRUAN.STATEFORMAT ( -- STATEFORMAT_ID BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20) NOT NULL, @@ -3101,6 +3226,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE stateformat OWNER TO postgres; +CREATE SEQUENCE stateformat_id_sequence; +ALTER TABLE stateformat ALTER COLUMN stateformat_id SET DEFAULT nextval('stateformat_id_sequence'); +-- alter sequence stateformat_id_sequence restart with 5; -- CREATE TABLE JRUAN.STATEMODIFIER ( -- STATEMODIFIER_ID BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20) NOT NULL, @@ -3124,6 +3252,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE statemodifier OWNER TO postgres; +CREATE SEQUENCE statemodifier_id_sequence; +ALTER TABLE statemodifier ALTER COLUMN statemodifier_id SET DEFAULT nextval('statemodifier_id_sequence'); +-- alter sequence statemodifier_id_sequence restart with 1; -- CREATE TABLE JRUAN.STATESET ( -- STATESET_ID BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20) NOT NULL, @@ -3141,6 +3272,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE stateset OWNER TO postgres; +CREATE SEQUENCE stateset_id_sequence; +ALTER TABLE stateset ALTER COLUMN stateset_id SET DEFAULT nextval('stateset_id_sequence'); +-- alter sequence stateset_id_sequence restart with 1; -- CREATE TABLE JRUAN.STEPMATRIXELEMENT ( -- DISCRETECHARSTATE_ID BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20) NOT NULL, @@ -3208,6 +3342,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE study OWNER TO postgres; +CREATE SEQUENCE study_id_sequence; +ALTER TABLE study ALTER COLUMN study_id SET DEFAULT nextval('study_id_sequence'); +-- alter sequence study_id_sequence restart with 2067; -- CREATE TABLE JRUAN.STUDYSTATUS ( -- STUDYSTATUS_ID BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20) NOT NULL, @@ -3223,6 +3360,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE studystatus OWNER TO postgres; +CREATE SEQUENCE studystatus_id_sequence; +ALTER TABLE studystatus ALTER COLUMN studystatus_id SET DEFAULT nextval('studystatus_id_sequence'); +-- alter sequence studystatus_id_sequence restart with 4; -- CREATE TABLE JRUAN.SUB_MATRIX ( -- SUBMISSION_ID BIGINT NOT NULL, @@ -3289,6 +3429,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE submission OWNER TO postgres; +CREATE SEQUENCE submission_id_sequence; +ALTER TABLE submission ALTER COLUMN submission_id SET DEFAULT nextval('submission_id_sequence'); +-- alter sequence submission_id_sequence restart with 2059; -- CREATE TABLE JRUAN.TAXON ( -- TAXON_ID BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20) NOT NULL, @@ -3314,6 +3457,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE taxon OWNER TO postgres; +CREATE SEQUENCE taxon_id_sequence; +ALTER TABLE taxon ALTER COLUMN taxon_id SET DEFAULT nextval('taxon_id_sequence'); +-- alter sequence taxon_id_sequence restart with 424700; -- CREATE TABLE JRUAN.TAXONAUTHORITY ( -- TAXONAUTHORITY_ID BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20) NOT NULL, @@ -3333,6 +3479,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE taxonauthority OWNER TO postgres; +CREATE SEQUENCE taxonauthority_id_sequence; +ALTER TABLE taxonauthority ALTER COLUMN taxonauthority_id SET DEFAULT nextval('taxonauthority_id_sequence'); +-- alter sequence taxonauthority_id_sequence restart with 1; -- CREATE TABLE JRUAN.TAXONLABEL ( -- TAXONLABEL_ID BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20) NOT NULL, @@ -3354,6 +3503,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE taxonlabel OWNER TO postgres; +CREATE SEQUENCE taxonlabel_id_sequence; +ALTER TABLE taxonlabel ALTER COLUMN taxonlabel_id SET DEFAULT nextval('taxonlabel_id_sequence'); +-- alter sequence taxonlabel_id_sequence restart with 231762; -- CREATE TABLE JRUAN.TAXONLABELGROUP ( -- TAXONLABELGROUP_ID BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20) NOT NULL, @@ -3371,6 +3523,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE taxonlabelgroup OWNER TO postgres; +CREATE SEQUENCE taxonlabelgroup_id_sequence; +ALTER TABLE taxonlabelgroup ALTER COLUMN taxonlabelgroup_id SET DEFAULT nextval('taxonlabelgroup_id_sequence'); +-- alter sequence taxonlabelgroup_id_sequence restart with 1; -- CREATE TABLE JRUAN.TAXONLABELPARTITION ( -- TAXONLABELPARTITION_ID BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20) NOT NULL, @@ -3386,6 +3541,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE taxonlabelpartition OWNER TO postgres; +CREATE SEQUENCE taxonlabelpartition_id_sequence; +ALTER TABLE taxonlabelpartition ALTER COLUMN taxonlabelpartition_id SET DEFAULT nextval('taxonlabelpartition_id_sequence'); +-- alter sequence taxonlabelpartition_id_sequence restart with 1; -- CREATE TABLE JRUAN.TAXONLABELROUP_TAXONLABEL ( -- TAXONLABELGROUP_ID BIGINT NOT NULL, @@ -3433,6 +3591,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE taxonlabelset OWNER TO postgres; +CREATE SEQUENCE taxonlabelset_id_sequence; +ALTER TABLE taxonlabelset ALTER COLUMN taxonlabelset_id SET DEFAULT nextval('taxonlabelset_id_sequence'); +-- alter sequence taxonlabelset_id_sequence restart with 13124; -- CREATE TABLE JRUAN.TAXONLINK ( -- LINKTYPE CHARACTER(1) NOT NULL, @@ -3454,6 +3615,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE taxonlink OWNER TO postgres; +CREATE SEQUENCE taxonlink_id_sequence; +ALTER TABLE taxonlink ALTER COLUMN taxonlink_id SET DEFAULT nextval('taxonlink_id_sequence'); +-- alter sequence taxonlink_id_sequence restart with 1; -- CREATE TABLE JRUAN.TAXONSET_TAXON ( -- TAXONSET_ID BIGINT NOT NULL, @@ -3484,6 +3648,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE taxonset OWNER TO postgres; +CREATE SEQUENCE taxonset_id_sequence; +ALTER TABLE taxonset ALTER COLUMN taxonset_id SET DEFAULT nextval('taxonset_id_sequence'); +-- alter sequence taxonset_id_sequence restart with 1; -- CREATE TABLE JRUAN.TAXONVARIANT ( -- TAXONVARIANT_ID BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20) NOT NULL, @@ -3509,6 +3676,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE taxonvariant OWNER TO postgres; +CREATE SEQUENCE taxonvariant_id_sequence; +ALTER TABLE taxonvariant ALTER COLUMN taxonvariant_id SET DEFAULT nextval('taxonvariant_id_sequence'); +-- alter sequence taxonvariant_id_sequence restart with 564260; -- CREATE TABLE JRUAN.TREEATTRIBUTE ( -- TREEATTRIBUTE_ID BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20) NOT NULL, @@ -3522,6 +3692,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE treeattribute OWNER TO postgres; +CREATE SEQUENCE treeattribute_id_sequence; +ALTER TABLE treeattribute ALTER COLUMN treeattribute_id SET DEFAULT nextval('treeattribute_id_sequence'); +-- alter sequence treeattribute_id_sequence restart with 1; -- CREATE TABLE JRUAN.TREEBLOCK ( -- TREEBLOCK_ID BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20) NOT NULL, @@ -3539,6 +3712,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE treeblock OWNER TO postgres; +CREATE SEQUENCE treeblock_id_sequence; +ALTER TABLE treeblock ALTER COLUMN treeblock_id SET DEFAULT nextval('treeblock_id_sequence'); +-- alter sequence treeblock_id_sequence restart with 9028; -- CREATE TABLE JRUAN.TREEGROUP_PHYLOTREE ( -- TREEGROUP_ID BIGINT NOT NULL, @@ -3569,6 +3745,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE treegroup OWNER TO postgres; +CREATE SEQUENCE treegroup_id_sequence; +ALTER TABLE treegroup ALTER COLUMN treegroup_id SET DEFAULT nextval('treegroup_id_sequence'); +-- alter sequence treegroup_id_sequence restart with 1; -- CREATE TABLE JRUAN.TREEKIND ( -- TREEKIND_ID BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20) NOT NULL, @@ -3584,6 +3763,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE treekind OWNER TO postgres; +CREATE SEQUENCE treekind_id_sequence; +ALTER TABLE treekind ALTER COLUMN treekind_id SET DEFAULT nextval('treekind_id_sequence'); +-- alter sequence treekind_id_sequence restart with 7; -- CREATE TABLE JRUAN.TREENODEEDGE ( -- TREENODEEDGE_ID BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20) NOT NULL, @@ -3601,6 +3783,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE treenodeedge OWNER TO postgres; +CREATE SEQUENCE treenodeedge_id_sequence; +ALTER TABLE treenodeedge ALTER COLUMN treenodeedge_id SET DEFAULT nextval('treenodeedge_id_sequence'); +-- alter sequence treenodeedge_id_sequence restart with 1; -- CREATE TABLE JRUAN.TREEPARTITION ( -- TREEPARTITION_ID BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20) NOT NULL, @@ -3616,6 +3801,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE treepartition OWNER TO postgres; +CREATE SEQUENCE treepartition_id_sequence; +ALTER TABLE treepartition ALTER COLUMN treepartition_id SET DEFAULT nextval('treepartition_id_sequence'); +-- alter sequence treepartition_id_sequence restart with 1; -- CREATE TABLE JRUAN.TREEQUALITY ( -- TREEQUALITY_ID BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20) NOT NULL, @@ -3631,6 +3819,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE treequality OWNER TO postgres; +CREATE SEQUENCE treequality_id_sequence; +ALTER TABLE treequality ALTER COLUMN treequality_id SET DEFAULT nextval('treequality_id_sequence'); +-- alter sequence treequality_id_sequence restart with 5; -- CREATE TABLE JRUAN.TREESET_PHYLOTREE ( -- TREESET_ID BIGINT NOT NULL, @@ -3661,6 +3852,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE treeset OWNER TO postgres; +CREATE SEQUENCE treeset_id_sequence; +ALTER TABLE treeset ALTER COLUMN treeset_id SET DEFAULT nextval('treeset_id_sequence'); +-- alter sequence treeset_id_sequence restart with 1; -- CREATE TABLE JRUAN.TREETYPE ( -- TREETYPE_ID BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20) NOT NULL, @@ -3676,6 +3870,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE treetype OWNER TO postgres; +CREATE SEQUENCE treetype_id_sequence; +ALTER TABLE treetype ALTER COLUMN treetype_id SET DEFAULT nextval('treetype_id_sequence'); +-- alter sequence treetype_id_sequence restart with 4; -- CREATE TABLE JRUAN.TYPESET ( -- TYPESET_ID BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20) NOT NULL, @@ -3693,6 +3890,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE typeset OWNER TO postgres; +CREATE SEQUENCE typeset_id_sequence; +ALTER TABLE typeset ALTER COLUMN typeset_id SET DEFAULT nextval('typeset_id_sequence'); +-- alter sequence typeset_id_sequence restart with 1; -- CREATE TABLE JRUAN.USER ( -- USER_ID BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20) NOT NULL, @@ -3714,6 +3914,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE "user" OWNER TO postgres; +CREATE SEQUENCE user_id_sequence; +ALTER TABLE "user" ALTER COLUMN user_id SET DEFAULT nextval('user_id_sequence'); +-- alter sequence user_id_sequence restart with 12; -- CREATE TABLE JRUAN.USERROLE ( -- USERROLE_ID BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20) NOT NULL, @@ -3729,6 +3932,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE userrole OWNER TO postgres; +CREATE SEQUENCE userrole_id_sequence; +ALTER TABLE "userrole" ALTER COLUMN userrole_id SET DEFAULT nextval('userrole_id_sequence'); +-- alter sequence userrole_id_sequence restart with 4; -- CREATE TABLE JRUAN.USERTYPE ( -- TYPE CHARACTER(1) NOT NULL, @@ -3746,6 +3952,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE usertype OWNER TO postgres; +CREATE SEQUENCE usertype_id_sequence; +ALTER TABLE usertype ALTER COLUMN usertype_id SET DEFAULT nextval('usertype_id_sequence'); +-- alter sequence usertype_id_sequence restart with 4; -- CREATE TABLE JRUAN.USERTYPERECORD ( -- USERTYPERECORD_ID BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20) NOT NULL, @@ -3763,6 +3972,9 @@ ) WITH (OIDS=FALSE); ALTER TABLE usertyperecord OWNER TO postgres; +CREATE SEQUENCE usertyperecord_id_sequence; +ALTER TABLE usertyperecord ALTER COLUMN usertyperecord_id SET DEFAULT nextval('usertyperecord_id_sequence'); +-- alter sequence usertyperecord_id_sequence restart with 1; -- CREATE TABLE JRUAN.USERTYPERRD_COLRANGE ( -- USERTYPERECORD_ID BIGINT NOT NULL, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2009-11-18 17:51:32
|
Revision: 282 http://treebase.svn.sourceforge.net/treebase/?rev=282&view=rev Author: rvos Date: 2009-11-18 17:51:00 +0000 (Wed, 18 Nov 2009) Log Message: ----------- Changed GenerationType for IDs from AUTO to SEQUENCE Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/AbstractPersistedObject.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/AbstractPersistedObject.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/AbstractPersistedObject.java 2009-11-18 17:02:31 UTC (rev 281) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/AbstractPersistedObject.java 2009-11-18 17:51:00 UTC (rev 282) @@ -53,7 +53,7 @@ * @see org.cipres.treebase.domain.TBPersistable#getId() */ @Id - @GeneratedValue(strategy = GenerationType.AUTO) + @GeneratedValue(strategy = GenerationType.SEQUENCE) public Long getId() { return mId; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yo...@us...> - 2009-11-18 17:02:46
|
Revision: 281 http://treebase.svn.sourceforge.net/treebase/?rev=281&view=rev Author: youjun Date: 2009-11-18 17:02:31 +0000 (Wed, 18 Nov 2009) Log Message: ----------- clean the config files for deploy Modified Paths: -------------- trunk/oai-pmh_data_provider/data_provider_web/.classpath trunk/oai-pmh_data_provider/data_provider_web/pom.xml trunk/oai-pmh_data_provider/data_provider_web/src/main/webapp/WEB-INF/web.xml trunk/oai-pmh_data_provider/pom.xml Modified: trunk/oai-pmh_data_provider/data_provider_web/.classpath =================================================================== --- trunk/oai-pmh_data_provider/data_provider_web/.classpath 2009-11-18 12:41:37 UTC (rev 280) +++ trunk/oai-pmh_data_provider/data_provider_web/.classpath 2009-11-18 17:02:31 UTC (rev 281) @@ -10,7 +10,6 @@ <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/> </attributes> </classpathentry> - <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/> <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/> <classpathentry kind="output" path="target/classes"/> </classpath> Modified: trunk/oai-pmh_data_provider/data_provider_web/pom.xml =================================================================== --- trunk/oai-pmh_data_provider/data_provider_web/pom.xml 2009-11-18 12:41:37 UTC (rev 280) +++ trunk/oai-pmh_data_provider/data_provider_web/pom.xml 2009-11-18 17:02:31 UTC (rev 281) @@ -65,12 +65,6 @@ </pluginRepositories> <dependencies> - - <!-- dependency> - <groupId>org.treebase.oai</groupId> - <artifactId>data_provider_core</artifactId> - <version>0.0.1-SNAPSHOT</version> - </dependency --> <dependency> <groupId>javax.servlet</groupId> @@ -256,46 +250,7 @@ <artifactId>treebase-core</artifactId> <version>1.0-SNAPSHOT</version> </dependency> - - <!-- used by Spring framework --> - <!--Older ersion not needed--> - <!-- Commented on April 23, 2008 Madhu--> - <!--dependency> - <groupId>javax.activation</groupId> - <artifactId>activation</artifactId> - <version>1.1</version> - </dependency--> - - <!-- used by Spring framework --> - - <!-- Jin 05/12/08: do we need xalan? dependency--> - - <!-- remove 05/13/08 to avoid xml parser conflicts> - <dependency> - <groupId>org.springframework.ws</groupId> - <artifactId>spring-ws-core</artifactId> - <version>1.0.2</version> - </dependency> - --> - - <!-- remove 05/13/08 to avoid xml parser conflicts.> - <dependency> - <groupId>jaxen</groupId> - <artifactId>jaxen</artifactId> - <version>1.1</version> - </dependency> - --> - - <!--commented on April 23, 2008 Madhu--> - <!--dependency> - <groupId>com.sun.xml.messaging.saaj</groupId> - <artifactId>saaj-impl</artifactId> - <version>1.3</version> - <scope>runtime</scope> - </dependency--> - - </dependencies> <dependencyManagement> <dependencies> Modified: trunk/oai-pmh_data_provider/data_provider_web/src/main/webapp/WEB-INF/web.xml =================================================================== --- trunk/oai-pmh_data_provider/data_provider_web/src/main/webapp/WEB-INF/web.xml 2009-11-18 12:41:37 UTC (rev 280) +++ trunk/oai-pmh_data_provider/data_provider_web/src/main/webapp/WEB-INF/web.xml 2009-11-18 17:02:31 UTC (rev 281) @@ -73,6 +73,6 @@ <!-- ========================================================== --> <!-- Error Pages --> <!-- ========================================================== --> - <!-- or errors will return as oai-pmh exception based on .vm files --> + <!-- all errors will return as oai-pmh exception based on .vm files --> </web-app> Modified: trunk/oai-pmh_data_provider/pom.xml =================================================================== --- trunk/oai-pmh_data_provider/pom.xml 2009-11-18 12:41:37 UTC (rev 280) +++ trunk/oai-pmh_data_provider/pom.xml 2009-11-18 17:02:31 UTC (rev 281) @@ -7,24 +7,6 @@ <version>0.0.1-SNAPSHOT</version> <name>oai-pmh_data_provider</name> <url>http://maven.apache.org</url> - <!-- issueManagement> - <system>FogBugz</system> - <url>https://www.xxx.org/bugz</url> - </issueManagement--> - <!-- inceptionYear></inceptionYear--> - <!-- scm> - <connection>scm:svn:http://nladr-cvs.sdsc.edu/svn/CIPRES/treebase/trunk</connection> - <developerConnection>scm:svn:http://nladr-cvs.sdsc.edu/svn/CIPRES/treebase/trunk</developerConnection> - <url>http://nladr-cvs.sdsc.edu/svn/cipresdev/trunk</url> - </scm--> - <!-- mailingLists> - <mailingList> - <name>treebase-dev</name> - <subscribe></subscribe> - <unsubscribe></unsubscribe> - <archive></archive> - </mailingList> - </mailingLists --> <developers> <developer> <id>youjun</id> @@ -90,45 +72,7 @@ <plugin> <artifactId>maven-clover-plugin</artifactId> </plugin> - <!-- plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-jxr-plugin</artifactId> - </plugin --> - <!-- plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-javadoc-plugin</artifactId> - <configuration> - <links> - <link>http://java.sun.com/j2se/1.4.2/docs/api</link> - <link>http://plexus.codehaus.org/ref/1.0-alpha-9/apidocs</link> - </links> - <aggregate>true</aggregate> - </configuration> - </plugin --> - <!-- plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-pmd-plugin</artifactId> - <configuration> - <targetjdk>1.5</targetjdk> - <rulesets> - <ruleset>/rulesets/basic.xml</ruleset> - <ruleset>/rulesets/imports.xml</ruleset> - <ruleset>/rulesets/unusedcode.xml</ruleset> - <ruleset>/rulesets/finalizers.xml</ruleset> - </rulesets> - <format>xml</format> - <linkXref>true</linkXref> - <sourceEncoding>utf-8</sourceEncoding> - <minimumTokens>100</minimumTokens> - </configuration> - </plugin --> - <!-- plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-checkstyle-plugin</artifactId> - <configuration> - <configLocation>config/maven_checks.xml</configLocation> - </configuration> - </plugin --> + <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>taglist-maven-plugin</artifactId> @@ -154,11 +98,7 @@ <dependencyManagement> <dependencies> - <!-- dependency> - <groupId>org.treebase.oai</groupId> - <artifactId>data_provider_core</artifactId> - <version>${project.version}</version> - </dependency --> + <dependency> <groupId>org.treebase.oai</groupId> <artifactId>data_provider_web</artifactId> @@ -218,54 +158,5 @@ <profiles> - <!--profile> - <id>xxx</id> - <activation> - <property> - <name>enablexxxprofile</name> - <value>true</value> - </property> - </activation> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-pmd-plugin</artifactId> - <executions> - <execution> - <goals> - <goal>check</goal> - </goals> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>cobertura-maven-plugin</artifactId> - <configuration> - <check> - <totalLineRate>80</totalLineRate> - <totalBranchRate>100</totalBranchRate> - </check> - </configuration> - <executions> - <execution> - <id>clean</id> - <goals> - <goal>clean</goal> - </goals> - </execution> - <execution> - <id>check</id> - <goals> - <goal>check</goal> - </goals> - </execution> - </executions> - </plugin> - </plugins> - </build> - </profile--> - </profiles> </project> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: SourceForge.net <no...@so...> - 2009-11-18 13:41:36
|
Bugs item #2861595, was opened at 2009-09-18 18:01 Message generated for change (Comment added) made by rvos You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1126676&aid=2861595&group_id=248804 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: ui Group: None >Status: Closed Priority: 5 Private: No Submitted By: Ryan Scherle (rscherle) >Assigned to: Rutger Vos (rvos) Summary: matrices cannot be viewed Initial Comment: When I click on the ID for a matrix, or any of the download icons, I receive an error from Hibernate. ---------------------------------------------------------------------- >Comment By: Rutger Vos (rvos) Date: 2009-11-18 13:41 Message: This bug was caused by an incorrect mapping between the database type and its java representation. When we were using DB2, nexus strings were stored as CLOBs and needed to be converted to String objects in the client code. Now that we're using PostgreSQL nexus strings are stored as TEXT and are automatically converted to Strings by Hibernate. However, the old CLOB handling code was still littered all over the code base. This has now been corrected. Matrices (and trees) now download correctly. ---------------------------------------------------------------------- Comment By: Rutger Vos (rvos) Date: 2009-11-18 13:41 Message: Your bug has been resolved. Thanks for the report. ---------------------------------------------------------------------- Comment By: William Piel (sfrgpiel) Date: 2009-09-19 14:00 Message: This seems to be related to PhyloWS. If you try to download a matrix from the search tabs, it works. e.g: http://8ball.sdsc.edu:6666/treebase-web/search/downloadAMatrix.html?id=1282&matrixid=2855 But if you try to download the very same matrix after tunneling through the study, the method used is not with PhyloWS, and the result throws and uncaught exception: http://8ball.sdsc.edu:6666/treebase-web/phylows/matrix/TB2:M2855?format=nexus ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1126676&aid=2861595&group_id=248804 |
From: <rv...@us...> - 2009-11-18 12:41:44
|
Revision: 280 http://treebase.svn.sourceforge.net/treebase/?rev=280&view=rev Author: rvos Date: 2009-11-18 12:41:37 +0000 (Wed, 18 Nov 2009) Log Message: ----------- Changed nexus file contents type from Clob (which we used under DB2) to Text (which we use under postgres), which is mapped onto a string by hibernate. Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/TreebaseUtil.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Study.java trunk/treebase-core/src/main/java/org/cipres/treebase/service/study/StudyServiceImpl.java trunk/treebase-core/src/main/java/org/cipres/treebase/util/RawNexusImporter.java trunk/treebase-core/src/main/java/org/cipres/treebase/util/RebuildNexusFiletable.java trunk/treebase-core/src/main/java/org/cipres/treebase/util/RepatriateData.java trunk/treebase-core/src/test/java/org/cipres/treebase/dao/study/StudyDAOTest.java trunk/treebase-core/src/test/java/org/cipres/treebase/service/study/StudyServiceImplTest.java trunk/treebase-core/src/test/java/org/cipres/treebase/service/study/SubmissionServiceImplTest.java trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/DownloadANexusFileController.java trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/NexusFilesController.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/TreebaseUtil.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/TreebaseUtil.java 2009-11-18 12:25:46 UTC (rev 279) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/TreebaseUtil.java 2009-11-18 12:41:37 UTC (rev 280) @@ -1,6 +1,10 @@ package org.cipres.treebase; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Arrays; @@ -136,7 +140,42 @@ return buf.toString(); } + + /** + * Reads the contents of a file into a string + * @param file + * @return file contents as string + */ + public static String readFileToString(File file) { + StringBuilder contents = new StringBuilder(); + try { + //use buffering, reading one line at a time + //FileReader always assumes default encoding is OK! + BufferedReader input = new BufferedReader(new FileReader(file)); + try { + String line = null; //not declared within while loop + /* + * readLine is a bit quirky : + * it returns the content of a line MINUS the newline. + * it returns null only for the END of the stream. + * it returns an empty String if two newlines appear in a row. + */ + while (( line = input.readLine()) != null){ + contents.append(line); + contents.append(System.getProperty("line.separator")); + } + } + finally { + input.close(); + } + } + catch (IOException ex){ + ex.printStackTrace(); + } + return contents.toString(); + } + /** * For Testing use. Output the content of the array to a string. If the all element parameter is * false, output only the first 10 elements. Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Study.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Study.java 2009-11-18 12:25:46 UTC (rev 279) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Study.java 2009-11-18 12:41:37 UTC (rev 280) @@ -1,6 +1,5 @@ package org.cipres.treebase.domain.study; -import java.sql.Clob; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -72,7 +71,7 @@ private List<Analysis> mAnalyses = new ArrayList<Analysis>(); private Set<TaxonLabelSet> mTaxonLabelSets = new HashSet<TaxonLabelSet>(); - private Map<String, Clob> mNexusFiles = new HashMap<String, Clob>(); + private Map<String, String> mNexusFiles = new HashMap<String, String>(); // transient fields private String mTransientDescription; @@ -318,14 +317,14 @@ // @Cascade(org.hibernate.annotations.CascadeType.DELETE_ORPHAN) // @Cache(usage = CacheConcurrencyStrategy.READ_WRITE, region = "studyCache") // @Transient - public Map<String, Clob> getNexusFiles() { + public Map<String, String> getNexusFiles() { return mNexusFiles; } /** * Set the NexusFiles field. */ - public void setNexusFiles(Map<String, Clob> pNewNexusFiles) { + public void setNexusFiles(Map<String, String> pNewNexusFiles) { mNexusFiles = pNewNexusFiles; } @@ -415,9 +414,9 @@ * Creation date: Feb 22, 2006 12:06:25 PM * * @param pFileName - * @param pNexusFile Clob + * @param pNexusFile */ - public void addNexusFile(String pFileName, Clob pNexusFile) { + public void addNexusFile(String pFileName, String pNexusFile) { if (TreebaseUtil.isEmpty(pFileName)) { if (pNexusFile == null) { return; Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/service/study/StudyServiceImpl.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/service/study/StudyServiceImpl.java 2009-11-18 12:25:46 UTC (rev 279) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/service/study/StudyServiceImpl.java 2009-11-18 12:41:37 UTC (rev 280) @@ -1,9 +1,11 @@ package org.cipres.treebase.service.study; +import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; +import java.io.IOException; import java.sql.Clob; import java.util.Collection; import java.util.Iterator; @@ -353,23 +355,11 @@ Study s = update(pStudy); Iterator<File> fileIter = pNexusFiles.iterator(); - try { - while (fileIter.hasNext()) { - File element = (File) fileIter.next(); - - String fileName = element.getName(); - FileReader reader; - reader = new FileReader(element); - - int fileLength = (int) (element.length()); - Clob nexus = Hibernate.createClob(reader, fileLength); - s.addNexusFile(fileName, nexus); - - } - } catch (FileNotFoundException ex) { - LOGGER.error(ex.getMessage()); + while (fileIter.hasNext()) { + File element = (File) fileIter.next(); + String fileName = element.getName(); + s.addNexusFile(fileName, TreebaseUtil.readFileToString(element)); } - } /** Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/util/RawNexusImporter.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/util/RawNexusImporter.java 2009-11-18 12:25:46 UTC (rev 279) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/util/RawNexusImporter.java 2009-11-18 12:41:37 UTC (rev 280) @@ -15,6 +15,7 @@ import java.util.Set; import org.cipres.treebase.ContextManager; +import org.cipres.treebase.TreebaseUtil; import org.cipres.treebase.domain.matrix.Matrix; import org.cipres.treebase.domain.matrix.MatrixHome; import org.cipres.treebase.domain.study.Study; @@ -121,20 +122,8 @@ return false; } - Clob clob; - try { - clob = buildClob(file); - } catch (FileNotFoundException e) { - err.println(fileName + ": file not found"); - return false; - } catch (UnsupportedEncodingException e) { - throw e; - } catch (IOException e) { - err.println(fileName + ": I/O error; skipping"); - return false; - } - - if (clob == null) return false; + String fileContents = TreebaseUtil.readFileToString(file); + if (fileContents == null) return false; Set<Study> studies = new HashSet<Study> (); studies.addAll(handleMatricesInFile(file)); @@ -142,7 +131,7 @@ for (Study s : studies) { if (liveMode()) - s.getNexusFiles().put(fileName, clob); + s.getNexusFiles().put(fileName, fileContents); verbose("Study S" + s.getId() + " now linked to nexus file " + fileName); } return true; Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/util/RebuildNexusFiletable.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/util/RebuildNexusFiletable.java 2009-11-18 12:25:46 UTC (rev 279) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/util/RebuildNexusFiletable.java 2009-11-18 12:41:37 UTC (rev 280) @@ -23,7 +23,7 @@ for (TBPersistable obj : ContextManager.getStudyHome().findAll(Study.class)) { Study s = (Study) obj; - Map<String,Clob> studyNexusFile = s.getNexusFiles(); + Map<String,String> studyNexusFile = s.getNexusFiles(); for (String fileName : studyNexusFile.keySet()) { if (nexusFileStudy.containsKey(fileName)) { nexusFileStudy.remove(fileName); Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/util/RepatriateData.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/util/RepatriateData.java 2009-11-18 12:25:46 UTC (rev 279) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/util/RepatriateData.java 2009-11-18 12:41:37 UTC (rev 280) @@ -74,8 +74,8 @@ if (m.getStudy() != s) { String nexusFileName = m.getNexusFileName(); - Map<String,Clob> nexusMap = m.getStudy().getNexusFiles(); - Clob nexusFile = nexusMap.remove(nexusFileName); + Map<String,String> nexusMap = m.getStudy().getNexusFiles(); + String nexusFile = nexusMap.remove(nexusFileName); s.getNexusFiles().put(nexusFileName, nexusFile); m.setStudy(s); } @@ -93,8 +93,8 @@ + " to study " + s.getId() + " submission " + sub.getId()); if (t.getStudy() != s) { String nexusFileName = t.getNexusFileName(); - Map<String,Clob> nexusMap = t.getStudy().getNexusFiles(); - Clob nexusFile = nexusMap.remove(nexusFileName); + Map<String,String> nexusMap = t.getStudy().getNexusFiles(); + String nexusFile = nexusMap.remove(nexusFileName); s.getNexusFiles().put(nexusFileName, nexusFile); t.setStudy(s); } Modified: trunk/treebase-core/src/test/java/org/cipres/treebase/dao/study/StudyDAOTest.java =================================================================== --- trunk/treebase-core/src/test/java/org/cipres/treebase/dao/study/StudyDAOTest.java 2009-11-18 12:25:46 UTC (rev 279) +++ trunk/treebase-core/src/test/java/org/cipres/treebase/dao/study/StudyDAOTest.java 2009-11-18 12:41:37 UTC (rev 280) @@ -243,8 +243,10 @@ + "f ctgactgctgaggagaaggctgccgtcaccgccttttggggcaaggtgaaagtggatgaagttggtggtgag gccctgggcaggctgctggttgtctacccctggactcagaggttctttgagtcctttggggacttgtccact gctgatgctgttatgaacaaccctaaggtgaaggcccatggcaagaaggtgctagattcctttagtaatggc atgaagcatctcgatgacctcaagggcacctttgctgcgctgagtgagctgcactgtgataagctgcatgtg gatcctgagaacttcaagctcctgggcaacgtgctagtggttgtgctggctcgcaattttggcaaggaattc accccggtgctgcaggctgactttcagaaggtggtggctggtgtggccaatgccctggcccacagatatcat\n" + "g ctgtccgatgcggtcaacgctgccgtcaccgccttttggggcaaggtgaaagtggatcaagttggtggtgag gccctgggcaggccgctggttgtctaccgctggactcagaggtgctatgagtcctttggagacttgtccact gctgatgctgttatgaacaaccctaaggtgaaggcccatggcaagaaggtgctagattcctttagtaatggc atgaagcatctcgatgacctcaagggcacctttgctgcgctgagtgagctgcactgtgataagctgcatgtg gatcctgagaacttcaagctcctgggcaacgtgctagtggttgtgctggctcgcaattttggcaaggaattc accccggtgctgcaggctgactttcagaaggtggtggctggtgtggccaatgccctggcccacagatatcat\n"; - Clob nexusC = Hibernate.createClob(nexus); - s.addNexusFile(fileName, nexusC); + //XXX rav 18/11/09 - we no longer use Clobs, we use text for nexus strings + //Clob nexusC = Hibernate.createClob(nexus); + //s.addNexusFile(fileName, nexusC); + s.addNexusFile(fileName, nexus); getFixture().store(s); Modified: trunk/treebase-core/src/test/java/org/cipres/treebase/service/study/StudyServiceImplTest.java =================================================================== --- trunk/treebase-core/src/test/java/org/cipres/treebase/service/study/StudyServiceImplTest.java 2009-11-18 12:25:46 UTC (rev 279) +++ trunk/treebase-core/src/test/java/org/cipres/treebase/service/study/StudyServiceImplTest.java 2009-11-18 12:41:37 UTC (rev 280) @@ -362,10 +362,10 @@ + "f ctgactgctgaggagaaggctgccgtcaccgccttttggggcaaggtgaaagtggatgaagttggtggtgag gccctgggcaggctgctggttgtctacccctggactcagaggttctttgagtcctttggggacttgtccact gctgatgctgttatgaacaaccctaaggtgaaggcccatggcaagaaggtgctagattcctttagtaatggc atgaagcatctcgatgacctcaagggcacctttgctgcgctgagtgagctgcactgtgataagctgcatgtg gatcctgagaacttcaagctcctgggcaacgtgctagtggttgtgctggctcgcaattttggcaaggaattc accccggtgctgcaggctgactttcagaaggtggtggctggtgtggccaatgccctggcccacagatatcat\n" + "g ctgtccgatgcggtcaacgctgccgtcaccgccttttggggcaaggtgaaagtggatcaagttggtggtgag gccctgggcaggccgctggttgtctaccgctggactcagaggtgctatgagtcctttggagacttgtccact gctgatgctgttatgaacaaccctaaggtgaaggcccatggcaagaaggtgctagattcctttagtaatggc atgaagcatctcgatgacctcaagggcacctttgctgcgctgagtgagctgcactgtgataagctgcatgtg gatcctgagaacttcaagctcctgggcaacgtgctagtggttgtgctggctcgcaattttggcaaggaattc accccggtgctgcaggctgactttcagaaggtggtggctggtgtggccaatgccctggcccacagatatcat\n"; - Clob nexusC = Hibernate.createClob(nexus); + //Clob nexusC = Hibernate.createClob(nexus); getStudyHome().refresh(s); - s.addNexusFile(fileName, nexusC); + s.addNexusFile(fileName, nexus); // force commit immeidately, important: setComplete(); @@ -377,14 +377,14 @@ assertTrue(countNexus == 1); startNewTransaction(); - Clob nexusClob = s.getNexusFiles().values().iterator().next(); - int clobLength = (int) nexusClob.length(); + String nexusString = s.getNexusFiles().values().iterator().next(); + int nexusLength = (int) nexusString.length(); // String clobStr = nexusClob.getSubString(0, 200); - char[] clobchars = new char[clobLength]; - nexusClob.getCharacterStream().read(clobchars); - logger.info("test clob: length=" + clobLength + "content = " + new String(clobchars)); - assertTrue(clobLength > 0); + //char[] clobchars = new char[clobLength]; + //nexusClob.getCharacterStream().read(clobchars); + logger.info("test clob: length=" + nexusLength + "content = " + nexusString); + assertTrue(nexusLength > 0); setComplete(); endTransaction(); Modified: trunk/treebase-core/src/test/java/org/cipres/treebase/service/study/SubmissionServiceImplTest.java =================================================================== --- trunk/treebase-core/src/test/java/org/cipres/treebase/service/study/SubmissionServiceImplTest.java 2009-11-18 12:25:46 UTC (rev 279) +++ trunk/treebase-core/src/test/java/org/cipres/treebase/service/study/SubmissionServiceImplTest.java 2009-11-18 12:41:37 UTC (rev 280) @@ -472,13 +472,10 @@ Study study2 = (Study) hibernateTemplate.load(Study.class, sub.getStudy().getId()); // hibernateTemplate.refresh(sub); - Clob nexusClob = study2.getNexusFiles().values().iterator().next(); - int clobLength = (int) nexusClob.length(); - char[] clobchars = new char[clobLength]; - nexusClob.getCharacterStream().read(clobchars); - String clobStr = new String(clobchars); - logger.info("test clob: length=" + clobLength + "content = " + clobStr); - assertTrue(clobLength > 0); + String nexusString = study2.getNexusFiles().values().iterator().next(); + int nexusStringLength = (int) nexusString.length(); + logger.info("test clob: length=" + nexusStringLength + "content = " + nexusString); + assertTrue(nexusStringLength > 0); // 4. delete: delete submission: // after add Nexus files, sub is outdated: @@ -569,13 +566,10 @@ // verify clob: hibernateTemplate.refresh(sub); - Clob nexusClob = sub.getStudy().getNexusFiles().values().iterator().next(); - int clobLength = (int) nexusClob.length(); - char[] clobchars = new char[clobLength]; - nexusClob.getCharacterStream().read(clobchars); - String clobStr = new String(clobchars); - logger.info("test clob: length=" + clobLength + "content = " + clobStr); - assertTrue(clobLength > 0); + String nexusString = sub.getStudy().getNexusFiles().values().iterator().next(); + int nexusStringLength = (int) nexusString.length(); + logger.info("test clob: length=" + nexusStringLength + "content = " + nexusString); + assertTrue(nexusStringLength > 0); // 4. delete: delete submission: // after add Nexus files, sub is outdated: Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/DownloadANexusFileController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/DownloadANexusFileController.java 2009-11-18 12:25:46 UTC (rev 279) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/DownloadANexusFileController.java 2009-11-18 12:41:37 UTC (rev 280) @@ -135,20 +135,11 @@ return null; } Study study = ControllerUtil.findStudy(req, mStudyService); - Map<String, Clob> nexusMap = study.getNexusFiles(); - Clob clob = nexusMap.get(nexusFileName); - String clobStr = "File Not Found. File Name is: " + nexusFileName; - if (clob != null) { - try { - int clobLength = (int) clob.length(); - char[] clobchars = new char[clobLength]; - clob.getCharacterStream().read(clobchars); - clobStr = new String(clobchars); - } catch ( Exception e ) { - e.printStackTrace(); - } - } - return clobStr; + Map<String, String> nexusMap = study.getNexusFiles(); + String nexusString = nexusMap.get(nexusFileName); + return nexusString != null + ? nexusString + : "File Not Found. File Name is: " + nexusFileName; } } Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/NexusFilesController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/NexusFilesController.java 2009-11-18 12:25:46 UTC (rev 279) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/NexusFilesController.java 2009-11-18 12:41:37 UTC (rev 280) @@ -51,7 +51,7 @@ throws Exception { Study study = ControllerUtil.findStudy(pRequest, mStudyService); - Map<String, Clob> nexusFilesMap = study.getNexusFiles(); + Map<String, String> nexusFilesMap = study.getNexusFiles(); if (LOGGER.isDebugEnabled()) { LOGGER.debug("MAP SIZE IS: " + nexusFilesMap.size()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2009-11-18 12:25:54
|
Revision: 279 http://treebase.svn.sourceforge.net/treebase/?rev=279&view=rev Author: rvos Date: 2009-11-18 12:25:46 +0000 (Wed, 18 Nov 2009) Log Message: ----------- Abstracted away hardcoded tomcat url Modified Paths: -------------- trunk/treebase-core/src/main/perl/misc/publish Modified: trunk/treebase-core/src/main/perl/misc/publish =================================================================== --- trunk/treebase-core/src/main/perl/misc/publish 2009-11-18 11:01:58 UTC (rev 278) +++ trunk/treebase-core/src/main/perl/misc/publish 2009-11-18 12:25:46 UTC (rev 279) @@ -24,6 +24,7 @@ GETCMD="curl -s -o /dev/null" WEBAPPS="$CATALINA_HOME/webapps" TARGET_DIR="treebase-web" +IP_ADDR=`curl -s checkip.dyndns.org | grep -Eo '[0-9\.]+'` # Flag to suppress sourre update and rebuilding update_sources=true @@ -31,7 +32,7 @@ update_sources=false fi -TOMCAT_URL=http://treebasedb-dev.nescent.org:6666/treebase-web/ +TOMCAT_URL=http://$IP_ADDR:6666/treebase-web/ VERSIONFILE=${TREEBASE_HOME}/treebase-core/src/main/java/org/cipres/treebase/Version.java # Rebuild the application WAR file, if requested This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2009-11-18 11:02:06
|
Revision: 278 http://treebase.svn.sourceforge.net/treebase/?rev=278&view=rev Author: rvos Date: 2009-11-18 11:01:58 +0000 (Wed, 18 Nov 2009) Log Message: ----------- jdom's maven path has changed from jdom/jdom/1.1 to org/jdom/jdom/1.1 Modified Paths: -------------- trunk/treebase-core/.classpath trunk/treebase-core/pom.xml trunk/treebase-web/.classpath Modified: trunk/treebase-core/.classpath =================================================================== --- trunk/treebase-core/.classpath 2009-11-17 21:08:07 UTC (rev 277) +++ trunk/treebase-core/.classpath 2009-11-18 11:01:58 UTC (rev 278) @@ -51,7 +51,7 @@ <classpathentry kind="var" path="M2_REPO/com/sun/xml/bind/jaxb-impl/2.1.6/jaxb-impl-2.1.6.jar"/> <classpathentry kind="var" path="M2_REPO/com/sun/xml/bind/jaxb-xjc/2.1.6/jaxb-xjc-2.1.6.jar"/> <classpathentry kind="var" path="M2_REPO/javax/sql/jdbc-stdext/2.0/jdbc-stdext-2.0.jar"/> - <classpathentry kind="var" path="M2_REPO/jdom/jdom/1.1/jdom-1.1.jar"/> + <classpathentry kind="var" path="M2_REPO/org/jdom/jdom/1.1/jdom-1.1.jar"/> <classpathentry kind="var" path="M2_REPO/org/mortbay/jetty/jetty/6.1.9/jetty-6.1.9.jar"/> <classpathentry kind="var" path="M2_REPO/org/mortbay/jetty/jetty-util/6.1.9/jetty-util-6.1.9.jar"/> <classpathentry kind="var" path="M2_REPO/jsci/jsci/mesquite/jsci-mesquite.jar"/> Modified: trunk/treebase-core/pom.xml =================================================================== --- trunk/treebase-core/pom.xml 2009-11-17 21:08:07 UTC (rev 277) +++ trunk/treebase-core/pom.xml 2009-11-18 11:01:58 UTC (rev 278) @@ -138,7 +138,7 @@ </dependency> <dependency> - <groupId>jdom</groupId> + <groupId>org.jdom</groupId> <artifactId>jdom</artifactId> <version>1.1</version> </dependency> Modified: trunk/treebase-web/.classpath =================================================================== --- trunk/treebase-web/.classpath 2009-11-17 21:08:07 UTC (rev 277) +++ trunk/treebase-web/.classpath 2009-11-18 11:01:58 UTC (rev 278) @@ -60,7 +60,7 @@ <classpathentry kind="var" path="M2_REPO/com/sun/xml/bind/jaxb-xjc/2.1.6/jaxb-xjc-2.1.6.jar"/> <classpathentry kind="var" path="M2_REPO/org/slf4j/jcl104-over-slf4j/1.4.2/jcl104-over-slf4j-1.4.2.jar"/> <classpathentry kind="var" path="M2_REPO/javax/sql/jdbc-stdext/2.0/jdbc-stdext-2.0.jar"/> - <classpathentry kind="var" path="M2_REPO/jdom/jdom/1.1/jdom-1.1.jar"/> + <classpathentry kind="var" path="M2_REPO/org/jdom/jdom/1.1/jdom-1.1.jar"/> <classpathentry kind="var" path="M2_REPO/org/mortbay/jetty/jetty/6.1.9/jetty-6.1.9.jar"/> <classpathentry kind="var" path="M2_REPO/org/mortbay/jetty/jetty-util/6.1.9/jetty-util-6.1.9.jar"/> <classpathentry kind="var" path="M2_REPO/jmock/jmock/1.0.1/jmock-1.0.1.jar"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |