Class AbstractCommentsController<T extends SocialUgc>

    • Constructor Detail

      • AbstractCommentsController

        public AbstractCommentsController()
    • Method Detail

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