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 Summary
FieldsModifier and TypeFieldDescriptionprotected NotificationService
protected SocialServices
protected UGCService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected String
context()
Gets current context.protected String
getContentType
(String filename) Gets the content type of the file based on the file extension.protected org.craftercms.profile.api.Profile
Gets Current User profile.parseAttributes
(String attributes) Parse the json String to a map.protected String
userId()
Current user id.
-
Field Details
-
notificationService
-
ugcService
-
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
Gets current context.- Returns:
- current context, never null.
-
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
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.
-
socialServices