NAME

Konstrukt::Plugin::tags::DBI - Tagging DBI backend

SYNOPSIS

#TODO

DESCRIPTION

Tagging DBI Backend driver.

CONFIGURATION

Note that you have to create the table tag. You may turn on the install setting (see "CONFIGURATION" in Konstrukt::Handler) or use the KonstruktBackendInitialization.pl script to accomplish this task.

You may define the source of this backend:

#backend
blog/backend/DBI/source       dbi:mysql:database:host
blog/backend/DBI/user         user
blog/backend/DBI/pass         pass

If no database settings are set the defaults from "CONFIGURATION" in Konstrukt::DBI will be used.

LIMITATIONS

The current data model has a max length for the tag title of 255 chars, for the plugin name of 64 chars and for the entry identifier of 128 chars. The identifier is a string, not a number (but of course can also contain numbers).

METHODS

init

Initialization of this class

install

Installs the backend (e.g. create tables).

Parameters:

none

set

Sets the tags for a specified entry.

Parameters:

  • $plugin - The plugin the entry belongs to

  • $entry - The identifier of the entry

  • @tags - List of all (not only new ones) tags for this entry.

get

Implementation of the get method of the plugin.

get_entries

Returns the entries, that match a specified tag query string and optionally belong to a specified plugin.

If a plugin is specified the identifiers (strings or numbers) of the entries will be returned in an arrayref:

[ 'someentry', 'someother', 23, 42, ... ]

Otherwise the entries will be returned as a reference to an array containing hash references with the identifier and the plugin for each entry:

[
	{ entry => 'someentry', plugin => 'someplugin' },
	...
]

Parameters:

  • $tagquery - Reference to an array containing the tags that each entry must have to match.

    ["sometag", "some other tag", "foo", "bar"]
    ->
    WHERE title = "sometag" AND title = "some other tag" AND title = "foo" AND title = "bar"

    There may also be additional arrayref entries inside the list which represent an OR-combined set of tags.

    ["sometag", [qw/one of these seven tags is enough/], "baz"]
    ->
    WHERE title = "sometag" AND title IN ("one", "of", "these", "seven", "tags", "is", "enough") AND title = "baz"
  • $plugin - Optional: Only return entries of this plugin.

delete

Implementation of "delete" in Konstrukt::Plugin::tags.

AUTHOR

Copyright 2006 Thomas Wittek (mail at gedankenkonstrukt dot de). All rights reserved.

This document is free software. It is distributed under the same terms as Perl itself.

SEE ALSO

Konstrukt::Plugin::blog, Konstrukt