[ic] ActionMap example (Was: Re: Bypassing the whole [more] system)

Grant interchange-users@icdevgroup.org
Mon Sep 30 15:43:03 2002


>Maybe this example will help you to learn more about ActionMap: 
>
>ActionMap Catalog <<EOR
>sub {
>	my ($action, $class, $what, $spec) = split ('/', shift);
>	
>	$CGI->{mv_like_field} = 'category';		 
>
>	$class = 'CDROM' if $class eq 'DVD'; 
>
>	if ($class eq 'CDROM' || $class eq 'Video') {
>		if ($what eq 'Producer') {
>			$CGI->{mv_like_field} = 'producer';		
>		} elsif ($what eq 'Star') {
>			$CGI->{mv_like_field} = 'category3';
>		}
>	} else {
>		# other categories have only one level of qualification	
>		$spec = $what;
>		$CGI->{mv_like_field} = 'category';
>		$class = 'Novelty' if $class eq 'Novelties';
>	} 
>
>	$CGI->{mv_todo} = 'search';
>	$CGI->{mv_nextpage} = $Config->{Special}->{search};
>	$CGI->{mv_profile} = 'catalog';
>	$CGI->{mv_coordinate} = 1;
>	$CGI->{mv_search_field} = 'class';
>	$CGI->{mv_searchspec} = "$class"; 
>
>	$CGI->{mv_like_spec} = "%$spec";
>	$CGI->{mv_column_op} = "eq";
>	$CGI->{banner_title} = $spec;
>	
>	if ($Variable->{SCOPE}) {
>		$CGI->{mv_search_group} = join("\0",0,1,1);
>		$CGI->{mv_orsearch} = join("\0",0,1,1);
>		$CGI->{mv_search_field} .= "\0scope\0scope";
>		$CGI->{mv_searchspec} .= "\0" . $Variable->{SCOPE} 
>. "\0" . '3';
>	} 
>
>	$Tag->update('process');
>	return 1;
>}
>EOR 
>
>ActionMap is a really cute feature of Interchange. 
>
>Ciao
>      Racke 

Thanks a lot Racke!  I'll see what I can do with ActionMap.

- Grant