From 1f832ccfed4c0552c95cdfd166c60d372afb0959 Mon Sep 17 00:00:00 2001 From: Michael Wilson Date: Wed, 29 Oct 2014 09:37:01 +0100 Subject: Berechtigung für Veranstaltung korrigiert --- .../java/gui/image/PermissionCreateImage_GUI.java | 2 +- .../java/gui/image/PermissionEditImage_GUI.java | 2 +- .../main/java/gui/lecture/EditLectureLink_GUI.java | 31 +++--- .../gui/lecture/PermissionCreateLecture_GUI.java | 7 +- .../gui/lecture/PermissionEditLecture_GUI.java | 11 ++- .../src/main/java/util/CheckIntegrity.java | 107 +++++++++++++++------ 6 files changed, 108 insertions(+), 52 deletions(-) (limited to 'dozentenmodul/src/main/java') diff --git a/dozentenmodul/src/main/java/gui/image/PermissionCreateImage_GUI.java b/dozentenmodul/src/main/java/gui/image/PermissionCreateImage_GUI.java index 239b5a0f..827c5e8d 100644 --- a/dozentenmodul/src/main/java/gui/image/PermissionCreateImage_GUI.java +++ b/dozentenmodul/src/main/java/gui/image/PermissionCreateImage_GUI.java @@ -578,7 +578,7 @@ public class PermissionCreateImage_GUI extends JFrame { isLink = (boolean) table.getValueAt(selectedRow, 3); isAdmin = (boolean) table.getValueAt(selectedRow, 4); - boolean[] checkedVals = CheckIntegrity.isIntegre(isRead, isWrite, + boolean[] checkedVals = CheckIntegrity.isIntegreForImage(isRead, isWrite, isLink, isAdmin); table.setValueAt(checkedVals[0], selectedRow, 1); diff --git a/dozentenmodul/src/main/java/gui/image/PermissionEditImage_GUI.java b/dozentenmodul/src/main/java/gui/image/PermissionEditImage_GUI.java index 8de41289..c80d5a52 100644 --- a/dozentenmodul/src/main/java/gui/image/PermissionEditImage_GUI.java +++ b/dozentenmodul/src/main/java/gui/image/PermissionEditImage_GUI.java @@ -634,7 +634,7 @@ public class PermissionEditImage_GUI extends JFrame { isLink = (boolean) table.getValueAt(selectedRow, 3); isAdmin = (boolean) table.getValueAt(selectedRow, 4); - boolean[] checkedVals = CheckIntegrity.isIntegre(isRead, isWrite, + boolean[] checkedVals = CheckIntegrity.isIntegreForImage(isRead, isWrite, isLink, isAdmin); table.setValueAt(checkedVals[0], selectedRow, 1); diff --git a/dozentenmodul/src/main/java/gui/lecture/EditLectureLink_GUI.java b/dozentenmodul/src/main/java/gui/lecture/EditLectureLink_GUI.java index 478c1bc0..af2ef7e6 100644 --- a/dozentenmodul/src/main/java/gui/lecture/EditLectureLink_GUI.java +++ b/dozentenmodul/src/main/java/gui/lecture/EditLectureLink_GUI.java @@ -521,8 +521,8 @@ public class EditLectureLink_GUI extends JFrame { buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); getContentPane().add(buttonPane); { - JButton okButton = new JButton("Zurück"); - okButton.addActionListener(new ActionListener() { + JButton btnBack = new JButton("Zurück"); + btnBack.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { PermissionEditLecture_GUI el = new PermissionEditLecture_GUI( @@ -531,14 +531,14 @@ public class EditLectureLink_GUI extends JFrame { dispose(); } }); - okButton.setActionCommand("OK"); - buttonPane.add(okButton); - getRootPane().setDefaultButton(okButton); + btnBack.setActionCommand("OK"); + buttonPane.add(btnBack); + getRootPane().setDefaultButton(btnBack); } { - JButton cancelButton = new JButton( + JButton btnFinish = new JButton( "Veranstaltung ändern und abschließen"); - cancelButton.addActionListener(new ActionListener() { + btnFinish.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String username = person.verantwortlicher.getName() + " " + person.verantwortlicher.getVorname(); @@ -607,7 +607,12 @@ public class EditLectureLink_GUI extends JFrame { + "/" + RightsManagement.rightsManagement .getPermittedUserList() - .size()); + .size() + +", r="+RightsManagement.rightsManagement.getPermittedUserList().get(i).isLecture_read() + +", w="+RightsManagement.rightsManagement.getPermittedUserList().get(i).isLecture_write() + +", a="+RightsManagement.rightsManagement.getPermittedUserList().get(i).isLecture_admin() + ); + client.writeAdditionalLectureRights( Lecture.lecture.getName(), RightsManagement.rightsManagement @@ -615,13 +620,13 @@ public class EditLectureLink_GUI extends JFrame { .get(i).getUserID(), // userID RightsManagement.rightsManagement .getPermittedUserList() - .get(i).isImageRead(),// read + .get(i).isLecture_read(),// read RightsManagement.rightsManagement .getPermittedUserList() - .get(i).isImageWrite(),// write + .get(i).isLecture_write(),// write RightsManagement.rightsManagement .getPermittedUserList() - .get(i).isImageAdmin()// admin + .get(i).isLecture_admin()// admin ); }// end for @@ -883,8 +888,8 @@ public class EditLectureLink_GUI extends JFrame { } }); - cancelButton.setActionCommand("Cancel"); - buttonPane.add(cancelButton); + btnFinish.setActionCommand("Cancel"); + buttonPane.add(btnFinish); } } diff --git a/dozentenmodul/src/main/java/gui/lecture/PermissionCreateLecture_GUI.java b/dozentenmodul/src/main/java/gui/lecture/PermissionCreateLecture_GUI.java index 378273b3..d4d49ec2 100644 --- a/dozentenmodul/src/main/java/gui/lecture/PermissionCreateLecture_GUI.java +++ b/dozentenmodul/src/main/java/gui/lecture/PermissionCreateLecture_GUI.java @@ -562,12 +562,11 @@ public class PermissionCreateLecture_GUI extends JFrame { isWrite = (boolean) tablePermittedUsers.getValueAt(selectedRow, 2); isAdmin = (boolean) tablePermittedUsers.getValueAt(selectedRow, 3); - boolean[] checkedVals = CheckIntegrity.isIntegre(isRead, isWrite,isAdmin, false); + boolean[] checkedVals = CheckIntegrity.isIntegreForLecture(isRead, isWrite,isAdmin); tablePermittedUsers.setValueAt(checkedVals[0], selectedRow, 1); tablePermittedUsers.setValueAt(checkedVals[1], selectedRow, 2); - tablePermittedUsers.setValueAt(checkedVals[3], selectedRow, 3); - // tablePermittedUsers.setValueAt(checkedVals[3], selectedRow, 4); + tablePermittedUsers.setValueAt(checkedVals[2], selectedRow, 3); }// end checkIntegrity() // Column 0 == Concat user name @@ -711,8 +710,6 @@ class CheckBoxHeader extends JCheckBox implements TableCellRenderer, } } setColumn(column); - // rendererComponent.setText("Check All"); - // setBorder(UIManager.getBorder("TableHeader.cellBorder")); return rendererComponent; } diff --git a/dozentenmodul/src/main/java/gui/lecture/PermissionEditLecture_GUI.java b/dozentenmodul/src/main/java/gui/lecture/PermissionEditLecture_GUI.java index cb01d824..05b7959e 100644 --- a/dozentenmodul/src/main/java/gui/lecture/PermissionEditLecture_GUI.java +++ b/dozentenmodul/src/main/java/gui/lecture/PermissionEditLecture_GUI.java @@ -203,6 +203,13 @@ public class PermissionEditLecture_GUI extends JFrame { panel_1.add(scrollPane); table = new JTable(); + table.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + checkIntegrity(-1); + } + }); + table.setModel(model); table.setSelectionForeground(Color.WHITE); @@ -573,11 +580,11 @@ public class PermissionEditLecture_GUI extends JFrame { isWrite = (boolean) table.getValueAt(selectedRow, 2); isAdmin = (boolean) table.getValueAt(selectedRow, 3); - boolean[] checkedVals = CheckIntegrity.isIntegre(isRead, isWrite,isAdmin, false); + boolean[] checkedVals = CheckIntegrity.isIntegreForLecture(isRead, isWrite,isAdmin); table.setValueAt(checkedVals[0], selectedRow, 1); table.setValueAt(checkedVals[1], selectedRow, 2); - table.setValueAt(checkedVals[3], selectedRow, 3); + table.setValueAt(checkedVals[2], selectedRow, 3); }// end checkIntegrity() // save the entered rights into the model and prepare them to be written to diff --git a/dozentenmodul/src/main/java/util/CheckIntegrity.java b/dozentenmodul/src/main/java/util/CheckIntegrity.java index bb5becbd..faded054 100644 --- a/dozentenmodul/src/main/java/util/CheckIntegrity.java +++ b/dozentenmodul/src/main/java/util/CheckIntegrity.java @@ -2,73 +2,120 @@ package util; public class CheckIntegrity { - //private static boolean isFine = false; + // private static boolean isFine = false; + + // integrity check on permissions put by user for an image + public static boolean[] isIntegreForImage(boolean isRead, boolean isWrite, + boolean isLink, boolean isAdmin) { - // integrity check on permissions put by user - public static boolean[] isIntegre(boolean isRead, boolean isWrite,boolean isLink, boolean isAdmin) - { - // boolean array for the correct result values boolean[] rights = new boolean[4]; rights[0] = isRead; rights[1] = isWrite; rights[2] = isLink; rights[3] = isAdmin; - - System.out.println("*****************************"); - System.out.println(isRead+" "+isWrite+" "+isLink+" "+isAdmin); + System.out.println("*****************************"); + System.out.println(isRead + " " + isWrite + " " + isLink + " " + + isAdmin); - if(isRead) //if read is allowed, only read is allowed + if (isRead) // if read is allowed, only read is allowed { - rights[0] = true; //read allowed - } - else //if read is not allowed, nothing is allowed + rights[0] = true; // read allowed + } else // if read is not allowed, nothing is allowed { rights[0] = false; rights[1] = false; rights[2] = false; rights[3] = false; } - - if(isWrite) //if write was selected + + if (isWrite) // if write was selected { rights[0] = true; rights[1] = true; - } - else //if write was unselected + } else // if write was unselected { - //rights[0] = false; + // rights[0] = false; rights[1] = false; } - - if(isLink) //if link was selected, read and link are allowed + + if (isLink) // if link was selected, read and link are allowed { rights[0] = true; rights[2] = true; - } - else //if link is unselected, link is not allowed + } else // if link is unselected, link is not allowed { rights[2] = false; } - - if(isAdmin) //if admin is selected, anything is allowed + + if (isAdmin) // if admin is selected, anything is allowed { rights[0] = true; rights[1] = true; rights[2] = true; rights[3] = true; - } - else //if admin is unselected, admin is not allowed + } else // if admin is unselected, admin is not allowed { rights[3] = false; } - + + System.out.println(">-------------<"); + System.out.println(rights[0] + " " + rights[1] + " " + rights[2] + " " + + rights[3]); + + return rights; + + }// end isIntegreForImage() + + + // integrity check on permissions put by user for a lecture + public static boolean[] isIntegreForLecture(boolean isRead, boolean isWrite, boolean isAdmin) { + + // boolean array for the correct result values + boolean[] rights = new boolean[4]; + rights[0] = isRead; + rights[1] = isWrite; + rights[2] = isAdmin; + + System.out.println("*****************************"); + System.out.println(isRead + " " + isWrite + " " + isAdmin); + + if (isRead) // if read is allowed, only read is allowed + { + rights[0] = true; // read allowed + } else // if read is not allowed, nothing is allowed + { + rights[0] = false; + rights[1] = false; + rights[2] = false; + } + + if (isWrite) // if write was selected + { + rights[0] = true; + rights[1] = true; + } else // if write was unselected + { + // rights[0] = false; + rights[1] = false; + } + + if (isAdmin) // if admin is selected, anything is allowed + { + rights[0] = true; + rights[1] = true; + rights[2] = true; + } else // if admin is unselected, admin is not allowed + { + rights[2] = false; + } + System.out.println(">-------------<"); - System.out.println(rights[0]+" "+rights[1]+" "+rights[2]+" "+rights[3]); - + System.out.println(rights[0] + " " + rights[1] + " " + rights[2]); + return rights; - - } + + }// end isIntegreForLecture() } -- cgit v1.2.3-55-g7522 From 9739aa18fda6f6ebdcac0f939a5ab5b5ad32cc00 Mon Sep 17 00:00:00 2001 From: Michael Wilson Date: Wed, 29 Oct 2014 11:21:35 +0100 Subject: -Löschen der Berechtigungen bei gelöschtem Image/Versanstaltung implementiert -Recht "LinkAllowed" wird jetzt korrekt gesetzt --- .../main/java/gui/image/FTPCreateUploader_GUI.java | 10 ++++++++++ .../src/main/java/server/ServerHandler.java | 19 +++++++++++++++---- dozentenmodulserver/src/main/java/sql/SQL.java | 22 +++++++++++++++------- 3 files changed, 40 insertions(+), 11 deletions(-) (limited to 'dozentenmodul/src/main/java') diff --git a/dozentenmodul/src/main/java/gui/image/FTPCreateUploader_GUI.java b/dozentenmodul/src/main/java/gui/image/FTPCreateUploader_GUI.java index b222b7ed..8db64f4f 100644 --- a/dozentenmodul/src/main/java/gui/image/FTPCreateUploader_GUI.java +++ b/dozentenmodul/src/main/java/gui/image/FTPCreateUploader_GUI.java @@ -697,6 +697,16 @@ public class FTPCreateUploader_GUI extends JFrame implements RightsManagement.rightsManagement.getPermittedUserList().get(i).isImageLinkAllowed(), RightsManagement.rightsManagement.getPermittedUserList().get(i).isImageAdmin() ); + /* + LOGGER.info( + "Name: "+Image.image.getImagename() + +"\tUserID: "+RightsManagement.rightsManagement.getPermittedUserList().get(i).getUserID() + +"\tisImageRead: "+RightsManagement.rightsManagement.getPermittedUserList().get(i).isImageRead() + +"\tisImageWrite: "+RightsManagement.rightsManagement.getPermittedUserList().get(i).isImageWrite() + +"\tisImageLInkAllowed: "+RightsManagement.rightsManagement.getPermittedUserList().get(i).isImageLinkAllowed() + +"\tisImageAdmin: "+RightsManagement.rightsManagement.getPermittedUserList().get(i).isImageAdmin() + ); + */ }//end for diff --git a/dozentenmodulserver/src/main/java/server/ServerHandler.java b/dozentenmodulserver/src/main/java/server/ServerHandler.java index d4b763cb..1aeb8820 100644 --- a/dozentenmodulserver/src/main/java/server/ServerHandler.java +++ b/dozentenmodulserver/src/main/java/server/ServerHandler.java @@ -429,8 +429,13 @@ public class ServerHandler implements Server.Iface { @Override public boolean deleteImageData(String id, String version) throws TException { - - return sql.deleteImage(id, version); + boolean success=false; + + if(sql.deleteImage(id, version)==true){ + success=true; + log.info("Image '"+id+"' and permissions successfully deleted."); + } + return success; } @Override @@ -441,6 +446,7 @@ public class ServerHandler implements Server.Iface { } public boolean deleteLecture(String id, String hs, String user) { + boolean success = false; Map map = new HashMap(); map = sql.getDeleteXMLData(id); try { @@ -456,8 +462,12 @@ public class ServerHandler implements Server.Iface { log.info(new Date() + " - Failed to execute deleteLecture"); e.printStackTrace(); } - return sql.deleteLecture(id); - + + if(sql.deleteLecture(id) == true){ + success = true; + log.info("Lecture '"+id+"' and permissions successfully deleted."); + } + return success; } @Override @@ -604,6 +614,7 @@ public class ServerHandler implements Server.Iface { // return null; } + //set permissions for users which are !=userID public boolean writeAdditionalImageRights(String imageName, String userID, boolean isRead, boolean isWrite, boolean isLinkAllowed, boolean isAdmin) { diff --git a/dozentenmodulserver/src/main/java/sql/SQL.java b/dozentenmodulserver/src/main/java/sql/SQL.java index 3990bf4e..80b97623 100644 --- a/dozentenmodulserver/src/main/java/sql/SQL.java +++ b/dozentenmodulserver/src/main/java/sql/SQL.java @@ -839,16 +839,20 @@ public class SQL { Connection con = getConnection(); Statement stm = con.createStatement(); - stm.executeUpdate("DELETE FROM bwLehrpool.m_VLData_imageInfo where GUID_imageID = '" - + id + "' " + "AND imageVersion = '" + version + "';"); + //delete the image record + stm.executeUpdate("DELETE FROM bwLehrpool.m_VLData_imageInfo WHERE GUID_imageID = '"+ id + "' " + "AND imageVersion = '" + version + "';"); + //delete all permission records for this image + stm.executeUpdate("DELETE FROM bwLehrpool.pm_VLData_image WHERE GUID_imageID = '"+id+"';"); + + con.commit(); con.close(); return true; } catch (SQLException e) { // TODO Auto-generated catch block - log.info(new Date() + " - Failed to deleteImage."); + log.info(new Date() + " - Failed to deleteImage and permissions."); e.printStackTrace(); } @@ -928,15 +932,19 @@ public class SQL { try { Connection con = getConnection(); Statement stm = con.createStatement(); - stm.executeUpdate("DELETE FROM bwLehrpool.m_VLData_lecture WHERE lectureID = '" - + id + "';"); + + //delete the lecture record + stm.executeUpdate("DELETE FROM bwLehrpool.m_VLData_lecture WHERE lectureID = '" + id + "';"); + //delete all permission records for this lecture + stm.executeUpdate("DELETE FROM bwLehrpool.pm_VLData_lecture WHERE lectureID = '" + id + "';"); + con.commit(); con.close(); return true; } catch (SQLException e) { // TODO Auto-generated catch block - log.info(new Date() + " - Failed to deleteLecture."); + log.info(new Date() + " - Failed to deleteLecture and permissions."); e.printStackTrace(); } @@ -1497,7 +1505,7 @@ public class SQL { + "image_read, " + "image_write, " + "Image_admin, " + "link_allowed)" + "VALUES(" + "'" + uid + "'," + "'" + imageID + "'," + "1," + "'" + userID + "'," + isRead - + "," + isWrite + "," + isLinkAllowed + "," + isAdmin + "" + + "," + isWrite + "," + isAdmin + "," + isLinkAllowed + "" + ");"); con.commit(); con.close(); -- cgit v1.2.3-55-g7522 From 069bf1120bdd629f761d1110ab073c07513d992a Mon Sep 17 00:00:00 2001 From: Michael Wilson Date: Wed, 29 Oct 2014 11:28:10 +0100 Subject: Radiobutton "Lecture is active" holt jetzt korrekte Werte aus Model --- .../src/main/java/gui/lecture/EditLectureAllgemein_GUI.java | 13 ++++++++++++- dozentenmodulserver/src/main/java/sql/SQL.java | 6 +++--- 2 files changed, 15 insertions(+), 4 deletions(-) (limited to 'dozentenmodul/src/main/java') diff --git a/dozentenmodul/src/main/java/gui/lecture/EditLectureAllgemein_GUI.java b/dozentenmodul/src/main/java/gui/lecture/EditLectureAllgemein_GUI.java index 2fa014b8..ab52626f 100644 --- a/dozentenmodul/src/main/java/gui/lecture/EditLectureAllgemein_GUI.java +++ b/dozentenmodul/src/main/java/gui/lecture/EditLectureAllgemein_GUI.java @@ -341,11 +341,22 @@ public class EditLectureAllgemein_GUI extends JFrame { buttonGroup.add(radioButtonyes); radioButtonyes.setBounds(240, 225, 109, 23); panel_2.add(radioButtonyes); + + radioButtonno = new JRadioButton("Nein"); buttonGroup.add(radioButtonno); radioButtonno.setBounds(385, 225, 109, 23); panel_2.add(radioButtonno); - + + //set button value + if(Lecture.lecture.isActive()==true){ + radioButtonyes.setSelected(true); + radioButtonno.setSelected(false); + } else { + radioButtonyes.setSelected(false); + radioButtonno.setSelected(true); + } + radioButtonyes.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { radioButtonyes.setSelected(true); diff --git a/dozentenmodulserver/src/main/java/sql/SQL.java b/dozentenmodulserver/src/main/java/sql/SQL.java index 80b97623..a7ac4a8c 100644 --- a/dozentenmodulserver/src/main/java/sql/SQL.java +++ b/dozentenmodulserver/src/main/java/sql/SQL.java @@ -1492,13 +1492,13 @@ public class SQL { try { stm = con.createStatement(); - log.info(new Date() + " - INSERT INTO pm_VLData_image (" + "GUID, " + log.info("INSERT INTO pm_VLData_image (" + "GUID, " + "GUID_imageID, " + "roleID, " + "userID, " + "image_read, " + "image_write, " + "Image_admin, " + "link_allowed)" + "VALUES(" + "'" + uid + "'," + "'" + imageID + "'," + "1," + "'" + userID + "'," + isRead - + "," + isWrite + "," + isLinkAllowed + "," + isAdmin + "" - + ")"); + + "," + isWrite + "," + isAdmin + "," + isLinkAllowed + "" + + ");"); stm.executeUpdate("INSERT INTO pm_VLData_image (" + "GUID, " + "GUID_imageID, " + "roleID, " + "userID, " -- cgit v1.2.3-55-g7522 From 6c69c0971a81028c9a3f046b75e1eedb37f451f9 Mon Sep 17 00:00:00 2001 From: Michael Wilson Date: Wed, 29 Oct 2014 13:11:43 +0100 Subject: Ausgaben etwas verkürzt --- .../src/main/java/gui/image/DeleteImage_GUI.java | 2 +- .../main/java/gui/lecture/DeleteLecture_GUI.java | 2 +- .../src/main/java/server/ServerHandler.java | 62 ++++------ dozentenmodulserver/src/main/java/sql/SQL.java | 132 +++++++++++++-------- 4 files changed, 109 insertions(+), 89 deletions(-) (limited to 'dozentenmodul/src/main/java') diff --git a/dozentenmodul/src/main/java/gui/image/DeleteImage_GUI.java b/dozentenmodul/src/main/java/gui/image/DeleteImage_GUI.java index 27197447..943366ea 100644 --- a/dozentenmodul/src/main/java/gui/image/DeleteImage_GUI.java +++ b/dozentenmodul/src/main/java/gui/image/DeleteImage_GUI.java @@ -906,7 +906,7 @@ public class DeleteImage_GUI extends JFrame { List images; try { // Hole eine Liste der Images - images = client.getImageListPermissionWrite(person.verantwortlicher.getUserID()); + images = client.getImageListPermissionAdmin(person.verantwortlicher.getUserID()); Iterator i = images.iterator(); diff --git a/dozentenmodul/src/main/java/gui/lecture/DeleteLecture_GUI.java b/dozentenmodul/src/main/java/gui/lecture/DeleteLecture_GUI.java index 49a2c7a0..b2bd4ac8 100644 --- a/dozentenmodul/src/main/java/gui/lecture/DeleteLecture_GUI.java +++ b/dozentenmodul/src/main/java/gui/lecture/DeleteLecture_GUI.java @@ -642,7 +642,7 @@ public class DeleteLecture_GUI extends JFrame { // Hole eine Liste der erlaubten Images für die diese Person // lectures = client.getLectureList(); lectures = client - .getLectureListPermissionWrite(person.verantwortlicher + .getLectureListPermissionAdmin(person.verantwortlicher .getUserID()); Iterator i = lectures.iterator(); SimpleDateFormat in = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); diff --git a/dozentenmodulserver/src/main/java/server/ServerHandler.java b/dozentenmodulserver/src/main/java/server/ServerHandler.java index 1aeb8820..a6412e24 100644 --- a/dozentenmodulserver/src/main/java/server/ServerHandler.java +++ b/dozentenmodulserver/src/main/java/server/ServerHandler.java @@ -38,7 +38,7 @@ public class ServerHandler implements Server.Iface { @Override public User getFtpUser() throws TException { - log.info(new Date() + " - returning FTPUser..."); + log.info("returning FTPUser..."); User user = new User(); user.setUserName(UUID.randomUUID().toString().substring(0, 8)); user.setPassword(getEncodedSha1Sum(UUID.randomUUID().toString() @@ -54,7 +54,7 @@ public class ServerHandler implements Server.Iface { sql.writeFTPUser(user.getUserName(), user.getPassword()); return user; } else { - log.info(new Date() + " - returning null user"); + log.info("Error: returning null user"); return null; } } @@ -69,15 +69,14 @@ public class ServerHandler implements Server.Iface { } if (Files.exists(path) == true) { - log.info(new Date() + " - folder '" + path - + "' exists, no further action"); + log.info("folder '" + path + "' exists, no further action"); return true; } else { // create directory and set permissions boolean success = (new File(path + "")).mkdirs(); if (!success) { - log.info(new Date() + " - failed to create folder '" + path + log.info("failed to create folder '" + path + "'"); return false; } else { @@ -88,8 +87,7 @@ public class ServerHandler implements Server.Iface { // TODO Auto-generated catch block e.printStackTrace(); } - log.info(new Date() + " - folder '" + path - + "' successfully created"); + log.info("folder '" + path + "' successfully created"); return true; } } @@ -106,15 +104,14 @@ public class ServerHandler implements Server.Iface { } if (Files.exists(path) == true) { - log.info(new Date() + " - folder '" + path - + "' exists, no further action"); + log.info("folder '" + path + "' exists, no further action"); return true; } else { // create directory and set permissions boolean success = (new File(path + "")).mkdirs(); if (!success) { - log.info(new Date() + " - failed to create folder '" + path + log.info("failed to create folder '" + path + "'"); return false; } else { @@ -125,7 +122,7 @@ public class ServerHandler implements Server.Iface { // TODO Auto-generated catch block e.printStackTrace(); } - log.info(new Date() + " - folder '" + path + log.info("folder '" + path + "' successfully created"); return true; } @@ -137,7 +134,7 @@ public class ServerHandler implements Server.Iface { try { MessageDigest md = MessageDigest.getInstance("SHA1"); md.update(key.getBytes()); - log.info(new Date() + " - successfully returned EncodedSha1Sum"); + log.info("successfully returned EncodedSha1Sum"); return new BigInteger(1, md.digest()).toString(16); } catch (NoSuchAlgorithmException e) { // handle error case to taste @@ -153,7 +150,7 @@ public class ServerHandler implements Server.Iface { @Override public String getPathOfImage(String image_id, String version) throws TException { - log.info(new Date() + " - successfully returned PathOfImage: " + log.info("successfully returned PathOfImage: " + sql.getPathOfImage(image_id, version)); return sql.getPathOfImage(image_id, version); @@ -196,7 +193,7 @@ public class ServerHandler implements Server.Iface { sql.setImageData(login, license, internet, cpu, ram, imagename, desc, imagePath, filesize, mode, pk_os); - log.info(new Date() + " - written VLdata"); + log.info("written VLdata"); // TODO Auto-generated method stub return true; } @@ -266,7 +263,7 @@ public class ServerHandler implements Server.Iface { XMLCreator xml = new XMLCreator(sql.getConnection(), name); try { xml.create(name); - log.info(new Date() + " - XML created."); + log.info("XML created."); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); @@ -288,8 +285,7 @@ public class ServerHandler implements Server.Iface { + filename; File tmpFile = new File(file); - log.info(new Date() - + " - Trying to move file to '/srv/openslx/nfs/prod/" + log.info("Trying to move file to '/srv/openslx/nfs/prod/" + tmpFile.getName() + "'"); try { FileUtils.moveFile(tmpFile, @@ -297,12 +293,12 @@ public class ServerHandler implements Server.Iface { + filename)); // int ret = sql.UpdateImagePath(filename); if (sql.UpdateImagePath(filename) == 0) { - log.info(new Date() + " - file moved and database updated."); + log.info("file moved and database updated."); } } catch (IOException e) { // TODO Auto-generated catch block - log.info(new Date() + " - Failed to move file."); + log.info("Failed to move file."); e.printStackTrace(); } return true; @@ -311,7 +307,7 @@ public class ServerHandler implements Server.Iface { @Override public Map getImageData(String imageid, String imageversion) throws TException { - log.info(new Date() + " - returning ImageData: " + log.info("returning ImageData: " + sql.getImageData(imageid, imageversion).size() + "items."); return sql.getImageData(imageid, imageversion); } @@ -339,33 +335,26 @@ public class ServerHandler implements Server.Iface { @Override public List getLectureList() throws TException { - log.info(new Date().toString() + " - returning LectureList: " - + sql.getLectureList().size() + " items."); + log.info("returning LectureList"); return sql.getLectureList(); } @Override public List getLectureListPermissionRead(String userID) { - log.info(new Date().toString() + " - returning LectureListRead: " - + sql.getLectureListPermissionRead(userID).size() - + " items for user " + userID); + log.info("returning LectureListRead"); return sql.getLectureListPermissionRead(userID); }// end getLectureListPermissionRead @Override public List getLectureListPermissionWrite(String userID) { - log.info(new Date().toString() + " - returning LectureListWrite: " - + sql.getLectureListPermissionWrite(userID).size() - + " items for user " + userID); + log.info("returning LectureListWrite"); return sql.getLectureListPermissionWrite(userID); }// end getLectureListPermissionRead @Override public List getLectureListPermissionAdmin(String userID) { - log.info(new Date().toString() + " - returning LectureListAdmin: " - + sql.getLectureListPermissionAdmin(userID).size() - + " items for user " + userID); + log.info("returning LectureListAdmin"); return sql.getLectureListPermissionAdmin(userID); }// end getLectureListPermissionRead @@ -479,8 +468,7 @@ public class ServerHandler implements Server.Iface { @Override public Map getLectureData(String lectureid) throws TException { - log.info(new Date() + " - returning LectureData: " - + sql.getLectureData(lectureid).size() + "items."); + log.info("returning LectureData"); return sql.getLectureData(lectureid); } @@ -559,7 +547,7 @@ public class ServerHandler implements Server.Iface { linkallowed); } - log.info(new Date() + " - written image rights"); + log.info("written image rights"); return true; } @@ -625,8 +613,7 @@ public class ServerHandler implements Server.Iface { sql.writeAdditionalImageRights(imageID, userID, isRead, isWrite, isLinkAllowed, isAdmin); - log.info(new Date() + " - written additional image rights for " - + userID); + log.info("written additional image rights for " + userID); return success; } @@ -638,8 +625,7 @@ public class ServerHandler implements Server.Iface { sql.writeAdditionalLectureRights(lectureID, userID, isRead, isWrite, isAdmin); - log.info(new Date() + " - written additional lecture rights for " - + userID); + log.info("written additional lecture rights for "+ userID); return true; } diff --git a/dozentenmodulserver/src/main/java/sql/SQL.java b/dozentenmodulserver/src/main/java/sql/SQL.java index a7ac4a8c..e1a1c1da 100644 --- a/dozentenmodulserver/src/main/java/sql/SQL.java +++ b/dozentenmodulserver/src/main/java/sql/SQL.java @@ -46,7 +46,7 @@ public class SQL { return con; } catch (SQLException e) { // TODO Auto-generated catch block - log.info(new Date() + " - Failed to return connection to Client."); + log.info("Failed to return connection to Client."); e.printStackTrace(); } return null; @@ -68,12 +68,12 @@ public class SQL { + "temp/');"); con.commit(); con.close(); - log.info(new Date() + " - created FTPUser " + user + " : " + pass + log.info("Created FTPUser " + user + " : " + pass + "."); return ret; } catch (SQLException e) { // TODO Auto-generated catch block - log.info(new Date() + " - Failed to writeFTPUser."); + log.info("Failed to writeFTPUser."); e.printStackTrace(); } return -1; @@ -90,11 +90,11 @@ public class SQL { + user + "';"); con.commit(); con.close(); - log.info(new Date() + " - FTPUser " + user + " deleted."); + log.info("FTPUser " + user + " deleted."); return ret; } catch (SQLException e) { // TODO Auto-generated catch block - log.info(new Date() + " - Failed to DeleteUser."); + log.info("Failed to DeleteUser."); e.printStackTrace(); } return -1; @@ -111,7 +111,7 @@ public class SQL { } catch (SQLException e) { // TODO Auto-generated catch block - log.info(new Date() + " - Failed to getImage."); + log.info("Failed to getImage."); e.printStackTrace(); } @@ -135,7 +135,7 @@ public class SQL { } catch (SQLException e) { // TODO Auto-generated catch block - log.info(new Date() + " - Failed to getPathOfImage."); + log.info("Failed to getPathOfImage."); e.printStackTrace(); } @@ -173,7 +173,7 @@ public class SQL { } catch (SQLException e) { // TODO Auto-generated catch block - log.info(new Date() + " - Failed to setInstitution."); + log.info("Failed to setInstitution."); e.printStackTrace(); } return "-1"; @@ -231,7 +231,7 @@ public class SQL { } catch (SQLException e) { // TODO Auto-generated catch block - log.info(new Date() + " - Failed to setPerson."); + log.info("Failed to setPerson."); e.printStackTrace(); } return "-1"; @@ -260,6 +260,7 @@ public class SQL { // create a UUID String uid = UUID.randomUUID().toString(); + /* log.info(" - Query is: " + "INSERT INTO `bwLehrpool`.`m_VLData_imageInfo`(`GUID_imageID`,`imageVersion`,`image_name`,`image_description`,`image_path`,`image_lastCall`,`image_create_time`,`image_update_time`,`image_owner`,`image_change_by`,`rec_create_time`,`rec_change_time`,`rec_owner`,`rec_change_by`,`content_operatingSystem`,`status_isCompressed`,`status_isSecure`,`status_isOptimzed`,`status_isValid`,`status_isReady`,`status_isDeleted`,`status_isLastOfficialVersion`,`cond_hasLicenseRestriction`,`cond_hasInternetRestriction`,`cond_minRAM`,`cond_minCPUs`,`image_isTemplate`,`image_filesize`,`image_syncMode`)VALUES('" + uid // GUID_imageID @@ -294,6 +295,7 @@ public class SQL { + ",'" + filesize // image_filesize + "','" + shareMode // shareMode + "');"); + */ stm.executeUpdate("INSERT INTO `bwLehrpool`.`m_VLData_imageInfo`(`GUID_imageID`,`imageVersion`,`image_name`,`image_description`,`image_path`,`image_lastCall`,`image_create_time`,`image_update_time`,`image_owner`,`image_change_by`,`rec_create_time`,`rec_change_time`,`rec_owner`,`rec_change_by`,`content_operatingSystem`,`status_isCompressed`,`status_isSecure`,`status_isOptimzed`,`status_isValid`,`status_isReady`,`status_isDeleted`,`status_isLastOfficialVersion`,`cond_hasLicenseRestriction`,`cond_hasInternetRestriction`,`cond_minRAM`,`cond_minCPUs`,`image_isTemplate`,`image_filesize`,`image_syncMode`)VALUES('" + uid // GUID_imageID @@ -332,7 +334,7 @@ public class SQL { con.close(); } catch (SQLException e) { // TODO Auto-generated catch block - log.info(new Date() + " - Failed to setImageData."); + log.info("Failed to setImageData."); e.printStackTrace(); } return true; @@ -388,7 +390,6 @@ public class SQL { stm = con.createStatement(); // ResultSet - // res=stm.executeQuery("SELECT vl.GUID_imageID, vl.imageVersion,vl.image_name, vl.cond_hasLicenseRestriction, os.name,os.architecture, '' as lecture,vl.image_update_time, Concat(u.Nachname,' ',u.Vorname) as user, vl.image_isTemplate FROM bwLehrpool.pm_VLData_image as pmi, bwLehrpool.m_VLData_imageInfo vl, bwLehrpool.m_operatingSystem os, bwLehrpool.m_user u Where vl.content_operatingSystem=os.operatingSystemID and vl.image_owner=u.userID and vl.image_name not in (SELECT vl.image_name FROM bwLehrpool.m_VLData_imageInfo vl, bwLehrpool.m_operatingSystem os, bwLehrpool.m_VLData_lecture lect, bwLehrpool.m_user u Where vl.content_operatingSystem=os.operatingSystemID and lect.imageID=vl.GUID_imageID and vl.image_owner=u.userID) union SELECT vl.GUID_imageID, vl.imageVersion,vl.image_name, vl.cond_hasLicenseRestriction, os.name,os.architecture, lect.name as lecture, vl.image_update_time, Concat(u.Nachname,' ',u.Vorname) as user, vl.image_isTemplate FROM bwLehrpool.m_VLData_imageInfo vl, bwLehrpool.m_operatingSystem os, bwLehrpool.m_VLData_lecture lect, bwLehrpool.m_user u Where vl.content_operatingSystem=os.operatingSystemID and lect.imageID=vl.GUID_imageID and vl.image_owner=u.userID;"); ResultSet res = stm .executeQuery("SELECT DISTINCT vl.GUID_imageID, vl.imageVersion, vl.image_name, vl.cond_hasLicenseRestriction, os.name, os.architecture, '' as lecture, vl.image_update_time, Concat(u.Nachname,' ',u.Vorname) as user, vl.image_isTemplate FROM bwLehrpool.pm_VLData_image pmi, bwLehrpool.m_VLData_imageInfo vl, bwLehrpool.m_operatingSystem os, bwLehrpool.m_user u WHERE pmi.userID='" + userID @@ -426,7 +427,6 @@ public class SQL { stm = con.createStatement(); // ResultSet - // res=stm.executeQuery("SELECT vl.GUID_imageID, vl.imageVersion,vl.image_name, vl.cond_hasLicenseRestriction, os.name,os.architecture, '' as lecture,vl.image_update_time, Concat(u.Nachname,' ',u.Vorname) as user, vl.image_isTemplate FROM bwLehrpool.pm_VLData_image as pmi, bwLehrpool.m_VLData_imageInfo vl, bwLehrpool.m_operatingSystem os, bwLehrpool.m_user u Where vl.content_operatingSystem=os.operatingSystemID and vl.image_owner=u.userID and vl.image_name not in (SELECT vl.image_name FROM bwLehrpool.m_VLData_imageInfo vl, bwLehrpool.m_operatingSystem os, bwLehrpool.m_VLData_lecture lect, bwLehrpool.m_user u Where vl.content_operatingSystem=os.operatingSystemID and lect.imageID=vl.GUID_imageID and vl.image_owner=u.userID) union SELECT vl.GUID_imageID, vl.imageVersion,vl.image_name, vl.cond_hasLicenseRestriction, os.name,os.architecture, lect.name as lecture, vl.image_update_time, Concat(u.Nachname,' ',u.Vorname) as user, vl.image_isTemplate FROM bwLehrpool.m_VLData_imageInfo vl, bwLehrpool.m_operatingSystem os, bwLehrpool.m_VLData_lecture lect, bwLehrpool.m_user u Where vl.content_operatingSystem=os.operatingSystemID and lect.imageID=vl.GUID_imageID and vl.image_owner=u.userID;"); ResultSet res = stm .executeQuery("SELECT DISTINCT vl.GUID_imageID, vl.imageVersion, vl.image_name, vl.cond_hasLicenseRestriction, os.name, os.architecture, '' as lecture, vl.image_update_time, Concat(u.Nachname,' ',u.Vorname) as user, vl.image_isTemplate FROM bwLehrpool.pm_VLData_image pmi, bwLehrpool.m_VLData_imageInfo vl, bwLehrpool.m_operatingSystem os, bwLehrpool.m_user u WHERE pmi.userID='" + userID @@ -455,8 +455,39 @@ public class SQL { public List getImageListPermissionAdmin(String userID){ - //fill me - return null; + Connection con = getConnection(); + Statement stm; + + List list = new ArrayList(); + try { + + stm = con.createStatement(); + + // ResultSet + ResultSet res = stm + .executeQuery("SELECT DISTINCT vl.GUID_imageID, vl.imageVersion, vl.image_name, vl.cond_hasLicenseRestriction, os.name, os.architecture, '' as lecture, vl.image_update_time, Concat(u.Nachname,' ',u.Vorname) as user, vl.image_isTemplate FROM bwLehrpool.pm_VLData_image pmi, bwLehrpool.m_VLData_imageInfo vl, bwLehrpool.m_operatingSystem os, bwLehrpool.m_user u WHERE pmi.userID='" + + userID + + "' AND u.userID = pmi.userID AND pmi.image_admin = 1 AND pmi.GUID_imageID = vl.GUID_imageID AND vl.content_operatingSystem=os.operatingSystemID;"); + + while (res.next()) { + list.add(new Image(res.getString("GUID_imageID"), res + .getString("imageVersion"), + res.getString("image_name"), res + .getString("cond_hasLicenseRestriction"), res + .getString("name") + + " " + + res.getString("architecture") + " bit", res + .getString("lecture"), res + .getString("image_update_time"), res + .getString("user"), res + .getString("image_isTemplate"))); + } + con.close(); + } catch (SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return list; } @@ -485,7 +516,7 @@ public class SQL { return list; } catch (SQLException e) { // TODO Auto-generated catch block - log.info(new Date() + " - Failed to getLectureListPermissionRead."); + log.info("Failed to getLectureListPermissionRead."); e.printStackTrace(); } return list; @@ -516,7 +547,7 @@ public class SQL { return list; } catch (SQLException e) { // TODO Auto-generated catch block - log.info(new Date() + " - Failed to getLectureListPermissionWrite."); + log.info("Failed to getLectureListPermissionWrite."); e.printStackTrace(); } return list; @@ -546,7 +577,7 @@ public class SQL { return list; } catch (SQLException e) { // TODO Auto-generated catch block - log.info(new Date() + " - Failed to getLectureListPermissionAdmin."); + log.info("Failed to getLectureListPermissionAdmin."); e.printStackTrace(); } return list; @@ -572,7 +603,7 @@ public class SQL { return list; } catch (SQLException e) { // TODO Auto-generated catch block - log.info(new Date() + " - Failed to getLectureList."); + log.info("Failed to getLectureList."); e.printStackTrace(); } return null; @@ -593,7 +624,7 @@ public class SQL { } catch (SQLException e) { // TODO Auto-generated catch block - log.info(new Date() + " - Failed to getAllOS."); + log.info("Failed to getAllOS."); e.printStackTrace(); } @@ -624,7 +655,7 @@ public class SQL { return map; } catch (SQLException e) { // TODO Auto-generated catch block - log.info(new Date() + " - Failed to getPersonData."); + log.info("Failed to getPersonData."); e.printStackTrace(); } return null; @@ -677,7 +708,7 @@ public class SQL { con.close(); } catch (SQLException e) { // TODO Auto-generated catch block - log.info(new Date() + " - Failed to setLectureData."); + log.info("Failed to setLectureData."); e.printStackTrace(); } return 0; @@ -702,7 +733,7 @@ public class SQL { return map; } catch (SQLException e) { // TODO Auto-generated catch block - log.info(new Date() + " - Failed to getImageIDandVersion."); + log.info("Failed to getImageIDandVersion."); e.printStackTrace(); } return null; @@ -740,7 +771,7 @@ public class SQL { return map; } catch (SQLException e) { // TODO Auto-generated catch block - log.info(new Date() + " - Failed to getImageData."); + log.info("Failed to getImageData."); e.printStackTrace(); } return null; @@ -764,6 +795,7 @@ public class SQL { if (license == true) { license_bol = 1; } + /* log.info(new Date() + " - 'image_name` = '" + newName + "\n length of name=" + newName.length()); @@ -787,6 +819,7 @@ public class SQL { + ",`image_syncMode` = '" + shareMode + "' WHERE GUID_imageID = '" + id + "' AND imageVersion = " + version + ";"); + */ stm.executeUpdate("UPDATE bwLehrpool.m_VLData_imageInfo SET imageVersion = " + newVersion @@ -827,7 +860,7 @@ public class SQL { return 0; } catch (SQLException e) { // TODO Auto-generated catch block - log.info(new Date() + " - Failed to UpdateImageData."); + log.info("Failed to UpdateImageData."); e.printStackTrace(); } return -1; @@ -852,7 +885,7 @@ public class SQL { } catch (SQLException e) { // TODO Auto-generated catch block - log.info(new Date() + " - Failed to deleteImage and permissions."); + log.info("Failed to deleteImage and permissions."); e.printStackTrace(); } @@ -891,11 +924,11 @@ public class SQL { + "'WHERE `lectureID` = '" + id + "';"); con.commit(); con.close(); - log.info(new Date() + " - Succeeded to updateLectureData."); + log.info("Succeeded to updateLectureData."); } catch (SQLException e) { // TODO Auto-generated catch block - log.info(new Date() + " - Failed to updateLectureData."); + log.info("Failed to updateLectureData."); e.printStackTrace(); } @@ -918,8 +951,7 @@ public class SQL { } catch (SQLException e) { // TODO Auto-generated catch block - log.info(new Date() - + " - Failed to execute method connectedToLecture."); + log.info("Failed to execute method connectedToLecture."); e.printStackTrace(); } @@ -944,7 +976,7 @@ public class SQL { return true; } catch (SQLException e) { // TODO Auto-generated catch block - log.info(new Date() + " - Failed to deleteLecture and permissions."); + log.info("Failed to deleteLecture and permissions."); e.printStackTrace(); } @@ -970,7 +1002,7 @@ public class SQL { } catch (SQLException e) { // TODO Auto-generated catch block - log.info(new Date() + " - Failed to getFile."); + log.info("Failed to getFile."); e.printStackTrace(); } @@ -996,7 +1028,7 @@ public class SQL { } catch (SQLException e) { // TODO Auto-generated catch block - log.info(new Date() + " - Failed to getDeleteXMLData."); + log.info("Failed to getDeleteXMLData."); e.printStackTrace(); } @@ -1009,11 +1041,12 @@ public class SQL { Statement stm = con.createStatement(); String image_path = "prod/" + name; + /* log.info(new Date() + " - Updating ImagePath with: UPDATE `bwLehrpool`.`m_VLData_imageInfo` SET `image_path` = '" + image_path + "' WHERE `image_path` = '" + "temp/" + name + "';"); - + */ stm.executeUpdate("UPDATE `bwLehrpool`.`m_VLData_imageInfo` SET `image_path` = '" + image_path + "' WHERE `image_path` = '" @@ -1022,10 +1055,11 @@ public class SQL { + "';"); con.commit(); con.close(); + log.info("Succesfully updated image path"); return 0; } catch (SQLException e) { // TODO Auto-generated catch block - log.info(new Date() + " - Failed to UpdateImagePath."); + log.info("Failed to UpdateImagePath."); e.printStackTrace(); } return -1; @@ -1045,7 +1079,7 @@ public class SQL { } catch (SQLException e) { // TODO Auto-generated catch block - log.info(new Date() + " - Failed to getAllUniversities."); + log.info("Failed to getAllUniversities."); e.printStackTrace(); } @@ -1057,8 +1091,7 @@ public class SQL { try { Connection con = getConnection(); Statement stm = con.createStatement(); - log.info(new Date() + " - Getting PrimaryKey for OS: " + os - + " architecture: " + architecture); + //log.info(new Date() + " - Getting PrimaryKey for OS: " + os + " architecture: " + architecture); ResultSet rs = stm .executeQuery("SELECT operatingSystemID FROM bwLehrpool.m_operatingSystem where name like '" + os @@ -1067,13 +1100,13 @@ public class SQL { + "';"); rs.first(); String pkos = rs.getString("operatingSystemID"); - log.info(new Date() + " - Key is " + pkos); + //log.info(" - Key is " + pkos); con.close(); return pkos; } catch (SQLException e) { // TODO Auto-generated catch block - log.info(new Date() + " - Failed to getOSpk."); + log.info("Failed to getOSpk."); e.printStackTrace(); } @@ -1097,7 +1130,7 @@ public class SQL { } catch (SQLException e) { // TODO Auto-generated catch block - log.info(new Date() + " - Failed to getOS."); + log.info("Failed to getOS."); e.printStackTrace(); } @@ -1128,7 +1161,7 @@ public class SQL { return map; } catch (SQLException e) { // TODO Auto-generated catch block - log.info(new Date() + " - Failed to getLectureData."); + log.info("Failed to getLectureData."); e.printStackTrace(); } return null; @@ -1145,12 +1178,12 @@ public class SQL { + username + "'"); if (rs.next()) { ret = true; - log.info(new Date() + " - User " + rs.getString("loginName") - + " exist."); + log.info("Checking user: " + rs.getString("loginName") + + " exists."); } else { ret = false; - log.info(new Date() + " - User " + rs.getString("loginName") - + " not exist."); + log.info("Checking user: " + rs.getString("loginName") + + " does not exist."); } con.close(); @@ -1177,7 +1210,7 @@ public class SQL { } catch (SQLException e) { // TODO Auto-generated catch block - log.info(new Date() + " - Failed to getRoleID."); + log.info("Failed to getRoleID."); e.printStackTrace(); } return -1; @@ -1199,7 +1232,7 @@ public class SQL { return id; } catch (SQLException e) { // TODO Auto-generated catch block - log.info(new Date() + " - Failed to LectureID."); + log.info("Failed to LectureID."); e.printStackTrace(); } return id; @@ -1474,7 +1507,7 @@ public class SQL { con.close(); } catch (SQLException e) { // TODO Auto-generated catch block - log.info(new Date() + " - Failed to setImageRights."); + log.info("Failed to setImageRights."); e.printStackTrace(); } return 0; @@ -1492,6 +1525,7 @@ public class SQL { try { stm = con.createStatement(); + /* log.info("INSERT INTO pm_VLData_image (" + "GUID, " + "GUID_imageID, " + "roleID, " + "userID, " + "image_read, " + "image_write, " + "Image_admin, " @@ -1499,7 +1533,7 @@ public class SQL { + imageID + "'," + "1," + "'" + userID + "'," + isRead + "," + isWrite + "," + isAdmin + "," + isLinkAllowed + "" + ");"); - + */ stm.executeUpdate("INSERT INTO pm_VLData_image (" + "GUID, " + "GUID_imageID, " + "roleID, " + "userID, " + "image_read, " + "image_write, " + "Image_admin, " -- cgit v1.2.3-55-g7522