LCC::Documents - base class for checking document information
use LCC; $lcc = LCC->new( $source, | {method => value} ); my $documents = $lcc->Documents( $source | {method => value} ); # auto-type my $documents = $lcc->Documents( 'type',$source | {method => value} );
The Documents object of the Perl support for LCC. Do not create directly, but through the Documents method of the LCC object.
These methods are available to the LCC::Documents object.
$documents->conceptual_url( \&myconceptualurl ); $coderef = $documents->conceptual_url;
Sets (and/or returns) the subroutine reference of the subroutine that should be called to convert the document ID to a conceptual URL that the LCC will store as an internal ID.
The subroutine should accept the ID as the only parameter and return the conceptual URL that should be stored in the LCC database.
By default, a subroutine that returns the document ID, will be used.
$documents->browse_url( \&mybrowseurl ); $coderef = $documents->browse_url;
Sets (and/or returns) the subroutine reference of the subroutine that should be called to convert the document ID to a URL that the LCC will store as the URL that users should use to access the document.
The subroutine should accept the ID as the only parameter and return the URL that should be used as URL for the browser.
By default, a subroutine that returns undef will be used, indicating that the browse URL is the same as the the fetch_url manpage.
$documents->fetch_url( \&myfetchurl ); $coderef = $documents->fetch_url;
Sets (and/or returns) the subroutine reference of the subroutine that should be called to convert the document ID to the URL that the LCC will use to fetch the document.
The subroutine should accept the ID as the only parameter and return the URL that should be used as URL to fetch the document.
By default, a subroutine that returns undef will be used, indicating that the browse URL is the same as the the fetch_url manpage.
my ($id,$mtime,$length,$md5,$mimetype,$subtype) = $documents->next_document;
This method is called by the the LCC::check manpage method to obtain the information about the next document to be checked. Should return an empty list when there are no more documents to be checked.
This method is always implemented by the sub-modules. Please do not call directly.
$documents->server; # default to `hostname` and 'html' $documents->server( 'www.host.com','html' ); # use specified server and ext
Sets the the browse_url manpage subroutine reference to always return undef, so that the browse URL will always be the same as the fetch URL.
Sets the the fetch_url manpage subroutine reference to allow for a simple translation from the document ID to a URL that the LCC should use to fetch the document. The input parameter specifies the server name that should be prefixed in the URL. If not specified, the server name will default to what is returned by `hostname`.
Also sets the conceptual_url subroutine reference so that the document ID is returned as the conceptual URL.
Elizabeth Mattijsen, <liz@dijkmat.nl>.
Please report bugs to <perlbugs@dijkmat.nl>.
Copyright (c) 2002 Elizabeth Mattijsen <liz@dijkmat.nl>. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
http://lococa.sourceforge.net, the LCC.pm and the other LCC::xxx modules.