Search in sources :

Example 1 with OpenMeetingsModule

use of org.olat.modules.openmeetings.OpenMeetingsModule in project OpenOLAT by OpenOLAT.

the class CollaborationTools method deleteTools.

/**
 * delete all CollaborationTools stuff from the database, which is related to
 * the calling OLATResourceable.
 */
public void deleteTools(BusinessGroup businessGroupTodelete) {
    NarrowedPropertyManager npm = NarrowedPropertyManager.getInstance(ores);
    /*
		 * delete the forum, if existing
		 */
    ForumManager fom = ForumManager.getInstance();
    Property forumKeyProperty = npm.findProperty(null, null, PROP_CAT_BG_COLLABTOOLS, KEY_FORUM);
    if (forumKeyProperty != null) {
        // if there was a forum, delete it
        Long forumKey = forumKeyProperty.getLongValue();
        if (forumKey == null)
            throw new AssertException("property had no longValue, prop:" + forumKeyProperty);
        fom.deleteForum(forumKey);
    }
    /*
		 * delete the folder, if existing
		 */
    OlatRootFolderImpl vfsContainer = new OlatRootFolderImpl(getFolderRelPath(), null);
    File fFolderRoot = vfsContainer.getBasefile();
    if (fFolderRoot.exists()) {
        FileUtils.deleteDirsAndFiles(fFolderRoot, true, true);
    }
    /*
		 * delete the wiki if existing
		 */
    VFSContainer rootContainer = WikiManager.getInstance().getWikiRootContainer(ores);
    if (rootContainer != null)
        rootContainer.delete();
    /*
		 * Delete calendar if exists
		 */
    if (businessGroupTodelete != null) {
        CoreSpringFactory.getImpl(ImportToCalendarManager.class).deleteGroupImportedCalendars(businessGroupTodelete);
        CoreSpringFactory.getImpl(CalendarManager.class).deleteGroupCalendar(businessGroupTodelete);
    }
    /*
		 * delete chatRoom
		 */
    // no cleanup needed, automatically done when last user exits the room
    /*
		 * delete all Properties defining enabled/disabled CollabTool XY and the
		 * news content
		 */
    npm.deleteProperties(null, null, PROP_CAT_BG_COLLABTOOLS, null);
    /*
		 * Delete OpenMeetings room
		 */
    OpenMeetingsModule omModule = CoreSpringFactory.getImpl(OpenMeetingsModule.class);
    if (omModule.isEnabled()) {
        OpenMeetingsManager omManager = CoreSpringFactory.getImpl(OpenMeetingsManager.class);
        try {
            omManager.deleteAll(ores, null, null);
        } catch (OpenMeetingsException e) {
            log.error("A room could not be deleted for group: " + ores, e);
        }
    }
    /*
		 * and last but not least the cache is reseted
		 */
    cacheToolStates.clear();
    this.dirty = true;
}
Also used : AssertException(org.olat.core.logging.AssertException) VFSContainer(org.olat.core.util.vfs.VFSContainer) OpenMeetingsModule(org.olat.modules.openmeetings.OpenMeetingsModule) ImportToCalendarManager(org.olat.commons.calendar.manager.ImportToCalendarManager) ImportToCalendarManager(org.olat.commons.calendar.manager.ImportToCalendarManager) CalendarManager(org.olat.commons.calendar.CalendarManager) OlatRootFolderImpl(org.olat.core.commons.modules.bc.vfs.OlatRootFolderImpl) ForumManager(org.olat.modules.fo.manager.ForumManager) OpenMeetingsException(org.olat.modules.openmeetings.manager.OpenMeetingsException) NarrowedPropertyManager(org.olat.properties.NarrowedPropertyManager) Property(org.olat.properties.Property) File(java.io.File) OpenMeetingsManager(org.olat.modules.openmeetings.manager.OpenMeetingsManager)

Example 2 with OpenMeetingsModule

use of org.olat.modules.openmeetings.OpenMeetingsModule in project OpenOLAT by OpenOLAT.

the class CollaborationTools method openOpenMeetingsRoom.

private void openOpenMeetingsRoom() {
    OpenMeetingsModule omModule = CoreSpringFactory.getImpl(OpenMeetingsModule.class);
    if (!omModule.isEnabled())
        return;
    OpenMeetingsManager omm = CoreSpringFactory.getImpl(OpenMeetingsManager.class);
    Long roomId = omm.getRoomId(ores, null, null);
    if (roomId == null) {
        // create the room
        OpenMeetingsRoom room = new OpenMeetingsRoom();
        room.setComment(ores.getDescription());
        room.setModerated(true);
        room.setName(ores.getName());
        room.setAudioOnly(true);
        room.setResourceName(ores.getName());
        room.setSize(25);
        room.setType(RoomType.conference.type());
        omm.addRoom(ores, null, null, room);
    }
}
Also used : OpenMeetingsRoom(org.olat.modules.openmeetings.model.OpenMeetingsRoom) OpenMeetingsModule(org.olat.modules.openmeetings.OpenMeetingsModule) OpenMeetingsManager(org.olat.modules.openmeetings.manager.OpenMeetingsManager)

Example 3 with OpenMeetingsModule

use of org.olat.modules.openmeetings.OpenMeetingsModule in project OpenOLAT by OpenOLAT.

the class BusinessGroupMainRunController method buildTreeModel.

/**
 * @return The menu tree model
 */
private TreeModel buildTreeModel() {
    GenericTreeNode gtnChild, root;
    GenericTreeModel gtm = new GenericTreeModel();
    root = new GenericTreeNode(nodeIdPrefix.concat("-root"));
    root.setTitle(businessGroup.getName());
    root.setUserObject(ACTIVITY_MENUSELECT_OVERVIEW);
    root.setAltText(translate("menutree.top.alt") + " " + businessGroup.getName());
    root.setIconCssClass("o_icon o_icon_group");
    gtm.setRootNode(root);
    CollaborationTools collabTools = CollaborationToolsFactory.getInstance().getOrCreateCollaborationTools(this.businessGroup);
    if (collabTools.isToolEnabled(CollaborationTools.TOOL_NEWS)) {
        gtnChild = new GenericTreeNode(nodeIdPrefix.concat("new"));
        gtnChild.setTitle(translate("menutree.news"));
        gtnChild.setUserObject(ACTIVITY_MENUSELECT_INFORMATION);
        gtnChild.setAltText(translate("menutree.news.alt"));
        gtnChild.setIconCssClass("o_icon_news");
        gtnChild.setCssClass("o_sel_group_news");
        root.addChild(gtnChild);
        nodeInformation = gtnChild;
    }
    if (calendarModule.isEnabled() && calendarModule.isEnableGroupCalendar() && collabTools.isToolEnabled(CollaborationTools.TOOL_CALENDAR)) {
        gtnChild = new GenericTreeNode(nodeIdPrefix.concat("cal"));
        gtnChild.setTitle(translate("menutree.calendar"));
        gtnChild.setUserObject(ACTIVITY_MENUSELECT_CALENDAR);
        gtnChild.setAltText(translate("menutree.calendar.alt"));
        gtnChild.setIconCssClass("o_calendar_icon");
        gtnChild.setCssClass("o_sel_group_calendar");
        root.addChild(gtnChild);
        nodeCal = gtnChild;
    }
    boolean hasResources = businessGroupService.hasResources(businessGroup);
    if (hasResources) {
        gtnChild = new GenericTreeNode(nodeIdPrefix.concat("courses"));
        gtnChild.setTitle(translate("menutree.resources"));
        gtnChild.setUserObject(ACTIVITY_MENUSELECT_SHOW_RESOURCES);
        gtnChild.setAltText(translate("menutree.resources.alt"));
        gtnChild.setIconCssClass("o_CourseModule_icon");
        gtnChild.setCssClass("o_sel_group_resources");
        root.addChild(gtnChild);
        nodeResources = gtnChild;
    }
    if (businessGroup.isOwnersVisibleIntern() || businessGroup.isParticipantsVisibleIntern() || businessGroup.isWaitingListVisibleIntern()) {
        // either owners, participants, the waiting list or all three are visible
        // otherwise the node is not visible
        gtnChild = new GenericTreeNode(nodeIdPrefix.concat("members"));
        gtnChild.setTitle(translate("menutree.members"));
        gtnChild.setUserObject(ACTIVITY_MENUSELECT_MEMBERSLIST);
        gtnChild.setAltText(translate("menutree.members.alt"));
        gtnChild.setIconCssClass("o_icon_group");
        gtnChild.setCssClass("o_sel_group_members");
        root.addChild(gtnChild);
        nodeGroupOwners = gtnChild;
    }
    if (collabTools.isToolEnabled(CollaborationTools.TOOL_CONTACT)) {
        gtnChild = new GenericTreeNode(nodeIdPrefix.concat("contact"));
        gtnChild.setTitle(translate("menutree.contactform"));
        gtnChild.setUserObject(ACTIVITY_MENUSELECT_CONTACTFORM);
        gtnChild.setAltText(translate("menutree.contactform.alt"));
        gtnChild.setIconCssClass("o_co_icon");
        gtnChild.setCssClass("o_sel_group_contact");
        root.addChild(gtnChild);
        nodeContact = gtnChild;
    }
    if (collabTools.isToolEnabled(CollaborationTools.TOOL_FOLDER)) {
        gtnChild = new GenericTreeNode(nodeIdPrefix.concat("folder"));
        gtnChild.setTitle(translate("menutree.folder"));
        gtnChild.setUserObject(ACTIVITY_MENUSELECT_FOLDER);
        gtnChild.setAltText(translate("menutree.folder.alt"));
        gtnChild.setIconCssClass("o_bc_icon");
        gtnChild.setCssClass("o_sel_group_folder");
        root.addChild(gtnChild);
        nodeFolder = gtnChild;
    }
    if (collabTools.isToolEnabled(CollaborationTools.TOOL_FORUM)) {
        gtnChild = new GenericTreeNode(nodeIdPrefix.concat("forum"));
        gtnChild.setTitle(translate("menutree.forum"));
        gtnChild.setUserObject(ACTIVITY_MENUSELECT_FORUM);
        gtnChild.setAltText(translate("menutree.forum.alt"));
        gtnChild.setIconCssClass("o_fo_icon");
        gtnChild.setCssClass("o_sel_group_forum");
        root.addChild(gtnChild);
        nodeForum = gtnChild;
    }
    if (chatAvailable) {
        gtnChild = new GenericTreeNode(nodeIdPrefix.concat("chat"));
        gtnChild.setTitle(translate("menutree.chat"));
        gtnChild.setUserObject(ACTIVITY_MENUSELECT_CHAT);
        gtnChild.setAltText(translate("menutree.chat.alt"));
        gtnChild.setIconCssClass("o_icon_chat");
        gtnChild.setCssClass("o_sel_group_chat");
        root.addChild(gtnChild);
    }
    BaseSecurityModule securityModule = CoreSpringFactory.getImpl(BaseSecurityModule.class);
    if (collabTools.isToolEnabled(CollaborationTools.TOOL_WIKI) && securityModule.isWikiEnabled()) {
        gtnChild = new GenericTreeNode(nodeIdPrefix.concat("wiki"));
        gtnChild.setTitle(translate("menutree.wiki"));
        gtnChild.setUserObject(ACTIVITY_MENUSELECT_WIKI);
        gtnChild.setAltText(translate("menutree.wiki.alt"));
        gtnChild.setIconCssClass("o_wiki_icon");
        gtnChild.setCssClass("o_sel_group_wiki");
        root.addChild(gtnChild);
        nodeWiki = gtnChild;
    }
    if (collabTools.isToolEnabled(CollaborationTools.TOOL_PORTFOLIO) && (portfolioModule.isEnabled() || portfolioV2Module.isEnabled())) {
        gtnChild = new GenericTreeNode(nodeIdPrefix.concat("eportfolio"));
        gtnChild.setTitle(translate("menutree.portfolio"));
        gtnChild.setUserObject(ACTIVITY_MENUSELECT_PORTFOLIO);
        gtnChild.setAltText(translate("menutree.portfolio.alt"));
        gtnChild.setIconCssClass("o_ep_icon");
        gtnChild.setCssClass("o_sel_group_portfolio");
        root.addChild(gtnChild);
        nodePortfolio = gtnChild;
    }
    OpenMeetingsModule openMeetingsModule = CoreSpringFactory.getImpl(OpenMeetingsModule.class);
    if (openMeetingsModule.isEnabled() && collabTools.isToolEnabled(CollaborationTools.TOOL_OPENMEETINGS)) {
        gtnChild = new GenericTreeNode(nodeIdPrefix.concat("meetings"));
        gtnChild.setTitle(translate("menutree.openmeetings"));
        gtnChild.setUserObject(ACTIVITY_MENUSELECT_OPENMEETINGS);
        gtnChild.setAltText(translate("menutree.openmeetings.alt"));
        gtnChild.setIconCssClass("o_openmeetings_icon");
        root.addChild(gtnChild);
        nodeOpenMeetings = gtnChild;
    }
    if (isAdmin) {
        gtnChild = new GenericTreeNode(nodeIdPrefix.concat("admin"));
        gtnChild.setTitle(translate("menutree.administration"));
        gtnChild.setUserObject(ACTIVITY_MENUSELECT_ADMINISTRATION);
        gtnChild.setIdent(ACTIVITY_MENUSELECT_ADMINISTRATION);
        gtnChild.setAltText(translate("menutree.administration.alt"));
        gtnChild.setIconCssClass("o_icon_settings");
        root.addChild(gtnChild);
        adminNodeId = gtnChild.getIdent();
        nodeAdmin = gtnChild;
        AccessControlModule acModule = (AccessControlModule) CoreSpringFactory.getBean("acModule");
        if (acModule.isEnabled() && acService.isResourceAccessControled(businessGroup.getResource(), null)) {
            gtnChild = new GenericTreeNode(nodeIdPrefix.concat("ac"));
            gtnChild.setTitle(translate("menutree.ac"));
            gtnChild.setUserObject(ACTIVITY_MENUSELECT_AC);
            gtnChild.setIdent(ACTIVITY_MENUSELECT_AC);
            gtnChild.setAltText(translate("menutree.ac.alt"));
            gtnChild.setIconCssClass("o_icon_booking");
            root.addChild(gtnChild);
        }
    }
    return gtm;
}
Also used : AccessControlModule(org.olat.resource.accesscontrol.AccessControlModule) GenericTreeNode(org.olat.core.gui.components.tree.GenericTreeNode) CollaborationTools(org.olat.collaboration.CollaborationTools) GenericTreeModel(org.olat.core.gui.components.tree.GenericTreeModel) BaseSecurityModule(org.olat.basesecurity.BaseSecurityModule) OpenMeetingsModule(org.olat.modules.openmeetings.OpenMeetingsModule)

Example 4 with OpenMeetingsModule

use of org.olat.modules.openmeetings.OpenMeetingsModule in project openolat by klemens.

the class OpenMeetingsWebService method getPortrait.

/**
 * Retrieves the portrait of an user
 * @response.representation.200.mediaType application/octet-stream
 * @response.representation.200.doc The portrait as image
 * @response.representation.404.doc The identity or the portrait not found
 * @param identityToken The identity key of the user being searched
 * @param request The REST request
 * @return The image
 */
@GET
@Path("{identityToken}/portrait")
@Produces({ "image/jpeg", "image/jpg", MediaType.APPLICATION_OCTET_STREAM })
public Response getPortrait(@PathParam("identityToken") String identityToken, @Context Request request) {
    try {
        OpenMeetingsModule module = CoreSpringFactory.getImpl(OpenMeetingsModule.class);
        if (!module.isEnabled()) {
            return Response.serverError().status(Status.FORBIDDEN).build();
        }
        OpenMeetingsManager omm = CoreSpringFactory.getImpl(OpenMeetingsManager.class);
        Long identityKey = omm.getIdentityKey(identityToken);
        if (identityKey == null) {
            return Response.serverError().status(Status.NOT_FOUND).build();
        }
        String username = CoreSpringFactory.getImpl(UserManager.class).getUsername(identityKey);
        if (username == null) {
            return Response.serverError().status(Status.NOT_FOUND).build();
        }
        File portrait = DisplayPortraitManager.getInstance().getBigPortrait(username);
        if (portrait == null || !portrait.exists()) {
            return Response.serverError().status(Status.NOT_FOUND).build();
        }
        Date lastModified = new Date(portrait.lastModified());
        Response.ResponseBuilder response = request.evaluatePreconditions(lastModified);
        if (response == null) {
            response = Response.ok(portrait).lastModified(lastModified).cacheControl(cc);
        }
        return response.build();
    } catch (Throwable e) {
        throw new WebApplicationException(e);
    }
}
Also used : Response(javax.ws.rs.core.Response) WebApplicationException(javax.ws.rs.WebApplicationException) UserManager(org.olat.user.UserManager) OpenMeetingsModule(org.olat.modules.openmeetings.OpenMeetingsModule) OpenMeetingsManager(org.olat.modules.openmeetings.manager.OpenMeetingsManager) File(java.io.File) Date(java.util.Date) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET)

Example 5 with OpenMeetingsModule

use of org.olat.modules.openmeetings.OpenMeetingsModule in project openolat by klemens.

the class CollaborationTools method openOpenMeetingsRoom.

private void openOpenMeetingsRoom() {
    OpenMeetingsModule omModule = CoreSpringFactory.getImpl(OpenMeetingsModule.class);
    if (!omModule.isEnabled())
        return;
    OpenMeetingsManager omm = CoreSpringFactory.getImpl(OpenMeetingsManager.class);
    Long roomId = omm.getRoomId(ores, null, null);
    if (roomId == null) {
        // create the room
        OpenMeetingsRoom room = new OpenMeetingsRoom();
        room.setComment(ores.getDescription());
        room.setModerated(true);
        room.setName(ores.getName());
        room.setAudioOnly(true);
        room.setResourceName(ores.getName());
        room.setSize(25);
        room.setType(RoomType.conference.type());
        omm.addRoom(ores, null, null, room);
    }
}
Also used : OpenMeetingsRoom(org.olat.modules.openmeetings.model.OpenMeetingsRoom) OpenMeetingsModule(org.olat.modules.openmeetings.OpenMeetingsModule) OpenMeetingsManager(org.olat.modules.openmeetings.manager.OpenMeetingsManager)

Aggregations

OpenMeetingsModule (org.olat.modules.openmeetings.OpenMeetingsModule)10 OpenMeetingsManager (org.olat.modules.openmeetings.manager.OpenMeetingsManager)6 File (java.io.File)4 BaseSecurityModule (org.olat.basesecurity.BaseSecurityModule)4 ArrayList (java.util.ArrayList)2 Date (java.util.Date)2 GET (javax.ws.rs.GET)2 Path (javax.ws.rs.Path)2 Produces (javax.ws.rs.Produces)2 WebApplicationException (javax.ws.rs.WebApplicationException)2 Response (javax.ws.rs.core.Response)2 CollaborationTools (org.olat.collaboration.CollaborationTools)2 CalendarManager (org.olat.commons.calendar.CalendarManager)2 CalendarModule (org.olat.commons.calendar.CalendarModule)2 ImportToCalendarManager (org.olat.commons.calendar.manager.ImportToCalendarManager)2 OlatRootFolderImpl (org.olat.core.commons.modules.bc.vfs.OlatRootFolderImpl)2 GenericTreeModel (org.olat.core.gui.components.tree.GenericTreeModel)2 GenericTreeNode (org.olat.core.gui.components.tree.GenericTreeNode)2 AssertException (org.olat.core.logging.AssertException)2 VFSContainer (org.olat.core.util.vfs.VFSContainer)2