Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Finding when Pages were Last Updated in a Set of Child Pages

Mick Davidson
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 15, 2014

I'm in the process of archiving pages in a space and am running a date search to find pages that were created between certain dates. For example:

  • modified:[20130101 TO 20130731]

What I would also like to do is run a similar search on a page and all its child pages to find which was the most recently edited.

Is this possible?

In an ideal world, I'd like to be able to find out when each child page was last edited.

At the moment the only way I can see of doing either of these things is by looking manually, which is far too inefficient and tedious given the 1000s of pages I have to check.

Cheers.

3 answers

0 votes
Midori
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 25, 2014

You should automatically generate this report with the Archiving Plugin.

This plugin displays a so-called Content Quality report which will calculate and list the pages not updated in the recent N days. The age of the page is calculated recursively (propagating upwards), this is what you originally asked for, if I'm not mistaken. See a sample report below.

Even better, the plugin will also help you to archive the pages that are not updated and/or not viewed.

And it features a fully automated "set it up and forget it" approach, which scales nicely to thousands of pages.

content-quality-statistics.png

0 votes
Matthew J. Horn
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 15, 2014

Ok, maybe you can try this user macro (put it on all your pages, in a Layout Decorator). You can hide it by wrapping an IF statement around it that checks against a user type (like admin), your username, or some other comparison.

## Macro title: Recently Updated Children
##
## Developed by: Matthew J. Horn
## Date created: 01/16/2014
## Installed by: ______
## Description: Lists all children and their timestamps. Similar to "Recently Updated" macro, except it only applies to child pages of the current page. It's a combination of "Recently Updated" and "Children Display".

## @noparams

#set ($pageListArray = [])
#set ($rootPage = $content)

#macro ( process $rp )
## note: Not sure what diff is between getChildren() and getSortedChildren()  -- "sort" is not by timestamp
  #set ($pagelist = $rp.getSortedChildren() )  ## returns List<Page>
  #foreach( $child in $pagelist )
    #set($p = $pageListArray.add( $child ) )
    #if( $child.hasChildren() )
      #process ( $child )
    #end
  #end
#end

#process ( $rootPage )

<table class="confluenceTable">
 <tbody>
 <tr>
  <th class="confluenceTh">Title</th>
  <th class="confluenceTh">Version</th>
  <th class="confluenceTh">Mod Date</th>
  <th class="confluenceTh">Modifier</th>
 </tr>

 #foreach( $child in $pageListArray)   ## child is of type Page
   <tr>
     <td class="confluenceTd">$child.getTitle()</td>
     <td class="confluenceTd">$child.getVersion()</td>
     <td class="confluenceTd">$child.getLastModificationDate()</td>     
     <td class="confluenceTd">$child.getLastModifierName()</td>
   </tr>
 #end 

</tbody>
</table>

Let me know if this does what you want. It sounds like you want to integrate this with a date range search, but I haven't quite gotten my head around how to do that yet.

matt

Matthew J. Horn
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 15, 2014

And a quick note, this does not include sorting in the macro. But tables in Confluence can be sorted on any column with a mouse click, as of Confluence 4.3.something...

Mick Davidson
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 3, 2014

Matthew,

Thanks for all your efforts on this. I've given this to our IT team but we've been having some issues recently (Confluence and non-Confluence) that has meant we still haven't tried it. I'll let you know what happens when we do.

Cheers.

0 votes
Matthew J. Horn
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 15, 2014

For 1,000s of pages, I would definitely look into using the SQL plug-in:

https://marketplace.atlassian.com/plugins/org.swift.confluence.sql

Mick Davidson
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 15, 2014

Thanks Matthew,

Yes, I wasn't clear there was I? :) I mean that in the space there's 1000s of pages, but using my modified search, I'll find a page within a group of related child pages.

Often the head page won't have been edited since it was created, but the others might have been.

So I'm not looking through 1000s in one go, I'm looking at a group that might be ten or twenty strong.

Cheers.

Matthew J. Horn
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 15, 2014

Ok, in that case I would write a User Macro because it sounds like you're going to want to show the your info on many pages (maybe "parent nodes" of small groups of sub pages)?

Lessee, maybe an "illustration" would make this clearer:

http://yuml.me/89832755

In this image, the second "row" (Topics 1, 2, and 3) is where you want to put your macro. Is this about right?

Mick Davidson
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 15, 2014

Matthew,

Yes, that's right. All I want to do is ID the last edited page so I can go straight to it to see who edited it.

The info doesn't need storing or displaying to anyone else. It's all mine... :)

Matthew J. Horn
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 15, 2014

Sorry to keep belaboring the point, but figuring out exactly what you want to do determines the best way to do it. (By best, I mean most performant and easiest...)

If I understand you correctly, you want to ID the last edited page within each "child group" (the Topics 1-3 in the image)? Is that correct?

Are these known pages (do you know the page names or IDs of the pages?), or do you need to sniff them out as well?

Mick Davidson
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 15, 2014

Sorry if I'm not being clear, thanks for sticking with me. :)

"If I understand you correctly, you want to ID the last edited page within each "child group" (the Topics 1-3 in the image)? Is that correct?"

Yes, that's right.

They are known to me because they, the pages, come up in the results from my date search.

Matthew J. Horn
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 15, 2014

Sorry, now I'm the one being unclear: are the parent pages known to you? In other words, Topic 1 is a parent page with 10 child pages. You want to find the most recently edited page of the children of Topic 1, correct? How many "Topic 1s" are there? And do you have a list of them somewhere?

Mick Davidson
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 15, 2014

Yes, but only because I find the child page, then see what the parent is called.

I then check that to see when it was last updated. It's a very manual process. :)

Cheers.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events