Remove all unnecessary usage of SUPER from Assets

This commit is contained in:
Colin Kuskie 2011-12-07 08:26:08 -08:00
parent c2baef0bde
commit 5f9f1e6dec
46 changed files with 175 additions and 171 deletions

View file

@ -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);

View file

@ -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;
}
};
#----------------------------------------------------------------------------

View file

@ -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;
}
};
#----------------------------------------------------------------------------

View file

@ -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;
}
};
#-------------------------------------------------------------------

View file

@ -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;
}
};
#-------------------------------------------------------------------

View file

@ -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;
}
};
#-------------------------------------------------------------------

View file

@ -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;
}
};
#-------------------------------------------------------------------

View file

@ -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;
}
};
#-------------------------------------------------------------------

View file

@ -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]);
}
};
#-------------------------------------------------------------------

View file

@ -214,10 +214,10 @@ it is purchased. C<item> 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;
}
};
#-------------------------------------------------------------------

View file

@ -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});
}
};
#-------------------------------------------------------------------

View file

@ -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;
}
};
#-------------------------------------------------------------------

View file

@ -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;
}
};
#-------------------------------------------------------------------

View file

@ -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;
}
};
#-------------------------------------------------------------------

View file

@ -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;
}
};
#-------------------------------------------------------------------

View file

@ -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;
}
};
#-------------------------------------------------------------------

View file

@ -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');
}

View file

@ -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;
}
};
#-------------------------------------------------------------------

View file

@ -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');
};
#----------------------------------------------------------------------------

View file

@ -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;
}
};
#----------------------------------------------------------------------------

View file

@ -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;
}
};
#-------------------------------------------------------------------

View file

@ -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
#----------------------------------------------------------------------------

View file

@ -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;
}
};
#------------------------------------------------------------------

View file

@ -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;
}
};
#-------------------------------------------------------------------

View file

@ -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;
}
};
#-------------------------------------------------------------------

View file

@ -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;

View file

@ -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;
}
};
#-------------------------------------------------------------------

View file

@ -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;
}
};
#-------------------------------------------------------------------

View file

@ -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;
}
};
#-------------------------------------------------------------------

View file

@ -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;
}
};
#-------------------------------------------------------------------

View file

@ -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;
}
};
#-------------------------------------------------------------------

View file

@ -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;
}
};
#-------------------------------------------------------------------

View file

@ -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;
}
};
#-------------------------------------------------------------------

View file

@ -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;
}
};
#-------------------------------------------------------------------

View file

@ -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;
}
};
#-------------------------------------------------------------------

View file

@ -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;
}
};
#-------------------------------------------------------------------

View file

@ -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;
}
};
#-------------------------------------------------------------------

View file

@ -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;
}
};
#-------------------------------------------------------------------

View file

@ -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;
}
};
#-------------------------------------------------------------------

View file

@ -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;
}
};
#-------------------------------------------------------------------

View file

@ -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;
}
};
#-------------------------------------------------------------------

View file

@ -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;
}
};
#-------------------------------------------------------------------

View file

@ -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;
}
};
#-------------------------------------------------------------------

View file

@ -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;
}
};
#-------------------------------------------------------------------

View file

@ -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;
}
};
#-------------------------------------------------------------------

View file

@ -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(@_);
};
#-------------------------------------------------------------------