[pmwiki-users] Global Delete all orphaned pages in a group
katir at hindu.org
Tue Feb 13 04:11:25 CST 2007
I've set up a kind of calendar (simple list
of dates, one per line all on on page) for visitors
where those responsible for people traveling to our place
here are entered in the wiki and sometimes they will
add more info by linking the name of the guests
->[[Patrick Michaud]] will be visiting from Texas, please
roll out the red carpet and give him a grand tour.
->[[Kathryn Anderson]] is flying in to give a Cluster Demo
It's a very simple, efficient, low over head system
(I've used it for years in my own PIM software
built in another program)
But "extra info" pages for visitors "VisitorCare.PatrickMichaud"
are highly ephemeral. Over time you just chop off the top of the calendar
and with them the links to the extra info page.
Now, we don't want old visitor info pages showing up or
accessed in pages lists after the visitor has come and gone.
So, what we will have is a lot of "orphaned"
pages in the group, like this:
which have no back links at all on any other page in the wiki.
because after PM visits, the lines with the links on the
main calendar page will be deleted.
Is there a way to rapidly delete all pages which have no
back links... but only for a specified group? We *can* ask
users to delete such page, but it's tricky because if you forget
then you the only way to tell if "VisitorCare.PatrickMichaud" is
orphaned or not would be to scan down the calendar for the year.
If you had lots of such pages, it could get messy.
So, I need a global "delete all orphans in this group"
Is there such a recipe? I could write my own external CGI for this
as I think I can quickly parses all the pages in VisitorCare.* and
if none contain a link to "PatrickMichaud" then it gets deleted.
and put this on a daily cron...
I have to be careful as there are other groups where new pages
are created by users who simply edit the URL and don't use a wiki
link as such... in those groups, the page that has no back link is
a valid document, integral to the group.
I guess it would be some kind of CGI action?
More information about the pmwiki-users