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
Fields Modifier and Type Field Description protected NotificationService
notificationService
protected SocialServices
socialServices
protected UGCService
ugcService
-
Constructor Summary
Constructors Constructor Description AbstractCommentsController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected 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
getCurrentProfile()
Gets Current User profile.protected Map<String,Object>
parseAttributes(String attributes)
Parse the json String to a map.protected String
userId()
Current user id.
-
-
-
Field Detail
-
socialServices
@Autowired protected SocialServices socialServices
-
notificationService
@Autowired protected NotificationService notificationService
-
ugcService
@Autowired protected UGCService ugcService
-
-
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.
-
-