|
NAMEToader::Entry - This holds a blog/article/whatever entry.VERSIONVersion 1.0.0SYNOPSISFor information on the storage and rendering of entries, please see 'Documentation/Entry.pod'.NEW METHODSIf any of the new methods error, the error is permanent.newThis creates the a object that represents a entry.One argument is taken and it s a hash reference. args hash renderer This is the rendering engine the body should use. If not defined, html will be used. body This is the body. title This is the title of the entry. from This is the from address to use. publish If it should be published or not. The default value is '1'. summary This is a summary of the entry. tags This is a Text::Tags parsable string for the tags. files This is a list of files that will be made available with this entry. toader This is a Toader object. my $foo = Toader::Entry->new(\%args); if ($foo->error){ warn('Error:'.$foo->error.': '.$foo->errorString); } newFromStringThis creates a new entry from a string.Two argument are accepted. The first is the entry string and the second is a Toader object. my $foo=Toader::Entry->newFromString($entryString, $toader); if($foo->error){ warn('Error:'.$foo->error.': '.$foo->errorString); } GENERAL METHODSas_stringThis returns the entry 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. This will return undef if no directory has been 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. my $dir=$foo->dirSet($toaderDirectory); if($foo->error){ warn('Error:'.$foo->error.': '.$foo->errorString); } entryNameGetThis gets Toader directory this entry is associated with.This will only error if a permanent error is set. This will return undef if no entry name has been set. my $entryName=$foo->entryNameGet; if($foo->error){ warn('Error:'.$foo->error.': '.$foo->errorString); } entryNameSetThis sets Toader directory this entry is associated with.One argument is taken and it is the Toader directory to set it to. If none is specified it will be generated. $foo->entryNameSet($entryName); 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); } 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. $foo->publishSet($publish); 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); } titleGetThis returns the title.my $name=$foo->titleGet; if($foo->error){ warn('error: '.$foo->error.":".$foo->errorString); } titleSetThis sets the title.One argument is taken and it is the title. $foo->titleSet($title); 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); } tagsGetReturns a array of tags tags.The returned value is an array. my @tags=$foo->tagsGet; if ( $foo->error ){ warn('Error:'.$foo->error.': '.$foo->errorString); } tagsGetAsStringThis returns the tags as a string.As long as this object has initiated with out issue, then there is no need to do error checking for this method. my $tagsString=$foo->tagsGetAsString; tagsSetThis sets the tags.One value is taken and that is the a array reference. $foo->tagsSet( \@tags ); if ( $foo->error ){ warn('Error:'.$foo->error.': '.$foo->errorString); } tagsSetFromStringThis sets the tags.One value is taken and that is a Text::Tags parsable string. A value of undef will blank the tags. $foo->tagsSetFromString( $tagsString ); if ( $foo->error ){ warn('Error:'.$foo->error.': '.$foo->errorString); } writeThis writes the entry out to a file.This requires a Toader directory to have been specified. $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 directory that will return the directory that contains where this object should be rendered to.This is not a full path, but a partial path that should be appended the directory current directory being outputted to. ERROR CODES1, noNameSpecifiedNo name specified.2, emailMIMEerrorUnable 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, invalidEntryNameNot a valid entry name.10. notAtoaderDirThe specified directory is not a Toader directory.11, noDirSpecifiedNo directory specified.12, noDirSetNo directory has been set yet.13, noLongerAtoaderDirThe directory is no longer a Toader directory. It looks like it has been removed.14, noEntryDirThe entries directory did not exist and was not able to create it.15, noSummarySpecifiedNo summary specified.16, noEntryNameSetNo entry name has been set.17, dirDNEorNADThe directory does not exist or is a not a directory.18, noFileSpecifiedNo file specified.19, publishValErrorInvalid publish value. It is not a recognized boolean value of either "0" or "1".20, getVCSerroredToader->getVCS errored.21, VCSusableErroredToader::VCS->usable errored.22, underVCSerroredToader::VCS->underVCS errored.23, VCSaddErroredToader::VCS->add errored.24, notAtoaderObjThe specified object is not a Toader object.25, noToaderObjNothing passed for a Toader object.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::Entry You can also look for information at:
ACKNOWLEDGEMENTSLICENSE AND COPYRIGHTCopyright 2013 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. |