Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
94 lines (77 sloc) 2.04 KB
__NAME__ purpose
generic subroutine mapper
__NAME__ see also
Fix the entry, then insert the missing _ at the beginning of line
_NAME__ synopsis
<group choice='req'>
<arg choice='plain'>
__NAME__ missing
replace plain words with entities in description
more description
__NAME__ description
A generic &PERL; subroutine mapper which allows mapping of subroutines to
CoreTags, &conf-UserTag;s,
and Widgets.
SearchOp definition needs to be a function that creates and returns a
search function. The search function will receive the data to match
and should return <literal>1</literal> if the value matches.
__NAME__ example: Defining a subroutine
__NAME__ example: Defining a custom SearchOp
Here's an exemplary "<literal>find_hammer</literal>" SearchOp that
should be placed in &gcf;:
CodeDef find_hammer SearchOp find_hammer
CodeDef find_hammer Routine <<EOR
sub {
# Called with:
# $self - search object
# $i - index into coordinated search array
# $string - data to match
# $opname - name of the specified mv_column_op
my($self, $i, $string, $opname);
#::logDebug("Calling fake SearchOp");
return sub {
#::logDebug("testing with fake SearchOp");
my $string = shift;
$string =~ /hammer/i;
The above simple function does not honor <mv>mv_negate</mv> or other
variables. See <function>Vend::Search::create_text_query</function>
for an example of how to create a proper search routine and honor
various associated search parameters.
__NAME__ example: Widgets with multiple selections
CodeDef checkbox Multiple 1
__NAME__ notes
__NAME__ missing