From 5f9f1e6dec084429f6521cc47db9133fbe91afba Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Wed, 7 Dec 2011 08:26:08 -0800 Subject: [PATCH] Remove all unnecessary usage of SUPER from Assets --- lib/WebGUI/Asset/Event.pm | 15 +++++++------ lib/WebGUI/Asset/File.pm | 22 +++++++++---------- lib/WebGUI/Asset/File/GalleryFile/Photo.pm | 6 ++--- lib/WebGUI/Asset/File/ZipArchive.pm | 6 ++--- lib/WebGUI/Asset/MapPoint.pm | 6 ++--- lib/WebGUI/Asset/Post.pm | 6 ++--- lib/WebGUI/Asset/Post/Thread.pm | 18 +++++++-------- lib/WebGUI/Asset/Shortcut.pm | 6 ++--- lib/WebGUI/Asset/Sku.pm | 6 ++--- lib/WebGUI/Asset/Sku/EMSBadge.pm | 12 +++++----- lib/WebGUI/Asset/Sku/EMSTicket.pm | 6 ++--- lib/WebGUI/Asset/Sku/FlatDiscount.pm | 6 ++--- lib/WebGUI/Asset/Sku/Product.pm | 6 ++--- lib/WebGUI/Asset/Sku/Subscription.pm | 6 ++--- lib/WebGUI/Asset/Sku/ThingyRecord.pm | 6 ++--- lib/WebGUI/Asset/Story.pm | 6 ++--- lib/WebGUI/Asset/Template.pm | 2 +- lib/WebGUI/Asset/Wobject/Article.pm | 6 ++--- lib/WebGUI/Asset/Wobject/AssetReport.pm | 7 +++--- lib/WebGUI/Asset/Wobject/Calendar.pm | 6 ++--- lib/WebGUI/Asset/Wobject/Carousel.pm | 6 ++--- lib/WebGUI/Asset/Wobject/DataTable.pm | 6 ++--- .../Asset/Wobject/EventManagementSystem.pm | 6 ++--- lib/WebGUI/Asset/Wobject/Folder.pm | 18 +++++++-------- lib/WebGUI/Asset/Wobject/HttpProxy.pm | 6 ++--- lib/WebGUI/Asset/Wobject/InOutBoard.pm | 7 +++--- lib/WebGUI/Asset/Wobject/Layout.pm | 12 +++++----- lib/WebGUI/Asset/Wobject/Map.pm | 6 ++--- lib/WebGUI/Asset/Wobject/Matrix.pm | 6 ++--- lib/WebGUI/Asset/Wobject/MessageBoard.pm | 6 ++--- lib/WebGUI/Asset/Wobject/MultiSearch.pm | 6 ++--- lib/WebGUI/Asset/Wobject/Navigation.pm | 6 ++--- lib/WebGUI/Asset/Wobject/Poll.pm | 6 ++--- lib/WebGUI/Asset/Wobject/ProjectManager.pm | 6 ++--- lib/WebGUI/Asset/Wobject/SQLReport.pm | 6 ++--- lib/WebGUI/Asset/Wobject/Search.pm | 6 ++--- lib/WebGUI/Asset/Wobject/Shelf.pm | 7 +++--- lib/WebGUI/Asset/Wobject/StockData.pm | 6 ++--- lib/WebGUI/Asset/Wobject/StoryArchive.pm | 7 +++--- lib/WebGUI/Asset/Wobject/StoryTopic.pm | 7 +++--- lib/WebGUI/Asset/Wobject/Survey.pm | 6 ++--- lib/WebGUI/Asset/Wobject/Thingy.pm | 12 +++++----- lib/WebGUI/Asset/Wobject/TimeTracking.pm | 6 ++--- lib/WebGUI/Asset/Wobject/UserList.pm | 6 ++--- lib/WebGUI/Asset/Wobject/WeatherData.pm | 6 ++--- lib/WebGUI/Asset/Wobject/WikiMaster.pm | 8 ++++--- 46 files changed, 175 insertions(+), 171 deletions(-) diff --git a/lib/WebGUI/Asset/Event.pm b/lib/WebGUI/Asset/Event.pm index 7f82f83a0..0d6af74a6 100644 --- a/lib/WebGUI/Asset/Event.pm +++ b/lib/WebGUI/Asset/Event.pm @@ -416,11 +416,12 @@ The session variable. =cut -sub canAdd { +around canAdd => sub { + my $orig = shift; my $class = shift; my $session = shift; - $class->SUPER::canAdd($session, undef, '7'); -} + $class->$orig($session, undef, '7'); +}; #################################################################### @@ -455,9 +456,9 @@ Extend the super class to duplicate the storage location. =cut -sub duplicate { +override duplicate => sub { my $self = shift; - my $newAsset = $self->SUPER::duplicate(@_); + my $newAsset = super(); my $newStorage = $self->getStorageLocation->copy; $newAsset->update({storageId=>$newStorage->getId}); my $links = $self->getRelatedLinks(); @@ -469,7 +470,7 @@ sub duplicate { } $newAsset->setRelatedLinks($links); return $newAsset; -} +}; #------------------------------------------------------------------- @@ -1674,7 +1675,7 @@ override purge => sub { my $id = $self->getId; my $session = $self->session; my @storageIds = $session->db->buildArray("select storageId from Event where assetId=?",[$id]); - my $success = $self->SUPER::purge; + my $success = super(); return 0 unless $success; foreach my $storageId (@storageIds) { my $storage = WebGUI::Storage->get($session, $storageId); diff --git a/lib/WebGUI/Asset/File.pm b/lib/WebGUI/Asset/File.pm index d01621a76..f08f56d4d 100644 --- a/lib/WebGUI/Asset/File.pm +++ b/lib/WebGUI/Asset/File.pm @@ -142,15 +142,15 @@ locations =cut -sub commit { +override commit => sub { my ( $self, @args ) = @_; for my $rev ( grep { $_->get("revisionDate") < $self->get("revisionDate") } @{$self->getRevisions} ) { $rev->getStorageLocation->trash; } - return $self->SUPER::commit( @args ); -} + return super(); +}; #------------------------------------------------------------------- @@ -474,11 +474,11 @@ Override trash restore to restore storage location =cut -sub restore { - my ( $self, @args ) = @_; +override restore => sub { + my ( $self ) = @_; $self->setPrivileges; - return $self->SUPER::restore( @args ); -} + return super(); +}; #---------------------------------------------------------------------------- @@ -573,14 +573,14 @@ Override to put the attached file in the trash too =cut -sub trash { - my ( $self, @args ) = @_; - my $return = $self->SUPER::trash( @args ); +override trash => sub { + my ( $self ) = @_; + my $return = super(); $self->getStorageLocation->trash; return $return; -} +}; #---------------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/File/GalleryFile/Photo.pm b/lib/WebGUI/Asset/File/GalleryFile/Photo.pm index 27d54ab2c..7ceeea433 100644 --- a/lib/WebGUI/Asset/File/GalleryFile/Photo.pm +++ b/lib/WebGUI/Asset/File/GalleryFile/Photo.pm @@ -480,12 +480,12 @@ additonal details. =cut -sub indexContent { +override indexContent => sub { my $self = shift; - my $indexer = $self->SUPER::indexContent; + my $indexer = super(); $indexer->addKeywords($self->get("location")); return $indexer; -} +}; #---------------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/File/ZipArchive.pm b/lib/WebGUI/Asset/File/ZipArchive.pm index dd7a8fad3..bd28aadcf 100644 --- a/lib/WebGUI/Asset/File/ZipArchive.pm +++ b/lib/WebGUI/Asset/File/ZipArchive.pm @@ -147,13 +147,13 @@ See WebGUI::Asset::prepareView() for details. =cut -sub prepareView { +override prepareView => sub { my $self = shift; - $self->SUPER::prepareView(); + super(); my $template = WebGUI::Asset::Template->newById($self->session, $self->get("templateId")); $template->prepare($self->getMetaDataAsTemplateVariables); $self->{_viewTemplate} = $template; -} +}; #------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/MapPoint.pm b/lib/WebGUI/Asset/MapPoint.pm index 3ce1c9f11..b1d15d40d 100644 --- a/lib/WebGUI/Asset/MapPoint.pm +++ b/lib/WebGUI/Asset/MapPoint.pm @@ -350,9 +350,9 @@ Indexing the content of attachments and user defined fields. See WebGUI::Asset:: =cut -sub indexContent { +override indexContent => sub { my $self = shift; - my $indexer = $self->SUPER::indexContent; + my $indexer = super(); $indexer->addKeywords($self->get("website")); $indexer->addKeywords($self->get("address1")); $indexer->addKeywords($self->get("address2")); @@ -369,7 +369,7 @@ sub indexContent { $indexer->addKeywords($self->get("userDefined4")); $indexer->addKeywords($self->get("userDefined5")); return $indexer; -} +}; #------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/Post.pm b/lib/WebGUI/Asset/Post.pm index 2e03f29e2..0de15d6d2 100644 --- a/lib/WebGUI/Asset/Post.pm +++ b/lib/WebGUI/Asset/Post.pm @@ -372,17 +372,17 @@ Extend the base method to handle duplicate storage locations and groups. =cut -sub duplicate { +override duplicate => sub { my $self = shift; my $session = $self->session; - my $copy = $self->SUPER::duplicate(@_); + my $copy = super(@_); if ($self->get('storageId')) { my $storage = $self->getStorageLocation; my $copied_storage = $storage->copy; $copy->update({storageId => $copied_storage->getId}); } return $copy; -} +}; #------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/Post/Thread.pm b/lib/WebGUI/Asset/Post/Thread.pm index c55732309..0e1cdfe6b 100644 --- a/lib/WebGUI/Asset/Post/Thread.pm +++ b/lib/WebGUI/Asset/Post/Thread.pm @@ -253,10 +253,10 @@ Extends the base method to handle creating a new subscription group. =cut -sub duplicate { +override duplicate => sub { my $self = shift; my $session = $self->session; - my $copy = $self->SUPER::duplicate(@_); + my $copy = super(); my $key = 'subscriptionGroupId'; my $oldGroupId = $self->get($key); @@ -270,7 +270,7 @@ sub duplicate { } } return $copy; -} +}; #------------------------------------------------------------------- @@ -414,16 +414,16 @@ Extend the base method from Post to remove the pagination query fragment =cut -sub getThreadLinkUrl { +override getThreadLinkUrl => sub { my $self = shift; - my $url = $self->SUPER::getThreadLinkUrl(); + my $url = super(); $url =~ s/\?pn=\d+//; if ($url =~ m{;revision=\d+}) { $url =~ s/;revision/?revision/; } return $url; -} +}; #------------------------------------------------------------------- @@ -740,13 +740,13 @@ See WebGUI::Asset::prepareView() for details. =cut -sub prepareView { +override prepareView => sub { my $self = shift; - $self->SUPER::prepareView(); + super(); my $template = WebGUI::Asset::Template->newById($self->session, $self->getParent->threadTemplateId); $template->prepare($self->getMetaDataAsTemplateVariables); $self->{_viewTemplate} = $template; -} +}; #------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/Shortcut.pm b/lib/WebGUI/Asset/Shortcut.pm index ff9c9a93f..008af859a 100644 --- a/lib/WebGUI/Asset/Shortcut.pm +++ b/lib/WebGUI/Asset/Shortcut.pm @@ -840,15 +840,15 @@ on the Asset that is shortcutted. =cut -sub prepareView { +override prepareView => sub { my $self = shift; - $self->SUPER::prepareView(); + super(); my $template = WebGUI::Asset::Template->newById($self->session, $self->get("templateId")); $template->prepare($self->getMetaDataAsTemplateVariables); $self->{_viewTemplate} = $template; my $shortcut = $self->getShortcut; $shortcut->prepareView if defined $shortcut; -} +}; #------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/Sku.pm b/lib/WebGUI/Asset/Sku.pm index 50b903550..2225b9299 100644 --- a/lib/WebGUI/Asset/Sku.pm +++ b/lib/WebGUI/Asset/Sku.pm @@ -598,13 +598,13 @@ Extent the base class to clean out any items using this Sku in all Carts. =cut -sub purge { +override purge => sub { my $self = shift; my $assetId = $self->getId; - my $success = $self->SUPER::purge; + my $success = super(); return $success unless $success; $self->session->db->write('delete from cartItem where assetId=?',[$assetId]); -} +}; #------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/Sku/EMSBadge.pm b/lib/WebGUI/Asset/Sku/EMSBadge.pm index 1b897edb4..c4b95d909 100644 --- a/lib/WebGUI/Asset/Sku/EMSBadge.pm +++ b/lib/WebGUI/Asset/Sku/EMSBadge.pm @@ -214,10 +214,10 @@ it is purchased. C is the WebGUI::Shop::TransactionItem for this item =cut -sub getPostPurchaseActions { +override getPostPurchaseActions => sub { my ( $self, $item ) = @_; my $session = $self->session; - my $opts = $self->SUPER::getPostPurchaseActions(); + my $opts = super(); if($self->getParent->isRegistrationStaff) { my $i18n = WebGUI::International->new( $session, "Asset_EventManagementSystem" ); my $badgeId = $item->get('options')->{badgeId}; @@ -225,7 +225,7 @@ sub getPostPurchaseActions { $opts->{ $i18n->get('print') } = $self->getParent->getUrl( "func=printBadge;badgeId=$badgeId" ); } return $opts; -} +}; #------------------------------------------------------------------- @@ -370,13 +370,13 @@ See WebGUI::Asset, prepareView for details. =cut -sub prepareView { +override prepareView => sub { my $self = shift; - $self->SUPER::prepareView(); + super(); my $templateId = $self->templateId; my $template = WebGUI::Asset::Template->newById($self->session, $templateId); $self->{_viewTemplate} = $template; -} +}; #------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/Sku/EMSTicket.pm b/lib/WebGUI/Asset/Sku/EMSTicket.pm index a040a2623..33fb48049 100644 --- a/lib/WebGUI/Asset/Sku/EMSTicket.pm +++ b/lib/WebGUI/Asset/Sku/EMSTicket.pm @@ -429,9 +429,9 @@ Extended to support event meta fields. =cut -sub processEditForm { +override processEditForm => sub { my $self = shift; - $self->SUPER::processEditForm(@_); + super(); my $form = $self->session->form; my %metadata = (); foreach my $field (@{$self->getParent->getEventMetaFields}) { @@ -442,7 +442,7 @@ sub processEditForm { my $startDate = $form->process('startDate', "dateTime", $date, { defaultValue => $date, timeZone => $self->getParent->timezone}); $self->update({eventMetaData => JSON->new->encode(\%metadata), startDate => $startDate}); -} +}; #------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/Sku/FlatDiscount.pm b/lib/WebGUI/Asset/Sku/FlatDiscount.pm index f25926bab..a5a6d3d94 100644 --- a/lib/WebGUI/Asset/Sku/FlatDiscount.pm +++ b/lib/WebGUI/Asset/Sku/FlatDiscount.pm @@ -189,14 +189,14 @@ Prepares the template. =cut -sub prepareView { +override prepareView => sub { my $self = shift; - $self->SUPER::prepareView(); + super(); my $templateId = $self->templateId; my $template = WebGUI::Asset::Template->newById($self->session, $templateId); $template->prepare($self->getMetaDataAsTemplateVariables); $self->{_viewTemplate} = $template; -} +}; #------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/Sku/Product.pm b/lib/WebGUI/Asset/Sku/Product.pm index 532e175a7..f7eebdd90 100644 --- a/lib/WebGUI/Asset/Sku/Product.pm +++ b/lib/WebGUI/Asset/Sku/Product.pm @@ -751,13 +751,13 @@ See WebGUI::Asset::prepareView() for details. =cut -sub prepareView { +override prepareView => sub { my $self = shift; - $self->SUPER::prepareView(); + super(); my $template = WebGUI::Asset::Template->newById($self->session, $self->get("templateId")); $template->prepare($self->getMetaDataAsTemplateVariables); $self->{_viewTemplate} = $template; -} +}; #------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/Sku/Subscription.pm b/lib/WebGUI/Asset/Sku/Subscription.pm index 647665742..205c55050 100644 --- a/lib/WebGUI/Asset/Sku/Subscription.pm +++ b/lib/WebGUI/Asset/Sku/Subscription.pm @@ -485,14 +485,14 @@ Prepares the template. =cut -sub prepareView { +override prepareView => sub { my $self = shift; - $self->SUPER::prepareView(); + super(); my $templateId = $self->templateId; my $template = WebGUI::Asset::Template->newById($self->session, $templateId); $template->prepare($self->getMetaDataAsTemplateVariables); $self->{_viewTemplate} = $template; -} +}; #------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/Sku/ThingyRecord.pm b/lib/WebGUI/Asset/Sku/ThingyRecord.pm index a361a46f5..099e4dcae 100644 --- a/lib/WebGUI/Asset/Sku/ThingyRecord.pm +++ b/lib/WebGUI/Asset/Sku/ThingyRecord.pm @@ -457,13 +457,13 @@ See WebGUI::Asset::prepareView() for details. =cut -sub prepareView { +override prepareView => sub { my $self = shift; - $self->SUPER::prepareView(); + super(); my $template = WebGUI::Asset::Template->newById( $self->session, $self->templateIdView ); $template->prepare( $self->getMetaDataAsTemplateVariables ); $self->{_viewTemplate} = $template; -} +}; #------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/Story.pm b/lib/WebGUI/Asset/Story.pm index fc3e0d605..fe0ef7838 100644 --- a/lib/WebGUI/Asset/Story.pm +++ b/lib/WebGUI/Asset/Story.pm @@ -211,9 +211,9 @@ Overriden to include any topics in which this story would appear. =cut -sub exportGetRelatedAssetIds { +override exportGetRelatedAssetIds => sub { my $self = shift; - my $rel = $self->SUPER::exportGetRelatedAssetIds(@_); + my $rel = super(); push @$rel, @{ WebGUI::Keyword->new($self->session)->getMatchingAssets({ keywords => WebGUI::Keyword::string2list($self->get('keywords')), @@ -221,7 +221,7 @@ sub exportGetRelatedAssetIds { }) }; return $rel; -} +}; #------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/Template.pm b/lib/WebGUI/Asset/Template.pm index f2941e768..8119aa3d5 100644 --- a/lib/WebGUI/Asset/Template.pm +++ b/lib/WebGUI/Asset/Template.pm @@ -326,7 +326,7 @@ Override to add attachments to package data override exportAssetData => sub { my ( $self ) = @_; - my $data = $self->SUPER::exportAssetData; + my $data = super(); if ( $self->get('storageIdExample') ) { push @{$data->{storage}}, $self->get('storageIdExample'); } diff --git a/lib/WebGUI/Asset/Wobject/Article.pm b/lib/WebGUI/Asset/Wobject/Article.pm index 2548c6166..fe8a36bde 100644 --- a/lib/WebGUI/Asset/Wobject/Article.pm +++ b/lib/WebGUI/Asset/Wobject/Article.pm @@ -222,9 +222,9 @@ See WebGUI::Asset::prepareView() for details. =cut -sub prepareView { +override prepareView => sub { my $self = shift; - $self->SUPER::prepareView(); + super(); my $templateId = $self->templateId; if ($self->session->form->process("overrideTemplateId") ne "") { $templateId = $self->session->form->process("overrideTemplateId"); @@ -239,7 +239,7 @@ sub prepareView { } $template->prepare($self->getMetaDataAsTemplateVariables); $self->{_viewTemplate} = $template; -} +}; #------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/Wobject/AssetReport.pm b/lib/WebGUI/Asset/Wobject/AssetReport.pm index dd67b4e9c..10b653a09 100644 --- a/lib/WebGUI/Asset/Wobject/AssetReport.pm +++ b/lib/WebGUI/Asset/Wobject/AssetReport.pm @@ -63,11 +63,12 @@ The session variable. =cut -sub canAdd { +around canAdd => sub { + my $orig = shift; my $class = shift; my $session = shift; - $class->SUPER::canAdd($session, undef, '3'); -} + return $class->$orig($session, undef, '3'); +}; #---------------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/Wobject/Calendar.pm b/lib/WebGUI/Asset/Wobject/Calendar.pm index b4d40eb4d..ae1fca8f0 100644 --- a/lib/WebGUI/Asset/Wobject/Calendar.pm +++ b/lib/WebGUI/Asset/Wobject/Calendar.pm @@ -812,9 +812,9 @@ parameters. =cut -sub prepareView { +override prepareView => sub { my $self = shift; - $self->SUPER::prepareView(); + super(); my $view = ucfirst lc $self->session->form->param("type") || ucfirst $self->defaultView @@ -838,7 +838,7 @@ sub prepareView { $template->prepare($self->getMetaDataAsTemplateVariables); $self->{_viewTemplate} = $template; -} +}; #---------------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/Wobject/Carousel.pm b/lib/WebGUI/Asset/Wobject/Carousel.pm index 61078cf61..558d266f0 100644 --- a/lib/WebGUI/Asset/Wobject/Carousel.pm +++ b/lib/WebGUI/Asset/Wobject/Carousel.pm @@ -179,9 +179,9 @@ See WebGUI::Asset::prepareView() for details. =cut -sub prepareView { +override prepareView => sub { my $self = shift; - $self->SUPER::prepareView(); + super(); my $template = WebGUI::Asset::Template->newById($self->session, $self->templateId); if (!$template) { WebGUI::Error::ObjectNotFound::Template->throw( @@ -192,7 +192,7 @@ sub prepareView { } $template->prepare; $self->{_viewTemplate} = $template; -} +}; #------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/Wobject/DataTable.pm b/lib/WebGUI/Asset/Wobject/DataTable.pm index 17d841efc..9715552cc 100644 --- a/lib/WebGUI/Asset/Wobject/DataTable.pm +++ b/lib/WebGUI/Asset/Wobject/DataTable.pm @@ -168,9 +168,9 @@ Prepare the view. Add stuff to HEAD. =cut -sub prepareView { +override prepareView => sub { my $self = shift; - $self->SUPER::prepareView(@_); + super(); my $session = $self->session; # For now, prepare the form control. @@ -199,7 +199,7 @@ sub prepareView { $self->{_template} = $template; return; -} ## end sub prepareView +}; ## end sub prepareView #---------------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/Wobject/EventManagementSystem.pm b/lib/WebGUI/Asset/Wobject/EventManagementSystem.pm index a1a7adbf9..baa64a2a2 100644 --- a/lib/WebGUI/Asset/Wobject/EventManagementSystem.pm +++ b/lib/WebGUI/Asset/Wobject/EventManagementSystem.pm @@ -677,9 +677,9 @@ See WebGUI::Asset::prepareView() for details. =cut -sub prepareView { +override prepareView => sub { my $self = shift; - $self->SUPER::prepareView(); + super(); my $template = WebGUI::Asset::Template->newById($self->session, $self->templateId); if (!$template) { WebGUI::Error::ObjectNotFound::Template->throw( @@ -690,7 +690,7 @@ sub prepareView { } $template->prepare($self->getMetaDataAsTemplateVariables); $self->{_viewTemplate} = $template; -} +}; #------------------------------------------------------------------ diff --git a/lib/WebGUI/Asset/Wobject/Folder.pm b/lib/WebGUI/Asset/Wobject/Folder.pm index 1403a635d..3dc7bcb39 100644 --- a/lib/WebGUI/Asset/Wobject/Folder.pm +++ b/lib/WebGUI/Asset/Wobject/Folder.pm @@ -127,9 +127,9 @@ Overridden to check the updated dates of children as well =cut -sub getContentLastModifiedBy { +override getContentLastModifiedBy => sub { my $self = shift; - my $mtime = $self->SUPER::getContentLastModified; + my $mtime = super(); my $userId = $self->get('revisedBy'); my $childIter = $self->getLineageIterator(["children"]); while ( 1 ) { @@ -147,7 +147,7 @@ sub getContentLastModifiedBy { } } return $userId; -} +}; #------------------------------------------------------------------- @@ -157,9 +157,9 @@ Returns the TabForm object that will be used in generating the edit page for thi =cut -sub getEditForm { +override getEditForm => sub { my $self = shift; - my $tabform = $self->SUPER::getEditForm(); + my $tabform = super(); my $i18n = WebGUI::International->new($self->session,"Asset_Folder"); if ($self->get("assetId") eq "new") { $tabform->getTab("properties")->whatNext( @@ -171,7 +171,7 @@ sub getEditForm { ); } return $tabform; -} +}; #---------------------------------------------------------------------------- @@ -202,9 +202,9 @@ See WebGUI::Asset::prepareView() for details. =cut -sub prepareView { +override prepareView => sub { my $self = shift; - $self->SUPER::prepareView(); + super(); my $template = WebGUI::Asset::Template->newById($self->session, $self->templateId); if (!$template) { WebGUI::Error::ObjectNotFound::Template->throw( @@ -215,7 +215,7 @@ sub prepareView { } $template->prepare($self->getMetaDataAsTemplateVariables); $self->{_viewTemplate} = $template; -} +}; #------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/Wobject/HttpProxy.pm b/lib/WebGUI/Asset/Wobject/HttpProxy.pm index 591474d83..f04229a83 100644 --- a/lib/WebGUI/Asset/Wobject/HttpProxy.pm +++ b/lib/WebGUI/Asset/Wobject/HttpProxy.pm @@ -226,9 +226,9 @@ See WebGUI::Asset::prepareView() for details. =cut -sub prepareView { +override prepareView => sub { my $self = shift; - $self->SUPER::prepareView(); + super(); my $template = WebGUI::Asset::Template->newById($self->session, $self->templateId); if (!$template) { WebGUI::Error::ObjectNotFound::Template->throw( @@ -239,7 +239,7 @@ sub prepareView { } $template->prepare($self->getMetaDataAsTemplateVariables); $self->{_viewTemplate} = $template; -} +}; #------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/Wobject/InOutBoard.pm b/lib/WebGUI/Asset/Wobject/InOutBoard.pm index 7a22d20a1..bf6c2f9a2 100644 --- a/lib/WebGUI/Asset/Wobject/InOutBoard.pm +++ b/lib/WebGUI/Asset/Wobject/InOutBoard.pm @@ -132,9 +132,9 @@ See WebGUI::Asset::prepareView() for details. =cut -sub prepareView { +override prepareView => sub { my $self = shift; - $self->SUPER::prepareView(); + super(); my $template = WebGUI::Asset::Template->newById($self->session, $self->inOutTemplateId); if (!$template) { WebGUI::Error::ObjectNotFound::Template->throw( @@ -145,7 +145,7 @@ sub prepareView { } $template->prepare($self->getMetaDataAsTemplateVariables); $self->{_viewTemplate} = $template; -} +}; #------------------------------------------------------------------- @@ -535,7 +535,6 @@ where users.userId<>'1' and $departmentSQLclause group by InOutBoard_statusLog.dateStamp order by department, lastName, firstName, InOutBoard_statusLog.dateStamp"; - $self->session->log->warn("QUERY: $sql\n"); $p->setDataByQuery($sql); my $rowdata = $p->getPageData(); my @rows; diff --git a/lib/WebGUI/Asset/Wobject/Layout.pm b/lib/WebGUI/Asset/Wobject/Layout.pm index 082e2bb66..734cc8c4a 100644 --- a/lib/WebGUI/Asset/Wobject/Layout.pm +++ b/lib/WebGUI/Asset/Wobject/Layout.pm @@ -137,9 +137,9 @@ and to put children in their places. =cut -sub prepareView { +override prepareView => sub { my $self = shift; - $self->SUPER::prepareView; + super(); my $session = $self->session; my $templateId; @@ -263,7 +263,7 @@ sub prepareView { $self->{_viewVars} = \%vars; $self->{_viewPlaceholder} = \%placeHolder; -} +}; #------------------------------------------------------------------- @@ -369,9 +369,9 @@ Extend the base class to include the userid of the person that made last modific =cut -sub getContentLastModifiedBy { +override getContentLastModifiedBy => sub { my $self = shift; - my $mtime = $self->SUPER::getContentLastModified; + my $mtime = super(); my $userId = $self->get('revisedBy'); my $childIter = $self->getLineageIterator(["children"],{excludeClasses=>['WebGUI::Asset::Wobject::Layout']}); while ( 1 ) { @@ -389,7 +389,7 @@ sub getContentLastModifiedBy { } } return $userId; -} +}; #------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/Wobject/Map.pm b/lib/WebGUI/Asset/Wobject/Map.pm index 47e171db1..d891dea9a 100644 --- a/lib/WebGUI/Asset/Wobject/Map.pm +++ b/lib/WebGUI/Asset/Wobject/Map.pm @@ -325,9 +325,9 @@ See WebGUI::Asset::prepareView() for details. =cut -sub prepareView { +override prepareView => sub { my $self = shift; - $self->SUPER::prepareView(); + super(); my $template = WebGUI::Asset::Template->newById( $self->session, $self->templateIdView ); if (!$template) { WebGUI::Error::ObjectNotFound::Template->throw( @@ -338,7 +338,7 @@ sub prepareView { } $template->prepare; $self->{_viewTemplate} = $template; -} +}; #------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/Wobject/Matrix.pm b/lib/WebGUI/Asset/Wobject/Matrix.pm index 55a696881..411b36711 100644 --- a/lib/WebGUI/Asset/Wobject/Matrix.pm +++ b/lib/WebGUI/Asset/Wobject/Matrix.pm @@ -537,10 +537,10 @@ See WebGUI::Asset::prepareView() for details. =cut -sub prepareView { +override prepareView => sub { my $self = shift; - $self->SUPER::prepareView(); + super(); my $template = WebGUI::Asset::Template->newById($self->session, $self->templateId); if (!$template) { WebGUI::Error::ObjectNotFound::Template->throw( @@ -553,7 +553,7 @@ sub prepareView { $self->{_viewTemplate} = $template; return undef; -} +}; #------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/Wobject/MessageBoard.pm b/lib/WebGUI/Asset/Wobject/MessageBoard.pm index ddb9861cb..8f73e243b 100644 --- a/lib/WebGUI/Asset/Wobject/MessageBoard.pm +++ b/lib/WebGUI/Asset/Wobject/MessageBoard.pm @@ -47,9 +47,9 @@ See WebGUI::Asset::prepareView() for details. =cut -sub prepareView { +override prepareView => sub { my $self = shift; - $self->SUPER::prepareView(); + super(); my $template = eval{ WebGUI::Asset::Template->newById($self->session, $self->templateId) }; if ($@ or !$template) { WebGUI::Error::ObjectNotFound::Template->throw( @@ -60,7 +60,7 @@ sub prepareView { } $template->prepare($self->getMetaDataAsTemplateVariables); $self->{_viewTemplate} = $template; -} +}; #------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/Wobject/MultiSearch.pm b/lib/WebGUI/Asset/Wobject/MultiSearch.pm index 807cc855f..5cae6877e 100644 --- a/lib/WebGUI/Asset/Wobject/MultiSearch.pm +++ b/lib/WebGUI/Asset/Wobject/MultiSearch.pm @@ -56,9 +56,9 @@ See WebGUI::Asset::prepareView() for details. =cut -sub prepareView { +override prepareView => sub { my $self = shift; - $self->SUPER::prepareView(); + super(); my $template = WebGUI::Asset::Template->newById($self->session, $self->templateId); if (!$template) { WebGUI::Error::ObjectNotFound::Template->throw( @@ -69,7 +69,7 @@ sub prepareView { } $template->prepare($self->getMetaDataAsTemplateVariables); $self->{_viewTemplate} = $template; -} +}; #------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/Wobject/Navigation.pm b/lib/WebGUI/Asset/Wobject/Navigation.pm index 6842fec59..27a483942 100644 --- a/lib/WebGUI/Asset/Wobject/Navigation.pm +++ b/lib/WebGUI/Asset/Wobject/Navigation.pm @@ -301,9 +301,9 @@ Extend the superclass to add metadata and to preprocess the template. =cut -sub prepareView { +override prepareView => sub { my $self = shift; - $self->SUPER::prepareView(); + super(); my $template = WebGUI::Asset::Template->newById($self->session, $self->templateId); # part of Couldn't lookup className (param: PBtmpl0000000000000048) if (!$template) { WebGUI::Error::ObjectNotFound::Template->throw( @@ -314,7 +314,7 @@ sub prepareView { } $template->prepare($self->getMetaDataAsTemplateVariables); $self->{_viewTemplate} = $template; -} +}; #------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/Wobject/Poll.pm b/lib/WebGUI/Asset/Wobject/Poll.pm index 2bd6cac10..b144e86a5 100644 --- a/lib/WebGUI/Asset/Wobject/Poll.pm +++ b/lib/WebGUI/Asset/Wobject/Poll.pm @@ -336,9 +336,9 @@ See WebGUI::Asset::prepareView() for details. =cut -sub prepareView { +override prepareView => sub { my $self = shift; - $self->SUPER::prepareView(); + super(); my $template = WebGUI::Asset::Template->newById($self->session, $self->get("templateId")); if (!$template) { WebGUI::Error::ObjectNotFound::Template->throw( @@ -349,7 +349,7 @@ sub prepareView { } $template->prepare($self->getMetaDataAsTemplateVariables); $self->{_viewTemplate} = $template; -} +}; #------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/Wobject/ProjectManager.pm b/lib/WebGUI/Asset/Wobject/ProjectManager.pm index 3cf72d5b7..b251f424c 100644 --- a/lib/WebGUI/Asset/Wobject/ProjectManager.pm +++ b/lib/WebGUI/Asset/Wobject/ProjectManager.pm @@ -588,9 +588,9 @@ sub i18n { =cut -sub prepareView { +override prepareView => sub { my $self = shift; - $self->SUPER::prepareView(); + super(); my $template = WebGUI::Asset::Template->newById($self->session, $self->projectDashboardTemplateId); if (!$template) { WebGUI::Error::ObjectNotFound::Template->throw( @@ -601,7 +601,7 @@ sub prepareView { } $template->prepare($self->getMetaDataAsTemplateVariables); $self->{_viewTemplate} = $template; -} +}; #------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/Wobject/SQLReport.pm b/lib/WebGUI/Asset/Wobject/SQLReport.pm index a7783a958..5b061ff76 100644 --- a/lib/WebGUI/Asset/Wobject/SQLReport.pm +++ b/lib/WebGUI/Asset/Wobject/SQLReport.pm @@ -392,9 +392,9 @@ See WebGUI::Asset::prepareView() for details. =cut -sub prepareView { +override prepareView => sub { my $self = shift; - $self->SUPER::prepareView(); + super(); my $template = WebGUI::Asset::Template->newById($self->session, $self->templateId); if (!$template) { WebGUI::Error::ObjectNotFound::Template->throw( @@ -405,7 +405,7 @@ sub prepareView { } $template->prepare($self->getMetaDataAsTemplateVariables); $self->{_viewTemplate} = $template; -} +}; #------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/Wobject/Search.pm b/lib/WebGUI/Asset/Wobject/Search.pm index e89e2275e..04d72b4cc 100644 --- a/lib/WebGUI/Asset/Wobject/Search.pm +++ b/lib/WebGUI/Asset/Wobject/Search.pm @@ -96,9 +96,9 @@ See WebGUI::Asset::prepareView() for details. =cut -sub prepareView { +override prepareView => sub { my $self = shift; - $self->SUPER::prepareView(); + super(); my $template = WebGUI::Asset::Template->newById($self->session, $self->templateId); if (!$template) { WebGUI::Error::ObjectNotFound::Template->throw( @@ -109,7 +109,7 @@ sub prepareView { } $template->prepare($self->getMetaDataAsTemplateVariables); $self->{_viewTemplate} = $template; -} +}; #------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/Wobject/Shelf.pm b/lib/WebGUI/Asset/Wobject/Shelf.pm index 80ef1c792..80cbcc1b2 100644 --- a/lib/WebGUI/Asset/Wobject/Shelf.pm +++ b/lib/WebGUI/Asset/Wobject/Shelf.pm @@ -66,10 +66,9 @@ See WebGUI::Asset::prepareView() for details. =cut -sub prepareView { +override prepareView => sub { my $self = shift; - $self->SUPER::prepareView(); -warn "Shelf: going to do prepareView on template with id: " . $self->templateId . " and we are: " . $self->getId; + super(); my $template = WebGUI::Asset::Template->newById($self->session, $self->templateId); # boom XXX if (!$template) { WebGUI::Error::ObjectNotFound::Template->throw( @@ -80,7 +79,7 @@ warn "Shelf: going to do prepareView on template with id: " . $self->templateId } $template->prepare($self->getMetaDataAsTemplateVariables); $self->{_viewTemplate} = $template; -} +}; #------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/Wobject/StockData.pm b/lib/WebGUI/Asset/Wobject/StockData.pm index ab6a7d36b..e1e0d5cb9 100644 --- a/lib/WebGUI/Asset/Wobject/StockData.pm +++ b/lib/WebGUI/Asset/Wobject/StockData.pm @@ -324,9 +324,9 @@ See WebGUI::Asset::prepareView() for details. =cut -sub prepareView { +override prepareView => sub { my $self = shift; - $self->SUPER::prepareView(); + super(); my $template = WebGUI::Asset::Template->newById($self->session, $self->templateId); if (!$template) { WebGUI::Error::ObjectNotFound::Template->throw( @@ -337,7 +337,7 @@ sub prepareView { } $template->prepare($self->getMetaDataAsTemplateVariables); $self->{_viewTemplate} = $template; -} +}; #------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/Wobject/StoryArchive.pm b/lib/WebGUI/Asset/Wobject/StoryArchive.pm index 148ab91ca..ba4c53e1d 100644 --- a/lib/WebGUI/Asset/Wobject/StoryArchive.pm +++ b/lib/WebGUI/Asset/Wobject/StoryArchive.pm @@ -443,9 +443,10 @@ See WebGUI::Asset::prepareView() for details. =cut -sub prepareView { +around prepareView => sub { + my $orig = shift; my $self = shift; - $self->SUPER::prepareView(); + $self->$orig(@_); my $template = WebGUI::Asset::Template->newById($self->session, $self->templateId); if (!$template) { WebGUI::Error::ObjectNotFound::Template->throw( @@ -456,7 +457,7 @@ sub prepareView { } $template->prepare; $self->{_viewTemplate} = $template; -} +}; #------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/Wobject/StoryTopic.pm b/lib/WebGUI/Asset/Wobject/StoryTopic.pm index 8b6331d7b..5578baa83 100644 --- a/lib/WebGUI/Asset/Wobject/StoryTopic.pm +++ b/lib/WebGUI/Asset/Wobject/StoryTopic.pm @@ -110,9 +110,10 @@ See WebGUI::Asset::prepareView() for details. =cut -sub prepareView { +around prepareView => sub { + my $orig = shift; my $self = shift; - $self->SUPER::prepareView(); + $self->$orig(@_); my $template = WebGUI::Asset::Template->newById($self->session, $self->templateId); if (!$template) { WebGUI::Error::ObjectNotFound::Template->throw( @@ -123,7 +124,7 @@ sub prepareView { } $template->prepare; $self->{_viewTemplate} = $template; -} +}; #------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/Wobject/Survey.pm b/lib/WebGUI/Asset/Wobject/Survey.pm index b02c7c09f..45874f905 100644 --- a/lib/WebGUI/Asset/Wobject/Survey.pm +++ b/lib/WebGUI/Asset/Wobject/Survey.pm @@ -1320,9 +1320,9 @@ See WebGUI::Asset::prepareView() for details. =cut -sub prepareView { +override prepareView => sub { my $self = shift; - $self->SUPER::prepareView(); + super(); my $templateId = $self->templateId; if ( $self->session->form->process('overrideTemplateId') ne q{} ) { $templateId = $self->session->form->process('overrideTemplateId'); @@ -1338,7 +1338,7 @@ sub prepareView { $template->prepare; $self->{_viewTemplate} = $template; return; -} +}; #------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/Wobject/Thingy.pm b/lib/WebGUI/Asset/Wobject/Thingy.pm index faccbb9ff..01a67129e 100644 --- a/lib/WebGUI/Asset/Wobject/Thingy.pm +++ b/lib/WebGUI/Asset/Wobject/Thingy.pm @@ -1578,12 +1578,12 @@ been inserted into the AssetIndex. =cut -sub indexContent { +override indexContent => sub { my ($self) = @_; my $session = $self->session; - $self->SUPER::indexContent(); + super(); $self->reindexThings; -} +}; #------------------------------------------------------------------- @@ -1696,9 +1696,9 @@ See WebGUI::Asset::prepareView() for details. =cut -sub prepareView { +override prepareView => sub { my $self = shift; - $self->SUPER::prepareView(); + super(); my $template = WebGUI::Asset::Template->newById($self->session, $self->templateId); if (!$template) { WebGUI::Error::ObjectNotFound::Template->throw( @@ -1710,7 +1710,7 @@ sub prepareView { $template->prepare($self->getMetaDataAsTemplateVariables); $self->{_viewTemplate} = $template; return undef; -} +}; #------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/Wobject/TimeTracking.pm b/lib/WebGUI/Asset/Wobject/TimeTracking.pm index 9f606f7f9..37113c986 100644 --- a/lib/WebGUI/Asset/Wobject/TimeTracking.pm +++ b/lib/WebGUI/Asset/Wobject/TimeTracking.pm @@ -73,9 +73,9 @@ use WebGUI::Asset::Wobject::ProjectManager; =cut -sub prepareView { +override prepareView => sub { my $self = shift; - $self->SUPER::prepareView(); + super(); my $template; $template = WebGUI::Asset::Template->newById($self->session, $self->userViewTemplateId); if (!$template) { @@ -87,7 +87,7 @@ sub prepareView { } $template->prepare($self->getMetaDataAsTemplateVariables); $self->{_viewTemplate} = $template; -} +}; #------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/Wobject/UserList.pm b/lib/WebGUI/Asset/Wobject/UserList.pm index 095a5f674..591caedeb 100644 --- a/lib/WebGUI/Asset/Wobject/UserList.pm +++ b/lib/WebGUI/Asset/Wobject/UserList.pm @@ -318,9 +318,9 @@ See WebGUI::Asset::prepareView() for details. =cut -sub prepareView { +override prepareView => sub { my $self = shift; - $self->SUPER::prepareView(); + super(); my $templateId = $self->templateId; if ($self->session->form->process("overrideTemplateId") ne "") { $templateId = $self->session->form->process("overrideTemplateId"); @@ -337,7 +337,7 @@ sub prepareView { $self->{_viewTemplate} = $template; return undef; -} +}; #------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/Wobject/WeatherData.pm b/lib/WebGUI/Asset/Wobject/WeatherData.pm index ba36c9943..84709a8f3 100644 --- a/lib/WebGUI/Asset/Wobject/WeatherData.pm +++ b/lib/WebGUI/Asset/Wobject/WeatherData.pm @@ -69,9 +69,9 @@ See WebGUI::Asset::prepareView() for details. =cut -sub prepareView { +override prepareView => sub { my $self = shift; - $self->SUPER::prepareView(); + super(); my $template = WebGUI::Asset::Template->newById($self->session, $self->templateId); if (!$template) { WebGUI::Error::ObjectNotFound::Template->throw( @@ -82,7 +82,7 @@ sub prepareView { } $template->prepare($self->getMetaDataAsTemplateVariables); $self->{_viewTemplate} = $template; -} +}; #------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/Wobject/WikiMaster.pm b/lib/WebGUI/Asset/Wobject/WikiMaster.pm index d62fcdaed..7c2a77448 100644 --- a/lib/WebGUI/Asset/Wobject/WikiMaster.pm +++ b/lib/WebGUI/Asset/Wobject/WikiMaster.pm @@ -773,11 +773,13 @@ Extend the master method to delete all keyword entries. =cut -sub purge { +##Using around due to the plugin +around purge => sub { + my $orig = shift; my $self = shift; $self->session->db->write('delete from WikiMasterKeywords where assetId=?',[$self->getId]); - return $self->SUPER::purge; -} + return $self->$orig(@_); +}; #-------------------------------------------------------------------