NAME
Konstrukt::Plugin::bookmarks::DBI - Konstrukt bookmarks DBI backend driver
SYNOPSIS
#TODO
DESCRIPTION
Konstrukt bookmarks DBI backend driver.
CONFIGURATION
Note that you have to create the tables bookmarks_item
and bookmarks_category
. 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 those settings to use this backend.
#Backend
bookmarks/backend/DBI/source dbi:mysql:database:host
bookmarks/backend/DBI/user user
bookmarks/backend/DBI/pass pass
If no database settings are set the defaults from "CONFIGURATION" in Konstrukt::DBI will be used.
METHODS
init
Initialization of this class
install
Installs the backend (e.g. create tables).
Parameters:
none
add_entry
Adds a new bookmark.
Parameters:
$category - The category under which the bookmark should be added
$url - The URL of this bookmark
$title - The title of this bookmark
$private - Is this entry only visible to the author?
$author - The entry's author
get_entry
Returns the requested bookmark as an hash reference with the keys id, url, title, category, private, visits, author, year, month, day, hour and minute.
Parameters:
$id - The id of the entry
get_entries
Returns the requested category and its sub-categories and -bookmarks visible to the specified author as an hash reference: { id => .., title => .., author => .., private => .., categories => [ { id => .. }, { id => .. }, ... ], bookmarks => [ { id => .., url => "..", title => "..", author => .., private => .., category => .., visits => .., year => .., month => .., ... }, ... ] }
Parameters:
$category - The category whose entries should be returned. All entries will be returned, when $category is 0 (root).
$author - The author who will read the entries. All private entries, whose author not equals to the specified author won't be shown
update_entry
Updates an existing bookmark.
Parameters:
$id - The id of the bookmark, which should be updated
$url - The URL of this bookmark
$title - The title of this bookmark
$private - Is this entry only visible to me?
$category - To which category does this entry belong?
delete_entry
Removes an existing bookmark.
Parameters:
$id - The id of the bookmark, which should be removed
add_category
Adds a new category.
Parameters:
$parent - ID of the parent category
$title - The title of this category
$author - The category's author
$private - Private flag
get_category
Returns the requested category as an hash reference: { id => .., title => .., author => .., private => .., parent => ..}
Parameters:
$id - The id of the category
update_category
Updates an existing category.
Parameters:
$id - The id of the category, which should be updated
$title - The new title
$private - The new private flag
$parent - To which parent category does this category belong?
delete_category
Recursively deletes an existing category and all sub-categories and -items.
Parameters:
$id - The id of the category, which should be removed
visit
Increates the visits counter and updates the last_visit timestamp for a specified bookmark.
Parameters:
$id - The id of the bookmark, which will be visited
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.