The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

AxKit::App::TABOO::XSP::Story - News story management tag library for TABOO

SYNOPSIS

Add the story: namespace to your XSP <xsp:page> tag, e.g.:

    <xsp:page
         language="Perl"
         xmlns:xsp="http://apache.org/xsp/core/v1"
         xmlns:story="http://www.kjetil.kjernsmo.net/software/TABOO/NS/Story"
    >

Add this taglib to AxKit (via httpd.conf or .htaccess):

  AxAddXSPTaglib AxKit::App::TABOO::XSP::Story

DESCRIPTION

This XSP taglib provides tags to store information related to news stories and to fetch and return XML representations of that data, as it communicates with TABOO Data objects, particulary AxKit::App::TABOO::Data::Story.

Apache::AxKit::Language::XSP::SimpleTaglib has been used to write this taglib.

Tag Reference

<store/>

It will take whatever data it finds in the Apache::Request object held by AxKit, and hand it to a new AxKit::App::TABOO::Data::Story object, which will use whatever data it finds useful. It will not store anything unless the user is logged in and authenticated with an authorization level. If an authlevel is not found in the user's session object, it will throw an exceptions with an AUTH_REQUIRED code. If asked to store certain priviliged fields, it will check the authorization level and throw an exception with a FORBIDDEN code if not satisfied. If timestamps do not exist, they will be created based on the system clock.

Finally, the Data object is instructed to save itself.

If successful, it will return a store element in the output namespace with the number 1.

<this-story/>

Will return an XML representation of the data submitted in the last request, enclosed in a story-submission element. Particularly useful for previewing a submission.

<get-story/>

Will return an XML representation of the data for a previously saved story, enclosed in a story-loaded element. It needs to get the story identified by storyname and sectionid attributes or child elements.

Quirks

There are a few things that I'm not sure how to handle that I've included in this release in an inelegant way. For example, if you want to update an old record with a new storyname (which is not unusual, if for example you don't like the storyname used by the submitter), then you need to include this somehow. For the time being, you must supply the storyname as a query parameter auto-storyname, and the supplied submit.xsp does this. It is then understood by the <store> tag, which does the right thing, but I feel that such a tag shouldn't really need to be aware of such things, from an aestetical POW, suggestion on how to do it differently are welcome.

FORMALITIES

See AxKit::App::TABOO.