Daizu::File

Daizu::File is a Perl class representing files in working copies.
Download

Daizu::File Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Geoff Richards
  • Publisher web site:
  • http://search.cpan.org/~geoffr/Daizu-0.3/lib/Daizu/Preview.pm

Daizu::File Tags


Daizu::File Description

Daizu::File is a Perl class representing files in working copies. Daizu::File is a Perl class representing files in working copies.Each object of this class represents a particular file in a Daizu CMS working copy (a record in the wc_file table).METHODSNote that all the functions which return the value of a Subversion property will strip leading and trailing whitespace, and treat a value which is empty or entirely whitespace as if it wasn't set at all.Daizu::File->new($cms, $file_id)Return a new Daizu::File object for the file with the specified ID number.$file->dataReturn a reference to a string containing the file data (content).$file->wcReturn a Daizu::Wc object representing the working copy in which this file lives.$file->guid_uriReturn the GUID URI for this file.$file->directory_pathReturns the path of a directory, either the same as the file if it's a directory itself, or the path of its parent directory, or '' if it's at the top level.$file->permalinkReturns the first URL generated by the file, which will be the URL you want to link to most of the time. For articles this will always be the normal HTML version of the article, even if there are also other URLs available for it, and it will always be the first page of multipage articles. For non-article files there is no guarantee about what this will return, but most will only generate a single URL anyway, and for those that don't generators are likely to return the most 'linkable' URL first.The URL returned is an absolute URL provided as a URI object.Returns nothing if the file doesn't generate any URLs.There are some cases where this might not be what you want. For example, the root directory of a website using Daizu::Gen will either not generate a URL at all, or will generate one for a Google sitemap XML file, neither of which is likely to be useful for linking. To get the URL of the website you would probably need to find a file called something like '_index.html'. On the other hand, the Daizu::Gen::Blog generator will give you a sensible URL for the blog homepage if you call this on its root directory.$file->urls_in_db($method, $argument)Return a list of the URLs (plain strings, each an absolute URI) of the file which have the specified method and argument values, drawing from the url table in the database.$file->article_urlsReturn information about the URLs which the file should have, if it is an article. Fails if it isn't. Requirements: · Perl


Daizu::File Related Software