Skip to content

Instantly share code, notes, and snippets.

@perlDreamer
Created April 7, 2010 21:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save perlDreamer/359517 to your computer and use it in GitHub Desktop.
Save perlDreamer/359517 to your computer and use it in GitHub Desktop.
diff --git a/lib/WebGUI/Asset/Event.pm b/lib/WebGUI/Asset/Event.pm
index 24dcde8..1fd1845 100644
--- a/lib/WebGUI/Asset/Event.pm
+++ b/lib/WebGUI/Asset/Event.pm
@@ -1418,9 +1418,10 @@ Indexing the content of attachments and user defined fields. See WebGUI::Asset::
=cut
-sub indexContent {
+around indexContent => sub {
+ my $orig = shift;
my $self = shift;
- my $indexer = $self->SUPER::indexContent;
+ my $indexer = $self->$orig(@_);
$indexer->addKeywords($self->userDefined1);
$indexer->addKeywords($self->userDefined2);
$indexer->addKeywords($self->userDefined3);
@@ -1429,9 +1430,9 @@ sub indexContent {
$indexer->addKeywords($self->location);
my $storage = $self->getStorageLocation;
foreach my $file (@{$storage->getFiles}) {
- $indexer->addFile($storage->getPath($file));
+ $indexer->addFile($storage->getPath($file));
}
-}
+};
diff --git a/lib/WebGUI/Asset/File.pm b/lib/WebGUI/Asset/File.pm
index def703a..151a6de 100644
--- a/lib/WebGUI/Asset/File.pm
+++ b/lib/WebGUI/Asset/File.pm
@@ -357,11 +357,12 @@ Indexing the content of the attachment. See WebGUI::Asset::indexContent() for ad
=cut
-sub indexContent {
+around indexContent => sub {
+ my $orig = shift;
my $self = shift;
- my $indexer = $self->SUPER::indexContent;
+ my $indexer = $self->$orig(@_);
$indexer->addFile($self->getStorageLocation->getPath($self->filename));
-}
+};
#-------------------------------------------------------------------
diff --git a/lib/WebGUI/Asset/MatrixListing.pm b/lib/WebGUI/Asset/MatrixListing.pm
index ac170ea..131e9a4 100644
--- a/lib/WebGUI/Asset/MatrixListing.pm
+++ b/lib/WebGUI/Asset/MatrixListing.pm
@@ -391,12 +391,13 @@ Making private. See WebGUI::Asset::indexContent() for additonal details.
=cut
-sub indexContent {
+around indexContent => sub {
+ my $orig = shift;
my $self = shift;
- my $indexer = $self->next::method;
+ my $indexer = $self->$orig(@_);
$indexer->setIsPublic(0);
return undef;
-}
+};
#-------------------------------------------------------------------
diff --git a/lib/WebGUI/Asset/Post.pm b/lib/WebGUI/Asset/Post.pm
index fb5cc00..4026f88 100644
--- a/lib/WebGUI/Asset/Post.pm
+++ b/lib/WebGUI/Asset/Post.pm
@@ -802,21 +802,22 @@ Indexing the content of attachments and user defined fields. See WebGUI::Asset::
=cut
-sub indexContent {
- my $self = shift;
- my $indexer = $self->SUPER::indexContent;
- $indexer->addKeywords($self->content);
- $indexer->addKeywords($self->userDefined1);
- $indexer->addKeywords($self->userDefined2);
- $indexer->addKeywords($self->userDefined3);
- $indexer->addKeywords($self->userDefined4);
- $indexer->addKeywords($self->userDefined5);
- $indexer->addKeywords($self->username);
- my $storage = $self->getStorageLocation;
- foreach my $file (@{$storage->getFiles}) {
- $indexer->addFile($storage->getPath($file));
- }
-}
+around indexContent => sub {
+ my $orig = shift;
+ my $self = shift;
+ my $indexer = $self->$orig(@_);
+ $indexer->addKeywords($self->content);
+ $indexer->addKeywords($self->userDefined1);
+ $indexer->addKeywords($self->userDefined2);
+ $indexer->addKeywords($self->userDefined3);
+ $indexer->addKeywords($self->userDefined4);
+ $indexer->addKeywords($self->userDefined5);
+ $indexer->addKeywords($self->username);
+ my $storage = $self->getStorageLocation;
+ foreach my $file (@{$storage->getFiles}) {
+ $indexer->addFile($storage->getPath($file));
+ }
+};
#-------------------------------------------------------------------
diff --git a/lib/WebGUI/Asset/RichEdit.pm b/lib/WebGUI/Asset/RichEdit.pm
index 45e1e1e..24c3332 100644
--- a/lib/WebGUI/Asset/RichEdit.pm
+++ b/lib/WebGUI/Asset/RichEdit.pm
@@ -651,11 +651,12 @@ Making private. See WebGUI::Asset::indexContent() for additonal details.
=cut
-sub indexContent {
+around indexContent => sub {
+ my $orig = shift;
my $self = shift;
- my $indexer = $self->SUPER::indexContent;
+ my $indexer = $self->$orig(@_);
$indexer->setIsPublic(0);
-}
+};
#-------------------------------------------------------------------
diff --git a/lib/WebGUI/Asset/Sku.pm b/lib/WebGUI/Asset/Sku.pm
index bbaff19..b796b68 100644
--- a/lib/WebGUI/Asset/Sku.pm
+++ b/lib/WebGUI/Asset/Sku.pm
@@ -394,12 +394,13 @@ Adding sku as a keyword. See WebGUI::Asset::indexContent() for additonal details
=cut
-sub indexContent {
+around indexContent => sub {
+ my $orig = shift;
my $self = shift;
- my $indexer = $self->SUPER::indexContent;
+ my $indexer = $self->$orig(@_);
$indexer->addKeywords($self->sku);
return $indexer;
-}
+};
#-------------------------------------------------------------------
diff --git a/lib/WebGUI/Asset/Sku/EMSTicket.pm b/lib/WebGUI/Asset/Sku/EMSTicket.pm
index 9a97e8c..d34e52f 100644
--- a/lib/WebGUI/Asset/Sku/EMSTicket.pm
+++ b/lib/WebGUI/Asset/Sku/EMSTicket.pm
@@ -367,12 +367,13 @@ Adding location and eventNumber as a keyword. See WebGUI::Asset::indexContent()
=cut
-sub indexContent {
+around indexContent => sub {
+ my $orig = shift;
my $self = shift;
- my $indexer = $self->SUPER::indexContent;
+ my $indexer = $self->$orig(@_);
$indexer->addKeywords($self->location.' '.$self->eventNumber);
return $indexer;
-}
+};
diff --git a/lib/WebGUI/Asset/Snippet.pm b/lib/WebGUI/Asset/Snippet.pm
index a1de541..4146510 100644
--- a/lib/WebGUI/Asset/Snippet.pm
+++ b/lib/WebGUI/Asset/Snippet.pm
@@ -186,12 +186,13 @@ Indexing the content of the snippet. See WebGUI::Asset::indexContent() for addit
=cut
-sub indexContent {
+around indexContent => sub {
+ my $orig = shift;
my $self = shift;
- my $indexer = $self->SUPER::indexContent;
+ my $indexer = $self->$orig(@_);
$indexer->addKeywords($self->snippet);
$indexer->setIsPublic(0);
-}
+};
#-------------------------------------------------------------------
diff --git a/lib/WebGUI/Asset/Story.pm b/lib/WebGUI/Asset/Story.pm
index a0e07aa..5dc3cbe 100644
--- a/lib/WebGUI/Asset/Story.pm
+++ b/lib/WebGUI/Asset/Story.pm
@@ -519,11 +519,12 @@ Extend the base class to index Story properties like headline, byline, etc.
=cut
-sub indexContent {
+around indexContent => {
+ my $orig = shift;
my $self = shift;
- my $indexer = $self->next::method();
+ my $indexer = $self->$orig(@_);
$indexer->addKeywords($self->headline, $self->subtitle, $self->location, $self->highlights, $self->byline, $self->story, );
-}
+};
#-------------------------------------------------------------------
diff --git a/lib/WebGUI/Asset/Template.pm b/lib/WebGUI/Asset/Template.pm
index e90f32e..d66fe77 100644
--- a/lib/WebGUI/Asset/Template.pm
+++ b/lib/WebGUI/Asset/Template.pm
@@ -496,12 +496,13 @@ Making private. See WebGUI::Asset::indexContent() for additonal details.
=cut
-sub indexContent {
+around indexContent => sub {
+ my $orig = shift;
my $self = shift;
- my $indexer = $self->SUPER::indexContent;
+ my $indexer = $self->$orig(@_);
$indexer->addKeywords($self->namespace);
$indexer->setIsPublic(0);
-}
+};
#-------------------------------------------------------------------
diff --git a/lib/WebGUI/Asset/WikiPage.pm b/lib/WebGUI/Asset/WikiPage.pm
index bcd3e61..665d3c7 100644
--- a/lib/WebGUI/Asset/WikiPage.pm
+++ b/lib/WebGUI/Asset/WikiPage.pm
@@ -301,12 +301,13 @@ Extends the master class to handle indexing the wiki content.
=cut
-sub indexContent {
+around indexContent => sub {
+ my $orig = shift;
my $self = shift;
- my $indexer = $self->next::method;
+ my $indexer = $self->$orig(@_);
$indexer->addKeywords($self->content);
return $indexer;
-}
+};
#-------------------------------------------------------------------
diff --git a/lib/WebGUI/Asset/Wobject/Poll.pm b/lib/WebGUI/Asset/Wobject/Poll.pm
index 86c7050..da68249 100644
--- a/lib/WebGUI/Asset/Wobject/Poll.pm
+++ b/lib/WebGUI/Asset/Wobject/Poll.pm
@@ -319,11 +319,12 @@ Indexing question and answers. See WebGUI::Asset::indexContent() for additonal d
=cut
-sub indexContent {
+around indexContent => sub {
+ my $orig = shift;
my $self = shift;
- my $indexer = $self->SUPER::indexContent;
+ my $indexer = $self->$orig(@_);
$indexer->addKeywords($self->get("question")." ".$self->get("answers"));
-}
+};
#-------------------------------------------------------------------
diff --git a/lib/WebGUI/Asset/_NewAsset.skeleton b/lib/WebGUI/Asset/_NewAsset.skeleton
index 492a311..126e6a0 100644
--- a/lib/WebGUI/Asset/_NewAsset.skeleton
+++ b/lib/WebGUI/Asset/_NewAsset.skeleton
@@ -143,11 +143,12 @@ Making private. See WebGUI::Asset::indexContent() for additonal details.
=cut
-sub indexContent {
+around indexContent => sub {
+ my $orig = shift;
my $self = shift;
- my $indexer = $self->SUPER::indexContent;
+ my $indexer = $self->$orig(@_);
$indexer->setIsPublic(0);
-}
+};
#-------------------------------------------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment