+}
+
+
+sub load {
+ my $self = shift;
+
+ my @paths = $self->param('paths');
+ warn "# paths ", dump @paths;
+ $self->_load_path( $_ ) foreach @paths;
+
+ my $path = $self->param('path') || $self->redirect_to( '/data/index' );
+ warn "# path $path\n";
+ $self->session('path' => $path);
+ $self->_load_path( $path );
+
+ $self->session( 'header' => $loaded->{$path}->{header} );
+ if ( ! defined $loaded->{$path}->{columns} ) {
+ $self->session( 'columns' => $loaded->{$path}->{header} );
+ $self->redirect_to( '/data/columns' );
+ } else {
+ $self->session( 'columns' => $loaded->{$path}->{columns} );
+ $self->redirect_to( '/data/items' );
+ }
+
+}
+
+
+sub _loaded {
+ my ( $self, $name ) = @_;
+ my $path = $self->session('path');
+ die "$path $name doesn't exist in loaded ",dump( $loaded )
+ unless defined $loaded->{$path}->{$name};
+ return $loaded->{$path}->{$name};
+}
+
+
+sub _checked {
+ my $self = shift;
+ my $checked;
+ $checked->{$_}++ foreach @_;
+# warn "# _checked ",dump($checked);
+ return $checked;