SIOC::Forum - SIOC Forum class


SIOC documentation Contained in the SIOC distribution.

Index


Code Index:

NAME

Top

SIOC::Forum -- SIOC Forum class

VERSION

Top

This documentation refers to SIOC::Forum version 1.0.0.

SYNOPSIS

Top

   use SIOC::Forum;

DESCRIPTION

Top

Forums can be thought of as channels or discussion area on which Posts are made. A Forum can be linked to the Site that hosts it. Forums will usually discuss a certain topic or set of related topics, or they may contain discussions entirely devoted to a certain community group or organisation. A Forum will have a moderator who can veto or edit posts before or after they appear in the Forum.

Forums may have a set of subscribed Users who are notified when new Posts are made. The hierarchy of Forums can be defined in terms of parents and children, allowing the creation of structures conforming to topic categories as defined by the Site administrator. Examples of Forums include mailing lists, message boards, Usenet newsgroups and weblogs.

The SIOC Types Ontology Module defines come more specific subclasses of SIOC::Forum.

CLASS ATTRIBUTES

Top

host

The Site that hosts this Forum.

moderators

Users who are moderators of this Forum.

scopes

Roles that have a scope of this Forum.

SUBROUTINES/METHODS

Top

host([$new_host])

Accessor for the attribute of the same name. Call without argument to read the current value of the attribute; sets attribute when called with new value as argument.

add_moderator($new_moderator)

Adds a new value to the corresponding array attribute.

add_scope($new_scope)

Adds a new value to the corresponding array attribute.

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::Forum
# Forum class for the SIOC ontology
###########################################################
#
# $Id: Forum.pm 10 2008-03-01 21:38:39Z geewiz $
#

package SIOC::Forum;

use strict;
use warnings;

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

use Moose;
use MooseX::AttributeHelpers;

extends 'SIOC::Container';

### optional attributes

has 'host' => (
    isa => 'SIOC::Site',
    is => 'rw'
);

has 'moderators' => (
    isa => 'ArrayRef[SIOC::User]',
    metaclass => 'Collection::Array',
    is => 'rw',
    default => sub { [] },
    provides => {
        'push' => 'add_moderator'
    },
);

has 'scopes' => (
    isa => 'ArrayRef[SIOC::Role]',
    metaclass => 'Collection::Array',
    is => 'rw',
    default => sub { [] },
    provides => {
        'push' => 'add_scope'
    },
);

### methods

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

1;
__DATA__
__rdfoutput__
<sioc:Forum rdf:about="[% url %]">
    <sioc:link rdf:resource="[% export_url %]"/>
[% IF title %]
    <dc:title>[% name %]</dc:title>
[% END %]
[% IF description %]
    <dc:description>[% description %]</dc:description>
[% END %]
[% IF comment %]
    <rdfs:comment>[% comment %]</rdfs:comment>
[% END %]

[% FOREACH thread = threads %]
    <sioc:parent_of>
        <sioc:Thread rdf:about="[% thread.url %]">
            <rdfs:seeAlso rdf:resource="[% thread.export_url %]"/>
        </sioc:Thread>
    </sioc:parent_of>
[% END %]

[% FOREACH post = items %]
    <sioc:container_of>
        <sioc:Post rdf:about="[% post.url %]">
            <rdfs:seeAlso rdf:resource="[% post.export_url %]"/>
        </sioc:Post>
    </sioc:container_of>
[% END %]

[% IF next_page_url %]
    <rdfs:seeAlso rdf:resource="[% next_page_url | url %]"/>
[% END %]
</sioc:Forum>
__END__