ZConf::Bookmarks - ZConf backed bookmark storage system.
Version 0.2.4
use ZConf::Bookmarks; my $zbm = ZConf::Bookmarks->new();
This initializes it.
One arguement is taken and that is a hash value.
If this is set to true, it will automatically call init the set and config. If this is set to false or not defined, besure to check '$zbm->{init}' to see if the config/module has been initiated or not.
If it is not specified, it will default to true.
This is the set to load initially.
If this key is defined, this hash will be passed to ZConf->new().
my $zbm=ZConf::Bookmarks->new(); if($zbm->{error}){ print "Error!\n"; }
This adds a bookmark for a specified scheme.
Only one arguement is accepted and that is a hash. Please see the below for a list of keys.
This is name for a book mark.
This is a description for the bookmark.
This is the URI, minus scheme. Thus 'http://vvelox.net/' would become 'vvelox.net'.
This is the scheme it should be added it. If it is not in lower case it will be converted to it.
my %newBM; $newBM{description}='VVelox.net'; $newBM{name}='VVelox.net'; $newBM{link}='vvelox.net'; $newBM{scheme}='http'; $zbm->modBookmark(%newBM); if($zbm->{error}){ print "Error!\n"; }
This verifies a bookmark ID exists for a specified scheme.
You do have to check the return value as it will contain if it exists or not. $zbm->{error} is only true if there is an error and for this the bookmark ID not existing is not considered an error.
my $returned=$zbm->bookmarkExists($scheme, $bmid); if($zbm->{error}){ print "Error!\n"; }else{ if($returned){ print "It does exist.\n"; }else{ print "It does not exist.\n"; } }
This removes a bookmark.
Two arguements are required. The first is the scheme and the second is the bookmark.
$zbm->delBookmark($scheme, $bmid); if($zbm->{error}){ print "Error\n"; }
This reads a returns a bookmark.
Two arguements are accepted. The first is the scheme and the second is the bookmark ID.
my %bookmark=$zbm->get($scheme, $bmID); if($zbm->{error}){ print "Error!\n"; }
This gets what the current set is.
my $set=$zbm->getSet; if($zbm->{error}){ print "Error!\n"; }
This initializes it or a new set.
If the specified set already exists, it will be reset.
One arguement is required and it is the name of the set. If it is not defined, ZConf will use the default one.
#creates a new set named foo $zbm->init('foo'); if($zbm->{error}){ print "Error!\n"; } #creates a new set with ZConf choosing it's name $zbg->init(); if($zbm->{error}){ print "Error!\n"; }
This lists the currently setup bookmark IDs for a scheme.
Only one arguement is accepted and that is the scheme to look under.
my @bookmarkIDs=$zbm->listBookmarks('http'); if($zbm->{error}){ print "Error!\n"; }
This lists the current schemes available to choose from.
my @schemes=$zbm->listSchemes(); if($zbm->{error}){ print "Error!\n"; }
This lists the available sets.
my @sets=$zbm->listSets; if($zbm->{error}){ print "Error!"; }
Modify a bookmark.
Only one arguement is accepted and it is a hash. Please see the hash information below for the required keys.
The bookmark ID to be changed.
This is the scheme it should be added it.
my %newBM; $newBM{bmid}=$bmid; $newBM{description}='VVelox.net'; $newBM{name}='VVelox.net'; $newBM{link}='vvelox.net'; $newBM{scheme}='http'; $zbm->modBookmark(%newBM); if($zbm->{error}){ print "Error!\n"; }
This checks if a scheme has any thing setup or not.
Only one option is accepted and that is the scheme to check for.
You do have to check the return value as it will contain if it exists or not. $zbm->{error} is only true if there is an error and for this the scheme not existing is not considered an error.
my $returned=$zbm->schemeExists('http'); if($zbm->{error}){ print "Error!\n"; }else{ if($returned){ print "It exists.\n"; }else{ print "It does not exists.\n"; } }
This reads a specific set. If the set specified is undef, the default set is read.
#read the default set $zcr->readSet(); if($zcr->{error}){ print "Error!\n"; } #read the set 'someSet' $zcr->readSet('someSet'); if($zcr->{error}){ print "Error!\n"; }
This blanks the error storage and is only meant for internal usage.
It does the following.
$self->{error}=undef; $self->{errorString}="";
Could not initialize ZConf.
ZConf error.
Missing a required arguement.
The highly unlikely event that there a duplicate bookmark ID exists after three attempts to generate one has happened. If this happens, it means your the local time function, or your system clock, and rand number generator are fragged.
For some uber add the use of setVar here failed.
Bookmark does not exist.
Scheme does not exist.
Zane C. Bowers, <vvelox at vvelox.net>
<vvelox at vvelox.net>
Please report any bugs or feature requests to bug-zconf-bookmarks at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=ZConf-Bookmarks. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-zconf-bookmarks at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc ZConf::Bookmarks
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=ZConf-Bookmarks
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/ZConf-Bookmarks
CPAN Ratings
http://cpanratings.perl.org/d/ZConf-Bookmarks
Search CPAN
http://search.cpan.org/dist/ZConf-Bookmarks
Copyright 2009 Zane C. Bowers, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install ZConf::Bookmarks, copy and paste the appropriate command in to your terminal.
cpanm
cpanm ZConf::Bookmarks
CPAN shell
perl -MCPAN -e shell install ZConf::Bookmarks
For more information on module installation, please visit the detailed CPAN module installation guide.