diff options
Diffstat (limited to 'Dozentenmodul/src')
| -rw-r--r-- | Dozentenmodul/src/gui/image/DeleteImage_GUI.java | 69 | ||||
| -rw-r--r-- | Dozentenmodul/src/gui/intro/MainMenue_GUI.java | 20 |
2 files changed, 80 insertions, 9 deletions
diff --git a/Dozentenmodul/src/gui/image/DeleteImage_GUI.java b/Dozentenmodul/src/gui/image/DeleteImage_GUI.java index c8363dcc..1f2dbfa6 100644 --- a/Dozentenmodul/src/gui/image/DeleteImage_GUI.java +++ b/Dozentenmodul/src/gui/image/DeleteImage_GUI.java @@ -451,6 +451,75 @@ public class DeleteImage_GUI extends JFrame { JOptionPane.showMessageDialog(null, "Bitte wählen Sie ein eigenes Image aus", "Message", JOptionPane.INFORMATION_MESSAGE); } + + //frage, soll das selektierte Daten gelöscht werden? + eingabe = JOptionPane.showConfirmDialog(null, + "Wollen Sie diese Daten löschen?", "Löschen?",JOptionPane.YES_NO_OPTION); + + if (eingabe == JOptionPane.YES_OPTION) { + + imageid = modelMyImages.getValueAt(tablemyImages.convertRowIndexToModel + (tablemyImages.getSelectedRow()), 7).toString(); + /* modelMyImages.getValueAt( + tablemyImages.convertRowIndexToModel(tablemyImages + .getSelectedRow()), 7).toString(); + */ + + imageversion = modelMyImages.getValueAt(tablemyImages.convertRowIndexToModel + (tablemyImages.getSelectedRow()), 8).toString(); + + //TODO + //Image darf nur gelöscht werden, wenn keine Veranstaltung mehr auf das Image verweist. + //Unbdingt abfragen! + + //try { + //if(client.connectedToEvents(imageid ,imageversion)) { + System.out.println(imageid); + System.out.println(imageversion); + try { + + + + if (client.deleteImageData(imageid ,imageversion) == true){ + System.out.println("erstes if true"); + //} + + //if (client.deleteImageData(imageid ,imageversion) && client.deleteImageServer(imageid ,imageversion)) { + + System.out.println("entrou2"); + + JOptionPane.showConfirmDialog(null, "Löschen erfolgreich!", + imageversion, JOptionPane.OK_CANCEL_OPTION); + + } else { + + JOptionPane.showConfirmDialog(null, "Löschen hat leider nicht geklappt!!", + imageversion, JOptionPane.OK_CANCEL_OPTION); + + } + } catch (HeadlessException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (TException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + //TODO --> client.deleteImageServer(imageid ,imageversion) + //das file ist aus der DB raus, aber ist noch auf dem Server als Datei hinterlegt. + //dieses muss auch gelöscht werden, um den festplattenlatz wieder frei zu geben. + //Hierzu könnte ein löschbefehl an die kommande zeile des server geschickt werden + //um das entsprechende file zu löschen. identifizieren über den image-namen!! + //z.B. FileUtils.moveFile(tmpFile, new File("141.79.128.102:/srv//openslx/nfs/temp/"+ + //tmpFile.getName())); + //FileUtils.ForceDelete (.. ); + + } + /*} catch (TException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } */ + //} + } }); btnDelete.setBounds(449, 508, 118, 23); diff --git a/Dozentenmodul/src/gui/intro/MainMenue_GUI.java b/Dozentenmodul/src/gui/intro/MainMenue_GUI.java index d364ba53..3649d79d 100644 --- a/Dozentenmodul/src/gui/intro/MainMenue_GUI.java +++ b/Dozentenmodul/src/gui/intro/MainMenue_GUI.java @@ -343,7 +343,7 @@ public class MainMenue_GUI extends JFrame { continueButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { - //Images + // Images if (rdbtnImageNew.isSelected() == true) { CreateImageAllgemein_GUI sr = new CreateImageAllgemein_GUI(); sr.setVisible(true); @@ -357,12 +357,14 @@ public class MainMenue_GUI extends JFrame { di.setVisible(true); dispose(); } else if (rdbtnImageSearchDownload.isSelected() == true) { - //SearchMethodLecture_GUI sm = new SearchMethodLecture_GUI(); - //SearchImage_GUI si = new SearchImage_GUI(); - SearchEditImage_GUI si = new SearchEditImage_GUI(); + // SearchMethodLecture_GUI sm = new + // SearchMethodLecture_GUI(); + SearchImage_GUI si = new SearchImage_GUI(); + // SearchEditImage_GUI si = new + // SearchEditImage_GUI(); si.setVisible(true); dispose(); - //Lectures + // Lectures } else if (rdbtnLectureNew.isSelected() == true) { CreateLectureAllgemein_GUI av = new CreateLectureAllgemein_GUI(); av.setVisible(true); @@ -372,11 +374,11 @@ public class MainMenue_GUI extends JFrame { el.setVisible(true); dispose(); } else if (rdbtnLectureDelete.isSelected() == true) { - //DeleteLecture_GUI dl = new DeleteLecture_GUI(); - //dl.setVisible(true); - //dispose(); + // DeleteLecture_GUI dl = new DeleteLecture_GUI(); + // dl.setVisible(true); + // dispose(); } else if (rdbtnLectureSearch.isSelected() == true) { - //SearchLecture_GUI sl = new SearchLecture_GUI(); + // SearchLecture_GUI sl = new SearchLecture_GUI(); EditLectureSearch_GUI sl = new EditLectureSearch_GUI(); sl.setVisible(true); dispose(); |
