Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

CONF 5.5: how can I use getLatestVersionsOfAttachments() using velocity in a user macro

Stefan Baader January 12, 2015

I want to collect all attachments of a space using the method of the AttachmentManager:

java.util.List<Attachment>getLatestVersionsOfAttachments(ContentEntityObject content)

BHow can I define the content entitiy object (here the space?) to run the method?
My approach is this:

# @noparams
#set( $allSpaces = $spaceManager.getAllSpaces()  )
#foreach( $s in $allSpaces  )
  &lt;li&gt;$attachmentManager.getLatestVersionsOfAttachments $s )
#end

BBut this doesn't work.

2 answers

1 vote
Alex Medved _ConfiForms_
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 12, 2015
0 votes
Davin Studer
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 12, 2015

 Well, $attachmentManager.getLatestVersionsOfAttachments will only get attachments for a ContentEntityObject ... page, blogpost, etc. It will not get you attachments for a space. Another way to get this would be the REST API. You could use the below ...

http://{yourserver}/rest/searchv3/1.0/search?where={spacekey}&amp;spaceSearch=true&amp;queryString=type:attachment


Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events