XML::BMEcat - Perl extension for generating BMEcat-XML
use XML::BMEcat;
my $BMEcat = XML::BMEcat->new();
$BMEcat->setOutfile("catalog.xml");
XML::BMEcat is a simple module to help in the generation of BMEcat-XML.
Basically, you create an XML::BMEcat object and then call the related
methods with the necessary parameters.
The following methods are provided:
Writes the BMEcat - Feature-System:
- * setConfigInfo
-
$Header->setConfigInfo('FEATURE_SYSTEM_NAME' => $FEATURE_SYSTEM_NAME);
- * creatFeatureSystem
-
my $FeatureSystem = $BMEcat->creatFeatureSystem();
- * addFeatureGroup
-
$FeatureSystem->addFeatureGroup( 'ftg1',
'ft1' => $unit_a,
'ft2' => $unit_b,
'ft3' => $unit_c,
);
$FeatureSystem->addFeatureGroup( 'ftg2',
'ft4' => $unit_d,
'ft5' => $unit_e,
'ft6' => $unit_f,
);
- * writeFeatureSystem
-
$BMEcat->writeFeatureSystem();
Writes the BMEcat - Catalog-Structure:
- * setConfigInfo
-
$Header->setConfigInfo('GROUP_SYSTEM_ID' => $GROUP_SYSTEM_ID);
- * creatGroupSystem
-
my $GroupSystem = $BMEcat->creatGroupSystem();
- * creatCatalogGroup
-
my $CatalogGroup = $GroupSystem->creatCatalogGroup($group_id);
- * getCatalogGroup
-
my $CatalogGroup = $GroupSystem->getCatalogGroup($group_id);
- * setData
-
$CatalogGroup->setData( 'PARENT' => 0,
'NAME' => $name02,
'SORT' => 5 );
$CatalogGroup = $GroupSystem->creatCatalogGroup('04');
$CatalogGroup->setData( 'PARENT' => 2,
'NAME' => $name04,
'SORT' => 5 );
$CatalogGroup = $GroupSystem->creatCatalogGroup('06');
$CatalogGroup->setData( 'PARENT' => 2,
'NAME' => $name06,
'SORT' => 10 );
$CatalogGroup = $GroupSystem->creatCatalogGroup('08');
$CatalogGroup->setData( 'PARENT' => 4,
'NAME' => $name08,
'SORT' => 5,
'LEAF' => 1 );
- * getData
-
$CatalogGroup->getData('PARENT');
- * addDescription
-
$CatalogGroup->addDescription($Description08);
- * addMime
-
$CatalogGroup->addMime($type, $source, $description, $purpose);
$CatalogGroup = $GroupSystem->creatCatalogGroup('10');
$CatalogGroup->setData( 'PARENT' => 4,
'NAME' => $name10,
'SORT' => 10,
'LEAF' => 1 );
- * addMember
-
$CatalogGroup->addMember('foo');
- * getMembers
-
my @members = $CatalogGroup->getMembers;
- * writeGroupSystem
-
$BMEcat->writeGroupSystem() and print "not ";
Writes the BMEcat - Article-Entrys:
All in the BMEcat-spezification described elements are allowed to set in free order
and at several times.
$Article->setOrderDetails(
'ORDER_UNIT' => $ORDER_UNIT,
'CONTENT_UNIT' => $CONTENT_UNIT,
'NO_CU_PER_OU' => $NO_CU_PER_OU
. . .
);
Several prices and types are possible. See the BMEcat-Spezification for more details.
- * setPriceDetails
-
$Article->setPriceDetails(
'valid_start_date' => $start_date,
'valid_end_date' => $end_date
);
- * addPrice
-
$Article->addPrice(
'price_type' => $price_type,
'PRICE_AMOUNT' => $price_amount,
'PRICE_CURRENCY' => $currency,
'TAX' => $tax
);
Maps Articles to the BMEcat - Catalog-Structure:
- * map2Group
-
$Article->map2Group($group_id);
- * writeArticleGroupMap
-
$BMEcat->writeArticleGroupMap();
At this time not usable:
- FEATURE_GROUP_NAME
- DAILY_PRICE
Not all BMEcat-features (eg. CLASSIFICATION_SYSTEM) have been implemented yet.
See method-descriptions for detailed informations.
I'd like to thank Larry Wall, Randolph Schwarz, Tom Christiansen,
Gurusamy Sarathy and many others for making Perl what it is today.
I had the privilege of working with a really excellent teacher,
Robert Krüger. He have guided me through the entire process and his
criticisms where always right on.
Copyright 2000-2003 by Frank-Peter Reich (fp$), fpreich@cpan.org
This library is free software; you can redistribute it and/or modify it under
the same terms as Perl itself.
BMEcat is a trademark of BME - Bundesverband Materialwirtschaft, Einkauf und Logistik e.V.