(Matthew Wilson) add AssetAspect/RssFeed. See exportAssetCollateral for a good time.

This commit is contained in:
Matthew Wilson 2009-03-30 21:38:12 +00:00
parent 4e78593395
commit cf63a4e4f3
10 changed files with 762 additions and 108 deletions

View file

@ -10,6 +10,13 @@
sku's view screen for the whole form. [TEMPLATE]
- fixed #9933: Matrix 2.0 - Unable to view/edit product maintainer account
- fixed #9951: Matrix 2.0: Median not calculated correctly
- added new AssetAspect::RssFeed (Matthew Wilson) - to convert an asset to use it (see
Collaboration.pm as an example), inherit from Class::C3 as in Collaboration
and you'll need to remove all your ->SUPER::xxxxx invocations - usually replace it
with ->next::method, but when your SUPER was previously calling a method with
a name different from your current method, you'll need to specify the parent/super
module name explicity (e.g. ->WebGUI::Asset::Wobject::canEdit()). You'll also
need to implement the getRssFeedItems method as explained in AssetAspect/RssFeed.pm
7.7.1
- the AdSku project: create a Sku that allows buyers to purchase advertising in select AdSpaces at selected priorities

View file

@ -33,6 +33,9 @@ my $session = start(); # this line required
# upgrade functions go here
recalculateMatrixListingMedianValue( $session );
addRssFeedAspect($session);
addRssFeedAspectToAssets($session);
removeRssCapableAsset($session);
finish($session); # this line required
@ -68,6 +71,49 @@ category = ?",[$medianValue,$listing->{listingId},$category]);
print "Done.\n" unless $quiet;
}
#----------------------------------------------------------------------------
sub addRssFeedAspect {
my $session = shift;
print "\tAdding RssFeed asset aspect..." unless $quiet;
$session->db->write("create table assetAspectRssFeed (
assetId char(22) binary not null,
revisionDate bigint not null,
itemsPerFeed int(11) default 25,
feedCopyright text,
feedTitle text,
feedDescription mediumtext,
feedImage char(22) binary,
feedImageLink text,
feedImageDescription mediumtext,
primary key (assetId, revisionDate)
)");
print "Done.\n" unless $quiet;
}
#----------------------------------------------------------------------------
sub addRssFeedAspectToAssets {
my $session = shift;
foreach my $asset_class (qw( WikiMaster Collaboration SyndicatedContent Gallery GalleryAlbum )) {
print "\tAdding RssFeed aspect to $asset_class table..." unless $quiet;
my $db = $session->db;
my $pages = $db->read("select assetId,revisionDate from $asset_class");
while (my ($id, $rev) = $pages->array) {
$db->write("insert into assetAspectRssFeed (assetId, revisionDate, itemsPerFeed, feedTitle, feedDescription, feedImage, feedImageLink, feedImageDescription) values (?,?,25,'','',NULL,'','')",[$id,$rev]);
}
print "Done.\n" unless $quiet;
}
}
#----------------------------------------------------------------------------
sub removeRssCapableAsset {
my $session = shift;
print "\tRemoving prior RssCapable asset..." unless $quiet;
$session->db->write("drop table RSSCapable");
$session->db->write("drop table RSSFromParent");
print "Done.\n" unless $quiet;
}
#----------------------------------------------------------------------------
# Describe what our function does
#sub exampleFunction {