Search in sources :

Example 1 with GroupWikiWebService

use of org.olat.modules.wiki.restapi.GroupWikiWebService in project OpenOLAT by OpenOLAT.

the class LearningGroupWebService method getWiki.

/**
 * Return the Forum web service
 * @param groupKey The key of the group
 * @param request The HTTP Request
 * @return
 */
@Path("{groupKey}/wiki")
public GroupWikiWebService getWiki(@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_WIKI)) {
        return new GroupWikiWebService(bg);
    }
    return null;
}
Also used : BusinessGroupService(org.olat.group.BusinessGroupService) BusinessGroup(org.olat.group.BusinessGroup) GroupWikiWebService(org.olat.modules.wiki.restapi.GroupWikiWebService) CollaborationTools(org.olat.collaboration.CollaborationTools) Identity(org.olat.core.id.Identity) Path(javax.ws.rs.Path)

Example 2 with GroupWikiWebService

use of org.olat.modules.wiki.restapi.GroupWikiWebService in project openolat by klemens.

the class LearningGroupWebService method getWiki.

/**
 * Return the Forum web service
 * @param groupKey The key of the group
 * @param request The HTTP Request
 * @return
 */
@Path("{groupKey}/wiki")
public GroupWikiWebService getWiki(@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_WIKI)) {
        return new GroupWikiWebService(bg);
    }
    return null;
}
Also used : BusinessGroupService(org.olat.group.BusinessGroupService) BusinessGroup(org.olat.group.BusinessGroup) GroupWikiWebService(org.olat.modules.wiki.restapi.GroupWikiWebService) CollaborationTools(org.olat.collaboration.CollaborationTools) Identity(org.olat.core.id.Identity) Path(javax.ws.rs.Path)

Aggregations

Path (javax.ws.rs.Path)2 CollaborationTools (org.olat.collaboration.CollaborationTools)2 Identity (org.olat.core.id.Identity)2 BusinessGroup (org.olat.group.BusinessGroup)2 BusinessGroupService (org.olat.group.BusinessGroupService)2 GroupWikiWebService (org.olat.modules.wiki.restapi.GroupWikiWebService)2