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
  • Constructor Details

    • CommentsController

      public CommentsController()
  • Method Details

    • 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)