summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Dozentenmodul/.classpath1
-rw-r--r--Dozentenmodul/bin/GUI/LoginWindow$2.classbin1495 -> 1495 bytes
-rw-r--r--Dozentenmodul/bin/GUI/LoginWindow.classbin3352 -> 3499 bytes
-rw-r--r--Dozentenmodul/bin/auth/Ldap.classbin2031 -> 2199 bytes
-rw-r--r--Dozentenmodul/jdatepicker-1.3.2.jarbin0 -> 33887 bytes
-rw-r--r--Dozentenmodul/src/GUI/AddOS.java145
-rw-r--r--Dozentenmodul/src/GUI/AddSoftware.java145
-rw-r--r--Dozentenmodul/src/GUI/EingabeAllgemein.java345
-rw-r--r--Dozentenmodul/src/GUI/EingabeSoftwareDaten.java298
-rw-r--r--Dozentenmodul/src/GUI/EingabeSystemDaten.java280
-rw-r--r--Dozentenmodul/src/GUI/FTPDownloader.java161
-rw-r--r--Dozentenmodul/src/GUI/FTPUploader.java180
-rw-r--r--Dozentenmodul/src/GUI/FertigStellen.java154
-rw-r--r--Dozentenmodul/src/GUI/LoginWindow.java3
-rw-r--r--Dozentenmodul/src/GUI/getVMwarePlayer.java156
-rw-r--r--Dozentenmodul/src/GUI/searchRohling.java201
-rw-r--r--Dozentenmodul/src/Jsch/scriptExecutor.java63
-rw-r--r--Dozentenmodul/src/Models/person.java61
-rw-r--r--Dozentenmodul/src/Models/vm.java69
-rw-r--r--Dozentenmodul/src/auth/Ldap.java5
-rw-r--r--Dozentenmodul/src/downloader/DownloadTask.java105
-rw-r--r--Dozentenmodul/src/downloader/FTPException.java8
-rw-r--r--Dozentenmodul/src/downloader/FTPUtility.java187
-rw-r--r--Dozentenmodul/src/downloader/UploadTask.java91
-rw-r--r--Dozentenmodul/src/downloader/jschtest.java84
-rw-r--r--Dozentenmodul/src/sql/sql.java179
26 files changed, 2919 insertions, 2 deletions
diff --git a/Dozentenmodul/.classpath b/Dozentenmodul/.classpath
index 068f08c8..ce379066 100644
--- a/Dozentenmodul/.classpath
+++ b/Dozentenmodul/.classpath
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path=".settings"/>
<classpathentry kind="src" path="img"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry kind="lib" path="C:/Users/tspitzer/Downloads/org.eclipse.jface.jar/org.eclipse.jface.jar"/>
diff --git a/Dozentenmodul/bin/GUI/LoginWindow$2.class b/Dozentenmodul/bin/GUI/LoginWindow$2.class
index f92ce998..29f40298 100644
--- a/Dozentenmodul/bin/GUI/LoginWindow$2.class
+++ b/Dozentenmodul/bin/GUI/LoginWindow$2.class
Binary files differ
diff --git a/Dozentenmodul/bin/GUI/LoginWindow.class b/Dozentenmodul/bin/GUI/LoginWindow.class
index a1618ae7..cacefec3 100644
--- a/Dozentenmodul/bin/GUI/LoginWindow.class
+++ b/Dozentenmodul/bin/GUI/LoginWindow.class
Binary files differ
diff --git a/Dozentenmodul/bin/auth/Ldap.class b/Dozentenmodul/bin/auth/Ldap.class
index 7e0c8587..1fdf2400 100644
--- a/Dozentenmodul/bin/auth/Ldap.class
+++ b/Dozentenmodul/bin/auth/Ldap.class
Binary files differ
diff --git a/Dozentenmodul/jdatepicker-1.3.2.jar b/Dozentenmodul/jdatepicker-1.3.2.jar
new file mode 100644
index 00000000..856619ff
--- /dev/null
+++ b/Dozentenmodul/jdatepicker-1.3.2.jar
Binary files differ
diff --git a/Dozentenmodul/src/GUI/AddOS.java b/Dozentenmodul/src/GUI/AddOS.java
new file mode 100644
index 00000000..5039a4e1
--- /dev/null
+++ b/Dozentenmodul/src/GUI/AddOS.java
@@ -0,0 +1,145 @@
+package GUI;
+
+import java.awt.BorderLayout;
+import java.awt.FlowLayout;
+import sql.sql;
+import javax.swing.JButton;
+import javax.swing.JDialog;
+import javax.swing.JPanel;
+import javax.swing.border.EmptyBorder;
+import javax.swing.JLabel;
+import java.awt.Font;
+import javax.swing.JTextField;
+import javax.swing.JComboBox;
+import javax.swing.JCheckBox;
+import java.awt.event.ActionListener;
+import java.awt.event.ActionEvent;
+import java.sql.Connection;
+import javax.swing.DefaultComboBoxModel;
+
+@SuppressWarnings("serial")
+public class AddOS extends JDialog {
+
+ private final JPanel contentPanel = new JPanel();
+ private JTextField textField;
+ private JTextField textField_1;
+ private JTextField textField_2;
+ @SuppressWarnings("rawtypes")
+ JComboBox comboBox;
+ JCheckBox checkBox;
+ sql sql=new sql();
+ /**
+ * Launch the application.
+ */
+ public static void main(String[] args) {
+ try {
+ AddOS dialog = new AddOS();
+ dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
+ dialog.setVisible(true);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Create the dialog.
+ */
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ public AddOS() {
+ setTitle("Dozentenmodul");
+ setBounds(100, 100, 288, 300);
+ getContentPane().setLayout(new BorderLayout());
+ contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
+ getContentPane().add(contentPanel, BorderLayout.CENTER);
+ contentPanel.setLayout(null);
+ {
+ JLabel lblNewLabel = new JLabel("Betriebssystem hinzuf\u00FCgen");
+ lblNewLabel.setFont(new Font("Dialog", Font.PLAIN, 14));
+ lblNewLabel.setBounds(10, 11, 194, 25);
+ contentPanel.add(lblNewLabel);
+ }
+ {
+ JLabel lblHersteller = new JLabel("Hersteller:");
+ lblHersteller.setBounds(10, 47, 100, 20);
+ contentPanel.add(lblHersteller);
+ }
+ {
+ textField = new JTextField();
+ textField.setBounds(120, 47, 125, 20);
+ contentPanel.add(textField);
+ textField.setColumns(10);
+ }
+ {
+ JLabel lblNewLabel_1 = new JLabel("Name:");
+ lblNewLabel_1.setBounds(10, 78, 100, 20);
+ contentPanel.add(lblNewLabel_1);
+ }
+ {
+ textField_1 = new JTextField();
+ textField_1.setColumns(10);
+ textField_1.setBounds(120, 78, 125, 20);
+ contentPanel.add(textField_1);
+ }
+ {
+ JLabel lblVersion = new JLabel("Version:");
+ lblVersion.setBounds(10, 109, 100, 20);
+ contentPanel.add(lblVersion);
+ }
+ {
+ textField_2 = new JTextField();
+ textField_2.setColumns(10);
+ textField_2.setBounds(120, 109, 125, 20);
+ contentPanel.add(textField_2);
+ }
+ {
+ JLabel lblArchitektur = new JLabel("Architektur:");
+ lblArchitektur.setBounds(10, 140, 100, 20);
+ contentPanel.add(lblArchitektur);
+ }
+
+ comboBox = new JComboBox();
+ comboBox.setModel(new DefaultComboBoxModel(new String[] {"32-bit", "64-bit"}));
+ comboBox.setBounds(120, 140, 125, 20);
+ contentPanel.add(comboBox);
+
+ JLabel lblLizenzpflichtig = new JLabel("Lizenzpflichtig:");
+ lblLizenzpflichtig.setBounds(10, 171, 100, 20);
+ contentPanel.add(lblLizenzpflichtig);
+
+ checkBox = new JCheckBox("");
+ checkBox.setBounds(120, 167, 97, 23);
+ contentPanel.add(checkBox);
+ {
+ JPanel buttonPane = new JPanel();
+ buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
+ getContentPane().add(buttonPane, BorderLayout.SOUTH);
+ {
+ JButton okButton = new JButton("OK");
+ okButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ int Kosten=0;
+ if(checkBox.isSelected()==true)
+ {
+ Kosten=1;
+ }
+ Connection con=sql.getConnection();
+ sql.AddOS(con, textField_1.getText().toString(), textField_2.getText().toString(), comboBox.getSelectedItem().toString(), Kosten, textField.getText().toString());
+ }
+ });
+ okButton.setActionCommand("OK");
+ buttonPane.add(okButton);
+ getRootPane().setDefaultButton(okButton);
+ }
+ {
+ JButton cancelButton = new JButton("Zur\u00FCck");
+ cancelButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ dispose();
+ }
+ });
+ cancelButton.setActionCommand("Cancel");
+ buttonPane.add(cancelButton);
+ }
+ }
+ }
+}
diff --git a/Dozentenmodul/src/GUI/AddSoftware.java b/Dozentenmodul/src/GUI/AddSoftware.java
new file mode 100644
index 00000000..c3a41227
--- /dev/null
+++ b/Dozentenmodul/src/GUI/AddSoftware.java
@@ -0,0 +1,145 @@
+package GUI;
+
+import java.awt.BorderLayout;
+import java.awt.FlowLayout;
+import sql.sql;
+import javax.swing.JButton;
+import javax.swing.JDialog;
+import javax.swing.JPanel;
+import javax.swing.border.EmptyBorder;
+import javax.swing.JLabel;
+import java.awt.Font;
+import javax.swing.JTextField;
+import javax.swing.JComboBox;
+import javax.swing.JCheckBox;
+import java.awt.event.ActionListener;
+import java.awt.event.ActionEvent;
+import java.sql.Connection;
+import javax.swing.DefaultComboBoxModel;
+
+@SuppressWarnings("serial")
+public class AddSoftware extends JDialog {
+
+ private final JPanel contentPanel = new JPanel();
+ private JTextField textField;
+ private JTextField textField_1;
+ private JTextField textField_2;
+ @SuppressWarnings("rawtypes")
+ JComboBox comboBox;
+ JCheckBox checkBox;
+ sql sql=new sql();
+ /**
+ * Launch the application.
+ */
+ public static void main(String[] args) {
+ try {
+ AddSoftware dialog = new AddSoftware();
+ dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
+ dialog.setVisible(true);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Create the dialog.
+ */
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ public AddSoftware() {
+ setTitle("Dozentenmodul");
+ setBounds(100, 100, 288, 300);
+ getContentPane().setLayout(new BorderLayout());
+ contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
+ getContentPane().add(contentPanel, BorderLayout.CENTER);
+ contentPanel.setLayout(null);
+ {
+ JLabel lblNewLabel = new JLabel("Software hinzuf\u00FCgen");
+ lblNewLabel.setFont(new Font("Dialog", Font.PLAIN, 14));
+ lblNewLabel.setBounds(10, 11, 194, 25);
+ contentPanel.add(lblNewLabel);
+ }
+ {
+ JLabel lblHersteller = new JLabel("Hersteller:");
+ lblHersteller.setBounds(10, 47, 100, 20);
+ contentPanel.add(lblHersteller);
+ }
+ {
+ textField = new JTextField();
+ textField.setBounds(120, 47, 125, 20);
+ contentPanel.add(textField);
+ textField.setColumns(10);
+ }
+ {
+ JLabel lblNewLabel_1 = new JLabel("Name:");
+ lblNewLabel_1.setBounds(10, 78, 100, 20);
+ contentPanel.add(lblNewLabel_1);
+ }
+ {
+ textField_1 = new JTextField();
+ textField_1.setColumns(10);
+ textField_1.setBounds(120, 78, 125, 20);
+ contentPanel.add(textField_1);
+ }
+ {
+ JLabel lblVersion = new JLabel("Version:");
+ lblVersion.setBounds(10, 109, 100, 20);
+ contentPanel.add(lblVersion);
+ }
+ {
+ textField_2 = new JTextField();
+ textField_2.setColumns(10);
+ textField_2.setBounds(120, 109, 125, 20);
+ contentPanel.add(textField_2);
+ }
+ {
+ JLabel lblArchitektur = new JLabel("Architektur:");
+ lblArchitektur.setBounds(10, 140, 100, 20);
+ contentPanel.add(lblArchitektur);
+ }
+
+ comboBox = new JComboBox();
+ comboBox.setModel(new DefaultComboBoxModel(new String[] {"32-bit", "64-bit"}));
+ comboBox.setBounds(120, 140, 125, 20);
+ contentPanel.add(comboBox);
+
+ JLabel lblLizenzpflichtig = new JLabel("Lizenzpflichtig:");
+ lblLizenzpflichtig.setBounds(10, 171, 100, 20);
+ contentPanel.add(lblLizenzpflichtig);
+
+ checkBox = new JCheckBox("");
+ checkBox.setBounds(120, 167, 97, 23);
+ contentPanel.add(checkBox);
+ {
+ JPanel buttonPane = new JPanel();
+ buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
+ getContentPane().add(buttonPane, BorderLayout.SOUTH);
+ {
+ JButton okButton = new JButton("OK");
+ okButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ int Kosten=0;
+ if(checkBox.isSelected()==true)
+ {
+ Kosten=1;
+ }
+ Connection con=sql.getConnection();
+ sql.AddSoftware(con, textField_1.getText().toString(), textField_2.getText().toString(), comboBox.getSelectedItem().toString(), Kosten, textField.getText().toString());
+ }
+ });
+ okButton.setActionCommand("OK");
+ buttonPane.add(okButton);
+ getRootPane().setDefaultButton(okButton);
+ }
+ {
+ JButton cancelButton = new JButton("Zur\u00FCck");
+ cancelButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ dispose();
+ }
+ });
+ cancelButton.setActionCommand("Cancel");
+ buttonPane.add(cancelButton);
+ }
+ }
+ }
+}
diff --git a/Dozentenmodul/src/GUI/EingabeAllgemein.java b/Dozentenmodul/src/GUI/EingabeAllgemein.java
new file mode 100644
index 00000000..b28147b7
--- /dev/null
+++ b/Dozentenmodul/src/GUI/EingabeAllgemein.java
@@ -0,0 +1,345 @@
+package GUI;
+
+
+import java.awt.FlowLayout;
+import javax.swing.JButton;
+import javax.swing.JDialog;
+import javax.swing.JPanel;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+import javax.swing.border.EmptyBorder;
+import java.awt.Color;
+import javax.swing.JLabel;
+import java.awt.Font;
+import javax.swing.JTextPane;
+import java.awt.SystemColor;
+import javax.swing.JTextField;
+
+import ftp.ftp;
+import java.awt.event.ActionListener;
+import java.awt.event.ActionEvent;
+import javax.swing.JCheckBox;
+import javax.swing.JSeparator;
+import javax.swing.event.ChangeListener;
+import javax.swing.event.ChangeEvent;
+import javax.swing.JMenuBar;
+import javax.swing.JMenu;
+import javax.swing.JMenuItem;
+
+import Models.person;
+
+@SuppressWarnings("serial")
+public class EingabeAllgemein extends JDialog {
+
+ private final JPanel contentPanel = new JPanel();
+ String[] result;
+ ftp f=new ftp();
+ private JTextField Vorname_V;
+ private JTextField Nachname_V;
+ private JTextField Hochschule_V;
+ private JTextField EMail_V;
+ private JTextField Tel_V;
+ private JTextField Fak_V;
+ private JTextField Vorname_E;
+ private JTextField Nachname_E;
+ private JTextField Hochschule_E;
+ private JTextField EMail_E;
+ private JTextField Tel_E;
+ private JTextField Fak_E;
+ JCheckBox chckbxDerVerantwortlicheEntspricht;
+ /**
+ * Launch the application.
+ */
+ public static void main(String[] args) {
+ try {
+ EingabeAllgemein dialog = new EingabeAllgemein();
+ dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
+ dialog.setVisible(true);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Create the dialog.
+ */
+ public EingabeAllgemein() {
+
+ try {
+ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+ } catch (ClassNotFoundException | InstantiationException
+ | IllegalAccessException | UnsupportedLookAndFeelException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ setTitle("Dozentenmodul");
+ setBounds(100, 100, 545, 689);
+ getContentPane().setLayout(null);
+ {
+ JPanel panel = new JPanel();
+ panel.setBounds(0, 0, 529, 68);
+ getContentPane().add(panel);
+ panel.setLayout(null);
+ {
+ JLabel lblNewLabel = new JLabel("Eingabe der allgemeinen Daten (Schritt 3 von 6)");
+ lblNewLabel.setBounds(10, 11, 509, 22);
+ panel.add(lblNewLabel);
+ lblNewLabel.setFont(new Font("Tahoma", Font.PLAIN, 18));
+ }
+
+ JTextPane txtpnBitteWhlenSie = new JTextPane();
+ txtpnBitteWhlenSie.setEditable(false);
+ txtpnBitteWhlenSie.setBackground(SystemColor.menu);
+ txtpnBitteWhlenSie.setText("Geben Sie hier bitte die Kontaktdaten des Vernatwortlichen und des Erstellers der VMDK ein");
+ txtpnBitteWhlenSie.setBounds(10, 36, 509, 42);
+ panel.add(txtpnBitteWhlenSie);
+ }
+ contentPanel.setBounds(10, 91, 509, 483);
+ contentPanel.setBackground(Color.WHITE);
+ contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
+ getContentPane().add(contentPanel);
+ contentPanel.setLayout(null);
+
+ JLabel lblNewLabel_1 = new JLabel("Allgemeine Informationen zum Verantwortlichen");
+ lblNewLabel_1.setFont(new Font("Tahoma", Font.PLAIN, 14));
+ lblNewLabel_1.setBounds(10, 0, 338, 25);
+ contentPanel.add(lblNewLabel_1);
+
+ JLabel lblNewLabel_2 = new JLabel("Vorname: *");
+ lblNewLabel_2.setBounds(10, 36, 125, 20);
+ contentPanel.add(lblNewLabel_2);
+
+ Vorname_V = new JTextField();
+ Vorname_V.setBounds(145, 36, 125, 20);
+ Vorname_V.setText(person.verantowrtlicher.getVorname());
+ contentPanel.add(Vorname_V);
+ Vorname_V.setColumns(10);
+
+ JLabel lblNachname = new JLabel("Nachname: *");
+ lblNachname.setBounds(10, 67, 125, 20);
+ contentPanel.add(lblNachname);
+
+ Nachname_V = new JTextField();
+ Nachname_V.setBounds(145, 67, 125, 20);
+ Nachname_V.setText(person.verantowrtlicher.getName());
+ contentPanel.add(Nachname_V);
+ Nachname_V.setColumns(10);
+
+ JLabel lblHochschule = new JLabel("Hochschule: *");
+ lblHochschule.setBounds(10, 98, 125, 20);
+ contentPanel.add(lblHochschule);
+
+ Hochschule_V = new JTextField();
+ Hochschule_V.setColumns(10);
+ Hochschule_V.setBounds(145, 98, 125, 20);
+ Hochschule_V.setText(person.verantowrtlicher.getHochschule());
+ contentPanel.add(Hochschule_V);
+
+ JLabel lblEmail = new JLabel("E-Mail: *");
+ lblEmail.setBounds(10, 129, 125, 20);
+ contentPanel.add(lblEmail);
+
+ EMail_V = new JTextField();
+ EMail_V.setColumns(10);
+ EMail_V.setBounds(145, 129, 125, 20);
+ EMail_V.setText(person.verantowrtlicher.getEMail());
+ contentPanel.add(EMail_V);
+
+ JLabel lblTelnummer = new JLabel("Tel.-Nummer:");
+ lblTelnummer.setBounds(10, 160, 125, 20);
+ contentPanel.add(lblTelnummer);
+
+ Tel_V = new JTextField();
+ Tel_V.setColumns(10);
+ Tel_V.setBounds(145, 160, 125, 20);
+ Tel_V.setText(person.verantowrtlicher.getTel());
+ contentPanel.add(Tel_V);
+
+ JLabel lblFakultt = new JLabel("Fakult\u00E4t:");
+ lblFakultt.setBounds(10, 191, 125, 20);
+ contentPanel.add(lblFakultt);
+
+ Fak_V = new JTextField();
+ Fak_V.setColumns(10);
+ Fak_V.setBounds(145, 191, 125, 20);
+ Fak_V.setText(person.verantowrtlicher.getFakultät());
+ contentPanel.add(Fak_V);
+
+ chckbxDerVerantwortlicheEntspricht = new JCheckBox("Der Verantwortliche entspricht dem Ersteller");
+ chckbxDerVerantwortlicheEntspricht.setSelected(person.verantowrtlicher.isIschecked());
+ chckbxDerVerantwortlicheEntspricht.addChangeListener(new ChangeListener() {
+ public void stateChanged(ChangeEvent arg0) {
+ if(chckbxDerVerantwortlicheEntspricht.isSelected()==true){
+ Nachname_E.setText(Nachname_V.getText());
+ Vorname_E.setText(Vorname_V.getText());
+ Hochschule_E.setText(Hochschule_V.getText());
+ EMail_E.setText(EMail_V.getText());
+ Tel_E.setText(Tel_V.getText());
+ Fak_E.setText(Fak_V.getText());
+ }else{
+ Nachname_E.setText("");
+ Vorname_E.setText("");
+ Hochschule_E.setText("");
+ EMail_E.setText("");
+ Tel_E.setText("");
+ Fak_E.setText("");
+ }
+ }
+ });
+ chckbxDerVerantwortlicheEntspricht.setBackground(Color.WHITE);
+ chckbxDerVerantwortlicheEntspricht.setBounds(6, 228, 264, 23);
+ contentPanel.add(chckbxDerVerantwortlicheEntspricht);
+
+ JLabel lblAllgemeineInformationenZum = new JLabel("Allgemeine Informationen zum Ersteller");
+ lblAllgemeineInformationenZum.setFont(new Font("Tahoma", Font.PLAIN, 14));
+ lblAllgemeineInformationenZum.setBounds(10, 258, 338, 25);
+ contentPanel.add(lblAllgemeineInformationenZum);
+
+ JLabel label_1 = new JLabel("Vorname: *");
+ label_1.setBounds(10, 294, 125, 20);
+ contentPanel.add(label_1);
+
+ Vorname_E = new JTextField();
+ Vorname_E.setColumns(10);
+ Vorname_E.setBounds(145, 294, 125, 20);
+ Vorname_E.setText(person.ersteller.getVorname());
+ contentPanel.add(Vorname_E);
+
+ JLabel label_2 = new JLabel("Nachname: *");
+ label_2.setBounds(10, 325, 125, 20);
+ contentPanel.add(label_2);
+
+ Nachname_E = new JTextField();
+ Nachname_E.setColumns(10);
+ Nachname_E.setBounds(145, 325, 125, 20);
+ Nachname_E.setText(person.ersteller.getName());
+ contentPanel.add(Nachname_E);
+
+ Hochschule_E = new JTextField();
+ Hochschule_E.setColumns(10);
+ Hochschule_E.setBounds(145, 356, 125, 20);
+ Hochschule_E.setText(person.ersteller.getHochschule());
+ contentPanel.add(Hochschule_E);
+
+ JLabel label_3 = new JLabel("Hochschule: *");
+ label_3.setBounds(10, 356, 125, 20);
+ contentPanel.add(label_3);
+
+ JLabel label_4 = new JLabel("E-Mail: *");
+ label_4.setBounds(10, 387, 125, 20);
+ contentPanel.add(label_4);
+
+ EMail_E = new JTextField();
+ EMail_E.setColumns(10);
+ EMail_E.setBounds(145, 387, 125, 20);
+ EMail_E.setText(person.ersteller.getEMail());
+ contentPanel.add(EMail_E);
+
+ Tel_E = new JTextField();
+ Tel_E.setColumns(10);
+ Tel_E.setBounds(145, 418, 125, 20);
+ Tel_E.setText(person.ersteller.getTel());
+ contentPanel.add(Tel_E);
+
+ JLabel label_5 = new JLabel("Tel.-Nummer:");
+ label_5.setBounds(10, 418, 125, 20);
+ contentPanel.add(label_5);
+
+ JLabel label_6 = new JLabel("Fakult\u00E4t:");
+ label_6.setBounds(10, 449, 125, 20);
+ contentPanel.add(label_6);
+
+ Fak_E = new JTextField();
+ Fak_E.setColumns(10);
+ Fak_E.setText(person.ersteller.getFakultät());
+ Fak_E.setBounds(145, 449, 125, 20);
+ contentPanel.add(Fak_E);
+ {
+ JPanel buttonPane = new JPanel();
+ buttonPane.setBounds(0, 597, 529, 33);
+ buttonPane.setBackground(SystemColor.menu);
+ buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
+ getContentPane().add(buttonPane);
+ {
+ JButton okButton = new JButton("Zur\u00FCck");
+ okButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ person.verantowrtlicher.setVorname(Vorname_V.getText());
+ person.verantowrtlicher.setName(Nachname_V.getText());
+ person.verantowrtlicher.setEMail(EMail_V.getText());
+ person.verantowrtlicher.setFakultät(Fak_V.getText());
+ person.verantowrtlicher.setHochschule(Hochschule_V.getText());
+ person.verantowrtlicher.setTel(Tel_V.getText());
+ person.verantowrtlicher.setIschecked(chckbxDerVerantwortlicheEntspricht.isSelected());
+ person.ersteller.setEMail(EMail_E.getText());
+ person.ersteller.setFakultät(Fak_E.getText());
+ person.ersteller.setHochschule(Hochschule_E.getText());
+ person.ersteller.setName(Nachname_E.getText());
+ person.ersteller.setVorname(Vorname_V.getText());
+ person.ersteller.setTel(Tel_E.getText());
+ getVMwarePlayer sr=new getVMwarePlayer();
+ sr.setVisible(true);
+ dispose();
+ }
+ });
+ okButton.setActionCommand("OK");
+ buttonPane.add(okButton);
+ getRootPane().setDefaultButton(okButton);
+ }
+ {
+ JButton cancelButton = new JButton("Weiter");
+ cancelButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ person.verantowrtlicher.setVorname(Vorname_V.getText());
+ person.verantowrtlicher.setName(Nachname_V.getText());
+ person.verantowrtlicher.setEMail(EMail_V.getText());
+ person.verantowrtlicher.setFakultät(Fak_V.getText());
+ person.verantowrtlicher.setHochschule(Hochschule_V.getText());
+ person.verantowrtlicher.setTel(Tel_V.getText());
+ person.verantowrtlicher.setIschecked(chckbxDerVerantwortlicheEntspricht.isSelected());
+ person.ersteller.setEMail(EMail_E.getText());
+ person.ersteller.setFakultät(Fak_E.getText());
+ person.ersteller.setHochschule(Hochschule_E.getText());
+ person.ersteller.setName(Nachname_E.getText());
+ person.ersteller.setVorname(Vorname_V.getText());
+ person.ersteller.setTel(Tel_E.getText());
+ EingabeSystemDaten ea=new EingabeSystemDaten();
+ ea.setVisible(true);
+ dispose();
+ }
+ });
+ cancelButton.setActionCommand("Cancel");
+ buttonPane.add(cancelButton);
+ }
+ }
+
+ JSeparator separator = new JSeparator();
+ separator.setBounds(0, 79, 529, 2);
+ getContentPane().add(separator);
+
+ JSeparator separator_1 = new JSeparator();
+ separator_1.setBounds(0, 585, 529, 2);
+ getContentPane().add(separator_1);
+
+ JMenuBar menuBar = new JMenuBar();
+ setJMenuBar(menuBar);
+
+ JMenu mnNewMenu = new JMenu("Suchen");
+ menuBar.add(mnNewMenu);
+
+ JMenuItem mntmVlSuche = new JMenuItem("VL Suche");
+ mnNewMenu.add(mntmVlSuche);
+
+ JMenu mnNewMenu_1 = new JMenu("Hilfe");
+ menuBar.add(mnNewMenu_1);
+
+ JMenuItem mntmFaq = new JMenuItem("FAQ");
+ mnNewMenu_1.add(mntmFaq);
+
+ JMenuItem mntmOtrs = new JMenuItem("OTRS");
+ mnNewMenu_1.add(mntmOtrs);
+
+
+
+ }
+}
diff --git a/Dozentenmodul/src/GUI/EingabeSoftwareDaten.java b/Dozentenmodul/src/GUI/EingabeSoftwareDaten.java
new file mode 100644
index 00000000..f99fd88e
--- /dev/null
+++ b/Dozentenmodul/src/GUI/EingabeSoftwareDaten.java
@@ -0,0 +1,298 @@
+package GUI;
+
+import java.awt.FlowLayout;
+import javax.swing.JButton;
+import javax.swing.JDialog;
+import javax.swing.JPanel;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+import javax.swing.border.EmptyBorder;
+import java.awt.Color;
+import javax.swing.JLabel;
+import java.awt.Font;
+import javax.swing.JTextPane;
+import java.awt.SystemColor;
+import javax.swing.JTextField;
+import sql.sql;
+import ftp.ftp;
+import java.awt.event.ActionListener;
+import java.awt.event.ActionEvent;
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.Arrays;
+import javax.swing.JSeparator;
+import java.awt.List;
+import java.awt.event.KeyAdapter;
+import java.awt.event.KeyEvent;
+import javax.swing.plaf.basic.BasicArrowButton;
+import javax.swing.JMenuBar;
+import javax.swing.JMenu;
+import javax.swing.JMenuItem;
+import Models.vm;
+
+
+@SuppressWarnings("serial")
+public class EingabeSoftwareDaten extends JDialog {
+
+ private final JPanel contentPanel = new JPanel();
+ String[] result;
+ ftp f=new ftp();
+ sql sql=new sql();
+ private JTextField textField;
+ List listavailable;
+ List listchoosed;
+
+ /**
+ * Launch the application.
+ */
+ public static void main(String[] args) {
+ try {
+ EingabeSoftwareDaten dialog = new EingabeSoftwareDaten();
+ dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
+ dialog.setVisible(true);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Create the dialog.
+ */
+ @SuppressWarnings({ })
+ public EingabeSoftwareDaten() {
+ try {
+ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+ } catch (ClassNotFoundException | InstantiationException
+ | IllegalAccessException | UnsupportedLookAndFeelException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ setTitle("Dozentenmodul");
+ setBounds(100, 100, 603, 722);
+ getContentPane().setLayout(null);
+ {
+ JPanel panel = new JPanel();
+ panel.setBounds(0, 0, 529, 71);
+ getContentPane().add(panel);
+ panel.setLayout(null);
+ {
+ JLabel lblNewLabel = new JLabel("Eingabe der installierten Software (Schritt 5 von 6)");
+ lblNewLabel.setBounds(10, 11, 509, 22);
+ panel.add(lblNewLabel);
+ lblNewLabel.setFont(new Font("Tahoma", Font.PLAIN, 18));
+ }
+
+ JTextPane txtpnBitteWhlenSie = new JTextPane();
+ txtpnBitteWhlenSie.setEditable(false);
+ txtpnBitteWhlenSie.setBackground(SystemColor.menu);
+ txtpnBitteWhlenSie.setText("Bitte geben Sie nun die in Ihrem System installierte Software an.");
+ txtpnBitteWhlenSie.setBounds(10, 36, 509, 42);
+ panel.add(txtpnBitteWhlenSie);
+ }
+ contentPanel.setBounds(10, 95, 567, 512);
+ contentPanel.setBackground(Color.WHITE);
+ contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
+ getContentPane().add(contentPanel);
+ contentPanel.setLayout(null);
+
+ JLabel lblSysteminformationen = new JLabel("Verf\u00FCgbare Software");
+ lblSysteminformationen.setFont(new Font("Tahoma", Font.PLAIN, 14));
+ lblSysteminformationen.setBounds(10, 11, 162, 14);
+ contentPanel.add(lblSysteminformationen);
+
+
+ JLabel lblAusgewhlteSoftware = new JLabel("Ausgew\u00E4hlte Software");
+ lblAusgewhlteSoftware.setFont(new Font("Tahoma", Font.PLAIN, 14));
+ lblAusgewhlteSoftware.setBounds(306, 11, 162, 14);
+ contentPanel.add(lblAusgewhlteSoftware);
+
+
+
+ textField = new JTextField();
+ textField.addKeyListener(new KeyAdapter() {
+ @Override
+ public void keyReleased(KeyEvent e) {
+
+
+ Connection con=sql.getConnection();
+ ResultSet rs=sql.getSoftwareByName(con, textField.getText().toString());
+ listavailable.removeAll();
+ try {
+ while(rs.next())
+ {
+ listavailable.add(rs.getString("SW"));
+ }
+ } catch (SQLException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+
+ }
+ });
+
+ textField.setBounds(10, 36, 244, 20);
+ contentPanel.add(textField);
+ textField.setColumns(10);
+
+ JButton btnSoftwareHinzufgen = new JButton("Software hinzuf\u00FCgen");
+ btnSoftwareHinzufgen.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ AddSoftware as=new AddSoftware();
+ as.setVisible(true);
+ }
+ });
+ btnSoftwareHinzufgen.setBounds(10, 483, 162, 23);
+ contentPanel.add(btnSoftwareHinzufgen);
+
+ listavailable = new List();
+ Connection con=sql.getConnection();
+ ResultSet he=sql.getAllHersteller(con);
+
+ try {
+ while(he.next())
+ {
+
+ ResultSet sw=sql.getAllSoftware(con, he.getString("Name"));
+
+ while(sw.next())
+ {
+
+ listavailable.add(he.getString("Name")+" "+sw.getString("Produktname")+" "+sw.getString("Version")+" "+sw.getString("Architektur"));
+ }
+ }
+ } catch (SQLException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ listavailable.setMultipleMode(true);
+ listavailable.setBounds(10, 62, 244, 415);
+ contentPanel.add(listavailable);
+
+ listchoosed = new List();
+ if(vm.vl.getSoftware()!=null)
+ {
+ for(int i=0;i<vm.vl.getSoftware().getItemCount();i++){
+ listchoosed.add(vm.vl.getSoftware().getItem(i));
+ listavailable.remove(vm.vl.getSoftware().getItem(i));
+ }
+ }
+
+ listchoosed.setMultipleMode(true);
+ listchoosed.setBounds(306, 62, 244, 415);
+ contentPanel.add(listchoosed);
+
+ JButton btnNewButton = new BasicArrowButton(BasicArrowButton.EAST);
+ btnNewButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ String[] items=new String[listavailable.getItemCount()];
+ items=listavailable.getSelectedItems();
+ for(int i=0;i<items.length;i++)
+ {
+ listchoosed.add(items[i]);
+
+ listavailable.remove(items[i]);
+ }
+
+ String[] sort=listchoosed.getItems();
+ Arrays.sort(sort);
+ listchoosed.removeAll();
+
+ for(int i=0;i<sort.length;i++)
+ {
+ listchoosed.add(sort[i]);
+ }
+
+
+ }
+ });
+ btnNewButton.setBounds(260, 223, 40, 40);
+ contentPanel.add(btnNewButton);
+
+ JButton btnNewButton_1 = new BasicArrowButton(BasicArrowButton.WEST);
+ btnNewButton_1.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ String[] items=new String[listchoosed.getItemCount()];
+ items=listchoosed.getSelectedItems();
+ for(int i=0;i<items.length;i++)
+ {
+ listavailable.add(items[i]);
+ listchoosed.remove(items[i]);
+ }
+ String[] sort=listavailable.getItems();
+ Arrays.sort(sort);
+ listavailable.removeAll();
+
+ for(int i=0;i<sort.length;i++)
+ {
+ listavailable.add(sort[i]);
+ }
+ }
+ });
+ btnNewButton_1.setBounds(260, 274, 40, 40);
+ contentPanel.add(btnNewButton_1);
+
+
+ {
+ JPanel buttonPane = new JPanel();
+ buttonPane.setBounds(0, 631, 587, 33);
+ buttonPane.setBackground(SystemColor.menu);
+ buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
+ getContentPane().add(buttonPane);
+ {
+ JButton okButton = new JButton("Zur\u00FCck");
+ okButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ vm.vl.setSoftware(listchoosed);
+ EingabeSystemDaten eas=new EingabeSystemDaten();
+ eas.setVisible(true);
+ dispose();
+ }
+ });
+ okButton.setActionCommand("OK");
+ buttonPane.add(okButton);
+ getRootPane().setDefaultButton(okButton);
+ }
+ {
+ JButton cancelButton = new JButton("Weiter");
+ cancelButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent arg0) {
+ vm.vl.setSoftware(listchoosed);
+ FertigStellen fs=new FertigStellen();
+ fs.setVisible(true);
+ dispose();
+ }
+ });
+ cancelButton.setActionCommand("Cancel");
+ buttonPane.add(cancelButton);
+ }
+ }
+
+ JSeparator separator = new JSeparator();
+ separator.setBounds(0, 618, 616, 2);
+ getContentPane().add(separator);
+
+ JSeparator separator_1 = new JSeparator();
+ separator_1.setBounds(0, 82, 529, 2);
+ getContentPane().add(separator_1);
+
+ JMenuBar menuBar = new JMenuBar();
+ setJMenuBar(menuBar);
+
+ JMenu mnSuchen = new JMenu("Suchen");
+ menuBar.add(mnSuchen);
+
+ JMenuItem mntmVlSuche = new JMenuItem("VL Suche");
+ mnSuchen.add(mntmVlSuche);
+
+ JMenu mnHilfe = new JMenu("Hilfe");
+ menuBar.add(mnHilfe);
+
+ JMenuItem mntmFaq = new JMenuItem("FAQ");
+ mnHilfe.add(mntmFaq);
+
+ JMenuItem mntmOtrs = new JMenuItem("OTRS");
+ mnHilfe.add(mntmOtrs);
+
+ }
+}
diff --git a/Dozentenmodul/src/GUI/EingabeSystemDaten.java b/Dozentenmodul/src/GUI/EingabeSystemDaten.java
new file mode 100644
index 00000000..bbbfa98a
--- /dev/null
+++ b/Dozentenmodul/src/GUI/EingabeSystemDaten.java
@@ -0,0 +1,280 @@
+package GUI;
+
+import java.awt.FlowLayout;
+import javax.swing.JButton;
+import javax.swing.JDialog;
+import javax.swing.JPanel;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+import javax.swing.border.EmptyBorder;
+import java.awt.Color;
+import javax.swing.JLabel;
+import java.awt.Font;
+import javax.swing.JTextPane;
+import java.awt.SystemColor;
+import javax.swing.JTextField;
+import sql.sql;
+import ftp.ftp;
+import java.awt.event.ActionListener;
+import java.awt.event.ActionEvent;
+import javax.swing.JSeparator;
+import javax.swing.JTextArea;
+import java.awt.Choice;
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+
+import Models.vm;
+
+import com.toedter.calendar.JDateChooser;
+import javax.swing.JMenuBar;
+import javax.swing.JMenu;
+import javax.swing.JMenuItem;
+
+@SuppressWarnings("serial")
+public class EingabeSystemDaten extends JDialog {
+
+ private final JPanel contentPanel = new JPanel();
+ String[] result;
+ ftp f=new ftp();
+ sql sql=new sql();
+ private JTextField Laborname;
+ JDateChooser dateChooser;
+ JTextArea textArea_2;
+ JDateChooser dateChooser_1;
+ JTextArea textArea_1;
+ Choice choiceOS;
+ JTextArea textArea;
+ /**
+ * Launch the application.
+ */
+ public static void main(String[] args) {
+ try {
+ EingabeSystemDaten dialog = new EingabeSystemDaten();
+ dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
+ dialog.setVisible(true);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Create the dialog.
+ */
+ public EingabeSystemDaten() {
+ try {
+ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+ } catch (ClassNotFoundException | InstantiationException
+ | IllegalAccessException | UnsupportedLookAndFeelException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ setTitle("Dozentenmodul");
+ setBounds(100, 100, 583, 648);
+ getContentPane().setLayout(null);
+ {
+ JPanel panel = new JPanel();
+ panel.setBounds(0, 0, 567, 71);
+ getContentPane().add(panel);
+ panel.setLayout(null);
+ {
+ JLabel lblNewLabel = new JLabel("Eingabe der systembezogenen Daten (Schritt 4 von 5)");
+ lblNewLabel.setBounds(10, 11, 509, 22);
+ panel.add(lblNewLabel);
+ lblNewLabel.setFont(new Font("Tahoma", Font.PLAIN, 18));
+ }
+
+ JTextPane txtpnBitteWhlenSie = new JTextPane();
+ txtpnBitteWhlenSie.setEditable(false);
+ txtpnBitteWhlenSie.setBackground(SystemColor.menu);
+ txtpnBitteWhlenSie.setText("Bitte geben Sie nun die notwendigen Daten Ihres Systems ein.");
+ txtpnBitteWhlenSie.setBounds(10, 36, 509, 42);
+ panel.add(txtpnBitteWhlenSie);
+ }
+ contentPanel.setBounds(10, 95, 547, 441);
+ contentPanel.setBackground(Color.WHITE);
+ contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
+ getContentPane().add(contentPanel);
+ contentPanel.setLayout(null);
+
+ JLabel lblSysteminformationen = new JLabel("Systeminformationen");
+ lblSysteminformationen.setFont(new Font("Tahoma", Font.PLAIN, 14));
+ lblSysteminformationen.setBounds(10, 11, 162, 14);
+ contentPanel.add(lblSysteminformationen);
+
+ JLabel lblLabornameanzeigename = new JLabel("Laborname (Anzeigename): *");
+ lblLabornameanzeigename.setBounds(10, 36, 150, 20);
+ contentPanel.add(lblLabornameanzeigename);
+
+ Laborname = new JTextField();
+ Laborname.setText(vm.vl.getLaborname());
+ Laborname.setBounds(170, 36, 150, 20);
+ contentPanel.add(Laborname);
+ Laborname.setColumns(10);
+
+ JLabel lblKurzbeschreibung = new JLabel("Kurzbeschreibung: *");
+ lblKurzbeschreibung.setBounds(10, 67, 150, 20);
+ contentPanel.add(lblKurzbeschreibung);
+
+ textArea = new JTextArea();
+ textArea.setBorder(UIManager.getBorder("TextField.border"));
+ textArea.setText(vm.vl.getShortDesc());
+ textArea.setBounds(170, 67, 274, 63);
+ contentPanel.add(textArea);
+
+ JLabel lblLangbeschreibung = new JLabel("Langbeschreibung: *");
+ lblLangbeschreibung.setBounds(10, 139, 150, 20);
+ contentPanel.add(lblLangbeschreibung);
+
+ textArea_1 = new JTextArea();
+ textArea_1.setBorder(UIManager.getBorder("TextField.border"));
+ textArea_1.setText(vm.vl.getLongDesc());
+ textArea_1.setBounds(170, 141, 274, 152);
+ contentPanel.add(textArea_1);
+
+ JLabel lblKommentar = new JLabel("Kommentar:");
+ lblKommentar.setBounds(10, 308, 150, 20);
+ contentPanel.add(lblKommentar);
+
+ textArea_2 = new JTextArea();
+ textArea_2.setBorder(UIManager.getBorder("TextField.border"));
+ textArea_2.setText(vm.vl.getComment());
+ textArea_2.setBounds(170, 304, 274, 63);
+ contentPanel.add(textArea_2);
+
+ JLabel lblBetriebssystem = new JLabel("Betriebssystem: *");
+ lblBetriebssystem.setBounds(10, 373, 150, 20);
+ contentPanel.add(lblBetriebssystem);
+
+ choiceOS = new Choice();
+
+ choiceOS.setBounds(170, 373, 150, 20);
+
+ Connection con=sql.getConnection();
+ ResultSet rs=sql.getAllOS(con);
+
+ try {
+ while(rs.next())
+ {
+ choiceOS.addItem(rs.getString("Produktname")+" "+rs.getString("Version")+" "+rs.getString("Architektur"));
+ }
+ } catch (SQLException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ choiceOS.select(vm.vl.getOS());
+
+ contentPanel.add(choiceOS);
+
+ JLabel lblGltigkeitsdatumVon = new JLabel("G\u00FCltigkeitsdatum: *");
+ lblGltigkeitsdatumVon.setBounds(10, 404, 150, 20);
+ contentPanel.add(lblGltigkeitsdatumVon);
+
+ JLabel lblVon = new JLabel("von");
+ lblVon.setBounds(170, 407, 24, 14);
+ contentPanel.add(lblVon);
+
+ dateChooser = new JDateChooser();
+ dateChooser.setDateFormatString("dd.MM.yyyy hh:mm:ss");
+ dateChooser.setDate(vm.vl.getBegin());
+ dateChooser.setBounds(204, 404, 140, 20);
+ contentPanel.add(dateChooser);
+
+ JLabel lblNewLabel_1 = new JLabel("bis");
+ lblNewLabel_1.setBounds(354, 407, 24, 14);
+ contentPanel.add(lblNewLabel_1);
+
+ dateChooser_1 = new JDateChooser();
+ dateChooser_1.setDateFormatString("dd.MM.yyyy hh:mm:ss");
+ dateChooser_1.setDate(vm.vl.getEnd());
+ dateChooser_1.setBounds(388, 404, 140, 20);
+ contentPanel.add(dateChooser_1);
+
+ JButton btnHinzufgen = new JButton("Hinzuf\u00FCgen");
+ btnHinzufgen.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent arg0) {
+ AddOS os=new AddOS();
+ os.setVisible(true);
+ }
+ });
+ btnHinzufgen.setBounds(326, 372, 118, 23);
+ contentPanel.add(btnHinzufgen);
+ {
+ JPanel buttonPane = new JPanel();
+ buttonPane.setBounds(0, 554, 567, 33);
+ buttonPane.setBackground(SystemColor.menu);
+ buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
+ getContentPane().add(buttonPane);
+ {
+ JButton okButton = new JButton("Zur\u00FCck");
+ okButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent arg0) {
+ vm.vl.setBegin(dateChooser.getDate());
+ vm.vl.setComment(textArea_2.getText());
+ vm.vl.setEnd(dateChooser_1.getDate());
+ vm.vl.setLaborname(Laborname.getText());
+ vm.vl.setLongDesc(textArea_1.getText());
+ vm.vl.setOS(choiceOS.getSelectedItem());
+ vm.vl.setShortDesc(textArea.getText());
+ EingabeAllgemein ea= new EingabeAllgemein();
+ ea.setVisible(true);
+ dispose();
+ }
+ });
+ okButton.setActionCommand("OK");
+ buttonPane.add(okButton);
+ getRootPane().setDefaultButton(okButton);
+ }
+ {
+ JButton cancelButton = new JButton("Weiter");
+ cancelButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent arg0) {
+ vm.vl.setBegin(dateChooser.getDate());
+ vm.vl.setComment(textArea_2.getText());
+ vm.vl.setEnd(dateChooser_1.getDate());
+ vm.vl.setLaborname(Laborname.getText());
+ vm.vl.setLongDesc(textArea_1.getText());
+ vm.vl.setOS(choiceOS.getSelectedItem());
+ vm.vl.setShortDesc(textArea.getText());
+
+ EingabeSoftwareDaten ea=new EingabeSoftwareDaten();
+ ea.setVisible(true);
+ dispose();
+ }
+ });
+ cancelButton.setActionCommand("Cancel");
+ buttonPane.add(cancelButton);
+ }
+ }
+
+ JSeparator separator = new JSeparator();
+ separator.setBounds(0, 547, 567, 2);
+ getContentPane().add(separator);
+
+ JSeparator separator_1 = new JSeparator();
+ separator_1.setBounds(0, 82, 529, 2);
+ getContentPane().add(separator_1);
+
+ JMenuBar menuBar = new JMenuBar();
+ setJMenuBar(menuBar);
+
+ JMenu mnSuchen = new JMenu("Suchen");
+ menuBar.add(mnSuchen);
+
+ JMenuItem mntmVlSuche = new JMenuItem("VL Suche");
+ mnSuchen.add(mntmVlSuche);
+
+ JMenu mnHilfe = new JMenu("Hilfe");
+ menuBar.add(mnHilfe);
+
+ JMenuItem mntmFaq = new JMenuItem("FAQ");
+ mnHilfe.add(mntmFaq);
+
+ JMenuItem mntmOtrs = new JMenuItem("OTRS");
+ mnHilfe.add(mntmOtrs);
+
+
+
+
+ }
+}
diff --git a/Dozentenmodul/src/GUI/FTPDownloader.java b/Dozentenmodul/src/GUI/FTPDownloader.java
new file mode 100644
index 00000000..b936a966
--- /dev/null
+++ b/Dozentenmodul/src/GUI/FTPDownloader.java
@@ -0,0 +1,161 @@
+package GUI;
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.FlowLayout;
+import java.io.File;
+import javax.swing.JButton;
+import javax.swing.JFileChooser;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JProgressBar;
+import javax.swing.SwingConstants;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+import javax.swing.border.EmptyBorder;
+
+import downloader.DownloadTask;
+
+import ftp.ftp;
+import java.awt.event.ActionListener;
+import java.awt.event.ActionEvent;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+
+@SuppressWarnings("serial")
+public class FTPDownloader extends JFrame implements PropertyChangeListener {
+
+ @SuppressWarnings("unused")
+ private JPanel contentPane;
+ private final JPanel contentPanel = new JPanel();
+ JLabel lblNewLabel;
+ JProgressBar progressBar;
+ ftp f=new ftp();
+ String host="openslx-nfs.rz.hs-offenburg.de";
+ int port=21;
+ String username="tspitzer";
+ String password="21071989";
+ String downloadPath="_vorlagen/";
+ String filename="";
+ static String arg="";
+ /**
+ * Launch the application.
+ */
+ /*public static void main(String[] args) {
+ EventQueue.invokeLater(new Runnable() {
+ public void run() {
+ try {
+ FTPDownloader frame = new FTPDownloader();
+ frame.setVisible(true);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ });
+ }*/
+
+ /**
+ * Create the frame.
+ */
+ public FTPDownloader(String name) {
+ //setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
+
+ filename=name;
+
+ try {
+ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+ } catch (ClassNotFoundException | InstantiationException
+ | IllegalAccessException | UnsupportedLookAndFeelException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ //filename=name;
+ setBackground(Color.WHITE);
+ setTitle("Downloader");
+ setBounds(100, 100, 450, 218);
+ getContentPane().setLayout(new BorderLayout());
+ contentPanel.setBackground(Color.WHITE);
+ contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
+ getContentPane().add(contentPanel, BorderLayout.CENTER);
+ contentPanel.setLayout(null);
+ {
+ JButton btnSpeicherortAuswhlen = new JButton("Speicherort ausw\u00E4hlen");
+ btnSpeicherortAuswhlen.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent arg0) {
+ JFileChooser fc=new JFileChooser();
+ fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
+
+ fc.showOpenDialog(getParent());
+ File dir=fc.getSelectedFile();
+ lblNewLabel.setText(dir.getAbsolutePath());
+ }
+ });
+
+ btnSpeicherortAuswhlen.setBounds(10, 11, 141, 23);
+ btnSpeicherortAuswhlen.setVerticalAlignment(SwingConstants.TOP);
+ btnSpeicherortAuswhlen.setHorizontalAlignment(SwingConstants.LEFT);
+ contentPanel.add(btnSpeicherortAuswhlen);
+ }
+
+ lblNewLabel = new JLabel("C:\\");
+ lblNewLabel.setBounds(169, 11, 255, 23);
+ contentPanel.add(lblNewLabel);
+
+ JButton btnDownloadStarten = new JButton("Download starten");
+ btnDownloadStarten.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent arg0) {
+ buttonDownloadActionPerformed(arg0);
+ }
+ });
+
+ btnDownloadStarten.setBounds(10, 106, 141, 23);
+ contentPanel.add(btnDownloadStarten);
+
+ progressBar = new JProgressBar(0,100);
+ progressBar.setStringPainted(true);
+
+
+ progressBar.setBounds(10, 45, 414, 30);
+ contentPanel.add(progressBar);
+ {
+ JPanel buttonPane = new JPanel();
+ buttonPane.setBackground(Color.WHITE);
+ buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
+ getContentPane().add(buttonPane, BorderLayout.SOUTH);
+ {
+ JButton okButton = new JButton("OK");
+ okButton.setActionCommand("OK");
+ buttonPane.add(okButton);
+ getRootPane().setDefaultButton(okButton);
+ }
+ {
+ JButton cancelButton = new JButton("Zur\u00FCck");
+ cancelButton.setActionCommand("Cancel");
+ buttonPane.add(cancelButton);
+ }
+ }
+ setVisible(true);
+
+ }
+
+ private void buttonDownloadActionPerformed(ActionEvent event) {
+
+ progressBar.setValue(0);
+ DownloadTask task = new DownloadTask(host, port, username, password,downloadPath+filename, lblNewLabel.getText(), this);
+ task.addPropertyChangeListener(this);
+ task.execute();
+ }
+
+ public void propertyChange(PropertyChangeEvent arg0) {
+ if ("progress" == arg0.getPropertyName()) {
+ int progress = (Integer) arg0.getNewValue();
+ progressBar.setValue(progress);
+ }
+
+ }
+
+
+
+} \ No newline at end of file
diff --git a/Dozentenmodul/src/GUI/FTPUploader.java b/Dozentenmodul/src/GUI/FTPUploader.java
new file mode 100644
index 00000000..88526d04
--- /dev/null
+++ b/Dozentenmodul/src/GUI/FTPUploader.java
@@ -0,0 +1,180 @@
+package GUI;
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.EventQueue;
+import java.awt.FlowLayout;
+import java.io.File;
+import javax.swing.JButton;
+import javax.swing.JFileChooser;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JProgressBar;
+import javax.swing.SwingConstants;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+import javax.swing.border.EmptyBorder;
+import downloader.UploadTask;
+import ftp.ftp;
+import java.awt.event.ActionListener;
+import java.awt.event.ActionEvent;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+
+@SuppressWarnings("serial")
+public class FTPUploader extends JFrame implements PropertyChangeListener {
+
+ @SuppressWarnings("unused")
+ private JPanel contentPane;
+ private final JPanel contentPanel = new JPanel();
+ JLabel lblNewLabel;
+ JLabel UpSpeed;
+ JProgressBar progressBar;
+ ftp f=new ftp();
+ String host="141.79.128.103";
+ int port=21;
+ String username="sysadmin4openslx";
+ String password="!N4ye,04u.";
+ String uploadPath="/";
+ String filename="";
+ File uploadFile;
+ static String arg="";
+ /**
+ * Launch the application.
+ */
+ public static void main(String[] args) {
+ EventQueue.invokeLater(new Runnable() {
+ public void run() {
+ try {
+ FTPUploader frame = new FTPUploader();
+ frame.setVisible(true);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ });
+ }
+
+ /**
+ * Create the frame.
+ */
+ public FTPUploader() {
+ //setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
+
+
+
+ try {
+ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+ } catch (ClassNotFoundException | InstantiationException
+ | IllegalAccessException | UnsupportedLookAndFeelException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ //filename=name;
+ setBackground(Color.WHITE);
+ setTitle("Uploader");
+ setBounds(100, 100, 450, 218);
+ getContentPane().setLayout(new BorderLayout());
+ contentPanel.setBackground(Color.WHITE);
+ contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
+ getContentPane().add(contentPanel, BorderLayout.CENTER);
+ contentPanel.setLayout(null);
+ {
+ JButton btnSpeicherortAuswhlen = new JButton("VMDK ausw\u00E4hlen");
+ btnSpeicherortAuswhlen.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent arg0) {
+ JFileChooser fc=new JFileChooser();
+ fc.setFileSelectionMode(JFileChooser.FILES_ONLY);
+
+ fc.showOpenDialog(getParent());
+ File dir=fc.getSelectedFile();
+ uploadFile=dir;
+ lblNewLabel.setText(dir.getAbsolutePath());
+ }
+ });
+
+ btnSpeicherortAuswhlen.setBounds(10, 11, 141, 23);
+ btnSpeicherortAuswhlen.setVerticalAlignment(SwingConstants.TOP);
+ btnSpeicherortAuswhlen.setHorizontalAlignment(SwingConstants.LEFT);
+ contentPanel.add(btnSpeicherortAuswhlen);
+ }
+
+ lblNewLabel = new JLabel("");
+ lblNewLabel.setBounds(169, 11, 255, 23);
+ contentPanel.add(lblNewLabel);
+
+ JButton btnDownloadStarten = new JButton("Upload starten");
+ btnDownloadStarten.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent arg0) {
+ buttonUploadActionPerformed(arg0);
+ }
+ });
+
+ btnDownloadStarten.setBounds(10, 106, 141, 23);
+ contentPanel.add(btnDownloadStarten);
+
+ progressBar = new JProgressBar(0,100);
+ progressBar.setStringPainted(true);
+
+
+ progressBar.setBounds(10, 45, 414, 30);
+ contentPanel.add(progressBar);
+
+ JLabel lblUploadgeschwindigkeit = new JLabel("Uploadgeschwindigkeit:");
+ lblUploadgeschwindigkeit.setBounds(10, 75, 150, 14);
+ contentPanel.add(lblUploadgeschwindigkeit);
+
+ UpSpeed = new JLabel("");
+ UpSpeed.setBounds(169, 75, 170, 14);
+ UpSpeed.setText(String.valueOf(0));
+ contentPanel.add(UpSpeed);
+ {
+ JPanel buttonPane = new JPanel();
+ buttonPane.setBackground(Color.WHITE);
+ buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
+ getContentPane().add(buttonPane, BorderLayout.SOUTH);
+ {
+ JButton okButton = new JButton("OK");
+ okButton.setActionCommand("OK");
+ buttonPane.add(okButton);
+ getRootPane().setDefaultButton(okButton);
+ }
+ {
+ JButton cancelButton = new JButton("Zur\u00FCck");
+ cancelButton.setActionCommand("Cancel");
+ buttonPane.add(cancelButton);
+ }
+ }
+ setVisible(true);
+
+ }
+
+ private void buttonUploadActionPerformed(ActionEvent event) {
+
+ progressBar.setValue(0);
+ UploadTask task=new UploadTask(host,port,username,password,uploadPath, uploadFile);
+ task.addPropertyChangeListener(this);
+ task.execute();
+ }
+
+ public void propertyChange(PropertyChangeEvent arg0) {
+ if ("progress" == arg0.getPropertyName()) {
+ int progress = (Integer) arg0.getNewValue();
+ progressBar.setValue(progress);
+ }
+ if("speed"==arg0.getPropertyName()){
+ double speed=(double)arg0.getNewValue();
+ if(speed<=1){
+ UpSpeed.setText(String.valueOf(speed));
+ }else
+ {
+ double MBSpeed=speed/1024;
+ UpSpeed.setText(String.valueOf((MBSpeed)).substring(0, String.valueOf(MBSpeed).indexOf(".")));
+ }
+
+ }
+
+ }
+} \ No newline at end of file
diff --git a/Dozentenmodul/src/GUI/FertigStellen.java b/Dozentenmodul/src/GUI/FertigStellen.java
new file mode 100644
index 00000000..e9beb598
--- /dev/null
+++ b/Dozentenmodul/src/GUI/FertigStellen.java
@@ -0,0 +1,154 @@
+package GUI;
+import java.awt.FlowLayout;
+import javax.swing.JButton;
+import javax.swing.JDialog;
+import javax.swing.JPanel;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+import javax.swing.border.EmptyBorder;
+import java.awt.Color;
+import javax.swing.JLabel;
+import java.awt.Font;
+import javax.swing.JTextPane;
+import java.awt.SystemColor;
+import ftp.ftp;
+import java.awt.event.ActionListener;
+import java.awt.event.ActionEvent;
+import javax.swing.JSeparator;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.JMenu;
+
+
+@SuppressWarnings("serial")
+public class FertigStellen extends JDialog {
+
+ private final JPanel contentPanel = new JPanel();
+ String[] result;
+ ftp f=new ftp();
+ /**
+ * Launch the application.
+ */
+ public static void main(String[] args) {
+ try {
+ FertigStellen dialog = new FertigStellen();
+ dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
+ dialog.setVisible(true);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Create the dialog.
+ */
+ public FertigStellen() {
+ try {
+ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+ } catch (ClassNotFoundException | InstantiationException
+ | IllegalAccessException | UnsupportedLookAndFeelException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ setTitle("Dozentenmodul");
+ setBounds(100, 100, 417, 307);
+ getContentPane().setLayout(null);
+ {
+ JPanel panel = new JPanel();
+ panel.setBounds(0, 0, 529, 68);
+ getContentPane().add(panel);
+ panel.setLayout(null);
+ {
+ JLabel lblNewLabel = new JLabel("Fertig stellen (Schritt 6 von 6)");
+ lblNewLabel.setBounds(10, 11, 391, 22);
+ panel.add(lblNewLabel);
+ lblNewLabel.setFont(new Font("Tahoma", Font.PLAIN, 18));
+ }
+
+ JTextPane txtpnBitteWhlenSie = new JTextPane();
+ txtpnBitteWhlenSie.setEditable(false);
+ txtpnBitteWhlenSie.setBackground(SystemColor.menu);
+ txtpnBitteWhlenSie.setText("Bitte laden Sie nun ihre fertige VL mithilfe des Uploaders auf den Server.");
+ txtpnBitteWhlenSie.setBounds(10, 36, 391, 42);
+ panel.add(txtpnBitteWhlenSie);
+ }
+ contentPanel.setBounds(10, 91, 381, 97);
+ contentPanel.setBackground(Color.WHITE);
+ contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
+ getContentPane().add(contentPanel);
+ contentPanel.setLayout(null);
+
+ JButton btnUploaderStarten = new JButton("Uploader starten");
+ btnUploaderStarten.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent arg0) {
+ FTPUploader ftp=new FTPUploader();
+ ftp.setVisible(true);
+ }
+ });
+ btnUploaderStarten.setBounds(10, 11, 203, 23);
+ contentPanel.add(btnUploaderStarten);
+
+ JButton btnSofortigeSyncronisation = new JButton("Sofortige Syncronisation");
+ btnSofortigeSyncronisation.setBounds(10, 63, 203, 23);
+ contentPanel.add(btnSofortigeSyncronisation);
+ {
+ JPanel buttonPane = new JPanel();
+ buttonPane.setBounds(0, 212, 401, 36);
+ buttonPane.setBackground(SystemColor.menu);
+ buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
+ getContentPane().add(buttonPane);
+ {
+ JButton okButton = new JButton("Zur\u00FCck");
+ okButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ EingabeSoftwareDaten ea=new EingabeSoftwareDaten();
+ ea.setVisible(true);
+ dispose();
+ }
+ });
+ okButton.setActionCommand("OK");
+ buttonPane.add(okButton);
+ getRootPane().setDefaultButton(okButton);
+ }
+ {
+ JButton cancelButton = new JButton("Fertig");
+ cancelButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ System.exit(0);
+ }
+ });
+ cancelButton.setActionCommand("Cancel");
+ buttonPane.add(cancelButton);
+ }
+ }
+
+ JSeparator separator = new JSeparator();
+ separator.setBounds(0, 79, 529, 2);
+ getContentPane().add(separator);
+
+ JSeparator separator_1 = new JSeparator();
+ separator_1.setBounds(0, 199, 401, 2);
+ getContentPane().add(separator_1);
+
+ JMenuBar menuBar = new JMenuBar();
+ setJMenuBar(menuBar);
+
+ JMenu mnSuchen = new JMenu("Suchen");
+ menuBar.add(mnSuchen);
+
+ JMenuItem mntmVlSuche = new JMenuItem("VL Suche");
+ mnSuchen.add(mntmVlSuche);
+
+ JMenu mnHilfe = new JMenu("Hilfe");
+ menuBar.add(mnHilfe);
+
+ JMenuItem mntmFaq = new JMenuItem("FAQ");
+ mnHilfe.add(mntmFaq);
+
+ JMenuItem mntmOtrs = new JMenuItem("OTRS");
+ mnHilfe.add(mntmOtrs);
+
+
+
+ }
+}
diff --git a/Dozentenmodul/src/GUI/LoginWindow.java b/Dozentenmodul/src/GUI/LoginWindow.java
index 3063bb81..4f9268ef 100644
--- a/Dozentenmodul/src/GUI/LoginWindow.java
+++ b/Dozentenmodul/src/GUI/LoginWindow.java
@@ -78,7 +78,8 @@ public class LoginWindow extends JFrame {
//Größe und Position des Logos festelegen
imgLabel.setBounds(10, 11, 270, 64);
//Pfadangabe des Logos
- ImageIcon icon = new ImageIcon("img/Logo_bwLehrpool.png","Logo");
+
+ ImageIcon icon = new ImageIcon(getClass().getResource("/Logo_bwLehrpool.png"),"Logo");
//Skalierung des Logos
Image scaled=icon.getImage().getScaledInstance(270, 64, 0);
imgLabel.setIcon(new ImageIcon(scaled));
diff --git a/Dozentenmodul/src/GUI/getVMwarePlayer.java b/Dozentenmodul/src/GUI/getVMwarePlayer.java
new file mode 100644
index 00000000..47a09de5
--- /dev/null
+++ b/Dozentenmodul/src/GUI/getVMwarePlayer.java
@@ -0,0 +1,156 @@
+package GUI;
+
+import java.awt.FlowLayout;
+import javax.swing.JButton;
+import javax.swing.JDialog;
+import javax.swing.JPanel;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+import javax.swing.border.EmptyBorder;
+import java.awt.Color;
+import javax.swing.JLabel;
+import java.awt.Font;
+import javax.swing.JTextPane;
+import java.awt.SystemColor;
+import ftp.ftp;
+import java.awt.event.ActionListener;
+import java.awt.event.ActionEvent;
+import javax.swing.JSeparator;
+import javax.swing.JMenuBar;
+import javax.swing.JMenu;
+import javax.swing.JMenuItem;
+
+@SuppressWarnings("serial")
+public class getVMwarePlayer extends JDialog {
+
+ private final JPanel contentPanel = new JPanel();
+ String[] result;
+ ftp f=new ftp();
+ /**
+ * Launch the application.
+ */
+ public static void main(String[] args) {
+ try {
+ getVMwarePlayer dialog = new getVMwarePlayer();
+ dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
+ dialog.setVisible(true);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Create the dialog.
+ */
+ public getVMwarePlayer() {
+ try {
+ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+ } catch (ClassNotFoundException | InstantiationException
+ | IllegalAccessException | UnsupportedLookAndFeelException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ setTitle("Dozentenmodul");
+ setBounds(100, 100, 545, 517);
+ getContentPane().setLayout(null);
+ {
+ JPanel panel = new JPanel();
+ panel.setBounds(0, 0, 529, 80);
+ getContentPane().add(panel);
+ panel.setLayout(null);
+ {
+ JLabel lblNewLabel = new JLabel("Bearbeiten der VMDK (Schritt 2 von 6)");
+ lblNewLabel.setBounds(10, 11, 509, 22);
+ panel.add(lblNewLabel);
+ lblNewLabel.setFont(new Font("Tahoma", Font.PLAIN, 18));
+ }
+
+ JTextPane txtpnBitteWhlenSie = new JTextPane();
+ txtpnBitteWhlenSie.setEditable(false);
+ txtpnBitteWhlenSie.setBackground(SystemColor.menu);
+ txtpnBitteWhlenSie.setText("Bitte bearbeiten Sie nun die heruntergeladene VMDK");
+ txtpnBitteWhlenSie.setBounds(10, 36, 509, 42);
+ panel.add(txtpnBitteWhlenSie);
+ }
+ contentPanel.setBounds(10, 113, 509, 252);
+ contentPanel.setBackground(Color.WHITE);
+ contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
+ getContentPane().add(contentPanel);
+ contentPanel.setLayout(null);
+
+ JTextPane txtpnUmIhreVmdk = new JTextPane();
+ txtpnUmIhreVmdk.setEditable(false);
+ txtpnUmIhreVmdk.setText("Um Ihre VMDK zu bearbeiten bzw. die notwendigen Programme zu installieren, ben\u00F6tigen sie den VMware Player. Den VMware Player k\u00F6nnen Sie unter folgendem Link downloaden.");
+ txtpnUmIhreVmdk.setBounds(0, 0, 499, 154);
+ contentPanel.add(txtpnUmIhreVmdk);
+ {
+ JPanel buttonPane = new JPanel();
+ buttonPane.setBounds(0, 423, 529, 33);
+ buttonPane.setBackground(SystemColor.menu);
+ buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
+ getContentPane().add(buttonPane);
+ {
+ JButton okButton = new JButton("Zur\u00FCck");
+ okButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ searchRohling sr=new searchRohling();
+ sr.setVisible(true);
+ dispose();
+ }
+ });
+ okButton.setActionCommand("OK");
+ buttonPane.add(okButton);
+ getRootPane().setDefaultButton(okButton);
+ }
+ {
+ JButton cancelButton = new JButton("Weiter");
+ cancelButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ EingabeAllgemein ea=new EingabeAllgemein();
+ ea.setVisible(true);
+ dispose();
+ }
+ });
+ cancelButton.setActionCommand("Cancel");
+ buttonPane.add(cancelButton);
+ }
+ }
+ {
+ JSeparator separator = new JSeparator();
+ separator.setBounds(0, 402, 519, 2);
+ getContentPane().add(separator);
+ }
+ {
+ JSeparator separator = new JSeparator();
+ separator.setBounds(0, 91, 519, 2);
+ getContentPane().add(separator);
+ }
+ {
+ JMenuBar menuBar = new JMenuBar();
+ setJMenuBar(menuBar);
+ {
+ JMenu mnSuchen = new JMenu("Suchen");
+ menuBar.add(mnSuchen);
+ {
+ JMenuItem mntmVlSuche = new JMenuItem("VL Suche");
+ mnSuchen.add(mntmVlSuche);
+ }
+ }
+ {
+ JMenu mnHilfe = new JMenu("Hilfe");
+ menuBar.add(mnHilfe);
+ {
+ JMenuItem mntmFaq = new JMenuItem("FAQ");
+ mnHilfe.add(mntmFaq);
+ }
+ {
+ JMenuItem mntmHilfe = new JMenuItem("Hilfe");
+ mnHilfe.add(mntmHilfe);
+ }
+ }
+ }
+
+
+
+ }
+}
diff --git a/Dozentenmodul/src/GUI/searchRohling.java b/Dozentenmodul/src/GUI/searchRohling.java
new file mode 100644
index 00000000..4b2ef1b0
--- /dev/null
+++ b/Dozentenmodul/src/GUI/searchRohling.java
@@ -0,0 +1,201 @@
+package GUI;
+
+import java.awt.FlowLayout;
+import javax.swing.JButton;
+import javax.swing.JDialog;
+import javax.swing.JPanel;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+import javax.swing.border.EmptyBorder;
+import java.awt.Color;
+import javax.swing.JLabel;
+import java.awt.Font;
+import javax.swing.JTextPane;
+import java.awt.SystemColor;
+import javax.swing.JTextField;
+import ftp.ftp;
+import java.awt.event.KeyAdapter;
+import java.awt.event.KeyEvent;
+import java.net.SocketException;
+import java.awt.List;
+import java.awt.event.ActionListener;
+import java.awt.event.ActionEvent;
+import javax.swing.JSeparator;
+import javax.swing.JMenuBar;
+import javax.swing.JMenu;
+import javax.swing.JMenuItem;
+
+@SuppressWarnings("serial")
+public class searchRohling extends JDialog {
+
+ private final JPanel contentPanel = new JPanel();
+ private JTextField textFieldsearch;
+ List list;
+ String[] result;
+ ftp f=new ftp();
+ /**
+ * Launch the application.
+ */
+ public static void main(String[] args) {
+ try {
+ searchRohling dialog = new searchRohling();
+ dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
+ dialog.setVisible(true);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Create the dialog.
+ */
+ public searchRohling() {
+ try {
+ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+ } catch (ClassNotFoundException | InstantiationException
+ | IllegalAccessException | UnsupportedLookAndFeelException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ setTitle("Dozentenmodul");
+ setBounds(100, 100, 545, 516);
+ getContentPane().setLayout(null);
+ {
+ JPanel panel = new JPanel();
+ panel.setBounds(0, 0, 529, 71);
+ getContentPane().add(panel);
+ panel.setLayout(null);
+ {
+ JLabel lblNewLabel = new JLabel("Rohling ausw\u00E4hlen (Schritt 1 von 6)");
+ lblNewLabel.setBounds(10, 11, 509, 22);
+ panel.add(lblNewLabel);
+ lblNewLabel.setFont(new Font("Tahoma", Font.PLAIN, 18));
+ }
+
+ JTextPane txtpnBitteWhlenSie = new JTextPane();
+ txtpnBitteWhlenSie.setEditable(false);
+ txtpnBitteWhlenSie.setBackground(SystemColor.menu);
+ txtpnBitteWhlenSie.setText("Bitte w\u00E4hlen Sie nun Ihr gew\u00FCnschtes Rohling aus und klicken Sie auf Download. Sollten Sie schon im Besitz Ihres gew\u00FCnschten Rohlings sein klicken Sie auf weiter.");
+ txtpnBitteWhlenSie.setBounds(10, 36, 509, 42);
+ panel.add(txtpnBitteWhlenSie);
+ }
+ contentPanel.setBounds(10, 113, 509, 252);
+ contentPanel.setBackground(Color.WHITE);
+ contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
+ getContentPane().add(contentPanel);
+ contentPanel.setLayout(null);
+
+ list = new List();
+ list.setBounds(0, 0, 509, 252);
+ contentPanel.add(list);
+ {
+ JPanel buttonPane = new JPanel();
+ buttonPane.setBounds(0, 423, 529, 33);
+ buttonPane.setBackground(SystemColor.menu);
+ buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
+ getContentPane().add(buttonPane);
+ {
+ JButton okButton = new JButton("Zur\u00FCck");
+ okButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent arg0) {
+ ActionChooser ac=new ActionChooser();
+ ac.setVisible(true);
+ dispose();
+ }
+ });
+ okButton.setActionCommand("OK");
+ buttonPane.add(okButton);
+ getRootPane().setDefaultButton(okButton);
+ }
+ {
+ JButton cancelButton = new JButton("Weiter");
+ cancelButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent arg0) {
+ getVMwarePlayer vp=new getVMwarePlayer();
+ vp.setVisible(true);
+ dispose();
+ }
+ });
+ cancelButton.setActionCommand("Cancel");
+ buttonPane.add(cancelButton);
+ }
+ }
+
+ JButton btnDownload = new JButton("Download");
+ btnDownload.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent arg0) {
+ FTPDownloader ftp=new FTPDownloader(list.getItem(list.getSelectedIndex()).toString());
+ ftp.setVisible(true);
+ }
+ });
+ btnDownload.setBounds(430, 376, 89, 23);
+ getContentPane().add(btnDownload);
+
+ textFieldsearch = new JTextField();
+ textFieldsearch.addKeyListener(new KeyAdapter() {
+ @Override
+ public void keyReleased(KeyEvent arg0) {
+ System.out.println(textFieldsearch.getText().toString());
+
+ try {
+ result=f.getAllRohling(textFieldsearch.getText().toString());
+ } catch (SocketException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ list.removeAll();
+ for(int i=0;i<result.length;i++)
+ {
+ if(result[i]!=null)
+ list.add(result[i]);
+
+ }
+ }
+ });
+ textFieldsearch.setBounds(10, 92, 166, 20);
+ getContentPane().add(textFieldsearch);
+ textFieldsearch.setColumns(10);
+
+ JSeparator separator = new JSeparator();
+ separator.setBounds(0, 410, 529, 2);
+ getContentPane().add(separator);
+
+ JSeparator separator_1 = new JSeparator();
+ separator_1.setBounds(0, 82, 529, 2);
+ getContentPane().add(separator_1);
+
+ JMenuBar menuBar = new JMenuBar();
+ setJMenuBar(menuBar);
+
+ JMenu mnNewMenu = new JMenu("Suche");
+ menuBar.add(mnNewMenu);
+
+ JMenuItem mntmVlSuche = new JMenuItem("VL Suche");
+ mnNewMenu.add(mntmVlSuche);
+
+ JMenu mnNewMenu_1 = new JMenu("Hilfe");
+ menuBar.add(mnNewMenu_1);
+
+ JMenuItem mntmFaq = new JMenuItem("FAQ");
+ mnNewMenu_1.add(mntmFaq);
+
+ JMenuItem mntmOtrs = new JMenuItem("OTRS");
+ mnNewMenu_1.add(mntmOtrs);
+
+try {
+
+ result=f.getAllRohling(textFieldsearch.getText().toString());
+ list.removeAll();
+ for(int i=0;i<result.length;i++)
+ {
+
+ list.add(result[i]);
+ }
+ } catch (SocketException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+
+ }
+}
diff --git a/Dozentenmodul/src/Jsch/scriptExecutor.java b/Dozentenmodul/src/Jsch/scriptExecutor.java
new file mode 100644
index 00000000..4d7b8f17
--- /dev/null
+++ b/Dozentenmodul/src/Jsch/scriptExecutor.java
@@ -0,0 +1,63 @@
+package Jsch;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.Properties;
+
+import com.jcraft.jsch.Channel;
+import com.jcraft.jsch.ChannelExec;
+import com.jcraft.jsch.JSch;
+import com.jcraft.jsch.JSchException;
+import com.jcraft.jsch.Session;
+
+public class scriptExecutor {
+
+ /**
+ * @param args
+ */
+ public static void main(String[] args) {
+ // TODO Auto-generated method stub
+ executeScript();
+ }
+
+ public static void executeScript()
+ {
+ JSch j=new JSch();
+
+ try {
+ Session se=j.getSession("root", "141.79.128.121", 22);
+
+ Properties config = new Properties();
+ config.setProperty("StrictHostKeyChecking", "no");
+ se.setConfig(config);
+ se.setPassword("!N4ye,04u.");
+ se.connect();
+ ChannelExec ch=(ChannelExec) se.openChannel("exec");
+ InputStream is=ch.getInputStream();
+
+ ch.setCommand("sh /home/openslx/hello.sh 'test'");
+ //ch.setCommand("ls");
+ ch.connect();
+
+ BufferedReader reader = new BufferedReader(new InputStreamReader(is));
+ String line;
+ int index = 0;
+
+ while ((line = reader.readLine()) != null)
+ {
+ System.out.println(++index + " : " + line);
+ }
+
+ ch.disconnect();
+ se.disconnect();
+
+ System.out.println("Done!");
+ } catch (JSchException | IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+}
diff --git a/Dozentenmodul/src/Models/person.java b/Dozentenmodul/src/Models/person.java
new file mode 100644
index 00000000..884bb96d
--- /dev/null
+++ b/Dozentenmodul/src/Models/person.java
@@ -0,0 +1,61 @@
+package Models;
+
+public class person {
+
+ private String Name;
+ private String Vorname;
+ private String Hochschule;
+ private String EMail;
+ private String Tel;
+ private String Fakultät;
+ private boolean ischecked;
+
+
+ public static person verantowrtlicher=new person();
+ public static person ersteller=new person();
+
+ public String getName() {
+ return Name;
+ }
+ public void setName(String name) {
+ Name = name;
+ }
+ public String getVorname() {
+ return Vorname;
+ }
+ public void setVorname(String vorname) {
+ Vorname = vorname;
+ }
+ public String getHochschule() {
+ return Hochschule;
+ }
+ public void setHochschule(String hochschule) {
+ Hochschule = hochschule;
+ }
+ public String getEMail() {
+ return EMail;
+ }
+ public void setEMail(String eMail) {
+ EMail = eMail;
+ }
+ public String getTel() {
+ return Tel;
+ }
+ public void setTel(String tel) {
+ Tel = tel;
+ }
+ public String getFakultät() {
+ return Fakultät;
+ }
+ public void setFakultät(String fakultät) {
+ Fakultät = fakultät;
+ }
+ public boolean isIschecked() {
+ return ischecked;
+ }
+ public void setIschecked(boolean ischecked) {
+ this.ischecked = ischecked;
+ }
+
+
+}
diff --git a/Dozentenmodul/src/Models/vm.java b/Dozentenmodul/src/Models/vm.java
new file mode 100644
index 00000000..bfe81c29
--- /dev/null
+++ b/Dozentenmodul/src/Models/vm.java
@@ -0,0 +1,69 @@
+package Models;
+
+import java.awt.List;
+import java.util.Date;
+
+
+public class vm {
+
+ private String Laborname;
+ private String shortDesc;
+ private String longDesc;
+ private String comment;
+ private String OS;
+ private Date begin;
+ private Date end;
+ private List software;
+
+ public static vm vl=new vm();
+ public String getLaborname() {
+ return Laborname;
+ }
+ public void setLaborname(String laborname) {
+ Laborname = laborname;
+ }
+ public String getShortDesc() {
+ return shortDesc;
+ }
+ public void setShortDesc(String shortDesc) {
+ this.shortDesc = shortDesc;
+ }
+ public String getLongDesc() {
+ return longDesc;
+ }
+ public void setLongDesc(String longDesc) {
+ this.longDesc = longDesc;
+ }
+ public String getComment() {
+ return comment;
+ }
+ public void setComment(String comment) {
+ this.comment = comment;
+ }
+ public String getOS() {
+ return OS;
+ }
+ public void setOS(String oS) {
+ OS = oS;
+ }
+ public Date getBegin() {
+ return begin;
+ }
+ public void setBegin(Date begin) {
+ this.begin = begin;
+ }
+ public Date getEnd() {
+ return end;
+ }
+ public void setEnd(Date end) {
+ this.end = end;
+ }
+ public List getSoftware() {
+ return software;
+ }
+ public void setSoftware(List software) {
+ this.software = software;
+ }
+
+
+}
diff --git a/Dozentenmodul/src/auth/Ldap.java b/Dozentenmodul/src/auth/Ldap.java
index a71d4389..b50bfeaa 100644
--- a/Dozentenmodul/src/auth/Ldap.java
+++ b/Dozentenmodul/src/auth/Ldap.java
@@ -7,6 +7,7 @@ import javax.naming.Context;
import javax.naming.NamingException;
import javax.naming.directory.DirContext;
import javax.naming.directory.InitialDirContext;
+import javax.swing.JOptionPane;
public class Ldap {
@@ -35,7 +36,9 @@ public class Ldap {
} catch (NamingException ex) {
userok=false;
//user hat keine Zugriffsrechte
-
+ JOptionPane.showMessageDialog(null,
+ ex.toString(), "Message",
+ JOptionPane.INFORMATION_MESSAGE);
Logger.getLogger(Ldap.class.getName()).log(Level.SEVERE, null, ex);
}
return userok;
diff --git a/Dozentenmodul/src/downloader/DownloadTask.java b/Dozentenmodul/src/downloader/DownloadTask.java
new file mode 100644
index 00000000..cf04f387
--- /dev/null
+++ b/Dozentenmodul/src/downloader/DownloadTask.java
@@ -0,0 +1,105 @@
+package downloader;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+
+import javax.swing.JOptionPane;
+import javax.swing.SwingWorker;
+import GUI.FTPDownloader;
+
+/**
+ * Execute file download in a background thread and update the progress.
+ * @author www.codejava.net
+ *
+ */
+public class DownloadTask extends SwingWorker<Void, Void> {
+
+ private static final int BUFFER_SIZE = 4096;
+
+ private String host;
+ private int port;
+ private String username;
+ private String password;
+
+ private String downloadPath;
+ private String saveDir;
+
+ @SuppressWarnings("unused")
+ private FTPDownloader gui;
+
+ public DownloadTask(String host, int port, String username,
+ String password, String downloadPath, String saveDir,
+ FTPDownloader gui) {
+ this.host = host;
+ this.port = port;
+ this.username = username;
+ this.password = password;
+ this.downloadPath = downloadPath;
+ this.saveDir = saveDir;
+ this.gui = gui;
+
+ }
+
+ /**
+ * Executed in background thread
+ */
+ @Override
+ protected Void doInBackground() throws Exception {
+ FTPUtility util = new FTPUtility(host, port, username, password);
+ try {
+ util.connect();
+
+ byte[] buffer = new byte[BUFFER_SIZE];
+ int bytesRead = -1;
+ long totalBytesRead = 0;
+ int percentCompleted = 0;
+
+ long fileSize = util.getFileSize(downloadPath);
+ //gui.setFileSize(fileSize);
+
+ String fileName = new File(downloadPath).getName();
+
+ File downloadFile = new File(saveDir + File.separator + fileName);
+ FileOutputStream outputStream = new FileOutputStream(downloadFile);
+
+ util.downloadFile(downloadPath);
+ InputStream inputStream = util.getInputStream();
+
+ while ((bytesRead = inputStream.read(buffer)) != -1) {
+ outputStream.write(buffer, 0, bytesRead);
+ totalBytesRead += bytesRead;
+ //System.out.println(totalBytesRead);
+ percentCompleted = (int) (totalBytesRead * 100 / fileSize);
+ setProgress(percentCompleted);
+
+ }
+
+ outputStream.close();
+
+ util.finish();
+ } catch (FTPException ex) {
+ JOptionPane.showMessageDialog(null, "Error downloading file: " + ex.getMessage(),
+ "Error", JOptionPane.ERROR_MESSAGE);
+ ex.printStackTrace();
+ setProgress(0);
+ cancel(true);
+ } finally {
+ util.disconnect();
+ }
+
+ return null;
+ }
+
+ /**
+ * Executed in Swing's event dispatching thread
+ */
+ @Override
+ protected void done() {
+ if (!isCancelled()) {
+ JOptionPane.showMessageDialog(null,
+ "File has been downloaded successfully!", "Message",
+ JOptionPane.INFORMATION_MESSAGE);
+ }
+ }
+} \ No newline at end of file
diff --git a/Dozentenmodul/src/downloader/FTPException.java b/Dozentenmodul/src/downloader/FTPException.java
new file mode 100644
index 00000000..33ba32be
--- /dev/null
+++ b/Dozentenmodul/src/downloader/FTPException.java
@@ -0,0 +1,8 @@
+package downloader;
+
+@SuppressWarnings("serial")
+public class FTPException extends Exception {
+ public FTPException(String message) {
+ super(message);
+ }
+} \ No newline at end of file
diff --git a/Dozentenmodul/src/downloader/FTPUtility.java b/Dozentenmodul/src/downloader/FTPUtility.java
new file mode 100644
index 00000000..dd0bd9ed
--- /dev/null
+++ b/Dozentenmodul/src/downloader/FTPUtility.java
@@ -0,0 +1,187 @@
+package downloader;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import org.apache.commons.net.ftp.FTP;
+import org.apache.commons.net.ftp.FTPClient;
+import org.apache.commons.net.ftp.FTPFile;
+import org.apache.commons.net.ftp.FTPReply;
+
+/**
+ * A utility class that provides functionality for downloading files from a FTP
+ * server.
+ *
+ * @author www.codejava.net
+ *
+ */
+public class FTPUtility {
+
+ // FTP server information
+ private String host;
+ private int port;
+ private String username;
+ private String password;
+
+ private FTPClient ftpClient = new FTPClient();
+ private int replyCode;
+
+ private InputStream inputStream;
+ private OutputStream outputStream;
+
+ public FTPUtility(String host, int port, String user, String pass) {
+ this.host = host;
+ this.port = port;
+ this.username = user;
+ this.password = pass;
+ }
+
+ /**
+ * Connect and login to the server.
+ *
+ * @throws FTPException
+ */
+ public void connect() throws FTPException {
+ try {
+ ftpClient.connect(host, port);
+ replyCode = ftpClient.getReplyCode();
+ if (!FTPReply.isPositiveCompletion(replyCode)) {
+ throw new FTPException("FTP serve refused connection.");
+ }
+
+ boolean logged = ftpClient.login(username, password);
+ if (!logged) {
+ // failed to login
+ ftpClient.disconnect();
+ throw new FTPException("Could not login to the server.");
+ }
+
+ ftpClient.enterLocalPassiveMode();
+
+ } catch (IOException ex) {
+ throw new FTPException("I/O error: " + ex.getMessage());
+ }
+ }
+
+ /**
+ * Gets size (in bytes) of the file on the server.
+ *
+ * @param filePath
+ * Path of the file on server
+ * @return file size in bytes
+ * @throws FTPException
+ */
+ public long getFileSize(String filePath) throws FTPException {
+ try {
+ FTPFile file = ftpClient.mlistFile(filePath);
+ if (file == null) {
+ throw new FTPException("The file may not exist on the server!");
+ }
+ return file.getSize();
+ } catch (IOException ex) {
+ throw new FTPException("Could not determine size of the file: "
+ + ex.getMessage());
+ }
+ }
+
+ /**
+ * Start downloading a file from the server
+ *
+ * @param downloadPath
+ * Full path of the file on the server
+ * @throws FTPException
+ * if client-server communication error occurred
+ */
+ public void downloadFile(String downloadPath) throws FTPException {
+ try {
+
+ boolean success = ftpClient.setFileType(FTP.BINARY_FILE_TYPE);
+ if (!success) {
+ throw new FTPException("Could not set binary file type.");
+ }
+
+ inputStream = ftpClient.retrieveFileStream(downloadPath);
+
+ if (inputStream == null) {
+ throw new FTPException(
+ "Could not open input stream. The file may not exist on the server.");
+ }
+ } catch (IOException ex) {
+ throw new FTPException("Error downloading file: " + ex.getMessage());
+ }
+ }
+
+
+ /**
+ * Start uploading a file to the server
+ * @param uploadFile the file to be uploaded
+ * @param destDir destination directory on the server
+ * where the file is stored
+ * @throws FTPException if client-server communication error occurred
+ */
+ public void uploadFile(File uploadFile, String destDir) throws FTPException {
+ try {
+ boolean success = ftpClient.changeWorkingDirectory(destDir);
+ if (!success) {
+ throw new FTPException("Could not change working directory to "
+ + destDir + ". The directory may not exist.");
+ }
+
+ success = ftpClient.setFileType(FTP.BINARY_FILE_TYPE);
+ if (!success) {
+ throw new FTPException("Could not set binary file type.");
+ }
+
+ outputStream = ftpClient.storeFileStream(uploadFile.getName());
+
+ } catch (IOException ex) {
+ throw new FTPException("Error uploading file: " + ex.getMessage());
+ }
+ }
+
+ /**
+ * Write an array of bytes to the output stream.
+ */
+ public void writeFileBytes(byte[] bytes, int offset, int length)
+ throws IOException {
+ outputStream.write(bytes, offset, length);
+ }
+
+ /**
+ * Complete the download operation.
+ */
+ public void finish() throws IOException {
+ inputStream.close();
+ ftpClient.completePendingCommand();
+ }
+
+ /**
+ * Log out and disconnect from the server
+ */
+ public void disconnect() throws FTPException {
+ if (ftpClient.isConnected()) {
+ try {
+ if (!ftpClient.logout()) {
+ throw new FTPException("Could not log out from the server");
+ }
+ ftpClient.disconnect();
+ } catch (IOException ex) {
+ throw new FTPException("Error disconnect from the server: "
+ + ex.getMessage());
+ }
+ }
+ }
+
+ /**
+ * Return InputStream of the remote file on the server.
+ */
+ public InputStream getInputStream() {
+ return inputStream;
+ }
+
+ public OutputStream getOutputStream() {
+ return outputStream;
+ }
+} \ No newline at end of file
diff --git a/Dozentenmodul/src/downloader/UploadTask.java b/Dozentenmodul/src/downloader/UploadTask.java
new file mode 100644
index 00000000..691a31bb
--- /dev/null
+++ b/Dozentenmodul/src/downloader/UploadTask.java
@@ -0,0 +1,91 @@
+package downloader;
+
+import java.io.File;
+import java.io.FileInputStream;
+
+import javax.swing.JOptionPane;
+import javax.swing.SwingWorker;
+
+/**
+ * Executes the file upload in a background thread and updates progress to
+ * listeners that implement the java.beans.PropertyChangeListener interface.
+ * @author www.codejava.net
+ *
+ */
+public class UploadTask extends SwingWorker<Void, Void> {
+ private static final int BUFFER_SIZE = 4096;
+
+ private String host;
+ private int port;
+ private String username;
+ private String password;
+
+ private String destDir;
+ private File uploadFile;
+
+ public UploadTask(String host, int port, String username, String password,
+ String destDir, File uploadFile) {
+ this.host = host;
+ this.port = port;
+ this.username = username;
+ this.password = password;
+ this.destDir = destDir;
+ this.uploadFile = uploadFile;
+ }
+
+ /**
+ * Executed in background thread
+ */
+ @Override
+ protected Void doInBackground() throws Exception {
+ FTPUtility util = new FTPUtility(host, port, username, password);
+ try {
+ util.connect();
+ util.uploadFile(uploadFile, destDir);
+
+ FileInputStream inputStream = new FileInputStream(uploadFile);
+ byte[] buffer = new byte[BUFFER_SIZE];
+ int bytesRead = -1;
+ long totalBytesRead = 0;
+ int percentCompleted = 0;
+ long fileSize = uploadFile.length();
+ long start=System.nanoTime();
+ final double NANOS_PER_SECOND = 1000000000.0;
+ final double BYTES_PER_MIB = 1024*1024;
+ while ((bytesRead = inputStream.read(buffer)) != -1) {
+ util.writeFileBytes(buffer, 0, bytesRead);
+ totalBytesRead += bytesRead;
+ percentCompleted = (int) (totalBytesRead * 100 / fileSize);
+ double speed = NANOS_PER_SECOND / BYTES_PER_MIB * totalBytesRead / (System.nanoTime() - start + 1);
+ setProgress(percentCompleted);
+ firePropertyChange("speed", 0, speed);
+ }
+
+ inputStream.close();
+
+ util.finish();
+ } catch (FTPException ex) {
+ JOptionPane.showMessageDialog(null, "Error uploading file: " + ex.getMessage(),
+ "Error", JOptionPane.ERROR_MESSAGE);
+ ex.printStackTrace();
+ setProgress(0);
+ cancel(true);
+ } finally {
+ util.disconnect();
+ }
+
+ return null;
+ }
+
+ /**
+ * Executed in Swing's event dispatching thread
+ */
+ @Override
+ protected void done() {
+ if (!isCancelled()) {
+ JOptionPane.showMessageDialog(null,
+ "File has been uploaded successfully!", "Message",
+ JOptionPane.INFORMATION_MESSAGE);
+ }
+ }
+} \ No newline at end of file
diff --git a/Dozentenmodul/src/downloader/jschtest.java b/Dozentenmodul/src/downloader/jschtest.java
new file mode 100644
index 00000000..83be7e03
--- /dev/null
+++ b/Dozentenmodul/src/downloader/jschtest.java
@@ -0,0 +1,84 @@
+package downloader;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.util.Properties;
+
+import com.jcraft.jsch.ChannelSftp;
+import com.jcraft.jsch.JSch;
+import com.jcraft.jsch.JSchException;
+import com.jcraft.jsch.Session;
+import com.jcraft.jsch.SftpException;
+import com.jcraft.jsch.UserInfo;
+
+public class jschtest {
+
+ /**
+ * @param args
+ */
+ public static void main(String[] args) {
+ File testfile=new File("C:\\Users\\tspitzer\\Documents\\201301_ws_win7_OPT_Apps_NC_Off2010.zip");
+ try {
+ sftpFile(testfile, "fr-bwlehrpool-rw-admin" , "fefobu36", "bwsonas.lsdf.kit.edu", "/.mounts/bwlehrpool");
+ } catch (FileNotFoundException | JSchException | SftpException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ System.out.println("Fertig");
+
+ }
+
+ private static void sftpFile(File localFile, String username, String password, String hostname, String remoteDirectory)
+ throws JSchException, SftpException, FileNotFoundException {
+
+ JSch jsch = new JSch();
+ String filename = localFile.getName();
+ Session session = jsch.getSession(username, hostname, 22);
+ session.setUserInfo(new HardcodedUserInfo(password));
+ Properties config = new Properties();
+ config.setProperty("StrictHostKeyChecking", "no");
+ session.setConfig(config);
+ session.connect();
+ ChannelSftp channel = (ChannelSftp)session.openChannel("sftp");
+ channel.connect();
+ channel.cd(remoteDirectory);
+ channel.put(new FileInputStream(localFile), filename);
+ channel.disconnect();
+ session.disconnect();
+ }
+
+ private static class HardcodedUserInfo implements UserInfo {
+
+ private final String password;
+
+ private HardcodedUserInfo(String password) {
+ this.password = password;
+ }
+
+ public String getPassphrase() {
+ return null;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+ public boolean promptPassword(String s) {
+ return true;
+ }
+
+ public boolean promptPassphrase(String s) {
+ return true;
+ }
+
+ public boolean promptYesNo(String s) {
+ return true;
+ }
+
+ public void showMessage(String s) {
+ System.out.println("message = " + s);
+ }
+ }
+
+}
diff --git a/Dozentenmodul/src/sql/sql.java b/Dozentenmodul/src/sql/sql.java
new file mode 100644
index 00000000..dade6b1e
--- /dev/null
+++ b/Dozentenmodul/src/sql/sql.java
@@ -0,0 +1,179 @@
+package sql;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+
+
+public class sql {
+
+ //Erstellt eine Verbindung zu einer Datenbank
+ public Connection getConnection()
+ {
+ try {
+ Class.forName("com.mysql.jdbc.Driver").newInstance();
+ } catch (InstantiationException | IllegalAccessException
+ | ClassNotFoundException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ try {
+ Connection con=DriverManager.getConnection("jdbc:mysql://127.0.0.1/bwLehrpool?user=root&password=root");
+ return con;
+ } catch (SQLException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ //Liefert alle vorhandenen Betriebssysteme zurück
+ public ResultSet getAllOS(Connection con)
+ {
+ Statement stm;
+ try {
+ stm = con.createStatement();
+ return stm.executeQuery("SELECT distinct Produktname, Version, Architektur FROM bwlehrpool.betriebssystem order by Produktname asc;");
+ } catch (SQLException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ //Fügt ein Betriebssystem in die Datenbank ein
+ public int AddOS(Connection con, String name, String Version, String Architektur,int Kosten, String Hersteller)
+ {
+ Statement stm;
+ try {
+ stm=con.createStatement();
+
+ int pk_Hersteller=HerstellerExists(con, Hersteller);
+
+ if(pk_Hersteller==-1)
+ {
+ addHersteller(con, Hersteller);
+ }
+ int ret=stm.executeUpdate("INSERT INTO `bwlehrpool`.`betriebssystem`(`Produktname`,`Version`,`Architektur`,`IstKostenlos`,`SWHersteller_pk`)VALUES('"+name+"','"+Version+"','"+Architektur+"',"+Kosten+","+pk_Hersteller+");");
+ return ret;
+ } catch (SQLException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return -1;
+
+ }
+
+ //Überprüft ob der angegebene Hersteller bereits exisitert
+ public int HerstellerExists(Connection con, String Hersteller)
+ {
+ int pk_Hersteller=-1;
+ try {
+ ResultSet rs=getAllHersteller(con);
+ while(rs.next())
+ {
+ if(rs.getString("Name").equals(Hersteller))
+ {
+ pk_Hersteller=Integer.parseInt(rs.getString("pk"));
+ }
+ }
+ } catch (SQLException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return pk_Hersteller;
+ }
+
+ //Liefert alle vorhandenen Hersteller zurück
+ public ResultSet getAllHersteller(Connection con)
+ {
+ try {
+ Statement stm=con.createStatement();
+ return stm.executeQuery("SELECT pk,Name FROM bwLehrpool.SWHersteller order by Name asc;");
+ } catch (SQLException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return null;
+ }
+ //Fügt einen Hersteller in die Datenbank ein
+ public int addHersteller(Connection con, String Name){
+ Statement stm;
+ int ret=-1;
+ try {
+ stm=con.createStatement();
+ ret=stm.executeUpdate("INSERT INTO `bwlehrpool`.`swhersteller`(`Name`)VALUES('"+Name+"');");
+ con.commit();
+ } catch (SQLException e) {
+ // TODO Auto-generated catch block
+
+ e.printStackTrace();
+ }
+ return ret;
+ }
+
+ //Liefert sämtliche in der Datenbank vorhandene Software zurück
+ public ResultSet getAllSoftware(Connection con, String Hersteller)
+ {
+
+ try {
+ Statement stm=con.createStatement();
+
+ return stm.executeQuery("SELECT s.pk,s.Produktname, s.Version, s.Architektur FROM bwLehrpool.Software s left join bwLehrpool.SWHersteller h on s.SWHersteller_pk=h.pk where Name like '"+Hersteller+"' order by s.Produktname;");
+
+
+ } catch (SQLException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+
+ return null;
+
+ }
+
+ //Gibt die Software abhängig vom gesuchten Namen zurück
+ public ResultSet getSoftwareByName(Connection con, String Name)
+ {
+
+ try {
+ Statement stm=con.createStatement();
+
+ return stm.executeQuery("SELECT concat(h.Name,' ',s.Produktname,' ',s.Version,' ',s.Architektur) as SW FROM bwLehrpool.Software s left join bwLehrpool.SWHersteller h on s.SWHersteller_pk=h.pk where concat(h.Name,' ',s.Produktname,' ',s.Version,' ',s.Architektur) like '%"+Name+"%' order by s.Produktname;");
+
+
+ } catch (SQLException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+
+ return null;
+
+ }
+
+ //Fügt eine Software in die Datenbank ein
+ public int AddSoftware(Connection con, String name, String Version, String Architektur,int Kosten, String Hersteller)
+ {
+ Statement stm;
+ try {
+ stm=con.createStatement();
+
+ int pk_Hersteller=HerstellerExists(con, Hersteller);
+
+ if(pk_Hersteller==-1)
+ {
+ addHersteller(con, Hersteller);
+ }
+ int ret=stm.executeUpdate("INSERT INTO `bwlehrpool`.`software`(`Produktname`,`Version`,`Architektur`,`IstKostenlos`,`SWHersteller_pk`)VALUES('"+name+"','"+Version+"','"+Architektur+"',"+Kosten+","+pk_Hersteller+");");
+ return ret;
+ } catch (SQLException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return -1;
+
+ }
+
+}