I'm looking for a plug-in whcih should count number of likes and comments added in each page.
Preferably I'm looking for a free plug-in.
Thanks in advance
Vijay Krishna
Hey Vijay,
I made a research on our marketplace and over the internet but I did not found a plugin that fully matched the criterea you want.
The onyl plugin I found was the Global Usage Activity which is bundled in confluence and it's disabled by default.
The pros of Above plugin:
The Cons:
Another option I found to achieve the end you want is trough SQL queries in your database:
Number of likes per Page:
select count (*) as Likes, CONTENTID as PageID from LIKES group by CONTENTID;
Number of Comments per Page
select count (*) as Comments, CONTENTID as PageID from CONTENT where CONTENTTYPE = 'COMMENT' and CONTENT_STATUS = 'current' group by CONTENTID;
The above you return the page ID which you can use in the end of below URL so you can navigate
to the target page (replace 12345 with the PAGE ID of above querries):
http://YourConfluenceURL/pages/viewpage.action?pageId=12345
Servus Vijay,
try this in a UserMacro
## @param Content:title=Content|type=confluence-content|required=true|desc=Select a page #set($containerManagerClass = $content.class.forName('com.atlassian.spring.container.ContainerManager')) #set($getInstanceMethod = $containerManagerClass.getDeclaredMethod('getInstance',null)) #set($containerManager = $getInstanceMethod.invoke(null,null)) #set($containerContext = $containerManager.containerContext) #set($pageManager = $containerContext.getComponent('pageManager')) #set($likeManager = $containerContext.getComponent('likeManager')) #if($paramContent) #set($parts = $paramContent.split(":")) #set($spaceKey = "") #set($pageTitle = "") #set($valueCount = 0) #foreach($part in $parts) #if($valueCount == 0) #set($spaceKey=$part) #else #set($pageTitle=$part) #end #set($valueCount=$valueCount+1) #end #if($valueCount <= 1) #set($pageTitle=$spaceKey) #set($spaceKey=$space.getKey() ) #end #set($page = $pageManager.getPage($spaceKey,$pageTitle)) #end #set($likes = $likeManager.getLikes($page).size() ) #set($comments = $page.getComments().size() ) LIKES: $likes<br> COMMENTS: $comments<br>
Hope that helps
Wolfgang
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Wolfgang,
It's working but I want to have the likes and comments count in each page of a space.
Is there any poosibility like If i give the apce name.It should print all the count of likes,comments in each page of that space.
Thanks
Vijay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.