From da1d1cf0604da05f253d3e59c11eb92db5833244 Mon Sep 17 00:00:00 2001 From: dakkar Date: Sat, 5 Nov 2005 11:06:09 +0000 Subject: normalizzati i nomi dei metodi, aggiunti test per controllo duplicati git-svn-id: svn://luxion/repos/WebCoso/trunk@20 fcb26f47-9200-0410-b104-b98ab5b095f3 --- lib/WebCoso/Config/Collection.pm | 6 +++--- lib/WebCoso/Config/Collections.pm | 6 +++--- lib/WebCoso/Config/Resource.pm | 12 +++++++----- 3 files changed, 13 insertions(+), 11 deletions(-) (limited to 'lib/WebCoso') diff --git a/lib/WebCoso/Config/Collection.pm b/lib/WebCoso/Config/Collection.pm index 6108623..961bc55 100644 --- a/lib/WebCoso/Config/Collection.pm +++ b/lib/WebCoso/Config/Collection.pm @@ -35,11 +35,11 @@ sub BUILD { return; } -sub axes { +sub get_axes { return 'language'; } -sub axis { +sub get_axis_value { my ($self,$axis_name)=@_; if ($axis_name eq 'language') { return grep { $_ } keys %{ $self->get_names() } @@ -49,7 +49,7 @@ sub axis { } } -sub properties { +sub get_properties { my ($self,$axis_name,$axis_value,@rest)=@_; if (@rest==0 and $axis_name eq 'language') { diff --git a/lib/WebCoso/Config/Collections.pm b/lib/WebCoso/Config/Collections.pm index 7d4d9e0..9cb3bbe 100644 --- a/lib/WebCoso/Config/Collections.pm +++ b/lib/WebCoso/Config/Collections.pm @@ -42,11 +42,11 @@ sub get_leaf_collections { } $self->get_all_collections(); } -sub axes { +sub get_axes { return 'language'; } -sub axis { +sub get_axis_value { my ($self,$axis_name)=@_; if ($axis_name eq 'language') { return $self->_get_languages(); @@ -61,7 +61,7 @@ sub _get_languages { my %langs=(); for my $collection ($self->get_all_collections()) { - @langs{ $collection->axis('language') } = (); + @langs{ $collection->get_axis_value('language') } = (); } delete $langs{''}; diff --git a/lib/WebCoso/Config/Resource.pm b/lib/WebCoso/Config/Resource.pm index fc80d41..b21bdcd 100644 --- a/lib/WebCoso/Config/Resource.pm +++ b/lib/WebCoso/Config/Resource.pm @@ -20,13 +20,15 @@ sub BUILD { $collections_of{$ident}=[]; WebCoso::Config->add_resource($self); + + return; } -sub axes { +sub get_axes { return 'filename'; } -sub axis { +sub get_axis_value { my ($self,$axis_name)=@_; if ($axis_name eq 'filename') { return @{ $self->get_sources() }; @@ -36,7 +38,7 @@ sub axis { } } -sub datastream { +sub get_datastream { my ($self,$axis_name,$axis_value,@rest)=@_; if (@rest==0 and $axis_name eq 'filename') { if ( grep { $_ eq $axis_value } @@ -50,11 +52,11 @@ sub datastream { } } -sub properties { +sub get_properties { return (); } -sub collections { +sub get_collections { my ($self)=@_; return @{ $self->get_collections_ref() }; -- cgit v1.2.3