2015-09-03 00:55:04 +02:00
|
|
|
####################################################################################################################################
|
|
|
|
# DOC MODULE
|
|
|
|
####################################################################################################################################
|
|
|
|
package BackRestDoc::Doc;
|
|
|
|
|
|
|
|
use strict;
|
|
|
|
use warnings FATAL => qw(all);
|
|
|
|
use Carp qw(confess);
|
|
|
|
|
|
|
|
use Exporter qw(import);
|
|
|
|
our @EXPORT = qw();
|
|
|
|
use File::Basename qw(dirname);
|
|
|
|
|
|
|
|
use lib dirname($0) . '/../lib';
|
|
|
|
use BackRest::Common::Log;
|
|
|
|
use BackRest::Common::String;
|
|
|
|
|
|
|
|
####################################################################################################################################
|
|
|
|
# Operation constants
|
|
|
|
####################################################################################################################################
|
|
|
|
use constant OP_DOC => 'Doc';
|
|
|
|
|
|
|
|
use constant OP_DOC_BUILD => OP_DOC . '->build';
|
2015-09-08 13:31:24 +02:00
|
|
|
use constant OP_DOC_NAME_GET => OP_DOC . '->nameGet';
|
2015-09-03 00:55:04 +02:00
|
|
|
use constant OP_DOC_NEW => OP_DOC . '->new';
|
2015-09-08 13:31:24 +02:00
|
|
|
use constant OP_DOC_NODE_BLESS => OP_DOC . '->nodeBless';
|
2015-09-03 00:55:04 +02:00
|
|
|
use constant OP_DOC_NODE_GET => OP_DOC . '->nodeGet';
|
2015-09-08 13:31:24 +02:00
|
|
|
use constant OP_DOC_NODE_LIST => OP_DOC . '->nodeList';
|
|
|
|
use constant OP_DOC_PARAM_GET => OP_DOC . '->paramGet';
|
|
|
|
use constant OP_DOC_PARAM_SET => OP_DOC . '->paramSet';
|
2015-09-03 00:55:04 +02:00
|
|
|
use constant OP_DOC_PARSE => OP_DOC . '->parse';
|
2015-09-08 13:31:24 +02:00
|
|
|
use constant OP_DOC_VALUE_GET => OP_DOC . '->valueGet';
|
2015-09-03 00:55:04 +02:00
|
|
|
|
|
|
|
####################################################################################################################################
|
|
|
|
# CONSTRUCTOR
|
|
|
|
####################################################################################################################################
|
|
|
|
sub new
|
|
|
|
{
|
|
|
|
my $class = shift; # Class name
|
|
|
|
|
|
|
|
# Create the class hash
|
|
|
|
my $self = {};
|
|
|
|
bless $self, $class;
|
|
|
|
|
2015-09-08 13:31:24 +02:00
|
|
|
$self->{strClass} = $class;
|
|
|
|
|
2015-09-03 00:55:04 +02:00
|
|
|
# Assign function parameters, defaults, and log debug info
|
|
|
|
(
|
|
|
|
my $strOperation,
|
|
|
|
$self->{strFileName}
|
|
|
|
) =
|
|
|
|
logDebugParam
|
|
|
|
(
|
|
|
|
OP_DOC_NEW, \@_,
|
|
|
|
{name => 'strFileName'}
|
|
|
|
);
|
|
|
|
|
|
|
|
my $oParser = XML::Checker::Parser->new(ErrorContext => 2, Style => 'Tree');
|
|
|
|
$oParser->set_sgml_search_path(dirname($self->{strFileName}) . '/dtd');
|
|
|
|
|
|
|
|
my $oTree;
|
|
|
|
|
|
|
|
eval
|
|
|
|
{
|
|
|
|
local $XML::Checker::FAIL = sub
|
|
|
|
{
|
|
|
|
my $iCode = shift;
|
|
|
|
|
|
|
|
die XML::Checker::error_string($iCode, @_);
|
|
|
|
};
|
|
|
|
|
|
|
|
$oTree = $oParser->parsefile($self->{strFileName});
|
|
|
|
};
|
|
|
|
|
|
|
|
# Report any error that stopped parsing
|
|
|
|
if ($@)
|
|
|
|
{
|
|
|
|
$@ =~ s/at \/.*?$//s; # remove module line number
|
|
|
|
die "malformed xml in '$self->{strFileName}':\n" . trim($@);
|
|
|
|
}
|
|
|
|
|
|
|
|
# Parse and build the doc
|
|
|
|
$self->{oDoc} = $self->build($self->parse(${$oTree}[0], ${$oTree}[1]));
|
2015-09-08 13:31:24 +02:00
|
|
|
$self->{strName} = 'root';
|
2015-09-03 00:55:04 +02:00
|
|
|
|
|
|
|
# Return from function and log return values if any
|
|
|
|
return logDebugReturn
|
|
|
|
(
|
|
|
|
$strOperation,
|
|
|
|
{name => 'self', value => $self}
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
####################################################################################################################################
|
|
|
|
# parse
|
|
|
|
#
|
|
|
|
# Parse the xml doc into a more usable hash and array structure.
|
|
|
|
####################################################################################################################################
|
|
|
|
sub parse
|
|
|
|
{
|
|
|
|
my $self = shift;
|
|
|
|
|
|
|
|
# Assign function parameters, defaults, and log debug info
|
|
|
|
my
|
|
|
|
(
|
|
|
|
$strOperation,
|
|
|
|
$strName,
|
|
|
|
$oyNode
|
|
|
|
) =
|
|
|
|
logDebugParam
|
|
|
|
(
|
|
|
|
OP_DOC_PARSE, \@_,
|
|
|
|
{name => 'strName', trace => true},
|
|
|
|
{name => 'oyNode', trace => true}
|
|
|
|
);
|
|
|
|
|
|
|
|
my %oOut;
|
|
|
|
my $iIndex = 0;
|
|
|
|
my $bText = $strName eq 'text' || $strName eq 'li' || $strName eq 'code-block';
|
|
|
|
|
|
|
|
# Store the node name
|
|
|
|
$oOut{name} = $strName;
|
|
|
|
|
|
|
|
if (keys($$oyNode[$iIndex]))
|
|
|
|
{
|
|
|
|
$oOut{param} = $$oyNode[$iIndex];
|
|
|
|
}
|
|
|
|
|
|
|
|
$iIndex++;
|
|
|
|
|
|
|
|
# Look for strings and children
|
|
|
|
while (defined($$oyNode[$iIndex]))
|
|
|
|
{
|
|
|
|
# Process string data
|
|
|
|
if (ref(\$$oyNode[$iIndex]) eq 'SCALAR' && $$oyNode[$iIndex] eq '0')
|
|
|
|
{
|
|
|
|
$iIndex++;
|
|
|
|
my $strBuffer = $$oyNode[$iIndex++];
|
|
|
|
|
|
|
|
# Strip tabs, CRs, and LFs
|
|
|
|
$strBuffer =~ s/\t|\r//g;
|
|
|
|
|
|
|
|
# If anything is left
|
|
|
|
if (length($strBuffer) > 0)
|
|
|
|
{
|
|
|
|
# If text node then create array entries for strings
|
|
|
|
if ($bText)
|
|
|
|
{
|
|
|
|
if (!defined($oOut{children}))
|
|
|
|
{
|
|
|
|
$oOut{children} = [];
|
|
|
|
}
|
|
|
|
|
|
|
|
push($oOut{children}, $strBuffer);
|
|
|
|
}
|
|
|
|
# Don't allow strings mixed with children
|
|
|
|
elsif (length(trim($strBuffer)) > 0)
|
|
|
|
{
|
|
|
|
if (defined($oOut{children}))
|
|
|
|
{
|
|
|
|
confess "text mixed with children in node ${strName} (spaces count)";
|
|
|
|
}
|
|
|
|
|
|
|
|
if (defined($oOut{value}))
|
|
|
|
{
|
|
|
|
confess "value is already defined in node ${strName} - this shouldn't happen";
|
|
|
|
}
|
|
|
|
|
|
|
|
# Don't allow text mixed with
|
|
|
|
$oOut{value} = $strBuffer;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
# Process a child
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (defined($oOut{value}) && $bText)
|
|
|
|
{
|
|
|
|
confess "text mixed with children in node ${strName} before child " . $$oyNode[$iIndex++] . " (spaces count)";
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!defined($oOut{children}))
|
|
|
|
{
|
|
|
|
$oOut{children} = [];
|
|
|
|
}
|
|
|
|
|
|
|
|
push($oOut{children}, $self->parse($$oyNode[$iIndex++], $$oyNode[$iIndex++]));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
# Return from function and log return values if any
|
|
|
|
return logDebugReturn
|
|
|
|
(
|
|
|
|
$strOperation,
|
|
|
|
{name => 'oDoc', value => \%oOut, trace => true}
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
####################################################################################################################################
|
|
|
|
# build
|
|
|
|
#
|
|
|
|
# Restructure the doc to make walking it easier.
|
|
|
|
####################################################################################################################################
|
|
|
|
sub build
|
|
|
|
{
|
|
|
|
my $self = shift;
|
|
|
|
|
|
|
|
# Assign function parameters, defaults, and log debug info
|
|
|
|
my
|
|
|
|
(
|
|
|
|
$strOperation,
|
|
|
|
$oDoc
|
|
|
|
) =
|
|
|
|
logDebugParam
|
|
|
|
(
|
|
|
|
OP_DOC_BUILD, \@_,
|
|
|
|
{name => 'oDoc', trace => true}
|
|
|
|
);
|
|
|
|
|
|
|
|
# Initialize the node object
|
|
|
|
my $oOut = {name => $$oDoc{name}, children => []};
|
|
|
|
my $strError = "in node $$oDoc{name}";
|
|
|
|
|
|
|
|
# Get all params
|
|
|
|
if (defined($$oDoc{param}))
|
|
|
|
{
|
|
|
|
for my $strParam (keys $$oDoc{param})
|
|
|
|
{
|
|
|
|
$$oOut{param}{$strParam} = $$oDoc{param}{$strParam};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (defined($$oDoc{children}))
|
|
|
|
{
|
|
|
|
for (my $iIndex = 0; $iIndex < @{$$oDoc{children}}; $iIndex++)
|
|
|
|
{
|
|
|
|
my $oSub = $$oDoc{children}[$iIndex];
|
|
|
|
my $strName = $$oSub{name};
|
|
|
|
|
|
|
|
if ($strName eq 'text' || $strName eq 'code-block')
|
|
|
|
{
|
|
|
|
$$oOut{field}{text} = $oSub;
|
|
|
|
}
|
|
|
|
elsif (defined($$oSub{value}))
|
|
|
|
{
|
|
|
|
$$oOut{field}{$strName} = $$oSub{value};
|
|
|
|
}
|
|
|
|
elsif (!defined($$oSub{children}))
|
|
|
|
{
|
|
|
|
$$oOut{field}{$strName} = true;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
push($$oOut{children}, $self->build($oSub));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
# Return from function and log return values if any
|
|
|
|
return logDebugReturn
|
|
|
|
(
|
|
|
|
$strOperation,
|
|
|
|
{name => 'oDoc', value => $oOut, trace => true}
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
####################################################################################################################################
|
|
|
|
# nodeGet
|
|
|
|
#
|
|
|
|
# Return a node by name - error if more than one exists
|
|
|
|
####################################################################################################################################
|
2015-09-08 13:31:24 +02:00
|
|
|
sub nodeGetById
|
2015-09-03 00:55:04 +02:00
|
|
|
{
|
|
|
|
my $self = shift;
|
|
|
|
|
|
|
|
# Assign function parameters, defaults, and log debug info
|
|
|
|
my
|
|
|
|
(
|
|
|
|
$strOperation,
|
|
|
|
$strName,
|
2015-09-08 13:31:24 +02:00
|
|
|
$strId,
|
2015-09-03 00:55:04 +02:00
|
|
|
$bRequired,
|
|
|
|
) =
|
|
|
|
logDebugParam
|
|
|
|
(
|
|
|
|
OP_DOC_NODE_GET, \@_,
|
|
|
|
{name => 'strName', trace => true},
|
2015-09-08 13:31:24 +02:00
|
|
|
{name => 'strId', required => false, trace => true},
|
|
|
|
{name => 'bRequired', default => true, trace => true}
|
2015-09-03 00:55:04 +02:00
|
|
|
);
|
|
|
|
|
2015-09-08 13:31:24 +02:00
|
|
|
my $oDoc = $self->{oDoc};
|
2015-09-03 00:55:04 +02:00
|
|
|
my $oNode;
|
|
|
|
|
|
|
|
for (my $iIndex = 0; $iIndex < @{$$oDoc{children}}; $iIndex++)
|
|
|
|
{
|
2015-09-08 13:31:24 +02:00
|
|
|
if ((defined($strName) && $$oDoc{children}[$iIndex]{name} eq $strName) &&
|
|
|
|
(!defined($strId) || $$oDoc{children}[$iIndex]{param}{id} eq $strId))
|
2015-09-03 00:55:04 +02:00
|
|
|
{
|
|
|
|
if (!defined($oNode))
|
|
|
|
{
|
|
|
|
$oNode = $$oDoc{children}[$iIndex];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
confess "found more than one child ${strName} in node $$oDoc{name}";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!defined($oNode) && $bRequired)
|
|
|
|
{
|
2015-10-08 17:43:56 +02:00
|
|
|
confess "unable to find child ${strName} (${strId}) in node $$oDoc{name}";
|
2015-09-03 00:55:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
# Return from function and log return values if any
|
|
|
|
return logDebugReturn
|
|
|
|
(
|
|
|
|
$strOperation,
|
2015-09-08 13:31:24 +02:00
|
|
|
{name => 'oNodeDoc', value => $self->nodeBless($oNode), trace => true}
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
####################################################################################################################################
|
|
|
|
# nodeGet
|
|
|
|
#
|
|
|
|
# Return a node by name - error if more than one exists
|
|
|
|
####################################################################################################################################
|
|
|
|
sub nodeGet
|
|
|
|
{
|
|
|
|
my $self = shift;
|
|
|
|
|
|
|
|
return $self->nodeGetById(shift, undef, shift);
|
|
|
|
}
|
|
|
|
|
|
|
|
####################################################################################################################################
|
|
|
|
# nodeBless
|
|
|
|
#
|
|
|
|
# Make a new Doc object from a node.
|
|
|
|
####################################################################################################################################
|
|
|
|
sub nodeBless
|
|
|
|
{
|
|
|
|
my $self = shift;
|
|
|
|
|
|
|
|
# Assign function parameters, defaults, and log debug info
|
|
|
|
my
|
|
|
|
(
|
|
|
|
$strOperation,
|
|
|
|
$oNode
|
|
|
|
) =
|
|
|
|
logDebugParam
|
|
|
|
(
|
|
|
|
OP_DOC_NODE_BLESS, \@_,
|
|
|
|
{name => 'oNode', required => false, trace => true}
|
|
|
|
);
|
|
|
|
|
|
|
|
my $oDoc;
|
|
|
|
|
|
|
|
if (defined($oNode))
|
|
|
|
{
|
|
|
|
$oDoc = {};
|
|
|
|
bless $oDoc, $self->{strClass};
|
|
|
|
|
|
|
|
$oDoc->{strClass} = $self->{strClass};
|
|
|
|
$oDoc->{strName} = $$oNode{name};
|
|
|
|
$oDoc->{oDoc} = $oNode;
|
|
|
|
}
|
|
|
|
|
|
|
|
# Return from function and log return values if any
|
|
|
|
return logDebugReturn
|
|
|
|
(
|
|
|
|
$strOperation,
|
|
|
|
{name => 'oDoc', value => $oDoc, trace => true}
|
2015-09-03 00:55:04 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
####################################################################################################################################
|
|
|
|
# nodeList
|
|
|
|
#
|
|
|
|
# Get a list of nodes.
|
|
|
|
####################################################################################################################################
|
|
|
|
sub nodeList
|
|
|
|
{
|
|
|
|
my $self = shift;
|
|
|
|
|
|
|
|
# Assign function parameters, defaults, and log debug info
|
|
|
|
my
|
|
|
|
(
|
|
|
|
$strOperation,
|
|
|
|
$strName,
|
|
|
|
$bRequired,
|
|
|
|
) =
|
|
|
|
logDebugParam
|
|
|
|
(
|
2015-09-08 13:31:24 +02:00
|
|
|
OP_DOC_NODE_LIST, \@_,
|
2015-09-03 00:55:04 +02:00
|
|
|
{name => 'strName', required => false, trace => true},
|
|
|
|
{name => 'bRequired', default => true, trace => true},
|
|
|
|
);
|
|
|
|
|
2015-09-08 13:31:24 +02:00
|
|
|
my $oDoc = $self->{oDoc};
|
2015-09-03 00:55:04 +02:00
|
|
|
my @oyNode;
|
|
|
|
|
2015-09-08 13:31:24 +02:00
|
|
|
if (defined($$oDoc{children}))
|
2015-09-03 00:55:04 +02:00
|
|
|
{
|
2015-09-08 13:31:24 +02:00
|
|
|
for (my $iIndex = 0; $iIndex < @{$$oDoc{children}}; $iIndex++)
|
2015-09-03 00:55:04 +02:00
|
|
|
{
|
2015-09-08 13:31:24 +02:00
|
|
|
if (!defined($strName) || $$oDoc{children}[$iIndex]{name} eq $strName)
|
|
|
|
{
|
|
|
|
if (ref(\$$oDoc{children}[$iIndex]) eq "SCALAR")
|
|
|
|
{
|
|
|
|
push(@oyNode, $$oDoc{children}[$iIndex]);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
push(@oyNode, $self->nodeBless($$oDoc{children}[$iIndex]));
|
|
|
|
}
|
|
|
|
}
|
2015-09-03 00:55:04 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (@oyNode == 0 && $bRequired)
|
|
|
|
{
|
2015-09-08 13:31:24 +02:00
|
|
|
confess 'unable to find ' . (defined($strName) ? "children named '${strName}'" : 'any children') . " in node $$oDoc{name}";
|
2015-09-03 00:55:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
# Return from function and log return values if any
|
|
|
|
return logDebugReturn
|
|
|
|
(
|
|
|
|
$strOperation,
|
2015-09-08 13:31:24 +02:00
|
|
|
{name => 'oyNode', value => \@oyNode, trace => true}
|
2015-09-03 00:55:04 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2015-09-08 13:31:24 +02:00
|
|
|
####################################################################################################################################
|
|
|
|
# nameGet
|
|
|
|
####################################################################################################################################
|
|
|
|
sub nameGet
|
|
|
|
{
|
|
|
|
my $self = shift;
|
|
|
|
|
|
|
|
# Assign function parameters, defaults, and log debug info
|
|
|
|
my $strOperation = logDebugParam(OP_DOC_NAME_GET);
|
|
|
|
|
|
|
|
# Return from function and log return values if any
|
|
|
|
return logDebugReturn
|
|
|
|
(
|
|
|
|
$strOperation,
|
|
|
|
{name => 'strName', value => ${$self->{oDoc}}{name}, trace => true}
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
####################################################################################################################################
|
|
|
|
# valueGet
|
|
|
|
####################################################################################################################################
|
|
|
|
sub valueGet
|
|
|
|
{
|
|
|
|
my $self = shift;
|
|
|
|
|
|
|
|
# Assign function parameters, defaults, and log debug info
|
|
|
|
my $strOperation = logDebugParam(OP_DOC_VALUE_GET);
|
|
|
|
|
|
|
|
# Return from function and log return values if any
|
|
|
|
return logDebugReturn
|
|
|
|
(
|
|
|
|
$strOperation,
|
|
|
|
{name => 'strValue', value => ${$self->{oDoc}}{value}, trace => true}
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
####################################################################################################################################
|
|
|
|
# paramGet
|
|
|
|
#
|
|
|
|
# Get a parameter from a node.
|
|
|
|
####################################################################################################################################
|
|
|
|
sub paramGet
|
|
|
|
{
|
|
|
|
my $self = shift;
|
|
|
|
|
|
|
|
# Assign function parameters, defaults, and log debug info
|
|
|
|
my
|
|
|
|
(
|
|
|
|
$strOperation,
|
|
|
|
$strName,
|
|
|
|
$bRequired,
|
|
|
|
$strType
|
|
|
|
) =
|
|
|
|
logDebugParam
|
|
|
|
(
|
|
|
|
OP_DOC_PARAM_GET, \@_,
|
|
|
|
{name => 'strName', trace => true},
|
|
|
|
{name => 'bRequired', default => true, trace => true},
|
|
|
|
{name => 'strType', default => 'param', trace => true}
|
|
|
|
);
|
|
|
|
|
|
|
|
my $strValue = ${$self->{oDoc}}{$strType}{$strName};
|
|
|
|
|
|
|
|
if (!defined($strValue) && $bRequired)
|
|
|
|
{
|
|
|
|
confess "${strType} '${strName}' in required in node '$self->{strName}'";
|
|
|
|
}
|
|
|
|
|
|
|
|
# Return from function and log return values if any
|
|
|
|
return logDebugReturn
|
|
|
|
(
|
|
|
|
$strOperation,
|
|
|
|
{name => 'strValue', value => $strValue, trace => true}
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
####################################################################################################################################
|
|
|
|
# paramSet
|
|
|
|
#
|
|
|
|
# Set a parameter in a node.
|
|
|
|
####################################################################################################################################
|
|
|
|
sub paramSet
|
|
|
|
{
|
|
|
|
my $self = shift;
|
|
|
|
|
|
|
|
# Assign function parameters, defaults, and log debug info
|
|
|
|
my
|
|
|
|
(
|
|
|
|
$strOperation,
|
|
|
|
$strName,
|
|
|
|
$strValue,
|
|
|
|
$strType
|
|
|
|
) =
|
|
|
|
logDebugParam
|
|
|
|
(
|
|
|
|
OP_DOC_PARAM_SET, \@_,
|
|
|
|
{name => 'strName', trace => true},
|
|
|
|
{name => 'strValue', trace => true},
|
|
|
|
{name => 'strType', default => 'param', trace => true}
|
|
|
|
);
|
|
|
|
|
|
|
|
${$self->{oDoc}}{$strType}{$strName} = $strValue;
|
|
|
|
|
|
|
|
# Return from function and log return values if any
|
|
|
|
logDebugReturn($strOperation);
|
|
|
|
}
|
|
|
|
|
|
|
|
####################################################################################################################################
|
|
|
|
# fieldGet
|
|
|
|
#
|
|
|
|
# Get a field from a node.
|
|
|
|
####################################################################################################################################
|
|
|
|
sub fieldGet
|
|
|
|
{
|
|
|
|
my $self = shift;
|
|
|
|
|
|
|
|
return $self->paramGet(shift, shift, 'field');
|
|
|
|
}
|
|
|
|
|
|
|
|
####################################################################################################################################
|
|
|
|
# textGet
|
|
|
|
#
|
|
|
|
# Get a field from a node.
|
|
|
|
####################################################################################################################################
|
|
|
|
sub textGet
|
|
|
|
{
|
|
|
|
my $self = shift;
|
|
|
|
|
|
|
|
return $self->nodeBless($self->paramGet('text', shift, 'field'));
|
|
|
|
}
|
|
|
|
|
|
|
|
####################################################################################################################################
|
|
|
|
# fieldSet
|
|
|
|
#
|
|
|
|
# Set a parameter in a node.
|
|
|
|
####################################################################################################################################
|
|
|
|
sub fieldSet
|
|
|
|
{
|
|
|
|
my $self = shift;
|
|
|
|
|
|
|
|
$self->paramSet(shift, shift, 'field');
|
|
|
|
}
|
|
|
|
|
2015-09-03 00:55:04 +02:00
|
|
|
1;
|