From d085d7d04a7381dfef599d44a7faaf0e10237efc Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Wed, 21 Apr 2010 16:55:16 -0700 Subject: [PATCH] Revoke the previous page-level hierarchial keywords work, in favor of forthcoming work on wiki level keywords work --- docs/changelog/7.x.x.txt | 1 + .../packages-7.9.4/default-wiki-page.wgpkg | Bin 0 -> 2341 bytes lib/WebGUI/Asset/WikiPage.pm | 24 -------- lib/WebGUI/Help/Asset_WikiPage.pm | 11 ---- lib/WebGUI/i18n/English/Asset_WikiPage.pm | 24 -------- t/Asset/WikiPage.t | 54 +----------------- 6 files changed, 2 insertions(+), 112 deletions(-) create mode 100644 docs/upgrades/packages-7.9.4/default-wiki-page.wgpkg diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index b3d8e194a..16e0043aa 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -1,5 +1,6 @@ 7.9.4 - fixed #11535: i18n - Asset_MapPoint - Tag form_fax - wrong text + - Implement hierarchial keywords differently. 7.9.3 - added #11477: No synopsis in asset now means no synopsis in search index diff --git a/docs/upgrades/packages-7.9.4/default-wiki-page.wgpkg b/docs/upgrades/packages-7.9.4/default-wiki-page.wgpkg new file mode 100644 index 0000000000000000000000000000000000000000..23ff7651a4be99d9e109343848f0be5631640673 GIT binary patch literal 2341 zcmV+=3EK7_iwFP!00000|Lt0BQyV!F=JWmv9s2=8VUNv=owFTRk++4~?1sIN%U#7; zN}dt6U@T3IWE>yMf8TCthYPFtzB&V_Q^iQ+d>~sz{Hk!>= z=dg+IX6xW!V}mT8=0>Zv-`?-En$31=gS1-B*4_qzAy5Czl%^@T6v~*3tM&F~ilu73 z7$*gfnVfmw(e>{nGG0U2;W57t56tJo#-)Ekoo1)B{s;T5&IW;K zKK=7l>)&{K*B`^e%@42%H#M6kG1csxYE8q*lnJdiNtb;3yldo2%ao3p-;|^>VX5ZK zbTn#EQ%se9{Uwp9X3>!miCG*QEhr9C24?U^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R6Sxb$_U~%}TW4oq<6A;gU~0yrHG%JTkI#O2ySfZqy*2gD-Xs_9n7PWLQJ$&4 z7*@8oxA&~Mf7tP^lv8%ik#WJkw)3u96DZNZdY5UC2OGX6ve(e=Qrg(@)T@b{pNKay zo!a1e;TDjCDxsk@iz``NNG8H`k!aIsvM)F5xTCdgY%a0-p$u{@e>9-s@ib95cillsVmzmG*E0{tFIIbCJ=@yNNd$5TU<|kL1Dqh(`TTjX6TlJIeD_m4 z2|PI!AYQd!sk@#mFTK^2;%+8Tl-{e$)%z8PoFLawCIXs{vs3*ApT3y=Jeu$EpWZCm zd((F<-MO6SP|DT&1+dy_8MwK!Uu#wsN>ekI-)ef0Zocj;6q8o_@Su(V42k_V$O{$M`DvyN>S>_#T1(vk3eN L{%_mC044wcgSLK0 literal 0 HcmV?d00001 diff --git a/lib/WebGUI/Asset/WikiPage.pm b/lib/WebGUI/Asset/WikiPage.pm index 6f9a4000e..e125c4bc6 100644 --- a/lib/WebGUI/Asset/WikiPage.pm +++ b/lib/WebGUI/Asset/WikiPage.pm @@ -309,35 +309,11 @@ sub getTemplateVars { $self->scrubContent, {skipTitles => [$self->get('title')]}, ), - isKeywordPage => $self->isKeywordPage, isSubscribed => $self->isSubscribed, subscribeUrl => $self->getSubscribeUrl, unsubscribeUrl => $self->getUnsubscribeUrl, owner => $owner->get('alias'), }; - my @keyword_pages = (); - if ($var->{isKeywordPage}) { - my $paginator = $keyObj->getMatchingAssets({ - startAsset => $self->getWiki, - keyword => $self->get('title'), - usePaginator => 1, - }); - PAGE: foreach my $assetId (@{ $paginator->getPageData }) { - next PAGE if $assetId->{assetId} eq $self->getId; - my $asset = WebGUI::Asset->newByDynamicClass($session, $assetId->{assetId}); - next PAGE unless $asset; - push @keyword_pages, { - title => $asset->getTitle, - url => $asset->getUrl, - }; - } - $paginator->appendTemplateVars($var); - @keyword_pages = map { $_->[1] } - sort - map { [ lc $_->{title}, $_ ] } - @keyword_pages; - } - $var->{keyword_page_loop} = \@keyword_pages; return $var; } diff --git a/lib/WebGUI/Help/Asset_WikiPage.pm b/lib/WebGUI/Help/Asset_WikiPage.pm index dc11d5976..15016cdbd 100644 --- a/lib/WebGUI/Help/Asset_WikiPage.pm +++ b/lib/WebGUI/Help/Asset_WikiPage.pm @@ -107,17 +107,6 @@ our $HELP = { name => 'owner', description => 'help owner', }, - { 'name' => 'isKeywordPage', }, - { 'name' => 'keyword_page_loop', - 'variables' => [ - { 'name' => 'title', - 'description' => 'keyword page title', - }, - { 'name' => 'url', - 'description' => 'keyword page url', - }, - ], - }, ], related => [], }, diff --git a/lib/WebGUI/i18n/English/Asset_WikiPage.pm b/lib/WebGUI/i18n/English/Asset_WikiPage.pm index 0c1663dbe..cddfe3b7a 100644 --- a/lib/WebGUI/i18n/English/Asset_WikiPage.pm +++ b/lib/WebGUI/i18n/English/Asset_WikiPage.pm @@ -333,30 +333,6 @@ our $I18N = context => 'Label for asset property', }, - 'isKeywordPage' => { - message => q{A boolean that is true if this page is a keyword page.}, - lastUpdated => 0, - context => 'template variable help', - }, - - 'keyword_page_loop' => { - message => q{If this page is a keyword page, then this loop will contain a list of all pages tagged with this page's keyword. The pagination variables will apply to the list of pages in this loop. If this page is not a keyword page, the loop will be blank, and the pagination variables will not be present.}, - lastUpdated => 0, - context => 'template variable help', - }, - - 'keyword page title' => { - message => q{The title of a page that has this keyword.}, - lastUpdated => 0, - context => 'template variable help', - }, - - 'keyword page url' => { - message => q{The URL to a page that has this keyword. The URL will have the gateway URL prepended to it.}, - lastUpdated => 0, - context => 'template variable help', - }, - }; 1; diff --git a/t/Asset/WikiPage.t b/t/Asset/WikiPage.t index 3a92d7e00..79815baaa 100644 --- a/t/Asset/WikiPage.t +++ b/t/Asset/WikiPage.t @@ -16,7 +16,7 @@ use lib "$FindBin::Bin/../lib"; use WebGUI::Test; use WebGUI::Session; -use Test::More tests => 29; # increment this value for each test you create +use Test::More tests => 17; # increment this value for each test you create use Test::Deep; use WebGUI::Asset::Wobject::WikiMaster; use WebGUI::Asset::WikiPage; @@ -91,55 +91,3 @@ $comments = $wikipage->get('comments'); is($comments->[0]{comment}, $secondComment, "you can delete a comment"); is($wikipage->get('averageCommentRating'), 1, 'average rating is adjusted after deleting a comment'); - -################## -# This section tests hierarchical keywords support -################## - -# -## setup some more wiki pages -my $properties = { - className=>'WebGUI::Asset::WikiPage', - content => 'Now is the time for all good men to come to the aid of their country', - title => 'Keyword', - keywords => 'keyword' -}; -my $wikipage2 = $wiki->addChild($properties, @autoCommitCoda); -isa_ok($wikipage2, 'WebGUI::Asset::WikiPage'); - -$properties = { - className=>'WebGUI::Asset::WikiPage', - content => 'The quick brown fox jumps over the lazy dog.', - title => 'Fox', - keywords => 'keyword' -}; -my $wikipage3 = $wiki->addChild($properties, @autoCommitCoda); -isa_ok($wikipage3, 'WebGUI::Asset::WikiPage'); - -# Test keywords support -my $keywords = $wikipage2->get('keywords'); -is($keywords,$properties->{'keywords'}, 'Keywords match'); - -# Test isKeywordPage() -ok $wikipage2->isKeywordPage(), "'".$wikipage2->get('title')."' is a keyword page"; -my $templateVars = $wikipage2->getTemplateVars; -ok $templateVars->{isKeywordPage}, 'isKeywordPage template var, true'; -cmp_deeply - $templateVars->{keyword_page_loop}, - [ - { title => 'Fox', url => '/wikitest/fox', }, - ], - 'populated keyword_page_loop, sorted by title'; -ok ! $wikipage3->isKeywordPage(), "'".$wikipage3->get('title')."' is not a keyword page"; -$templateVars = $wikipage3->getTemplateVars; -ok ! $templateVars->{isKeywordPage}, 'isKeywordPage template var, false'; -cmp_deeply $templateVars->{keyword_page_loop}, [], 'empty keyword_page_loop'; - -$wikipage3->update({keywords => $wikipage3->get('keywords').',Fox'}); -ok $wikipage3->isKeywordPage(), "'".$wikipage3->get('title')."' is now a keyword page"; -$templateVars = $wikipage3->getTemplateVars; -ok $templateVars->{isKeywordPage}, 'isKeywordPage template var, false'; -cmp_deeply - $templateVars->{keyword_page_loop}, - [ ], - 'empty keyword_page_loop, self is not put into the loop';