|
NAMEToader::Page - This provides methods for a named page.VERSIONVersion 1.0.0SYNOPSISFor information on the storage and rendering of entries, please see 'Documentation/Page.pod'.NEW METHODSIf any of the new methods error, the error is permanent.newThis creates the a object that represents a page.Two arguments are taken. The first is a hash reference that is documented below. args hash renderer This is the rendering engine the body should use. If not defined, html will be used. body This is the body. name This is the short name of the page. from This is the from address to use. files This is a list of files that will be made available with this page. publish Wether or not to publish it or not. This is a boolean value and uses "0" and "1". If not specified, it uses "1". toader This is a Toader object. my $foo = Toader::isaToaderDir->new(\%args); if ($foo->error){ warn('Error:'.$foo->error.': '.$foo->errorString); } newFromStringThis creates a new page from a string.There are two required arguments, the first being a string containing the page in question and the second being Toader object. my $foo=Toader::Page->newFromString($pageString, $toader); if($foo->error){ warn('Error:'.$foo->error.': '.$foo->errorString); } GENERAL METHODSas_stringThis returns the page as a string.my $mimeString=$foo->as_string; if($foo->error) warn('Error:'.$foo->error.': '.$foo->errorString); } bodyGetThis gets body.my $body=$foo->bodyGet; if($foo->error){ warn('Error:'.$foo->error.': '.$foo->errorString); } bodySetThis sets the body.One argument is required and it is the body. $foo->bodySet($body); if($foo->error){ warn('Error:'.$foo->error.': '.$foo->errorString); } dirGetThis gets Toader directory this entry is associated with.This will only error if a permanent error is set. my $dir=$foo->dirGet; if($foo->error){ warn('Error:'.$foo->error.': '.$foo->errorString); } dirSetThis sets Toader directory this entry is associated with.One argument is taken and it is the Toader directory to set it to. $foo->dirSet($toaderDirectory); if($foo->error){ warn('Error:'.$foo->error.': '.$foo->errorString); } fromGetThis returns the from.my $from=$foo->fromGet; if($foo->error){ warn('error: '.$foo->error.":".$foo->errorString); } fromSetThis sets the from.One argument is taken and it is the name. $foo->fromSet($name); if($foo->error){ warn('error: '.$foo->error.":".$foo->errorString); } nameGetThis returns the name.my $name=$foo->nameGet; if($foo->error){ warn('error: '.$foo->error.":".$foo->errorString); } nameSetThis sets the short name.One argument is taken and it is the name. $foo->nameSet($name); if($foo->error){ warn('error: '.$foo->error.":".$foo->errorString); } publishGetThis returns the publish value.my $publish=$foo->publishGet; if($foo->error){ warn('error: '.$foo->error.":".$foo->errorString); } publishSetThis sets the publish value.One argument is taken and it is the publish value. If no value is set, it uses the default, "1". It must be a recognized boolean value, either "0" or "1". $foo->publishSet($publish); if($foo->error){ warn('error: '.$foo->error.":".$foo->errorString); } rendererGetThis returns the renderer type.my $renderer=$foo->rendererGet; if($foo->error){ warn('error: '.$foo->error.":".$foo->errorString); } rendererSetThis sets the renderer type.One argument is taken and it is the render type. A value of undef sets it to the default, 'html'. my $renderer=$foo->rendererGet; if($foo->error){ warn('error: '.$foo->error.":".$foo->errorString); } subpartsAddThis adds a new file as a subpart.One argument is required and it is the path to the file. $foo->subpartsAdd( $file ); if ( $foo->error ){ warn('Error:'.$foo->error.': '.$foo->errorString); } subpartsExtractThis extracts the subparts of a entry.One argument is extracted, it is the directory to extract the files to. $foo->subpartsExtract( $dir ); if ( $foo->error ){ warn('Error:'.$foo->error.': '.$foo->errorString); } subpartsGetThis returns the results from the subparts methods from the internal Email::MIME object.my @parts=$foo->subpartsGet; if ( $foo->error ){ warn('Error:'.$foo->error.': '.$foo->errorString); } subpartsListThis returns a list filenames for the subparts.my @files=$foo->subpartsList; if ( $foo->error ){ warn('Error:'.$foo->error.': '.$foo->errorString); } subpartsRemoveThis removes the specified subpart.One argument is required and it is the name of the file to remove. $foo->subpartsRemove( $filename ); if ( $foo->error ){ warn('Error:'.$foo->error.': '.$foo->errorString); } summaryGetThis returns the summary.my $summary=$foo->summaryGet; if($foo->error){ warn('error: '.$foo->error.":".$foo->errorString); } summarySetThis sets the summary.One argument is taken and it is the summary. $foo->summarySet($summary); if($foo->error){ warn('error: '.$foo->error.":".$foo->errorString); } writeThis saves the page file. It requires dirSet to have been called previously.$foo->write; if($foo->error){ warn('error: '.$foo->error.":".$foo->errorString); } REQUIRED RENDERING METHODSfilesDirThis returns the file directory for the object.This is not a full path, but a partial path that should be appended the directory current directory being outputted to. locationIDThis returns the location ID.This one requires the object to be initialized. renderDirThis is the directory that it will be rendered to.The base directory that will be used for rendering. renderUsingThis returns the module to use for rendering.my $module=$foo->renderUsing; toaderRenderableThis method returns true and marks it as being Toader renderable.toDirThis returns the relative path to the object.This is not a full path, but a partial path that should be appended the directory current directory being outputted to. ERROR CODES/FLAGS1, noPageNameNo name specified.2, emailMIMEcreationFailedUnable to create Email::MIME object.3, notAnArrayHas files specified, but the passed object is not a array.4, fileDoesNotExistThe file does not exist or is not a file.5, MIMEinfoErrorFile::MimeInfo->mimetype returned undef, meaning the file does not exist or is not readable.6, unableToOpenFileUnable to open the file.7, emailMIMEerrorUnable to create a Email::MIME object for one of the parts/files.8, noBodyNo body defined.9, notAtoaderDirNot a Toader directory.10, noLonderAtoaderDirNo longer appears to be a Toader directory.11, noDirSetNo directory has been specified.12, pagesDirCreationFailedThe pages directory could not be created.13, publishValErrorThe publish value is not a recognized boolean value.Only '0' and '1' is recognized. 14, notAtoaderObjThe specified object is not a Toader object.15, getVCSerroredToader->getVCS errored.16, VCSusableErroredToader::VCS->usable errored.17, underVCSerrorToader::VCS->underVCS errored.18, VCSaddErroredToader::VCS->add errored.19, noToaderObjNo Toader object specified.AUTHORZane C. Bowers-Hadley, "<vvelox at vvelox.net>"BUGSPlease report any bugs or feature requests to "bug-toader at rt.cpan.org", or through the web interface at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Toader>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.SUPPORTYou can find documentation for this module with the perldoc command.perldoc Toader::Page You can also look for information at:
ACKNOWLEDGEMENTSLICENSE AND COPYRIGHTCopyright 2011 Zane C. Bowers-Hadley.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.
Visit the GSP FreeBSD Man Page Interface. |