Modified: openmeetings/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java URL: http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java?rev=1714149&r1=1714148&r2=1714149&view=diff ============================================================================== --- openmeetings/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java (original) +++ openmeetings/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java Fri Nov 13 01:24:41 2015 @@ -91,7 +91,7 @@ public class ScopeApplicationAdapter ext @Autowired private WhiteboardManager whiteboardManagement; @Autowired - private RecordingService flvRecorderService; + private RecordingService recordingService; @Autowired private ConfigurationDao configurationDao; @Autowired @@ -103,7 +103,7 @@ public class ScopeApplicationAdapter ext @Autowired private ConferenceLogDao conferenceLogDao; @Autowired - private UserDao usersDao; + private UserDao userDao; @Autowired private RoomDao roomDao; @Autowired @@ -191,7 +191,7 @@ public class ScopeApplicationAdapter ext SessionVariablesUtil.setUserId(conn.getClient(), rcm.getUserId()); rcm.setStreamPublishName(parentSid); - User u = usersDao.get(rcm.getUserId() < 0 ? -rcm.getUserId() : rcm.getUserId()); + User u = userDao.get(rcm.getUserId() < 0 ? -rcm.getUserId() : rcm.getUserId()); rcm.setUsername(u.getLogin()); rcm.setFirstname(u.getFirstname()); rcm.setLastname(u.getLastname()); @@ -235,7 +235,7 @@ public class ScopeApplicationAdapter ext //Send message to all users sendMessageToCurrentScope("stopRecordingMessage", client, false); - flvRecorderService.stopRecordAndSave(current.getScope(), client, null); + recordingService.stopRecordAndSave(current.getScope(), client, null); } if (Boolean.valueOf("" + map.get("stopPublishing")) && client.isScreenPublishStarted()) { changed = true; @@ -353,7 +353,7 @@ public class ScopeApplicationAdapter ext String recordingName = "Recording " + CalendarPatterns.getDateWithTimeByMiliSeconds(new Date()); - flvRecorderService.recordMeetingStream(current, client, recordingName, "", false); + recordingService.recordMeetingStream(current, client, recordingName, "", false); } else { log.warn("Recording is already started for the client id=" + client.getId() + ". Second request is ignored."); } @@ -504,15 +504,15 @@ public class ScopeApplicationAdapter ext public void roomLeaveByScope(Client currentClient, IScope currentScope, boolean removeUserFromSessionList) { try { log.debug("currentClient " + currentClient); - Long room_id = currentClient.getRoomId(); + Long roomId = currentClient.getRoomId(); // Log the User conferenceLogDao.addConferenceLog(ConferenceLog.Type.roomLeave, currentClient.getUserId(), currentClient.getStreamid(), - room_id, currentClient.getUserip(), ""); + roomId, currentClient.getUserip(), ""); // Remove User from Sync List's - if (room_id != null) { + if (roomId != null) { whiteBoardService.removeUserFromAllLists(currentScope, currentClient); } @@ -527,7 +527,7 @@ public class ScopeApplicationAdapter ext //interview, TODO need better check _stopInterviewRecording(currentClient, currentScope); } else { - flvRecorderService.stopRecordAndSave(currentScope, currentClient, null); + recordingService.stopRecordAndSave(currentScope, currentClient, null); // set to true and overwrite the default one cause otherwise no // notification is send @@ -559,7 +559,7 @@ public class ScopeApplicationAdapter ext log.debug("###########[roomLeave]"); if (rcl.getIsRecording()) { log.debug("*** roomLeave Any Client is Recording - stop that"); - flvRecorderService.stopRecordingShowForClient(cons, currentClient); + recordingService.stopRecordingShowForClient(cons, currentClient); } //If the user was a avclient, we do not broadcast a message about that to everybody @@ -651,7 +651,7 @@ public class ScopeApplicationAdapter ext } if (rcl.getIsRecording()) { log.debug("RCL getIsRecording newStream SEND"); - flvRecorderService.addRecordingByStreamId(current, streamid, currentClient, rcl.getRecordingId()); + recordingService.addRecordingByStreamId(current, streamid, currentClient, rcl.getRecordingId()); } if (rcl.isAvClient()) { log.debug("RCL getIsAVClient newStream SEND"); @@ -748,7 +748,7 @@ public class ScopeApplicationAdapter ext // StreamService.stopRecordingShowForClient(conn, // currentClient, // rcl.getRoomRecordingName(), false); - flvRecorderService.stopRecordingShowForClient(conn, currentClient); + recordingService.stopRecordingShowForClient(conn, currentClient); } // Don't notify current client current.ping(); @@ -771,7 +771,7 @@ public class ScopeApplicationAdapter ext // recording of this stream if (clientFunction.equals("closeStream") && rcl.getIsRecording()) { log.debug("*** +++++++ ######## sendClientBroadcastNotifications Any Client is Recording - stop that"); - flvRecorderService.stopRecordingShowForClient(conn, currentClient); + recordingService.stopRecordingShowForClient(conn, currentClient); } } } @@ -799,13 +799,13 @@ public class ScopeApplicationAdapter ext if (currentClient == null) { return -1L; } - Long room_id = currentClient.getRoomId(); + Long roomId = currentClient.getRoomId(); currentClient.setIsMod(true); // Put the mod-flag to true for this client sessionManager.updateClientByStreamId(currentClient.getStreamid(), currentClient, false, null); - List<Client> currentMods = sessionManager.getCurrentModeratorByRoom(room_id); + List<Client> currentMods = sessionManager.getCurrentModeratorByRoom(roomId); //Send message to all users sendMessageToCurrentScope("setNewModeratorByList", currentMods, true); @@ -841,13 +841,13 @@ public class ScopeApplicationAdapter ext if (currentClient == null) { return -1L; } - Long room_id = currentClient.getRoomId(); + Long roomId = currentClient.getRoomId(); currentClient.setIsMod(false); // Put the mod-flag to true for this client sessionManager.updateClientByStreamId(currentClient.getStreamid(), currentClient, false, null); - List<Client> currentMods = sessionManager.getCurrentModeratorByRoom(room_id); + List<Client> currentMods = sessionManager.getCurrentModeratorByRoom(roomId); sendMessageToCurrentScope("setNewModeratorByList", currentMods, true); } catch (Exception err) { @@ -1026,14 +1026,14 @@ public class ScopeApplicationAdapter ext * @param newMessage * @param vWidth * @param vHeight - * @param room_id + * @param roomId * @param publicSID * @param interviewPodId * @return RoomClient being updated in case of no errors, null otherwise */ public Client setUserAVSettings(String avsettings, Object newMessage, Integer vWidth, Integer vHeight, - long room_id, String publicSID, Integer interviewPodId) { + long roomId, String publicSID, Integer interviewPodId) { try { IConnection current = Red5.getConnectionLocal(); IClient c = current.getClient(); @@ -1042,7 +1042,7 @@ public class ScopeApplicationAdapter ext Client parentClient = sessionManager.getClientByPublicSID(publicSID, false, null); Client currentClient = sessionManager.getClientByStreamId(streamid, null); currentClient.setAvsettings(avsettings); - currentClient.setRoomId(room_id); + currentClient.setRoomId(roomId); currentClient.setPublicSID(publicSID); currentClient.setVWidth(vWidth); currentClient.setVHeight(vHeight); @@ -1069,27 +1069,23 @@ public class ScopeApplicationAdapter ext /* * checks if the user is allowed to apply for Moderation */ - public Boolean checkRoomValues(Long room_id) { + public Boolean checkRoomValues(Long roomId) { try { // appointed meeting or moderated Room? - Room room = roomDao.get(room_id); + Room room = roomDao.get(roomId); // not really - default logic - if (!room.isAppointment()) { - if (room.isModerated()) { - // if this is a Moderated Room then the Room can be only - // locked off by the Moderator Bit - List<Client> clientModeratorListRoom = sessionManager.getCurrentModeratorByRoom(room_id); - - // If there is no Moderator yet and we are asking for it - // then deny it - // cause at this moment, the user should wait untill a - // Moderator enters the Room - return clientModeratorListRoom.size() != 0; - } else { - return true; - } + if (!room.isAppointment() && room.isModerated()) { + // if this is a Moderated Room then the Room can be only + // locked off by the Moderator Bit + List<Client> clientModeratorListRoom = sessionManager.getCurrentModeratorByRoom(roomId); + + // If there is no Moderator yet and we are asking for it + // then deny it + // cause at this moment, the user should wait untill a + // Moderator enters the Room + return clientModeratorListRoom.size() != 0; } else { // FIXME: TODO: For Rooms that are created as Appointment we // have to check that too @@ -1131,12 +1127,12 @@ public class ScopeApplicationAdapter ext * @param roomId - id of the room * @param becomeModerator - is user will become moderator * @param isSuperModerator - is user super moderator - * @param organization_id - organization id of the user + * @param groupId - group id of the user * @param colorObj - some color * @return RoomStatus object */ public synchronized RoomStatus setRoomValues(Long roomId, Boolean becomeModerator, Boolean isSuperModerator, - Long organization_id, String colorObj) { + Long groupId, String colorObj) { try { log.debug("----------- setRoomValues"); IConnection current = Red5.getConnectionLocal(); @@ -1144,14 +1140,14 @@ public class ScopeApplicationAdapter ext Client currentClient = sessionManager.getClientByStreamId(streamid, null); currentClient.setRoomId(roomId); currentClient.setRoomEnter(new Date()); - currentClient.setOrganization_id(organization_id); + currentClient.setGroupId(groupId); currentClient.setUsercolor(colorObj); // Inject externalUserId if nothing is set yet if (currentClient.getExternalUserId() == null) { if (currentClient.getUserId() != null) { - User us = usersDao.get(currentClient.getUserId()); + User us = userDao.get(currentClient.getUserId()); if (us != null) { currentClient.setExternalUserId(us.getExternalId()); currentClient.setExternalUserType(us.getExternalType()); @@ -1191,7 +1187,7 @@ public class ScopeApplicationAdapter ext // if this is a Moderated Room then the Room can be only // locked off by the Moderator Bit // List<RoomClient> clientModeratorListRoom = - // this.sessionManager.getCurrentModeratorByRoom(room_id); + // this.sessionManager.getCurrentModeratorByRoom(roomId); // If there is no Moderator yet we have to check if the // current User has the Bit set to true to @@ -1387,7 +1383,7 @@ public class ScopeApplicationAdapter ext // cause invited users have no associated User, so // you cannot set the firstname,lastname from the UserRecord if (userId != null) { - User us = usersDao.get(userId); + User us = userDao.get(userId); if (us != null) { currentClient.setExternalUserId(us.getExternalId()); @@ -1432,7 +1428,7 @@ public class ScopeApplicationAdapter ext log.debug("UDPATE SESSION " + SID + ", " + userId); sessiondataDao.updateUserWithoutSession(SID, userId); - User user = usersDao.get(userId); + User user = userDao.get(userId); if (user != null) { currentClient.setExternalUserId(user.getExternalId()); @@ -1442,7 +1438,7 @@ public class ScopeApplicationAdapter ext // only fill this value from User-Record // cause invited users have non // you cannot set the firstname,lastname from the UserRecord - User us = usersDao.get(userId); + User us = userDao.get(userId); if (us != null && us.getPictureuri() != null) { // set Picture-URI currentClient.setPicture_uri(us.getPictureuri()); @@ -1458,22 +1454,22 @@ public class ScopeApplicationAdapter ext /** * used by the Screen-Sharing Servlet to trigger events * - * @param room_id + * @param roomId * @param message * @return the list of room clients */ - public HashMap<String, Client> sendMessageByRoomAndDomain(Long room_id, Object message) { + public HashMap<String, Client> sendMessageByRoomAndDomain(Long roomId, Object message) { HashMap<String, Client> roomClientList = new HashMap<String, Client>(); try { - log.debug("sendMessageByRoomAndDomain " + room_id); + log.debug("sendMessageByRoomAndDomain " + roomId); IScope globalScope = getContext().getGlobalScope(); IScope webAppKeyScope = globalScope.getScope(OpenmeetingsVariables.webAppRootKey); log.debug("webAppKeyScope " + webAppKeyScope); - IScope scopeHibernate = webAppKeyScope.getScope(room_id.toString()); + IScope scopeHibernate = webAppKeyScope.getScope(roomId.toString()); new MessageSender(scopeHibernate, "newMessageByRoomAndDomain", message) { @Override @@ -1492,8 +1488,8 @@ public class ScopeApplicationAdapter ext try { IConnection current = Red5.getConnectionLocal(); Client currentClient = sessionManager.getClientByStreamId(current.getClient().getId(), null); - Long room_id = currentClient.getRoomId(); - return sessionManager.getCurrentModeratorByRoom(room_id); + Long roomId = currentClient.getRoomId(); + return sessionManager.getCurrentModeratorByRoom(roomId); } catch (Exception err) { log.error("[getCurrentModerator]", err); } @@ -1529,7 +1525,7 @@ public class ScopeApplicationAdapter ext return; } - Long room_id = currentClient.getRoomId(); + Long roomId = currentClient.getRoomId(); // log.debug("***** sendVars: " + whiteboardObj); @@ -1562,14 +1558,14 @@ public class ScopeApplicationAdapter ext whiteboardTempObj.put(3, tempActionObject); whiteboardManagement.addWhiteBoardObjectById( - room_id, whiteboardTempObj, whiteboardId); + roomId, whiteboardTempObj, whiteboardId); } } else { whiteboardManagement.addWhiteBoardObjectById( - room_id, whiteboardObj, whiteboardId); + roomId, whiteboardObj, whiteboardId); } @@ -1612,7 +1608,6 @@ public class ScopeApplicationAdapter ext try { IConnection current = Red5.getConnectionLocal(); Client currentClient = sessionManager.getClientByStreamId(current.getClient().getId(), null); - // Long room_id = currentClient.getRoom_id(); log.debug("***** id: " + currentClient.getStreamid()); @@ -1958,7 +1953,7 @@ public class ScopeApplicationAdapter ext // log.debug("scopeHibernate "+scopeHibernate); if (scopeHibernate != null) { - // Notify the clients of the same scope (room) with user_id + // Notify the clients of the same scope (room) with userId for (IConnection conn : webAppKeyScope.getScope(scopeName).getClientConnections()) { IClient client = conn.getClient(); @@ -1982,13 +1977,13 @@ public class ScopeApplicationAdapter ext } } - public synchronized void sendMessageWithClientByPublicSIDOrUser(Object message, String publicSID, Long user_id) { + public synchronized void sendMessageWithClientByPublicSIDOrUser(Object message, String publicSID, Long userId) { try { // Get Room Id to send it to the correct Scope Client currentClient = sessionManager.getClientByPublicSID(publicSID, false, null); if (currentClient == null) { - currentClient = sessionManager.getClientByUserId(user_id); + currentClient = sessionManager.getClientByUserId(userId); } Set<IConnection> conset = null; @@ -2014,7 +2009,7 @@ public class ScopeApplicationAdapter ext } } - // Notify the clients of the same scope (room) with user_id + // Notify the clients of the same scope (room) with userId for (IConnection conn : conset) { if (conn != null) { @@ -2031,7 +2026,7 @@ public class ScopeApplicationAdapter ext // log.debug("IS EQUAL "); ((IServiceCapableConnection) conn).invoke("newMessageByRoomAndDomain", new Object[] { message }, this); log.debug("sendMessageWithClientByPublicSID RPC:newMessageByRoomAndDomain" + message); - } else if (user_id != 0 && SessionVariablesUtil.getUserId(client).equals(user_id)) { + } else if (userId != 0 && SessionVariablesUtil.getUserId(client).equals(userId)) { ((IServiceCapableConnection) conn).invoke("newMessageByRoomAndDomain", new Object[] { message }, this); log.debug("sendMessageWithClientByPublicSID RPC:newMessageByRoomAndDomain" + message); } @@ -2114,7 +2109,7 @@ public class ScopeApplicationAdapter ext } String recordingName = "Interview " + CalendarPatterns.getDateWithTimeByMiliSeconds(new Date()); - flvRecorderService.recordMeetingStream(current, current_rcl, recordingName, "", true); + recordingService.recordMeetingStream(current, current_rcl, recordingName, "", true); return true; } catch (Exception err) { @@ -2137,12 +2132,12 @@ public class ScopeApplicationAdapter ext } private Long checkRecordingClient(IConnection conn) { - Long flvRecordingId = null; + Long recordingId = null; if (conn != null) { Client rcl = sessionManager.getClientByStreamId(conn.getClient().getId(), null); if (rcl != null && rcl.getIsRecording() != null && rcl.getIsRecording()) { rcl.setIsRecording(false); - flvRecordingId = rcl.getRecordingId(); + recordingId = rcl.getRecordingId(); rcl.setRecordingId(null); // Reset the Recording Flag to Record all @@ -2150,7 +2145,7 @@ public class ScopeApplicationAdapter ext sessionManager.updateClientByStreamId(conn.getClient().getId(), rcl, false, null); } } - return flvRecordingId; + return recordingId; } /** @@ -2172,20 +2167,20 @@ public class ScopeApplicationAdapter ext private Boolean _stopInterviewRecording(Client currentClient, IScope currentScope) { try { log.debug("----------- stopInterviewRecording"); - Long flvRecordingId = currentClient.getRecordingId(); + Long clientRecordingId = currentClient.getRecordingId(); for (IConnection conn : currentScope.getClientConnections()) { Long recordingId = checkRecordingClient(conn); if (recordingId != null) { - flvRecordingId = recordingId; + clientRecordingId = recordingId; } } - if (flvRecordingId == null) { + if (clientRecordingId == null) { log.debug("stopInterviewRecording:: unable to find recording client"); return false; } - flvRecorderService.stopRecordAndSave(scope, currentClient, flvRecordingId); + recordingService.stopRecordAndSave(scope, currentClient, clientRecordingId); Map<String, String> interviewStatus = new HashMap<String, String>(); interviewStatus.put("action", "stop"); @@ -2316,16 +2311,16 @@ public class ScopeApplicationAdapter ext } } - public synchronized String getSipNumber(Long room_id) { - Room r = roomDao.get(room_id); + public synchronized String getSipNumber(Long roomId) { + Room r = roomDao.get(roomId); if(r != null && r.getConfno() != null) { - log.debug("getSipNumber: room_id: {}, sipNumber: {}", new Object[]{room_id, r.getConfno()}); + log.debug("getSipNumber: roomId: {}, sipNumber: {}", new Object[]{roomId, r.getConfno()}); return r.getConfno(); } return null; } - public void setSipTransport(Long room_id, String publicSID, String broadCastId) { + public void setSipTransport(Long roomId, String publicSID, String broadCastId) { log.debug("----------- setSipTransport"); IConnection current = Red5.getConnectionLocal(); IClient c = current.getClient(); @@ -2333,10 +2328,10 @@ public class ScopeApplicationAdapter ext // Notify all clients of the same scope (room) Client currentClient = sessionManager.getClientByStreamId(streamid, null); currentClient.setSipTransport(true); - currentClient.setRoomId(room_id); + currentClient.setRoomId(roomId); currentClient.setRoomEnter(new Date()); currentClient.setFirstname("SIP Transport"); - currentClient.setLastname(getSipTransportLastname(room_id)); + currentClient.setLastname(getSipTransportLastname(roomId)); currentClient.setBroadCastID(Long.parseLong(broadCastId)); currentClient.setIsBroadcasting(true); currentClient.setPublicSID(publicSID);
Modified: openmeetings/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/session/SessionManager.java URL: http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/session/SessionManager.java?rev=1714149&r1=1714148&r2=1714149&view=diff ============================================================================== --- openmeetings/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/session/SessionManager.java (original) +++ openmeetings/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/session/SessionManager.java Fri Nov 13 01:24:41 2015 @@ -291,7 +291,7 @@ public class SessionManager implements I int start, int max, String orderby, boolean asc) { SearchResult<Client> sResult = new SearchResult<Client>(); sResult.setObjectName(Client.class.getName()); - sResult.setRecords(Long.valueOf(cache.size()).longValue()); + sResult.setRecords(Long.valueOf(cache.size())); sResult.setResult(cache.getClientsWithServer()); return sResult; } Modified: openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/basic/ConfigurationDao.java URL: http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/basic/ConfigurationDao.java?rev=1714149&r1=1714148&r2=1714149&view=diff ============================================================================== --- openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/basic/ConfigurationDao.java (original) +++ openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/basic/ConfigurationDao.java Fri Nov 13 01:24:41 2015 @@ -19,6 +19,7 @@ package org.apache.openmeetings.db.dao.basic; import static org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_APPLICATION_BASE_URL; +import static org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_APPLICATION_NAME; import static org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_CRYPT_KEY; import static org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_MAX_UPLOAD_SIZE_KEY; import static org.apache.openmeetings.util.OpenmeetingsVariables.DEFAULT_BASE_URL; @@ -61,7 +62,7 @@ public class ConfigurationDao implements private static final Logger log = Red5LoggerFactory.getLogger(ConfigurationDao.class, webAppRootKey); public static final long DEFAULT_MAX_UPLOAD_SIZE = 1024 * 1024 * 1024; // 1GB public static final String DEFAULT_APP_NAME = "OpenMeetings"; - public final static String[] searchFields = {"conf_key", "conf_value"}; + public final static String[] searchFields = {"key", "value"}; @PersistenceContext private EntityManager em; @@ -70,8 +71,7 @@ public class ConfigurationDao implements private UserDao userDao; /** - * @deprecated Dao's are not the place to store session variables, also - * updates to the key won't update this variable + * @deprecated Dao's are not the place to store session variables */ @Deprecated private String appName = null; @@ -85,7 +85,7 @@ public class ConfigurationDao implements public Configuration forceGet(String confKey) { try { List<Configuration> list = em.createNamedQuery("forceGetConfigurationByKey", Configuration.class) - .setParameter("conf_key", confKey).getResultList(); + .setParameter("key", confKey).getResultList(); return list.isEmpty() ? null : list.get(0); } catch (Exception e) { log.error("[forceGet]: ", e); @@ -97,7 +97,7 @@ public class ConfigurationDao implements List<Configuration> result = new ArrayList<Configuration>(); for (String key : keys) { //iteration is necessary to fill list with all values List<Configuration> r = em.createNamedQuery("getConfigurationsByKeys", Configuration.class) - .setParameter("conf_keys", Arrays.asList(key)) + .setParameter("keys", Arrays.asList(key)) .getResultList(); result.add(r.isEmpty() ? null : r.get(0)); } @@ -122,7 +122,7 @@ public class ConfigurationDao implements if (list == null || list.isEmpty() || list.get(0) == null) { log.warn("Could not find key in configurations: " + key); } else { - String val = list.get(0).getConf_value(); + String val = list.get(0).getValue(); // Use the custom value as default value if (val != null) { defaultValue = val; @@ -171,57 +171,15 @@ public class ConfigurationDao implements */ public Configuration add(String key, String value, Long userId, String comment) { Configuration c = new Configuration(); - c.setConf_key(key); - c.setConf_value(value); + c.setKey(key); + c.setValue(value); c.setComment(comment); return update(c, userId); } - /** - * @deprecated please use {@link ConfigurationDao#update(Configuration, Long)} - */ - public Long addConfig(Configuration conf) { - try { - conf = em.merge(conf); - Long configuration_id = conf.getId(); - return configuration_id; - } catch (Exception ex2) { - log.error("[updateConfByUID]: ", ex2); - } - return new Long(-1); - } - - /** - * @deprecated please use {@link ConfigurationDao#update(Configuration, Long)} - * @param conf - * @return - */ - public Long updateConfig(Configuration conf) { - try { - if (conf.getId() == null - || conf.getId() == 0 - || conf.getId() == 0L) { - em.persist(conf); - } else { - if (!em.contains(conf)) { - conf = em.merge(conf); - } - } - if (CONFIG_CRYPT_KEY.equals(conf.getConf_key())) { - configKeyCryptClassName = conf.getConf_value(); - } else if ("show.whiteboard.draw.status".equals(conf.getConf_key())) { - whiteboardDrawStatus = "1".equals(conf.getConf_value()); - } - return conf.getId(); - } catch (Exception ex2) { - log.error("[updateConfByUID]: ", ex2); - } - return new Long(-1); - } - public String getAppName() { if (appName == null) { - appName = getConfValue("application.name", String.class, DEFAULT_APP_NAME); + appName = getConfValue(CONFIG_APPLICATION_NAME, String.class, DEFAULT_APP_NAME); } return appName; } @@ -239,7 +197,7 @@ public class ConfigurationDao implements return null; } return em.createNamedQuery("getConfigurationById", Configuration.class) - .setParameter("configuration_id", id).getSingleResult(); + .setParameter("id", id).getSingleResult(); } public List<Configuration> get(int start, int count) { @@ -268,10 +226,10 @@ public class ConfigurationDao implements } public Configuration update(Configuration entity, Long userId, boolean deleted) { - String key = entity.getConf_key(); - String value = entity.getConf_value(); + String key = entity.getKey(); + String value = entity.getValue(); if (entity.getId() == null || entity.getId() <= 0) { - entity.setStarttime(new Date()); + entity.setInserted(new Date()); entity.setDeleted(deleted); em.persist(entity); } else { @@ -279,14 +237,14 @@ public class ConfigurationDao implements entity.setUser(userDao.get(userId)); } entity.setDeleted(deleted); - entity.setUpdatetime(new Date()); + entity.setUpdated(new Date()); entity = em.merge(entity); } if (CONFIG_CRYPT_KEY.equals(key)) { configKeyCryptClassName = value; } else if ("show.whiteboard.draw.status".equals(key)) { whiteboardDrawStatus = "1".equals(value); - } else if ("application.name".equals(key)) { + } else if (CONFIG_APPLICATION_NAME.equals(key)) { appName = value; } //TODO ensure entity returned is updated @@ -294,7 +252,7 @@ public class ConfigurationDao implements } public void delete(Configuration entity, Long userId) { - entity.setUpdatetime(new Date()); + entity.setUpdated(new Date()); this.update(entity, userId, true); } Modified: openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/record/RecordingDao.java URL: http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/record/RecordingDao.java?rev=1714149&r1=1714148&r2=1714149&view=diff ============================================================================== --- openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/record/RecordingDao.java (original) +++ openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/record/RecordingDao.java Fri Nov 13 01:24:41 2015 @@ -38,7 +38,7 @@ import org.apache.openmeetings.db.dao.us import org.apache.openmeetings.db.dto.record.RecordingContainerData; import org.apache.openmeetings.db.entity.record.Recording; import org.apache.openmeetings.db.entity.record.Recording.Status; -import org.apache.openmeetings.db.entity.user.Organisation_Users; +import org.apache.openmeetings.db.entity.user.GroupUser; import org.red5.logging.Red5LoggerFactory; import org.slf4j.Logger; import org.springframework.beans.factory.annotation.Autowired; @@ -149,10 +149,10 @@ public class RecordingDao { return query.getResultList(); } - public List<Recording> getRootByPublic(Long orgId) { - TypedQuery<Recording> q = em.createNamedQuery(orgId == null ? "getRecordingsPublic" : "getRecordingsByOrganization", Recording.class); - if (orgId != null) { - q.setParameter("organization_id", orgId); + public List<Recording> getRootByPublic(Long groupId) { + TypedQuery<Recording> q = em.createNamedQuery(groupId == null ? "getRecordingsPublic" : "getRecordingsByGroup", Recording.class); + if (groupId != null) { + q.setParameter("groupId", groupId); } return q.getResultList(); } @@ -260,9 +260,9 @@ public class RecordingDao { // Public Recordings long publicFileSize = 0; - //get all organizations the user can view - for (Organisation_Users ou : userDao.get(userId).getOrganisation_users()) { - List<Recording> publicRecordings = getRootByPublic(ou.getOrganisation().getId()); + //get all groups the user can view + for (GroupUser ou : userDao.get(userId).getGroupUsers()) { + List<Recording> publicRecordings = getRootByPublic(ou.getGroup().getId()); //get sizes for (Recording r : publicRecordings) { publicFileSize += getSize(r); Modified: openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/room/ClientDao.java URL: http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/room/ClientDao.java?rev=1714149&r1=1714148&r2=1714149&view=diff ============================================================================== --- openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/room/ClientDao.java (original) +++ openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/room/ClientDao.java Fri Nov 13 01:24:41 2015 @@ -145,13 +145,13 @@ public class ClientDao { public List<Client> getClientsByUserId(Server server, Long userId) { TypedQuery<Client> q = em.createNamedQuery("getClientsByUserId", Client.class); q.setParameter("server", server); - q.setParameter("user_id", userId); + q.setParameter("userId", userId); return q.getResultList(); } public List<Client> getClientsByRoomId(Long roomId) { TypedQuery<Client> q = em.createNamedQuery("getClientsByRoomId", Client.class); - q.setParameter("room_id", roomId); + q.setParameter("roomId", roomId); return q.getResultList(); } Modified: openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/room/RoomDao.java URL: http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/room/RoomDao.java?rev=1714149&r1=1714148&r2=1714149&view=diff ============================================================================== --- openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/room/RoomDao.java (original) +++ openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/room/RoomDao.java Fri Nov 13 01:24:41 2015 @@ -119,9 +119,9 @@ public class RoomDao implements IDataPro return q.getResultList(); } - public List<Room> getGroupRooms(long orgId) { + public List<Room> getGroupRooms(long groupId) { TypedQuery<Room> q = em.createNamedQuery("getGroupRooms", Room.class); - q.setParameter("orgId", orgId); + q.setParameter("groupId", groupId); return q.getResultList(); } Modified: openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/room/RoomModeratorDao.java URL: http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/room/RoomModeratorDao.java?rev=1714149&r1=1714148&r2=1714149&view=diff ============================================================================== --- openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/room/RoomModeratorDao.java (original) +++ openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/room/RoomModeratorDao.java Fri Nov 13 01:24:41 2015 @@ -35,7 +35,7 @@ public class RoomModeratorDao { public RoomModerator get(long id) { List<RoomModerator> list = em.createNamedQuery("getRoomModeratorById", RoomModerator.class) - .setParameter("roomModeratorsId", id).getResultList(); + .setParameter("id", id).getResultList(); if (!list.isEmpty()) { return list.get(0); } @@ -51,11 +51,11 @@ public class RoomModeratorDao { } public RoomModerator update(RoomModerator rm, Long userId) { - if (rm.getRoomModeratorsId() == 0) { - rm.setStarttime(new Date()); + if (rm.getId() == 0) { + rm.setInserted(new Date()); em.persist(rm); } else { - rm.setUpdatetime(new Date()); + rm.setUpdated(new Date()); rm = em.merge(rm); } return rm; Modified: openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/server/ISessionManager.java URL: http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/server/ISessionManager.java?rev=1714149&r1=1714148&r2=1714149&view=diff ============================================================================== --- openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/server/ISessionManager.java (original) +++ openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/server/ISessionManager.java Fri Nov 13 01:24:41 2015 @@ -155,12 +155,12 @@ public interface ISessionManager { * needed cause it is invoked internally AFTER the current user has been * already removed from the ClientList to see if the Room is empty again and * the PollList can be removed - * @param room_id + * @param roomId * @return */ - public abstract List<Client> getClientListByRoom(Long room_id); + public abstract List<Client> getClientListByRoom(Long roomId); - public abstract Collection<Client> getClientListByRoomAll(Long room_id); + public abstract Collection<Client> getClientListByRoomAll(Long roomId); /** * get the current Moderator in this room @@ -168,7 +168,7 @@ public interface ISessionManager { * @param roomname * @return */ - public abstract List<Client> getCurrentModeratorByRoom(Long room_id); + public abstract List<Client> getCurrentModeratorByRoom(Long roomId); /** * Get list of current client sessions Modified: openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/server/LdapConfigDao.java URL: http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/server/LdapConfigDao.java?rev=1714149&r1=1714148&r2=1714149&view=diff ============================================================================== --- openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/server/LdapConfigDao.java (original) +++ openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/server/LdapConfigDao.java Fri Nov 13 01:24:41 2015 @@ -18,6 +18,8 @@ */ package org.apache.openmeetings.db.dao.server; +import static org.apache.openmeetings.util.OpenmeetingsVariables.webAppRootKey; + import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -32,7 +34,6 @@ import org.apache.openmeetings.db.dao.ID import org.apache.openmeetings.db.dao.user.UserDao; import org.apache.openmeetings.db.entity.server.LdapConfig; import org.apache.openmeetings.util.DaoHelper; -import org.apache.openmeetings.util.OpenmeetingsVariables; import org.red5.logging.Red5LoggerFactory; import org.slf4j.Logger; import org.springframework.beans.factory.annotation.Autowired; @@ -47,15 +48,14 @@ import org.springframework.transaction.a */ @Transactional public class LdapConfigDao implements IDataProviderDao<LdapConfig> { - private static final Logger log = Red5LoggerFactory.getLogger( - LdapConfigDao.class, OpenmeetingsVariables.webAppRootKey); + private static final Logger log = Red5LoggerFactory.getLogger(LdapConfigDao.class, webAppRootKey); public final static String[] searchFields = {"name", "configFileName", "domain", "comment"}; @PersistenceContext private EntityManager em; @Autowired - private UserDao usersDao; + private UserDao userDao; public Long addLdapConfig(String name, Boolean addDomainToUserName, String configFileName, String domain, Long insertedby, @@ -71,8 +71,8 @@ public class LdapConfigDao implements ID ldapConfig.setName(name); ldapConfig.setInserted(new Date()); if (insertedby != null) { - log.debug("addLdapConfig :1: " + usersDao.get(insertedby)); - ldapConfig.setInsertedby(usersDao.get(insertedby)); + log.debug("addLdapConfig :1: " + userDao.get(insertedby)); + ldapConfig.setInsertedby(userDao.get(insertedby)); } log.debug("addLdapConfig :2: " + insertedby); @@ -80,7 +80,7 @@ public class LdapConfigDao implements ID ldapConfig = em.merge(ldapConfig); Long id = ldapConfig.getId(); - if (id > 0) { + if (id != null) { return id; } else { throw new Exception("Could not store SOAPLogin"); @@ -101,7 +101,7 @@ public class LdapConfigDao implements ID ldapConfig = em.merge(ldapConfig); Long id = ldapConfig.getId(); - if (id > 0) { + if (id != null) { return id; } else { throw new Exception("Could not store SOAPLogin"); @@ -118,7 +118,7 @@ public class LdapConfigDao implements ID Long updatedby, Boolean isActive) { try { - LdapConfig ldapConfig = this.get(id); + LdapConfig ldapConfig = get(id); if (ldapConfig == null) { return -1L; @@ -132,8 +132,8 @@ public class LdapConfigDao implements ID ldapConfig.setName(name); ldapConfig.setUpdated(new Date()); if (updatedby != null) { - log.debug("updateLdapConfig :1: " + usersDao.get(updatedby)); - ldapConfig.setUpdatedby(usersDao.get(updatedby)); + log.debug("updateLdapConfig :1: " + userDao.get(updatedby)); + ldapConfig.setUpdatedby(userDao.get(updatedby)); } log.debug("updateLdapConfig :2: " + updatedby); @@ -152,14 +152,8 @@ public class LdapConfigDao implements ID public LdapConfig get(long id) { try { - String hql = "select c from LdapConfig c " - + "WHERE c.id = :id " - + "AND c.deleted = :deleted"; - - TypedQuery<LdapConfig> query = em - .createQuery(hql, LdapConfig.class); + TypedQuery<LdapConfig> query = em.createNamedQuery("getLdapConfigById", LdapConfig.class); query.setParameter("id", id); - query.setParameter("deleted", false); LdapConfig ldapConfig = null; try { @@ -214,10 +208,7 @@ public class LdapConfigDao implements ID public long count() { try { - TypedQuery<Long> query = em - .createQuery( - "select count(c) from LdapConfig c where c.deleted = false", - Long.class); + TypedQuery<Long> query = em.createNamedQuery("countNondeletedLdapConfigs", Long.class); List<Long> ll = query.getResultList(); log.debug("selectMaxFromLdapConfig" + ll.get(0)); return ll.get(0); @@ -234,17 +225,17 @@ public class LdapConfigDao implements ID public LdapConfig update(LdapConfig entity, Long userId) { try { - if (entity.getId() <= 0) { + if (entity.getId() == null) { entity.setInserted(new Date()); if (userId != null) { - entity.setInsertedby(usersDao.get(userId)); + entity.setInsertedby(userDao.get(userId)); } entity.setDeleted(false); em.persist(entity); } else { entity.setUpdated(new Date()); if (userId != null) { - entity.setUpdatedby(usersDao.get(userId)); + entity.setUpdatedby(userDao.get(userId)); } entity.setDeleted(false); em.merge(entity); @@ -256,10 +247,10 @@ public class LdapConfigDao implements ID } public void delete(LdapConfig entity, Long userId) { - if (entity.getId() >= 0) { + if (entity.getId() != null) { entity.setUpdated(new Date()); if (userId != null) { - entity.setUpdatedby(usersDao.get(userId)); + entity.setUpdatedby(userDao.get(userId)); } entity.setDeleted(true); em.merge(entity); Modified: openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/server/SOAPLoginDao.java URL: http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/server/SOAPLoginDao.java?rev=1714149&r1=1714148&r2=1714149&view=diff ============================================================================== --- openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/server/SOAPLoginDao.java (original) +++ openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/server/SOAPLoginDao.java Fri Nov 13 01:24:41 2015 @@ -40,9 +40,9 @@ public class SOAPLoginDao { @PersistenceContext private EntityManager em; - public String addSOAPLogin(String sessionHash, Long room_id, + public String addSOAPLogin(String sessionHash, Long roomId, boolean becomemoderator, boolean showAudioVideoTest, - boolean allowSameURLMultipleTimes, Long recording_id, + boolean allowSameURLMultipleTimes, Long recordingId, boolean showNickNameDialog, String landingZone, boolean allowRecording) { try { @@ -53,10 +53,10 @@ public class SOAPLoginDao { SOAPLogin soapLogin = new SOAPLogin(); soapLogin.setCreated(new Date()); soapLogin.setUsed(false); - soapLogin.setRoomId(room_id); + soapLogin.setRoomId(roomId); soapLogin.setAllowSameURLMultipleTimes(allowSameURLMultipleTimes); soapLogin.setHash(hash); - soapLogin.setRecordingId(recording_id); + soapLogin.setRecordingId(recordingId); soapLogin.setSessionHash(sessionHash); soapLogin.setBecomemoderator(becomemoderator); soapLogin.setShowAudioVideoTest(showAudioVideoTest); @@ -65,7 +65,7 @@ public class SOAPLoginDao { soapLogin.setAllowRecording(allowRecording); soapLogin = em.merge(soapLogin); - Long soapLoginId = soapLogin.getSoapLoginId(); + Long soapLoginId = soapLogin.getId(); if (soapLoginId > 0) { return hash; @@ -102,7 +102,7 @@ public class SOAPLoginDao { public void update(SOAPLogin soapLogin) { try { - if (soapLogin.getSoapLoginId() == 0) { + if (soapLogin.getId() == null) { em.persist(soapLogin); } else { if (!em.contains(soapLogin)) { Modified: openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/server/ServerDao.java URL: http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/server/ServerDao.java?rev=1714149&r1=1714148&r2=1714149&view=diff ============================================================================== --- openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/server/ServerDao.java (original) +++ openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/server/ServerDao.java Fri Nov 13 01:24:41 2015 @@ -18,6 +18,8 @@ */ package org.apache.openmeetings.db.dao.server; +import static org.apache.openmeetings.util.OpenmeetingsVariables.webAppRootKey; + import java.util.Date; import java.util.List; @@ -30,7 +32,6 @@ import org.apache.openmeetings.db.dao.ID import org.apache.openmeetings.db.dao.user.UserDao; import org.apache.openmeetings.db.entity.server.Server; import org.apache.openmeetings.util.DaoHelper; -import org.apache.openmeetings.util.OpenmeetingsVariables; import org.red5.logging.Red5LoggerFactory; import org.slf4j.Logger; import org.springframework.beans.factory.annotation.Autowired; @@ -45,15 +46,14 @@ import org.springframework.transaction.a */ @Transactional public class ServerDao implements IDataProviderDao<Server> { - private static final Logger log = Red5LoggerFactory.getLogger( - ServerDao.class, OpenmeetingsVariables.webAppRootKey); + private static final Logger log = Red5LoggerFactory.getLogger(ServerDao.class, webAppRootKey); public final static String[] searchFields = { "name", "address", "comment" }; @PersistenceContext private EntityManager em; @Autowired - private UserDao usersDao; + private UserDao userDao; /** * Get a list of all available servers @@ -163,13 +163,13 @@ public class ServerDao implements IDataP if (entity.getId() > 0) { entity.setUpdated(new Date()); if (userId != null) { - entity.setUpdatedby(usersDao.get(userId)); + entity.setUpdatedby(userDao.get(userId)); } em.merge(entity); } else { entity.setInserted(new Date()); if (userId != null) { - entity.setInsertedby(usersDao.get(userId)); + entity.setInsertedby(userDao.get(userId)); } em.persist(entity); } @@ -187,7 +187,7 @@ public class ServerDao implements IDataP if (entity.getId() > 0) { entity.setUpdated(new Date()); if (userId != null) { - entity.setUpdatedby(usersDao.get(userId)); + entity.setUpdatedby(userDao.get(userId)); } entity.setDeleted(true); em.merge(entity); Modified: openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/server/SessiondataDao.java URL: http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/server/SessiondataDao.java?rev=1714149&r1=1714148&r2=1714149&view=diff ============================================================================== --- openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/server/SessiondataDao.java (original) +++ openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/server/SessiondataDao.java Fri Nov 13 01:24:41 2015 @@ -212,9 +212,9 @@ public class SessiondataDao { return false; } - public Boolean updateUserOrg(String SID, Long organization_id) { + public Boolean updateUserGroup(String SID, Long groupId) { try { - log.debug("updateUserGroup User: " + organization_id + " || " + SID); + log.debug("updateUserGroup User: " + groupId + " || " + SID); TypedQuery<Sessiondata> query = em.createNamedQuery("getSessionById", Sessiondata.class).setParameter("sessionId", SID); List<Sessiondata> sessions = query.getResultList(); @@ -229,10 +229,10 @@ public class SessiondataDao { return false; } log.debug("Found session to update: " + sessiondata.getSessionId() - + " organisation_id: " + organization_id); + + " groupId: " + groupId); sessiondata.setRefreshed(new Date()); - sessiondata.setOrganizationId(organization_id); + sessiondata.setGroupId(groupId); if (sessiondata.getId() == null) { em.persist(sessiondata); } else { Copied: openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/user/GroupDao.java (from r1714102, openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/user/OrganisationDao.java) URL: http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/user/GroupDao.java?p2=openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/user/GroupDao.java&p1=openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/user/OrganisationDao.java&r1=1714102&r2=1714149&rev=1714149&view=diff ============================================================================== --- openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/user/OrganisationDao.java (original) +++ openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/user/GroupDao.java Fri Nov 13 01:24:41 2015 @@ -28,20 +28,20 @@ import javax.persistence.PersistenceCont import javax.persistence.TypedQuery; import org.apache.openmeetings.db.dao.IDataProviderDao; -import org.apache.openmeetings.db.entity.user.Organisation; +import org.apache.openmeetings.db.entity.user.Group; import org.apache.openmeetings.util.DaoHelper; import org.springframework.transaction.annotation.Transactional; @Transactional -public class OrganisationDao implements IDataProviderDao<Organisation> { +public class GroupDao implements IDataProviderDao<Group> { public final static String[] searchFields = {"name"}; @PersistenceContext private EntityManager em; - public Organisation get(long id) { - TypedQuery<Organisation> query = em.createNamedQuery("getOrganisationById", Organisation.class); + public Group get(long id) { + TypedQuery<Group> query = em.createNamedQuery("getGroupById", Group.class); query.setParameter("id", id); - Organisation o = null; + Group o = null; try { o = query.getSingleResult(); } catch (NoResultException e) { @@ -50,58 +50,58 @@ public class OrganisationDao implements return o; } - public Organisation get(String name) { - List<Organisation> orgs = em.createNamedQuery("getOrganisationByName", Organisation.class).setParameter("name", name).getResultList(); - return orgs == null || orgs.isEmpty() ? null : orgs.get(0); + public Group get(String name) { + List<Group> groups = em.createNamedQuery("getGroupByName", Group.class).setParameter("name", name).getResultList(); + return groups == null || groups.isEmpty() ? null : groups.get(0); } - public List<Organisation> get(int start, int count) { - TypedQuery<Organisation> q = em.createNamedQuery("getNondeletedOrganisations", Organisation.class); + public List<Group> get(int start, int count) { + TypedQuery<Group> q = em.createNamedQuery("getNondeletedGroups", Group.class); q.setFirstResult(start); q.setMaxResults(count); return q.getResultList(); } - public List<Organisation> get(String search, int start, int count, String sort) { - TypedQuery<Organisation> q = em.createQuery(DaoHelper.getSearchQuery("Organisation", "o", search, true, false, sort, searchFields), Organisation.class); + public List<Group> get(String search, int start, int count, String sort) { + TypedQuery<Group> q = em.createQuery(DaoHelper.getSearchQuery("Group", "o", search, true, false, sort, searchFields), Group.class); q.setFirstResult(start); q.setMaxResults(count); return q.getResultList(); } public long count() { - TypedQuery<Long> q = em.createNamedQuery("countOrganisations", Long.class); + TypedQuery<Long> q = em.createNamedQuery("countGroups", Long.class); return q.getSingleResult(); } public long count(String search) { - TypedQuery<Long> q = em.createQuery(DaoHelper.getSearchQuery("Organisation", "o", search, true, true, null, searchFields), Long.class); + TypedQuery<Long> q = em.createQuery(DaoHelper.getSearchQuery("Group", "o", search, true, true, null, searchFields), Long.class); return q.getSingleResult(); } - public List<Organisation> get(Collection<Long> ids) { - return em.createNamedQuery("getOrganisationsByIds", Organisation.class).setParameter("ids", ids).getResultList(); + public List<Group> get(Collection<Long> ids) { + return em.createNamedQuery("getGroupsByIds", Group.class).setParameter("ids", ids).getResultList(); } - public Organisation update(Organisation entity, Long userId) { + public Group update(Group entity, Long userId) { if (entity.getId() == null) { if (userId != null) { entity.setInsertedby(userId); } - entity.setStarttime(new Date()); + entity.setInserted(new Date()); em.persist(entity); } else { if (userId != null) { entity.setUpdatedby(userId); } - entity.setUpdatetime(new Date()); + entity.setUpdated(new Date()); em.merge(entity); } return entity; } - public void delete(Organisation entity, Long userId) { - em.createNamedQuery("deleteUsersFromOrganisation") + public void delete(Group entity, Long userId) { + em.createNamedQuery("deleteUsersFromGroup") .setParameter("id", entity.getId()) .executeUpdate(); Copied: openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/user/GroupUserDao.java (from r1714051, openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/user/OrganisationUserDao.java) URL: http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/user/GroupUserDao.java?p2=openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/user/GroupUserDao.java&p1=openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/user/OrganisationUserDao.java&r1=1714051&r2=1714149&rev=1714149&view=diff ============================================================================== --- openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/user/OrganisationUserDao.java (original) +++ openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/user/GroupUserDao.java Fri Nov 13 01:24:41 2015 @@ -26,54 +26,54 @@ import javax.persistence.PersistenceCont import javax.persistence.TypedQuery; import org.apache.openmeetings.db.dao.IDataProviderDao; -import org.apache.openmeetings.db.entity.user.Organisation_Users; +import org.apache.openmeetings.db.entity.user.GroupUser; import org.apache.openmeetings.db.entity.user.User; import org.apache.openmeetings.util.DaoHelper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Transactional; @Transactional -public class OrganisationUserDao implements IDataProviderDao<Organisation_Users> { +public class GroupUserDao implements IDataProviderDao<GroupUser> { @PersistenceContext private EntityManager em; @Autowired - private UserDao usersDao; + private UserDao userDao; public final static String[] searchFields = {"user.lastname", "user.firstname", "user.login", "user.address.email"}; - public Organisation_Users get(long id) { - TypedQuery<Organisation_Users> q = em.createNamedQuery("getOrganisationUsersById", Organisation_Users.class); + public GroupUser get(long id) { + TypedQuery<GroupUser> q = em.createNamedQuery("getGroupUsersById", GroupUser.class); q.setParameter("id", id); return q.getSingleResult(); } - public List<Organisation_Users> get(int start, int count) { + public List<GroupUser> get(int start, int count) { throw new RuntimeException("Should not be used"); } - public List<Organisation_Users> get(String search, int start, int count, String sort) { + public List<GroupUser> get(String search, int start, int count, String sort) { throw new RuntimeException("Should not be used"); } - public List<Organisation_Users> get(long orgId, String search, int start, int count, String sort) { - TypedQuery<Organisation_Users> q = em.createQuery(DaoHelper.getSearchQuery("Organisation_Users", "ou", null, search, false, false, "ou.organisation.organisation_id = :orgId", sort, searchFields), Organisation_Users.class); - q.setParameter("orgId", orgId); + public List<GroupUser> get(long groupId, String search, int start, int count, String sort) { + TypedQuery<GroupUser> q = em.createQuery(DaoHelper.getSearchQuery(GroupUser.class.getSimpleName(), "ou", null, search, false, false, "ou.group.id = :groupId", sort, searchFields), GroupUser.class); + q.setParameter("groupId", groupId); q.setFirstResult(start); q.setMaxResults(count); return q.getResultList(); } - public List<Organisation_Users> get(long orgId, int start, int count) { - TypedQuery<Organisation_Users> q = em.createNamedQuery("getOrganisationUsersByOrgId", Organisation_Users.class); - q.setParameter("id", orgId); + public List<GroupUser> get(long groupId, int start, int count) { + TypedQuery<GroupUser> q = em.createNamedQuery("getGroupUsersByGroupId", GroupUser.class); + q.setParameter("id", groupId); q.setFirstResult(start); q.setMaxResults(count); return q.getResultList(); } - public Organisation_Users getByOrganizationAndUser(long orgId, long userId) { + public GroupUser getByGroupAndUser(long groupId, long userId) { try { - List<Organisation_Users> list = em.createNamedQuery("isUserInOrganization", Organisation_Users.class) - .setParameter("orgId", orgId).setParameter("userId", userId).getResultList(); + List<GroupUser> list = em.createNamedQuery("isUserInGroup", GroupUser.class) + .setParameter("groupId", groupId).setParameter("userId", userId).getResultList(); if (list != null && !list.isEmpty()) { return list.get(0); } @@ -83,9 +83,9 @@ public class OrganisationUserDao impleme return null; } - public boolean isUserInOrganization(long orgId, long userId) { - return em.createNamedQuery("isUserInOrganization", Organisation_Users.class) - .setParameter("orgId", orgId).setParameter("userId", userId).getResultList().size() > 0; + public boolean isUserInGroup(long groupId, long userId) { + return em.createNamedQuery("isUserInGroup", GroupUser.class) + .setParameter("groupId", groupId).setParameter("userId", userId).getResultList().size() > 0; } public long count() { @@ -96,49 +96,49 @@ public class OrganisationUserDao impleme throw new RuntimeException("Should not be used"); } - public long count(long orgId, String search) { - TypedQuery<Long> q = em.createQuery(DaoHelper.getSearchQuery("Organisation_Users", "ou", search, false, true, null, searchFields), Long.class); + public long count(long groupId, String search) { + TypedQuery<Long> q = em.createQuery(DaoHelper.getSearchQuery(GroupUser.class.getSimpleName(), "ou", search, false, true, null, searchFields), Long.class); return q.getSingleResult(); } - public long count(long orgId) { - TypedQuery<Long> q = em.createNamedQuery("countOrganisationUsers", Long.class); - q.setParameter("id", orgId); + public long count(long groupId) { + TypedQuery<Long> q = em.createNamedQuery("countGroupUsers", Long.class); + q.setParameter("id", groupId); return q.getSingleResult(); } - public void update(List<Organisation_Users> list, Long userId) { - for (Organisation_Users ou : list) { + public void update(List<GroupUser> list, Long userId) { + for (GroupUser ou : list) { update(ou, userId); } } - public Organisation_Users update(Organisation_Users entity, Long userId) { + public GroupUser update(GroupUser entity, Long userId) { if (entity.getId() == null) { - entity.setStarttime(new Date()); + entity.setInserted(new Date()); em.persist(entity); } else { - entity.setUpdatetime(new Date()); + entity.setUpdated(new Date()); entity = em.merge(entity); } updateUser(entity, false, userId); return entity; } - private void updateUser(Organisation_Users entity, boolean delete, Long userId) { + private void updateUser(GroupUser entity, boolean delete, Long userId) { //entity has been detached need to re-fetch - User u = usersDao.get(entity.getUser().getId()); - int idx = u.getOrganisation_users().indexOf(entity); + User u = userDao.get(entity.getUser().getId()); + int idx = u.getGroupUsers().indexOf(entity); if (delete && idx > -1) { - Organisation_Users ou = u.getOrganisation_users().remove(idx); + GroupUser ou = u.getGroupUsers().remove(idx); em.remove(ou); } else if (!delete && idx < 0) { - u.getOrganisation_users().add(entity); + u.getGroupUsers().add(entity); } - usersDao.update(u, userId); + userDao.update(u, userId); } - public void delete(Organisation_Users entity, Long userId) { + public void delete(GroupUser entity, Long userId) { if (entity.getId() != null) { updateUser(entity, true, userId); } Modified: openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/user/IUserManager.java URL: http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/user/IUserManager.java?rev=1714149&r1=1714148&r2=1714149&view=diff ============================================================================== --- openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/user/IUserManager.java (original) +++ openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/user/IUserManager.java Fri Nov 13 01:24:41 2015 @@ -44,18 +44,12 @@ public interface IUserManager { Long registerUserInit(Set<Right> rights, String login, String password, String lastname, String firstname, String email, Date age, String street, String additionalname, String fax, String zip, long stateId, - String town, long language_id, boolean sendWelcomeMessage, - List<Long> organisations, String phone, boolean sendSMS, Boolean sendConfirmation, + String town, long languageId, boolean sendWelcomeMessage, + List<Long> groups, String phone, boolean sendSMS, Boolean sendConfirmation, TimeZone timezone, Boolean forceTimeZoneCheck, String userOffers, String userSearchs, Boolean showContactData, Boolean showContactDataToContacts, String activatedHash) throws Exception; - Long registerUserNoEmail(String login, String Userpass, - String lastname, String firstname, String email, Date age, - String street, String additionalname, String fax, String zip, - long stateId, String town, long language_id, String phone, boolean sendSMS, - boolean generateSipUserData, String jNameTimeZone); - Long getLanguage(Locale loc); State getCountry(Locale loc); User loginOAuth(Map<String, String> params, long serverId) throws IOException, NoSuchAlgorithmException; Modified: openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/user/IUserService.java URL: http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/user/IUserService.java?rev=1714149&r1=1714148&r2=1714149&view=diff ============================================================================== --- openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/user/IUserService.java (original) +++ openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/user/IUserService.java Fri Nov 13 01:24:41 2015 @@ -20,6 +20,7 @@ package org.apache.openmeetings.db.dao.u //FIXME HACK to bypass cross project compilation public interface IUserService { - Boolean kickUserByStreamId(String SID, String streamid, long serverId); - Boolean kickUserBySessionId(String SID, long userId, String sessionId); + Boolean kickUserByStreamId(String sid, String streamid, long serverId); + + Boolean kickUserBySessionId(String sid, long userId, String sessionId); } Modified: openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/user/PrivateMessageDao.java URL: http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/user/PrivateMessageDao.java?rev=1714149&r1=1714148&r2=1714149&view=diff ============================================================================== --- openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/user/PrivateMessageDao.java (original) +++ openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/user/PrivateMessageDao.java Fri Nov 13 01:24:41 2015 @@ -105,7 +105,7 @@ public class PrivateMessageDao implement private String getQuery(boolean isCount, String search, String orderBy, boolean asc) { StringBuilder hql = new StringBuilder("SELECT "); hql.append(isCount ? "COUNT(" : "").append("m").append(isCount ? ")" : "") - .append(" FROM PrivateMessage m WHERE m.owner.user_id = :ownerId ") + .append(" FROM PrivateMessage m WHERE m.owner.id = :ownerId ") .append(" AND m.folderId = :folderId "); if (!StringUtils.isEmpty(search)) { Modified: openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/user/PrivateMessageFolderDao.java URL: http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/user/PrivateMessageFolderDao.java?rev=1714149&r1=1714148&r2=1714149&view=diff ============================================================================== --- openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/user/PrivateMessageFolderDao.java (original) +++ openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/user/PrivateMessageFolderDao.java Fri Nov 13 01:24:41 2015 @@ -67,7 +67,7 @@ public class PrivateMessageFolderDao imp } public PrivateMessageFolder get(long id) { - String hql = "select c from PrivateMessageFolder c where c.privateMessageFolderId = :id "; + String hql = "select c from PrivateMessageFolder c where c.id = :id "; TypedQuery<PrivateMessageFolder> query = em.createQuery(hql, PrivateMessageFolder.class); query.setParameter("id", id); @@ -82,7 +82,7 @@ public class PrivateMessageFolderDao imp } public List<PrivateMessageFolder> get(int start, int count) { - return em.createQuery("SELECT c FROM PrivateMessageFolder c ORDER BY c.privateMessageFolderId", PrivateMessageFolder.class) + return em.createQuery("SELECT c FROM PrivateMessageFolder c ORDER BY c.id", PrivateMessageFolder.class) .setFirstResult(start).setMaxResults(count) .getResultList(); } Modified: openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/user/UserContactDao.java URL: http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/user/UserContactDao.java?rev=1714149&r1=1714148&r2=1714149&view=diff ============================================================================== --- openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/user/UserContactDao.java (original) +++ openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/user/UserContactDao.java Fri Nov 13 01:24:41 2015 @@ -43,13 +43,13 @@ public class UserContactDao { @Autowired private UserDao userDao; - public Long addUserContact(Long user_id, Long ownerId, Boolean pending, String hash) { + public Long addUserContact(Long userId, Long ownerId, Boolean pending, String hash) { try { UserContact userContact = new UserContact(); userContact.setInserted(new Date()); userContact.setOwner(userDao.get(ownerId)); - userContact.setContact(userDao.get(user_id)); + userContact.setContact(userDao.get(userId)); userContact.setPending(pending); userContact.setHash(hash); @@ -124,7 +124,7 @@ public class UserContactDao { public List<UserContact> get(long ownerId, int first, int count) { TypedQuery<UserContact> q = em.createNamedQuery("getContactsByUser", UserContact.class); - q.setParameter("user_id", ownerId); + q.setParameter("userId", ownerId); q.setFirstResult(first); q.setMaxResults(count); return q.getResultList(); @@ -132,7 +132,7 @@ public class UserContactDao { public long count(long ownerId) { TypedQuery<Long> q = em.createNamedQuery("countContactsByUser", Long.class); - q.setParameter("user_id", ownerId); + q.setParameter("userId", ownerId); return q.getSingleResult(); } @@ -178,10 +178,10 @@ public class UserContactDao { return null; } - public List<UserContact> getContactRequestsByUserAndStatus(Long user_id, Boolean pending) { + public List<UserContact> getContactRequestsByUserAndStatus(Long userId, Boolean pending) { try { TypedQuery<UserContact> query = em.createNamedQuery("getContactRequestsByUserAndStatus", UserContact.class); - query.setParameter("user_id", user_id); + query.setParameter("userId", userId); query.setParameter("pending", pending); return query.getResultList(); } catch (Exception e) { Modified: openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/user/UserDao.java URL: http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/user/UserDao.java?rev=1714149&r1=1714148&r2=1714149&view=diff ============================================================================== --- openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/user/UserDao.java (original) +++ openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/user/UserDao.java Fri Nov 13 01:24:41 2015 @@ -45,14 +45,14 @@ import org.apache.openjpa.persistence.Op import org.apache.openmeetings.db.dao.IDataProviderDao; import org.apache.openmeetings.db.dao.basic.ConfigurationDao; import org.apache.openmeetings.db.entity.user.Address; -import org.apache.openmeetings.db.entity.user.Organisation_Users; +import org.apache.openmeetings.db.entity.user.GroupUser; import org.apache.openmeetings.db.entity.user.User; import org.apache.openmeetings.db.entity.user.User.Right; import org.apache.openmeetings.db.entity.user.User.Salutation; import org.apache.openmeetings.db.entity.user.User.Type; +import org.apache.openmeetings.db.util.AuthLevelUtil; import org.apache.openmeetings.db.util.TimezoneUtil; import org.apache.openmeetings.db.util.UserHelper; -import org.apache.openmeetings.db.util.AuthLevelUtil; import org.apache.openmeetings.util.DaoHelper; import org.apache.openmeetings.util.OmException; import org.apache.openmeetings.util.crypt.ManageCryptStyle; @@ -124,7 +124,7 @@ public class UserDao implements IDataPro } private String getAdditionalJoin(boolean filterContacts) { - return filterContacts ? "LEFT JOIN u.organisation_users ou" : null; + return filterContacts ? "LEFT JOIN u.groupUsers ou" : null; } private String getAdditionalWhere(boolean excludeContacts, Map<String, Object> params) { @@ -139,7 +139,7 @@ public class UserDao implements IDataPro if (filterContacts) { params.put("ownerId", ownerId); params.put("contact", Type.contact); - return "((u.type <> :contact AND ou.organisation.organisation_id IN (SELECT ou.organisation.organisation_id FROM Organisation_Users ou WHERE ou.user.user_id = :ownerId)) " + return "((u.type <> :contact AND ou.group.id IN (SELECT ou.group.id FROM GroupUser ou WHERE ou.user.id = :ownerId)) " + "OR (u.type = :contact AND u.ownerId = :ownerId))"; } return null; @@ -203,8 +203,8 @@ public class UserDao implements IDataPro } public User update(User u, Long userId) { - if (u.getOrganisation_users() != null) { - for (Organisation_Users ou : u.getOrganisation_users()) { + if (u.getGroupUsers() != null) { + for (GroupUser ou : u.getGroupUsers()) { ou.setUser(u); } } @@ -218,8 +218,8 @@ public class UserDao implements IDataPro u.setUpdated(new Date()); u = em.merge(u); } - //this is necessary due to organisation details are lost on update - for (Organisation_Users ou : u.getOrganisation_users()) { + //this is necessary due to group details are lost on update + for (GroupUser ou : u.getGroupUsers()) { em.refresh(ou); } return u; @@ -244,20 +244,20 @@ public class UserDao implements IDataPro deleteUserID(u.getId()); } - public User get(long user_id) { - return get(user_id, false); + public User get(long id) { + return get(id, false); } - private User get(long user_id, boolean force) { + private User get(long id, boolean force) { User u = null; - if (user_id > 0) { + if (id > 0) { OpenJPAEntityManager oem = OpenJPAPersistence.cast(em); boolean qrce = oem.getFetchPlan().getQueryResultCacheEnabled(); oem.getFetchPlan().setQueryResultCacheEnabled(false); //FIXME update in cache during update - TypedQuery<User> q = oem.createNamedQuery("getUserById", User.class).setParameter("id", user_id); + TypedQuery<User> q = oem.createNamedQuery("getUserById", User.class).setParameter("id", id); @SuppressWarnings("unchecked") OpenJPAQuery<User> kq = OpenJPAPersistence.cast(q); - kq.getFetchPlan().addFetchGroup("orgUsers"); + kq.getFetchPlan().addFetchGroup("groupUsers"); if (force) { kq.getFetchPlan().addFetchGroup("backupexport"); } @@ -268,7 +268,7 @@ public class UserDao implements IDataPro } oem.getFetchPlan().setQueryResultCacheEnabled(qrce); } else { - log.info("[get] " + "Info: No USER_ID given"); + log.info("[get] " + "Info: No user id given"); } return u; } @@ -277,10 +277,10 @@ public class UserDao implements IDataPro try { if (userId != 0) { User us = get(userId); - for (Organisation_Users ou : us.getOrganisation_users()){ + for (GroupUser ou : us.getGroupUsers()){ em.remove(ou); } - us.setOrganisation_users(null); + us.setGroupUsers(null); us.setDeleted(true); us.setUpdated(new Date()); us.setSipUser(null); @@ -318,7 +318,7 @@ public class UserDao implements IDataPro TypedQuery<User> q = em.createNamedQuery("getAllUsers", User.class); @SuppressWarnings("unchecked") OpenJPAQuery<User> kq = OpenJPAPersistence.cast(q); - kq.getFetchPlan().addFetchGroups("backupexport", "orgUsers"); + kq.getFetchPlan().addFetchGroups("backupexport", "groupUsers"); return kq.getResultList(); } catch (Exception ex2) { log.error("[getAllUsersDeleted] ", ex2); @@ -364,7 +364,7 @@ public class UserDao implements IDataPro return false; } } - + public boolean validLogin(String login) { return !Strings.isEmpty(login) && login.length() >= UserHelper.getMinLoginLength(cfgDao); } @@ -398,7 +398,7 @@ public class UserDao implements IDataPro } return u; } - + public Object getUserByHash(String hash) { if (hash.length() == 0) { return new Long(-5); @@ -618,9 +618,9 @@ public class UserDao implements IDataPro if (!AuthLevelUtil.hasLoginLevel(u.getRights())) { throw new OmException(-41L); } - log.debug("loginUser " + u.getOrganisation_users()); - if (u.getOrganisation_users().isEmpty()) { - throw new OmException("No Organization assigned to user"); + log.debug("loginUser " + u.getGroupUsers()); + if (u.getGroupUsers().isEmpty()) { + throw new OmException("No Group assigned to user"); } u.setLastlogin(new Date()); @@ -641,10 +641,10 @@ public class UserDao implements IDataPro return a; } - public User addUser(Set<Right> rights, String firstname, String login, String lastname, long language_id, + public User addUser(Set<Right> rights, String firstname, String login, String lastname, long languageId, String userpass, Address adress, boolean sendSMS, Date age, String hash, TimeZone timezone, Boolean forceTimeZoneCheck, String userOffers, String userSearchs, Boolean showContactData, - Boolean showContactDataToContacts, String externalId, String externalType, List<Organisation_Users> orgList, String pictureuri) throws NoSuchAlgorithmException { + Boolean showContactDataToContacts, String externalId, String externalType, List<GroupUser> orgList, String pictureuri) throws NoSuchAlgorithmException { User u = new User(); u.setFirstname(firstname); @@ -673,14 +673,14 @@ public class UserDao implements IDataPro u.setShowContactDataToContacts(showContactDataToContacts); // this is needed cause the language is not a needed data at registering - u.setLanguageId(language_id != 0 ? language_id : null); + u.setLanguageId(languageId != 0 ? languageId : null); if (!Strings.isEmpty(userpass)) { u.updatePassword(cfgDao, userpass); } u.setRegdate(new Date()); u.setDeleted(false); u.setPictureuri(pictureuri); - u.setOrganisation_users(orgList); + u.setGroupUsers(orgList); return update(u, null); } Modified: openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dto/record/RecordingContainerData.java URL: http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dto/record/RecordingContainerData.java?rev=1714149&r1=1714148&r2=1714149&view=diff ============================================================================== --- openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dto/record/RecordingContainerData.java (original) +++ openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dto/record/RecordingContainerData.java Fri Nov 13 01:24:41 2015 @@ -21,15 +21,13 @@ package org.apache.openmeetings.db.dto.r import java.io.Serializable; public class RecordingContainerData implements Serializable { - - /** - * - */ - private static final long serialVersionUID = -7211000652612571746L; + private static final long serialVersionUID = 1L; private long userHomeSize; private long publicFileSize; + public RecordingContainerData() {} + public long getUserHomeSize() { return userHomeSize; } Modified: openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dto/record/RecordingDTO.java URL: http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dto/record/RecordingDTO.java?rev=1714149&r1=1714148&r2=1714149&view=diff ============================================================================== --- openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dto/record/RecordingDTO.java (original) +++ openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dto/record/RecordingDTO.java Fri Nov 13 01:24:41 2015 @@ -18,13 +18,21 @@ */ package org.apache.openmeetings.db.dto.record; +import java.io.Serializable; import java.util.ArrayList; import java.util.Date; import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlRootElement; + import org.apache.openmeetings.db.entity.record.Recording; -public class RecordingDTO { +@XmlRootElement +@XmlAccessorType(XmlAccessType.FIELD) +public class RecordingDTO implements Serializable { + private static final long serialVersionUID = 1L; private Long id; private String name; private String flvName; @@ -46,7 +54,7 @@ public class RecordingDTO { this.aviName = r.getAlternateDownload(); this.roomId = r.getRoomId(); this.status = r.getStatus().name(); - this.interview = r.getIsInterview(); + this.interview = r.isInterview(); this.start = r.getRecordStart(); this.end = r.getRecordEnd(); this.width = r.getWidth(); @@ -149,6 +157,5 @@ public class RecordingDTO { } } return rList; - } } Modified: openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dto/room/WhiteboardObjectList.java URL: http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dto/room/WhiteboardObjectList.java?rev=1714149&r1=1714148&r2=1714149&view=diff ============================================================================== --- openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dto/room/WhiteboardObjectList.java (original) +++ openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dto/room/WhiteboardObjectList.java Fri Nov 13 01:24:41 2015 @@ -23,16 +23,16 @@ import java.util.Map; public class WhiteboardObjectList { - private Long room_id; + private Long roomId; private Map<Long,WhiteboardObject> whiteboardObjects = new HashMap<Long,WhiteboardObject>(); public WhiteboardObjectList() {} - public Long getRoom_id() { - return room_id; + public Long getRoomId() { + return roomId; } - public void setRoom_id(Long roomId) { - room_id = roomId; + public void setRoomId(Long roomId) { + this.roomId = roomId; } public Map<Long, WhiteboardObject> getWhiteboardObjects() { return whiteboardObjects; Modified: openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dto/room/WhiteboardSyncLockObject.java URL: http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dto/room/WhiteboardSyncLockObject.java?rev=1714149&r1=1714148&r2=1714149&view=diff ============================================================================== --- openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dto/room/WhiteboardSyncLockObject.java (original) +++ openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dto/room/WhiteboardSyncLockObject.java Fri Nov 13 01:24:41 2015 @@ -27,7 +27,7 @@ public class WhiteboardSyncLockObject { private boolean isCurrentLoadingItem = false; private Date addtime; - private Date starttime; + private Date inserted; public WhiteboardSyncLockObject() {} @@ -47,12 +47,12 @@ public class WhiteboardSyncLockObject { this.isInitialLoaded = isInitialLoaded; } - public Date getStarttime() { - return starttime; + public Date getInserted() { + return inserted; } - public void setStarttime(Date starttime) { - this.starttime = starttime; + public void setInserted(Date inserted) { + this.inserted = inserted; } public boolean isCurrentLoadingItem() { Modified: openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dto/server/ClientSessionInfo.java URL: http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dto/server/ClientSessionInfo.java?rev=1714149&r1=1714148&r2=1714149&view=diff ============================================================================== --- openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dto/server/ClientSessionInfo.java (original) +++ openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dto/server/ClientSessionInfo.java Fri Nov 13 01:24:41 2015 @@ -26,6 +26,8 @@ public class ClientSessionInfo { private Client rcl; public Long serverId; + public ClientSessionInfo() {} + public ClientSessionInfo(Client rcl, Long serverId) { super(); this.rcl = rcl; Modified: openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/entity/basic/ChatMessage.java URL: http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/entity/basic/ChatMessage.java?rev=1714149&r1=1714148&r2=1714149&view=diff ============================================================================== --- openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/entity/basic/ChatMessage.java (original) +++ openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/entity/basic/ChatMessage.java Fri Nov 13 01:24:41 2015 @@ -44,12 +44,12 @@ import org.simpleframework.xml.Root; @NamedQuery(name = "getChatMessageById", query = "SELECT c FROM ChatMessage c WHERE c.id = :id") , @NamedQuery(name = "getChatMessages", query = "SELECT c FROM ChatMessage c ORDER BY c.id") , @NamedQuery(name = "getGlobalChatMessages", query = "SELECT c FROM ChatMessage c WHERE c.toUser IS NULL AND c.toRoom IS NULL ORDER BY c.sent DESC") - , @NamedQuery(name = "getChatMessagesByRoom", query = "SELECT c FROM ChatMessage c WHERE c.toUser.user_id IS NULL AND c.toRoom.rooms_id = :roomId" + , @NamedQuery(name = "getChatMessagesByRoom", query = "SELECT c FROM ChatMessage c WHERE c.toUser.id IS NULL AND c.toRoom.id = :roomId" + " AND (true = :all OR (false = :all AND c.needModeration = false)) ORDER BY c.sent DESC") , @NamedQuery(name = "getChatMessagesByUser", query = "SELECT c FROM ChatMessage c WHERE c.toUser IS NOT NULL AND c.toRoom IS NULL AND " - + "(c.fromUser.user_id = :userId OR c.toUser.user_id = :userId) ORDER BY c.sent DESC") + + "(c.fromUser.id = :userId OR c.toUser.id = :userId) ORDER BY c.sent DESC") , @NamedQuery(name = "getChatMessagesByUserTime", query = "SELECT c FROM ChatMessage c WHERE c.toUser IS NOT NULL AND c.toRoom IS NULL AND " - + "(c.fromUser.user_id = :userId OR c.toUser.user_id = :userId) AND c.sent > :date ORDER BY c.sent DESC") + + "(c.fromUser.id = :userId OR c.toUser.id = :userId) AND c.sent > :date ORDER BY c.sent DESC") }) @Table(name = "chat") @Root(name = "ChatMessage")
