| CatalystX-Usul documentation | Contained in the CatalystX-Usul distribution. |
CatalystX::Usul::Model::FileSystem - File system related methods
0.3.$Revision: 576 $
package MyApp::Model::FileSystem;
use base qw(CatalystX::Usul::Model::FileSystem);
1;
package MyApp::Controller::Foo;
sub bar {
my ($self, $c) = @_;
$c->model( q(FileSystem) )->list_subdirectory( { dir => q(/path) } );
return;
}
This model provides methods for manipulating files and directories
Creates an instance of CatalystX::Usul::Filesystem
Returns the file systems on the local host
Returns the contents of the selected directory as a CatalystX::Usul::Table object
Stash the data used by HTML::FormWidgets to view a file of a given type
None
None
There are no known incompatibilities in this module
There are no known bugs in this module. Please report problems to the address below. Patches are welcome
Peter Flanigan, <Support at RoxSoft.co.uk>
Copyright (c) 2008 Peter Flanigan. All rights reserved
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic
This program is distributed in the hope that it will be useful, but WITHOUT WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE
| CatalystX-Usul documentation | Contained in the CatalystX-Usul distribution. |
# @(#)$Id: FileSystem.pm 576 2009-06-09 23:23:46Z pjf $ package CatalystX::Usul::Model::FileSystem; use strict; use warnings; use version; our $VERSION = qv( sprintf '0.3.%d', q$Rev: 576 $ =~ /\d+/gmx ); use parent qw(CatalystX::Usul::Model); use CatalystX::Usul::FileSystem; use Class::C3; __PACKAGE__->mk_accessors( qw(domain_model) ); sub build_per_context_instance { my ($self, $c, @rest) = @_; my $s = $c->stash; my $args; my $new = $self->next::method( $c, @rest ); $args->{debug } = $s->{debug}; $args->{lang } = $s->{lang}; $args->{fs_type} = $s->{os}->{fs_type}->{value}; $args->{fuser } = $s->{os}->{fuser }->{value}; $new->domain_model( CatalystX::Usul::FileSystem->new( $c, $args ) ); return $new; } sub get_file_systems { return shift->domain_model->get_file_systems( @_ ); } sub list_subdirectory { return shift->domain_model->list_subdirectory( @_ ); } sub view_file { my ($self, $subtype, $id) = @_; return unless ($id); my $path = $subtype eq q(source) ? $self->find_source( $id ) : $id; $self->add_field( { path => $path, subtype => $subtype, type => q(file) } ); $self->add_append( { text => $self->loc( 'Viewing [_1]', $path ), type => q(label) } ); return; } 1; __END__
# Local Variables: # mode: perl # tab-width: 3 # End: