use of org.olat.modules.fo.restapi.ForumWebService in project openolat by klemens.
the class CourseGroupWebService method getForum.
/**
* Return the Forum web service
* @param groupKey The key of the group
* @param request The HTTP Request
* @return
*/
@Path("{groupKey}/forum")
public ForumWebService getForum(@PathParam("groupKey") Long groupKey, @Context HttpServletRequest request) {
BusinessGroupService bgs = CoreSpringFactory.getImpl(BusinessGroupService.class);
BusinessGroup bg = bgs.loadBusinessGroup(groupKey);
if (bg == null) {
return null;
}
if (!isGroupManager(request)) {
Identity identity = RestSecurityHelper.getIdentity(request);
if (!bgs.isIdentityInBusinessGroup(identity, bg)) {
return null;
}
}
CollaborationTools collabTools = CollaborationToolsFactory.getInstance().getOrCreateCollaborationTools(bg);
if (collabTools.isToolEnabled(CollaborationTools.TOOL_FORUM)) {
Forum forum = collabTools.getForum();
return new ForumWebService(forum);
}
return null;
}
use of org.olat.modules.fo.restapi.ForumWebService in project OpenOLAT by OpenOLAT.
the class CourseGroupWebService method getForum.
/**
* Return the Forum web service
* @param groupKey The key of the group
* @param request The HTTP Request
* @return
*/
@Path("{groupKey}/forum")
public ForumWebService getForum(@PathParam("groupKey") Long groupKey, @Context HttpServletRequest request) {
BusinessGroupService bgs = CoreSpringFactory.getImpl(BusinessGroupService.class);
BusinessGroup bg = bgs.loadBusinessGroup(groupKey);
if (bg == null) {
return null;
}
if (!isGroupManager(request)) {
Identity identity = RestSecurityHelper.getIdentity(request);
if (!bgs.isIdentityInBusinessGroup(identity, bg)) {
return null;
}
}
CollaborationTools collabTools = CollaborationToolsFactory.getInstance().getOrCreateCollaborationTools(bg);
if (collabTools.isToolEnabled(CollaborationTools.TOOL_FORUM)) {
Forum forum = collabTools.getForum();
return new ForumWebService(forum);
}
return null;
}
use of org.olat.modules.fo.restapi.ForumWebService in project OpenOLAT by OpenOLAT.
the class LearningGroupWebService method getForum.
/**
* Return the Forum web service
* @param groupKey The key of the group
* @param request The HTTP Request
* @return
*/
@Path("{groupKey}/forum")
public ForumWebService getForum(@PathParam("groupKey") Long groupKey, @Context HttpServletRequest request) {
BusinessGroupService bgs = CoreSpringFactory.getImpl(BusinessGroupService.class);
BusinessGroup bg = CoreSpringFactory.getImpl(BusinessGroupService.class).loadBusinessGroup(groupKey);
if (bg == null) {
return null;
}
if (!isGroupManager(request)) {
Identity identity = RestSecurityHelper.getIdentity(request);
if (!bgs.isIdentityInBusinessGroup(identity, bg)) {
return null;
}
}
CollaborationTools collabTools = CollaborationToolsFactory.getInstance().getOrCreateCollaborationTools(bg);
if (collabTools.isToolEnabled(CollaborationTools.TOOL_FORUM)) {
Forum forum = collabTools.getForum();
return new ForumWebService(forum);
}
return null;
}
use of org.olat.modules.fo.restapi.ForumWebService in project openolat by klemens.
the class LearningGroupWebService method getForum.
/**
* Return the Forum web service
* @param groupKey The key of the group
* @param request The HTTP Request
* @return
*/
@Path("{groupKey}/forum")
public ForumWebService getForum(@PathParam("groupKey") Long groupKey, @Context HttpServletRequest request) {
BusinessGroupService bgs = CoreSpringFactory.getImpl(BusinessGroupService.class);
BusinessGroup bg = CoreSpringFactory.getImpl(BusinessGroupService.class).loadBusinessGroup(groupKey);
if (bg == null) {
return null;
}
if (!isGroupManager(request)) {
Identity identity = RestSecurityHelper.getIdentity(request);
if (!bgs.isIdentityInBusinessGroup(identity, bg)) {
return null;
}
}
CollaborationTools collabTools = CollaborationToolsFactory.getInstance().getOrCreateCollaborationTools(bg);
if (collabTools.isToolEnabled(CollaborationTools.TOOL_FORUM)) {
Forum forum = collabTools.getForum();
return new ForumWebService(forum);
}
return null;
}
Aggregations