NAME
XAO::DO::Data::Catalog - object that holds non-translated vendor catalogs
SYNOPSIS
my $catalog=$odb->fetch('/Catalogs/3m');
$catalog->import_catalog(categories => $odb->fetch('/Categories'),
products => $odb->fetch('/Products'));
DESCRIPTION
Data::Catalog is a Hash that has the following properties:
- CategoryMap
-
Contains a list of Data::CatalogCategoryMap objects describing how to translate internal categories of the catalog into global categories table for the site.
See XAO::DO::Data::CatalogCategoryMap for more details.
- Data
-
List of Data::CatatalogData objects containing small pieces of original catalog representing either one product or one category.
See XAO::DO::Data::CatalogData for more details.
- export_map
-
Name of export map class that can map from internal products and categories structure to the specific format of the catalog.
See XAO::DO::ExportMap::Base for more details.
- import_map
-
Name of import map class that can map from the specific structure of the catalog (Data::CatalogData objects) to the site products and categories.
See XAO::DO::ImportMap::Base for more details.
- source_seq
-
Each time the catalog is imported into the database this source_seq is incremented and goes into all the imported products. It is possible to know then what products were not imported and remove or de-activate these products in the database.
In addition to being normal Hash data object in OS sense Data::Catalog provides the following methods:
- import_catalog (%)
-
Takes two arguments -- reference to the categories container and reference to the products container and translates entire content of the catalog storing results there.
Example:
my $catalog=$odb->fetch('/Catalogs/3M'); my $products=$odb->fetch('/Products'); my $categories=$odb->fetch('/Categories'); $catalog->import_catalog(categories => $categories, products => $products);
- import_map ()
-
Returns ImportMap object for that catalog. Object name is stored in `import_map' property.
AUTHORS
Copyright (c) 2005 Andrew Maltsev
Copyright (c) 2001-2004 Andrew Maltsev, XAO Inc.
<am@ejelta.com> -- http://ejelta.com/xao/