JSON collateral rewrite, first part.

API is rewritten and tested.  Upgrade script builds JSON
for all commerce products with unique identifiers.
TBD: Rework Product asset and test it.
This commit is contained in:
Colin Kuskie 2008-05-16 05:08:58 +00:00
parent 5656ee915c
commit 06a38c61c3
3 changed files with 212 additions and 185 deletions

View file

@ -814,9 +814,9 @@ EOSQL1
my $assetSth = $session->db->read('select distinct(assetId) from Product');
my $accessorySth = $session->db->read('select accessoryAssetId from Product_accessory where assetId=? order by sequenceNumber');
my $relatedSth = $session->db->read('select relatedAssetId from Product_related where assetId=? order by sequenceNumber');
my $specificationSth = $session->db->read('select name, value, units from Product_specification where assetId=? order by sequenceNumber');
my $featureSth = $session->db->read('select feature from Product_feature where assetId=? order by sequenceNumber');
my $benefitSth = $session->db->read('select benefit from Product_benefit where assetId=? order by sequenceNumber');
my $specificationSth = $session->db->read('select Product_specificationId as specificationId, name, value, units from Product_specification where assetId=? order by sequenceNumber');
my $featureSth = $session->db->read('select Product_featureId as featureId, feature from Product_feature where assetId=? order by sequenceNumber');
my $benefitSth = $session->db->read('select Product_benefitId as benefitId, benefit from Product_benefit where assetId=? order by sequenceNumber');
while (my ($assetId) = $assetSth->array) {
##For each assetId, get each type of collateral
##Convert the data to JSON and store it in Product with setCollateral (update)