SIOC::Thread - SIOC Thread class


SIOC documentation Contained in the SIOC distribution.

Index


Code Index:

NAME

Top

SIOC::Thread -- SIOC Thread class

VERSION

Top

This documentation refers to SIOC::Thread version 1.0.0.

SYNOPSIS

Top

   use SIOC::Thread;

DESCRIPTION

Top

Mailing lists, forums and blogs on community sites usually employ some threaded discussion methods, whereby discussions are initialised by a certain user and replied to by others. The Thread container is used to group Posts from a single discussion thread together via the sioc:container_of property, especially where a sioc:has_reply / reply_of structure is absent.

SUBROUTINES/METHODS

Top

TODO: document methods

DIAGNOSTICS

Top

For diagnostics information, see the SIOC base class.

CONFIGURATION AND ENVIRONMENT

Top

This module doesn't need configuration.

DEPENDENCIES

Top

This module depends on the following modules:

INCOMPATIBILITIES

Top

There are no known incompatibilities.

BUGS AND LIMITATIONS

Top

There are no known bugs in this module.

Please report problems via the bug tracking system on the perl-SIOC project website: http://developer.berlios.de/projects/perl-sioc/.

Patches are welcome.

AUTHOR

Top

Jochen Lillich <geewiz@cpan.org>

LICENSE AND COPYRIGHT

Top


SIOC documentation Contained in the SIOC distribution.

###########################################################
# SIOC::Thread
# Thread class for the SIOC ontology
###########################################################
#
# $Id: Thread.pm 10 2008-03-01 21:38:39Z geewiz $
#

package SIOC::Thread;

use strict;
use warnings;

use version; our $VERSION = qv(1.0.0);

use Moose;

extends 'SIOC::Container';

### required attributes

has 'page' => (
    isa => 'Num',
    is => 'ro',
    required => 1,
    );

### methods

after 'fill_template' => sub {
    my ($self) = @_;
    
    $self->set_template_var(page => $self->page);
};

1;
__DATA__
__rdfoutput__
<sioc:Thread rdf:about="[% url | url %]">
    <sioc:link rdf:resource="[% url | url %]"/>
[% IF views %]
    <sioc:num_views>[% views %]</sioc:num_views>
[% END %]
[% IF note %]
    <rdfs:comment>[% note %]</rdfs:comment>
[% END %]
[% FOREACH topic = topics %]
    <sioc:topic>[% topic %]</sioc:topic>
[% END %]
[% FOREACH post = items %]
    <sioc:container_of>
        <sioc:Post rdf:about="[% post.url | url %]">
            <rdfs:seeAlso rdf:resource="[% siocURL('post', post.id) %]"/>
[% IF post.prev_by_date %]
		    <sioc:previous_by_date rdf:resource="[% post.prev_by_date | url %]"/>
[% END %]
[% IF post.next_by_date %]
		    <sioc:next_by_date rdf:resource="[% post.next_by_date | url %]"/>
[% END %]
        </sioc:Post>
    </sioc:container_of>
[% END %]
[% IF next %]
    <rdfs:seeAlso rdf:resource="[% siocURL('thread', id, page+1) %]"/>
[% END %]
</sioc:Thread>
__END__