
Package
Meta-data handling.
A meta-data object is a hash of different types of meta-data (keyed on
the type, such as 'FIELD' and 'TOPICINFO').
Each entry in the hash is an array, where each entry in the array
contains another hash of the key=value pairs, corresponding to a
single meta-datum.
If there may be multiple entries of the same top-level type (i.e. for FIELD
and FILEATTACHMENT) then the array hash multiple entries. These types
are referred to as "keyed" types. The array entries are keyed with the
attribute 'name' which must be in each entry in the array.
For unkeyed types, the array has only one entry.
The module knows nothing about how meta-data is stored. That is entirely the
responsibility of the Store module.
Meta-data objects are created by the Store engine when topics are read. They
are populated using the | ||||||||
| Added: | ||||||||
| > > | ||||||||
Get the web name
ClassMethod topic () | ||||||||
| Added: | ||||||||
| > > | ||||||||
Get the topic name
ObjectMethod put ($type,\%args)Put a hash of key=value pairs into the given type set in this meta. See the main comment for this package to understand how meta-data is represented.ObjectMethod putKeyed ($type,\%args)Put a hash of key=value pairs into the given type set in this meta. The entries are keyed by 'name'. See the main comment for this package to understand how meta-data is represented.ObjectMethod putAll | ||||||||
| Added: | ||||||||
| > > | ||||||||
Replaces all the items of a given key with a new array
This is the logical inverse of the find method
ObjectMethod get ($type,$key) -> \%hashFind the value of a meta-datum in the map. If the type is keyed, the $key parameter is required to say which entry you want. Otherwise it can be undef. WARNING SMELL If key is undef but the type is keyed you get the FIRST entry If you want all the keys of a given type use the 'find' method. The result is a reference to the hash for the item. ObjectMethod find ($type) -> @values
Get all meta data for a specific type
Returns the array stored for the type. This will be zero length
if there are no entries.
| ||||||||
| Changed: | ||||||||
| < < | SMELL: That spec absolutely STINKS !! | |||||||
| > > | SMELL: This is a shallow copy | |||||||
| Deleted: | ||||||||
| < < | SMELL: this is a shallow copy | |||||||
ObjectMethod count ($type) -> $integerReturn the number of entries of the given type that are in this meta setObjectMethod getRevisionInfo ($fromrev) -> ($date,$author,$rev,$comment)Try and get revision info from the meta information, or, if it is not present, kick down to the Store module for the same information. Returns ( $revDate, $author, $rev, $comment ) $rev is an integer revision number.ObjectMethod merge ($otherMeta,$formDef) | ||||||||
| Added: | ||||||||
| > > | ||||||||
ObjectMethod stringify ($types) -> $string | ||||||||
| Added: | ||||||||
| > > | ||||||||
Return a string version of the meta object. Uses \n to separate lines.
If $types is specified, return only types specified by that RE.
ObjectMethod forEachSelectedValue ($types,$keys,\&fn,\%options) | ||||||||
| Added: | ||||||||
| > > | ||||||||
Iterate over the values selected by the regular expressions in $types and
$keys.
\&fn on each, and replacing the value
with the result of \&fn.
\%options will be passed on to $fn, with the following additions:
ObjectMethod getParent () -> $parent | ||||||||
| Added: | ||||||||
| > > | ||||||||
Gets the TOPICPARENT name.
ObjectMethod getFormName () -> $formnameReturns the name of the FORM, or '' if none. | ||||||||