| Solstice documentation | Contained in the Solstice distribution. |
Solstice::View::Boilerplate - Superclass for boilerplate views.
No symbols exported.
Creates a new Solstice::View::Application object.
Solstice::Configure, Solstice::View, Solstice::Application, Solstice::OnloadService, Solstice::IncludeService,
Catalyst Group, <catalyst@u.washington.edu>
$Revision: 2586 $
Copyright 1998-2007 Office of Learning Technologies, University of Washington
Licensed under the Educational Community License, Version 1.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: http://www.opensource.org/licenses/ecl1.php
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
| Solstice documentation | Contained in the Solstice distribution. |
package Solstice::View::Boilerplate;
use 5.006_000; use strict; use warnings; use Solstice::View::MessageService; use Solstice::NamespaceService; use base qw(Solstice::View); use constant TEMPLATE => 'boilerplate/boiler.html';
sub new { my $obj = shift; my $self = $obj->SUPER::new(@_); $self->_setTemplatePath($self->getConfigService()->getRoot().'/templates'); $self->_setTemplate(TEMPLATE); return $self; }
sub setViewTopNav { my $self = shift; $self->{'_view_top_nav'} = shift; }
sub getViewTopNav { my $self = shift; return $self->{'_view_top_nav'}; }
sub _getTemplateParams { my $self = shift; my $ns_service = Solstice::NamespaceService->new(); my $app_name_space = $ns_service->getAppNamespace(); # Add the messaging pane to the boilerplate if messages need to be shown (still # up to the template to show them though!) $self->addChildView('messaging_pane', Solstice::View::MessageService->new()); if (my $nav_view = $self->getNavigationService->new()->getView()) { $self->addChildView('application_nav', $nav_view); }elsif(defined $app_name_space) { my $application_package = $app_name_space.'::Application'; my $nav_view; eval { $self->loadModule($application_package); $nav_view = $application_package->new()->getNavigationView(); }; $self->addChildView('application_nav', $nav_view) if $nav_view; } $self->generateParams(); my %child_views = $self->processChildViews(); foreach my $key (%child_views) { $self->setParam($key, $child_views{$key}); } # We go through this bit of convolution because we have some subclasses that # never bother to create an app namespace, as they just do a quick redirect # to wherever they want to go. my $app_home = ''; if (defined $app_name_space) { my $app_config = $self->getConfigService($ns_service->getAppNamespace()); $app_home = $app_config->getAppURL() . '/'; } $self->setParam('app_home', $app_home); return $self->{'_params'}; } 1; __END__