@Controller public class AttachmentsController<T extends SocialUgc> extends AbstractCommentsController
| Modifier and Type | Field and Description |
|---|---|
protected org.springframework.core.io.Resource |
mimeFile |
notificationService, socialServices, ugcService| Constructor and Description |
|---|
AttachmentsController() |
| Modifier and Type | Method and Description |
|---|---|
org.craftercms.commons.mongo.FileInfo |
addAttachment(String id,
org.springframework.web.multipart.MultipartFile attachment) |
Iterable<org.craftercms.commons.mongo.FileInfo> |
listAttachments(String id) |
void |
readAttachment(String id,
String attachmentId,
javax.servlet.http.HttpServletResponse response) |
boolean |
removeAttachment(String id,
String attachmentId) |
boolean |
removeAttachmentPost(String id,
String attachmentId) |
boolean |
updateAttachmentPost(String id,
String attachmentId,
org.springframework.web.multipart.MultipartFile file) |
context, getContentType, getCurrentProfile, parseAttributes, userId@Value(value="${studio.social.web.mimeFile}")
protected org.springframework.core.io.Resource mimeFile
@RequestMapping(value="/{id}/attachments",
method=POST)
@ResponseBody
public org.craftercms.commons.mongo.FileInfo addAttachment(@NotBlank @PathVariable(value="id")
String id,
@RequestParam
org.springframework.web.multipart.MultipartFile attachment)
throws SocialException,
IOException
SocialExceptionIOException@RequestMapping(value="/{id}/attachments/{attachmentId}",
method=DELETE)
@ResponseBody
public boolean removeAttachment(@NotBlank @PathVariable(value="id")
String id,
@NotBlank @PathVariable(value="attachmentId")
String attachmentId)
throws SocialException,
IOException
SocialExceptionIOException@RequestMapping(value="/{id}/attachments/{attachmentId}/delete",
method=POST)
@ResponseBody
public boolean removeAttachmentPost(@NotBlank @PathVariable(value="id")
String id,
@NotBlank @PathVariable(value="attachmentId")
String attachmentId)
throws SocialException,
IOException
SocialExceptionIOException@RequestMapping(value="/{id}/attachments/{attachmentId}/update",
method=POST)
@ResponseBody
public boolean updateAttachmentPost(@NotBlank @PathVariable(value="id")
String id,
@NotBlank @PathVariable(value="attachmentId")
String attachmentId,
@RequestParam
org.springframework.web.multipart.MultipartFile file)
throws SocialException,
IOException
SocialExceptionIOException@RequestMapping(value="/{id}/attachments",
method=GET)
@ResponseBody
public Iterable<org.craftercms.commons.mongo.FileInfo> listAttachments(@NotBlank @PathVariable(value="id")
String id)
throws SocialException,
UGCNotFound
SocialExceptionUGCNotFound@RequestMapping(value="/{id}/attachments/{attachmentId}",
method=GET)
@ResponseBody
public void readAttachment(@NotBlank @PathVariable(value="id")
String id,
@NotBlank @PathVariable(value="attachmentId")
String attachmentId,
javax.servlet.http.HttpServletResponse response)
throws SocialException,
IOException
SocialExceptionIOExceptionCopyright © 2019 CrafterCMS. All Rights Reserved.