diff options
| author | unknown | 2014-05-08 13:59:31 +0200 |
|---|---|---|
| committer | unknown | 2014-05-08 13:59:31 +0200 |
| commit | ea2bbcbaa29508d11404a31b2c17380edc38f80a (patch) | |
| tree | 275929ef8da853da76e62ad1780ef233aadf0120 /Dozentenmodul/src/gui | |
| parent | FAQ & OTRS (diff) | |
| parent | -Kopieren von Temp zu Prod inkl. änderung des Pfades in SQL-DB (diff) | |
| download | tutor-module-ea2bbcbaa29508d11404a31b2c17380edc38f80a.tar.gz tutor-module-ea2bbcbaa29508d11404a31b2c17380edc38f80a.tar.xz tutor-module-ea2bbcbaa29508d11404a31b2c17380edc38f80a.zip | |
Merge branch 'master' of ssh://git.openslx.org/openslx-ng/tutor-module
Conflicts:
Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI$6.class
Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI$7.class
Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI$8.class
Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI.class
Dozentenmodul/bin/gui/image/FTPEditUploader_GUI$1.class
Dozentenmodul/bin/gui/image/FTPEditUploader_GUI$2.class
Dozentenmodul/bin/gui/image/FTPEditUploader_GUI$3.class
Dozentenmodul/bin/gui/image/FTPEditUploader_GUI$4.class
Dozentenmodul/bin/gui/image/FTPEditUploader_GUI$5.class
Dozentenmodul/bin/gui/image/FTPEditUploader_GUI$6.class
Dozentenmodul/bin/gui/image/FTPEditUploader_GUI.class
Dozentenmodul/bin/gui/lecture/EditLectureAllgemein_GUI$3.class
Dozentenmodul/bin/gui/lecture/EditLectureAllgemein_GUI$4.class
Dozentenmodul/bin/gui/lecture/EditLectureAllgemein_GUI.class
Diffstat (limited to 'Dozentenmodul/src/gui')
6 files changed, 38 insertions, 52 deletions
diff --git a/Dozentenmodul/src/gui/image/EditImageAllgemein_GUI.java b/Dozentenmodul/src/gui/image/EditImageAllgemein_GUI.java index 8e928105..6725850b 100644 --- a/Dozentenmodul/src/gui/image/EditImageAllgemein_GUI.java +++ b/Dozentenmodul/src/gui/image/EditImageAllgemein_GUI.java @@ -285,7 +285,7 @@ public class EditImageAllgemein_GUI extends JFrame { } else { // setze Namen, egal ob alt oder nicht - Image.image.setNewName(imagename.getText()); + Image.image.setImagename(imagename.getText()); System.out.println("Changing name to:" + imagename.getText()+ "\nNewName is: "+Image.image.getNewName()); con.closeThriftConnection(); diff --git a/Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java b/Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java index 13c83d61..3a78e322 100644 --- a/Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java +++ b/Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java @@ -300,26 +300,6 @@ public class FTPCreateUploader_GUI extends JFrame implements separator_1.setBounds(0, 627, 597, 2); contentPanel.add(separator_1); - JButton btnCopyFileTo = new JButton("Copy File to Prod"); - btnCopyFileTo.setEnabled(false); - btnCopyFileTo.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - try { - System.out.println("Copying file to " + user.path + "/" - + uploadFile.getName()); - client.startFileCopy(user.path + "/" + uploadFile.getName()); - } catch (TException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - JOptionPane.showMessageDialog(null, - e1.getCause()+"\n"+e1.getMessage(), - "Debug-Message", JOptionPane.ERROR_MESSAGE); - } - } - }); - btnCopyFileTo.setBounds(102, 375, 173, 23); - contentPanel.add(btnCopyFileTo); - JLabel lblSchritt_1 = new JLabel("Schritt 1:"); lblSchritt_1.setBounds(24, 128, 57, 14); contentPanel.add(lblSchritt_1); @@ -447,7 +427,7 @@ public class FTPCreateUploader_GUI extends JFrame implements + person.verantwortlicher.getUsername() + "_" + Image.image.getImagename() + ".vmdk"); task = new UploadTask(host, port, user.userName, user.password, - user.path, uploadFile); + user.path+"temp/", uploadFile); task.addPropertyChangeListener(this); task.execute(); @@ -473,8 +453,10 @@ public class FTPCreateUploader_GUI extends JFrame implements // Fertigstellen erlauben wenn upload abgeschlossen if (progress == 100) { finishButton.setEnabled(true); + } else { finishButton.setEnabled(false); + } } @@ -520,7 +502,7 @@ public class FTPCreateUploader_GUI extends JFrame implements public boolean writeData() { try { - + client.writeVLdata(Image.image.getImagename(), person.verantwortlicher.getUsername(), person.verantwortlicher.getVorname(), @@ -531,7 +513,8 @@ public class FTPCreateUploader_GUI extends JFrame implements person.verantwortlicher.getFakultät(), Image.image.isLicensed(), Image.image.isInternet(), Image.image.getRam(), Image.image.getCpu(), - "/srv/openslx/nfs/temp/" + Image.image.getNewName()); + "temp/" + Image.image.getNewName(),false,Image.image.getFilesize()); + client.startFileCopy(Image.image.getNewName()); } catch (TException e) { // TODO Auto-generated catch block e.printStackTrace(); diff --git a/Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java b/Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java index 8b14dc4c..68bd4bb1 100644 --- a/Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java +++ b/Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java @@ -76,7 +76,6 @@ public class FTPEditUploader_GUI extends JFrame implements Client client = thrift.getThriftConnection(); JButton btnUploadStarten = new JButton("Upload auf Server starten"); JButton btnSpeicherortAuswhlen = new JButton("Image ausw\u00E4hlen"); - JButton btnCopyFileTo = new JButton("Copy File to Prod"); JButton finishButton = new JButton("Fertigstellen"); JButton btnZurck = new JButton("Zur\u00FCck"); @@ -290,23 +289,6 @@ public class FTPEditUploader_GUI extends JFrame implements separator_1.setBounds(0, 627, 597, 2); contentPanel.add(separator_1); - btnCopyFileTo.setEnabled(false); - btnCopyFileTo.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - try { - client.startFileCopy(user.path + "/" + uploadFile.getName()); - } catch (TException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - JOptionPane.showMessageDialog(null, - e1.getCause()+"\n"+e1.getMessage(), - "Debug-Message", JOptionPane.ERROR_MESSAGE); - } - } - }); - btnCopyFileTo.setBounds(102, 375, 173, 23); - contentPanel.add(btnCopyFileTo); - JLabel lblSchritt_1 = new JLabel("Schritt 1:"); lblSchritt_1.setBounds(24, 128, 57, 14); contentPanel.add(lblSchritt_1); @@ -437,12 +419,13 @@ public class FTPEditUploader_GUI extends JFrame implements "Debug-Message", JOptionPane.ERROR_MESSAGE); } DateFormat formatter = new SimpleDateFormat("yyyMMddhhmmss"); + Image.image.setNewName(formatter.format(new Date()) + "_" + person.verantwortlicher.getHochschule() + "_" + person.verantwortlicher.getUsername() + "_" - + Image.image.getImagename() + ".vmdk"); + + Image.image.getImagename()+ ".vmdk"); task = new UploadTask(host, port, user.userName, user.password, - user.path, uploadFile); + user.path+"temp/", uploadFile); task.addPropertyChangeListener(this); task.execute(); @@ -514,11 +497,13 @@ public class FTPEditUploader_GUI extends JFrame implements try { System.out.println("NewName="+Image.image.getNewName()); + System.out.println("OldName="+Image.image.getImagename()); client.updateImageData(Image.image.getImagename(), - Image.image.getNewName(), Image.image.isLicensed(), + Image.image.getImagename(),"temp/" + Image.image.getNewName(), Image.image.isLicensed(), Image.image.isInternet(), Image.image.getRam(), Image.image.getCpu(), Image.image.getImageId(), - Image.image.getVersion()); + Image.image.getVersion(), false,Image.image.getFilesize()); + client.startFileCopy(Image.image.getNewName()); } catch (TException e) { // TODO Auto-generated catch block e.printStackTrace(); diff --git a/Dozentenmodul/src/gui/intro/Login_GUI.java b/Dozentenmodul/src/gui/intro/Login_GUI.java index 019a2ec7..75320b58 100644 --- a/Dozentenmodul/src/gui/intro/Login_GUI.java +++ b/Dozentenmodul/src/gui/intro/Login_GUI.java @@ -12,6 +12,8 @@ import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.io.File; import java.io.IOException; +import java.util.UUID; + import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JFrame; @@ -89,6 +91,7 @@ public class Login_GUI extends JFrame { // Fenster darf nicht vergrößert werden setResizable(false); + try { // Setzt das Look and Feel auf System UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); @@ -213,12 +216,14 @@ public class Login_GUI extends JFrame { + ", mein Token für den Satelliten " + result.authToken); + /* // show received information JOptionPane.showMessageDialog(null, "Freiburg liefert:" + "\nSession-ID = " + result.sessionId + "\nToken = " + result.authToken + "\nSatellit = " + result.serverAddress, "Rückgabewerte aus Freiburg", JOptionPane.INFORMATION_MESSAGE); + */ if (login == true) { /* @@ -248,6 +253,7 @@ public class Login_GUI extends JFrame { person.verantwortlicher.setEMail(user.eMail); person.verantwortlicher.setHochschule(hochschule); + /* // show processed information JOptionPane .showMessageDialog( @@ -289,6 +295,7 @@ public class Login_GUI extends JFrame { .getEMail(), "Werte vergleichen", JOptionPane.INFORMATION_MESSAGE); + */ try { //Lege config File an und entscheide welches Fenster als nächstes geöffnet wird diff --git a/Dozentenmodul/src/gui/lecture/EditLectureAllgemein_GUI.java b/Dozentenmodul/src/gui/lecture/EditLectureAllgemein_GUI.java index 0be23ee0..cab588d9 100644 --- a/Dozentenmodul/src/gui/lecture/EditLectureAllgemein_GUI.java +++ b/Dozentenmodul/src/gui/lecture/EditLectureAllgemein_GUI.java @@ -245,6 +245,7 @@ public class EditLectureAllgemein_GUI extends JFrame { panel_2.add(textFieldLaborname); JTextArea textArea = new JTextArea(); + textArea.setEditable(false); textArea.setWrapStyleWord(true); textArea.setText("Geben Sie bitte einen sprechenden Namen f\u00FCr das Image an. Dieser soll jedoch recht allgemein gehalten werden.\r\nBeispiel: \"Programmieren\", nicht \"Programmieren 1\""); textArea.setLineWrap(true); @@ -261,6 +262,7 @@ public class EditLectureAllgemein_GUI extends JFrame { scrollPane.setBounds(200, 104, 347, 78); panel_2.add(scrollPane); description = new JTextArea(); + description.setFont(new Font("Tahoma", Font.PLAIN, 11)); description.setText(Lecture.lecture.getDesc()); description.setLineWrap(true); scrollPane.add(description); diff --git a/Dozentenmodul/src/gui/lecture/EditLectureLink_GUI.java b/Dozentenmodul/src/gui/lecture/EditLectureLink_GUI.java index 28447e0d..bd69a2ac 100644 --- a/Dozentenmodul/src/gui/lecture/EditLectureLink_GUI.java +++ b/Dozentenmodul/src/gui/lecture/EditLectureLink_GUI.java @@ -118,8 +118,7 @@ public class EditLectureLink_GUI extends JFrame { getContentPane().add(panel); panel.setLayout(null); { - JLabel lblNewLabel = new JLabel( - "Image verlinken"); + JLabel lblNewLabel = new JLabel("Image verlinken"); lblNewLabel.setBounds(10, 11, 509, 22); panel.add(lblNewLabel); lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18)); @@ -374,9 +373,11 @@ public class EditLectureLink_GUI extends JFrame { .toString(); try { - - DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - client.updateLecturedata(Lecture.lecture.getName(), + + DateFormat formatter = new SimpleDateFormat( + "yyyy-MM-dd hh:mm:ss"); + client.updateLecturedata( + Lecture.lecture.getName(), Lecture.lecture.getNewName(), Lecture.lecture.getShortDesc(), Lecture.lecture.getDesc(), @@ -395,7 +396,14 @@ public class EditLectureLink_GUI extends JFrame { person.verantwortlicher.getTel(), person.verantwortlicher.getFakultät(), Lecture.lecture.getid()); - + + JOptionPane + .showMessageDialog( + null, + "Ihre Veranstaltung wurde erfolgreich angelegt. Sie kehren nun zum Hauptmenü zurück.", + "Veranstaltung angelegt", + JOptionPane.INFORMATION_MESSAGE); + } catch (TException e1) { // TODO Auto-generated catch block e1.printStackTrace(); @@ -409,6 +417,7 @@ public class EditLectureLink_GUI extends JFrame { JOptionPane.INFORMATION_MESSAGE); } + thrift.closeThriftConnection(); MainMenue_GUI m = new MainMenue_GUI(); m.setVisible(true); dispose(); |
