Class AbstractCommentsController<T extends SocialUgc>

java.lang.Object
org.craftercms.social.controllers.rest.v3.comments.AbstractCommentsController<T>
Direct Known Subclasses:
AttachmentsController, CommentsController, VotesControllerController

@Controller @RequestMapping("/api/3/comments") public class AbstractCommentsController<T extends SocialUgc> extends Object
Generic Information about all Comments related Rest Services
  • Field Details

  • Constructor Details

    • AbstractCommentsController

      public AbstractCommentsController()
  • Method Details

    • parseAttributes

      protected Map<String,Object> parseAttributes(String attributes) throws org.springframework.web.bind.MissingServletRequestParameterException
      Parse the json String to a map.
      Parameters:
      attributes - Json String to parse.
      Returns:
      A map with the values of the JSON String
      Throws:
      org.springframework.web.bind.MissingServletRequestParameterException - If String can't be parsed.
    • context

      protected String context()
      Gets current context.
      Returns:
      current context, never null.
    • userId

      protected String userId()
      Current user id.
      Returns:
      Current User Id, Empty if a user is not logged.
    • getCurrentProfile

      protected org.craftercms.profile.api.Profile getCurrentProfile()
      Gets Current User profile.
      Returns:
      Profile of current Logged User.
    • getContentType

      protected String getContentType(String filename)
      Gets the content type of the file based on the file extension.
      Parameters:
      filename - File name to check.
      Returns:
      Content Type of the file based on filename.