Repository::Simple - Simple heirarchical repository for Perl
use Repository::Simple; my $repository = Repository::Simple->attach( FileSystem => root => /home/foo );
NOTICE: This software is still in development and the interface WILL CHANGE.
This is the main module of a hierarchical repository system, which is loosely based upon the File::System module I've. See "DIFFERENCES FROM JSR 170" for details of the major deviations.
This is a glossary of the terms used by this library. Many of these have been borrowed from the JSR 170 terminology.
A name is given to every node and path in the tree. A name may contain any number of letters, numbers, underscores, dashes, and colons. No other letter is permitted in a name.
Data in the repository is associated with objects called nodes. Each node has a parent which roots it in the hierarchy. Each node has a name. A node may have zero or more properties associated with it. A node may have zero or more child nodes associated with it.
The node type determines when/how a node may be changed and the acceptable names and types of child properties and nodes.
Relative to a given node or property, the parent is the node that is one-level higher than the given node or.
A property is a field associated with a node object. Each field has a single parent node. Each field has a name. Each field has a value.
A property type determines when/how a property may be changed and what values are acceptable, via a selected value type.
The repository is the name for this storage API, specifically for the repository, node, property, and value classes.
The storage engine is the back-end storage device a repository refers to. The storage engine is responsible for actually reading from and writing to the storage device. The repository can be used without direct knowledge of the storage device in use.
Type is the generic term referred to describe the permitted nature of an object in the system. There are three kinds of type: node type, property type, and value type.
A value is the data associated with a property.
A value type restricts the kinds of values that can be associated with a property. It may define how a value is checked for correctness and may define methods for serializing and deserializing values of the given type.:
Not yet implemented. This engine reads and stores hierarchies inside of SQL databases.
This storage engine maps a hierarchy into the native file system.
Not yet implemented. This storage engine allows one or more engines to be layered over top of each other.
Not yet implemented. This storage engine reads and stores hierarchies in transient memory structures.
Not yet implemented. This storage engine simply wraps another storage engine as a mechanism to simplify meta-engine extensions.
Not yet implemented. This storage engine allows for VFS-like mounting of one or more engines via a mount table.
Not yet implemented. This storage engine reads and stores data in an XML file.
As of this writing, only read operations have been implemented. Write operations are planned, but haven't been designed or implemented yet.');
This will attach to a repository via the named engine,
$engine. The repository object representing that storage is returned.
If the
$engine does not contain any colons, then the package "
Repository::Simple::Engine::$engine" is loaded. Otherwise, the
$engine is loaded and its
new method is used.
Any additional arguments passed to this method are then passed to the
new method of the engine.
See Repository::Simple::Engine if you are interested in the guts.
Given an engine, this constructor wraps the engine with a repository object.
Returns a reference to the engine this repository is using.
Returns the Repository::Simple::Type::Node object for the given
$name or returns
undef if no such type exists in the repository.
Returns the Repository::Simple::Type::Property object for the given
$name or returns
undef if no such type exists in the repository.
Return the root node in the repository.
Return the node (Repository::Simple::Node) or property (Repository::Simple::Property) found at the given path. This method returns
undef if the given path points to nothing.
Determine the meaning of the name prefixes used by the engine. This returns a hash of all namespace information currently used by the storage engine.
This method will
croak() if the specified action,
$action, is not permitted on the given path,
$path, due to access restrictions by the current attached session. The
$path is an absolute path in the repository.
The
$action must be one of the following constants:
Use this to see if the current session is permitted to create a node at
$path.
Use this to see if the current session is permitted to modify the property at
$path.
Use this to see if the current session is permitted to remove the node or property at
$path..
There are a number of tasks remaining to do on this project. Here are a few of the big.