The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Tree::Navigator - Generic navigation in various kinds of trees

SYNOPSIS

Create a file treenav.psgi like this :

  # create a navigator, then mount various kinds of nodes as shown below
  use Tree::Navigator;
  my $tn = Tree::Navigator->new;

  # example 1 : browse through the filesystem
  $tn->mount(Files => Filesys 
                   => {attributes => {label => 'My Web Files'},
                       mount_point => {root  => '/path/to/files'}});

  # example 2 : inspect tables and columns in a database
  my $dbh = DBI->connect(...);
  $tn->mount(MyDB => 'DBI' => {mount_point => {dbh => $dbh}});

  # example 3 : browse through the Win32 registry
  $tn->mount(HKCU => 'Win32::Registry' => {mount_point => {key => 'HKCU'}});

  # example 4 : browse through Perl internals
  $tn->mount(Ref => 'Perl::Ref' => {mount_point => {ref => $some_ref}});
  $tn->mount(Stack => 'Perl::StackTrace' => {mount_point => {}});
  $tn->mount(Symdump => 'Perl::Symdump' => {});

  # create the application
  my $app = $tn->to_app;

Then run the app

  plackup treenav.psgi

or mount the app in Apache

  <Location /treenav>
    SetHandler perl-script
    PerlResponseHandler Plack::Handler::Apache2
    PerlSetVar psgi_app /path/to/treenav.psgi
  </Location>

and use your favorite web browser to navigate through your data.

DESCRIPTION

Disclaimer

This distribution is still in an early stage, with incomplete documentation and tests, and an unstabilized API. Use for experiments, not yet for production code.

Introduction

This is a set of tools for navigating within various kinds of trees; a tree is just a set of nodes, where each node may have a content, may have attributes, and may have children nodes. Examples of such structures are filesystems, FTP sites, email boxes, Web sites, HTML pages, XML documents, etc.

The distribution provides

  • an abstract class for nodes, with a few concrete classes for some of the examples just mentioned above

  • a server application for exposing the tree structure to web clients or command-line clients (the present module).

  • a shell client [TODO]

  • an application that uses the Tree Navigator to navigate into the memory of a running Perl program.

Definitions

  - node
  - subnode
  - leaf
  - attribute
  - content

METHODS

TODO

DEPENDENCIES

This application uses Plack and Moose.

AUTHOR

Laurent Dami, <dami at cpan.org>

BUGS

Please report any bugs or feature requests to bug-tree-navigator at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Tree-Navigator. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SEE ALSO

Tree::Simple

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc Tree::Navigator

You can also look for information at:

ACKNOWLEDGEMENTS

LICENSE AND COPYRIGHT

Copyright 2012 Laurent Dami.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.

TODO

- check proper handling of SCRIPT_NAME - display node, show attrs & use IFRAME for content - option to toogle leaves in treeNav - export dir data as JSON/yaml - menu of actions on nodes

- Node types: - HTML viewer, build tree from H1, h2, etc. nodes; href links are leaves - Obj in memory - Process tree - LDAP - POM - Catalyst Actions - WWW mechanize - XML Schema - Smb Client, FTP, FTPS, SVN, GIT

- Shell : use Plack::Client

- Operation: - ls - cat - grep / ack - search / find (from attributes)

- fix utf8 bug in content

- apps - doc avec MsWordHTML - doc avec Latex

API app/_frameset => basic layout (frameset) app/_tn/ => tree TOC app/_tn/path/to/node => subtree TOC

  app/path/to/node?children
  app/path/to/node?subnodes
  app/path/to/node?content&view=html
    accept: text/html
  app/path/to/node?content&view=
     accept: binary
  app/path/to/node?html

     => right panel
  app/path/to/node?source (PPW, )

Cli === cd ls cat pwd find grep/ack