| XML-XBEL documentation | Contained in the XML-XBEL distribution. |
XML::XBEL::Bookmark - OOP for reading and writing XBEL bookmarks.
use XML::XBEL::Bookmark;
OOP for reading and writing XBEL bookmarks.
Valid args are:
String.
String.
String.
String.
String.
String.
String.
Hash ref, with the following key/value pairs :
Array ref.
Returns a XML::XBEL::Bookmark object.
Get/set the href attribute for an XBEL bookmark.
If modified, the object's modified method is automatically called with the current datetime.
Get/set the title for an XBEL bookmark.
If modified, the object's modified method is automatically called with the current datetime.
Returns a string when called with no arguments; otherwise returns true or false.
Get/set the description for an XBEL bookmark.
If modified, the object's modified method is automatically called with the current datetime.
Returns a string when called with no arguments; otherwise returns true or false.
Get/set the metadata for an XBEL document.
Valid args are :
Array reference
Returns an array reference when called with no arguments; otherwise returns true or false.
Get/set the id attribute for an XBEL bookmark.
If modified, the object's modified method is automatically called with the current datetime.
Returns a string when called with no arguments; otherwise returns true or false.
Get/set the creation datetime for an XBEL bookmark.
Returns a string when called with no arguments; otherwise returns true or false.
Get/set the last modified datetime for an XBEL bookmark.
Returns a string when called with no arguments; otherwise returns true or false.
Get/set the last visited datetime for an XBEL bookmark.
Returns a string when called with no arguments; otherwise returns true or false.
$Revision: 1.4 $
$Date: 2004/06/23 06:23:57 $
Aaron Straup Cope <ascope@cpan.org>
Copyright (c) 2004 Aaron Straup Cope. All rights reserved.
This is free software, you may use it and distribute it under the same terms as Perl itself.
| XML-XBEL documentation | Contained in the XML-XBEL distribution. |
use strict; package XML::XBEL::Bookmark; use base qw (XML::XBEL::thingy XML::XBEL::item XML::XBEL::url XML::XBEL::node XML::XBEL::serialize); # $Id: Bookmark.pm,v 1.4 2004/06/23 06:23:57 asc Exp $
use XML::LibXML;
sub new { my $pkg = shift; my $args = shift; my $root = XML::LibXML::Element->new("bookmark"); my $self = bless {'__root' => $root }, $pkg; foreach my $el ("title","href","id","desc","added","info","modified","visited") { if (! exists($args->{$el})) { next; } $self->$el($args->{$el}); } if (! $self->added()) { $self->added($self->_now()); } return $self; }
sub href { my $self = shift; my $href = shift; if (defined($href)) { $self->modified($self->_now()); } return $self->SUPER::href($href); }
sub title { my $self = shift; my $title = shift; if (defined($title)) { $self->modified($self->_now()); } return $self->SUPER::title($title); }
# Defined in XML::XBEL::item
sub id { my $self = shift; my $id = shift; if (defined($id)) { $self->modified($self->_now()); } return $self->SUPER::id($id); }
# Defined in XML::XBEL::node
# Defined in XML::XBEL::url
# Defined in XML::XBEL::url
# Defined in XML::XBEL::serialize
# Defined in XML::XBEL::serialize
# Defined in XML::XBEL::serialize
return 1;