use of org.olat.modules.openmeetings.manager.OpenMeetingsManager 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);
}
}
use of org.olat.modules.openmeetings.manager.OpenMeetingsManager 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;
}
use of org.olat.modules.openmeetings.manager.OpenMeetingsManager 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);
}
}
use of org.olat.modules.openmeetings.manager.OpenMeetingsManager in project openolat by klemens.
the class OpenMeetingsCourseNode method isConfigValid.
@Override
public StatusDescription isConfigValid() {
if (oneClickStatusCache != null) {
return oneClickStatusCache[0];
}
StatusDescription sd = StatusDescription.NOERROR;
if (groupMgr != null) {
OpenMeetingsManager openMeetingsManager = CoreSpringFactory.getImpl(OpenMeetingsManager.class);
Long roomId = openMeetingsManager.getRoomId(null, groupMgr.getCourseResource(), getIdent());
if (roomId == null) {
String shortKey = "error.noroom.short";
String longKey = "error.noroom.long";
String[] params = new String[] { getShortTitle() };
String translPackage = Util.getPackageName(OpenMeetingsRoomEditController.class);
sd = new StatusDescription(StatusDescription.ERROR, shortKey, longKey, params, translPackage);
sd.setDescriptionForUnit(getIdent());
// set which pane is affected by error
sd.setActivateableViewIdentifier(CPEditController.PANE_TAB_CPCONFIG);
}
}
return sd;
}
use of org.olat.modules.openmeetings.manager.OpenMeetingsManager 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);
}
}
Aggregations