| 1 | # $Id: /local/CPAN/Apache-AxKit-Language-XSP-ObjectTaglib/lib/AxKit/XSP/ObjectTaglib/Demo.pm 1508 2005-03-10T02:56:40.581331Z claco $ | ||
| 2 | package AxKit::XSP::ObjectTaglib::Demo; | ||
| 3 | use strict; | ||
| 4 | use warnings; | ||
| 5 | use base 'Apache::AxKit::Language::XSP::ObjectTaglib'; | ||
| 6 | use vars qw($NS @specification); | ||
| 7 | |||
| 8 | $NS = 'http://today.icantfocus.com/CPAN/AxKit/XSP/ObjectTaglib/Demo'; | ||
| 9 | |||
| 10 | @specification = ( | ||
| 11 | { | ||
| 12 | tag => 'name', | ||
| 13 | context => 'resources', | ||
| 14 | target => 'resource' | ||
| 15 | }, { | ||
| 16 | tag => 'resources', | ||
| 17 | target => 'course', | ||
| 18 | type => 'loop', | ||
| 19 | iterator => 'resource' | ||
| 20 | }, { | ||
| 21 | tag => 'courses', | ||
| 22 | type => 'special', | ||
| 23 | start => \&start_courses, | ||
| 24 | end => \&end_courses | ||
| 25 | }, { | ||
| 26 | tag => 'name', | ||
| 27 | target => 'course' | ||
| 28 | }, { | ||
| 29 | tag => 'code', | ||
| 30 | target => 'course' | ||
| 31 | }, { | ||
| 32 | tag => 'description', | ||
| 33 | target => 'course', | ||
| 34 | type => 'as_xml' | ||
| 35 | }, { | ||
| 36 | tag => 'summary', | ||
| 37 | target => 'course', | ||
| 38 | type => 'as_xml' | ||
| 39 | }, { | ||
| 40 | tag => 'presentations', | ||
| 41 | target => 'course', | ||
| 42 | type => 'loop', | ||
| 43 | iterator => 'presentation' | ||
| 44 | }, { | ||
| 45 | tag => 'size', | ||
| 46 | key => 'calculateSize', | ||
| 47 | target => 'presentation', | ||
| 48 | notnull => 1 | ||
| 49 | }, { | ||
| 50 | tag => 'prerequisites', | ||
| 51 | target => 'course', | ||
| 52 | type => 'loop', | ||
| 53 | iterator => 'course' | ||
| 54 | } | ||
| 55 | ); | ||
| 56 | |||
| 57 | sub start_courses { | ||
| 58 | my ($e, $tag, %attr) = @_; | ||
| 59 | |||
| 60 | $e->manage_text(0); | ||
| 61 | |||
| 62 | my $out = ' | ||
| 63 | use AxKit::XSP::ObjectTaglib::Demo::Courses; | ||
| 64 | |||
| 65 | my @_xsp_axkit_xsp_objecttaglib_demo_courses = | ||
| 66 | AxKit::XSP::ObjectTaglib::Demo::Courses->load; | ||
| 67 | |||
| 68 | for my $_xsp_axkit_xsp_objecttaglib_demo_course | ||
| 69 | (@_xsp_axkit_xsp_objecttaglib_demo_courses) { | ||
| 70 | |||
| 71 | '; | ||
| 72 | |||
| 73 | return $out; | ||
| 74 | }; | ||
| 75 | |||
| 76 | sub end_courses { | ||
| 77 | my ($e, $tag, %attr) = @_; | ||
| 78 | |||
| 79 | $e->manage_text(0); | ||
| 80 | |||
| 81 | my $out = ' | ||
| 82 | }; | ||
| 83 | '; | ||
| 84 | |||
| 85 | return $out; | ||
| 86 | }; | ||
| 87 | |||
| 88 | 1; | ||
| 89 | __END__ |