NAME

MasonX::Resolver::CVS - component path resolver for components in CVS

SYNOPSIS

  my $resolver = MasonX::Resolver::CVS->new(
  	cvs_module	=> 'cvs/module',
	cvs_repository	=> '/var/cvs'
  );
  my $info = $resolver->get_info('/some/comp.html');

DESCRIPTION

This HTML::Mason::Resolver(3) subclass is used when components are stored in the Concurrent Version System (cvs(1)). Currently, this subclass only supports local CVS repositories. As such, it is able to deliver component source without checking the files out into a working directory (see "IMPLEMENTATION NOTES").

PARAMETERS TO THE new() CONSTRUCTOR

The new method takes two parameters, cvs_module and cvs_repository.

cvs_module

The cvs_module attribute is a relative path that specifies the CVS module that marks the top of your component hierarchy within the repository. For example, if cvs_module is doc and your CVS repository is /var/cvs, a component path of /products/index.html translates to the file /var/cvs/doc/products/index.html,v, which will be checked out of CVS and processed by Mason.

The cvs_module attribute defaults to the empty string, implying that the URI space will be a direct mirror of the CVS hierarchy. When it is specified, it should be a relative filesystem path representing the CVS module.

cvs_repository

The cvs_repository attribute is an absolute pathname specifying the local CVS repository.

IMPLEMENTATION NOTES

A HTML::Mason::Resolver(3) class's get_info method must return an HTML::Mason::ComponentSource(3) object that contains the last modification time of the component. Since this module currently only supports local repositories, it just goes into the repository and stats the file to get the last modification time.

The best way I could find using CVS command to get the last modification time is with cvs status, which requires a checked out working directory. (The cvs history command also returns the last modification time, but it doesn't include the year.) So if this module is improved to support remote respositories, it will have to keep checked out copies of the files.

BUGS

This implementation cheats by statting the modification dates of repository files rather than using cvs status or somesuch (see "IMPLMEMENTATION NOTES"). Consequently, Mason will think some components have changed when they really haven't (e.g., a new revision was checked in on a different branch).

This module forks to spawn CVS commands, which can be a waste of resources, especially in a mod_perl environment. In this version, CVS commands are only run when the CVS file has changed. Using a Perl extension interface to a real CVS API would be an improvement, but the author knows of no such API.

AUTHOR

Andrew J. Korty, <ajk@iu.edu>

SEE ALSO

HTML::Mason(3), HTML::Mason::ComponentSource(3), HTML::Mason::Resolver(3)