Class CommentsController<T extends SocialUgc>
- java.lang.Object
-
- org.craftercms.social.controllers.rest.v3.comments.AbstractCommentsController
-
- org.craftercms.social.controllers.rest.v3.comments.CommentsController<T>
-
@Controller public class CommentsController<T extends SocialUgc> extends AbstractCommentsController
-
-
Field Summary
-
Fields inherited from class org.craftercms.social.controllers.rest.v3.comments.AbstractCommentsController
notificationService, socialServices, ugcService
-
-
Constructor Summary
Constructors Constructor Description CommentsController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addAttributes(@NotBlank String id, Map<String,Object> attributes)
Iterable<T>
byStatus(ModerationStatus status, String thread, int pageNumber, int pageSize, List<String> sortBy, List<SocialSortOrder> sortOrder)
long
byStatusCount(ModerationStatus status, String thread)
protected boolean
checkAnonymous(boolean anonymous)
T
create(String body, String thread, String parent, boolean anonymous, String subject, String attributes, org.springframework.web.multipart.MultipartFile attachment)
boolean
delete(String id)
boolean
deletePost(String id)
Iterable<T>
flagged(int pageNumber, int pageSize, List<String> sortBy, List<SocialSortOrder> sortOrder)
long
flaggedCount(int pageNumber, int pageSize, List<String> sortBy, List<SocialSortOrder> sortOrder)
Iterable<Flag>
flagUgc(String id)
T
flagUgc(String id, String reason)
T
moderate(String id, ModerationStatus status)
T
read(String id)
Iterable<T>
read(String search, String sortBy, int start, int limit)
boolean
removeAttributes(String id, String attributes)
boolean
removeAttributesPost(String id, String attributes)
boolean
unflagUgc(String id, String flagId)
T
update(String id, String body, String attributes)
T
updatePost(String id, String body, String attributes)
-
Methods inherited from class org.craftercms.social.controllers.rest.v3.comments.AbstractCommentsController
context, getContentType, getCurrentProfile, parseAttributes, userId
-
-
-
-
Method Detail
-
create
@RequestMapping(method=POST) @ResponseBody public T create(@RequestParam String body, @RequestParam String thread, @RequestParam(required=false,defaultValue="") String parent, @RequestParam(required=false,defaultValue="false",value="anonymous") boolean anonymous, @RequestParam(required=false,defaultValue="",value="subject") String subject, @RequestParam(required=false,defaultValue="{}") String attributes, org.springframework.web.multipart.MultipartFile attachment) throws SocialException, org.springframework.web.bind.MissingServletRequestParameterException, IOException
- Throws:
SocialException
org.springframework.web.bind.MissingServletRequestParameterException
IOException
-
update
@RequestMapping(value="{id}", method=PUT) @ResponseBody public T update(@PathVariable("id") String id, @RequestParam String body, @RequestParam(required=false,defaultValue="{}") String attributes) throws SocialException, org.springframework.web.bind.MissingServletRequestParameterException, UGCNotFound
- Throws:
SocialException
org.springframework.web.bind.MissingServletRequestParameterException
UGCNotFound
-
updatePost
@RequestMapping(value="{id}/update", method=POST) @ResponseBody public T updatePost(@PathVariable("id") String id, @RequestParam String body, @RequestParam(required=false,defaultValue="{}") String attributes) throws SocialException, org.springframework.web.bind.MissingServletRequestParameterException, UGCNotFound
- Throws:
SocialException
org.springframework.web.bind.MissingServletRequestParameterException
UGCNotFound
-
delete
@RequestMapping(value="{id}", method=DELETE) @ResponseBody public boolean delete(@PathVariable("id") String id) throws SocialException
- Throws:
SocialException
-
deletePost
@RequestMapping(value="{id}/delete", method=POST) @ResponseBody public boolean deletePost(@PathVariable("id") String id) throws SocialException
- Throws:
SocialException
-
read
@RequestMapping(value="{id}", method=GET) @ResponseBody public T read(@PathVariable("id") String id) throws SocialException
- Throws:
SocialException
-
read
@RequestMapping(value="/search", method=POST) @ResponseBody public Iterable<T> read(@RequestParam String search, @RequestParam String sortBy, @RequestParam int start, @RequestParam int limit) throws SocialException
- Throws:
SocialException
-
addAttributes
@RequestMapping(value="{id}/attributes", method={POST,PUT}, consumes="application/x-www-form-urlencoded") @ResponseBody public boolean addAttributes(@NotBlank @PathVariable("id") @NotBlank String id, @RequestParam Map<String,Object> attributes) throws SocialException, UGCNotFound
- Throws:
SocialException
UGCNotFound
-
removeAttributes
@RequestMapping(value="{id}/attributes", method=DELETE) @ResponseBody public boolean removeAttributes(@PathVariable("id") String id, @RequestParam String attributes) throws SocialException
- Throws:
SocialException
-
removeAttributesPost
@RequestMapping(value="{id}/attributes/delete", method=POST) @ResponseBody public boolean removeAttributesPost(@PathVariable("id") String id, @RequestParam String attributes) throws SocialException
- Throws:
SocialException
-
flagUgc
@RequestMapping(value="{id}/flags", method=POST) @ResponseBody public T flagUgc(@PathVariable("id") String id, @RequestParam String reason) throws SocialException
- Throws:
SocialException
-
flagUgc
@RequestMapping(value="{id}/flags", method=GET) @ResponseBody public Iterable<Flag> flagUgc(@PathVariable("id") String id) throws SocialException
- Throws:
SocialException
-
unflagUgc
@RequestMapping(value="{id}/flags/{flagId}", method={POST,DELETE}) @ResponseBody public boolean unflagUgc(@PathVariable("id") String id, @PathVariable("flagId") String flagId) throws SocialException
- Throws:
SocialException
-
moderate
@RequestMapping(value="{id}/moderate", method={POST,PUT}) @ResponseBody public T moderate(@PathVariable String id, @RequestParam ModerationStatus status) throws SocialException
- Throws:
SocialException
-
byStatus
@RequestMapping(value="moderation/{status}", method=GET) @ResponseBody public Iterable<T> byStatus(@PathVariable("status") ModerationStatus status, @RequestParam(defaultValue="",required=false) String thread, @RequestParam(required=false,defaultValue="0") int pageNumber, @RequestParam(required=false,defaultValue="666") int pageSize, @RequestParam(required=false) List<String> sortBy, @RequestParam(required=false) List<SocialSortOrder> sortOrder) throws UGCException
- Throws:
UGCException
-
flagged
@RequestMapping(value="flagged", method=GET) @ResponseBody public Iterable<T> flagged(@RequestParam(required=false,defaultValue="0") int pageNumber, @RequestParam(required=false,defaultValue="666") int pageSize, @RequestParam(required=false) List<String> sortBy, @RequestParam(required=false) List<SocialSortOrder> sortOrder) throws UGCException
- Throws:
UGCException
-
flaggedCount
@RequestMapping(value="flagged/count", method=GET) @ResponseBody public long flaggedCount(@RequestParam(required=false,defaultValue="0") int pageNumber, @RequestParam(required=false,defaultValue="666") int pageSize, @RequestParam(required=false) List<String> sortBy, @RequestParam(required=false) List<SocialSortOrder> sortOrder) throws UGCException
- Throws:
UGCException
-
byStatusCount
@RequestMapping(value="moderation/{status}/count", method=GET) @ResponseBody public long byStatusCount(@PathVariable("status") ModerationStatus status, @RequestParam(defaultValue="",required=false) String thread) throws UGCException
- Throws:
UGCException
-
checkAnonymous
protected boolean checkAnonymous(boolean anonymous)
-
-