NAME

Hub::Data::Data - Interface for storing and retrieving web-content

Part of the Hub Library

SYNOPSIS

use Hub;
my $data = Hub::mkinst( 'Data' );

$data->store( $hash );              # stores data by implicit address
$data->store_at( $addr, $hash );    # stores data at address $addr
$data->get( $addr );                # returns data at address

$data->commit();                    # writes to disk

DESCRIPTION

This class provides interfaces for storing and retrieving data.

DESCRIPTION

METHODS

attach define_id init refreshmeta store
commit delete_at new resort store_at
cp get packdata set touch
create_id get_root refresh set_root
attach

Usage: attach this data object to an existing HashFile instance
commit

write to disk

cp

get (return a copy) information

create_id

create id

define_id

define id

delete_at

remove data

get

Usage: get information
get_root

Usage: get_root

Get the root of the data

init

Usage: initialize myself and load the disk files
new

constructor

packdata

Usage: packdata HASHREF

From the bottom up, pack each variable's data.

refresh

reload from disk and reset any instance data

refreshmeta

Usage: refreshmeta ID

Refresh the meta variables (which already exist) at point ID

resort

Usage: resort( $address )

Before calling this method, set '_sort2' to a *number* on the subhashes which have priority. This method will clear that property.

Resorts the items which are peers at the given address. If no address is given, we will resort all root items. The sort value is stored in the subkey: '_sort'.

set

Usage: set information
set_root

Usage: set_root HASH

Set the root of the data!

store

Usage: store information in the embedded hashfile

examples

1)  store( { _id => 'user1', name => 'Ryan', height => '5\'9\"', } );


    %user1{
        name == Ryan
        height == 5'9"
    }


2)  store( { name => "Ryan", height => "5\'9\"", } );


    name == Ryan
    height == 5'9"


2)  store( { user1:name => "Ryan", user1:height => "5\'9\"", } );


    name == Ryan
    height == 5'9"
store_at

store information at the specified address

touch

Usage: touch($hashref)
Usage: touch($address)

Update meta-data. See touch() in Meta.pm for what gets modified.

Example:


    touch( { a => "aye", b => "bee" } )
    touch( "file:data" )


Will:


    update the hash provided
    update the item at address 'file:data' if it is a hash

INTERNAL

AUTHOR

Ryan Gies

COPYRIGHT

Copyright (c) 2006 Livesite Networks, LLC. All rights reserved.

Copyright (c) 2000-2005 Ryan Gies. All rights reserved.

UPDATED

This file created by on at