#!/usr/bin/perl -w # # Controlling script for all import maps. # use strict; use XAO::Utils; use XAO::Web; use constant SITENAME => '<%PROJECT%>'; if(@ARGV && $ARGV[0] eq '--debug') { XAO::Utils::set_debug(1); shift @ARGV; } if (!@ARGV) { print <new(sitename => SITENAME); $site->set_current(); my $odb=$site->config->odb(); foreach my $name (@ARGV) { dprint "=== Processing $name"; if($name !~ /^\w+$/) { eprint "Bad source name '$name'"; next; } my $catalog=$odb->fetch("/Catalogs/$name"); my $products=$odb->fetch("/Products"); my $categories=$odb->fetch("/Categories"); $catalog->import_catalog(categories => $categories, products => $products); }