NAME

AxKit::App::TABOO::Data::Article - Article Data object for TABOO

SYNOPSIS

use AxKit::App::TABOO::Data::Article;
[etc ... similar as for other Data objects]

DESCRIPTION

This Data class contains an mainly metadata for an article. These articles are of a more static nature than typical news stories.

METHODS

This class implements several methods, reimplements the load method, but inherits some from AxKit::App::TABOO::Data.

new(@dbconnectargs)

The constructor. Nothing special.

load(what => fields, limit => {filename => value, primcat => value, [...]})
adduserinfo()

When data has been loaded into an object of this class, it will contain a string only identifying a user, the authors of the article. This method will replace those strings with a reference to a AxKit::App::TABOO::Data::User-object, containing the needed user information.

addcatinfo()

Similarly to adding user info, this method will also add category information, for different types of categories, again by creating a reference to a AxKit::App::TABOO::Data::Category-object and calling its load-method with the string from the data loaded by the article as argument.

date([$filename|Time::Piece])

The date method will retrieve or set the date of the article. If the date has been loaded earlier from the data storage (for example by the load method), you need not supply any arguments. If the date is not available, you must supply the filename identifiers, the method will then load it into the data structure first.

The date method will return a Time::Piece object with the requested time information.

To set the date, you must supply a Time::Piece object, the date is set to the time given by that object.

editorok([($filename)])

This is similar to the date method in interface, but can't be used to set the value, only retrieves it. It returns the editorok, which is a boolean variable that says can be used to see if an editor has approved a story.

It takes arguments like the date method does, and it will return 1 if the story has been approved, 0 if not.

Additional methods

There are a few more methods that will be documented in later releases.

STORED DATA

The data is stored in named fields, and for certain uses, it is good to know them. If you want to subclass this class, you might want to use the same names, see the documentation of AxKit::App::TABOO::Data for more about this.

In this class it gets even more interesting, because you may pass a list of those to the load method. This is useful if you don't want to load all data, in those cases where you don't need all the data that the object can hold.

This will be documented later.

XML representation

The write_xml() method, implemented in the parent class, can be used to create an XML representation of the data in the object. The above names will be used as element names. The xmlelement(), xmlns() and xmlprefix() methods can be used to set the name of the root element, the namespace URI and namespace prefix respectively. Usually, it doesn't make sense to change the defaults, that are

  • article

  • http://www.kjetil.kjernsmo.net/software/TABOO/NS/Article/Output

  • art

BUGS/TODO

This class is really experimental at this point, and has not seen the same level of testing as the rest of TABOO. More documentation is also needed.

FORMALITIES

See AxKit::App::TABOO.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 315:

=back without =over