openmeetings-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From solo...@apache.org
Subject svn commit: r1442510 - in /openmeetings/trunk/singlewebapp/src/org/apache/openmeetings: data/basic/dao/ data/conference/ data/user/ data/user/dao/ ldap/ servlet/outputhandler/
Date Tue, 05 Feb 2013 09:22:33 GMT
Author: solomax
Date: Tue Feb  5 09:22:33 2013
New Revision: 1442510

URL: http://svn.apache.org/viewvc?rev=1442510&view=rev
Log:
Dao: anonymous update/delete is added

Modified:
    openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/basic/dao/ConfigurationDao.java
    openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/basic/dao/LdapConfigDao.java
    openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/basic/dao/ServerDao.java
    openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/conference/Roommanagement.java
    openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/Organisationmanagement.java
    openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/Usermanagement.java
    openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/dao/OrganisationDao.java
    openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/dao/UsersDao.java
    openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/ldap/LdapLoginManagement.java
    openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/servlet/outputhandler/BackupImportController.java

Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/basic/dao/ConfigurationDao.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/basic/dao/ConfigurationDao.java?rev=1442510&r1=1442509&r2=1442510&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/basic/dao/ConfigurationDao.java
(original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/basic/dao/ConfigurationDao.java
Tue Feb  5 09:22:33 2013
@@ -374,7 +374,9 @@ public class ConfigurationDao implements
 			entity.setDeleted(false);
 			this.updateConfig(entity);
 		} else {
-			entity.setUser(usersDao.get(userId));
+			if (userId > 0) {
+				entity.setUser(usersDao.get(userId));
+			}
 			entity.setDeleted(false);
 			entity.setUpdatetime(new Date());
 			this.updateConfig(entity);
@@ -391,7 +393,9 @@ public class ConfigurationDao implements
 	}
 
 	public void delete(Configuration entity, long userId) {
-		entity.setUser(usersDao.get(userId));
+		if (userId > 0) {
+			entity.setUser(usersDao.get(userId));
+		}
 		entity.setDeleted(true);
 		entity.setUpdatetime(new Date());
 		this.updateConfig(entity);

Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/basic/dao/LdapConfigDao.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/basic/dao/LdapConfigDao.java?rev=1442510&r1=1442509&r2=1442510&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/basic/dao/LdapConfigDao.java
(original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/basic/dao/LdapConfigDao.java
Tue Feb  5 09:22:33 2013
@@ -309,12 +309,16 @@ public class LdapConfigDao implements ID
 		try {
 			if (entity.getLdapConfigId() <= 0) {
 				entity.setInserted(new Date());
-				entity.setInsertedby(usersDao.get(userId));
+				if (userId > 0) {
+					entity.setInsertedby(usersDao.get(userId));
+				}
 				entity.setDeleted(false);
 				em.persist(entity);
 			} else {
 				entity.setUpdated(new Date());
-				entity.setUpdatedby(usersDao.get(userId));
+				if (userId > 0) {
+					entity.setUpdatedby(usersDao.get(userId));
+				}
 				entity.setDeleted(false);
 				em.merge(entity);
 			}
@@ -327,7 +331,9 @@ public class LdapConfigDao implements ID
 	public void delete(LdapConfig entity, long userId) {
 		if (entity.getLdapConfigId() >= 0) {
 			entity.setUpdated(new Date());
-			entity.setUpdatedby(usersDao.get(userId));
+			if (userId > 0) {
+				entity.setUpdatedby(usersDao.get(userId));
+			}
 			entity.setDeleted(true);
 			em.merge(entity);
 		}

Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/basic/dao/ServerDao.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/basic/dao/ServerDao.java?rev=1442510&r1=1442509&r2=1442510&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/basic/dao/ServerDao.java
(original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/basic/dao/ServerDao.java
Tue Feb  5 09:22:33 2013
@@ -164,13 +164,17 @@ public class ServerDao implements IDataP
 		if (entity.getId() > 0) {
 			if (userId > 0) {
 				entity.setUpdated(new Date());
-				entity.setUpdatedby(usersDao.get(userId));
+				if (userId > 0) {
+					entity.setUpdatedby(usersDao.get(userId));
+				}
 			}
 			em.merge(entity);
 		} else {
 			if (userId > 0) {
 				entity.setInserted(new Date());
-				entity.setInsertedby(usersDao.get(userId));
+				if (userId > 0) {
+					entity.setInsertedby(usersDao.get(userId));
+				}
 			}
 			em.persist(entity);
 		}
@@ -187,7 +191,9 @@ public class ServerDao implements IDataP
 	public void delete(Server entity, long userId) {
 		if (entity.getId() > 0) {
 			entity.setUpdated(new Date());
-			entity.setUpdatedby(usersDao.get(userId));
+			if (userId > 0) {
+				entity.setUpdatedby(usersDao.get(userId));
+			}
 			entity.setDeleted(true);
 			em.merge(entity);
 		}

Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/conference/Roommanagement.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/conference/Roommanagement.java?rev=1442510&r1=1442509&r2=1442510&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/conference/Roommanagement.java
(original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/conference/Roommanagement.java
Tue Feb  5 09:22:33 2013
@@ -1403,7 +1403,7 @@ public class Roommanagement {
 		try {
 			if (authLevelManagement.checkWebServiceLevel(user_level)) {
 				this.deleteAllRoomsOrganisationOfRoom(rooms_id);
-				roomDao.delete(roomDao.get(rooms_id), 1L);
+				roomDao.delete(roomDao.get(rooms_id), -1L);
 				return rooms_id;
 			}
 		} catch (Exception ex2) {
@@ -1510,7 +1510,7 @@ public class Roommanagement {
 
 			room.setIsClosed(status);
 
-			roomDao.update(room, 1L);
+			roomDao.update(room, -1L);
 
 		} catch (Exception e) {
 			log.error("Error updateRoomObject : ", e);

Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/Organisationmanagement.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/Organisationmanagement.java?rev=1442510&r1=1442509&r2=1442510&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/Organisationmanagement.java
(original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/Organisationmanagement.java
Tue Feb  5 09:22:33 2013
@@ -451,7 +451,7 @@ public class Organisationmanagement {
 			List<Organisation_Users> l = u.getOrganisation_users();
 			l.add(orgUser);
 			u.setOrganisation_users(l);
-			usersDao.update(u, 1L);
+			usersDao.update(u, -1L);
 			
 			return orgUser.getOrganisation_users_id();
 		} catch (Exception ex2) {
@@ -497,7 +497,7 @@ public class Organisationmanagement {
 					}
 				}
 				u.setOrganisation_users(l);
-				usersDao.update(u, 1L);
+				usersDao.update(u, -1L);
 
 				return id;
 			} else {

Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/Usermanagement.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/Usermanagement.java?rev=1442510&r1=1442509&r2=1442510&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/Usermanagement.java
(original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/Usermanagement.java
Tue Feb  5 09:22:33 2013
@@ -1290,7 +1290,7 @@ public class Usermanagement {
 		log.debug("User: " + us.getLogin());
 		us.setResethash(cryptManager.getInstanceOfCrypt().createPassPhrase(
 				loginData));
-		usersDao.update(us, 1L);
+		usersDao.update(us, -1L);
 		String reset_link = appLink + "?lzproxied=solo&hash="
 				+ us.getResethash();
 
@@ -1549,7 +1549,7 @@ public class Usermanagement {
 	}
 
 	public void updateUser(User user) {
-		usersDao.update(user, 1L);
+		usersDao.update(user, -1L);
 	}
 
 	/**

Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/dao/OrganisationDao.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/dao/OrganisationDao.java?rev=1442510&r1=1442509&r2=1442510&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/dao/OrganisationDao.java
(original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/dao/OrganisationDao.java
Tue Feb  5 09:22:33 2013
@@ -76,11 +76,15 @@ public class OrganisationDao implements 
 	
 	public Organisation update(Organisation entity, long userId) {
 		if (entity.getOrganisation_id() == null) {
-			entity.setInsertedby(userId);
+			if (userId > 0) {
+				entity.setInsertedby(userId);
+			}
 			entity.setStarttime(new Date());
 			em.persist(entity);
 		} else {
-			entity.setUpdatedby(userId);
+			if (userId > 0) {
+				entity.setUpdatedby(userId);
+			}
 			entity.setUpdatetime(new Date());
 			em.merge(entity);
 		}
@@ -93,7 +97,9 @@ public class OrganisationDao implements 
 			.executeUpdate();
 
 		entity.setDeleted(true);
-		entity.setUpdatedby(userId);
+		if (userId > 0) {
+			entity.setUpdatedby(userId);
+		}
 
 		em.merge(entity);
 	}

Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/dao/UsersDao.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/dao/UsersDao.java?rev=1442510&r1=1442509&r2=1442510&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/dao/UsersDao.java
(original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/dao/UsersDao.java
Tue Feb  5 09:22:33 2013
@@ -303,7 +303,7 @@ public class UsersDao implements IDataPr
 				User us = (User) u;
 				us.updatePassword(cryptManager, configDao, pass);
 				us.setResethash("");
-				update(us, 1L);
+				update(us, -1L);
 				return new Long(-8);
 			} else {
 				return u;

Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/ldap/LdapLoginManagement.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/ldap/LdapLoginManagement.java?rev=1442510&r1=1442509&r2=1442510&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/ldap/LdapLoginManagement.java
(original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/ldap/LdapLoginManagement.java
Tue Feb  5 09:22:33 2013
@@ -573,7 +573,7 @@ public class LdapLoginManagement {
 					u.updatePassword(cryptManager, configDao, passwd);
 				}
 
-				usersDao.update(u, 1L);
+				usersDao.update(u, -1L);
 			} catch (Exception e) {
 				log.error("Error updating user : " + e.getMessage());
 				return new Long(-1);
@@ -726,7 +726,7 @@ public class LdapLoginManagement {
 			
 			User user = usersDao.get(newUserId);
 			user.setPictureuri(pictureUri);
-			usersDao.update(user, 1L);
+			usersDao.update(user, -1L);
 
 		} catch (Exception e) {
 			log.error("Error creating user : " + e.getMessage());

Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/servlet/outputhandler/BackupImportController.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/servlet/outputhandler/BackupImportController.java?rev=1442510&r1=1442509&r2=1442510&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/servlet/outputhandler/BackupImportController.java
(original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/servlet/outputhandler/BackupImportController.java
Tue Feb  5 09:22:33 2013
@@ -284,7 +284,7 @@ public class BackupImportController exte
 				u.setStarttime(new Date());
 				long userId = u.getUser_id();
 				u.setUser_id(null);
-				usersDao.update(u, 1L);
+				usersDao.update(u, -1L);
 				usersMap.put(userId, u.getUser_id());
 			}
 		}
@@ -321,7 +321,7 @@ public class BackupImportController exte
 						}
 					}
 				}
-				r = roomDao.update(r, 1L);
+				r = roomDao.update(r, -1L);
 				if (mm != null) {
 					mm.setConfno(roommanagement.getSipNumber(r.getRooms_id()));
 					r.setMeetme(mm);
@@ -603,7 +603,7 @@ public class BackupImportController exte
 						c.setConf_value(MD5Implementation.class.getCanonicalName());
 					}
 				}
-				configurationDao.update(c, 1L);
+				configurationDao.update(c, -1L);
 			}
 		}
 



Mime
View raw message