Merge branch 'master' into WebGUI8

This commit is contained in:
Graham Knop 2010-04-13 07:50:02 -05:00
commit 2400f19099
797 changed files with 33894 additions and 27196 deletions

View file

@ -43,7 +43,6 @@ around snippet => sub {
if ( $self->mimeType eq "text/html" ) {
HTML::Packer::minify( \$packed, {
remove_comments => 1,
remove_newlines => 1,
do_javascript => "shrink",
do_stylesheet => "minify",
} );
@ -166,6 +165,30 @@ sub exportGetUrlAsPath {
#-------------------------------------------------------------------
=head2 getCache ( $calledAsWebMethod )
Overrides the base method to handle Snippet specific caching.
=head3 $calledAsWebMethod
If this is true, then change the cache key.
=cut
sub getCache {
my $self = shift;
my $calledAsWebMethod = shift;
my $session = $self->session;
my $cacheKey = "view_".$calledAsWebMethod.'_'.$self->getId;
if ($session->env->sslRequest) {
$cacheKey .= '_ssl';
}
my $cache = WebGUI::Cache->new($session, $cacheKey);
return $cache;
}
#-------------------------------------------------------------------
=head2 getToolbar ( )
Returns a toolbar with a set of icons that hyperlink to functions that delete, edit, promote, demote, cut, and copy.
@ -207,7 +230,9 @@ override purgeCache => sub {
my $cache = $self->session->cache;
eval {
$cache->delete("view__".$self->getId);
$cache->delete("view_1_".$self->getId);
$cache->delete("view_1_".$self->getId);
$cache->delete("view__".$self->getId . '_ssl');
$cache->delete("view_1_".$self->getId . '_ssl');
};
super();
};
@ -238,16 +263,17 @@ toolbar if in adminMode.
=cut
sub view {
my $self = shift;
my $self = shift;
my $calledAsWebMethod = shift;
my $session = $self->session;
my $session = $self->session;
my $versionTag = WebGUI::VersionTag->getWorking($session, 1);
my $noCache =
$session->var->isAdminOn
|| $self->cacheTimeout <= 10
|| ($versionTag && $versionTag->getId eq $self->tagId);
my $cacheKey = $self->getWwwCacheKey('view', $calledAsWebMethod);
unless ($noCache) {
my $out = eval{$session->cache->get("view_".$calledAsWebMethod."_".$self->getId)};
my $out = eval { $session->cache->get( $cacheKey )};
return $out if $out;
}
my $output = $self->usePacked
@ -260,7 +286,7 @@ sub view {
}
WebGUI::Macro::process($session,\$output);
unless ($noCache) {
eval{$session->cache->set("view_".$calledAsWebMethod."_".$self->getId, $output, $self->cacheTimeout)};
eval { $session->cache->set( $cacheKey, $output, $self->cacheTimeout) };
}
return $output;
}