diff options
44 files changed, 1319 insertions, 408 deletions
diff --git a/Dozentenmodul/bin/gui/image/DeleteImage_GUI.class b/Dozentenmodul/bin/gui/image/DeleteImage_GUI.class Binary files differindex c49ec97a..6c46d334 100644 --- a/Dozentenmodul/bin/gui/image/DeleteImage_GUI.class +++ b/Dozentenmodul/bin/gui/image/DeleteImage_GUI.class diff --git a/Dozentenmodul/bin/gui/image/SearchEditImage_GUI.class b/Dozentenmodul/bin/gui/image/SearchEditImage_GUI.class Binary files differindex 7655aeef..cb2733ea 100644 --- a/Dozentenmodul/bin/gui/image/SearchEditImage_GUI.class +++ b/Dozentenmodul/bin/gui/image/SearchEditImage_GUI.class diff --git a/Dozentenmodul/bin/gui/image/SearchImage_GUI.class b/Dozentenmodul/bin/gui/image/SearchImage_GUI.class Binary files differindex 3eb9a7dd..0141feae 100644 --- a/Dozentenmodul/bin/gui/image/SearchImage_GUI.class +++ b/Dozentenmodul/bin/gui/image/SearchImage_GUI.class diff --git a/Dozentenmodul/bin/org/eclipse/wb/swt/SWTResourceManager.class b/Dozentenmodul/bin/org/eclipse/wb/swt/SWTResourceManager.class Binary files differindex 824bd6b1..32758ea9 100644 --- a/Dozentenmodul/bin/org/eclipse/wb/swt/SWTResourceManager.class +++ b/Dozentenmodul/bin/org/eclipse/wb/swt/SWTResourceManager.class diff --git a/Dozentenmodul/bin/thrift/AuthenticationException$AuthenticationExceptionStandardScheme.class b/Dozentenmodul/bin/thrift/AuthenticationException$AuthenticationExceptionStandardScheme.class Binary files differindex 69115c47..6108caf6 100644 --- a/Dozentenmodul/bin/thrift/AuthenticationException$AuthenticationExceptionStandardScheme.class +++ b/Dozentenmodul/bin/thrift/AuthenticationException$AuthenticationExceptionStandardScheme.class diff --git a/Dozentenmodul/bin/thrift/AuthenticationException.class b/Dozentenmodul/bin/thrift/AuthenticationException.class Binary files differindex 19a6f19e..de2ec118 100644 --- a/Dozentenmodul/bin/thrift/AuthenticationException.class +++ b/Dozentenmodul/bin/thrift/AuthenticationException.class diff --git a/Dozentenmodul/bin/thrift/AuthorizationException$AuthorizationExceptionStandardScheme.class b/Dozentenmodul/bin/thrift/AuthorizationException$AuthorizationExceptionStandardScheme.class Binary files differindex 0104f62e..978243e1 100644 --- a/Dozentenmodul/bin/thrift/AuthorizationException$AuthorizationExceptionStandardScheme.class +++ b/Dozentenmodul/bin/thrift/AuthorizationException$AuthorizationExceptionStandardScheme.class diff --git a/Dozentenmodul/bin/thrift/AuthorizationException.class b/Dozentenmodul/bin/thrift/AuthorizationException.class Binary files differindex a9102d48..9ec46927 100644 --- a/Dozentenmodul/bin/thrift/AuthorizationException.class +++ b/Dozentenmodul/bin/thrift/AuthorizationException.class diff --git a/Dozentenmodul/bin/thrift/ImageServer$authenticate_args$authenticate_argsStandardScheme.class b/Dozentenmodul/bin/thrift/ImageServer$authenticate_args$authenticate_argsStandardScheme.class Binary files differindex b34e84ca..29e03256 100644 --- a/Dozentenmodul/bin/thrift/ImageServer$authenticate_args$authenticate_argsStandardScheme.class +++ b/Dozentenmodul/bin/thrift/ImageServer$authenticate_args$authenticate_argsStandardScheme.class diff --git a/Dozentenmodul/bin/thrift/ImageServer$authenticate_args.class b/Dozentenmodul/bin/thrift/ImageServer$authenticate_args.class Binary files differindex 03c45013..a92fb3e9 100644 --- a/Dozentenmodul/bin/thrift/ImageServer$authenticate_args.class +++ b/Dozentenmodul/bin/thrift/ImageServer$authenticate_args.class diff --git a/Dozentenmodul/bin/thrift/ImageServer$authenticate_result$authenticate_resultStandardScheme.class b/Dozentenmodul/bin/thrift/ImageServer$authenticate_result$authenticate_resultStandardScheme.class Binary files differindex eaeffdc5..b1243414 100644 --- a/Dozentenmodul/bin/thrift/ImageServer$authenticate_result$authenticate_resultStandardScheme.class +++ b/Dozentenmodul/bin/thrift/ImageServer$authenticate_result$authenticate_resultStandardScheme.class diff --git a/Dozentenmodul/bin/thrift/ImageServer$authenticate_result.class b/Dozentenmodul/bin/thrift/ImageServer$authenticate_result.class Binary files differindex 9d371b39..db12a9f8 100644 --- a/Dozentenmodul/bin/thrift/ImageServer$authenticate_result.class +++ b/Dozentenmodul/bin/thrift/ImageServer$authenticate_result.class diff --git a/Dozentenmodul/bin/thrift/ImageServer$getUserFromToken_args$getUserFromToken_argsStandardScheme.class b/Dozentenmodul/bin/thrift/ImageServer$getUserFromToken_args$getUserFromToken_argsStandardScheme.class Binary files differindex a1af0acb..9b24fe8f 100644 --- a/Dozentenmodul/bin/thrift/ImageServer$getUserFromToken_args$getUserFromToken_argsStandardScheme.class +++ b/Dozentenmodul/bin/thrift/ImageServer$getUserFromToken_args$getUserFromToken_argsStandardScheme.class diff --git a/Dozentenmodul/bin/thrift/ImageServer$getUserFromToken_result$getUserFromToken_resultStandardScheme.class b/Dozentenmodul/bin/thrift/ImageServer$getUserFromToken_result$getUserFromToken_resultStandardScheme.class Binary files differindex b1be58ff..8ce44766 100644 --- a/Dozentenmodul/bin/thrift/ImageServer$getUserFromToken_result$getUserFromToken_resultStandardScheme.class +++ b/Dozentenmodul/bin/thrift/ImageServer$getUserFromToken_result$getUserFromToken_resultStandardScheme.class diff --git a/Dozentenmodul/bin/thrift/ImageServer$getUserFromToken_result.class b/Dozentenmodul/bin/thrift/ImageServer$getUserFromToken_result.class Binary files differindex 3a76c644..bc1a176b 100644 --- a/Dozentenmodul/bin/thrift/ImageServer$getUserFromToken_result.class +++ b/Dozentenmodul/bin/thrift/ImageServer$getUserFromToken_result.class diff --git a/Dozentenmodul/bin/thrift/ImageServer$ping_result$ping_resultStandardScheme.class b/Dozentenmodul/bin/thrift/ImageServer$ping_result$ping_resultStandardScheme.class Binary files differindex ecff1ebc..311b5c76 100644 --- a/Dozentenmodul/bin/thrift/ImageServer$ping_result$ping_resultStandardScheme.class +++ b/Dozentenmodul/bin/thrift/ImageServer$ping_result$ping_resultStandardScheme.class diff --git a/Dozentenmodul/bin/thrift/SessionData$SessionDataStandardScheme.class b/Dozentenmodul/bin/thrift/SessionData$SessionDataStandardScheme.class Binary files differindex 690d9b62..06cd5a25 100644 --- a/Dozentenmodul/bin/thrift/SessionData$SessionDataStandardScheme.class +++ b/Dozentenmodul/bin/thrift/SessionData$SessionDataStandardScheme.class diff --git a/Dozentenmodul/bin/thrift/SessionData.class b/Dozentenmodul/bin/thrift/SessionData.class Binary files differindex 64bbae88..c1156dff 100644 --- a/Dozentenmodul/bin/thrift/SessionData.class +++ b/Dozentenmodul/bin/thrift/SessionData.class diff --git a/Dozentenmodul/bin/thrift/UserInfo$UserInfoStandardScheme.class b/Dozentenmodul/bin/thrift/UserInfo$UserInfoStandardScheme.class Binary files differindex 80f7efd3..c4a055f7 100644 --- a/Dozentenmodul/bin/thrift/UserInfo$UserInfoStandardScheme.class +++ b/Dozentenmodul/bin/thrift/UserInfo$UserInfoStandardScheme.class diff --git a/Dozentenmodul/bin/thrift/UserInfo.class b/Dozentenmodul/bin/thrift/UserInfo.class Binary files differindex 79d011df..ed7e6f12 100644 --- a/Dozentenmodul/bin/thrift/UserInfo.class +++ b/Dozentenmodul/bin/thrift/UserInfo.class diff --git a/Dozentenmodul/src/gui/lecture/DeleteLecture_GUI.java b/Dozentenmodul/src/gui/lecture/DeleteLecture_GUI.java index 9b3d0ef3..cadb4ca3 100644 --- a/Dozentenmodul/src/gui/lecture/DeleteLecture_GUI.java +++ b/Dozentenmodul/src/gui/lecture/DeleteLecture_GUI.java @@ -17,8 +17,11 @@ import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.net.URI; import java.net.URISyntaxException; +import java.text.ParseException; +import java.text.SimpleDateFormat; import java.util.Iterator; import java.util.List; +import java.util.Map; import javax.swing.JButton; import javax.swing.JFrame; @@ -33,15 +36,19 @@ import javax.swing.JScrollPane; import javax.swing.JSeparator; import javax.swing.JTabbedPane; import javax.swing.JTable; +import javax.swing.JTextArea; import javax.swing.JTextField; import javax.swing.JTextPane; import javax.swing.RowFilter; +import javax.swing.ScrollPaneConstants; import javax.swing.UIManager; import javax.swing.UnsupportedLookAndFeelException; import javax.swing.border.EmptyBorder; import javax.swing.border.TitledBorder; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; +import javax.swing.event.ListSelectionEvent; +import javax.swing.event.ListSelectionListener; import javax.swing.table.DefaultTableModel; import javax.swing.table.TableModel; import javax.swing.table.TableRowSorter; @@ -63,16 +70,22 @@ public class DeleteLecture_GUI extends JFrame { String[] result; JRadioButton rdbtnInternetJa; JRadioButton rdbtnInternetNein; + JLabel labelAktiv; + JLabel labelstartdate; + JLabel labelenddate; + JLabel labelimageversion; + JTextArea labelName; + JTextArea labelimage; + JTextArea labeldesc; + JLabel labelVerantwortlicher; JTable tableAllLectures; JTable tablemyLectures; - JTable tableCoopImages; - JTable tablePublicImages; private JTextField textFieldName; JTabbedPane tabbedPane; boolean activeSearch=false; String[] titles = { "Veranstaltungsname", "Beschreibung", "G\u00fcltigkeitsdatum", "Aktiv", "Letzte Benutzung", - "Verantwortlicher", "Image", "ID" }; + "Verantwortlicher", "Image", "Schlagwort", "ID" }; ThriftConnection con = new ThriftConnection(); Client client = models.Client.clientcon.getClient(); final DefaultTableModel modelAll = new DefaultTableModel(titles, 0); @@ -97,9 +110,51 @@ public class DeleteLecture_GUI extends JFrame { } @Override public void windowOpened(WindowEvent arg0) { - initTableModel(modelAll); - initTableModel(modelMyLectures); textFieldName.requestFocusInWindow(); + try { + initTableModel(modelMyLectures); + initTableModel(modelAll); + + } catch (ParseException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + tablemyLectures.getColumnModel().getColumn(1).setWidth(0); + tablemyLectures.getColumnModel().getColumn(1).setMinWidth(0); + tablemyLectures.getColumnModel().getColumn(1).setMaxWidth(0); + tablemyLectures.getColumnModel().getColumn(2).setWidth(0); + tablemyLectures.getColumnModel().getColumn(2).setMinWidth(0); + tablemyLectures.getColumnModel().getColumn(2).setMaxWidth(0); + tablemyLectures.getColumnModel().getColumn(3).setWidth(0); + tablemyLectures.getColumnModel().getColumn(3).setMinWidth(0); + tablemyLectures.getColumnModel().getColumn(3).setMaxWidth(0); + tablemyLectures.getColumnModel().getColumn(6).setWidth(0); + tablemyLectures.getColumnModel().getColumn(6).setMinWidth(0); + tablemyLectures.getColumnModel().getColumn(6).setMaxWidth(0); + tablemyLectures.getColumnModel().getColumn(7).setWidth(0); + tablemyLectures.getColumnModel().getColumn(7).setMinWidth(0); + tablemyLectures.getColumnModel().getColumn(7).setMaxWidth(0); + tablemyLectures.getColumnModel().getColumn(8).setWidth(0); + tablemyLectures.getColumnModel().getColumn(8).setMinWidth(0); + tablemyLectures.getColumnModel().getColumn(8).setMaxWidth(0); + tableAllLectures.getColumnModel().getColumn(1).setWidth(0); + tableAllLectures.getColumnModel().getColumn(1).setMinWidth(0); + tableAllLectures.getColumnModel().getColumn(1).setMaxWidth(0); + tableAllLectures.getColumnModel().getColumn(2).setWidth(0); + tableAllLectures.getColumnModel().getColumn(2).setMinWidth(0); + tableAllLectures.getColumnModel().getColumn(2).setMaxWidth(0); + tableAllLectures.getColumnModel().getColumn(3).setWidth(0); + tableAllLectures.getColumnModel().getColumn(3).setMinWidth(0); + tableAllLectures.getColumnModel().getColumn(3).setMaxWidth(0); + tableAllLectures.getColumnModel().getColumn(6).setWidth(0); + tableAllLectures.getColumnModel().getColumn(6).setMinWidth(0); + tableAllLectures.getColumnModel().getColumn(6).setMaxWidth(0); + tableAllLectures.getColumnModel().getColumn(7).setWidth(0); + tableAllLectures.getColumnModel().getColumn(7).setMinWidth(0); + tableAllLectures.getColumnModel().getColumn(7).setMaxWidth(0); + tableAllLectures.getColumnModel().getColumn(8).setWidth(0); + tableAllLectures.getColumnModel().getColumn(8).setMinWidth(0); + tableAllLectures.getColumnModel().getColumn(8).setMaxWidth(0); } }); // Verhindert das Vergroessern Des Fensters @@ -116,16 +171,15 @@ public class DeleteLecture_GUI extends JFrame { // Setzt den Fenstertitel setTitle("bwLehrpool Suite *Prototyp* - Veranstaltung l\u00F6schen"); // Zentriert das Fenster in die Bildmitte - setBounds(0, 0, 603, 722); + setBounds(0, 0, 842, 722); GuiOrganizer.centerGUI(this); - final DefaultTableModel model = new DefaultTableModel(titles, 0); getContentPane().setLayout(null); { JPanel panel = new JPanel(); panel.setBackground(SystemColor.menu); - panel.setBounds(10, 11, 577, 57); + panel.setBounds(10, 11, 816, 57); getContentPane().add(panel); panel.setLayout(null); { @@ -144,7 +198,7 @@ public class DeleteLecture_GUI extends JFrame { txtpnBitteWhlenSie.setBounds(10, 36, 509, 32); panel.add(txtpnBitteWhlenSie); } - contentPanel.setBounds(10, 85, 577, 531); + contentPanel.setBounds(10, 85, 570, 518); contentPanel.setBackground(SystemColor.menu); contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); getContentPane().add(contentPanel); @@ -241,12 +295,35 @@ public class DeleteLecture_GUI extends JFrame { } }); - tabbedPane.setBounds(10, 124, 557, 373); + tabbedPane.setBounds(10, 123, 557, 397); contentPanel.add(tabbedPane); JScrollPane scrollPaneAllImages = new JScrollPane(); tableAllLectures = new JTable(); + tableAllLectures.getSelectionModel().addListSelectionListener( new ListSelectionListener() + { + public void valueChanged(ListSelectionEvent e) + { + String imageid = modelAll + .getValueAt( + tableAllLectures + .convertRowIndexToModel(tableAllLectures + .getSelectedRow()), 8) + .toString(); + System.out.println(imageid); + + try { + writeLectureData(imageid); + } catch (TException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } catch (ParseException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + } + }); tableAllLectures.setModel(modelAll); tableAllLectures.getColumnModel().getColumn(1).sizeWidthToFit(); tableAllLectures.getColumnModel().getColumn(2).sizeWidthToFit(); @@ -256,6 +333,29 @@ public class DeleteLecture_GUI extends JFrame { tableAllLectures.setRowSorter(rowSorterAll); JScrollPane scrollPaneMyImage = new JScrollPane(); tablemyLectures = new JTable(); + tablemyLectures.getSelectionModel().addListSelectionListener( new ListSelectionListener() + { + public void valueChanged(ListSelectionEvent e) + { + String imageid = modelMyLectures + .getValueAt( + tablemyLectures + .convertRowIndexToModel(tablemyLectures + .getSelectedRow()), 8) + .toString(); + System.out.println(imageid); + + try { + writeLectureData(imageid); + } catch (TException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } catch (ParseException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + } + }); tablemyLectures.setModel(modelMyLectures); tablemyLectures.getColumnModel().getColumn(1).sizeWidthToFit(); @@ -272,121 +372,9 @@ public class DeleteLecture_GUI extends JFrame { scrollPaneAllImages.setViewportView(tableAllLectures); tabbedPane.addTab("Alle", null, scrollPaneAllImages, null); - - JScrollPane scrollPaneCoopImages = new JScrollPane(); - tableCoopImages = new JTable(); - tableCoopImages.setModel(model); - tableCoopImages.getColumnModel().getColumn(1).sizeWidthToFit(); - tableCoopImages.getColumnModel().getColumn(2).sizeWidthToFit(); - tableCoopImages.getColumnModel().getColumn(3).sizeWidthToFit(); - tableCoopImages.getColumnModel().getColumn(4).sizeWidthToFit(); - tableCoopImages.getColumnModel().getColumn(5).sizeWidthToFit(); - - scrollPaneCoopImages.setViewportView(tableCoopImages); - tabbedPane.addTab("Kooperative Veranstaltungen", null, - scrollPaneCoopImages, null); - tabbedPane.setEnabledAt(2, false); - - JScrollPane scrollPanePublicImages = new JScrollPane(); - tablePublicImages = new JTable(); - tablePublicImages.setModel(model); - tablePublicImages.getColumnModel().getColumn(1).sizeWidthToFit(); - tablePublicImages.getColumnModel().getColumn(2).sizeWidthToFit(); - tablePublicImages.getColumnModel().getColumn(3).sizeWidthToFit(); - tablePublicImages.getColumnModel().getColumn(4).sizeWidthToFit(); - tablePublicImages.getColumnModel().getColumn(5).sizeWidthToFit(); - - scrollPanePublicImages.setViewportView(tablePublicImages); - tabbedPane.addTab("\u00D6ffentliche Veranstaltungen", null, - scrollPanePublicImages, null); - tabbedPane.setEnabledAt(3, false); - - button = new JButton("L\u00F6schen"); - button.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - String lectureID=""; - int eingabe; - String username = person.verantwortlicher.getName() + " " - + person.verantwortlicher.getVorname(); - //check if a row is selected - if (tablemyLectures.getSelectedRowCount() !=0){ - //a row is selected - //ask for confirmation - eingabe = JOptionPane.showConfirmDialog(null, - "Wollen Sie diese Daten l\u00f6schen?", "L\u00f6schen?", - JOptionPane.YES_NO_OPTION); - - if (eingabe == JOptionPane.YES_OPTION) { - //user has confirmed deletion, now get the ID of the selected lecture - lectureID = modelMyLectures.getValueAt(tablemyLectures.convertColumnIndexToModel(tablemyLectures.getSelectedRow()), 7).toString(); - System.out.println("L\u00f6sche Lecture "+lectureID); - try { - if(client.deleteLecture(lectureID, person.verantwortlicher.getHochschule(),person.verantwortlicher.getUsername())){ - System.out.println("L\u00f6schen erfolgreich"); - //delete successful - - DeleteLecture_GUI dl = new DeleteLecture_GUI(); - dl.setVisible(true); - dispose(); - } else { - //delete not successful - JOptionPane - .showMessageDialog( - null, - "L\u00f6schen aus Datenbank fehlgeschlagen.", - "Fehler", - JOptionPane.INFORMATION_MESSAGE); - } - } catch (TException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - }//end delete - }//end ask for confirmation - - }//end check if a row is selected - else if (tableAllLectures.getSelectedRowCount() !=0 && tableAllLectures.getValueAt(tableAllLectures.getSelectedRow(), 5).toString().equals(username)){ - //a row is selected - //ask for confirmation - eingabe = JOptionPane.showConfirmDialog(null, - "Wollen Sie diese Daten l\u00f6schen?", "L\u00f6schen?", - JOptionPane.YES_NO_OPTION); - - if (eingabe == JOptionPane.YES_OPTION) { - //user has confirmed deletion, now get the ID of the selected lecture - lectureID = tableAllLectures.getValueAt(tableAllLectures.convertColumnIndexToModel(tableAllLectures.getSelectedRow()), 7).toString(); - System.out.println("L\u00f6sche Lecture "+lectureID); - try { - if(client.deleteLecture(lectureID, person.verantwortlicher.getHochschule(),person.verantwortlicher.getUsername())){ - System.out.println("L\u00f6schen erfolgreich"); - //delete successful - - DeleteLecture_GUI dl = new DeleteLecture_GUI(); - dl.setVisible(true); - dispose(); - } else { - //delete not successful - JOptionPane - .showMessageDialog( - null, - "L\u00f6schen aus Datenbank fehlgeschlagen.", - "Fehler", - JOptionPane.INFORMATION_MESSAGE); - } - } catch (TException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - }//end delete - }//end ask for confirmation - - }//end check if a row is selected - - } - }); - button.setBounds(459, 508, 118, 23); - contentPanel.add(button); { JPanel buttonPane = new JPanel(); - buttonPane.setBounds(0, 640, 597, 33); + buttonPane.setBounds(0, 640, 826, 33); buttonPane.setBackground(SystemColor.menu); buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); getContentPane().add(buttonPane); @@ -408,12 +396,193 @@ public class DeleteLecture_GUI extends JFrame { } JSeparator separator = new JSeparator(); - separator.setBounds(0, 78, 597, 2); + separator.setBounds(0, 79, 836, 1); getContentPane().add(separator); JSeparator separator_1 = new JSeparator(); - separator_1.setBounds(0, 627, 597, 2); + separator_1.setBounds(0, 628, 836, 1); getContentPane().add(separator_1); + + JPanel panel = new JPanel(); + panel.setLayout(null); + panel.setBorder(new TitledBorder(null, "Detailinformationen", + + TitledBorder.LEADING, TitledBorder.TOP, null, null)); + panel.setBackground(SystemColor.menu); + panel.setBounds(591, 85, 235, 518); + getContentPane().add(panel); + + JLabel lblNewLabel_3 = new JLabel("Name:"); + lblNewLabel_3.setBounds(10, 27, 104, 14); + panel.add(lblNewLabel_3); + + JLabel lblAktiv = new JLabel("Aktiv:"); + lblAktiv.setBounds(10, 88, 104, 14); + panel.add(lblAktiv); + + labelAktiv = new JLabel(""); + labelAktiv.setBounds(124, 88, 104, 14); + panel.add(labelAktiv); + + labelstartdate = new JLabel(""); + labelstartdate.setBounds(124, 113, 104, 14); + panel.add(labelstartdate); + + JLabel lblStartdatum = new JLabel("Startdatum:"); + lblStartdatum.setBounds(10, 113, 104, 14); + panel.add(lblStartdatum); + + labelenddate = new JLabel(""); + labelenddate.setBounds(124, 138, 104, 14); + panel.add(labelenddate); + + JLabel lblEnddatum = new JLabel("Enddatum:"); + lblEnddatum.setBounds(10, 138, 104, 14); + panel.add(lblEnddatum); + + JLabel lblBeschreibung = new JLabel("Beschreibung:"); + lblBeschreibung.setBounds(10, 163, 104, 14); + panel.add(lblBeschreibung); + + JLabel lblImage = new JLabel("Image:"); + lblImage.setBounds(10, 284, 104, 14); + panel.add(lblImage); + + labelVerantwortlicher = new JLabel(""); + labelVerantwortlicher.setBounds(124, 401, 104, 14); + panel.add(labelVerantwortlicher); + + JLabel lblVerantwortlicher = new JLabel("Verantwortlicher:"); + lblVerantwortlicher.setBounds(10, 401, 104, 14); + panel.add(lblVerantwortlicher); + + JLabel lblImageversion = new JLabel("Imageversion:"); + lblImageversion.setBounds(10, 376, 104, 14); + panel.add(lblImageversion); + + labelimageversion = new JLabel(""); + labelimageversion.setBounds(124, 376, 104, 14); + panel.add(labelimageversion); + + + labeldesc = new JTextArea(); + labeldesc.setFont(new Font("Tahoma", Font.PLAIN, 11)); + labeldesc.setEditable(false); + labeldesc.setLineWrap(true); + labeldesc.setBackground(SystemColor.menu); + labeldesc.setBounds(124, 127, 104, 110); + JScrollPane scrollPane = new JScrollPane(labeldesc); + scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); + scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); + scrollPane.setBounds(124, 163, 104, 110); + panel.add(scrollPane); + //panel.add(labeldesc); + + labelimage = new JTextArea(); + labelimage.setLineWrap(true); + labelimage.setFont(new Font("Tahoma", Font.PLAIN, 11)); + labelimage.setEditable(false); + labelimage.setBackground(SystemColor.menu); + labelimage.setBounds(124, 248, 101, 81); + JScrollPane scrollPaneImage = new JScrollPane(labelimage); + scrollPaneImage.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); + scrollPaneImage.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); + scrollPaneImage.setBounds(124, 284, 101, 81); + panel.add(scrollPaneImage); + + labelName = new JTextArea(); + labelName.setFont(new Font("Tahoma", Font.PLAIN, 11)); + labelName.setBackground(SystemColor.menu); + labelName.setBounds(124, 22, 101, 55); + JScrollPane scrollPaneName = new JScrollPane(labelName); + scrollPaneName.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); + scrollPaneName.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); + scrollPaneName.setBounds(124, 22, 101, 55); + panel.add(scrollPaneName); + + button = new JButton("L\u00F6schen"); + button.setBounds(469, 606, 118, 23); + getContentPane().add(button); + button.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + String lectureID=""; + int eingabe; + String username = person.verantwortlicher.getName() + " " + + person.verantwortlicher.getVorname(); + //check if a row is selected + if (tablemyLectures.getSelectedRowCount() !=0){ + //a row is selected + //ask for confirmation + eingabe = JOptionPane.showConfirmDialog(null, + "Wollen Sie diese Daten l\u00f6schen?", "L\u00f6schen?", + JOptionPane.YES_NO_OPTION); + + if (eingabe == JOptionPane.YES_OPTION) { + //user has confirmed deletion, now get the ID of the selected lecture + lectureID = modelMyLectures.getValueAt(tablemyLectures.convertColumnIndexToModel(tablemyLectures.getSelectedRow()), 8).toString(); + System.out.println("L\u00f6sche Lecture "+lectureID); + try { + if(client.deleteLecture(lectureID, person.verantwortlicher.getHochschule(),person.verantwortlicher.getUsername())){ + System.out.println("L\u00f6schen erfolgreich"); + //delete successful + + DeleteLecture_GUI dl = new DeleteLecture_GUI(); + dl.setVisible(true); + dispose(); + } else { + //delete not successful + JOptionPane + .showMessageDialog( + null, + "L\u00f6schen aus Datenbank fehlgeschlagen.", + "Fehler", + JOptionPane.INFORMATION_MESSAGE); + } + } catch (TException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + }//end delete + }//end ask for confirmation + + }//end check if a row is selected + else if (tableAllLectures.getSelectedRowCount() !=0 && tableAllLectures.getValueAt(tableAllLectures.getSelectedRow(), 5).toString().equals(username)){ + //a row is selected + //ask for confirmation + eingabe = JOptionPane.showConfirmDialog(null, + "Wollen Sie diese Daten l\u00f6schen?", "L\u00f6schen?", + JOptionPane.YES_NO_OPTION); + + if (eingabe == JOptionPane.YES_OPTION) { + //user has confirmed deletion, now get the ID of the selected lecture + lectureID = tableAllLectures.getValueAt(tableAllLectures.convertColumnIndexToModel(tableAllLectures.getSelectedRow()), 8).toString(); + System.out.println("L\u00f6sche Lecture "+lectureID); + try { + if(client.deleteLecture(lectureID, person.verantwortlicher.getHochschule(),person.verantwortlicher.getUsername())){ + System.out.println("L\u00f6schen erfolgreich"); + //delete successful + + DeleteLecture_GUI dl = new DeleteLecture_GUI(); + dl.setVisible(true); + dispose(); + } else { + //delete not successful + JOptionPane + .showMessageDialog( + null, + "L\u00f6schen aus Datenbank fehlgeschlagen.", + "Fehler", + JOptionPane.INFORMATION_MESSAGE); + } + } catch (TException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + }//end delete + }//end ask for confirmation + + }//end check if a row is selected + + } + }); JMenuBar menuBar = new JMenuBar(); setJMenuBar(menuBar); @@ -477,13 +646,14 @@ public class DeleteLecture_GUI extends JFrame { } // Initiale Beffuelung eines Table models - public DefaultTableModel initTableModel(DefaultTableModel model) { + public DefaultTableModel initTableModel(DefaultTableModel model) throws ParseException { List<server.Lecture> lectures; try { // Hole eine Liste der Images lectures = client.getLectureList(); Iterator<server.Lecture> i = lectures.iterator(); - + SimpleDateFormat in=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); + SimpleDateFormat out=new SimpleDateFormat("dd.MM.yyyy hh:mm:ss"); int x = 0; while (i.hasNext()) { @@ -491,11 +661,11 @@ public class DeleteLecture_GUI extends JFrame { Object[] obj = { lectures.get(x).lecturename, lectures.get(x).desc, - lectures.get(x).starttime + " " - + lectures.get(x).endtime, - lectures.get(x).isActive, lectures.get(x).lastused, + out.format(in.parse(lectures.get(x).starttime)) + " " + + out.format(in.parse(lectures.get(x).endtime)), + lectures.get(x).isActive, out.format(in.parse(lectures.get(x).lastused)), lectures.get(x).username, - lectures.get(x).imagename,lectures.get(x).id }; + lectures.get(x).imagename," " ,lectures.get(x).id }; // Fuege diese Objekte der Tabelle hinzu model.addRow(obj); x++; @@ -510,4 +680,20 @@ public class DeleteLecture_GUI extends JFrame { } return model; } + public void writeLectureData(String id) throws TException, ParseException{ + + SimpleDateFormat in=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); + SimpleDateFormat out=new SimpleDateFormat("dd.MM.yyyy hh:mm:ss"); + Map<String,String> res=client.getLectureData(id); + labelName.setText(res.get("name")); + labelAktiv.setText(res.get("isActive")); + labeldesc.setText(res.get("desc")); + labelVerantwortlicher.setText(res.get("owner")); + labelstartdate.setText(out.format(in.parse(res.get("startTime")))); + labelenddate.setText(out.format(in.parse(res.get("endTime")))); + labelimage.setText(res.get("imagepath").substring(res.get("imagepath").indexOf("/")+1)); + labelimageversion.setText(res.get("imageversion")); + + +} } diff --git a/Dozentenmodul/src/gui/lecture/EditLectureLink_GUI.java b/Dozentenmodul/src/gui/lecture/EditLectureLink_GUI.java index a98ea836..149c93f5 100644 --- a/Dozentenmodul/src/gui/lecture/EditLectureLink_GUI.java +++ b/Dozentenmodul/src/gui/lecture/EditLectureLink_GUI.java @@ -18,10 +18,12 @@ import java.awt.event.WindowEvent; import java.net.URI; import java.net.URISyntaxException; import java.text.DateFormat; +import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Iterator; import java.util.List; +import java.util.Map; import javax.swing.JButton; import javax.swing.JComboBox; @@ -60,6 +62,8 @@ import util.GuiOrganizer; import util.OpenLinks; import javax.swing.event.ChangeListener; import javax.swing.event.ChangeEvent; +import javax.swing.event.ListSelectionEvent; +import javax.swing.event.ListSelectionListener; @SuppressWarnings("serial") public class EditLectureLink_GUI extends JFrame { @@ -69,10 +73,19 @@ public class EditLectureLink_GUI extends JFrame { JRadioButton rdbtnInternetJa; JRadioButton rdbtnInternetNein; JComboBox<String> comboBox; + JLabel labelName; + JLabel labelUpdate; + JLabel labelVerantwortlicher; + JLabel labelWeitereVerantwortliche; + JLabel labelVorlage; + JLabel labelLizenzSoftware; + JLabel labelInternet; + JLabel labelRam; + JLabel labelCPU; + private JLabel labelOS; JTable tableAllImages = new JTable(); JTable tablemyImages = new JTable(); JTable tableCoopImages = new JTable(); - JTable tablePublicImages = new JTable(); JTable tablePublicVorlagen = new JTable(); private JTextField textFieldName; JTabbedPane tabbedPane; @@ -114,9 +127,54 @@ public class EditLectureLink_GUI extends JFrame { } @Override public void windowOpened(WindowEvent arg0) { - initTableModel(modelAll); - initTableModel(modelMyImages); - initTableModel(modelPublicVorlagen); + try { + initTableModel(modelAll); + initTableModel(modelMyImages); + initTableModel(modelPublicVorlagen); + } catch (TException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (ParseException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + tablemyImages.getColumnModel().getColumn(1).setWidth(0); + tablemyImages.getColumnModel().getColumn(1).setMinWidth(0); + tablemyImages.getColumnModel().getColumn(1).setMaxWidth(0); + tablemyImages.getColumnModel().getColumn(8).setWidth(0); + tablemyImages.getColumnModel().getColumn(8).setMinWidth(0); + tablemyImages.getColumnModel().getColumn(8).setMaxWidth(0); + tablemyImages.getColumnModel().getColumn(6).setWidth(0); + tablemyImages.getColumnModel().getColumn(6).setMinWidth(0); + tablemyImages.getColumnModel().getColumn(6).setMaxWidth(0); + tablemyImages.getColumnModel().getColumn(7).setWidth(0); + tablemyImages.getColumnModel().getColumn(7).setMinWidth(0); + tablemyImages.getColumnModel().getColumn(7).setMaxWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(1).setWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(1).setMinWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(1).setMaxWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(8).setWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(8).setMinWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(8).setMaxWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(6).setWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(6).setMinWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(6).setMaxWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(7).setWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(7).setMinWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(7).setMaxWidth(0); + tableAllImages.getColumnModel().getColumn(1).setWidth(0); + tableAllImages.getColumnModel().getColumn(1).setMinWidth(0); + tableAllImages.getColumnModel().getColumn(1).setMaxWidth(0); + tableAllImages.getColumnModel().getColumn(8).setWidth(0); + tableAllImages.getColumnModel().getColumn(8).setMinWidth(0); + tableAllImages.getColumnModel().getColumn(8).setMaxWidth(0); + tableAllImages.getColumnModel().getColumn(6).setWidth(0); + tableAllImages.getColumnModel().getColumn(6).setMinWidth(0); + tableAllImages.getColumnModel().getColumn(6).setMaxWidth(0); + tableAllImages.getColumnModel().getColumn(7).setWidth(0); + tableAllImages.getColumnModel().getColumn(7).setMinWidth(0); + tableAllImages.getColumnModel().getColumn(7).setMaxWidth(0); textFieldName.requestFocusInWindow(); } }); @@ -131,7 +189,7 @@ public class EditLectureLink_GUI extends JFrame { } setTitle("bwLehrpool Suite *Prototyp* - Veranstaltung bearbeiten"); - setBounds(0, 0, 603, 722); + setBounds(0, 0, 918, 722); GuiOrganizer.centerGUI(this); @@ -304,10 +362,33 @@ public class EditLectureLink_GUI extends JFrame { } }); - tabbedPane.setBounds(10, 151, 557, 346); + tabbedPane.setBounds(10, 158, 557, 339); contentPanel.add(tabbedPane); JScrollPane scrollPaneAllImages = new JScrollPane(); + tableAllImages.getSelectionModel().addListSelectionListener( new ListSelectionListener() + { + public void valueChanged(ListSelectionEvent e) + { + + String imageid = modelAll + .getValueAt( + tableAllImages + .convertRowIndexToModel(tableAllImages + .getSelectedRow()), 6) + .toString(); + System.out.println(imageid); + String version = modelAll + .getValueAt( + tableAllImages + .convertRowIndexToModel(tableAllImages + .getSelectedRow()), 7) + .toString(); + System.out.println(version); + writeImageData(imageid, version); + + } + }); tableAllImages.setModel(modelAll); tableAllImages.getColumnModel().getColumn(1).sizeWidthToFit(); tableAllImages.getColumnModel().getColumn(2).sizeWidthToFit(); @@ -316,7 +397,27 @@ public class EditLectureLink_GUI extends JFrame { tableAllImages.getColumnModel().getColumn(5).sizeWidthToFit(); tableAllImages.setRowSorter(rowSorterAll); JScrollPane scrollPaneMyImage = new JScrollPane(); - + tablemyImages.getSelectionModel().addListSelectionListener( new ListSelectionListener() + { + public void valueChanged(ListSelectionEvent e) + { + String imageid = modelMyImages + .getValueAt( + tablemyImages + .convertRowIndexToModel(tablemyImages + .getSelectedRow()), 6) + .toString(); + System.out.println(imageid); + String version = modelMyImages + .getValueAt( + tablemyImages + .convertRowIndexToModel(tablemyImages + .getSelectedRow()), 7) + .toString(); + System.out.println(version); + writeImageData(imageid, version); + } + }); tablemyImages.setModel(modelMyImages); tablemyImages.getColumnModel().getColumn(1).sizeWidthToFit(); tablemyImages.getColumnModel().getColumn(2).sizeWidthToFit(); @@ -328,7 +429,28 @@ public class EditLectureLink_GUI extends JFrame { tabbedPane.addTab("Meine Images", null, scrollPaneMyImage, null); JScrollPane scrollPanePublicVorlagen = new JScrollPane(); - + scrollPanePublicVorlagen.setEnabled(false); + tablePublicVorlagen.getSelectionModel().addListSelectionListener( new ListSelectionListener() + { + public void valueChanged(ListSelectionEvent e) + { + String imageid = modelPublicVorlagen + .getValueAt( + tablePublicVorlagen + .convertRowIndexToModel(tablePublicVorlagen + .getSelectedRow()), 6) + .toString(); + System.out.println(imageid); + String version = modelPublicVorlagen + .getValueAt( + tablePublicVorlagen + .convertRowIndexToModel(tablePublicVorlagen + .getSelectedRow()), 7) + .toString(); + System.out.println(version); + writeImageData(imageid, version); + } + }); tablePublicVorlagen.setModel(modelPublicVorlagen); tablePublicVorlagen.getColumnModel().getColumn(1).sizeWidthToFit(); tablePublicVorlagen.getColumnModel().getColumn(2).sizeWidthToFit(); @@ -337,7 +459,7 @@ public class EditLectureLink_GUI extends JFrame { tablePublicVorlagen.getColumnModel().getColumn(5).sizeWidthToFit(); tablePublicVorlagen.setRowSorter(rowSorterPublicVorlagen); scrollPanePublicVorlagen.setViewportView(tablePublicVorlagen); - tabbedPane.addTab("\u00D6ffentliche Vorlagen", null, + tabbedPane.addTab("Vorlagen", null, scrollPanePublicVorlagen, null); tabbedPane.setEnabledAt(1, false); @@ -354,24 +476,10 @@ public class EditLectureLink_GUI extends JFrame { tableCoopImages.getColumnModel().getColumn(5).sizeWidthToFit(); scrollPaneCoopImages.setViewportView(tableCoopImages); - tabbedPane.addTab("Kooperative Images", null, scrollPaneCoopImages, + tabbedPane.addTab("bwLehrpool", null, scrollPaneCoopImages, null); tabbedPane.setEnabledAt(3, false); - JScrollPane scrollPanePublicImages = new JScrollPane(); - - tablePublicImages.setModel(model); - tablePublicImages.getColumnModel().getColumn(1).sizeWidthToFit(); - tablePublicImages.getColumnModel().getColumn(2).sizeWidthToFit(); - tablePublicImages.getColumnModel().getColumn(3).sizeWidthToFit(); - tablePublicImages.getColumnModel().getColumn(4).sizeWidthToFit(); - tablePublicImages.getColumnModel().getColumn(5).sizeWidthToFit(); - - scrollPanePublicImages.setViewportView(tablePublicImages); - tabbedPane.addTab("\u00D6ffentliche Images", null, - scrollPanePublicImages, null); - tabbedPane.setEnabledAt(4, false); - JButton btnLinkLschen = new JButton("Link l\u00F6schen"); btnLinkLschen.setEnabled(false); btnLinkLschen.setBounds(478, 508, 89, 23); @@ -380,7 +488,7 @@ public class EditLectureLink_GUI extends JFrame { { JPanel buttonPane = new JPanel(); - buttonPane.setBounds(0, 640, 597, 33); + buttonPane.setBounds(0, 640, 902, 33); buttonPane.setBackground(SystemColor.menu); buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); getContentPane().add(buttonPane); @@ -415,8 +523,9 @@ public class EditLectureLink_GUI extends JFrame { try { DateFormat formatter = new SimpleDateFormat( "yyyy-MM-dd hh:mm:ss"); - client.writeLecturedata( + client.updateLecturedata( Lecture.lecture.getName(), + Lecture.lecture.getNewName(), Lecture.lecture.getShortDesc(), Lecture.lecture.getDesc(), formatter.format( @@ -426,18 +535,28 @@ public class EditLectureLink_GUI extends JFrame { Lecture.lecture.getEnddate()) .toString(), Lecture.lecture.isActive(), - imagename, - person.verantwortlicher.getUsername(), + modelMyImages + .getValueAt( + tablemyImages + .convertRowIndexToModel(tablemyImages + .getSelectedRow()), 6).toString(), + modelMyImages + .getValueAt( + tablemyImages + .convertRowIndexToModel(tablemyImages + .getSelectedRow()), 7) + .toString(), person.verantwortlicher.getVorname(), person.verantwortlicher.getName(), person.verantwortlicher.getHochschule(), person.verantwortlicher.getEMail(), person.verantwortlicher.getTel(), - person.verantwortlicher.getFakultaet()); + person.verantwortlicher.getFakultaet(), + Lecture.lecture.getid()); JOptionPane .showMessageDialog( null, - "Ihre Veranstaltung wurde erfolgreich angelegt. Sie kehren nun zum Hauptmen\u00fc zur\u00fcck.", + "Ihre Veranstaltung wurde erfolgreich geändert. Sie kehren nun zum Hauptmen\u00fc zur\u00fcck.", "Veranstaltung angelegt", JOptionPane.INFORMATION_MESSAGE); // zurueck zum Menue @@ -468,8 +587,9 @@ public class EditLectureLink_GUI extends JFrame { try { DateFormat formatter = new SimpleDateFormat( "yyyy-MM-dd hh:mm:ss"); - client.writeLecturedata( + client.updateLecturedata( Lecture.lecture.getName(), + Lecture.lecture.getNewName(), Lecture.lecture.getShortDesc(), Lecture.lecture.getDesc(), formatter.format( @@ -479,18 +599,27 @@ public class EditLectureLink_GUI extends JFrame { Lecture.lecture.getEnddate()) .toString(), Lecture.lecture.isActive(), - imagename, - person.verantwortlicher.getUsername(), + modelPublicVorlagen + .getValueAt( + tablePublicVorlagen + .convertRowIndexToModel(tablePublicVorlagen + .getSelectedRow()), 6).toString(), + modelPublicVorlagen + .getValueAt( + tablePublicVorlagen + .convertRowIndexToModel(tablePublicVorlagen + .getSelectedRow()), 7).toString(), person.verantwortlicher.getVorname(), person.verantwortlicher.getName(), person.verantwortlicher.getHochschule(), person.verantwortlicher.getEMail(), person.verantwortlicher.getTel(), - person.verantwortlicher.getFakultaet()); + person.verantwortlicher.getFakultaet(), + Lecture.lecture.getid()); JOptionPane .showMessageDialog( null, - "Ihre Veranstaltung wurde erfolgreich angelegt. Sie kehren nun zum Hauptmen\u00fc zur\u00fcck.", + "Ihre Veranstaltung wurde erfolgreich geändert. Sie kehren nun zum Hauptmen\u00fc zur\u00fcck.", "Veranstaltung angelegt", JOptionPane.INFORMATION_MESSAGE); // zurueck zum Menue @@ -521,8 +650,9 @@ public class EditLectureLink_GUI extends JFrame { try { DateFormat formatter = new SimpleDateFormat( "yyyy-MM-dd hh:mm:ss"); - client.writeLecturedata( + client.updateLecturedata( Lecture.lecture.getName(), + Lecture.lecture.getNewName(), Lecture.lecture.getShortDesc(), Lecture.lecture.getDesc(), formatter.format( @@ -532,18 +662,30 @@ public class EditLectureLink_GUI extends JFrame { Lecture.lecture.getEnddate()) .toString(), Lecture.lecture.isActive(), - imagename, - person.verantwortlicher.getUsername(), + modelAll + .getValueAt( + tableAllImages + .convertRowIndexToModel(tableAllImages + .getSelectedRow()), 6) + .toString(), + modelAll + .getValueAt( + tableAllImages + .convertRowIndexToModel(tableAllImages + .getSelectedRow()), 7) + .toString(), + person.verantwortlicher.getVorname(), person.verantwortlicher.getName(), person.verantwortlicher.getHochschule(), person.verantwortlicher.getEMail(), person.verantwortlicher.getTel(), - person.verantwortlicher.getFakultaet()); + person.verantwortlicher.getFakultaet(), + Lecture.lecture.getid()); JOptionPane .showMessageDialog( null, - "Ihre Veranstaltung wurde erfolgreich angelegt. Sie kehren nun zum Hauptmen\u00fc zur\u00fcck.", + "Ihre Veranstaltung wurde erfolgreich geändert. Sie kehren nun zum Hauptmen\u00fc zur\u00fcck.", "Veranstaltung angelegt", JOptionPane.INFORMATION_MESSAGE); // zurueck zum Menue @@ -582,12 +724,109 @@ public class EditLectureLink_GUI extends JFrame { } JSeparator separator = new JSeparator(); - separator.setBounds(0, 78, 597, 2); + separator.setBounds(0, 79, 912, 1); getContentPane().add(separator); JSeparator separator_1 = new JSeparator(); - separator_1.setBounds(0, 627, 597, 2); + separator_1.setBounds(0, 627, 912, 2); getContentPane().add(separator_1); + + JPanel panel = new JPanel(); + panel.setLayout(null); + panel.setBorder(new TitledBorder(null, "Detailinformationen", + + TitledBorder.LEADING, TitledBorder.TOP, null, null)); + panel.setBackground(SystemColor.menu); + panel.setBounds(586, 85, 316, 531); + getContentPane().add(panel); + + JLabel lblName = new JLabel("Name:"); + lblName.setBounds(10, 30, 130, 14); + panel.add(lblName); + + labelName = new JLabel(""); + labelName.setBounds(150, 30, 130, 14); + panel.add(labelName); + + JLabel lblVerantwortlicher = new JLabel("Verantwortlicher:"); + lblVerantwortlicher.setBounds(10, 105, 130, 14); + panel.add(lblVerantwortlicher); + + labelOS = new JLabel(""); + labelOS.setBounds(150, 55, 130, 14); + panel.add(labelOS); + + JLabel lblWeitereVerantwortliche = new JLabel("Betriebssystem:"); + lblWeitereVerantwortliche.setBounds(10, 55, 130, 14); + panel.add(lblWeitereVerantwortliche); + + labelVerantwortlicher = new JLabel(""); + labelVerantwortlicher.setBounds(150, 105, 130, 14); + panel.add(labelVerantwortlicher); + + JLabel label = new JLabel("Weitere Verantwortliche:"); + label.setBounds(10, 130, 130, 14); + panel.add(label); + + labelWeitereVerantwortliche = new JLabel(""); + labelWeitereVerantwortliche.setBounds(150, 130, 130, 14); + panel.add(labelWeitereVerantwortliche); + + JLabel label_5 = new JLabel(""); + label_5.setBounds(150, 130, 130, 14); + panel.add(label_5); + + labelUpdate = new JLabel(""); + labelUpdate.setBounds(150, 80, 130, 14); + panel.add(labelUpdate); + + JLabel lblLetztesUpdate = new JLabel("Letztes Update:"); + lblLetztesUpdate.setBounds(10, 80, 130, 14); + panel.add(lblLetztesUpdate); + + JLabel lblImageIstVorlage = new JLabel("Image ist Vorlage:"); + lblImageIstVorlage.setBounds(10, 259, 130, 14); + panel.add(lblImageIstVorlage); + + labelVorlage = new JLabel(""); + labelVorlage.setBounds(150, 259, 130, 14); + panel.add(labelVorlage); + + labelLizenzSoftware = new JLabel(""); + labelLizenzSoftware.setBounds(150, 284, 130, 14); + panel.add(labelLizenzSoftware); + + JLabel lblLizenzpflichtigeSoftware = new JLabel("Lizenzpflichtige Software:"); + lblLizenzpflichtigeSoftware.setBounds(10, 284, 130, 14); + panel.add(lblLizenzpflichtigeSoftware); + + JLabel lblInternet = new JLabel("Internet:"); + lblInternet.setBounds(10, 309, 130, 14); + panel.add(lblInternet); + + labelInternet = new JLabel(""); + labelInternet.setBounds(150, 309, 130, 14); + panel.add(labelInternet); + + JLabel lblEmpfehlungRam = new JLabel("Empfehlung RAM:"); + lblEmpfehlungRam.setBounds(10, 334, 130, 14); + panel.add(lblEmpfehlungRam); + + labelRam = new JLabel(""); + labelRam.setBounds(150, 334, 130, 14); + panel.add(labelRam); + + JLabel lblEmpfehlungCpu = new JLabel("Empfehlung CPU:"); + lblEmpfehlungCpu.setBounds(10, 359, 130, 14); + panel.add(lblEmpfehlungCpu); + + labelCPU = new JLabel(""); + labelCPU.setBounds(150, 359, 130, 14); + panel.add(labelCPU); + + JLabel lblTechnischeDaten = new JLabel("Technische Daten:"); + lblTechnischeDaten.setBounds(10, 223, 296, 14); + panel.add(lblTechnischeDaten); JMenuBar menuBar = new JMenuBar(); setJMenuBar(menuBar); @@ -657,14 +896,15 @@ public class EditLectureLink_GUI extends JFrame { } // Initiale Beffuelung eines Table models - public DefaultTableModel initTableModel(DefaultTableModel model) { + public DefaultTableModel initTableModel(DefaultTableModel model) throws TException, ParseException { List<server.Image> images; - try { + // Hole eine Liste der Images images = client.getImageList(); Iterator<server.Image> i = images.iterator(); - + SimpleDateFormat in=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); + SimpleDateFormat out=new SimpleDateFormat("dd.MM.yyyy hh:mm:ss"); int x = 0; while (i.hasNext()) { @@ -674,9 +914,9 @@ public class EditLectureLink_GUI extends JFrame { images.get(x).getOsName(), images.get(x).getLectureName(), images.get(x).getUserData(), - images.get(x).getUpdateTime(), images.get(x).id, + out.format(in.parse(images.get(x).updateTime)), images.get(x).id, images.get(x).getVersion(), - images.get(x).getIsTemplate()}; + images.get(x).getIsTemplate() }; // Fuege diese Objekte der Tabelle hinzu model.addRow(obj); x++; @@ -685,13 +925,43 @@ public class EditLectureLink_GUI extends JFrame { } return model; - } catch (TException e1) { + + + } + public void writeImageData(String id, String version){ + try { + SimpleDateFormat in=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); + SimpleDateFormat out=new SimpleDateFormat("dd.MM.yyyy hh:mm:ss"); + Map<String,String> res=client.getImageData(id,version); + labelName.setText(res.get("name")); + labelOS.setText(res.get("os")); + labelUpdate.setText(out.format(in.parse(res.get("lastupdate")))); + labelVerantwortlicher.setText(res.get("owner")); + labelWeitereVerantwortliche.setText("Noch nicht Verf�gbar"); + if(res.get("template").equals("true")){ + labelVorlage.setText("Ja"); + }else{ + labelVorlage.setText("Nein"); + } + if(res.get("license").equals("1")){ + labelLizenzSoftware.setText("Ja"); + } + else + { + labelLizenzSoftware.setText("Nein"); + } + if(res.get("internet").equals("1")){ + labelInternet.setText("Ja"); + } + else + { + labelInternet.setText("Nein"); + } + labelRam.setText(res.get("ram")); + labelCPU.setText(res.get("cpu")); + } catch (TException | ParseException e1) { // TODO Auto-generated catch block e1.printStackTrace(); - JOptionPane.showMessageDialog(null, - e1.getCause()+"\n"+e1.getStackTrace(), - "Debug-Message", JOptionPane.ERROR_MESSAGE); } - return model; } } diff --git a/Dozentenmodul/src/gui/lecture/EditLectureSearch_GUI.java b/Dozentenmodul/src/gui/lecture/EditLectureSearch_GUI.java index 9dc4b36c..0a81f96d 100644 --- a/Dozentenmodul/src/gui/lecture/EditLectureSearch_GUI.java +++ b/Dozentenmodul/src/gui/lecture/EditLectureSearch_GUI.java @@ -22,6 +22,7 @@ import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Iterator; import java.util.List; +import java.util.Map; import javax.swing.JButton; import javax.swing.JFrame; @@ -36,15 +37,19 @@ import javax.swing.JScrollPane; import javax.swing.JSeparator; import javax.swing.JTabbedPane; import javax.swing.JTable; +import javax.swing.JTextArea; import javax.swing.JTextField; import javax.swing.JTextPane; import javax.swing.RowFilter; +import javax.swing.ScrollPaneConstants; import javax.swing.UIManager; import javax.swing.UnsupportedLookAndFeelException; import javax.swing.border.EmptyBorder; import javax.swing.border.TitledBorder; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; +import javax.swing.event.ListSelectionEvent; +import javax.swing.event.ListSelectionListener; import javax.swing.table.DefaultTableModel; import javax.swing.table.TableModel; import javax.swing.table.TableRowSorter; @@ -67,16 +72,22 @@ public class EditLectureSearch_GUI extends JFrame { String[] result; JRadioButton rdbtnInternetJa; JRadioButton rdbtnInternetNein; + JLabel labelAktiv; + JLabel labelstartdate; + JLabel labelenddate; + JLabel labelimageversion; + JTextArea labelName; + JTextArea labelimage; + JTextArea labeldesc; + JLabel labelVerantwortlicher; JTable tableAllLectures; JTable tablemyLectures; - JTable tableCoopImages; - JTable tablePublicImages; private JTextField textFieldName; JTabbedPane tabbedPane; boolean activeSearch=false; String[] titles = { "Veranstaltungsname", "Beschreibung", "G\u00fcltigkeitsdatum", "Aktiv", "Letzte Benutzung", - "Verantwortlicher", "Image", "ID" }; + "Verantwortlicher", "Image", "Schlagwort", "ID" }; ThriftConnection con = new ThriftConnection(); Client client = models.Client.clientcon.getClient(); final DefaultTableModel modelAll = new DefaultTableModel(titles, 0){ @@ -109,9 +120,51 @@ public class EditLectureSearch_GUI extends JFrame { } @Override public void windowOpened(WindowEvent arg0) { - initTableModel(modelAll); - initTableModel(modelMyLectures); textFieldName.requestFocusInWindow(); + try { + initTableModel(modelMyLectures); + initTableModel(modelAll); + + } catch (ParseException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + tablemyLectures.getColumnModel().getColumn(1).setWidth(0); + tablemyLectures.getColumnModel().getColumn(1).setMinWidth(0); + tablemyLectures.getColumnModel().getColumn(1).setMaxWidth(0); + tablemyLectures.getColumnModel().getColumn(2).setWidth(0); + tablemyLectures.getColumnModel().getColumn(2).setMinWidth(0); + tablemyLectures.getColumnModel().getColumn(2).setMaxWidth(0); + tablemyLectures.getColumnModel().getColumn(3).setWidth(0); + tablemyLectures.getColumnModel().getColumn(3).setMinWidth(0); + tablemyLectures.getColumnModel().getColumn(3).setMaxWidth(0); + tablemyLectures.getColumnModel().getColumn(6).setWidth(0); + tablemyLectures.getColumnModel().getColumn(6).setMinWidth(0); + tablemyLectures.getColumnModel().getColumn(6).setMaxWidth(0); + tablemyLectures.getColumnModel().getColumn(7).setWidth(0); + tablemyLectures.getColumnModel().getColumn(7).setMinWidth(0); + tablemyLectures.getColumnModel().getColumn(7).setMaxWidth(0); + tablemyLectures.getColumnModel().getColumn(8).setWidth(0); + tablemyLectures.getColumnModel().getColumn(8).setMinWidth(0); + tablemyLectures.getColumnModel().getColumn(8).setMaxWidth(0); + tableAllLectures.getColumnModel().getColumn(1).setWidth(0); + tableAllLectures.getColumnModel().getColumn(1).setMinWidth(0); + tableAllLectures.getColumnModel().getColumn(1).setMaxWidth(0); + tableAllLectures.getColumnModel().getColumn(2).setWidth(0); + tableAllLectures.getColumnModel().getColumn(2).setMinWidth(0); + tableAllLectures.getColumnModel().getColumn(2).setMaxWidth(0); + tableAllLectures.getColumnModel().getColumn(3).setWidth(0); + tableAllLectures.getColumnModel().getColumn(3).setMinWidth(0); + tableAllLectures.getColumnModel().getColumn(3).setMaxWidth(0); + tableAllLectures.getColumnModel().getColumn(6).setWidth(0); + tableAllLectures.getColumnModel().getColumn(6).setMinWidth(0); + tableAllLectures.getColumnModel().getColumn(6).setMaxWidth(0); + tableAllLectures.getColumnModel().getColumn(7).setWidth(0); + tableAllLectures.getColumnModel().getColumn(7).setMinWidth(0); + tableAllLectures.getColumnModel().getColumn(7).setMaxWidth(0); + tableAllLectures.getColumnModel().getColumn(8).setWidth(0); + tableAllLectures.getColumnModel().getColumn(8).setMinWidth(0); + tableAllLectures.getColumnModel().getColumn(8).setMaxWidth(0); } }); // Verhindert das Vergroessern Des Fensters @@ -128,16 +181,14 @@ public class EditLectureSearch_GUI extends JFrame { // Setzt den Fenstertitel setTitle("bwLehrpool Suite *Prototyp* - Veranstaltung bearbeiten"); // Zentriert das Fenster in die Bildmitte - setBounds(0, 0, 603, 722); + setBounds(0, 0, 842, 722); GuiOrganizer.centerGUI(this); - final DefaultTableModel model = new DefaultTableModel(titles, 0); - getContentPane().setLayout(null); { JPanel panel = new JPanel(); panel.setBackground(SystemColor.menu); - panel.setBounds(10, 11, 577, 57); + panel.setBounds(10, 11, 816, 57); getContentPane().add(panel); panel.setLayout(null); { @@ -252,12 +303,35 @@ public class EditLectureSearch_GUI extends JFrame { } }); - tabbedPane.setBounds(10, 126, 557, 394); + tabbedPane.setBounds(10, 123, 557, 397); contentPanel.add(tabbedPane); JScrollPane scrollPaneAllImages = new JScrollPane(); tableAllLectures = new JTable(); + tableAllLectures.getSelectionModel().addListSelectionListener( new ListSelectionListener() + { + public void valueChanged(ListSelectionEvent e) + { + String imageid = modelAll + .getValueAt( + tableAllLectures + .convertRowIndexToModel(tableAllLectures + .getSelectedRow()), 8) + .toString(); + System.out.println(imageid); + + try { + writeLectureData(imageid); + } catch (TException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } catch (ParseException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + } + }); tableAllLectures.setModel(modelAll); tableAllLectures.getColumnModel().getColumn(1).sizeWidthToFit(); tableAllLectures.getColumnModel().getColumn(2).sizeWidthToFit(); @@ -268,6 +342,29 @@ public class EditLectureSearch_GUI extends JFrame { JScrollPane scrollPaneMyImage = new JScrollPane(); tablemyLectures = new JTable(); + tablemyLectures.getSelectionModel().addListSelectionListener( new ListSelectionListener() + { + public void valueChanged(ListSelectionEvent e) + { + String imageid = modelMyLectures + .getValueAt( + tablemyLectures + .convertRowIndexToModel(tablemyLectures + .getSelectedRow()), 8) + .toString(); + System.out.println(imageid); + + try { + writeLectureData(imageid); + } catch (TException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } catch (ParseException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + } + }); tablemyLectures.setModel(modelMyLectures); tablemyLectures.getColumnModel().getColumn(1).sizeWidthToFit(); @@ -284,37 +381,9 @@ public class EditLectureSearch_GUI extends JFrame { scrollPaneAllImages.setViewportView(tableAllLectures); tabbedPane.addTab("Alle", null, scrollPaneAllImages, null); - - JScrollPane scrollPaneCoopImages = new JScrollPane(); - tableCoopImages = new JTable(); - tableCoopImages.setModel(model); - tableCoopImages.getColumnModel().getColumn(1).sizeWidthToFit(); - tableCoopImages.getColumnModel().getColumn(2).sizeWidthToFit(); - tableCoopImages.getColumnModel().getColumn(3).sizeWidthToFit(); - tableCoopImages.getColumnModel().getColumn(4).sizeWidthToFit(); - tableCoopImages.getColumnModel().getColumn(5).sizeWidthToFit(); - - scrollPaneCoopImages.setViewportView(tableCoopImages); - tabbedPane.addTab("Kooperative Veranstaltungen", null, - scrollPaneCoopImages, null); - tabbedPane.setEnabledAt(2, false); - - JScrollPane scrollPanePublicImages = new JScrollPane(); - tablePublicImages = new JTable(); - tablePublicImages.setModel(model); - tablePublicImages.getColumnModel().getColumn(1).sizeWidthToFit(); - tablePublicImages.getColumnModel().getColumn(2).sizeWidthToFit(); - tablePublicImages.getColumnModel().getColumn(3).sizeWidthToFit(); - tablePublicImages.getColumnModel().getColumn(4).sizeWidthToFit(); - tablePublicImages.getColumnModel().getColumn(5).sizeWidthToFit(); - - scrollPanePublicImages.setViewportView(tablePublicImages); - tabbedPane.addTab("\u00D6ffentliche Veranstaltungen", null, - scrollPanePublicImages, null); - tabbedPane.setEnabledAt(3, false); { JPanel buttonPane = new JPanel(); - buttonPane.setBounds(0, 640, 597, 33); + buttonPane.setBounds(0, 640, 826, 33); buttonPane.setBackground(SystemColor.menu); buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); getContentPane().add(buttonPane); @@ -351,7 +420,7 @@ public class EditLectureSearch_GUI extends JFrame { tablemyLectures .convertRowIndexToModel(tablemyLectures .getSelectedRow()), - 7).toString()); + 8).toString()); Lecture.lecture.setName(modelMyLectures .getValueAt( tablemyLectures @@ -385,6 +454,16 @@ public class EditLectureSearch_GUI extends JFrame { zweitesLeerzeichen); String enddate = date .substring(zweitesLeerzeichen); + SimpleDateFormat out=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); + SimpleDateFormat in=new SimpleDateFormat("dd.MM.yyyy hh:mm:ss"); + try { + enddate=out.format(in.parse(enddate)); + startdate=out.format(in.parse(startdate)); + } catch (ParseException e2) { + // TODO Auto-generated catch block + e2.printStackTrace(); + } + DateFormat df = new SimpleDateFormat( "yyyy-MM-dd hh:mm:ss"); @@ -415,7 +494,7 @@ public class EditLectureSearch_GUI extends JFrame { EditLectureAllgemein_GUI el = new EditLectureAllgemein_GUI(); el.setVisible(true); dispose(); - } if (tableAllLectures.getSelectedRow() != -1 && tableAllLectures.getValueAt(tableAllLectures.getSelectedRow(), 5).toString().equals(username)) { + } else if (tableAllLectures.getSelectedRow() != -1 && tableAllLectures.getValueAt(tableAllLectures.getSelectedRow(), 5).toString().equals(username)) { // a row is selected, do operations @@ -426,7 +505,7 @@ public class EditLectureSearch_GUI extends JFrame { tableAllLectures .convertRowIndexToModel(tableAllLectures .getSelectedRow()), - 7).toString()); + 8).toString()); Lecture.lecture.setName(modelAll .getValueAt( tableAllLectures @@ -460,6 +539,15 @@ public class EditLectureSearch_GUI extends JFrame { zweitesLeerzeichen); String enddate = date .substring(zweitesLeerzeichen); + SimpleDateFormat out=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); + SimpleDateFormat in=new SimpleDateFormat("dd.MM.yyyy hh:mm:ss"); + try { + enddate=out.format(in.parse(enddate)); + startdate=out.format(in.parse(startdate)); + } catch (ParseException e2) { + // TODO Auto-generated catch block + e2.printStackTrace(); + } DateFormat df = new SimpleDateFormat( "yyyy-MM-dd hh:mm:ss"); @@ -484,9 +572,6 @@ public class EditLectureSearch_GUI extends JFrame { Lecture.lecture.setActive(false); } - - // EditImageAllgemein_GUI ea=new - // EditImageAllgemein_GUI(); EditLectureAllgemein_GUI el = new EditLectureAllgemein_GUI(); el.setVisible(true); dispose(); @@ -497,8 +582,8 @@ public class EditLectureSearch_GUI extends JFrame { "Bitte w\u00f4hlen Sie ein eigenes Image aus", "Message", JOptionPane.INFORMATION_MESSAGE); - } - } + } //End Else + } //Action }); @@ -508,13 +593,111 @@ public class EditLectureSearch_GUI extends JFrame { } JSeparator separator = new JSeparator(); - separator.setBounds(0, 78, 597, 2); + separator.setBounds(0, 79, 836, 1); getContentPane().add(separator); JSeparator separator_1 = new JSeparator(); - separator_1.setBounds(0, 627, 597, 2); + separator_1.setBounds(0, 628, 836, 1); getContentPane().add(separator_1); + JPanel panel = new JPanel(); + panel.setLayout(null); + panel.setBorder(new TitledBorder(null, "Detailinformationen", + + TitledBorder.LEADING, TitledBorder.TOP, null, null)); + panel.setBackground(SystemColor.menu); + panel.setBounds(591, 85, 235, 518); + getContentPane().add(panel); + + JLabel lblNewLabel_3 = new JLabel("Name:"); + lblNewLabel_3.setBounds(10, 27, 104, 14); + panel.add(lblNewLabel_3); + + JLabel lblAktiv = new JLabel("Aktiv:"); + lblAktiv.setBounds(10, 88, 104, 14); + panel.add(lblAktiv); + + labelAktiv = new JLabel(""); + labelAktiv.setBounds(124, 88, 104, 14); + panel.add(labelAktiv); + + labelstartdate = new JLabel(""); + labelstartdate.setBounds(124, 113, 104, 14); + panel.add(labelstartdate); + + JLabel lblStartdatum = new JLabel("Startdatum:"); + lblStartdatum.setBounds(10, 113, 104, 14); + panel.add(lblStartdatum); + + labelenddate = new JLabel(""); + labelenddate.setBounds(124, 138, 104, 14); + panel.add(labelenddate); + + JLabel lblEnddatum = new JLabel("Enddatum:"); + lblEnddatum.setBounds(10, 138, 104, 14); + panel.add(lblEnddatum); + + JLabel lblBeschreibung = new JLabel("Beschreibung:"); + lblBeschreibung.setBounds(10, 163, 104, 14); + panel.add(lblBeschreibung); + + JLabel lblImage = new JLabel("Image:"); + lblImage.setBounds(10, 284, 104, 14); + panel.add(lblImage); + + labelVerantwortlicher = new JLabel(""); + labelVerantwortlicher.setBounds(124, 401, 104, 14); + panel.add(labelVerantwortlicher); + + JLabel lblVerantwortlicher = new JLabel("Verantwortlicher:"); + lblVerantwortlicher.setBounds(10, 401, 104, 14); + panel.add(lblVerantwortlicher); + + JLabel lblImageversion = new JLabel("Imageversion:"); + lblImageversion.setBounds(10, 376, 104, 14); + panel.add(lblImageversion); + + labelimageversion = new JLabel(""); + labelimageversion.setBounds(124, 376, 104, 14); + panel.add(labelimageversion); + + + labeldesc = new JTextArea(); + labeldesc.setFont(new Font("Tahoma", Font.PLAIN, 11)); + labeldesc.setEditable(false); + labeldesc.setLineWrap(true); + labeldesc.setBackground(SystemColor.menu); + labeldesc.setBounds(124, 127, 104, 110); + JScrollPane scrollPane = new JScrollPane(labeldesc); + scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); + scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); + scrollPane.setBounds(124, 163, 104, 110); + panel.add(scrollPane); + //panel.add(labeldesc); + + labelimage = new JTextArea(); + labelimage.setLineWrap(true); + labelimage.setFont(new Font("Tahoma", Font.PLAIN, 11)); + labelimage.setEditable(false); + labelimage.setBackground(SystemColor.menu); + labelimage.setBounds(124, 248, 101, 81); + JScrollPane scrollPaneImage = new JScrollPane(labelimage); + scrollPaneImage.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); + scrollPaneImage.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); + scrollPaneImage.setBounds(124, 284, 101, 81); + panel.add(scrollPaneImage); + + labelName = new JTextArea(); + labelName.setFont(new Font("Tahoma", Font.PLAIN, 11)); + labelName.setBackground(SystemColor.menu); + labelName.setBounds(124, 22, 101, 55); + JScrollPane scrollPaneName = new JScrollPane(labelName); + scrollPaneName.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); + scrollPaneName.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); + scrollPaneName.setBounds(124, 22, 101, 55); + panel.add(scrollPaneName); + //panel.add(labelName); + //panel.add(labelimage); JMenuBar menuBar = new JMenuBar(); setJMenuBar(menuBar); @@ -577,13 +760,14 @@ public class EditLectureSearch_GUI extends JFrame { } // Initiale Beffuelung eines Table models - public DefaultTableModel initTableModel(DefaultTableModel model) { + public DefaultTableModel initTableModel(DefaultTableModel model) throws ParseException { List<server.Lecture> lectures; try { // Hole eine Liste der Images lectures = client.getLectureList(); Iterator<server.Lecture> i = lectures.iterator(); - + SimpleDateFormat in=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); + SimpleDateFormat out=new SimpleDateFormat("dd.MM.yyyy hh:mm:ss"); int x = 0; while (i.hasNext()) { @@ -591,11 +775,11 @@ public class EditLectureSearch_GUI extends JFrame { Object[] obj = { lectures.get(x).lecturename, lectures.get(x).desc, - lectures.get(x).starttime + " " - + lectures.get(x).endtime, - lectures.get(x).isActive, lectures.get(x).lastused, + out.format(in.parse(lectures.get(x).starttime)) + " " + + out.format(in.parse(lectures.get(x).endtime)), + lectures.get(x).isActive, out.format(in.parse(lectures.get(x).lastused)), lectures.get(x).username, - lectures.get(x).imagename ,lectures.get(x).id }; + lectures.get(x).imagename," " ,lectures.get(x).id }; // Fuege diese Objekte der Tabelle hinzu model.addRow(obj); x++; @@ -610,5 +794,21 @@ public class EditLectureSearch_GUI extends JFrame { } return model; } + public void writeLectureData(String id) throws TException, ParseException{ + + SimpleDateFormat in=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); + SimpleDateFormat out=new SimpleDateFormat("dd.MM.yyyy hh:mm:ss"); + Map<String,String> res=client.getLectureData(id); + labelName.setText(res.get("name")); + labelAktiv.setText(res.get("isActive")); + labeldesc.setText(res.get("desc")); + labelVerantwortlicher.setText(res.get("owner")); + labelstartdate.setText(out.format(in.parse(res.get("startTime")))); + labelenddate.setText(out.format(in.parse(res.get("endTime")))); + labelimage.setText(res.get("imagepath").substring(res.get("imagepath").indexOf("/")+1)); + labelimageversion.setText(res.get("imageversion")); + + +} } diff --git a/Dozentenmodul/src/gui/lecture/SearchLecture_GUI.java b/Dozentenmodul/src/gui/lecture/SearchLecture_GUI.java index a0276f6c..07a48925 100644 --- a/Dozentenmodul/src/gui/lecture/SearchLecture_GUI.java +++ b/Dozentenmodul/src/gui/lecture/SearchLecture_GUI.java @@ -6,6 +6,7 @@ import gui.intro.MainMenue_GUI; import java.awt.Color;
import java.awt.FlowLayout;
import java.awt.Font;
+import java.awt.Point;
import java.awt.SystemColor;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
@@ -17,8 +18,11 @@ import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent;
import java.net.URI;
import java.net.URISyntaxException;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
import java.util.Iterator;
import java.util.List;
+import java.util.Map;
import javax.swing.JButton;
import javax.swing.JFrame;
@@ -41,6 +45,8 @@ import javax.swing.border.EmptyBorder; import javax.swing.border.TitledBorder;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;
import javax.swing.table.TableRowSorter;
@@ -54,6 +60,8 @@ import server.Server.Client; import thrift.ThriftConnection;
import util.GuiOrganizer;
import util.OpenLinks;
+import javax.swing.JTextArea;
+import javax.swing.ScrollPaneConstants;
@SuppressWarnings("serial")
public class SearchLecture_GUI extends JFrame {
@@ -62,10 +70,19 @@ public class SearchLecture_GUI extends JFrame { String[] result;
JRadioButton rdbtnInternetJa;
JRadioButton rdbtnInternetNein;
+ JLabel labelAktiv;
+ JLabel labelstartdate;
+ JLabel labelenddate;
+ JLabel labelimageversion;
+ JTextArea labelName;
+ JTextArea labelimage;
+ JTextArea labeldesc;
+ JLabel labelVerantwortlicher;
JTable tableAllLectures;
JTable tablemyLectures;
private JTextField textFieldName;
JTabbedPane tabbedPane;
+ boolean activeSearch=false;
String[] titles = { "Veranstaltungsname", "Beschreibung",
"G\u00fcltigkeitsdatum", "Aktiv", "Letzte Benutzung",
"Verantwortlicher", "Image", "Schlagwort", "ID" };
@@ -98,6 +115,53 @@ public class SearchLecture_GUI extends JFrame { con.closeThriftConnection();
System.exit(0);
}
+ @Override
+ public void windowOpened(WindowEvent arg0) {
+ try {
+ initTableModel(modelMyLectures);
+ initTableModel(modelAll);
+
+ } catch (ParseException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ tablemyLectures.getColumnModel().getColumn(1).setWidth(0);
+ tablemyLectures.getColumnModel().getColumn(1).setMinWidth(0);
+ tablemyLectures.getColumnModel().getColumn(1).setMaxWidth(0);
+ tablemyLectures.getColumnModel().getColumn(2).setWidth(0);
+ tablemyLectures.getColumnModel().getColumn(2).setMinWidth(0);
+ tablemyLectures.getColumnModel().getColumn(2).setMaxWidth(0);
+ tablemyLectures.getColumnModel().getColumn(3).setWidth(0);
+ tablemyLectures.getColumnModel().getColumn(3).setMinWidth(0);
+ tablemyLectures.getColumnModel().getColumn(3).setMaxWidth(0);
+ tablemyLectures.getColumnModel().getColumn(6).setWidth(0);
+ tablemyLectures.getColumnModel().getColumn(6).setMinWidth(0);
+ tablemyLectures.getColumnModel().getColumn(6).setMaxWidth(0);
+ tablemyLectures.getColumnModel().getColumn(7).setWidth(0);
+ tablemyLectures.getColumnModel().getColumn(7).setMinWidth(0);
+ tablemyLectures.getColumnModel().getColumn(7).setMaxWidth(0);
+ tablemyLectures.getColumnModel().getColumn(8).setWidth(0);
+ tablemyLectures.getColumnModel().getColumn(8).setMinWidth(0);
+ tablemyLectures.getColumnModel().getColumn(8).setMaxWidth(0);
+ tableAllLectures.getColumnModel().getColumn(1).setWidth(0);
+ tableAllLectures.getColumnModel().getColumn(1).setMinWidth(0);
+ tableAllLectures.getColumnModel().getColumn(1).setMaxWidth(0);
+ tableAllLectures.getColumnModel().getColumn(2).setWidth(0);
+ tableAllLectures.getColumnModel().getColumn(2).setMinWidth(0);
+ tableAllLectures.getColumnModel().getColumn(2).setMaxWidth(0);
+ tableAllLectures.getColumnModel().getColumn(3).setWidth(0);
+ tableAllLectures.getColumnModel().getColumn(3).setMinWidth(0);
+ tableAllLectures.getColumnModel().getColumn(3).setMaxWidth(0);
+ tableAllLectures.getColumnModel().getColumn(6).setWidth(0);
+ tableAllLectures.getColumnModel().getColumn(6).setMinWidth(0);
+ tableAllLectures.getColumnModel().getColumn(6).setMaxWidth(0);
+ tableAllLectures.getColumnModel().getColumn(7).setWidth(0);
+ tableAllLectures.getColumnModel().getColumn(7).setMinWidth(0);
+ tableAllLectures.getColumnModel().getColumn(7).setMaxWidth(0);
+ tableAllLectures.getColumnModel().getColumn(8).setWidth(0);
+ tableAllLectures.getColumnModel().getColumn(8).setMinWidth(0);
+ tableAllLectures.getColumnModel().getColumn(8).setMaxWidth(0);
+ }
});
// Verhindert das Vergroessern Des Fensters
setResizable(false);
@@ -116,8 +180,6 @@ public class SearchLecture_GUI extends JFrame { setBounds(0, 0, 842, 722);
GuiOrganizer.centerGUI(this);
- final DefaultTableModel model = new DefaultTableModel(titles, 0);
-
getContentPane().setLayout(null);
{
JPanel panel = new JPanel();
@@ -136,7 +198,7 @@ public class SearchLecture_GUI extends JFrame { txtpnBitteWhlenSie.setEditable(false);
txtpnBitteWhlenSie.setBackground(SystemColor.menu);
txtpnBitteWhlenSie
- .setText("Hier k\u00F6nnen Sie nach Ihrem gew\u00FCnschten VL-Image suchen und dieses f\u00FCr weitere Schritte ausw\u00E4hlen");
+ .setText("Hier k\u00F6nnen Sie nach Ihrer gew\u00FCnschten Veranstaltung suchen und diese f\u00FCr weitere Schritte ausw\u00E4hlen");
txtpnBitteWhlenSie.setBounds(10, 36, 509, 32);
panel.add(txtpnBitteWhlenSie);
}
@@ -165,15 +227,22 @@ public class SearchLecture_GUI extends JFrame { public void keyReleased(KeyEvent e) {
// Textfield eingabe auslesen
String stext = textFieldName.getText();
-
// Wenn Textfield nicht leer
if (stext != "") {
+ activeSearch=true;
// Filtere nach der Eingabe
rowSorterAll.setRowFilter(RowFilter.regexFilter(
textFieldName.getText(), 0));
rowSorterMyLectures.setRowFilter(RowFilter.regexFilter(
textFieldName.getText(), 0));
+ }else{
+ activeSearch=false;
+ String username = person.verantwortlicher.getName() + " "
+ + person.verantwortlicher.getVorname();
+ rowSorterMyLectures.setRowFilter(RowFilter.regexFilter(
+ username, 5));
+ rowSorterAll.setRowFilter(null);
}
}
});
@@ -232,20 +301,65 @@ public class SearchLecture_GUI extends JFrame { tabbedPane.setBounds(10, 123, 557, 397);
contentPanel.add(tabbedPane);
- initTableModel(modelMyLectures);
+
JScrollPane scrollPaneAllImages = new JScrollPane();
tableAllLectures = new JTable();
+ tableAllLectures.getSelectionModel().addListSelectionListener( new ListSelectionListener()
+ {
+ public void valueChanged(ListSelectionEvent e)
+ {
+ String imageid = modelAll
+ .getValueAt(
+ tableAllLectures
+ .convertRowIndexToModel(tableAllLectures
+ .getSelectedRow()), 8)
+ .toString();
+ System.out.println(imageid);
+
+ try {
+ writeLectureData(imageid);
+ } catch (TException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ } catch (ParseException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ }
+ });
tableAllLectures.setModel(modelAll);
tableAllLectures.getColumnModel().getColumn(1).sizeWidthToFit();
tableAllLectures.getColumnModel().getColumn(2).sizeWidthToFit();
tableAllLectures.getColumnModel().getColumn(3).sizeWidthToFit();
tableAllLectures.getColumnModel().getColumn(4).sizeWidthToFit();
tableAllLectures.getColumnModel().getColumn(5).sizeWidthToFit();
- initTableModel(modelAll);
JScrollPane scrollPaneMyImage = new JScrollPane();
tablemyLectures = new JTable();
+ tablemyLectures.getSelectionModel().addListSelectionListener( new ListSelectionListener()
+ {
+ public void valueChanged(ListSelectionEvent e)
+ {
+ String imageid = modelMyLectures
+ .getValueAt(
+ tablemyLectures
+ .convertRowIndexToModel(tablemyLectures
+ .getSelectedRow()), 8)
+ .toString();
+ System.out.println(imageid);
+
+ try {
+ writeLectureData(imageid);
+ } catch (TException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ } catch (ParseException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ }
+ });
tablemyLectures.setModel(modelMyLectures);
tablemyLectures.getColumnModel().getColumn(1).sizeWidthToFit();
@@ -305,65 +419,91 @@ public class SearchLecture_GUI extends JFrame { lblNewLabel_3.setBounds(10, 27, 104, 14);
panel.add(lblNewLabel_3);
- JLabel labelName = new JLabel("");
- labelName.setBounds(124, 27, 104, 14);
- panel.add(labelName);
-
JLabel lblAktiv = new JLabel("Aktiv:");
- lblAktiv.setBounds(10, 52, 104, 14);
+ lblAktiv.setBounds(10, 88, 104, 14);
panel.add(lblAktiv);
- JLabel labelAktiv = new JLabel("");
- labelAktiv.setBounds(124, 52, 104, 14);
+ labelAktiv = new JLabel("");
+ labelAktiv.setBounds(124, 88, 104, 14);
panel.add(labelAktiv);
- JLabel labelstartdate = new JLabel("");
- labelstartdate.setBounds(124, 77, 104, 14);
+ labelstartdate = new JLabel("");
+ labelstartdate.setBounds(124, 113, 104, 14);
panel.add(labelstartdate);
JLabel lblStartdatum = new JLabel("Startdatum:");
- lblStartdatum.setBounds(10, 77, 104, 14);
+ lblStartdatum.setBounds(10, 113, 104, 14);
panel.add(lblStartdatum);
- JLabel labelenddate = new JLabel("");
- labelenddate.setBounds(124, 102, 104, 14);
+ labelenddate = new JLabel("");
+ labelenddate.setBounds(124, 138, 104, 14);
panel.add(labelenddate);
JLabel lblEnddatum = new JLabel("Enddatum:");
- lblEnddatum.setBounds(10, 102, 104, 14);
+ lblEnddatum.setBounds(10, 138, 104, 14);
panel.add(lblEnddatum);
JLabel lblBeschreibung = new JLabel("Beschreibung:");
- lblBeschreibung.setBounds(10, 127, 104, 14);
+ lblBeschreibung.setBounds(10, 163, 104, 14);
panel.add(lblBeschreibung);
- JLabel labeldesc = new JLabel("");
- labeldesc.setBounds(124, 127, 104, 110);
- panel.add(labeldesc);
-
JLabel lblImage = new JLabel("Image:");
- lblImage.setBounds(10, 248, 104, 14);
+ lblImage.setBounds(10, 284, 104, 14);
panel.add(lblImage);
- JLabel labelimage = new JLabel("");
- labelimage.setBounds(124, 248, 104, 14);
- panel.add(labelimage);
-
- JLabel labelVerantwortlicher = new JLabel("");
- labelVerantwortlicher.setBounds(124, 298, 104, 14);
+ labelVerantwortlicher = new JLabel("");
+ labelVerantwortlicher.setBounds(124, 401, 104, 14);
panel.add(labelVerantwortlicher);
JLabel lblVerantwortlicher = new JLabel("Verantwortlicher:");
- lblVerantwortlicher.setBounds(10, 298, 104, 14);
+ lblVerantwortlicher.setBounds(10, 401, 104, 14);
panel.add(lblVerantwortlicher);
JLabel lblImageversion = new JLabel("Imageversion:");
- lblImageversion.setBounds(10, 273, 104, 14);
+ lblImageversion.setBounds(10, 376, 104, 14);
panel.add(lblImageversion);
- JLabel labelimageversion = new JLabel("");
- labelimageversion.setBounds(124, 273, 104, 14);
+ labelimageversion = new JLabel("");
+ labelimageversion.setBounds(124, 376, 104, 14);
panel.add(labelimageversion);
+
+
+ labeldesc = new JTextArea();
+ labeldesc.setFont(new Font("Tahoma", Font.PLAIN, 11));
+ labeldesc.setEditable(false);
+ labeldesc.setLineWrap(true);
+ labeldesc.setBackground(SystemColor.menu);
+ labeldesc.setBounds(124, 127, 104, 110);
+ JScrollPane scrollPane = new JScrollPane(labeldesc);
+ scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
+ scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
+ scrollPane.setBounds(124, 163, 104, 110);
+ panel.add(scrollPane);
+ //panel.add(labeldesc);
+
+ labelimage = new JTextArea();
+ labelimage.setLineWrap(true);
+ labelimage.setFont(new Font("Tahoma", Font.PLAIN, 11));
+ labelimage.setEditable(false);
+ labelimage.setBackground(SystemColor.menu);
+ labelimage.setBounds(124, 248, 101, 81);
+ JScrollPane scrollPaneImage = new JScrollPane(labelimage);
+ scrollPaneImage.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
+ scrollPaneImage.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
+ scrollPaneImage.setBounds(124, 284, 101, 81);
+ panel.add(scrollPaneImage);
+
+ labelName = new JTextArea();
+ labelName.setFont(new Font("Tahoma", Font.PLAIN, 11));
+ labelName.setBackground(SystemColor.menu);
+ labelName.setBounds(124, 22, 101, 55);
+ JScrollPane scrollPaneName = new JScrollPane(labelName);
+ scrollPaneName.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
+ scrollPaneName.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
+ scrollPaneName.setBounds(124, 22, 101, 55);
+ panel.add(scrollPaneName);
+ //panel.add(labelName);
+ //panel.add(labelimage);
JMenuBar menuBar = new JMenuBar();
setJMenuBar(menuBar);
@@ -373,6 +513,7 @@ public class SearchLecture_GUI extends JFrame { JMenuItem mntmFaq = new JMenuItem("FAQ");
mntmFaq.addMouseListener(new MouseAdapter() {
+ @SuppressWarnings("static-access")
@Override
public void mousePressed(MouseEvent arg0) {
@@ -395,6 +536,7 @@ public class SearchLecture_GUI extends JFrame { JMenuItem mntmOtrs = new JMenuItem("OTRS");
mntmOtrs.addMouseListener(new MouseAdapter() {
+ @SuppressWarnings("static-access")
@Override
public void mousePressed(MouseEvent arg0) {
@@ -427,13 +569,14 @@ public class SearchLecture_GUI extends JFrame { }
// Initiale Beffuelung eines Table models
- public DefaultTableModel initTableModel(DefaultTableModel model) {
+ public DefaultTableModel initTableModel(DefaultTableModel model) throws ParseException {
List<server.Lecture> lectures;
try {
// Hole eine Liste der Images
lectures = client.getLectureList();
Iterator<server.Lecture> i = lectures.iterator();
-
+ SimpleDateFormat in=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
+ SimpleDateFormat out=new SimpleDateFormat("dd.MM.yyyy hh:mm:ss");
int x = 0;
while (i.hasNext()) {
@@ -441,9 +584,9 @@ public class SearchLecture_GUI extends JFrame { Object[] obj = {
lectures.get(x).lecturename,
lectures.get(x).desc,
- lectures.get(x).starttime + " "
- + lectures.get(x).endtime,
- lectures.get(x).isActive, lectures.get(x).lastused,
+ out.format(in.parse(lectures.get(x).starttime)) + " "
+ + out.format(in.parse(lectures.get(x).endtime)),
+ lectures.get(x).isActive, out.format(in.parse(lectures.get(x).lastused)),
lectures.get(x).username,
lectures.get(x).imagename," " ,lectures.get(x).id };
// Fuege diese Objekte der Tabelle hinzu
@@ -460,4 +603,20 @@ public class SearchLecture_GUI extends JFrame { }
return model;
}
+ public void writeLectureData(String id) throws TException, ParseException{
+
+ SimpleDateFormat in=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
+ SimpleDateFormat out=new SimpleDateFormat("dd.MM.yyyy hh:mm:ss");
+ Map<String,String> res=client.getLectureData(id);
+ labelName.setText(res.get("name"));
+ labelAktiv.setText(res.get("isActive"));
+ labeldesc.setText(res.get("desc"));
+ labelVerantwortlicher.setText(res.get("owner"));
+ labelstartdate.setText(out.format(in.parse(res.get("startTime"))));
+ labelenddate.setText(out.format(in.parse(res.get("endTime"))));
+ labelimage.setText(res.get("imagepath").substring(res.get("imagepath").indexOf("/")+1));
+ labelimageversion.setText(res.get("imageversion"));
+
+
+ }
}
diff --git a/Dozentenmodulserver/bin/server/Server$getLectureData_args$getLectureData_argsTupleScheme.class b/Dozentenmodulserver/bin/server/Server$getLectureData_args$getLectureData_argsTupleScheme.class Binary files differindex 369faacc..9afb3914 100644 --- a/Dozentenmodulserver/bin/server/Server$getLectureData_args$getLectureData_argsTupleScheme.class +++ b/Dozentenmodulserver/bin/server/Server$getLectureData_args$getLectureData_argsTupleScheme.class diff --git a/Dozentenmodulserver/bin/server/Server$getLectureData_result$_Fields.class b/Dozentenmodulserver/bin/server/Server$getLectureData_result$_Fields.class Binary files differindex de63a796..8c45803b 100644 --- a/Dozentenmodulserver/bin/server/Server$getLectureData_result$_Fields.class +++ b/Dozentenmodulserver/bin/server/Server$getLectureData_result$_Fields.class diff --git a/Dozentenmodulserver/bin/server/Server$getPersonData_args$_Fields.class b/Dozentenmodulserver/bin/server/Server$getPersonData_args$_Fields.class Binary files differindex e9b7c765..57529c4a 100644 --- a/Dozentenmodulserver/bin/server/Server$getPersonData_args$_Fields.class +++ b/Dozentenmodulserver/bin/server/Server$getPersonData_args$_Fields.class diff --git a/Dozentenmodulserver/bin/server/Server$getPersonData_result$_Fields.class b/Dozentenmodulserver/bin/server/Server$getPersonData_result$_Fields.class Binary files differindex 70f0cd79..d7836899 100644 --- a/Dozentenmodulserver/bin/server/Server$getPersonData_result$_Fields.class +++ b/Dozentenmodulserver/bin/server/Server$getPersonData_result$_Fields.class diff --git a/Dozentenmodulserver/bin/server/Server$startFileCopy_args$startFileCopy_argsTupleSchemeFactory.class b/Dozentenmodulserver/bin/server/Server$startFileCopy_args$startFileCopy_argsTupleSchemeFactory.class Binary files differindex 8702c005..fda3d893 100644 --- a/Dozentenmodulserver/bin/server/Server$startFileCopy_args$startFileCopy_argsTupleSchemeFactory.class +++ b/Dozentenmodulserver/bin/server/Server$startFileCopy_args$startFileCopy_argsTupleSchemeFactory.class diff --git a/Dozentenmodulserver/bin/server/Server$startFileCopy_args.class b/Dozentenmodulserver/bin/server/Server$startFileCopy_args.class Binary files differindex 62625637..694e908d 100644 --- a/Dozentenmodulserver/bin/server/Server$startFileCopy_args.class +++ b/Dozentenmodulserver/bin/server/Server$startFileCopy_args.class diff --git a/Dozentenmodulserver/bin/server/Server$startFileCopy_result$_Fields.class b/Dozentenmodulserver/bin/server/Server$startFileCopy_result$_Fields.class Binary files differindex 461ec031..94cacf3a 100644 --- a/Dozentenmodulserver/bin/server/Server$startFileCopy_result$_Fields.class +++ b/Dozentenmodulserver/bin/server/Server$startFileCopy_result$_Fields.class diff --git a/Dozentenmodulserver/bin/server/Server$updateImageData_args.class b/Dozentenmodulserver/bin/server/Server$updateImageData_args.class Binary files differindex 8c3bcc07..57cdfdef 100644 --- a/Dozentenmodulserver/bin/server/Server$updateImageData_args.class +++ b/Dozentenmodulserver/bin/server/Server$updateImageData_args.class diff --git a/Dozentenmodulserver/bin/server/Server$updateImageData_result$_Fields.class b/Dozentenmodulserver/bin/server/Server$updateImageData_result$_Fields.class Binary files differindex 674e1e07..d9de4abc 100644 --- a/Dozentenmodulserver/bin/server/Server$updateImageData_result$_Fields.class +++ b/Dozentenmodulserver/bin/server/Server$updateImageData_result$_Fields.class diff --git a/Dozentenmodulserver/bin/server/Server$updateImageData_result.class b/Dozentenmodulserver/bin/server/Server$updateImageData_result.class Binary files differindex e64cad3a..14277ca9 100644 --- a/Dozentenmodulserver/bin/server/Server$updateImageData_result.class +++ b/Dozentenmodulserver/bin/server/Server$updateImageData_result.class diff --git a/Dozentenmodulserver/bin/server/Server$writeLecturedata_args$writeLecturedata_argsTupleSchemeFactory.class b/Dozentenmodulserver/bin/server/Server$writeLecturedata_args$writeLecturedata_argsTupleSchemeFactory.class Binary files differindex c40f6225..b4a13535 100644 --- a/Dozentenmodulserver/bin/server/Server$writeLecturedata_args$writeLecturedata_argsTupleSchemeFactory.class +++ b/Dozentenmodulserver/bin/server/Server$writeLecturedata_args$writeLecturedata_argsTupleSchemeFactory.class diff --git a/Dozentenmodulserver/bin/server/Server$writeLecturedata_args.class b/Dozentenmodulserver/bin/server/Server$writeLecturedata_args.class Binary files differindex e863e5fe..dd4c5cb9 100644 --- a/Dozentenmodulserver/bin/server/Server$writeLecturedata_args.class +++ b/Dozentenmodulserver/bin/server/Server$writeLecturedata_args.class diff --git a/Dozentenmodulserver/bin/server/Server$writeLecturedata_result$_Fields.class b/Dozentenmodulserver/bin/server/Server$writeLecturedata_result$_Fields.class Binary files differindex eb82a29f..169c86e2 100644 --- a/Dozentenmodulserver/bin/server/Server$writeLecturedata_result$_Fields.class +++ b/Dozentenmodulserver/bin/server/Server$writeLecturedata_result$_Fields.class diff --git a/Dozentenmodulserver/bin/server/Server$writeVLdata_args.class b/Dozentenmodulserver/bin/server/Server$writeVLdata_args.class Binary files differindex 0f3a9e36..4866c551 100644 --- a/Dozentenmodulserver/bin/server/Server$writeVLdata_args.class +++ b/Dozentenmodulserver/bin/server/Server$writeVLdata_args.class diff --git a/Dozentenmodulserver/bin/sql/SQL.class b/Dozentenmodulserver/bin/sql/SQL.class Binary files differindex 94acdc53..d48de5c6 100644 --- a/Dozentenmodulserver/bin/sql/SQL.class +++ b/Dozentenmodulserver/bin/sql/SQL.class diff --git a/Dozentenmodulserver/bin/util/XMLCreator.class b/Dozentenmodulserver/bin/util/XMLCreator.class Binary files differindex 6d7673fb..04ba5197 100644 --- a/Dozentenmodulserver/bin/util/XMLCreator.class +++ b/Dozentenmodulserver/bin/util/XMLCreator.class diff --git a/Dozentenmodulserver/src/server/Server.java b/Dozentenmodulserver/src/server/Server.java index 568ef600..43bdd515 100644 --- a/Dozentenmodulserver/src/server/Server.java +++ b/Dozentenmodulserver/src/server/Server.java @@ -66,7 +66,7 @@ public class Server { public boolean deleteImageData(String id, String version) throws org.apache.thrift.TException; - public boolean updateLecturedata(String name, String newName, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imagename, String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id) throws org.apache.thrift.TException; + public boolean updateLecturedata(String name, String newName, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imageid, String imageversion, String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id) throws org.apache.thrift.TException; public boolean deleteImageServer(String id, String version) throws org.apache.thrift.TException; @@ -108,7 +108,7 @@ public class Server { public void deleteImageData(String id, String version, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void updateLecturedata(String name, String newName, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imagename, String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void updateLecturedata(String name, String newName, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imageid, String imageversion, String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void deleteImageServer(String id, String version, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; @@ -523,13 +523,13 @@ public class Server { throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "deleteImageData failed: unknown result"); } - public boolean updateLecturedata(String name, String newName, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imagename, String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id) throws org.apache.thrift.TException + public boolean updateLecturedata(String name, String newName, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imageid, String imageversion, String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id) throws org.apache.thrift.TException { - send_updateLecturedata(name, newName, shortdesc, desc, startDate, endDate, isActive, imagename, firstname, lastname, university, Mail, Tel, Fak, id); + send_updateLecturedata(name, newName, shortdesc, desc, startDate, endDate, isActive, imageid, imageversion, firstname, lastname, university, Mail, Tel, Fak, id); return recv_updateLecturedata(); } - public void send_updateLecturedata(String name, String newName, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imagename, String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id) throws org.apache.thrift.TException + public void send_updateLecturedata(String name, String newName, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imageid, String imageversion, String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id) throws org.apache.thrift.TException { updateLecturedata_args args = new updateLecturedata_args(); args.setName(name); @@ -539,7 +539,8 @@ public class Server { args.setStartDate(startDate); args.setEndDate(endDate); args.setIsActive(isActive); - args.setImagename(imagename); + args.setImageid(imageid); + args.setImageversion(imageversion); args.setFirstname(firstname); args.setLastname(lastname); args.setUniversity(university); @@ -1251,9 +1252,9 @@ public class Server { } } - public void updateLecturedata(String name, String newName, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imagename, String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void updateLecturedata(String name, String newName, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imageid, String imageversion, String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); - updateLecturedata_call method_call = new updateLecturedata_call(name, newName, shortdesc, desc, startDate, endDate, isActive, imagename, firstname, lastname, university, Mail, Tel, Fak, id, resultHandler, this, ___protocolFactory, ___transport); + updateLecturedata_call method_call = new updateLecturedata_call(name, newName, shortdesc, desc, startDate, endDate, isActive, imageid, imageversion, firstname, lastname, university, Mail, Tel, Fak, id, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } @@ -1266,7 +1267,8 @@ public class Server { private String startDate; private String endDate; private boolean isActive; - private String imagename; + private String imageid; + private String imageversion; private String firstname; private String lastname; private String university; @@ -1274,7 +1276,7 @@ public class Server { private String Tel; private String Fak; private String id; - public updateLecturedata_call(String name, String newName, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imagename, String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + public updateLecturedata_call(String name, String newName, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imageid, String imageversion, String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.name = name; this.newName = newName; @@ -1283,7 +1285,8 @@ public class Server { this.startDate = startDate; this.endDate = endDate; this.isActive = isActive; - this.imagename = imagename; + this.imageid = imageid; + this.imageversion = imageversion; this.firstname = firstname; this.lastname = lastname; this.university = university; @@ -1303,7 +1306,8 @@ public class Server { args.setStartDate(startDate); args.setEndDate(endDate); args.setIsActive(isActive); - args.setImagename(imagename); + args.setImageid(imageid); + args.setImageversion(imageversion); args.setFirstname(firstname); args.setLastname(lastname); args.setUniversity(university); @@ -1789,7 +1793,7 @@ public class Server { public updateLecturedata_result getResult(I iface, updateLecturedata_args args) throws org.apache.thrift.TException { updateLecturedata_result result = new updateLecturedata_result(); - result.success = iface.updateLecturedata(args.name, args.newName, args.shortdesc, args.desc, args.startDate, args.endDate, args.isActive, args.imagename, args.firstname, args.lastname, args.university, args.Mail, args.Tel, args.Fak, args.id); + result.success = iface.updateLecturedata(args.name, args.newName, args.shortdesc, args.desc, args.startDate, args.endDate, args.isActive, args.imageid, args.imageversion, args.firstname, args.lastname, args.university, args.Mail, args.Tel, args.Fak, args.id); result.setSuccessIsSet(true); return result; } @@ -2712,7 +2716,7 @@ public class Server { } public void start(I iface, updateLecturedata_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws TException { - iface.updateLecturedata(args.name, args.newName, args.shortdesc, args.desc, args.startDate, args.endDate, args.isActive, args.imagename, args.firstname, args.lastname, args.university, args.Mail, args.Tel, args.Fak, args.id,resultHandler); + iface.updateLecturedata(args.name, args.newName, args.shortdesc, args.desc, args.startDate, args.endDate, args.isActive, args.imageid, args.imageversion, args.firstname, args.lastname, args.university, args.Mail, args.Tel, args.Fak, args.id,resultHandler); } } @@ -17753,14 +17757,15 @@ public class Server { private static final org.apache.thrift.protocol.TField START_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("startDate", org.apache.thrift.protocol.TType.STRING, (short)-5); private static final org.apache.thrift.protocol.TField END_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("endDate", org.apache.thrift.protocol.TType.STRING, (short)-6); private static final org.apache.thrift.protocol.TField IS_ACTIVE_FIELD_DESC = new org.apache.thrift.protocol.TField("isActive", org.apache.thrift.protocol.TType.BOOL, (short)-7); - private static final org.apache.thrift.protocol.TField IMAGENAME_FIELD_DESC = new org.apache.thrift.protocol.TField("imagename", org.apache.thrift.protocol.TType.STRING, (short)-8); - private static final org.apache.thrift.protocol.TField FIRSTNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("firstname", org.apache.thrift.protocol.TType.STRING, (short)-9); - private static final org.apache.thrift.protocol.TField LASTNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("lastname", org.apache.thrift.protocol.TType.STRING, (short)-10); - private static final org.apache.thrift.protocol.TField UNIVERSITY_FIELD_DESC = new org.apache.thrift.protocol.TField("university", org.apache.thrift.protocol.TType.STRING, (short)-11); - private static final org.apache.thrift.protocol.TField MAIL_FIELD_DESC = new org.apache.thrift.protocol.TField("Mail", org.apache.thrift.protocol.TType.STRING, (short)-12); - private static final org.apache.thrift.protocol.TField TEL_FIELD_DESC = new org.apache.thrift.protocol.TField("Tel", org.apache.thrift.protocol.TType.STRING, (short)-13); - private static final org.apache.thrift.protocol.TField FAK_FIELD_DESC = new org.apache.thrift.protocol.TField("Fak", org.apache.thrift.protocol.TType.STRING, (short)-14); - private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)-15); + private static final org.apache.thrift.protocol.TField IMAGEID_FIELD_DESC = new org.apache.thrift.protocol.TField("imageid", org.apache.thrift.protocol.TType.STRING, (short)-8); + private static final org.apache.thrift.protocol.TField IMAGEVERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("imageversion", org.apache.thrift.protocol.TType.STRING, (short)-9); + private static final org.apache.thrift.protocol.TField FIRSTNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("firstname", org.apache.thrift.protocol.TType.STRING, (short)-10); + private static final org.apache.thrift.protocol.TField LASTNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("lastname", org.apache.thrift.protocol.TType.STRING, (short)-11); + private static final org.apache.thrift.protocol.TField UNIVERSITY_FIELD_DESC = new org.apache.thrift.protocol.TField("university", org.apache.thrift.protocol.TType.STRING, (short)-12); + private static final org.apache.thrift.protocol.TField MAIL_FIELD_DESC = new org.apache.thrift.protocol.TField("Mail", org.apache.thrift.protocol.TType.STRING, (short)-13); + private static final org.apache.thrift.protocol.TField TEL_FIELD_DESC = new org.apache.thrift.protocol.TField("Tel", org.apache.thrift.protocol.TType.STRING, (short)-14); + private static final org.apache.thrift.protocol.TField FAK_FIELD_DESC = new org.apache.thrift.protocol.TField("Fak", org.apache.thrift.protocol.TType.STRING, (short)-15); + private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)-16); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { @@ -17775,7 +17780,8 @@ public class Server { public String startDate; // required public String endDate; // required public boolean isActive; // required - public String imagename; // required + public String imageid; // required + public String imageversion; // required public String firstname; // required public String lastname; // required public String university; // required @@ -17793,14 +17799,15 @@ public class Server { START_DATE((short)-5, "startDate"), END_DATE((short)-6, "endDate"), IS_ACTIVE((short)-7, "isActive"), - IMAGENAME((short)-8, "imagename"), - FIRSTNAME((short)-9, "firstname"), - LASTNAME((short)-10, "lastname"), - UNIVERSITY((short)-11, "university"), - MAIL((short)-12, "Mail"), - TEL((short)-13, "Tel"), - FAK((short)-14, "Fak"), - ID((short)-15, "id"); + IMAGEID((short)-8, "imageid"), + IMAGEVERSION((short)-9, "imageversion"), + FIRSTNAME((short)-10, "firstname"), + LASTNAME((short)-11, "lastname"), + UNIVERSITY((short)-12, "university"), + MAIL((short)-13, "Mail"), + TEL((short)-14, "Tel"), + FAK((short)-15, "Fak"), + ID((short)-16, "id"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); @@ -17829,21 +17836,23 @@ public class Server { return END_DATE; case -7: // IS_ACTIVE return IS_ACTIVE; - case -8: // IMAGENAME - return IMAGENAME; - case -9: // FIRSTNAME + case -8: // IMAGEID + return IMAGEID; + case -9: // IMAGEVERSION + return IMAGEVERSION; + case -10: // FIRSTNAME return FIRSTNAME; - case -10: // LASTNAME + case -11: // LASTNAME return LASTNAME; - case -11: // UNIVERSITY + case -12: // UNIVERSITY return UNIVERSITY; - case -12: // MAIL + case -13: // MAIL return MAIL; - case -13: // TEL + case -14: // TEL return TEL; - case -14: // FAK + case -15: // FAK return FAK; - case -15: // ID + case -16: // ID return ID; default: return null; @@ -17904,7 +17913,9 @@ public class Server { new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.IS_ACTIVE, new org.apache.thrift.meta_data.FieldMetaData("isActive", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - tmpMap.put(_Fields.IMAGENAME, new org.apache.thrift.meta_data.FieldMetaData("imagename", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.IMAGEID, new org.apache.thrift.meta_data.FieldMetaData("imageid", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.IMAGEVERSION, new org.apache.thrift.meta_data.FieldMetaData("imageversion", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.FIRSTNAME, new org.apache.thrift.meta_data.FieldMetaData("firstname", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); @@ -17935,7 +17946,8 @@ public class Server { String startDate, String endDate, boolean isActive, - String imagename, + String imageid, + String imageversion, String firstname, String lastname, String university, @@ -17953,7 +17965,8 @@ public class Server { this.endDate = endDate; this.isActive = isActive; setIsActiveIsSet(true); - this.imagename = imagename; + this.imageid = imageid; + this.imageversion = imageversion; this.firstname = firstname; this.lastname = lastname; this.university = university; @@ -17987,8 +18000,11 @@ public class Server { this.endDate = other.endDate; } this.isActive = other.isActive; - if (other.isSetImagename()) { - this.imagename = other.imagename; + if (other.isSetImageid()) { + this.imageid = other.imageid; + } + if (other.isSetImageversion()) { + this.imageversion = other.imageversion; } if (other.isSetFirstname()) { this.firstname = other.firstname; @@ -18027,7 +18043,8 @@ public class Server { this.endDate = null; setIsActiveIsSet(false); this.isActive = false; - this.imagename = null; + this.imageid = null; + this.imageversion = null; this.firstname = null; this.lastname = null; this.university = null; @@ -18204,27 +18221,51 @@ public class Server { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ISACTIVE_ISSET_ID, value); } - public String getImagename() { - return this.imagename; + public String getImageid() { + return this.imageid; } - public updateLecturedata_args setImagename(String imagename) { - this.imagename = imagename; + public updateLecturedata_args setImageid(String imageid) { + this.imageid = imageid; return this; } - public void unsetImagename() { - this.imagename = null; + public void unsetImageid() { + this.imageid = null; } - /** Returns true if field imagename is set (has been assigned a value) and false otherwise */ - public boolean isSetImagename() { - return this.imagename != null; + /** Returns true if field imageid is set (has been assigned a value) and false otherwise */ + public boolean isSetImageid() { + return this.imageid != null; } - public void setImagenameIsSet(boolean value) { + public void setImageidIsSet(boolean value) { if (!value) { - this.imagename = null; + this.imageid = null; + } + } + + public String getImageversion() { + return this.imageversion; + } + + public updateLecturedata_args setImageversion(String imageversion) { + this.imageversion = imageversion; + return this; + } + + public void unsetImageversion() { + this.imageversion = null; + } + + /** Returns true if field imageversion is set (has been assigned a value) and false otherwise */ + public boolean isSetImageversion() { + return this.imageversion != null; + } + + public void setImageversionIsSet(boolean value) { + if (!value) { + this.imageversion = null; } } @@ -18454,11 +18495,19 @@ public class Server { } break; - case IMAGENAME: + case IMAGEID: if (value == null) { - unsetImagename(); + unsetImageid(); } else { - setImagename((String)value); + setImageid((String)value); + } + break; + + case IMAGEVERSION: + if (value == null) { + unsetImageversion(); + } else { + setImageversion((String)value); } break; @@ -18544,8 +18593,11 @@ public class Server { case IS_ACTIVE: return Boolean.valueOf(isIsActive()); - case IMAGENAME: - return getImagename(); + case IMAGEID: + return getImageid(); + + case IMAGEVERSION: + return getImageversion(); case FIRSTNAME: return getFirstname(); @@ -18593,8 +18645,10 @@ public class Server { return isSetEndDate(); case IS_ACTIVE: return isSetIsActive(); - case IMAGENAME: - return isSetImagename(); + case IMAGEID: + return isSetImageid(); + case IMAGEVERSION: + return isSetImageversion(); case FIRSTNAME: return isSetFirstname(); case LASTNAME: @@ -18689,12 +18743,21 @@ public class Server { return false; } - boolean this_present_imagename = true && this.isSetImagename(); - boolean that_present_imagename = true && that.isSetImagename(); - if (this_present_imagename || that_present_imagename) { - if (!(this_present_imagename && that_present_imagename)) + boolean this_present_imageid = true && this.isSetImageid(); + boolean that_present_imageid = true && that.isSetImageid(); + if (this_present_imageid || that_present_imageid) { + if (!(this_present_imageid && that_present_imageid)) return false; - if (!this.imagename.equals(that.imagename)) + if (!this.imageid.equals(that.imageid)) + return false; + } + + boolean this_present_imageversion = true && this.isSetImageversion(); + boolean that_present_imageversion = true && that.isSetImageversion(); + if (this_present_imageversion || that_present_imageversion) { + if (!(this_present_imageversion && that_present_imageversion)) + return false; + if (!this.imageversion.equals(that.imageversion)) return false; } @@ -18847,12 +18910,22 @@ public class Server { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetImagename()).compareTo(other.isSetImagename()); + lastComparison = Boolean.valueOf(isSetImageid()).compareTo(other.isSetImageid()); if (lastComparison != 0) { return lastComparison; } - if (isSetImagename()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.imagename, other.imagename); + if (isSetImageid()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.imageid, other.imageid); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetImageversion()).compareTo(other.isSetImageversion()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetImageversion()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.imageversion, other.imageversion); if (lastComparison != 0) { return lastComparison; } @@ -18999,11 +19072,19 @@ public class Server { sb.append(this.isActive); first = false; if (!first) sb.append(", "); - sb.append("imagename:"); - if (this.imagename == null) { + sb.append("imageid:"); + if (this.imageid == null) { sb.append("null"); } else { - sb.append(this.imagename); + sb.append(this.imageid); + } + first = false; + if (!first) sb.append(", "); + sb.append("imageversion:"); + if (this.imageversion == null) { + sb.append("null"); + } else { + sb.append(this.imageversion); } first = false; if (!first) sb.append(", "); @@ -19163,15 +19244,23 @@ public class Server { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case -8: // IMAGENAME + case -8: // IMAGEID if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.imagename = iprot.readString(); - struct.setImagenameIsSet(true); + struct.imageid = iprot.readString(); + struct.setImageidIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case -9: // FIRSTNAME + case -9: // IMAGEVERSION + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.imageversion = iprot.readString(); + struct.setImageversionIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -10: // FIRSTNAME if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.firstname = iprot.readString(); struct.setFirstnameIsSet(true); @@ -19179,7 +19268,7 @@ public class Server { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case -10: // LASTNAME + case -11: // LASTNAME if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.lastname = iprot.readString(); struct.setLastnameIsSet(true); @@ -19187,7 +19276,7 @@ public class Server { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case -11: // UNIVERSITY + case -12: // UNIVERSITY if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.university = iprot.readString(); struct.setUniversityIsSet(true); @@ -19195,7 +19284,7 @@ public class Server { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case -12: // MAIL + case -13: // MAIL if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.Mail = iprot.readString(); struct.setMailIsSet(true); @@ -19203,7 +19292,7 @@ public class Server { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case -13: // TEL + case -14: // TEL if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.Tel = iprot.readString(); struct.setTelIsSet(true); @@ -19211,7 +19300,7 @@ public class Server { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case -14: // FAK + case -15: // FAK if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.Fak = iprot.readString(); struct.setFakIsSet(true); @@ -19219,7 +19308,7 @@ public class Server { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case -15: // ID + case -16: // ID if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.id = iprot.readString(); struct.setIdIsSet(true); @@ -19277,9 +19366,14 @@ public class Server { oprot.writeString(struct.firstname); oprot.writeFieldEnd(); } - if (struct.imagename != null) { - oprot.writeFieldBegin(IMAGENAME_FIELD_DESC); - oprot.writeString(struct.imagename); + if (struct.imageversion != null) { + oprot.writeFieldBegin(IMAGEVERSION_FIELD_DESC); + oprot.writeString(struct.imageversion); + oprot.writeFieldEnd(); + } + if (struct.imageid != null) { + oprot.writeFieldBegin(IMAGEID_FIELD_DESC); + oprot.writeString(struct.imageid); oprot.writeFieldEnd(); } oprot.writeFieldBegin(IS_ACTIVE_FIELD_DESC); @@ -19354,31 +19448,34 @@ public class Server { if (struct.isSetIsActive()) { optionals.set(6); } - if (struct.isSetImagename()) { + if (struct.isSetImageid()) { optionals.set(7); } - if (struct.isSetFirstname()) { + if (struct.isSetImageversion()) { optionals.set(8); } - if (struct.isSetLastname()) { + if (struct.isSetFirstname()) { optionals.set(9); } - if (struct.isSetUniversity()) { + if (struct.isSetLastname()) { optionals.set(10); } - if (struct.isSetMail()) { + if (struct.isSetUniversity()) { optionals.set(11); } - if (struct.isSetTel()) { + if (struct.isSetMail()) { optionals.set(12); } - if (struct.isSetFak()) { + if (struct.isSetTel()) { optionals.set(13); } - if (struct.isSetId()) { + if (struct.isSetFak()) { optionals.set(14); } - oprot.writeBitSet(optionals, 15); + if (struct.isSetId()) { + optionals.set(15); + } + oprot.writeBitSet(optionals, 16); if (struct.isSetName()) { oprot.writeString(struct.name); } @@ -19400,8 +19497,11 @@ public class Server { if (struct.isSetIsActive()) { oprot.writeBool(struct.isActive); } - if (struct.isSetImagename()) { - oprot.writeString(struct.imagename); + if (struct.isSetImageid()) { + oprot.writeString(struct.imageid); + } + if (struct.isSetImageversion()) { + oprot.writeString(struct.imageversion); } if (struct.isSetFirstname()) { oprot.writeString(struct.firstname); @@ -19429,7 +19529,7 @@ public class Server { @Override public void read(org.apache.thrift.protocol.TProtocol prot, updateLecturedata_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(15); + BitSet incoming = iprot.readBitSet(16); if (incoming.get(0)) { struct.name = iprot.readString(); struct.setNameIsSet(true); @@ -19459,34 +19559,38 @@ public class Server { struct.setIsActiveIsSet(true); } if (incoming.get(7)) { - struct.imagename = iprot.readString(); - struct.setImagenameIsSet(true); + struct.imageid = iprot.readString(); + struct.setImageidIsSet(true); } if (incoming.get(8)) { + struct.imageversion = iprot.readString(); + struct.setImageversionIsSet(true); + } + if (incoming.get(9)) { struct.firstname = iprot.readString(); struct.setFirstnameIsSet(true); } - if (incoming.get(9)) { + if (incoming.get(10)) { struct.lastname = iprot.readString(); struct.setLastnameIsSet(true); } - if (incoming.get(10)) { + if (incoming.get(11)) { struct.university = iprot.readString(); struct.setUniversityIsSet(true); } - if (incoming.get(11)) { + if (incoming.get(12)) { struct.Mail = iprot.readString(); struct.setMailIsSet(true); } - if (incoming.get(12)) { + if (incoming.get(13)) { struct.Tel = iprot.readString(); struct.setTelIsSet(true); } - if (incoming.get(13)) { + if (incoming.get(14)) { struct.Fak = iprot.readString(); struct.setFakIsSet(true); } - if (incoming.get(14)) { + if (incoming.get(15)) { struct.id = iprot.readString(); struct.setIdIsSet(true); } diff --git a/Dozentenmodulserver/src/server/ServerHandler.java b/Dozentenmodulserver/src/server/ServerHandler.java index 0ba4d08c..906fba3c 100644 --- a/Dozentenmodulserver/src/server/ServerHandler.java +++ b/Dozentenmodulserver/src/server/ServerHandler.java @@ -319,16 +319,11 @@ public class ServerHandler implements Server.Iface { @Override public boolean updateLecturedata(String name, String newName, String shortdesc, String desc, String startDate, String endDate, - boolean isActive, String imagename, String firstname, + boolean isActive, String imageid,String imageversion, String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id) throws TException { - String pk_image = ""; - int imageversion = 0; - Map<String, String> image = sql.getImageIDandVersion(imagename); - pk_image = image.get("GUID"); - imageversion = Integer.parseInt(image.get("version")); - sql.updateLectureData(pk_image, imageversion, lastname, newName, desc, + sql.updateLectureData(imageid, imageversion, lastname, newName, desc, shortdesc, startDate, endDate, isActive, id); XMLCreator xml = new XMLCreator(sql.getConnection(), newName); diff --git a/Dozentenmodulserver/src/sql/SQL.java b/Dozentenmodulserver/src/sql/SQL.java index 15d6950f..461a372b 100644 --- a/Dozentenmodulserver/src/sql/SQL.java +++ b/Dozentenmodulserver/src/sql/SQL.java @@ -599,7 +599,7 @@ public class SQL { }
public int updateLectureData(String pk_image,
- int imageversion, String name, String newName, String desc,
+ String imageversion, String name, String newName, String desc,
String shortdesc, String start, String end, boolean isactive,
String id) {
@@ -837,21 +837,18 @@ public class SQL { Connection con=getConnection();
Statement stm = con.createStatement();
ResultSet data=stm
- .executeQuery("SELECT i.image_name,i.image_update_time,i.cond_hasInternetRestriction,i.cond_hasLicenseRestriction, i.cond_minCPUs,i.cond_minRAM, i.image_syncMode,i.image_filesize,i.image_path, i.image_isTemplate,os.GuestOS, concat(u.Nachname,' ',u.Vorname) as Owner FROM bwLehrpool.m_VLData_imageInfo i,bwLehrpool.m_user u,bwLehrpool.m_operatingSystem os where i.image_owner=u.userID and i.content_operatingSystem=os.operatingSystemID and GUID_imageID = '" + id + "' ;");
+ .executeQuery("select l.name, l.isActive, l.startTime, l.endTime, l.lastUsed, l.description, i.image_path, l.imageVersion, concat(u.Nachname,' ',u.Vorname) as owner from m_VLData_lecture l, m_user u, m_VLData_imageInfo i where l.admin_owner=u.userID and l.imageID=i.GUID_imageID and lectureID= '" + id + "' ;");
while (data.next()) {
- map.put("name", data.getString("image_name"));
- map.put("internet",
- data.getString("cond_hasInternetRestriction"));
- map.put("license", data.getString("cond_hasLicenseRestriction"));
- map.put("cpu", data.getString("cond_minCPUs"));
- map.put("ram", data.getString("cond_minRAM"));
- map.put("shareMode", data.getString("image_syncMode"));
- map.put("filesize", data.getString("image_filesize"));
- map.put("path", data.getString("image_path"));
- map.put("template", data.getString("image_isTemplate"));
- map.put("os",data.getString("GuestOS"));
+ map.put("name", data.getString("name"));
+ map.put("isActive",
+ data.getString("isActive"));
+ map.put("startTime", data.getString("startTime"));
+ map.put("endTime", data.getString("endTime"));
+ map.put("lastUsed", data.getString("lastUsed"));
+ map.put("desc", data.getString("description"));
+ map.put("imagepath", data.getString("image_path"));
+ map.put("imageversion", data.getString("imageVersion"));
map.put("owner", data.getString("Owner"));
- map.put("lastupdate", data.getString("image_update_time"));
}
con.close();
diff --git a/Dozentenmodulserver/thrift/server.thrift b/Dozentenmodulserver/thrift/server.thrift index 0bd3d800..571a32ac 100644 --- a/Dozentenmodulserver/thrift/server.thrift +++ b/Dozentenmodulserver/thrift/server.thrift @@ -50,7 +50,7 @@ service Server{ map<string,string> getLectureData(string lectureid), bool updateImageData(string name, string newName,string image_path,bool license, bool internet, int ram,int cpu, string id, string version,bool isTemplate ,i64 filesize, int shareMode, string os), bool deleteImageData(string id, string version), - bool updateLecturedata(string name, string newName ,string shortdesc, string desc,string startDate, string endDate, bool isActive, string imagename,string firstname,string lastname, string university, string Mail, string Tel,string Fak, string id), + bool updateLecturedata(string name, string newName ,string shortdesc, string desc,string startDate, string endDate, bool isActive, string imageid, string imageversion,string firstname,string lastname, string university, string Mail, string Tel,string Fak, string id), bool deleteImageServer(string id, string version), bool connectedToLecture(string id, string version), bool deleteLecture(string id, string hs, string user), |
