add search asset and list all other assets
This commit is contained in:
parent
c7825d4f74
commit
b7db85dcc6
1 changed files with 105 additions and 1 deletions
|
|
@ -42,6 +42,7 @@ sub run {
|
||||||
title => 'Test Content',
|
title => 'Test Content',
|
||||||
styleTemplateId => $style->getId,
|
styleTemplateId => $style->getId,
|
||||||
});
|
});
|
||||||
|
$top->indexContent;
|
||||||
|
|
||||||
# Create category pages for all asset categories
|
# Create category pages for all asset categories
|
||||||
my %categories = ();
|
my %categories = ();
|
||||||
|
|
@ -53,21 +54,24 @@ sub run {
|
||||||
title => $title,
|
title => $title,
|
||||||
styleTemplateId => $style->getId,
|
styleTemplateId => $style->getId,
|
||||||
});
|
});
|
||||||
|
$categories{ $cat }->indexContent;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Add individual asset pages to their category pages
|
# Add individual asset pages to their category pages
|
||||||
for my $class ( keys %ASSETS ) {
|
for my $class ( keys %ASSETS ) {
|
||||||
my @sets = @{ $self->getPropertySets( $class ) };
|
my @sets = @{ $self->getPropertySets( $class ) };
|
||||||
|
next unless @sets > 0;
|
||||||
|
|
||||||
# Set the default style template
|
# Set the default style template
|
||||||
$sets[0]->{styleTemplateId} ||= $style->getId;
|
$sets[0]->{styleTemplateId} ||= $style->getId;
|
||||||
|
|
||||||
# Put the first one on the given page
|
# Put the first one on the given page
|
||||||
my $cat = $session->config->get( "assets/$class/category" );
|
my $cat = $session->config->get( "assets/$class/category" ) || "utilities";
|
||||||
my $page = $categories{ $cat }->addChild({
|
my $page = $categories{ $cat }->addChild({
|
||||||
className => $LAYOUT_CLASS,
|
className => $LAYOUT_CLASS,
|
||||||
styleTemplateId => $style->getId,
|
styleTemplateId => $style->getId,
|
||||||
});
|
});
|
||||||
|
|
||||||
my $asset = $self->buildAsset( $class, $page, $sets[0] );
|
my $asset = $self->buildAsset( $class, $page, $sets[0] );
|
||||||
$page->title( $asset->getName );
|
$page->title( $asset->getName );
|
||||||
$page->menuTitle( $asset->getName );
|
$page->menuTitle( $asset->getName );
|
||||||
|
|
@ -75,8 +79,10 @@ sub run {
|
||||||
# Fix the URLs to take the new titles
|
# Fix the URLs to take the new titles
|
||||||
$page->url( '' );
|
$page->url( '' );
|
||||||
$page->write;
|
$page->write;
|
||||||
|
$page->indexContent;
|
||||||
$asset->url( '' );
|
$asset->url( '' );
|
||||||
$asset->write;
|
$asset->write;
|
||||||
|
$asset->indexContent;
|
||||||
|
|
||||||
# Make subpages for the other ones
|
# Make subpages for the other ones
|
||||||
for my $set ( @sets[1..$#sets] ) {
|
for my $set ( @sets[1..$#sets] ) {
|
||||||
|
|
@ -159,6 +165,9 @@ sub buildAsset {
|
||||||
$self->buildAsset( $merged_set->{className}, $asset, $merged_set );
|
$self->buildAsset( $merged_set->{className}, $asset, $merged_set );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Index the content
|
||||||
|
$asset->indexContent;
|
||||||
|
|
||||||
return $asset;
|
return $asset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -408,6 +417,101 @@ my $DT_NOW = DateTime->now;
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
'WebGUI::Asset::Wobject::Poll' => [
|
||||||
|
|
||||||
|
],
|
||||||
|
'WebGUI::Asset::Wobject::Search' => [
|
||||||
|
{
|
||||||
|
title => 'Search',
|
||||||
|
isHidden => 1,
|
||||||
|
searchRoot => 'PBasset000000000000001',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
'WebGUI::Asset::Snippet' => [
|
||||||
|
{
|
||||||
|
title => 'Snippet',
|
||||||
|
isHidden => 1,
|
||||||
|
snippet => '<div style="color: red">Red room!</div>',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
'WebGUI::Asset::Wobject::Collaboration' => [
|
||||||
|
|
||||||
|
],
|
||||||
|
'WebGUI::Asset::Wobject::Gallery' => [
|
||||||
|
|
||||||
|
],
|
||||||
|
'WebGUI::Asset::Wobject::MessageBoard' => [
|
||||||
|
|
||||||
|
],
|
||||||
|
'WebGUI::Asset::Wobject::Collaboration::Newsletter' => [
|
||||||
|
|
||||||
|
],
|
||||||
|
'WebGUI::Asset::Wobject::StoryArchive' => [
|
||||||
|
|
||||||
|
],
|
||||||
|
'WebGUI::Asset::Wobject::Survey' => [
|
||||||
|
|
||||||
|
],
|
||||||
|
'WebGUI::Asset::Wobject::WikiMaster' => [
|
||||||
|
|
||||||
|
],
|
||||||
|
'WebGUI::Asset::Wobject::Dashboard' => [
|
||||||
|
|
||||||
|
],
|
||||||
|
'WebGUI::Asset::Wobject::StockData' => [
|
||||||
|
|
||||||
|
],
|
||||||
|
'WebGUI::Asset::Wobject::Thingy' => [
|
||||||
|
|
||||||
|
],
|
||||||
|
'WebGUI::Asset::Wobject::UserList' => [
|
||||||
|
|
||||||
|
],
|
||||||
|
'WebGUI::Asset::Wobject::WeatherData' => [
|
||||||
|
|
||||||
|
],
|
||||||
|
'WebGUI::Asset::Sku::Donation' => [
|
||||||
|
|
||||||
|
],
|
||||||
|
'WebGUI::Asset::Sku::FlatDiscount' => [
|
||||||
|
|
||||||
|
],
|
||||||
|
'WebGUI::Asset::Sku::Product' => [
|
||||||
|
|
||||||
|
],
|
||||||
|
'WebGUI::Asset::Wobject::Shelf' => [
|
||||||
|
|
||||||
|
],
|
||||||
|
'WebGUI::Asset::Sku::Subscription' => [
|
||||||
|
|
||||||
|
],
|
||||||
|
'WebGUI::Asset::Wobject::AssetReport' => [
|
||||||
|
|
||||||
|
],
|
||||||
|
'WebGUI::Asset::Wobject::Carousel' => [
|
||||||
|
|
||||||
|
],
|
||||||
|
'WebGUI::Asset::File' => [
|
||||||
|
|
||||||
|
],
|
||||||
|
'WebGUI::Asset::File::Image' => [
|
||||||
|
|
||||||
|
],
|
||||||
|
'WebGUI::Asset::Wobject::Navigation' => [
|
||||||
|
|
||||||
|
],
|
||||||
|
'WebGUI::Asset::Redirect' => [
|
||||||
|
|
||||||
|
],
|
||||||
|
'WebGUI::Asset::Wobject::SQLReport' => [
|
||||||
|
|
||||||
|
],
|
||||||
|
'WebGUI::Asset::Wobject::SyndicatedContent' => [
|
||||||
|
|
||||||
|
],
|
||||||
|
'WebGUI::Asset::Template' => [
|
||||||
|
|
||||||
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
sub getPropertySets {
|
sub getPropertySets {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue