new caching system to replace old page cache
This commit is contained in:
parent
e12ff119af
commit
e4392f7449
54 changed files with 718 additions and 167 deletions
|
|
@ -13,6 +13,7 @@ package WebGUI::Asset::Event;
|
|||
use strict;
|
||||
use Tie::CPHash;
|
||||
use WebGUI::Form;
|
||||
use WebGUI::Cache;
|
||||
use WebGUI::HTML;
|
||||
use WebGUI::HTMLForm;
|
||||
use WebGUI::International;
|
||||
|
|
@ -192,6 +193,21 @@ sub processPropertiesFromFormPost {
|
|||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 purgeCache ()
|
||||
|
||||
See WebGUI::Asset::purgeCache() for details.
|
||||
|
||||
=cut
|
||||
|
||||
sub purgeCache {
|
||||
my $self = shift;
|
||||
WebGUI::Cache->new($self->session,"view_".$self->getId)->delete;
|
||||
$self->SUPER::purgeCache;
|
||||
$self->getParent->purgeCache;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 setParent ( newParent )
|
||||
|
|
@ -214,6 +230,10 @@ sub setParent {
|
|||
#-------------------------------------------------------------------
|
||||
sub view {
|
||||
my $self = shift;
|
||||
if ($self->session->user->userId eq '1') {
|
||||
my $out = WebGUI::Cache->new($self->session,"view_".$self->getId)->get;
|
||||
return $out if $out;
|
||||
}
|
||||
my ($output, $event, $id);
|
||||
my %var = $self->get;
|
||||
my $i18n = WebGUI::International->new($self->session,"Asset_Event");
|
||||
|
|
@ -245,7 +265,11 @@ sub view {
|
|||
});
|
||||
}
|
||||
$var{others_loop} = \@others;
|
||||
return $self->processTemplate(\%var,undef, $self->{_viewTemplate});
|
||||
my $out = $self->processTemplate(\%var,undef,$self->{_viewTemplate});
|
||||
if ($self->session->user->userId eq '1') {
|
||||
WebGUI::Cache->new($self->session,"view_".$self->getId)->set($out,$self->getParent->get("visitorCacheTimeout"));
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ package WebGUI::Asset::File;
|
|||
|
||||
use strict;
|
||||
use WebGUI::Asset;
|
||||
use WebGUI::Cache;
|
||||
use WebGUI::Storage;
|
||||
use WebGUI::SQL;
|
||||
|
||||
|
|
@ -83,6 +84,14 @@ sub definition {
|
|||
tableName=>'FileAsset',
|
||||
className=>'WebGUI::Asset::File',
|
||||
properties=>{
|
||||
cacheTimeout => {
|
||||
tab => "display",
|
||||
fieldType => "interval",
|
||||
defaultValue => 3600,
|
||||
uiLevel => 8,
|
||||
label => $i18n->get("cache timeout"),
|
||||
hoverHelp => $i18n->get("cache timeout help")
|
||||
},
|
||||
filename=>{
|
||||
noFormPost=>1,
|
||||
fieldType=>'hidden',
|
||||
|
|
@ -250,6 +259,20 @@ sub purge {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 purgeCache ()
|
||||
|
||||
See WebGUI::Asset::purgeCache() for details.
|
||||
|
||||
=cut
|
||||
|
||||
sub purgeCache {
|
||||
my $self = shift;
|
||||
WebGUI::Cache->new($self->session,"view_".$self->getId)->delete;
|
||||
$self->SUPER::purgeCache;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
sub purgeRevision {
|
||||
my $self = shift;
|
||||
$self->getStorageLocation->delete;
|
||||
|
|
@ -291,11 +314,19 @@ sub update {
|
|||
#-------------------------------------------------------------------
|
||||
sub view {
|
||||
my $self = shift;
|
||||
if (!$self->session->var->isAdminOn && $self->get("cacheTimeout") > 10) {
|
||||
my $out = WebGUI::Cache->new($self->session,"view_".$self->getId)->get;
|
||||
return $out if $out;
|
||||
}
|
||||
my %var = %{$self->get};
|
||||
$var{controls} = $self->getToolbar;
|
||||
$var{fileUrl} = $self->getFileUrl;
|
||||
$var{fileIcon} = $self->getFileIconUrl;
|
||||
return $self->processTemplate(\%var, undef, $self->{_viewTemplate});
|
||||
my $out = $self->processTemplate(\%var,undef,$self->{_viewTemplate});
|
||||
if (!$self->session->var->isAdminOn && $self->get("cacheTimeout") > 10) {
|
||||
WebGUI::Cache->new($self->session,"view_".$self->getId)->set($out,$self->get("cacheTimeout"));
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -232,12 +232,20 @@ sub setSize {
|
|||
#-------------------------------------------------------------------
|
||||
sub view {
|
||||
my $self = shift;
|
||||
if (!$self->session->var->isAdminOn && $self->get("cacheTimeout") > 10) {
|
||||
my $out = WebGUI::Cache->new($self->session,"view_".$self->getId)->get;
|
||||
return $out if $out;
|
||||
}
|
||||
my %var = %{$self->get};
|
||||
$var{controls} = $self->getToolbar;
|
||||
$var{fileUrl} = $self->getFileUrl;
|
||||
$var{fileIcon} = $self->getFileIconUrl;
|
||||
$var{thumbnail} = $self->getThumbnailUrl;
|
||||
return $self->processTemplate(\%var,undef,$self->{_viewTemplate});
|
||||
my $out = $self->processTemplate(\%var,undef,$self->{_viewTemplate});
|
||||
if (!$self->session->var->isAdminOn && $self->get("cacheTimeout") > 10) {
|
||||
WebGUI::Cache->new($self->session,"view_".$self->getId)->set($out,$self->get("cacheTimeout"));
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -251,6 +251,10 @@ used to show the file to administrators.
|
|||
|
||||
sub view {
|
||||
my $self = shift;
|
||||
if (!$self->session->var->isAdminOn && $self->get("cacheTimeout") > 10) {
|
||||
my $out = WebGUI::Cache->new($self->session,"view_".$self->getId)->get;
|
||||
return $out if $out;
|
||||
}
|
||||
my %var = %{$self->get};
|
||||
#$self->session->errorHandler->warn($self->getId);
|
||||
$var{controls} = $self->getToolbar;
|
||||
|
|
@ -266,7 +270,11 @@ sub view {
|
|||
unless($self->get("showPage")) {
|
||||
$var{pageError} = "true";
|
||||
}
|
||||
return $self->processTemplate(\%var,undef,$self->{_viewTemplate});
|
||||
my $out = $self->processTemplate(\%var,undef,$self->{_viewTemplate});
|
||||
if (!$self->session->var->isAdminOn && $self->get("cacheTimeout") > 10) {
|
||||
WebGUI::Cache->new($self->session,"view_".$self->getId)->set($out,$self->get("cacheTimeout"));
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -696,6 +696,20 @@ sub purge {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 purgeCache ()
|
||||
|
||||
See WebGUI::Asset::purgeCache() for details.
|
||||
|
||||
=cut
|
||||
|
||||
sub purgeCache {
|
||||
my $self = shift;
|
||||
$self->getThread->purgeCache if $self->isReply;
|
||||
$self->SUPER::purgeCache;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
sub purgeRevision {
|
||||
my $self = shift;
|
||||
$self->getStorageLocation->delete;
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ package WebGUI::Asset::Post::Thread;
|
|||
use strict;
|
||||
use WebGUI::Asset::Template;
|
||||
use WebGUI::Asset::Post;
|
||||
use WebGUI::Cache;
|
||||
use WebGUI::Group;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Paginator;
|
||||
|
|
@ -534,6 +535,21 @@ sub purge {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 purgeCache ()
|
||||
|
||||
See WebGUI::Asset::purgeCache() for details.
|
||||
|
||||
=cut
|
||||
|
||||
sub purgeCache {
|
||||
my $self = shift;
|
||||
WebGUI::Cache->new($self->session,"view_".$self->getId)->delete;
|
||||
$self->SUPER::purgeCache;
|
||||
$self->getParent->purgeCache;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 rate ( rating )
|
||||
|
||||
Stores a rating against this post.
|
||||
|
|
@ -736,6 +752,10 @@ sub view {
|
|||
my $self = shift;
|
||||
$self->markRead;
|
||||
$self->incrementViews unless ($self->session->form->process("func") eq 'rate');
|
||||
if ($self->session->user->userId eq '1' && !$self->session->form->process("layout")) {
|
||||
my $out = WebGUI::Cache->new($self->session,"view_".$self->getId)->get;
|
||||
return $out if $out;
|
||||
}
|
||||
$self->session->scratch->set("discussionLayout",$self->session->form->process("layout"));
|
||||
my $var = $self->getTemplateVars;
|
||||
$self->getParent->appendTemplateLabels($var);
|
||||
|
|
@ -827,7 +847,11 @@ sub view {
|
|||
$var->{"collaboration.url"} = $self->getThread->getParent->getUrl;
|
||||
$var->{'collaboration.title'} = $self->getParent->get("title");
|
||||
$var->{'collaboration.description'} = $self->getParent->get("description");
|
||||
return $self->processTemplate($var,undef,$self->{_viewTemplate});
|
||||
my $out = $self->processTemplate($var,undef,$self->{_viewTemplate});
|
||||
if ($self->session->user->userId eq '1' && !$self->session->form->process("layout")) {
|
||||
WebGUI::Cache->new($self->session,"view_".$self->getId)->set($out,$self->getThread->getParent->get("visitorCacheTimeout"));
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -82,22 +82,6 @@ sub definition {
|
|||
hoverHelp=>$i18n->get('174 description'),
|
||||
uiLevel=>5
|
||||
},
|
||||
cacheTimeout=>{
|
||||
fieldType=>'interval',
|
||||
defaultValue=>60,
|
||||
tab=>"display",
|
||||
label=>$i18n->get(895),
|
||||
hoverHelp=>$i18n->get('895 description'),
|
||||
uiLevel=>8
|
||||
},
|
||||
cacheTimeoutVisitor=>{
|
||||
fieldType=>'interval',
|
||||
defaultValue=>600,
|
||||
tab=>"display",
|
||||
label=>$i18n->get(896),
|
||||
hoverHelp=>$i18n->get('896 description'),
|
||||
uiLevel=>8
|
||||
},
|
||||
styleTemplateId=>{
|
||||
fieldType=>'template',
|
||||
defaultValue=>undef,
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ package WebGUI::Asset::Wobject::Article;
|
|||
use strict;
|
||||
use Tie::IxHash;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Cache;
|
||||
use WebGUI::Paginator;
|
||||
use WebGUI::Asset::Wobject;
|
||||
|
||||
|
|
@ -73,6 +74,14 @@ sub definition {
|
|||
my %properties;
|
||||
tie %properties, 'Tie::IxHash';
|
||||
%properties = (
|
||||
cacheTimeout => {
|
||||
tab => "display",
|
||||
fieldType => "interval",
|
||||
defaultValue => 3600,
|
||||
uiLevel => 8,
|
||||
label => $i18n->get("cache timeout"),
|
||||
hoverHelp => $i18n->get("cache timeout help")
|
||||
},
|
||||
templateId =>{
|
||||
fieldType=>"template",
|
||||
defaultValue=>'PBtmpl0000000000000002',
|
||||
|
|
@ -139,6 +148,20 @@ sub prepareView {
|
|||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 purgeCache ()
|
||||
|
||||
See WebGUI::Asset::purgeCache() for details.
|
||||
|
||||
=cut
|
||||
|
||||
sub purgeCache {
|
||||
my $self = shift;
|
||||
WebGUI::Cache->new($self->session,"view_".$self->getId)->delete;
|
||||
$self->SUPER::purgeCache;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 view ( )
|
||||
|
|
@ -150,6 +173,10 @@ returns the output.
|
|||
|
||||
sub view {
|
||||
my $self = shift;
|
||||
if (!$self->session->var->isAdminOn && $self->get("cacheTimeout") > 10 && !$self->session->form->process("overrideTemplateId") && !$self->session->form->process("pn") && !$self->session->form->process("makePrintable")) {
|
||||
my $out = WebGUI::Cache->new($self->session,"view_".$self->getId)->get;
|
||||
return $out if $out;
|
||||
}
|
||||
my %var;
|
||||
my $children = $self->getLineage(["children"],{returnObjects=>1,includeOnlyClasses=>["WebGUI::Asset::File","WebGUI::Asset::File::Image"]});
|
||||
foreach my $child (@{$children}) {
|
||||
|
|
@ -201,7 +228,11 @@ sub view {
|
|||
$var{description} = $p->getPage;
|
||||
}
|
||||
$p->appendTemplateVars(\%var);
|
||||
return $self->processTemplate(\%var, undef, $self->{_viewTemplate});
|
||||
my $out = $self->processTemplate(\%var,undef,$self->{_viewTemplate});
|
||||
if (!$self->session->var->isAdminOn && $self->get("cacheTimeout") > 10 && !$self->session->form->process("overrideTemplateId") && !$self->session->form->process("pn") && !$self->session->form->process("makePrintable")) {
|
||||
WebGUI::Cache->new($self->session,"view_".$self->getId)->set($out,$self->get("cacheTimeout"));
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ package WebGUI::Asset::Wobject::Collaboration;
|
|||
use strict;
|
||||
use Tie::IxHash;
|
||||
use WebGUI::Group;
|
||||
use WebGUI::Cache;
|
||||
use WebGUI::HTML;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Paginator;
|
||||
|
|
@ -248,6 +249,14 @@ sub definition {
|
|||
tableName=>'Collaboration',
|
||||
className=>'WebGUI::Asset::Wobject::Collaboration',
|
||||
properties=>{
|
||||
visitorCacheTimeout => {
|
||||
tab => "display",
|
||||
fieldType => "interval",
|
||||
defaultValue => 3600,
|
||||
uiLevel => 8,
|
||||
label => $i18n->get("visitor cache timeout"),
|
||||
hoverHelp => $i18n->get("visitor cache timeout help")
|
||||
},
|
||||
approvalWorkflow =>{
|
||||
fieldType=>"workflow",
|
||||
defaultValue=>"pbworkflow000000000003"
|
||||
|
|
@ -410,6 +419,14 @@ sub getEditForm {
|
|||
my $self = shift;
|
||||
my $tabform = $self->SUPER::getEditForm;
|
||||
my $i18n = WebGUI::International->new($self->session,"Asset_Collaboration");
|
||||
$tabform->getTab("display")->interval(
|
||||
-name=>"visitorCacheTimeout",
|
||||
-label=>$i18n->get('visitor cache timeout'),
|
||||
-hoverHelp=>$i18n->get('visitor cache timeout help'),
|
||||
-value=>$self->getValue('visitorCacheTimeout'),
|
||||
-uiLevel=>8,
|
||||
-defaultValue=>3600
|
||||
);
|
||||
$tabform->getTab("display")->yesNo(
|
||||
-value=>$self->getValue('displayLastReply'),
|
||||
-label=>$i18n->get('display last reply'),
|
||||
|
|
@ -822,6 +839,20 @@ sub purge {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 purgeCache ()
|
||||
|
||||
See WebGUI::Asset::purgeCache() for details.
|
||||
|
||||
=cut
|
||||
|
||||
sub purgeCache {
|
||||
my $self = shift;
|
||||
WebGUI::Cache->new($self->session,"view_".$self->getId)->delete;
|
||||
$self->SUPER::purgeCache;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 recalculateRating ( )
|
||||
|
||||
Calculates the rating of this forum from its threads and stores the new value in the forum properties.
|
||||
|
|
@ -895,6 +926,10 @@ sub unsubscribe {
|
|||
#-------------------------------------------------------------------
|
||||
sub view {
|
||||
my $self = shift;
|
||||
if ($self->session->user->userId eq '1' && !$self->session->form->process("sortBy")) {
|
||||
my $out = WebGUI::Cache->new($self->session,"view_".$self->getId)->get;
|
||||
return $out if $out;
|
||||
}
|
||||
my $scratchSortBy = $self->getId."_sortBy";
|
||||
my $scratchSortOrder = $self->getId."_sortDir";
|
||||
my $sortBy = $self->session->form->process("sortBy") || $self->session->scratch->get($scratchSortBy) || $self->get("sortBy");
|
||||
|
|
@ -942,7 +977,11 @@ sub view {
|
|||
my $p = WebGUI::Paginator->new($self->session,$self->getUrl,$self->get("threadsPerPage"));
|
||||
$self->appendPostListTemplateVars(\%var, $sql, $p);
|
||||
$self->appendTemplateLabels(\%var);
|
||||
return $self->processTemplate(\%var,undef, $self->{_viewTemplate});
|
||||
my $out = $self->processTemplate(\%var,undef,$self->{_viewTemplate});
|
||||
if ($self->session->user->userId eq '1' && !$self->session->form->process("sortBy")) {
|
||||
WebGUI::Cache->new($self->session,"view_".$self->getId)->set($out,$self->get("visitorCacheTimeout"));
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -1137,18 +1137,6 @@ sub www_process {
|
|||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 www_view ( )
|
||||
|
||||
Overwrite www_view method and call the superclass object, passing in a 1 to disable cache
|
||||
|
||||
=cut
|
||||
|
||||
sub www_view {
|
||||
my $self = shift;
|
||||
$self->SUPER::www_view(1);
|
||||
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ package WebGUI::Asset::Wobject::EventsCalendar;
|
|||
|
||||
use strict;
|
||||
use Tie::CPHash;
|
||||
use WebGUI::Cache;
|
||||
use WebGUI::International;
|
||||
use WebGUI::SQL;
|
||||
use WebGUI::Utility;
|
||||
|
|
@ -45,6 +46,14 @@ sub definition {
|
|||
tableName=>'EventsCalendar',
|
||||
className=>'WebGUI::Asset::Wobject::EventsCalendar',
|
||||
properties=>{
|
||||
visitorCacheTimeout => {
|
||||
tab => "display",
|
||||
fieldType => "interval",
|
||||
defaultValue => 3600,
|
||||
uiLevel => 8,
|
||||
label => $i18n->get("visitor cache timeout"),
|
||||
hoverHelp => $i18n->get("visitor cache timeout help")
|
||||
},
|
||||
templateId =>{
|
||||
fieldType=>"template",
|
||||
defaultValue=>'PBtmpl0000000000000022'
|
||||
|
|
@ -116,6 +125,14 @@ sub getEditForm {
|
|||
2=>$i18n->get(509),
|
||||
}
|
||||
);
|
||||
$tabform->getTab("display")->interval(
|
||||
-name=>"visitorCacheTimeout",
|
||||
-label=>$i18n->get('visitor cache timeout'),
|
||||
-hoverHelp=>$i18n->get('visitor cache timeout help'),
|
||||
-value=>$self->getValue('visitorCacheTimeout'),
|
||||
-uiLevel=>8,
|
||||
-defaultValue=>3600
|
||||
);
|
||||
$tabform->getTab("display")->template(
|
||||
-name=>"templateId",
|
||||
-label=>$i18n->get(94),
|
||||
|
|
@ -198,9 +215,27 @@ sub prepareView {
|
|||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 purgeCache ()
|
||||
|
||||
See WebGUI::Asset::purgeCache() for details.
|
||||
|
||||
=cut
|
||||
|
||||
sub purgeCache {
|
||||
my $self = shift;
|
||||
WebGUI::Cache->new($self->session,"view_".$self->getId)->delete;
|
||||
$self->SUPER::purgeCache;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub view {
|
||||
my $self = shift;
|
||||
if ($self->session->user->userId eq '1' && !$self->session->form->process("calMonthStart") && !$self->session->form->process("calMonthEnd")) {
|
||||
my $out = WebGUI::Cache->new($self->session,"view_".$self->getId)->get;
|
||||
return $out if $out;
|
||||
}
|
||||
my $i18n = WebGUI::International->new($self->session,"Asset_EventsCalendar");
|
||||
#define default view month range. Note that this could be different from
|
||||
#the range a user is allowed to view - set by the events calendar limitations.
|
||||
|
|
@ -466,25 +501,15 @@ sub view {
|
|||
<option value="'.(8+$calMonthStart).'">9 '.$i18n->get(561).'</option>
|
||||
<option value="'.(11+$calMonthStart).'">12 '.$i18n->get(561).'</option></select>
|
||||
<input type="submit" value="Go" name="Go" />';
|
||||
#use Data::Dumper; return '<pre>'.Dumper(\%var).'</pre>';
|
||||
my $vars = \%var;
|
||||
return $self->processTemplate($vars,undef,$self->{_viewTemplate});
|
||||
my $out = $self->processTemplate(\%var,undef,$self->{_viewTemplate});
|
||||
if ($self->session->user->userId eq '1' && !$self->session->form->process("calMonthStart") && !$self->session->form->process("calMonthEnd")) {
|
||||
WebGUI::Cache->new($self->session,"view_".$self->getId)->set($out,$self->get("visitorCacheTimeout"));
|
||||
}
|
||||
return $out;
|
||||
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 www_view ( )
|
||||
|
||||
Overwrite www_view method and call the superclass object, passing in a 1 to disable cache
|
||||
|
||||
=cut
|
||||
|
||||
sub www_view {
|
||||
my $self = shift;
|
||||
$self->SUPER::www_view(1);
|
||||
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ package WebGUI::Asset::Wobject::Folder;
|
|||
|
||||
use strict;
|
||||
use WebGUI::Asset::Wobject;
|
||||
use WebGUI::Cache;
|
||||
use WebGUI::Utility;
|
||||
|
||||
our @ISA = qw(WebGUI::Asset::Wobject);
|
||||
|
|
@ -65,6 +66,14 @@ sub definition {
|
|||
tableName=>'Folder',
|
||||
className=>'WebGUI::Asset::Wobject::Folder',
|
||||
properties=>{
|
||||
visitorCacheTimeout => {
|
||||
tab => "display",
|
||||
fieldType => "interval",
|
||||
defaultValue => 3600,
|
||||
uiLevel => 8,
|
||||
label => $i18n->get("visitor cache timeout"),
|
||||
hoverHelp => $i18n->get("visitor cache timeout help")
|
||||
},
|
||||
templateId =>{
|
||||
fieldType=>"template",
|
||||
defaultValue=>'PBtmpl0000000000000078'
|
||||
|
|
@ -88,6 +97,14 @@ sub getEditForm {
|
|||
my $self = shift;
|
||||
my $tabform = $self->SUPER::getEditForm();
|
||||
my $i18n = WebGUI::International->new($self->session,"Asset_Folder");
|
||||
$tabform->getTab("display")->interval(
|
||||
-name=>"visitorCacheTimeout",
|
||||
-label=>$i18n->get('visitor cache timeout'),
|
||||
-hoverHelp=>$i18n->get('visitor cache timeout help'),
|
||||
-value=>$self->getValue('visitorCacheTimeout'),
|
||||
-uiLevel=>8,
|
||||
-defaultValue=>3600
|
||||
);
|
||||
$tabform->getTab("display")->template(
|
||||
-value=>$self->getValue('templateId'),
|
||||
-label=>$i18n->get('folder template title'),
|
||||
|
|
@ -124,9 +141,27 @@ sub prepareView {
|
|||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 purgeCache ()
|
||||
|
||||
See WebGUI::Asset::purgeCache() for details.
|
||||
|
||||
=cut
|
||||
|
||||
sub purgeCache {
|
||||
my $self = shift;
|
||||
WebGUI::Cache->new($self->session,"view_".$self->getId)->delete;
|
||||
$self->SUPER::purgeCache;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub view {
|
||||
my $self = shift;
|
||||
if ($self->session->user->userId eq '1') {
|
||||
my $out = WebGUI::Cache->new($self->session,"view_".$self->getId)->get;
|
||||
return $out if $out;
|
||||
}
|
||||
my $children = $self->getLineage( ["children"], { returnObjects=>1 });
|
||||
my %vars;
|
||||
foreach my $child (@{$children}) {
|
||||
|
|
@ -164,18 +199,14 @@ sub view {
|
|||
});
|
||||
}
|
||||
}
|
||||
return $self->processTemplate(\%vars,undef,$self->{_viewTemplate});
|
||||
my $out = $self->processTemplate(\%vars,undef,$self->{_viewTemplate});
|
||||
if ($self->session->user->userId eq '1') {
|
||||
WebGUI::Cache->new($self->session,"view_".$self->getId)->set($out,$self->get("visitorCacheTimeout"));
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
|
||||
|
||||
#sub www_edit {
|
||||
# my $self = shift;
|
||||
# return $self->session->privilege->insufficient() unless $self->canEdit;
|
||||
# $self->getAdminConsole->setHelp("folder add/edit","Asset_Folder");
|
||||
# return $self->getAdminConsole->render($self->getEditForm->print,"Edit Folder");
|
||||
#}
|
||||
|
||||
|
||||
|
||||
1;
|
||||
|
||||
|
|
|
|||
|
|
@ -54,6 +54,10 @@ sub definition {
|
|||
fieldType=>"yesNo",
|
||||
defaultValue=>1
|
||||
},
|
||||
cacheTimeout=>{
|
||||
fieldType=>"interval",
|
||||
defaultValue=>0
|
||||
},
|
||||
filterHtml=>{
|
||||
fieldType=>"filterContent",
|
||||
defaultValue=>"javascript"
|
||||
|
|
@ -139,6 +143,13 @@ sub getEditForm {
|
|||
-hoverHelp=>$i18n->get('12 description'),
|
||||
-value=>$self->getValue("rewriteUrls")
|
||||
);
|
||||
$tabform->getTab("display")->interval(
|
||||
-name=>"cacheTimeout",
|
||||
-label=>$i18n->get('cache timeout'),
|
||||
-hoverHelp=>$i18n->get('cache timeout description'),
|
||||
-uiLevel => 8,
|
||||
-value=>$self->getValue("cacheTimeout")
|
||||
);
|
||||
$tabform->getTab("display")->yesNo(
|
||||
-name=>"removeStyle",
|
||||
-label=>$i18n->get(6),
|
||||
|
|
@ -197,6 +208,21 @@ sub purge {
|
|||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 purgeCache ()
|
||||
|
||||
See WebGUI::Asset::purgeCache() for details.
|
||||
|
||||
=cut
|
||||
|
||||
sub purgeCache {
|
||||
my $self = shift;
|
||||
WebGUI::Cache->new($self->session,$self->get("proxiedUrl"),"URL")->delete;
|
||||
WebGUI::Cache->new($self->session,$self->get("proxiedUrl"),"HEADER")->delete;
|
||||
$self->SUPER::purgeCache;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub view {
|
||||
my $self = shift;
|
||||
|
|
@ -204,7 +230,7 @@ sub view {
|
|||
$cookiebox =~ s/[^A-Za-z0-9\-\.\_]//g; #removes all funky characters
|
||||
$cookiebox .= '.cookie';
|
||||
my $jar = HTTP::Cookies->new(File => $self->getCookieJar->getPath($cookiebox), AutoSave => 1, Ignore_Discard => 1);
|
||||
my (%var, %formdata, @formUpload, $redirect, $response, $header, $userAgent, $proxiedUrl, $request, $ttl);
|
||||
my (%var, %formdata, @formUpload, $redirect, $response, $header, $userAgent, $proxiedUrl, $request);
|
||||
|
||||
if($self->session->form->process("func")!~/editSave/i) {
|
||||
$proxiedUrl = $self->session->form->process("FormAction") || $self->session->form->process("proxiedUrl") || $self->get("proxiedUrl") ;
|
||||
|
|
@ -338,14 +364,9 @@ sub view {
|
|||
$var{content} = "<b>Getting <a href='$proxiedUrl'>$proxiedUrl</a> failed</b>".
|
||||
"<p><i>GET status line: ".$response->status_line."</i>";
|
||||
}
|
||||
if ($self->session->user->userId eq '1') {
|
||||
$ttl = $self->get("cacheTimeoutVisitor");
|
||||
} else {
|
||||
$ttl = $self->get("cacheTimeout");
|
||||
}
|
||||
unless ($self->get("cacheTimeoutVisitor") <= 1 && $self->get("cacheTimeout") <= 1) {
|
||||
$cachedContent->set($var{content},$ttl);
|
||||
$cachedHeader->set($var{header},$ttl);
|
||||
unless ($self->get("cacheTimeout") <= 10) {
|
||||
$cachedContent->set($var{content},$self->get("cacheTimeout"));
|
||||
$cachedHeader->set($var{header},$self->get("cacheTimeout"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -398,10 +398,6 @@ sub www_setStatus {
|
|||
return $self->www_view;
|
||||
}
|
||||
|
||||
sub www_view {
|
||||
my $self = shift;
|
||||
$self->SUPER::www_view(1);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_viewReport {
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ use strict;
|
|||
use Tie::IxHash;
|
||||
use WebGUI::Form;
|
||||
use WebGUI::HTMLForm;
|
||||
use WebGUI::Cache;
|
||||
use WebGUI::Mail::Send;
|
||||
use WebGUI::SQL;
|
||||
use WebGUI::User;
|
||||
|
|
@ -27,6 +28,14 @@ sub definition {
|
|||
className=>'WebGUI::Asset::Wobject::Matrix',
|
||||
assetName=>$i18n->get('assetName'),
|
||||
properties=>{
|
||||
visitorCacheTimeout => {
|
||||
tab => "display",
|
||||
fieldType => "interval",
|
||||
defaultValue => 3600,
|
||||
uiLevel => 8,
|
||||
label => $i18n->get("visitor cache timeout"),
|
||||
hoverHelp => $i18n->get("visitor cache timeout help")
|
||||
},
|
||||
categories=>{
|
||||
defaultValue=>"Features\nBenefits",
|
||||
fieldType=>"textarea"
|
||||
|
|
@ -192,6 +201,20 @@ sub purge {
|
|||
$self->SUPER::purge;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 purgeCache ()
|
||||
|
||||
See WebGUI::Asset::purgeCache() for details.
|
||||
|
||||
=cut
|
||||
|
||||
sub purgeCache {
|
||||
my $self = shift;
|
||||
WebGUI::Cache->new($self->session,"view_".$self->getId)->delete;
|
||||
$self->SUPER::purgeCache;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub setRatings {
|
||||
my $self = shift;
|
||||
|
|
@ -377,6 +400,14 @@ sub getEditForm {
|
|||
my $self = shift;
|
||||
my $tabform = $self->SUPER::getEditForm();
|
||||
my $i18n = WebGUI::International->new($self->session,'Asset_Matrix');
|
||||
$tabform->getTab("display")->interval(
|
||||
-name=>"visitorCacheTimeout",
|
||||
-label=>$i18n->get('visitor cache timeout'),
|
||||
-hoverHelp=>$i18n->get('visitor cache timeout help'),
|
||||
-value=>$self->getValue('visitorCacheTimeout'),
|
||||
-uiLevel=>8,
|
||||
-defaultValue=>3600
|
||||
);
|
||||
$tabform->getTab("properties")->textarea(
|
||||
-name=>"categories",
|
||||
-label=>$i18n->get('categories'),
|
||||
|
|
@ -905,6 +936,10 @@ sub www_search {
|
|||
#-------------------------------------------------------------------
|
||||
sub view {
|
||||
my $self = shift;
|
||||
if ($self->session->user->userId eq '1') {
|
||||
my $out = WebGUI::Cache->new($self->session,"view_".$self->getId)->get;
|
||||
return $out if $out;
|
||||
}
|
||||
my (%var);
|
||||
$var{'compare.form'} = $self->getCompareForm;
|
||||
$var{'search.url'} = $self->getUrl("func=search");
|
||||
|
|
@ -1000,7 +1035,11 @@ sub view {
|
|||
});
|
||||
}
|
||||
$sth->finish;
|
||||
return $self->processTemplate(\%var,undef,$self->{_viewTemplate});
|
||||
my $out = $self->processTemplate(\%var,undef,$self->{_viewTemplate});
|
||||
if ($self->session->user->userId eq '1') {
|
||||
WebGUI::Cache->new($self->session,"view_".$self->getId)->set($out,$self->get("visitorCacheTimeout"));
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ package WebGUI::Asset::Wobject::MessageBoard;
|
|||
|
||||
use strict;
|
||||
use Tie::IxHash;
|
||||
use WebGUI::Cache;
|
||||
use WebGUI::Asset::Wobject;
|
||||
use WebGUI::International;
|
||||
use WebGUI::SQL;
|
||||
|
|
@ -35,7 +36,15 @@ sub definition {
|
|||
namespace=>"MessageBoard",
|
||||
label=>$i18n->get(73),
|
||||
hoverHelp=>$i18n->get('73 description')
|
||||
}
|
||||
},
|
||||
visitorCacheTimeout => {
|
||||
tab => "display",
|
||||
fieldType => "interval",
|
||||
defaultValue => 3600,
|
||||
uiLevel => 8,
|
||||
label => $i18n->get("visitor cache timeout"),
|
||||
hoverHelp => $i18n->get("visitor cache timeout help")
|
||||
},
|
||||
);
|
||||
push(@{$definition}, {
|
||||
assetName=>$i18n->get('assetName'),
|
||||
|
|
@ -65,10 +74,34 @@ sub prepareView {
|
|||
$self->{_viewTemplate} = $template;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 purgeCache ()
|
||||
|
||||
See WebGUI::Asset::purgeCache() for details.
|
||||
|
||||
=cut
|
||||
|
||||
sub purgeCache {
|
||||
my $self = shift;
|
||||
WebGUI::Cache->new($self->session,"view_".$self->getId)->delete;
|
||||
$self->SUPER::purgeCache;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 view ()
|
||||
|
||||
See WebGUI::Asset::view() for details.
|
||||
|
||||
=cut
|
||||
|
||||
sub view {
|
||||
my $self = shift;
|
||||
if ($self->session->user->userId eq '1') {
|
||||
my $out = WebGUI::Cache->new($self->session,"view_".$self->getId)->get;
|
||||
return $out if $out;
|
||||
}
|
||||
my %var;
|
||||
my $count;
|
||||
my $first;
|
||||
|
|
@ -123,7 +156,11 @@ sub view {
|
|||
$var{'lastpost.label'} = $i18n->get('lastpost');
|
||||
$var{areMultipleForums} = ($count > 1);
|
||||
$var{forum_loop} = \@forum_loop;
|
||||
return $self->processTemplate(\%var,undef,$self->{_viewTemplate});
|
||||
my $out = $self->processTemplate(\%var,undef,$self->{_viewTemplate});
|
||||
if ($self->session->user->userId eq '1') {
|
||||
WebGUI::Cache->new($self->session,"view_".$self->getId)->set($out,$self->get("visitorCacheTimeout"));
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ use Tie::IxHash;
|
|||
use JSON;
|
||||
use WebGUI::International;
|
||||
use WebGUI::SQL;
|
||||
use WebGUI::Cache;
|
||||
use WebGUI::Asset::Wobject;
|
||||
use WebGUI::Utility;
|
||||
|
||||
|
|
@ -43,6 +44,14 @@ sub definition {
|
|||
my $definition = shift;
|
||||
my $i18n = WebGUI::International->new($session, "Asset_MultiSearch");
|
||||
my $properties = {
|
||||
cacheTimeout => {
|
||||
tab => "display",
|
||||
fieldType => "interval",
|
||||
defaultValue => 3600,
|
||||
uiLevel => 8,
|
||||
label => $i18n->get("cache timeout"),
|
||||
hoverHelp => $i18n->get("cache timeout help")
|
||||
},
|
||||
templateId =>{
|
||||
fieldType=>"template",
|
||||
tab=>"display",
|
||||
|
|
@ -87,6 +96,20 @@ sub prepareView {
|
|||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 purgeCache ()
|
||||
|
||||
See WebGUI::Asset::purgeCache() for details.
|
||||
|
||||
=cut
|
||||
|
||||
sub purgeCache {
|
||||
my $self = shift;
|
||||
WebGUI::Cache->new($self->session,"view_".$self->getId)->delete;
|
||||
$self->SUPER::purgeCache;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 view ( )
|
||||
|
||||
|
|
@ -97,6 +120,10 @@ to be displayed within the page style
|
|||
|
||||
sub view {
|
||||
my $self = shift;
|
||||
if (!$self->session->var->isAdminOn && $self->get("cacheTimeout") > 10) {
|
||||
my $out = WebGUI::Cache->new($self->session,"view_".$self->getId)->get;
|
||||
return $out if $out;
|
||||
}
|
||||
my %var = $self->get();
|
||||
my $i18n = WebGUI::International->new($self->session, 'Asset_MultiSearch');
|
||||
|
||||
|
|
@ -105,7 +132,11 @@ sub view {
|
|||
$var{'search'} = $i18n->get('search');
|
||||
$var{'submit'} = WebGUI::Form::Submit->new({name=>'SearchSubmit',value=>$i18n->get('submit','WebGUI')})->toHtml();
|
||||
|
||||
return $self->processTemplate(\%var, undef, $self->get("templateId"));
|
||||
my $out = $self->processTemplate(\%var,undef,$self->{_viewTemplate});
|
||||
if (!$self->session->var->isAdminOn && $self->get("cacheTimeout") > 10) {
|
||||
WebGUI::Cache->new($self->session,"view_".$self->getId)->set($out,$self->get("cacheTimeout"));
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ package WebGUI::Asset::Wobject::Product;
|
|||
|
||||
use strict;
|
||||
use Tie::CPHash;
|
||||
use WebGUI::Cache;
|
||||
use WebGUI::HTMLForm;
|
||||
use WebGUI::Storage::Image;
|
||||
use WebGUI::SQL;
|
||||
|
|
@ -101,6 +102,14 @@ sub definition {
|
|||
tableName=>'Product',
|
||||
className=>'WebGUI::Asset::Wobject::Product',
|
||||
properties=>{
|
||||
cacheTimeout => {
|
||||
tab => "display",
|
||||
fieldType => "interval",
|
||||
defaultValue => 3600,
|
||||
uiLevel => 8,
|
||||
label => $i18n->get("cache timeout"),
|
||||
hoverHelp => $i18n->get("cache timeout help")
|
||||
},
|
||||
templateId =>{
|
||||
fieldType=>"template",
|
||||
defaultValue=>'PBtmpl0000000000000056'
|
||||
|
|
@ -333,6 +342,20 @@ sub purge {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 purgeCache ()
|
||||
|
||||
See WebGUI::Asset::purgeCache() for details.
|
||||
|
||||
=cut
|
||||
|
||||
sub purgeCache {
|
||||
my $self = shift;
|
||||
WebGUI::Cache->new($self->session,"view_".$self->getId)->delete;
|
||||
$self->SUPER::purgeCache;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
sub purgeRevision {
|
||||
my $self = shift;
|
||||
WebGUI::Storage->get($self->session,$self->get("image1"))->delete if ($self->get("image1"));
|
||||
|
|
@ -737,6 +760,10 @@ sub www_moveSpecificationUp {
|
|||
#-------------------------------------------------------------------
|
||||
sub view {
|
||||
my $self = shift;
|
||||
if (!$self->session->var->isAdminOn && $self->get("cacheTimeout") > 10) {
|
||||
my $out = WebGUI::Cache->new($self->session,"view_".$self->getId)->get;
|
||||
return $out if $out;
|
||||
}
|
||||
my (%data, $sth, $file, $segment, %var, @featureloop, @benefitloop, @specificationloop, @accessoryloop, @relatedloop);
|
||||
tie %data, 'Tie::CPHash';
|
||||
my $brochure = $self->get("brochure");
|
||||
|
|
@ -879,7 +906,11 @@ sub view {
|
|||
}
|
||||
$sth->finish;
|
||||
$var{relatedproduct_loop} = \@relatedloop;
|
||||
return $self->processTemplate(\%var, undef, $self->{_viewTemplate});
|
||||
my $out = $self->processTemplate(\%var,undef,$self->{_viewTemplate});
|
||||
if (!$self->session->var->isAdminOn && $self->get("cacheTimeout") > 10) {
|
||||
WebGUI::Cache->new($self->session,"view_".$self->getId)->set($out,$self->get("cacheTimeout"));
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ use WebGUI::Paginator;
|
|||
use WebGUI::SQL;
|
||||
use WebGUI::Utility;
|
||||
use WebGUI::Asset::Wobject;
|
||||
use WebGUI::Cache;
|
||||
|
||||
our @ISA = qw(WebGUI::Asset::Wobject);
|
||||
|
||||
|
|
@ -40,6 +41,10 @@ sub definition {
|
|||
fieldType=>"template",
|
||||
defaultValue=>'PBtmpl0000000000000059'
|
||||
},
|
||||
cacheTimeout=>{
|
||||
fieldType=>"interval",
|
||||
defaultValue=>0
|
||||
},
|
||||
paginateAfter=>{
|
||||
fieldType=>"integer",
|
||||
defaultValue=>50
|
||||
|
|
@ -170,6 +175,13 @@ sub getEditForm {
|
|||
-hoverHelp=>$i18n->get('16 description'),
|
||||
-value=>$self->getValue("debugMode")
|
||||
);
|
||||
$tabform->getTab("display")->interval(
|
||||
-name=>"cacheTimeout",
|
||||
-label=>$i18n->get('cache timeout'),
|
||||
-hoverHelp=>$i18n->get('cache timeout description'),
|
||||
-uiLevel => 8,
|
||||
-value=>$self->getValue("cacheTimeout")
|
||||
);
|
||||
|
||||
# Add toggleQuery javascript
|
||||
$tabform->getTab("properties")->raw(qq|
|
||||
|
|
@ -279,9 +291,27 @@ sub prepareView {
|
|||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 purgeCache ()
|
||||
|
||||
See WebGUI::Asset::purgeCache() for details.
|
||||
|
||||
=cut
|
||||
|
||||
sub purgeCache {
|
||||
my $self = shift;
|
||||
WebGUI::Cache->new($self->session,"view_".$self->getId)->delete;
|
||||
$self->SUPER::purgeCache;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub view {
|
||||
my $self = shift;
|
||||
if (!$self->session->var->isAdminOn && $self->get("cacheTimeout") > 10) {
|
||||
my $out = WebGUI::Cache->new($self->session,"view_".$self->getId)->get;
|
||||
return $out if $out;
|
||||
}
|
||||
# Initiate an empty debug loop
|
||||
$self->{_debug_loop} = [] ;
|
||||
|
||||
|
|
@ -294,7 +324,11 @@ sub view {
|
|||
# Add debug loop to template vars
|
||||
$var->{'debug_loop'} = $self->{_debug_loop};
|
||||
#use Data::Dumper; return '<pre>'.Dumper($var).'</pre>';
|
||||
return $self->processTemplate($var, undef, $self->{_viewTemplate});
|
||||
my $out = $self->processTemplate($var,undef,$self->{_viewTemplate});
|
||||
if (!$self->session->var->isAdminOn && $self->get("cacheTimeout") > 10) {
|
||||
WebGUI::Cache->new($self->session,"view_".$self->getId)->set($out,$self->get("visitorCacheTimeout"));
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -463,16 +463,5 @@ sub www_displayStock {
|
|||
return $self->processTemplate($var, $self->get("displayTemplateId"));
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 www_view ( )
|
||||
|
||||
Overwrite www_view method and call the superclass object, passing in a 1 to disable cache
|
||||
|
||||
=cut
|
||||
|
||||
sub www_view {
|
||||
my $self = shift;
|
||||
$self->SUPER::www_view(1);
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
|
|||
|
|
@ -1213,18 +1213,6 @@ sub www_respond {
|
|||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 www_view ( )
|
||||
|
||||
Overwrite www_view method and call the superclass object, passing in a 1 to disable cache
|
||||
|
||||
=cut
|
||||
|
||||
sub www_view {
|
||||
my $self = shift;
|
||||
$self->SUPER::www_view(1);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_viewGradebook {
|
||||
my $self = shift;
|
||||
|
|
|
|||
|
|
@ -69,6 +69,14 @@ sub definition {
|
|||
tie %properties, 'Tie::IxHash';
|
||||
my $i18n = WebGUI::International->new($session,'Asset_SyndicatedContent');
|
||||
%properties = (
|
||||
cacheTimeout => {
|
||||
tab => "display",
|
||||
fieldType => "interval",
|
||||
defaultValue => 3600,
|
||||
uiLevel => 8,
|
||||
label => $i18n->get("cache timeout"),
|
||||
hoverHelp => $i18n->get("cache timeout help")
|
||||
},
|
||||
templateId =>{
|
||||
tab=>"display",
|
||||
fieldType=>'template',
|
||||
|
|
@ -485,6 +493,20 @@ sub prepareView {
|
|||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 purgeCache ()
|
||||
|
||||
See WebGUI::Asset::purgeCache() for details.
|
||||
|
||||
=cut
|
||||
|
||||
sub purgeCache {
|
||||
my $self = shift;
|
||||
WebGUI::Cache->new($self->session,"view_".$self->getId)->delete;
|
||||
$self->SUPER::purgeCache;
|
||||
}
|
||||
|
||||
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
=head2 view()
|
||||
|
||||
|
|
@ -494,9 +516,11 @@ Returns the rendered output of the wobject.
|
|||
|
||||
sub view {
|
||||
my $self = shift;
|
||||
if (!$self->session->var->isAdminOn && $self->get("cacheTimeout") > 10) {
|
||||
my $out = WebGUI::Cache->new($self->session,"view_".$self->getId)->get;
|
||||
return $out if $out;
|
||||
}
|
||||
my $rssFlavor = shift;
|
||||
$self->logView() if ($self->session->setting->get("passiveProfilingEnabled"));
|
||||
|
||||
my $maxHeadlines = $self->get('maxHeadlines') || 1000000;
|
||||
my @urls = split(/\s+/,$self->get('rssUrl'));
|
||||
return $self->processTemplate({},$self->get('templateId')) unless (scalar(@urls));
|
||||
|
|
@ -535,7 +559,11 @@ sub view {
|
|||
return $rss;
|
||||
|
||||
} else {
|
||||
return $self->processTemplate(\%var,undef, $self->{_viewTemplate});
|
||||
my $out = $self->processTemplate(\%var,undef,$self->{_viewTemplate});
|
||||
if (!$self->session->var->isAdminOn && $self->get("cacheTimeout") > 10) {
|
||||
WebGUI::Cache->new($self->session,"view_".$self->getId)->set($out,$self->get("cacheTimeout"));
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -186,19 +186,4 @@ adminConsole views.
|
|||
# WebGUI::International::get("edit_title","NewWobject"));
|
||||
#}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 www_view ( )
|
||||
|
||||
Override www_view method and call the superclass's object method, passing
|
||||
in a 1 to disable wobject-level cache. Only use this method if you want
|
||||
to explicitly disable caching, or do something else when /yourWobjectUrl?func=view or just /yourWobjectUrl is requested.
|
||||
|
||||
=cut
|
||||
|
||||
sub www_view {
|
||||
my $self = shift;
|
||||
return $self->SUPER::www_view(1);
|
||||
# default: return $self->SUPER::www_view();
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
|
|||
|
|
@ -158,22 +158,6 @@ sub www_editBranch {
|
|||
-afterEdit=>'op=editPage;npp='.$self->session->form->process("npp"),
|
||||
-subtext=>'<br />'.$i18n->get("change").' '.WebGUI::Form::yesNo($self->session,{name=>"change_printableStyleTemplateId"})
|
||||
);
|
||||
$tabform->getTab("display")->interval(
|
||||
-name=>"cacheTimeout",
|
||||
-label=>$i18n->get(895),
|
||||
-hoverHelp=>$i18n->get('895 description','Asset_Wobject'),
|
||||
-value=>$self->getValue("cacheTimeout"),
|
||||
-uiLevel=>8,
|
||||
-subtext=>'<br />'.$i18n->get("change").' '.WebGUI::Form::yesNo($self->session,{name=>"change_cacheTimeout"})
|
||||
);
|
||||
$tabform->getTab("display")->interval(
|
||||
-name=>"cacheTimeoutVisitor",
|
||||
-label=>$i18n->get(896),
|
||||
-hoverHelp=>$i18n->get('896 description','Asset_Wobject'),
|
||||
-value=>$self->getValue("cacheTimeoutVisitor"),
|
||||
-uiLevel=>8,
|
||||
-subtext=>'<br />'.$i18n->get("change").' '.WebGUI::Form::yesNo($self->session,{name=>"change_cacheTimeoutVisitor"})
|
||||
);
|
||||
$tabform->addTab("security",$i18n->get(107),6);
|
||||
$tabform->getTab("security")->yesNo(
|
||||
-name=>"encryptPage",
|
||||
|
|
@ -277,8 +261,6 @@ sub www_editBranchSave {
|
|||
$data{displayTitle} = $self->session->form->yesNo("displayTitle") if ($self->session->form->yesNo("change_displayTitle"));
|
||||
$data{styleTemplateId} = $self->session->form->template("styleTemplateId") if ($self->session->form->yesNo("change_styleTemplateId"));
|
||||
$data{printableStyleTemplateId} = $self->session->form->template("printableStyleTemplateId") if ($self->session->form->yesNo("change_printableStyleTemplateId"));
|
||||
$data{cacheTimeout} = $self->session->form->interval("cacheTimeout") if ($self->session->form->yesNo("change_cacheTimeout"));
|
||||
$data{cacheTimeoutVisitor} = $self->session->form->interval("cacheTimeoutVisitor") if ($self->session->form->yesNo("change_cacheTimeoutVisitor"));
|
||||
$data{encryptPage} = $self->session->form->yesNo("encryptPage") if ($self->session->form->yesNo("change_encryptPage"));
|
||||
$data{ownerUserId} = $self->session->form->selectBox("ownerUserId") if ($self->session->form->yesNo("change_ownerUserId"));
|
||||
$data{groupIdView} = $self->session->form->group("groupIdView") if ($self->session->form->yesNo("change_groupIdView"));
|
||||
|
|
|
|||
|
|
@ -96,7 +96,6 @@ sub exportAsHtml {
|
|||
# Change the stuff we need to change to do the export
|
||||
my $session = WebGUI::Session->open($self->session->config->getWebguiRoot, $self->session->config->getFilename);
|
||||
$session->user({userId=>$userId}) unless ($userId eq $self->session->user->userId);
|
||||
$self->{_properties}{cacheTimeout} = $self->{_properties}{cacheTimeoutVisitor} = 1;
|
||||
|
||||
# Generate the page
|
||||
my $content = $self->www_view;
|
||||
|
|
|
|||
|
|
@ -5,6 +5,11 @@ our $HELP = {
|
|||
title => '61',
|
||||
body => '71',
|
||||
fields => [
|
||||
{
|
||||
title => 'cache timeout',
|
||||
namespace => 'Asset_Article',
|
||||
description => 'cache timeout help'
|
||||
},
|
||||
{
|
||||
title => '72',
|
||||
description => 'article template description',
|
||||
|
|
|
|||
|
|
@ -5,6 +5,11 @@ our $HELP = {
|
|||
title => 'collaboration add/edit title',
|
||||
body => 'collaboration add/edit body',
|
||||
fields => [
|
||||
{
|
||||
title => 'visitor cache timeout',
|
||||
namespace => 'Asset_Collaboration',
|
||||
description => 'visitor cache timeout help'
|
||||
},
|
||||
{
|
||||
title => 'display last reply',
|
||||
description => 'display last reply description',
|
||||
|
|
|
|||
|
|
@ -5,6 +5,11 @@ our $HELP = {
|
|||
title => '61',
|
||||
body => '71',
|
||||
fields => [
|
||||
{
|
||||
title => 'visitor cache timeout',
|
||||
namespace => 'Asset_EventsCalendar',
|
||||
description => 'visitor cache timeout help'
|
||||
},
|
||||
{
|
||||
title => '507',
|
||||
description => '507 description',
|
||||
|
|
|
|||
|
|
@ -6,6 +6,11 @@ our $HELP = {
|
|||
title => 'file add/edit title',
|
||||
body => 'file add/edit body',
|
||||
fields => [
|
||||
{
|
||||
title => 'cache timeout',
|
||||
namespace => 'Asset_File',
|
||||
description => 'cache timeout help'
|
||||
},
|
||||
{
|
||||
title => 'new file',
|
||||
description => 'new file description',
|
||||
|
|
|
|||
|
|
@ -6,6 +6,11 @@ our $HELP = {
|
|||
title => 'folder add/edit title',
|
||||
body => 'folder add/edit body',
|
||||
fields => [
|
||||
{
|
||||
title => 'visitor cache timeout',
|
||||
namespace => 'Asset_Folder',
|
||||
description => 'visitor cache timeout help'
|
||||
},
|
||||
{
|
||||
title => 'folder template title',
|
||||
description => 'folder template description',
|
||||
|
|
|
|||
|
|
@ -30,6 +30,11 @@ our $HELP = {
|
|||
description => 'http proxy template title description',
|
||||
namespace => 'Asset_HttpProxy',
|
||||
},
|
||||
{
|
||||
title => 'cache timeout',
|
||||
description => 'cache timeout description',
|
||||
namespace => 'Asset_HttpProxy',
|
||||
},
|
||||
{
|
||||
title => '6',
|
||||
description => '6 description',
|
||||
|
|
|
|||
|
|
@ -5,6 +5,11 @@ our $HELP = {
|
|||
title => 'add/edit help title',
|
||||
body => 'add/edit help body',
|
||||
fields => [
|
||||
{
|
||||
title => 'visitor cache timeout',
|
||||
namespace => 'Asset_Matrix',
|
||||
description => 'visitor cache timeout help'
|
||||
},
|
||||
{
|
||||
title => 'categories',
|
||||
description => 'categories description',
|
||||
|
|
|
|||
|
|
@ -5,6 +5,11 @@ our $HELP = {
|
|||
title => '61',
|
||||
body => '71',
|
||||
fields => [
|
||||
{
|
||||
title => 'visitor cache timeout',
|
||||
namespace => 'Asset_MessageBoard',
|
||||
description => 'visitor cache timeout help'
|
||||
},
|
||||
{
|
||||
title => '73',
|
||||
namespace => 'Asset_MessageBoard',
|
||||
|
|
|
|||
|
|
@ -5,6 +5,11 @@ our $HELP = {
|
|||
title => 'multisearch add/edit title',
|
||||
body => 'multisearch add/edit body',
|
||||
fields => [
|
||||
{
|
||||
title => 'cache timeout',
|
||||
namespace => 'Asset_MultiSearch',
|
||||
description => 'cache timeout help'
|
||||
},
|
||||
{
|
||||
title => 'MultiSearch Template',
|
||||
description => 'MultiSearch Template description',
|
||||
|
|
|
|||
|
|
@ -5,6 +5,11 @@ our $HELP = {
|
|||
title => '38',
|
||||
body => '39',
|
||||
fields => [
|
||||
{
|
||||
title => 'cache timeout',
|
||||
namespace => 'Asset_Product',
|
||||
description => 'cache timeout help'
|
||||
},
|
||||
{
|
||||
title => '62',
|
||||
description => '62 description',
|
||||
|
|
|
|||
|
|
@ -10,6 +10,11 @@ our $HELP = {
|
|||
description => '72 description',
|
||||
namespace => 'Asset_SQLReport',
|
||||
},
|
||||
{
|
||||
title => 'cache timeout',
|
||||
description => 'cache timeout description',
|
||||
namespace => 'Asset_SQLReport',
|
||||
},
|
||||
{
|
||||
title => '16',
|
||||
description => '16 description',
|
||||
|
|
|
|||
|
|
@ -5,6 +5,11 @@ our $HELP = {
|
|||
title => '61',
|
||||
body => '71',
|
||||
fields => [
|
||||
{
|
||||
title => 'cache timeout',
|
||||
namespace => 'Asset_SyndicatedContent',
|
||||
description => 'cache timeout help'
|
||||
},
|
||||
{
|
||||
title => '72',
|
||||
description => '72 description',
|
||||
|
|
|
|||
|
|
@ -52,18 +52,6 @@ our $HELP = {
|
|||
description => '85 description',
|
||||
namespace => 'Asset_Wobject',
|
||||
},
|
||||
{
|
||||
title => '895',
|
||||
description => '895 description',
|
||||
namespace => 'Asset_Wobject',
|
||||
uiLevel => 8,
|
||||
},
|
||||
{
|
||||
title => '896',
|
||||
description => '896 description',
|
||||
namespace => 'Asset_Wobject',
|
||||
uiLevel => 8,
|
||||
},
|
||||
],
|
||||
related => [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,6 +1,16 @@
|
|||
package WebGUI::i18n::English::Asset_Article;
|
||||
|
||||
our $I18N = {
|
||||
'cache timeout' => {
|
||||
message => q|Cache Timeout|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'cache timeout help' => {
|
||||
message => q|Since all users will see this asset the same way, we can cache it for long periods of time to increase performance. How long should we cache it?<br /> <br /><b>UI Level: 8</b>|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'11' => {
|
||||
message => q|(Select "Yes" only if you aren't adding <br> manually.)|,
|
||||
lastUpdated => 1031514049
|
||||
|
|
|
|||
|
|
@ -2,6 +2,16 @@ package WebGUI::i18n::English::Asset_Collaboration;
|
|||
|
||||
our $I18N = {
|
||||
|
||||
'visitor cache timeout' => {
|
||||
message => q|Visitor Cache Timeout|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'visitor cache timeout help' => {
|
||||
message => q|Since all visitors will see this asset the same way, we can cache it to increase performance. How long should we cache it?<br /> <br /><b>UI Level: 8</b>|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'karma rank' => {
|
||||
message => q|Karma Rank|,
|
||||
context => q|a label used in sorting threads by karma divided by karma scale|,
|
||||
|
|
|
|||
|
|
@ -2,6 +2,16 @@ package WebGUI::i18n::English::Asset_EventsCalendar;
|
|||
|
||||
our $I18N = {
|
||||
|
||||
'visitor cache timeout' => {
|
||||
message => q|Visitor Cache Timeout|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'visitor cache timeout help' => {
|
||||
message => q|Since all visitors will see this asset the same way, we can cache it to increase performance. How long should we cache it?<br /> <br /><b>UI Level: 8</b>|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'january' => {
|
||||
message => q|January|,
|
||||
lastUpdated => 1133711787
|
||||
|
|
|
|||
|
|
@ -1,6 +1,16 @@
|
|||
package WebGUI::i18n::English::Asset_File;
|
||||
|
||||
our $I18N = {
|
||||
'cache timeout' => {
|
||||
message => q|Cache Timeout|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'cache timeout help' => {
|
||||
message => q|Since all users will see this asset the same way, we can cache it for long periods of time to increase performance. How long should we cache it?<br /> <br /><b>UI Level: 8</b>|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'file add/edit title' => {
|
||||
message => q|File, Add/Edit|,
|
||||
lastUpdated => 1106683494,
|
||||
|
|
|
|||
|
|
@ -2,6 +2,16 @@ package WebGUI::i18n::English::Asset_Folder;
|
|||
|
||||
our $I18N = {
|
||||
|
||||
'visitor cache timeout' => {
|
||||
message => q|Visitor Cache Timeout|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'visitor cache timeout help' => {
|
||||
message => q|Since all visitors will see this asset the same way, we can cache it to increase performance. How long should we cache it?<br /> <br /><b>UI Level: 8</b>|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'847' => {
|
||||
message => qq|Go back to the current page.|,
|
||||
lastUpdated => 1039587250,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,16 @@
|
|||
package WebGUI::i18n::English::Asset_HttpProxy;
|
||||
|
||||
our $I18N = {
|
||||
'cache timeout description' => {
|
||||
message => q|How long should the proxy cache a page, so that if it's requested again, it won't have to refetch it?|,
|
||||
lastUpdated => 1047837230
|
||||
},
|
||||
|
||||
'cache timeout' => {
|
||||
message => q|Cache Timeout|,
|
||||
lastUpdated => 1047837230
|
||||
},
|
||||
|
||||
'6' => {
|
||||
message => q|Remove style?|,
|
||||
lastUpdated => 1047837230
|
||||
|
|
|
|||
|
|
@ -1,6 +1,16 @@
|
|||
package WebGUI::i18n::English::Asset_Matrix;
|
||||
|
||||
our $I18N = {
|
||||
'visitor cache timeout' => {
|
||||
message => q|Visitor Cache Timeout|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'visitor cache timeout help' => {
|
||||
message => q|Since all visitors will see this asset the same way, we can cache it to increase performance. How long should we cache it?<br /> <br /><b>UI Level: 8</b>|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'comparison template help body' => {
|
||||
lastUpdated => 0,
|
||||
message => q| <p>The following template variables are available in the comparison template.</p>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,16 @@
|
|||
package WebGUI::i18n::English::Asset_MessageBoard;
|
||||
|
||||
our $I18N = {
|
||||
'visitor cache timeout' => {
|
||||
message => q|Visitor Cache Timeout|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'visitor cache timeout help' => {
|
||||
message => q|Since all visitors will see this asset the same way, we can cache it to increase performance. How long should we cache it?<br /> <br /><b>UI Level: 8</b>|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'74' => {
|
||||
message => q|The following is the list of template variables available in message board templates.
|
||||
<p/>
|
||||
|
|
|
|||
|
|
@ -2,6 +2,16 @@ package WebGUI::i18n::English::Asset_MultiSearch;
|
|||
|
||||
our $I18N = {
|
||||
|
||||
'cache timeout' => {
|
||||
message => q|Cache Timeout|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'cache timeout help' => {
|
||||
message => q|Since all users will see this asset the same way, we can cache it for long periods of time to increase performance. How long should we cache it?<br /> <br /><b>UI Level: 8</b>|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'MultiSearch Template' => {
|
||||
message => q|MultiSearch Template|,
|
||||
lastUpdated => 1133619940,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,16 @@
|
|||
package WebGUI::i18n::English::Asset_Product;
|
||||
|
||||
our $I18N = {
|
||||
'cache timeout' => {
|
||||
message => q|Cache Timeout|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'cache timeout help' => {
|
||||
message => q|Since all users will see this asset the same way, we can cache it for long periods of time to increase performance. How long should we cache it?<br /> <br /><b>UI Level: 8</b>|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'33' => {
|
||||
message => q|Related Products|,
|
||||
lastUpdated => 1031514049
|
||||
|
|
|
|||
|
|
@ -1,6 +1,16 @@
|
|||
package WebGUI::i18n::English::Asset_SQLReport;
|
||||
|
||||
our $I18N = {
|
||||
'cache timeout description' => {
|
||||
message => q|How long should we cache the results of the query before fetching it again?|,
|
||||
lastUpdated => 1047837230
|
||||
},
|
||||
|
||||
'cache timeout' => {
|
||||
message => q|Cache Timeout|,
|
||||
lastUpdated => 1047837230
|
||||
},
|
||||
|
||||
'11' => {
|
||||
message => q|<b>Debug:</b> Error: There was a problem with the query.|,
|
||||
lastUpdated => 1031514049
|
||||
|
|
|
|||
|
|
@ -1,6 +1,16 @@
|
|||
package WebGUI::i18n::English::Asset_SyndicatedContent;
|
||||
|
||||
our $I18N = {
|
||||
'cache timeout' => {
|
||||
message => q|Cache Timeout|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'cache timeout help' => {
|
||||
message => q|Since all users will see this asset the same way, we can cache it for long periods of time to increase performance. How long should we cache it?<br /> <br /><b>UI Level: 8</b>|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'get syndicated content' => {
|
||||
'lastUpdated' => 0,
|
||||
'message' => 'Get Syndicated Content',
|
||||
|
|
|
|||
|
|
@ -77,15 +77,6 @@ is displayed as part of a Layout Asset, the Layout Asset's <b>Style Template</b>
|
|||
lastUpdated => 1119410887,
|
||||
},
|
||||
|
||||
'895 description' => {
|
||||
message => q|The amount of time this page should remain cached for registered users.|,
|
||||
lastUpdated => 1119410887,
|
||||
},
|
||||
|
||||
'896 description' => {
|
||||
message => q|The amount of time this page should remain cached for visitors.|,
|
||||
lastUpdated => 1119410887,
|
||||
},
|
||||
|
||||
'42' => {
|
||||
lastUpdated => 1031514049,
|
||||
|
|
@ -111,14 +102,6 @@ is displayed as part of a Layout Asset, the Layout Asset's <b>Style Template</b>
|
|||
lastUpdated => 1031514049,
|
||||
message => q|Description|
|
||||
},
|
||||
'895' => {
|
||||
lastUpdated => 1056292971,
|
||||
message => q|Cache Timeout|
|
||||
},
|
||||
'896' => {
|
||||
lastUpdated => 1056292980,
|
||||
message => q|Cache Timeout (Visitors)|
|
||||
},
|
||||
'664' => {
|
||||
lastUpdated => 1031514049,
|
||||
message => q|Wobject, Delete|
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue