summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Bauer2014-09-10 14:54:40 +0200
committerJonathan Bauer2014-09-10 14:54:40 +0200
commit61e8e600dd1c9d6066711dfb9874e0117b87baf6 (patch)
treec5321291edcc9286fbe75f1cbf1a0548fb78da1d
parentMerge branch 'maven' of git.openslx.org:openslx-ng/tutor-module into maven (diff)
downloadtutor-module-61e8e600dd1c9d6066711dfb9874e0117b87baf6.tar.gz
tutor-module-61e8e600dd1c9d6066711dfb9874e0117b87baf6.tar.xz
tutor-module-61e8e600dd1c9d6066711dfb9874e0117b87baf6.zip
mavenization v2
-rw-r--r--Dozentenmodul/src/main/java/config/config_file.java19
-rw-r--r--Dozentenmodul/src/main/java/ftp/DownloadTask.java81
-rw-r--r--Dozentenmodul/src/main/java/ftp/FTPUtility.java86
-rw-r--r--Dozentenmodul/src/main/java/ftp/UploadTask.java178
-rw-r--r--Dozentenmodul/src/main/java/gui/image/CreateImageAllgemein_GUI.java249
-rw-r--r--Dozentenmodul/src/main/java/gui/image/CreateImageFreigabe_GUI.java12
-rw-r--r--Dozentenmodul/src/main/java/gui/image/CreateImageTechnisch_GUI.java164
-rw-r--r--Dozentenmodul/src/main/java/gui/image/DeleteImage_GUI.java857
-rw-r--r--Dozentenmodul/src/main/java/gui/image/EditImageAllgemein_GUI.java137
-rw-r--r--Dozentenmodul/src/main/java/gui/image/EditImageFreigabe_GUI.java14
-rw-r--r--Dozentenmodul/src/main/java/gui/image/EditImageTechnisch_GUI.java211
-rw-r--r--Dozentenmodul/src/main/java/gui/image/ExtendedSearchForImages_GUI.java278
-rw-r--r--Dozentenmodul/src/main/java/gui/image/FTPCreateUploader_GUI.java278
-rw-r--r--Dozentenmodul/src/main/java/gui/image/FTPEditDownloader_GUI.java (renamed from Dozentenmodul/src/main/java/gui/image/FTPDownloader_GUI.java)286
-rw-r--r--Dozentenmodul/src/main/java/gui/image/FTPEditUploader_GUI.java300
-rw-r--r--Dozentenmodul/src/main/java/gui/image/FTPSearchDownloader_GUI.java635
-rw-r--r--Dozentenmodul/src/main/java/gui/image/PermissionCreateImage_GUI.java552
-rw-r--r--Dozentenmodul/src/main/java/gui/image/PermissionEditImage_GUI.java504
-rw-r--r--Dozentenmodul/src/main/java/gui/image/SearchEditImage_GUI.java777
-rw-r--r--Dozentenmodul/src/main/java/gui/image/SearchImage_GUI.java1492
-rw-r--r--Dozentenmodul/src/main/java/gui/image/SearchMethodLecture_GUI.java290
-rw-r--r--Dozentenmodul/src/main/java/gui/intro/About_GUI.java8
-rw-r--r--Dozentenmodul/src/main/java/gui/intro/BillOfRights_GUI.java6
-rw-r--r--Dozentenmodul/src/main/java/gui/intro/Login_GUI.java172
-rw-r--r--Dozentenmodul/src/main/java/gui/intro/MainMenue_GUI.java212
-rw-r--r--Dozentenmodul/src/main/java/gui/intro/VmWareLink_GUI.java24
-rw-r--r--Dozentenmodul/src/main/java/gui/lecture/CreateLectureAllgemein_GUI.java116
-rw-r--r--Dozentenmodul/src/main/java/gui/lecture/CreateLectureLink_GUI.java733
-rw-r--r--Dozentenmodul/src/main/java/gui/lecture/DeleteLecture_GUI.java497
-rw-r--r--Dozentenmodul/src/main/java/gui/lecture/EditLectureAllgemein_GUI.java350
-rw-r--r--Dozentenmodul/src/main/java/gui/lecture/EditLectureLink_GUI.java760
-rw-r--r--Dozentenmodul/src/main/java/gui/lecture/EditLectureSearch_GUI.java647
-rw-r--r--Dozentenmodul/src/main/java/gui/lecture/ExtendedSearchForLectures_GUI.java269
-rw-r--r--Dozentenmodul/src/main/java/gui/lecture/PermissionCreateLecture_GUI.java546
-rw-r--r--Dozentenmodul/src/main/java/gui/lecture/PermissionEditLecture_GUI.java (renamed from Dozentenmodul/src/main/java/gui/image/PermissionImage_GUI.java)87
-rw-r--r--Dozentenmodul/src/main/java/gui/lecture/SearchLecture_GUI.java1080
-rw-r--r--Dozentenmodul/src/main/java/models/Image.java24
-rw-r--r--Dozentenmodul/src/main/java/models/ImageRights.java45
-rw-r--r--Dozentenmodul/src/main/java/models/LectureRights.java37
-rw-r--r--Dozentenmodul/src/main/java/models/Links.java146
-rw-r--r--Dozentenmodul/src/main/java/models/SessionData.java2
-rw-r--r--Dozentenmodul/src/main/java/models/Version.java24
-rw-r--r--Dozentenmodul/src/main/java/models/person.java10
-rw-r--r--Dozentenmodul/src/main/java/thrift/MasterThriftConnection.java3
-rw-r--r--Dozentenmodul/src/main/java/util/GuiOrganizer.java25
-rw-r--r--Dozentenmodul/src/main/java/util/OpenLinks.java25
-rw-r--r--Dozentenmodulserver/src/main/java/server/Image.java108
-rw-r--r--Dozentenmodulserver/src/main/java/server/Server.java7938
-rw-r--r--Dozentenmodulserver/src/main/java/server/ServerHandler.java190
-rw-r--r--Dozentenmodulserver/src/main/java/server/StartServer.java70
-rw-r--r--Dozentenmodulserver/src/main/java/sql/SQL.java279
-rw-r--r--Dozentenmodulserver/src/main/java/util/XMLCreator.java19
-rw-r--r--Dozentenmodulserver/thrift/server.thrift14
53 files changed, 16784 insertions, 5082 deletions
diff --git a/Dozentenmodul/src/main/java/config/config_file.java b/Dozentenmodul/src/main/java/config/config_file.java
index 5d59e22a..e2290f34 100644
--- a/Dozentenmodul/src/main/java/config/config_file.java
+++ b/Dozentenmodul/src/main/java/config/config_file.java
@@ -20,6 +20,7 @@ public class config_file {
//Pruefen ob Ordner schon existiert
if(config.exists()==false)
{
+ System.out.println("Ordner \"bwLehrpoolSuite\" exisitiert nicht - lege ihn jetzt an.");
//Wenn nicht erzeuge Ordner
config.mkdir();
@@ -30,33 +31,51 @@ public class config_file {
//Wenn in die Datei geschrieben werden kann
if(conf.canWrite()==true)
{
+ System.out.println("Erzeuge \"config.ini.\"");
//Schreibe Config
ini.put("main", "BillOfRights",false);
ini.put("main", "vmware", false);
+ ini.put("main", "Benutzername speichern", false);
+ ini.put("main", "Benutzername", "");
+ ini.put("main", "Letzter Downloadpfad", "");
+ ini.put("main", "Letzter Uploadpfad", "");
ini.store();
return true;
+ } else {
+ System.out.println("Konnte \"config.ini\" nicht anlegen - keine weitere Aktion.");
}
}
else
{
+ System.out.println("Ordner \"bwLehrpoolSuite\" existiert bereits - keine weitere Aktion.");
//Wenn Ordner schon existiert, pruefe ob Datei existiert
if(conf.exists()==false)
{
+ System.out.println("\"config.ini\" existiert nicht - lege jetzt an.");
//Wenn nicht, erzeuge diese
conf.createNewFile();
ini=new Wini(conf);
if(conf.canWrite()==true)
{
+ System.out.println("Schreibe jetzt \"config.ini\".");
//Schreibe Konfig in File
ini.put("main", "BillOfRights",false);
ini.put("main", "vmware", false);
+ ini.put("main", "Benutzername speichern", false);
+ ini.put("main", "Benutzername", "");
+ ini.put("main", "Letzter Downloadpfad", "");
+ ini.put("main", "Letzter Uploadpfad", "");
ini.store();
return true;
+ } else {
+ System.out.println("Kann \"config.ini\" nicht schreiben - keine weitere Aktion.");
}
+ } else {
+ System.out.println("\"config.ini\" existiert bereits - keine weitere Aktion.");
}
}
return true;
diff --git a/Dozentenmodul/src/main/java/ftp/DownloadTask.java b/Dozentenmodul/src/main/java/ftp/DownloadTask.java
index 83ad2c15..5592adba 100644
--- a/Dozentenmodul/src/main/java/ftp/DownloadTask.java
+++ b/Dozentenmodul/src/main/java/ftp/DownloadTask.java
@@ -1,6 +1,6 @@
package ftp;
-import gui.image.FTPDownloader_GUI;
+import gui.image.FTPEditDownloader_GUI;
import java.io.File;
import java.io.FileOutputStream;
@@ -10,91 +10,90 @@ import javax.swing.JOptionPane;
import javax.swing.SwingWorker;
/**
- * Execute file download in a background thread and update the progress.
+ * 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 gui;
-
+ private int percentCompleted;
+
public DownloadTask(String host, int port, String username,
- String password, String downloadPath, String saveDir,
- FTPDownloader_GUI gui) {
+ String password, String downloadPath, String saveDir) {
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 start=System.nanoTime();
- final double NANOS_PER_SECOND = 1000000000.0;
- final double BYTES_PER_MIB = 1024*1024;
+ percentCompleted = 0;
+ long start = System.nanoTime();
+ final double NANOS_PER_SECOND = 1000000000.0;
+ final double BYTES_PER_MIB = 1024 * 1024;
long fileSize = util.getFileSize(downloadPath);
- //gui.setFileSize(fileSize);
-
+ // 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 && isCancelled()==false) {
+
+ while ((bytesRead = inputStream.read(buffer)) != -1
+ && isCancelled() == false) {
outputStream.write(buffer, 0, bytesRead);
totalBytesRead += bytesRead;
- //System.out.println(totalBytesRead);
- double speed = NANOS_PER_SECOND / BYTES_PER_MIB * totalBytesRead / (System.nanoTime() - start + 1);
+ // System.out.println(totalBytesRead);
+ double speed = NANOS_PER_SECOND / BYTES_PER_MIB
+ * totalBytesRead / (System.nanoTime() - start + 1);
percentCompleted = (int) (totalBytesRead * 100 / fileSize);
setProgress(percentCompleted);
firePropertyChange("speed", 0, speed);
- firePropertyChange("filesize", 0,fileSize);
- firePropertyChange("bytesread", 0,totalBytesRead);
-
+ firePropertyChange("filesize", 0, fileSize);
+ firePropertyChange("bytesread", 0, totalBytesRead);
+
}
outputStream.close();
-
+
util.finish();
} catch (FTPException ex) {
- JOptionPane.showMessageDialog(null, "Error downloading file: " + ex.getMessage(),
- "Error", JOptionPane.ERROR_MESSAGE);
+ JOptionPane.showMessageDialog(null,
+ "Error downloading file: " + ex.getMessage(), "Error",
+ JOptionPane.ERROR_MESSAGE);
ex.printStackTrace();
setProgress(0);
- cancel(true);
+ cancel(true);
} finally {
util.disconnect();
}
-
+
return null;
}
@@ -103,10 +102,16 @@ public class DownloadTask extends SwingWorker<Void, Void> {
*/
@Override
protected void done() {
- if (!isCancelled()) {
+ if (!isCancelled() && percentCompleted==100) {
+ System.out.println("Datei erfolgreich heruntergeladen");
+ JOptionPane.showMessageDialog(null,
+ "Datei erfolgreich heruntergeladen.", "Message",
+ JOptionPane.INFORMATION_MESSAGE);
+ } else if(!isCancelled() && percentCompleted != 100){
+ System.out.println("Datein wurde unvollständig heruntergeladen");
JOptionPane.showMessageDialog(null,
- "File has been downloaded successfully!", "Message",
+ "Datei wurde unvollständig heruntergeladen. Bitte wiederholen.", "Message",
JOptionPane.INFORMATION_MESSAGE);
}
- }
+ }
} \ No newline at end of file
diff --git a/Dozentenmodul/src/main/java/ftp/FTPUtility.java b/Dozentenmodul/src/main/java/ftp/FTPUtility.java
index f2c51dfc..beae3f34 100644
--- a/Dozentenmodul/src/main/java/ftp/FTPUtility.java
+++ b/Dozentenmodul/src/main/java/ftp/FTPUtility.java
@@ -16,7 +16,6 @@ import org.apache.commons.net.ftp.FTPFile;
import org.apache.commons.net.ftp.FTPReply;
import org.apache.commons.net.ftp.FTPSClient;
-
/**
* A utility class that provides functionality for downloading files from a FTP
* server.
@@ -49,7 +48,7 @@ public class FTPUtility {
* Connect and login to the server.
*
* @throws FTPException
- * @throws NoSuchAlgorithmException
+ * @throws NoSuchAlgorithmException
*/
public void connect() throws FTPException, NoSuchAlgorithmException {
try {
@@ -58,8 +57,7 @@ public class FTPUtility {
if (!FTPReply.isPositiveCompletion(replyCode)) {
throw new FTPException("FTP serve refused connection.");
}
-
-
+
boolean logged = ftpClient.login(username, password);
if (!logged) {
// failed to login
@@ -122,43 +120,45 @@ public class FTPUtility {
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(Image.image.getNewName());
-
- //ftpClient.rename(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);
- }
+
+ /**
+ * 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(Image.image.getNewName());
+
+ // ftpClient.rename(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.
@@ -191,11 +191,9 @@ public class FTPUtility {
public InputStream getInputStream() {
return inputStream;
}
-
+
public OutputStream getOutputStream() {
return outputStream;
}
-
-
} \ No newline at end of file
diff --git a/Dozentenmodul/src/main/java/ftp/UploadTask.java b/Dozentenmodul/src/main/java/ftp/UploadTask.java
index 06d76dc8..e7ebe43b 100644
--- a/Dozentenmodul/src/main/java/ftp/UploadTask.java
+++ b/Dozentenmodul/src/main/java/ftp/UploadTask.java
@@ -1,98 +1,108 @@
package ftp;
-
+
import java.io.File;
import java.io.FileInputStream;
-
+
import javax.swing.JOptionPane;
import javax.swing.SwingWorker;
import models.Image;
-
+
/**
* 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;
- int i=0;
- long totalBytesRead = 0;
- int percentCompleted = 0;
- long fileSize = uploadFile.length();
- Image.image.setFilesize(fileSize);
- long start=System.nanoTime();
- final double NANOS_PER_SECOND = 1000000000.0;
- final double BYTES_PER_MIB = 1024*1024;
- while ((bytesRead = inputStream.read(buffer)) != -1 && isCancelled()==false) {
- 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);
- firePropertyChange("filesize", 0,fileSize);
- firePropertyChange("bytesread", 0,totalBytesRead);
- }
-
- 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);
- }
- }
+ 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;
+ private int percentCompleted;
+
+ 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;
+ int i = 0;
+ long totalBytesRead = 0;
+ percentCompleted = 0;
+ long fileSize = uploadFile.length();
+ Image.image.setFilesize(fileSize);
+ long start = System.nanoTime();
+ final double NANOS_PER_SECOND = 1000000000.0;
+ final double BYTES_PER_MIB = 1024 * 1024;
+ while ((bytesRead = inputStream.read(buffer)) != -1
+ && isCancelled() == false) {
+ 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);
+ firePropertyChange("filesize", 0, fileSize);
+ firePropertyChange("bytesread", 0, totalBytesRead);
+ }
+
+ 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() && percentCompleted==100) {
+ System.out.println("Datei erfolgreich hochgeladen");
+ JOptionPane.showMessageDialog(null,
+ "Datei erfolgreich hochgeladen.", "Message",
+ JOptionPane.INFORMATION_MESSAGE);
+ } else if(!isCancelled() && percentCompleted != 100){
+ System.out.println("Datein wurde unvollständig hochgeladen");
+ JOptionPane.showMessageDialog(null,
+ "Datei wurde unvollständig hochgeladen. Bitte wiederholen.", "Message",
+ JOptionPane.INFORMATION_MESSAGE);
+ }
+ }
} \ No newline at end of file
diff --git a/Dozentenmodul/src/main/java/gui/image/CreateImageAllgemein_GUI.java b/Dozentenmodul/src/main/java/gui/image/CreateImageAllgemein_GUI.java
index 6231c6f2..06835167 100644
--- a/Dozentenmodul/src/main/java/gui/image/CreateImageAllgemein_GUI.java
+++ b/Dozentenmodul/src/main/java/gui/image/CreateImageAllgemein_GUI.java
@@ -1,6 +1,5 @@
package gui.image;
-
import gui.intro.About_GUI;
import gui.intro.MainMenue_GUI;
@@ -39,6 +38,10 @@ import models.Links;
import models.person;
import util.GuiOrganizer;
import util.OpenLinks;
+import javax.swing.JScrollPane;
+import java.awt.event.KeyAdapter;
+import java.awt.event.KeyEvent;
+
@SuppressWarnings("serial")
public class CreateImageAllgemein_GUI extends JFrame {
@@ -50,6 +53,12 @@ public class CreateImageAllgemein_GUI extends JFrame {
private JTextField Hochschule;
private JTextField EMail;
private JTextField imagename;
+ private JTextArea textAreadesc;
+ private boolean textfieldsHaveContent = false; // no textfield is empty
+ private boolean descriptionLengthOK = false; //description may not be longer than 254 chars
+ private boolean nameIsOK = false; // imagename only contains letters
+ private final int MAX_DESCRIPTION_LENGTH = 254;
+ private JTextArea txtrGebenSieBitte_1;
/**
* Create the dialog.
@@ -58,31 +67,32 @@ public class CreateImageAllgemein_GUI extends JFrame {
addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent arg0) {
- //Beendet das Fenster auf X
+ // Beendet das Fenster auf X
System.exit(0);
}
+
@Override
public void windowOpened(WindowEvent arg0) {
imagename.requestFocusInWindow();
}
});
- //Verhindert das Vergroessern des Fensters
+ // Verhindert das Vergroessern des Fensters
setResizable(false);
-
+
try {
- //setzt das Look & Feel
+ // setzt das Look & Feel
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (ClassNotFoundException | InstantiationException
| IllegalAccessException | UnsupportedLookAndFeelException e) {
// TODO Auto-generated catch block
e.printStackTrace();
JOptionPane.showMessageDialog(null,
- e.getCause()+"\n"+e.getMessage(),
- "Debug-Message", JOptionPane.ERROR_MESSAGE);
+ e.getCause() + "\n" + e.getStackTrace(), "Debug-Message",
+ JOptionPane.ERROR_MESSAGE);
}
- //Setzt den Titel
- setTitle("bwLehrpool Suite *Prototyp* - Image erzeugen");
- //Zentriert das Fenster
+ // Setzt den Titel
+ setTitle("bwLehrpool Suite - Image erzeugen");
+ // Zentriert das Fenster
setBounds(0, 0, 603, 722);
GuiOrganizer.centerGUI(this);
@@ -99,11 +109,12 @@ public class CreateImageAllgemein_GUI extends JFrame {
panel.add(lblNewLabel);
lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18));
}
-
+
JTextPane txtpnBitteWhlenSie = new JTextPane();
txtpnBitteWhlenSie.setEditable(false);
txtpnBitteWhlenSie.setBackground(SystemColor.menu);
- txtpnBitteWhlenSie.setText("Geben Sie hier bitte einen sprechenden Imagename sowie Ihre Kontaktdaten an");
+ txtpnBitteWhlenSie
+ .setText("Geben Sie hier bitte einen sprechenden Imagenamen sowie Ihre Kontaktdaten an");
txtpnBitteWhlenSie.setBounds(10, 36, 509, 32);
panel.add(txtpnBitteWhlenSie);
}
@@ -112,19 +123,20 @@ public class CreateImageAllgemein_GUI extends JFrame {
contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
getContentPane().add(contentPanel);
contentPanel.setLayout(null);
-
+
JPanel panel_1 = new JPanel();
panel_1.setBackground(SystemColor.menu);
- panel_1.setBorder(new TitledBorder(null, "Informationen zum Besitzer", TitledBorder.LEADING, TitledBorder.TOP, null, null));
+ panel_1.setBorder(new TitledBorder(null, "Informationen zum Besitzer",
+ TitledBorder.LEADING, TitledBorder.TOP, null, null));
panel_1.setBounds(10, 66, 557, 369);
contentPanel.add(panel_1);
panel_1.setLayout(null);
-
+
JLabel label = new JLabel("Vorname: *");
label.setBackground(SystemColor.menu);
label.setBounds(10, 245, 125, 20);
panel_1.add(label);
-
+
Vorname = new JTextField();
Vorname.setEnabled(false);
Vorname.setEditable(false);
@@ -133,12 +145,12 @@ public class CreateImageAllgemein_GUI extends JFrame {
Vorname.setColumns(10);
Vorname.setBounds(145, 245, 350, 20);
panel_1.add(Vorname);
-
+
JLabel label_7 = new JLabel("Nachname: *");
label_7.setBackground(SystemColor.menu);
label_7.setBounds(10, 276, 125, 20);
panel_1.add(label_7);
-
+
Nachname = new JTextField();
Nachname.setEnabled(false);
Nachname.setEditable(false);
@@ -147,12 +159,12 @@ public class CreateImageAllgemein_GUI extends JFrame {
Nachname.setColumns(10);
Nachname.setBounds(145, 276, 350, 20);
panel_1.add(Nachname);
-
+
JLabel label_8 = new JLabel("Hochschule: *");
label_8.setBackground(SystemColor.menu);
label_8.setBounds(10, 307, 125, 20);
panel_1.add(label_8);
-
+
Hochschule = new JTextField();
Hochschule.setEnabled(false);
Hochschule.setEditable(false);
@@ -161,12 +173,12 @@ public class CreateImageAllgemein_GUI extends JFrame {
Hochschule.setColumns(10);
Hochschule.setBounds(145, 307, 350, 20);
panel_1.add(Hochschule);
-
+
JLabel label_9 = new JLabel("E-Mail: *");
label_9.setBackground(SystemColor.menu);
label_9.setBounds(10, 338, 125, 20);
panel_1.add(label_9);
-
+
EMail = new JTextField();
EMail.setEnabled(false);
EMail.setEditable(false);
@@ -175,68 +187,107 @@ public class CreateImageAllgemein_GUI extends JFrame {
EMail.setColumns(10);
EMail.setBounds(145, 338, 350, 20);
panel_1.add(EMail);
-
+
JLabel lblImagename = new JLabel("Imagename: *");
lblImagename.setBackground(SystemColor.menu);
- lblImagename.setBounds(10, 31, 125, 20);
+ lblImagename.setBounds(10, 23, 125, 20);
panel_1.add(lblImagename);
-
-
+
imagename = new JTextField();
+ imagename.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent arg0) {
+ textAreadesc.requestFocusInWindow();
+ }
+ });
imagename.setBackground(Color.WHITE);
imagename.setText((String) null);
imagename.setColumns(10);
- imagename.setBounds(145, 31, 350, 20);
- imagename.setText(Image.image.getImagename()); //null am Anfang, aber speichert die Eingabe, wenn man zurueck kommt zur Seite
+ imagename.setBounds(145, 23, 350, 20);
+ imagename.setText(Image.image.getImagename()); // null am Anfang, aber
+ // speichert die
+ // Eingabe, wenn man
+ // zurueck kommt zur
+ // Seite
panel_1.add(imagename);
-
+
JTextArea txtrGebenSieBitte = new JTextArea();
txtrGebenSieBitte.setEditable(false);
txtrGebenSieBitte.setBackground(SystemColor.menu);
txtrGebenSieBitte.setLineWrap(true);
txtrGebenSieBitte.setFont(new Font("Tahoma", Font.PLAIN, 12));
- txtrGebenSieBitte.setText("Geben Sie bitte einen sprechenden Namen f\u00FCr das Image an.\r\nDieser soll jedoch recht allgemein gehalten werden.\r\nBeispiel: \"Programmieren\", nicht \"Programmieren 1\"");
- txtrGebenSieBitte.setBounds(145, 62, 350, 110);
+ txtrGebenSieBitte
+ .setText("Geben Sie bitte einen sprechenden Namen f\u00FCr das Image an.\r\nDieser soll jedoch recht allgemein gehalten werden.\r\nBeispiel: \"Programmieren\", nicht \"Programmieren 1\"");
+ txtrGebenSieBitte.setBounds(145, 48, 350, 49);
panel_1.add(txtrGebenSieBitte);
+
+ JLabel lblBeschreibung = new JLabel("Beschreibung: *");
+ lblBeschreibung.setBackground(SystemColor.menu);
+ lblBeschreibung.setBounds(10, 110, 125, 20);
+ panel_1.add(lblBeschreibung);
+
+ JScrollPane scrollPane = new JScrollPane();
+ scrollPane.setBounds(145, 110, 350, 60);
+ panel_1.add(scrollPane);
+
+ textAreadesc = new JTextArea();
+ textAreadesc.setFont(new Font("Tahoma", Font.PLAIN, 11));
+ textAreadesc.setLineWrap(true);
+ textAreadesc.setText((String) null);
+ textAreadesc.setText(Image.image.getDesc());// null am Anfang, aber
+ // speichert die Eingabe,
+ // wenn man zurueck kommt
+ // zur Seite
+ scrollPane.setViewportView(textAreadesc);
+
+ txtrGebenSieBitte_1 = new JTextArea();
+ txtrGebenSieBitte_1
+ .setText("Geben Sie bitte eine Beschreibung f\u00FCr das Image an.\r\nDiese soll jedoch recht spezifisch gehalten werden.\r\nBeispiel: \"Java-Enticklung mit eclipse und MySQL\"");
+ txtrGebenSieBitte_1.setLineWrap(true);
+ txtrGebenSieBitte_1.setFont(new Font("Tahoma", Font.PLAIN, 12));
+ txtrGebenSieBitte_1.setEditable(false);
+ txtrGebenSieBitte_1.setBackground(SystemColor.menu);
+ txtrGebenSieBitte_1.setBounds(145, 177, 350, 49);
+ panel_1.add(txtrGebenSieBitte_1);
+
JPanel panel = new JPanel();
panel.setBounds(10, 402, 577, 33);
contentPanel.add(panel);
panel.setLayout(null);
panel.setBorder(new EmptyBorder(5, 5, 5, 5));
panel.setBackground(SystemColor.menu);
-
+
JLabel lblPflichtfelder = new JLabel("* Pflichtfelder");
lblPflichtfelder.setBounds(10, 442, 136, 14);
contentPanel.add(lblPflichtfelder);
-
+
JLabel lblHauptmen = new JLabel("Hauptmen\u00FC");
lblHauptmen.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent arg0) {
- //oeffnet das Hauptmenue
+ // oeffnet das Hauptmenue
CreateImageAllgemein_GUI.this.setVisible(false);
- MainMenue_GUI main=new MainMenue_GUI();
+ MainMenue_GUI main = new MainMenue_GUI();
main.setVisible(true);
}
});
lblHauptmen.setForeground(Color.BLUE);
lblHauptmen.setBounds(10, 11, 61, 14);
contentPanel.add(lblHauptmen);
-
+
JLabel label_1 = new JLabel(">");
label_1.setBounds(69, 11, 13, 14);
contentPanel.add(label_1);
-
- JLabel lblVlimage = new JLabel("VL-Image");
+
+ JLabel lblVlimage = new JLabel("Image");
lblVlimage.setForeground(Color.BLUE);
lblVlimage.setBounds(81, 11, 45, 14);
contentPanel.add(lblVlimage);
-
+
JLabel label_2 = new JLabel(">");
label_2.setBounds(133, 11, 13, 14);
contentPanel.add(label_2);
-
+
JLabel lblNewLabel_1 = new JLabel("Neu");
lblNewLabel_1.setBounds(146, 11, 46, 14);
contentPanel.add(lblNewLabel_1);
@@ -251,7 +302,8 @@ public class CreateImageAllgemein_GUI extends JFrame {
backButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Image.image.setImagename(imagename.getText());
- MainMenue_GUI sr=new MainMenue_GUI();
+ Image.image.setDesc(textAreadesc.getText());
+ MainMenue_GUI sr = new MainMenue_GUI();
sr.setVisible(true);
dispose();
}
@@ -263,18 +315,24 @@ public class CreateImageAllgemein_GUI extends JFrame {
JButton continueButton = new JButton("Weiter");
continueButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
- //Prueft die Eingabe
- if(imagename.getText().isEmpty()==false && Vorname.getText().isEmpty()==false && Nachname.getText().isEmpty()==false && Hochschule.getText().isEmpty()==false&&EMail.getText().isEmpty()==false)
- {
- //Schreibt die Daten in das Model
- Image.image.setImagename(imagename.getText());
- CreateImageTechnisch_GUI ea=new CreateImageTechnisch_GUI();
- ea.setVisible(true);
- dispose();
- }
- else{
- JOptionPane.showMessageDialog(null, "Bitte geben Sie alle notwendigen Daten an!",
- "Daten unvollst\u00e4ndig", JOptionPane.INFORMATION_MESSAGE);
+ // Prueft die Eingabe und leitet weiter zur naechsten
+ // Seite
+ if (checkContent() == true
+ && checkNameIsLettersOrNumbers() == true && descriptionLenghtOK() == true) {
+ // Schreibt die Daten in das Model
+ Image.image.setImagename(imagename.getText());
+ Image.image.setDesc(textAreadesc.getText());
+ // Info
+ System.out
+ .println("Alle Eingaben in Ordnung. Imagename= \""
+ + Image.image.getImagename()
+ + "\", Imagebeschreibung=\""
+ + Image.image.getDesc()+"\"");
+ CreateImageTechnisch_GUI ea = new CreateImageTechnisch_GUI();
+ ea.setVisible(true);
+ dispose();
+ } else {
+
}
}
});
@@ -283,34 +341,30 @@ public class CreateImageAllgemein_GUI extends JFrame {
getRootPane().setDefaultButton(continueButton);
}
}
-
+
JSeparator separator = new JSeparator();
separator.setBounds(0, 78, 597, 2);
getContentPane().add(separator);
-
+
JSeparator separator_1 = new JSeparator();
separator_1.setBounds(0, 627, 597, 2);
getContentPane().add(separator_1);
-
+
JMenuBar menuBar = new JMenuBar();
setJMenuBar(menuBar);
-
+
JMenu mnNewMenu_1 = new JMenu("Hilfe");
menuBar.add(mnNewMenu_1);
-
+
JMenuItem mntmFaq = new JMenuItem("FAQ");
mntmFaq.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent arg0) {
-
OpenLinks open = new OpenLinks();
-
URI windows;
try {
windows = new URI(Links.getFAQ());
-
open.openWebpage(windows);
-
} catch (URISyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
@@ -318,21 +372,16 @@ public class CreateImageAllgemein_GUI extends JFrame {
}
});
mnNewMenu_1.add(mntmFaq);
-
JMenuItem mntmOtrs = new JMenuItem("OTRS");
mntmOtrs.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent arg0) {
-
OpenLinks open = new OpenLinks();
-
URI windows;
try {
windows = new URI(Links.getOTRS());
-
open.openWebpage(windows);
-
} catch (URISyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
@@ -341,7 +390,7 @@ public class CreateImageAllgemein_GUI extends JFrame {
}
});
mnNewMenu_1.add(mntmOtrs);
-
+
JMenuItem menuItem = new JMenuItem("About");
menuItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
@@ -350,6 +399,66 @@ public class CreateImageAllgemein_GUI extends JFrame {
}
});
mnNewMenu_1.add(menuItem);
+
+ }// end main
+
+ public boolean checkNameIsLettersOrNumbers() {
+ nameIsOK = false;
+
+ // only allow letter from alphabet and numbers
+ if (imagename.getText().matches("[a-zA-Z0-9]+")) {
+ nameIsOK = true;
+ } else {
+ JOptionPane
+ .showMessageDialog(
+ null,
+ "Der Imagename darf keine Leer- oder Sonderzeichen enthalten.",
+ "Unerlaubte Zeichen",
+ JOptionPane.INFORMATION_MESSAGE);
+ }// if
+
+ return nameIsOK;
+ }// end nameIsOK
+
+ public boolean checkContent() {
+ textfieldsHaveContent = false;
+
+ // check if any textfield is empty
+ if (imagename.getText().isEmpty() == false
+ && textAreadesc.getText().isEmpty() == false
+ && Vorname.getText().isEmpty() == false
+ && Nachname.getText().isEmpty() == false
+ && Hochschule.getText().isEmpty() == false
+ && EMail.getText().isEmpty() == false) {
+ // all textfields have content
+ textfieldsHaveContent = true;
+ } else {
+ JOptionPane
+ .showMessageDialog(null,
+ "Bitte geben Sie alle notwendigen Daten an!",
+ "Daten unvollst\u00e4ndig",
+ JOptionPane.INFORMATION_MESSAGE);
+ }// end if
+
+ return textfieldsHaveContent;
+ }// end checkContent
+
+ public boolean descriptionLenghtOK(){
+ descriptionLengthOK=false;
+
+ //max length is 254 chars
+ if (textAreadesc.getText().length() >= MAX_DESCRIPTION_LENGTH) {
+ descriptionLengthOK=false;
+ JOptionPane
+ .showMessageDialog(null,
+ "Die Beschreibung darf max 254 Zeichen enthalten. Aktuell enthält sie "+textAreadesc.getText().length()+".",
+ "Beschreibung zu umfangreich",
+ JOptionPane.INFORMATION_MESSAGE);
+ }else {
+ descriptionLengthOK=true;
+
+ }
- }//end main
-}
+ return descriptionLengthOK;
+ }// enddescriptionLenghtOK()
+}// end Class
diff --git a/Dozentenmodul/src/main/java/gui/image/CreateImageFreigabe_GUI.java b/Dozentenmodul/src/main/java/gui/image/CreateImageFreigabe_GUI.java
index ec50440f..dea785d3 100644
--- a/Dozentenmodul/src/main/java/gui/image/CreateImageFreigabe_GUI.java
+++ b/Dozentenmodul/src/main/java/gui/image/CreateImageFreigabe_GUI.java
@@ -67,7 +67,7 @@ public class CreateImageFreigabe_GUI extends JFrame {
// TODO Auto-generated catch block
e.printStackTrace();
}
- setTitle("bwLehrpool Suite *Prototyp* - Image erzeugen");
+ setTitle("bwLehrpool Suite - Image erzeugen");
setBounds(0, 0, 603, 722);
GuiOrganizer.centerGUI(this);
@@ -138,7 +138,7 @@ public class CreateImageFreigabe_GUI extends JFrame {
label_1.setBounds(69, 11, 13, 14);
contentPanel.add(label_1);
- JLabel lblVlimage = new JLabel("VL-Image");
+ JLabel lblVlimage = new JLabel("Image");
lblVlimage.setForeground(Color.BLUE);
lblVlimage.setBounds(81, 11, 45, 14);
contentPanel.add(lblVlimage);
@@ -176,7 +176,7 @@ public class CreateImageFreigabe_GUI extends JFrame {
continueButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Image.image.setShareMode(comboBox.getSelectedIndex());
- FTPCreateUploader_GUI ea = new FTPCreateUploader_GUI();
+ PermissionCreateImage_GUI ea = new PermissionCreateImage_GUI();
ea.setVisible(true);
dispose();
@@ -199,12 +199,6 @@ public class CreateImageFreigabe_GUI extends JFrame {
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);
diff --git a/Dozentenmodul/src/main/java/gui/image/CreateImageTechnisch_GUI.java b/Dozentenmodul/src/main/java/gui/image/CreateImageTechnisch_GUI.java
index f861901f..a6b19c6c 100644
--- a/Dozentenmodul/src/main/java/gui/image/CreateImageTechnisch_GUI.java
+++ b/Dozentenmodul/src/main/java/gui/image/CreateImageTechnisch_GUI.java
@@ -16,9 +16,11 @@ import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.net.URI;
import java.net.URISyntaxException;
+import java.util.List;
import javax.swing.ButtonGroup;
import javax.swing.JButton;
+import javax.swing.JCheckBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JMenu;
@@ -38,8 +40,13 @@ import javax.swing.border.TitledBorder;
import models.Image;
import models.Links;
+import server.Server.Client;
+import thrift.ThriftConnection;
import util.GuiOrganizer;
import util.OpenLinks;
+import javax.swing.JComboBox;
+
+import org.apache.thrift.TException;
@SuppressWarnings("serial")
public class CreateImageTechnisch_GUI extends JFrame {
@@ -48,15 +55,21 @@ public class CreateImageTechnisch_GUI extends JFrame {
String[] result;
JSpinner spinnerCPU;
JSpinner spinnerRam;
- JRadioButton rdbtnlicenseJa;
- JRadioButton rdbtnlicenseNein;
- JRadioButton rdbtnInternetJa;
- JRadioButton rdbtnInternetNein;
- JRadioButton radioButtonVorlageJa;
- JRadioButton radioButtonVorlageNein;
+ //JRadioButton rdbtnlicenseJa;
+ //JRadioButton rdbtnlicenseNein;
+ //JRadioButton rdbtnInternetJa;
+ //JRadioButton rdbtnInternetNein;
+ //JRadioButton radioButtonVorlageJa;
+ //JRadioButton radioButtonVorlageNein;
+ private JCheckBox chckbxIsTemplate;
+ private JCheckBox chckbxIsLicensed;
+ private JCheckBox chckbxIsInternetBlocked;
+ JComboBox comboBox;
private final ButtonGroup buttonGrouplicense = new ButtonGroup();
private final ButtonGroup buttonGroupInternet = new ButtonGroup();
private final ButtonGroup buttonGroupVorlage = new ButtonGroup();
+ ThriftConnection con = new ThriftConnection();
+ Client client = models.Client.clientcon.getClient();
/**
@@ -78,7 +91,7 @@ public class CreateImageTechnisch_GUI extends JFrame {
// TODO Auto-generated catch block
e.printStackTrace();
}
- setTitle("bwLehrpool Suite *Prototyp* - Image erzeugen");
+ setTitle("bwLehrpool Suite - Image erzeugen");
setBounds(0, 0, 603, 722);
GuiOrganizer.centerGUI(this);
@@ -104,7 +117,7 @@ public class CreateImageTechnisch_GUI extends JFrame {
txtpnBitteWhlenSie.setBounds(10, 36, 509, 32);
panel.add(txtpnBitteWhlenSie);
}
- contentPanel.setBounds(10, 85, 577, 493);
+ contentPanel.setBounds(10, 85, 577, 531);
contentPanel.setBackground(SystemColor.menu);
contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
getContentPane().add(contentPanel);
@@ -113,75 +126,100 @@ public class CreateImageTechnisch_GUI extends JFrame {
JPanel panel_1 = new JPanel();
panel_1.setBackground(SystemColor.menu);
panel_1.setBorder(new TitledBorder(null, "Informationen zum Image", TitledBorder.LEADING, TitledBorder.TOP, null, null));
- panel_1.setBounds(10, 52, 557, 138);
+ panel_1.setBounds(10, 36, 557, 166);
contentPanel.add(panel_1);
panel_1.setLayout(null);
-
- rdbtnlicenseNein = new JRadioButton("Nein");
- buttonGrouplicense.add(rdbtnlicenseNein);
- rdbtnlicenseNein.setBounds(377, 49, 46, 23);
- panel_1.add(rdbtnlicenseNein);
-
- rdbtnInternetNein = new JRadioButton("Nein");
- rdbtnInternetNein.setSelected(true);
- buttonGroupInternet.add(rdbtnInternetNein);
- rdbtnInternetNein.setBounds(377, 77, 46, 23);
- panel_1.add(rdbtnInternetNein);
+
JLabel lblInternetIstInnerhalb = new JLabel("Internet ist f\u00FCr dieses Image gesperrt:");
- lblInternetIstInnerhalb.setBounds(10, 78, 250, 20);
+ lblInternetIstInnerhalb.setBounds(10, 106, 250, 20);
panel_1.add(lblInternetIstInnerhalb);
JButton btnInternetSettings = new JButton("Einstellungen...");
btnInternetSettings.setEnabled(false);
- btnInternetSettings.setBounds(439, 77, 108, 23);
+ btnInternetSettings.setBounds(439, 105, 108, 23);
panel_1.add(btnInternetSettings);
- rdbtnInternetJa = new JRadioButton("Ja");
-
- buttonGroupInternet.add(rdbtnInternetJa);
- rdbtnInternetJa.setBounds(266, 77, 41, 23);
- panel_1.add(rdbtnInternetJa);
-
- rdbtnlicenseJa = new JRadioButton("Ja");
- rdbtnlicenseJa.setSelected(true);
- buttonGrouplicense.add(rdbtnlicenseJa);
- rdbtnlicenseJa.setBounds(266, 49, 41, 23);
- panel_1.add(rdbtnlicenseJa);
JLabel lblNewLabel_2 = new JLabel("Image enth\u00E4lt lizenzpflichtige Software:");
- lblNewLabel_2.setBounds(10, 50, 250, 20);
+ lblNewLabel_2.setBounds(10, 78, 250, 20);
panel_1.add(lblNewLabel_2);
+ chckbxIsTemplate = new JCheckBox("");
+ chckbxIsTemplate.setBounds(266, 50, 97, 23);
+ panel_1.add(chckbxIsTemplate);
+
+ chckbxIsLicensed = new JCheckBox("");
+ chckbxIsLicensed.setSelected(true);
+ chckbxIsLicensed.setBounds(266, 76, 97, 23);
+ panel_1.add(chckbxIsLicensed);
+
+ chckbxIsInternetBlocked = new JCheckBox("");
+ chckbxIsInternetBlocked.setBounds(266, 104, 97, 23);
+ panel_1.add(chckbxIsInternetBlocked);
+
JLabel lblLizenzserverEintragen = new JLabel("Lizenzserver eintragen:");
- lblLizenzserverEintragen.setBounds(10, 105, 250, 20);
+ lblLizenzserverEintragen.setBounds(10, 133, 250, 20);
panel_1.add(lblLizenzserverEintragen);
JButton btnLicenseServer = new JButton("Server-Adresse...");
btnLicenseServer.setEnabled(false);
- btnLicenseServer.setBounds(266, 104, 157, 23);
+ btnLicenseServer.setBounds(266, 132, 157, 23);
panel_1.add(btnLicenseServer);
JLabel lblImageIstEine = new JLabel("Image ist eine Vorlage:");
- lblImageIstEine.setBounds(10, 24, 250, 20);
+ lblImageIstEine.setBounds(10, 52, 250, 20);
panel_1.add(lblImageIstEine);
+
+
+ JLabel lblBetriebssystem = new JLabel("Betriebssystem:");
+ lblBetriebssystem.setBounds(10, 21, 250, 20);
+ panel_1.add(lblBetriebssystem);
+
+ if (Image.image.isVorlage() == true) {
+ //radioButtonVorlageJa.setSelected(true);
+ chckbxIsTemplate.setSelected(true);
+ } else {
+ //radioButtonVorlageNein.setSelected(true);
+ chckbxIsTemplate.setSelected(false);
+ }
+
+ if(Image.image.isInternet() == true ){
+ chckbxIsInternetBlocked.setSelected(true);
+ } else {
+ chckbxIsInternetBlocked.setSelected(false);
+ }
- radioButtonVorlageJa = new JRadioButton("Ja");
- buttonGroupVorlage.add(radioButtonVorlageJa);
- radioButtonVorlageJa.setSelected(true);
- radioButtonVorlageJa.setBounds(266, 23, 41, 23);
- panel_1.add(radioButtonVorlageJa);
+ /* TODO deprecated, as checked is default in new image
+ if (Image.image.isLicensed() == true) {
+ //rdbtnlicenseJa.setSelected(true);
+ chckbxIsLicensed.setSelected(true);
+ chckbxIsLicensed.isSelected();
+ } else {
+ //rdbtnlicenseNein.setSelected(true);
+ chckbxIsLicensed.setSelected(false);
+ }
+ */
- radioButtonVorlageNein = new JRadioButton("Nein");
- buttonGroupVorlage.add(radioButtonVorlageNein);
- radioButtonVorlageNein.setBounds(377, 23, 46, 23);
- panel_1.add(radioButtonVorlageNein);
+ comboBox = new JComboBox();
+ try {
+ List<String> os=client.getAllOS();
+
+ for(int i=0; i<os.size();i++){
+ comboBox.addItem(os.get(i).toString());
+ }
+ } catch (TException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ comboBox.setBounds(270, 21, 277, 20);
+ panel_1.add(comboBox);
JPanel panel_2 = new JPanel();
panel_2.setLayout(null);
panel_2.setBorder(new TitledBorder(null, "Empfehlung bez\u00fcglich Ressourcen", TitledBorder.LEADING, TitledBorder.TOP, null, null));
panel_2.setBackground(SystemColor.menu);
- panel_2.setBounds(11, 196, 557, 338);
+ panel_2.setBounds(10, 207, 557, 324);
contentPanel.add(panel_2);
JLabel lblGbyte = new JLabel("GByte");
@@ -259,7 +297,7 @@ public class CreateImageTechnisch_GUI extends JFrame {
label_1.setBounds(69, 11, 13, 14);
contentPanel.add(label_1);
- JLabel lblVlimage = new JLabel("VL-Image");
+ JLabel lblVlimage = new JLabel("Image");
lblVlimage.setForeground(Color.BLUE);
lblVlimage.setBounds(81, 11, 45, 14);
contentPanel.add(lblVlimage);
@@ -282,7 +320,7 @@ public class CreateImageTechnisch_GUI extends JFrame {
cancelButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
- if(rdbtnInternetJa.isSelected()==true)
+ if(chckbxIsInternetBlocked.isSelected()==true)
{
Image.image.setInternet(true);
}
@@ -291,7 +329,7 @@ public class CreateImageTechnisch_GUI extends JFrame {
Image.image.setInternet(false);
}
- if(rdbtnlicenseJa.isSelected()==true)
+ if(chckbxIsLicensed.isSelected()==true)
{
Image.image.setLicensed(true);
}
@@ -299,9 +337,16 @@ public class CreateImageTechnisch_GUI extends JFrame {
{
Image.image.setLicensed(false);
}
+
+ if(chckbxIsTemplate.isSelected() == true){
+ Image.image.setVorlage(true);
+ } else {
+ Image.image.setVorlage(false);
+ }
+
Image.image.setCpu(Integer.valueOf(spinnerCPU.getValue().toString()).intValue());
Image.image.setRam(Integer.valueOf(spinnerRam.getValue().toString()).intValue());
-
+ Image.image.setOS(comboBox.getSelectedItem().toString());
CreateImageAllgemein_GUI sr=new CreateImageAllgemein_GUI();
sr.setVisible(true);
dispose();
@@ -315,7 +360,8 @@ public class CreateImageTechnisch_GUI extends JFrame {
JButton continueButton = new JButton("Weiter");
continueButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
- if(rdbtnInternetJa.isSelected()==true)
+
+ if(chckbxIsInternetBlocked.isSelected()==true)
{
Image.image.setInternet(true);
}
@@ -324,7 +370,7 @@ public class CreateImageTechnisch_GUI extends JFrame {
Image.image.setInternet(false);
}
- if(rdbtnlicenseJa.isSelected()==true)
+ if(chckbxIsLicensed.isSelected()==true)
{
Image.image.setLicensed(true);
}
@@ -332,7 +378,7 @@ public class CreateImageTechnisch_GUI extends JFrame {
{
Image.image.setLicensed(false);
}
- if(radioButtonVorlageJa.isSelected()==true)
+ if(chckbxIsTemplate.isSelected()==true)
{
Image.image.setVorlage(true);
}
@@ -342,6 +388,8 @@ public class CreateImageTechnisch_GUI extends JFrame {
}
Image.image.setCpu(Integer.valueOf(spinnerCPU.getValue().toString()).intValue());
Image.image.setRam(Integer.valueOf(spinnerRam.getValue().toString()).intValue());
+ Image.image.setOS(comboBox.getSelectedItem().toString());
+ System.out.println("Betriebssystem: "+Image.image.getOS()+", istVorlage: "+Image.image.isVorlage()+", Lizenzpflichtig: "+Image.image.isLicensed()+", Internetsperre: "+Image.image.isInternet()+", CPU: "+Image.image.getCpu()+", RAM: "+Image.image.getRam());
CreateImageFreigabe_GUI ea=new CreateImageFreigabe_GUI();
ea.setVisible(true);
dispose();
@@ -364,13 +412,7 @@ public class CreateImageTechnisch_GUI extends JFrame {
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);
diff --git a/Dozentenmodul/src/main/java/gui/image/DeleteImage_GUI.java b/Dozentenmodul/src/main/java/gui/image/DeleteImage_GUI.java
index 67084a75..3b4cc3ba 100644
--- a/Dozentenmodul/src/main/java/gui/image/DeleteImage_GUI.java
+++ b/Dozentenmodul/src/main/java/gui/image/DeleteImage_GUI.java
@@ -18,8 +18,11 @@ import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.net.URI;
import java.net.URISyntaxException;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
import java.util.Iterator;
import java.util.List;
+import java.util.Map;
import javax.swing.JButton;
import javax.swing.JComboBox;
@@ -45,6 +48,8 @@ import javax.swing.border.EmptyBorder;
import javax.swing.border.TitledBorder;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;
import javax.swing.table.TableRowSorter;
@@ -58,37 +63,75 @@ import server.Server.Client;
import thrift.ThriftConnection;
import util.GuiOrganizer;
import util.OpenLinks;
+import javax.swing.JTextArea;
@SuppressWarnings("serial")
public class DeleteImage_GUI extends JFrame {
private final JPanel contentPanel = new JPanel();
+ JLabel labelName;
+ JLabel labelUpdate;
+ JLabel labelVerantwortlicher;
+ JLabel labelWeitereVerantwortliche;
+ JLabel labelVorlage;
+ JLabel labelLizenzSoftware;
+ JLabel labelInternet;
+ JLabel labelRam;
+ JLabel labelCPU;
+ JLabel labelID;
+ JLabel labelVersion;
+ JTextArea textAreadesc;
+ private JLabel labelOS;
String[] result;
JRadioButton rdbtnInternetJa;
JRadioButton rdbtnInternetNein;
JComboBox<String> comboBox;
JTable tableAllImages;
JTable tablemyImages;
+ JTable tablePublicVorlagen;
private JTextField textFieldName;
JTabbedPane tabbedPane;
- String[] titles = { "Image-Name", "Lizenzpflichtig", "OS", "Veranstaltung",
- "Verantwortlicher", "Letztes Update", "Schlagwort", "ID", "Version" };
- ThriftConnection con=new ThriftConnection();
+ boolean activeSearch = false;
+ String[] titles = { "Name", "Lizenzpflichtig", "OS", "Veranstaltung",
+ "Verantwortlicher", "Letztes Update", "ID", "Version", "Template" }; // Angezeigt
+ // werden
+ // aber
+ // nur
+ // Name
+ // (0),
+ // OS
+ // (2),
+ // Verantwortlicher
+ // (4),
+ // Letztes
+ // Update
+ // (5)
+ ThriftConnection con = new ThriftConnection();
Client client = models.Client.clientcon.getClient();
- final DefaultTableModel modelAll = new DefaultTableModel(titles, 0){
- public boolean isCellEditable(int rowIndex, int mColIndex) {
- return false;
- }
+ final DefaultTableModel modelAll = new DefaultTableModel(titles, 0) {
+ public boolean isCellEditable(int rowIndex, int mColIndex) {
+ return false;
+ }
+ };
+ final DefaultTableModel modelMyImages = new DefaultTableModel(titles, 0) {
+ public boolean isCellEditable(int rowIndex, int mColIndex) {
+ return false;
+ }
+ };
+ final DefaultTableModel modelPublicVorlagen = new DefaultTableModel(titles,
+ 0) {
+ public boolean isCellEditable(int rowIndex, int mColIndex) {
+ return false;
+ }
};
- final DefaultTableModel modelMyImages = new DefaultTableModel(titles,0){
- public boolean isCellEditable(int rowIndex, int mColIndex) {
- return false;
- }
- };
final TableRowSorter<TableModel> rowSorterAll = new TableRowSorter<TableModel>(
modelAll);
final TableRowSorter<TableModel> rowSorterMyImages = new TableRowSorter<TableModel>(
modelMyImages);
+ final TableRowSorter<TableModel> rowSorterPublicVorlagen = new TableRowSorter<TableModel>(
+ modelPublicVorlagen);
+ private JLabel lblBeschreibung_1;
+ private JTextField textField;
/**
* Create the dialog.
@@ -101,10 +144,83 @@ public class DeleteImage_GUI extends JFrame {
con.closeThriftConnection();
System.exit(0);
}
+
+ @Override
+ public void windowOpened(WindowEvent arg0) {
+ initTableModel(modelAll);
+ initTableModel(modelMyImages);
+ initTableModel(modelPublicVorlagen);
+
+ // auszublendende Angaben
+ // 1=Lizenzpflichtig
+ // 3=Veranstaltung
+ // 6=ID
+ // 7=Version
+ // 8=Template
+ tablemyImages.getColumnModel().getColumn(1).setWidth(0);
+ tablemyImages.getColumnModel().getColumn(1).setMinWidth(0);
+ tablemyImages.getColumnModel().getColumn(1).setMaxWidth(0);
+ tablemyImages.getColumnModel().getColumn(3).setWidth(0);
+ tablemyImages.getColumnModel().getColumn(3).setMinWidth(0);
+ tablemyImages.getColumnModel().getColumn(3).setMaxWidth(0);
+ tablemyImages.getColumnModel().getColumn(8).setWidth(0);
+ tablemyImages.getColumnModel().getColumn(8).setMinWidth(0);
+ tablemyImages.getColumnModel().getColumn(8).setMaxWidth(0);
+ tablemyImages.getColumnModel().getColumn(6).setWidth(0);
+ tablemyImages.getColumnModel().getColumn(6).setMinWidth(0);
+ tablemyImages.getColumnModel().getColumn(6).setMaxWidth(0);
+ tablemyImages.getColumnModel().getColumn(7).setWidth(0);
+ tablemyImages.getColumnModel().getColumn(7).setMinWidth(0);
+ tablemyImages.getColumnModel().getColumn(7).setMaxWidth(0);
+
+ tablePublicVorlagen.getColumnModel().getColumn(1).setWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(1)
+ .setMinWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(1)
+ .setMaxWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(3).setWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(3)
+ .setMinWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(3)
+ .setMaxWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(8).setWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(8)
+ .setMinWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(8)
+ .setMaxWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(6).setWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(6)
+ .setMinWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(6)
+ .setMaxWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(7).setWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(7)
+ .setMinWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(7)
+ .setMaxWidth(0);
+
+ tableAllImages.getColumnModel().getColumn(1).setWidth(0);
+ tableAllImages.getColumnModel().getColumn(1).setMinWidth(0);
+ tableAllImages.getColumnModel().getColumn(1).setMaxWidth(0);
+ tableAllImages.getColumnModel().getColumn(3).setWidth(0);
+ tableAllImages.getColumnModel().getColumn(3).setMinWidth(0);
+ tableAllImages.getColumnModel().getColumn(3).setMaxWidth(0);
+ tableAllImages.getColumnModel().getColumn(8).setWidth(0);
+ tableAllImages.getColumnModel().getColumn(8).setMinWidth(0);
+ tableAllImages.getColumnModel().getColumn(8).setMaxWidth(0);
+ tableAllImages.getColumnModel().getColumn(6).setWidth(0);
+ tableAllImages.getColumnModel().getColumn(6).setMinWidth(0);
+ tableAllImages.getColumnModel().getColumn(6).setMaxWidth(0);
+ tableAllImages.getColumnModel().getColumn(7).setWidth(0);
+ tableAllImages.getColumnModel().getColumn(7).setMinWidth(0);
+ tableAllImages.getColumnModel().getColumn(7).setMaxWidth(0);
+ // bis hier
+ textFieldName.requestFocusInWindow();
+ }
});
// Verhindert das Vergroessern Des Fensters
setResizable(false);
-
+
try {
// Setzt das Look & Feel auf System
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
@@ -114,9 +230,9 @@ public class DeleteImage_GUI extends JFrame {
e.printStackTrace();
}
// Setzt den Fenstertitel
- setTitle("bwLehrpool Suite *Prototyp* - Image l\u00F6schen");
+ setTitle("bwLehrpool Suite - Image l\u00F6schen");
// Zentriert das Fenster in die Bildmitte
- setBounds(0, 0, 603, 722);
+ setBounds(0, 0, 918, 722);
GuiOrganizer.centerGUI(this);
final DefaultTableModel model = new DefaultTableModel(titles, 0);
@@ -125,7 +241,7 @@ public class DeleteImage_GUI extends JFrame {
{
JPanel panel = new JPanel();
panel.setBackground(SystemColor.menu);
- panel.setBounds(10, 11, 577, 57);
+ panel.setBounds(10, 11, 892, 57);
getContentPane().add(panel);
panel.setLayout(null);
{
@@ -154,16 +270,16 @@ public class DeleteImage_GUI extends JFrame {
panel_1.setBackground(SystemColor.menu);
panel_1.setBorder(new TitledBorder(null, "Filterfunktionen",
TitledBorder.LEADING, TitledBorder.TOP, null, null));
- panel_1.setBounds(10, 49, 557, 131);
+ panel_1.setBounds(10, 49, 557, 98);
contentPanel.add(panel_1);
panel_1.setLayout(null);
- JLabel lblNewLabel_2 = new JLabel("Anzeigename:");
- lblNewLabel_2.setBounds(10, 30, 250, 20);
+ JLabel lblNewLabel_2 = new JLabel("Name:");
+ lblNewLabel_2.setBounds(10, 30, 80, 20);
panel_1.add(lblNewLabel_2);
JLabel lblInternetIstInnerhalb = new JLabel("Betriebssystem:");
- lblInternetIstInnerhalb.setBounds(10, 58, 250, 20);
+ lblInternetIstInnerhalb.setBounds(10, 58, 80, 20);
panel_1.add(lblInternetIstInnerhalb);
textFieldName = new JTextField();
@@ -176,44 +292,36 @@ public class DeleteImage_GUI extends JFrame {
// Wenn Textfield nicht leer
if (stext != "") {
+ activeSearch = true;
// Filtere nach der Eingabe
rowSorterAll.setRowFilter(RowFilter.regexFilter(
textFieldName.getText(), 0));
rowSorterMyImages.setRowFilter(RowFilter.regexFilter(
textFieldName.getText(), 0));
+ rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter(
+ textFieldName.getText(), 0));
-
+ } else {
+ activeSearch = false;
+ String username = person.verantwortlicher.getName() + " "
+ + person.verantwortlicher.getVorname();
+ rowSorterMyImages.setRowFilter(RowFilter.regexFilter(
+ username, 4));
+ rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter(
+ "true", 8));
+ rowSorterAll.setRowFilter(null);
}
}
});
- textFieldName.setBounds(270, 30, 250, 20);
+ textFieldName.setBounds(96, 30, 166, 20);
panel_1.add(textFieldName);
textFieldName.setColumns(10);
- JLabel lblErweiterteSuche = new JLabel(
- "<html><u>Erweiterte Suche*Folgt noch...*</u></html>");
- lblErweiterteSuche.addMouseListener(new MouseAdapter() {
- @Override
- public void mouseClicked(MouseEvent arg0) {
-
- // oeffnet das Fenster Extended GUI
- con.closeThriftConnection();
-
- // oeffnet das Fenster Extended GUI
-
- //ExtendedSearchForImages_GUI es = new ExtendedSearchForImages_GUI();
- //es.setVisible(true);
- }
- });
- lblErweiterteSuche.setForeground(Color.BLUE);
-
- lblErweiterteSuche.setBounds(332, 106, 188, 14);
- panel_1.add(lblErweiterteSuche);
-
comboBox = new JComboBox<String>();
try {
- // Holt sich eine Liste aller verf\u00FCgbaren Betriebssysteme vom Server
+ // Holt sich eine Liste aller verf\u00FCgbaren Betriebssysteme vom
+ // Server
List<String> list = client.getAllOS();
// Leeres Item hinzufuegen
comboBox.addItem("");
@@ -225,25 +333,45 @@ public class DeleteImage_GUI extends JFrame {
// TODO Auto-generated catch block
e2.printStackTrace();
JOptionPane.showMessageDialog(null,
- e2.getCause()+"\n"+e2.getMessage(),
- "Debug-Message", JOptionPane.ERROR_MESSAGE);
+ e2.getCause() + "\n" + e2.getStackTrace(), "Debug-Message",
+ JOptionPane.ERROR_MESSAGE);
}
// Registriert Auswahlaenderungen der Box
comboBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
// Prueft das die Auswahl nicht leer ist
if (comboBox.getSelectedItem().toString() != "") {
- // Filtert nach dem ausgewaehlten Betriebssystem
+ activeSearch = true;
rowSorterAll.setRowFilter(RowFilter.regexFilter(comboBox
.getSelectedItem().toString(), 2));
rowSorterMyImages.setRowFilter(RowFilter.regexFilter(
comboBox.getSelectedItem().toString(), 2));
+ rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter(
+ comboBox.getSelectedItem().toString(), 2));
+ } else {
+ activeSearch = false;
+ String username = person.verantwortlicher.getName() + " "
+ + person.verantwortlicher.getVorname();
+ rowSorterMyImages.setRowFilter(RowFilter.regexFilter(
+ username, 4));
+ rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter(
+ "true", 8));
+ rowSorterAll.setRowFilter(null);
}
}
});
- comboBox.setBounds(270, 58, 250, 20);
+ comboBox.setBounds(96, 58, 166, 20);
panel_1.add(comboBox);
+
+ lblBeschreibung_1 = new JLabel("Beschreibung:");
+ lblBeschreibung_1.setBounds(291, 30, 80, 20);
+ panel_1.add(lblBeschreibung_1);
+
+ textField = new JTextField();
+ textField.setColumns(10);
+ textField.setBounds(381, 30, 166, 20);
+ panel_1.add(textField);
JLabel lblHauptmen = new JLabel("Hauptmen\u00FC");
lblHauptmen.addMouseListener(new MouseAdapter() {
@@ -254,7 +382,7 @@ public class DeleteImage_GUI extends JFrame {
con.closeThriftConnection();
// oeffnet das Hauuetmenue
-
+
DeleteImage_GUI.this.setVisible(false);
MainMenue_GUI main = new MainMenue_GUI();
main.setVisible(true);
@@ -268,59 +396,66 @@ public class DeleteImage_GUI extends JFrame {
label_1.setBounds(69, 11, 13, 14);
contentPanel.add(label_1);
- JLabel lblVlimage = new JLabel("VL-Image");
+ JLabel lblVlimage = new JLabel("Image");
lblVlimage.setForeground(Color.BLUE);
lblVlimage.setBounds(81, 11, 45, 14);
contentPanel.add(lblVlimage);
JLabel label_2 = new JLabel(">");
- label_2.setBounds(133, 11, 13, 14);
+ label_2.setBounds(115, 11, 13, 14);
contentPanel.add(label_2);
JLabel lblNewLabel_1 = new JLabel("Imageauswahl");
- lblNewLabel_1.setBounds(146, 11, 85, 14);
+ lblNewLabel_1.setBounds(128, 11, 85, 14);
contentPanel.add(lblNewLabel_1);
tabbedPane = new JTabbedPane(JTabbedPane.TOP);
tabbedPane.addChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent arg0) {
- System.out.println(tabbedPane.getSelectedIndex());
- if (tabbedPane.getSelectedIndex() == 0) {
+ // System.out.println(tabbedPane.getSelectedIndex());
+ if (tabbedPane.getSelectedIndex() == 0 && activeSearch == false) {
String username = person.verantwortlicher.getName() + " "
+ person.verantwortlicher.getVorname();
- // String username="Spitzer Tobias";
rowSorterMyImages.setRowFilter(RowFilter.regexFilter(
username, 4));
- } else if (tabbedPane.getSelectedIndex() == 1) {
-
+ } else if (tabbedPane.getSelectedIndex() == 1
+ && activeSearch == false) {
+ rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter(
+ "true", 8));
+ } else if (tabbedPane.getSelectedIndex() == 2
+ && activeSearch == false) {
+ rowSorterAll.setRowFilter(null);
}
}
});
- tabbedPane.setBounds(10, 197, 557, 300);
+ tabbedPane.setBounds(10, 158, 557, 339);
contentPanel.add(tabbedPane);
- initTableModel(modelMyImages);
-
- JScrollPane scrollPaneAllImages = new JScrollPane();
- tableAllImages = new JTable();
- tableAllImages.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
- tableAllImages.setModel(modelAll);
- tableAllImages.getColumnModel().getColumn(1).sizeWidthToFit();
- tableAllImages.getColumnModel().getColumn(2).sizeWidthToFit();
- tableAllImages.getColumnModel().getColumn(3).sizeWidthToFit();
- tableAllImages.getColumnModel().getColumn(4).sizeWidthToFit();
- tableAllImages.getColumnModel().getColumn(5).sizeWidthToFit();
- initTableModel(modelAll);
JScrollPane scrollPaneMyImage = new JScrollPane();
tablemyImages = new JTable();
+ tablemyImages.getSelectionModel().addListSelectionListener(
+ new ListSelectionListener() {
+ public void valueChanged(ListSelectionEvent e) {
+ String imageid = modelMyImages.getValueAt(
+ tablemyImages
+ .convertRowIndexToModel(tablemyImages
+ .getSelectedRow()), 6)
+ .toString();
+ // System.out.println(imageid);
+ String version = modelMyImages.getValueAt(
+ tablemyImages
+ .convertRowIndexToModel(tablemyImages
+ .getSelectedRow()), 7)
+ .toString();
+ // System.out.println(version);
+ writeImageData(imageid, version);
+ }
+ });
tablemyImages.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
- tablemyImages.setEnabled(true);
-
tablemyImages.setModel(modelMyImages);
-
tablemyImages.getColumnModel().getColumn(1).sizeWidthToFit();
tablemyImages.getColumnModel().getColumn(2).sizeWidthToFit();
tablemyImages.getColumnModel().getColumn(3).sizeWidthToFit();
@@ -330,10 +465,6 @@ public class DeleteImage_GUI extends JFrame {
scrollPaneMyImage.setViewportView(tablemyImages);
tabbedPane.addTab("Meine Images", null, scrollPaneMyImage, null);
- tableAllImages.setRowSorter(rowSorterAll);
-
- scrollPaneAllImages.setViewportView(tableAllImages);
- tabbedPane.addTab("Alle", null, scrollPaneAllImages, null);
JScrollPane scrollPaneCoopImages = new JScrollPane();
JTable tableCoopImages = new JTable();
@@ -345,69 +476,318 @@ public class DeleteImage_GUI extends JFrame {
tableCoopImages.getColumnModel().getColumn(4).sizeWidthToFit();
tableCoopImages.getColumnModel().getColumn(5).sizeWidthToFit();
- scrollPaneCoopImages.setViewportView(tableCoopImages);
- tabbedPane.addTab("Kooperative Images", null, scrollPaneCoopImages,
- null);
- tabbedPane.setEnabledAt(2, false);
-
- JScrollPane scrollPanePublicImages = new JScrollPane();
- JTable tablePublicImages = new JTable();
- tablePublicImages.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
- tablePublicImages.setModel(model);
- tablePublicImages.getColumnModel().getColumn(1).sizeWidthToFit();
- tablePublicImages.getColumnModel().getColumn(2).sizeWidthToFit();
- tablePublicImages.getColumnModel().getColumn(3).sizeWidthToFit();
- tablePublicImages.getColumnModel().getColumn(4).sizeWidthToFit();
- tablePublicImages.getColumnModel().getColumn(5).sizeWidthToFit();
-
- scrollPanePublicImages.setViewportView(tablePublicImages);
- tabbedPane.addTab("\u00D6ffentliche Images", null,
- scrollPanePublicImages, null);
- tabbedPane.setEnabledAt(3, false);
-
JScrollPane scrollPanePublicVorlagen = new JScrollPane();
- JTable tablePublicVorlagen = new JTable();
+ tablePublicVorlagen = new JTable();
+ tablePublicVorlagen.getSelectionModel().addListSelectionListener(
+ new ListSelectionListener() {
+ public void valueChanged(ListSelectionEvent e) {
+ String imageid = modelPublicVorlagen
+ .getValueAt(
+ tablePublicVorlagen
+ .convertRowIndexToModel(tablePublicVorlagen
+ .getSelectedRow()), 6)
+ .toString();
+ // System.out.println(imageid);
+ String version = modelPublicVorlagen
+ .getValueAt(
+ tablePublicVorlagen
+ .convertRowIndexToModel(tablePublicVorlagen
+ .getSelectedRow()), 7)
+ .toString();
+ // System.out.println(version);
+ writeImageData(imageid, version);
+ }
+ });
+ tablePublicVorlagen.setModel(modelPublicVorlagen);
tablePublicVorlagen
.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
- tablePublicVorlagen.setModel(model);
+
tablePublicVorlagen.getColumnModel().getColumn(1).sizeWidthToFit();
tablePublicVorlagen.getColumnModel().getColumn(2).sizeWidthToFit();
tablePublicVorlagen.getColumnModel().getColumn(3).sizeWidthToFit();
tablePublicVorlagen.getColumnModel().getColumn(4).sizeWidthToFit();
tablePublicVorlagen.getColumnModel().getColumn(5).sizeWidthToFit();
-
+ tablePublicVorlagen.setRowSorter(rowSorterPublicVorlagen);
scrollPanePublicVorlagen.setViewportView(tablePublicVorlagen);
- tabbedPane.addTab("\u00D6ffentliche Vorlagen", null,
- scrollPanePublicVorlagen, null);
- tabbedPane.setEnabledAt(4, false);
+ tabbedPane.addTab("Vorlagen", null, scrollPanePublicVorlagen, null);
+
+ JScrollPane scrollPaneAllImages = new JScrollPane();
+ tableAllImages = new JTable();
+ tableAllImages.getSelectionModel().addListSelectionListener(
+ new ListSelectionListener() {
+ public void valueChanged(ListSelectionEvent e) {
+
+ String imageid = modelAll.getValueAt(
+ tableAllImages
+ .convertRowIndexToModel(tableAllImages
+ .getSelectedRow()), 6)
+ .toString();
+ // System.out.println(imageid);
+ String version = modelAll.getValueAt(
+ tableAllImages
+ .convertRowIndexToModel(tableAllImages
+ .getSelectedRow()), 7)
+ .toString();
+ // System.out.println(version);
+ writeImageData(imageid, version);
+
+ }
+ });
+ tableAllImages.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+ tableAllImages.setModel(modelAll);
+ tableAllImages.getColumnModel().getColumn(1).sizeWidthToFit();
+ tableAllImages.getColumnModel().getColumn(2).sizeWidthToFit();
+ tableAllImages.getColumnModel().getColumn(3).sizeWidthToFit();
+ tableAllImages.getColumnModel().getColumn(4).sizeWidthToFit();
+ tableAllImages.getColumnModel().getColumn(5).sizeWidthToFit();
+ tableAllImages.setRowSorter(rowSorterAll);
+
+ scrollPaneAllImages.setViewportView(tableAllImages);
+ tabbedPane.addTab("Alle", null, scrollPaneAllImages, null);
+
+ scrollPaneCoopImages.setViewportView(tableCoopImages);
+ tabbedPane.addTab("bwLehrpool", null, scrollPaneCoopImages, null);
+ tabbedPane.setEnabledAt(3, false);
JButton btnDelete = new JButton("L\u00F6schen");
btnDelete.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
- String imageid="";
- String imageversion="";
+ String imageid = "";
+ String imageversion = "";
int eingabe;
-
+ String username = person.verantwortlicher.getName() + " "
+ + person.verantwortlicher.getVorname();
if (tablemyImages.getSelectedRowCount() != 0) {
// frage, soll das selektierte Daten geloescht werden?
eingabe = JOptionPane.showConfirmDialog(null,
- "Wollen Sie diese Daten l\u00f6schen?", "L\u00f6schen?",
- JOptionPane.YES_NO_OPTION);
+ "Wollen Sie diese Daten l\u00f6schen?",
+ "L\u00f6schen?", JOptionPane.YES_NO_OPTION);
if (eingabe == JOptionPane.YES_OPTION) {
imageid = modelMyImages.getValueAt(
tablemyImages
.convertRowIndexToModel(tablemyImages
- .getSelectedRow()), 7)
+ .getSelectedRow()), 6)
.toString();
imageversion = modelMyImages.getValueAt(
tablemyImages
.convertRowIndexToModel(tablemyImages
- .getSelectedRow()), 8)
+ .getSelectedRow()), 7)
+ .toString();
+
+ // TODO
+ // Image darf nur geloescht werden, wenn keine
+ // Veranstaltung mehr auf das Image verweist.
+ // Unbdingt abfragen!
+
+ try {
+ if (!client.connectedToLecture(imageid,
+ imageversion)) {
+ // System.out.println(imageid);
+ // System.out.println(imageversion);
+ try {
+ client.deleteImageServer(imageid,
+ imageversion);
+ if (client.deleteImageData(imageid,
+ imageversion)) {
+ // if (client.deleteImageServer(imageid
+ // ,imageversion)) {
+
+ DeleteImage_GUI di = new DeleteImage_GUI();
+ di.setVisible(true);
+ dispose();
+
+ /*
+ * } else {
+ *
+ * JOptionPane.showConfirmDialog(null,
+ * "Loeschen vom Server hat leider nicht geklappt!!"
+ * , imageversion,
+ * JOptionPane.OK_CANCEL_OPTION); }
+ */
+
+ } else {
+
+ JOptionPane
+ .showConfirmDialog(
+ null,
+ "L\u00f6schen von der DB hat leider nicht geklappt!!",
+ "Fehler",
+ JOptionPane.INFORMATION_MESSAGE);
+ }
+ } catch (HeadlessException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ JOptionPane.showMessageDialog(
+ null,
+ e.getCause() + "\n"
+ + e.getStackTrace(),
+ "Debug-Message",
+ JOptionPane.ERROR_MESSAGE);
+ } catch (TException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ JOptionPane.showMessageDialog(
+ null,
+ e.getCause() + "\n"
+ + e.getStackTrace(),
+ "Debug-Message",
+ JOptionPane.ERROR_MESSAGE);
+ }
+
+ } else {
+
+ JOptionPane
+ .showMessageDialog(
+ null,
+ "Image kann nicht gel\u00f6scht werden, da mindestens eine Veranstaltung mit diesem Image verlinkt ist.",
+ "Verlinkung vorhanden",
+ JOptionPane.INFORMATION_MESSAGE);
+ }
+ } catch (TException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ JOptionPane.showMessageDialog(null, e.getCause()
+ + "\n" + e.getStackTrace(),
+ "Debug-Message", JOptionPane.ERROR_MESSAGE);
+ }
+ }
+
+ } else if (tablePublicVorlagen.getSelectedRowCount() != 0
+ && modelPublicVorlagen
+ .getValueAt(
+ tablePublicVorlagen
+ .convertRowIndexToModel(tablePublicVorlagen
+ .getSelectedRow()), 4)
+ .equals(username)) {
+
+ // frage, soll das selektierte Daten geloescht werden?
+ eingabe = JOptionPane.showConfirmDialog(null,
+ "Wollen Sie diese Daten l\u00f6schen?",
+ "L\u00f6schen?", JOptionPane.YES_NO_OPTION);
+
+ if (eingabe == JOptionPane.YES_OPTION) {
+
+ imageid = modelPublicVorlagen
+ .getValueAt(
+ tablePublicVorlagen
+ .convertRowIndexToModel(tablePublicVorlagen
+ .getSelectedRow()), 6)
+ .toString();
+
+ imageversion = modelPublicVorlagen
+ .getValueAt(
+ tablePublicVorlagen
+ .convertRowIndexToModel(tablePublicVorlagen
+ .getSelectedRow()), 7)
+ .toString();
+
+ // TODO
+ // Image darf nur geloescht werden, wenn keine
+ // Veranstaltung mehr auf das Image verweist.
+ // Unbdingt abfragen!
+
+ try {
+ if (!client.connectedToLecture(imageid,
+ imageversion)) {
+ // System.out.println(imageid);
+ // System.out.println(imageversion);
+ try {
+ client.deleteImageServer(imageid,
+ imageversion);
+ if (client.deleteImageData(imageid,
+ imageversion)) {
+ // if (client.deleteImageServer(imageid
+ // ,imageversion)) {
+
+ DeleteImage_GUI di = new DeleteImage_GUI();
+ di.setVisible(true);
+ dispose();
+
+ /*
+ * } else {
+ *
+ * JOptionPane.showConfirmDialog(null,
+ * "Loeschen vom Server hat leider nicht geklappt!!"
+ * , imageversion,
+ * JOptionPane.OK_CANCEL_OPTION); }
+ */
+
+ } else {
+
+ JOptionPane
+ .showConfirmDialog(
+ null,
+ "L\u00f6schen von der DB hat leider nicht geklappt!!",
+ "Fehler",
+ JOptionPane.INFORMATION_MESSAGE);
+ }
+ } catch (HeadlessException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ JOptionPane.showMessageDialog(
+ null,
+ e.getCause() + "\n"
+ + e.getStackTrace(),
+ "Debug-Message",
+ JOptionPane.ERROR_MESSAGE);
+ } catch (TException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ JOptionPane.showMessageDialog(
+ null,
+ e.getCause() + "\n"
+ + e.getStackTrace(),
+ "Debug-Message",
+ JOptionPane.ERROR_MESSAGE);
+ }
+
+ } else {
+
+ JOptionPane
+ .showMessageDialog(
+ null,
+ "Image kann nicht gel\u00f6scht werden, da mindestens eine Veranstaltung mit diesem Image verlinkt ist.",
+ "Verlinkung vorhanden",
+ JOptionPane.INFORMATION_MESSAGE);
+ }
+ } catch (TException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ JOptionPane.showMessageDialog(null, e.getCause()
+ + "\n" + e.getStackTrace(),
+ "Debug-Message", JOptionPane.ERROR_MESSAGE);
+ }
+ }
+
+ } else if (tableAllImages.getSelectedRowCount() != 0
+ && modelAll.getValueAt(
+ tableAllImages
+ .convertRowIndexToModel(tableAllImages
+ .getSelectedRow()), 4).equals(
+ username)) {
+
+ // frage, soll das selektierte Daten geloescht werden?
+ eingabe = JOptionPane.showConfirmDialog(null,
+ "Wollen Sie diese Daten l\u00f6schen?",
+ "L\u00f6schen?", JOptionPane.YES_NO_OPTION);
+
+ if (eingabe == JOptionPane.YES_OPTION) {
+
+ imageid = modelAll.getValueAt(
+ tableAllImages
+ .convertRowIndexToModel(tableAllImages
+ .getSelectedRow()), 6)
+ .toString();
+
+ imageversion = modelAll.getValueAt(
+ tableAllImages
+ .convertRowIndexToModel(tableAllImages
+ .getSelectedRow()), 7)
.toString();
// TODO
@@ -418,23 +798,20 @@ public class DeleteImage_GUI extends JFrame {
try {
if (!client.connectedToLecture(imageid,
imageversion)) {
- System.out.println(imageid);
- System.out.println(imageversion);
+ // System.out.println(imageid);
+ // System.out.println(imageversion);
try {
- client.deleteImageServer(imageid, imageversion);
+ client.deleteImageServer(imageid,
+ imageversion);
if (client.deleteImageData(imageid,
imageversion)) {
// if (client.deleteImageServer(imageid
// ,imageversion)) {
-
-
-
-
+
DeleteImage_GUI di = new DeleteImage_GUI();
di.setVisible(true);
dispose();
-
-
+
/*
* } else {
*
@@ -456,28 +833,37 @@ public class DeleteImage_GUI extends JFrame {
} catch (HeadlessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
- JOptionPane.showMessageDialog(null,
- e.getCause()+"\n"+e.getMessage(),
- "Debug-Message", JOptionPane.ERROR_MESSAGE);
+ JOptionPane.showMessageDialog(
+ null,
+ e.getCause() + "\n"
+ + e.getStackTrace(),
+ "Debug-Message",
+ JOptionPane.ERROR_MESSAGE);
} catch (TException e) {
// TODO Auto-generated catch block
e.printStackTrace();
- JOptionPane.showMessageDialog(null,
- e.getCause()+"\n"+e.getMessage(),
- "Debug-Message", JOptionPane.ERROR_MESSAGE);
+ JOptionPane.showMessageDialog(
+ null,
+ e.getCause() + "\n"
+ + e.getStackTrace(),
+ "Debug-Message",
+ JOptionPane.ERROR_MESSAGE);
}
} else {
-
- JOptionPane.showMessageDialog(null,
- "Image kann nicht gel\u00f6scht werden, da mindestens eine Veranstaltung mit diesem Image verlinkt ist.",
- "Verlinkung vorhanden", JOptionPane.INFORMATION_MESSAGE);
+
+ JOptionPane
+ .showMessageDialog(
+ null,
+ "Image kann nicht gel\u00f6scht werden, da mindestens eine Veranstaltung mit diesem Image verlinkt ist.",
+ "Verlinkung vorhanden",
+ JOptionPane.INFORMATION_MESSAGE);
}
} catch (TException e) {
// TODO Auto-generated catch block
e.printStackTrace();
- JOptionPane.showMessageDialog(null,
- e.getCause()+"\n"+e.getMessage(),
+ JOptionPane.showMessageDialog(null, e.getCause()
+ + "\n" + e.getStackTrace(),
"Debug-Message", JOptionPane.ERROR_MESSAGE);
}
}
@@ -495,7 +881,7 @@ public class DeleteImage_GUI extends JFrame {
contentPanel.add(btnDelete);
{
JPanel buttonPane = new JPanel();
- buttonPane.setBounds(0, 640, 597, 33);
+ buttonPane.setBounds(0, 640, 902, 33);
buttonPane.setBackground(SystemColor.menu);
buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
getContentPane().add(buttonPane);
@@ -508,7 +894,6 @@ public class DeleteImage_GUI extends JFrame {
con.closeThriftConnection();
// oeffnet das Hauptmenue
-
MainMenue_GUI main = new MainMenue_GUI();
main.setVisible(true);
@@ -522,13 +907,138 @@ public class DeleteImage_GUI extends JFrame {
}
JSeparator separator = new JSeparator();
- separator.setBounds(0, 78, 597, 2);
+ separator.setBounds(0, 79, 912, 1);
getContentPane().add(separator);
JSeparator separator_1 = new JSeparator();
- separator_1.setBounds(0, 627, 597, 2);
+ separator_1.setBounds(0, 627, 912, 2);
getContentPane().add(separator_1);
+ JPanel panel = new JPanel();
+ panel.setLayout(null);
+ panel.setBorder(new TitledBorder(null, "Detailinformationen",
+
+ TitledBorder.LEADING, TitledBorder.TOP, null, null));
+ panel.setBackground(SystemColor.menu);
+ panel.setBounds(586, 85, 316, 531);
+ getContentPane().add(panel);
+
+ JLabel lblName = new JLabel("Name:");
+ lblName.setBounds(10, 87, 130, 14);
+ panel.add(lblName);
+
+ labelName = new JLabel("");
+ labelName.setBounds(10, 102, 296, 14);
+ panel.add(labelName);
+
+ JLabel lblVerantwortlicher = new JLabel("Verantwortlicher:");
+ lblVerantwortlicher.setBounds(10, 259, 130, 14);
+ panel.add(lblVerantwortlicher);
+
+ labelOS = new JLabel("");
+ labelOS.setBounds(10, 216, 296, 14);
+ panel.add(labelOS);
+
+ JLabel lblWeitereVerantwortliche = new JLabel("Betriebssystem:");
+ lblWeitereVerantwortliche.setBounds(10, 202, 130, 14);
+ panel.add(lblWeitereVerantwortliche);
+
+ labelVerantwortlicher = new JLabel("");
+ labelVerantwortlicher.setBounds(10, 272, 296, 14);
+ panel.add(labelVerantwortlicher);
+
+ JLabel label = new JLabel("Weitere Verantwortliche:");
+ label.setBounds(10, 284, 130, 14);
+ panel.add(label);
+
+ labelWeitereVerantwortliche = new JLabel("");
+ labelWeitereVerantwortliche.setBounds(10, 297, 296, 14);
+ panel.add(labelWeitereVerantwortliche);
+
+ labelUpdate = new JLabel("");
+ labelUpdate.setBounds(10, 245, 296, 14);
+ panel.add(labelUpdate);
+
+ JLabel lblLetztesUpdate = new JLabel("Letztes Update:");
+ lblLetztesUpdate.setBounds(10, 231, 130, 14);
+ panel.add(lblLetztesUpdate);
+
+ JLabel lblImageIstVorlage = new JLabel("Image ist Vorlage:");
+ lblImageIstVorlage.setBounds(10, 336, 130, 14);
+ panel.add(lblImageIstVorlage);
+
+ labelVorlage = new JLabel("");
+ labelVorlage.setBounds(10, 350, 296, 14);
+ panel.add(labelVorlage);
+
+ labelLizenzSoftware = new JLabel("");
+ labelLizenzSoftware.setBounds(10, 383, 296, 14);
+ panel.add(labelLizenzSoftware);
+
+ JLabel lblLizenzpflichtigeSoftware = new JLabel(
+ "Lizenzpflichtige Software:");
+ lblLizenzpflichtigeSoftware.setBounds(10, 367, 130, 14);
+ panel.add(lblLizenzpflichtigeSoftware);
+
+ JLabel lblInternet = new JLabel("Internetsperre vorhanden:");
+ lblInternet.setBounds(10, 400, 130, 14);
+ panel.add(lblInternet);
+
+ labelInternet = new JLabel("");
+ labelInternet.setBounds(10, 417, 296, 14);
+ panel.add(labelInternet);
+
+ JLabel lblEmpfehlungRam = new JLabel("Empfehlung RAM:");
+ lblEmpfehlungRam.setBounds(10, 432, 130, 14);
+ panel.add(lblEmpfehlungRam);
+
+ labelRam = new JLabel("");
+ labelRam.setBounds(10, 455, 296, 14);
+ panel.add(labelRam);
+
+ JLabel lblEmpfehlungCpu = new JLabel("Empfehlung CPU:");
+ lblEmpfehlungCpu.setBounds(10, 469, 130, 14);
+ panel.add(lblEmpfehlungCpu);
+
+ labelCPU = new JLabel("");
+ labelCPU.setBounds(10, 487, 296, 14);
+ panel.add(labelCPU);
+
+ JLabel lblTechnischeDaten = new JLabel("Technische Daten:");
+ lblTechnischeDaten.setBounds(10, 322, 296, 14);
+ panel.add(lblTechnischeDaten);
+
+ JLabel lblId = new JLabel("ID:");
+ lblId.setBounds(10, 23, 296, 14);
+ panel.add(lblId);
+
+ labelID = new JLabel("");
+ labelID.setBounds(10, 37, 296, 14);
+ panel.add(labelID);
+
+ labelVersion = new JLabel("");
+ labelVersion.setBounds(10, 73, 296, 14);
+ panel.add(labelVersion);
+
+ JLabel lblVersion = new JLabel("Version:");
+ lblVersion.setBounds(10, 57, 296, 14);
+ panel.add(lblVersion);
+
+ JLabel lblBeschreibung = new JLabel("Beschreibung:");
+ lblBeschreibung.setBounds(10, 119, 130, 14);
+ panel.add(lblBeschreibung);
+
+ JScrollPane scrollPane = new JScrollPane();
+ scrollPane.setBounds(10, 135, 296, 65);
+ panel.add(scrollPane);
+
+ textAreadesc = new JTextArea();
+ textAreadesc.setEditable(false);
+ textAreadesc.setFont(new Font("Tahoma", Font.PLAIN, 11));
+ textAreadesc.setLineWrap(true);
+ textAreadesc.setBackground(SystemColor.menu);
+ scrollPane.setViewportView(textAreadesc);
+
JMenuBar menuBar = new JMenuBar();
setJMenuBar(menuBar);
@@ -539,15 +1049,15 @@ public class DeleteImage_GUI extends JFrame {
mntmFaq.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent arg0) {
-
+
OpenLinks open = new OpenLinks();
-
+
URI windows;
try {
windows = new URI(Links.getFAQ());
-
+
open.openWebpage(windows);
-
+
} catch (URISyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
@@ -555,7 +1065,6 @@ public class DeleteImage_GUI extends JFrame {
}
});
mnNewMenu_1.add(mntmFaq);
-
JMenuItem mntmOtrs = new JMenuItem("OTRS");
mntmOtrs.addMouseListener(new MouseAdapter() {
@@ -563,22 +1072,22 @@ public class DeleteImage_GUI extends JFrame {
public void mousePressed(MouseEvent arg0) {
OpenLinks open = new OpenLinks();
-
+
URI windows;
try {
windows = new URI(Links.getOTRS());
-
+
open.openWebpage(windows);
-
+
} catch (URISyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
-
+
}
});
mnNewMenu_1.add(mntmOtrs);
-
+
JMenuItem menuItem = new JMenuItem("About");
menuItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
@@ -590,7 +1099,7 @@ public class DeleteImage_GUI extends JFrame {
}
- // Initiale Beff\u00FClung eines Table models
+ // Initiale Beffuelung eines Table models
public DefaultTableModel initTableModel(DefaultTableModel model) {
List<server.Image> images;
try {
@@ -600,19 +1109,22 @@ public class DeleteImage_GUI extends JFrame {
Iterator<server.Image> i = images.iterator();
int x = 0;
-
+ SimpleDateFormat in = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
+ SimpleDateFormat out = new SimpleDateFormat("dd.MM.yyyy hh:mm:ss");
while (i.hasNext()) {
- // erzeuge Objekte f\u00FCr die Tabelle
+
+ // System.out.println(out.format(in.parse(images.get(x).updateTime)));
+
+ // erzeuge Objekte fuer die Tabelle
Object[] obj = { images.get(x).getImageName(),
images.get(x).getLicenseRestriction(),
images.get(x).getOsName(),
images.get(x).getLectureName(),
images.get(x).getUserData(),
- images.get(x).getUpdateTime(), "", images.get(x).id,
- images.get(x).getVersion() };
- // System.out.println("id:"+images.get(x).getId());
- // F\u00FCge diese Objekte der Tabelle hinzu
-
+ out.format(in.parse(images.get(x).updateTime)),
+ images.get(x).id, images.get(x).getVersion(),
+ images.get(x).getIsTemplate() };
+ // Fuege diese Objekte der Tabelle hinzu
model.addRow(obj);
x++;
i.next();
@@ -620,14 +1132,49 @@ public class DeleteImage_GUI extends JFrame {
}
return model;
- } catch (TException e1) {
+ } catch (TException | ParseException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
JOptionPane.showMessageDialog(null,
- e1.getCause()+"\n"+e1.getMessage(),
- "Debug-Message", JOptionPane.ERROR_MESSAGE);
+ e1.getCause() + "\n" + e1.getStackTrace(), "Debug-Message",
+ JOptionPane.ERROR_MESSAGE);
}
return model;
}
+ public void writeImageData(String id, String version) {
+ try {
+ SimpleDateFormat in = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
+ SimpleDateFormat out = new SimpleDateFormat("dd.MM.yyyy hh:mm:ss");
+ Map<String, String> res = client.getImageData(id, version);
+ labelName.setText(res.get("name"));
+ labelOS.setText(res.get("os"));
+ labelUpdate.setText(out.format(in.parse(res.get("lastupdate"))));
+ labelVerantwortlicher.setText(res.get("owner"));
+ labelWeitereVerantwortliche.setText("Noch nicht Verf�gbar");
+ if (res.get("template").equals("true")) {
+ labelVorlage.setText("Ja");
+ } else {
+ labelVorlage.setText("Nein");
+ }
+ if (res.get("license").equals("1")) {
+ labelLizenzSoftware.setText("Ja");
+ } else {
+ labelLizenzSoftware.setText("Nein");
+ }
+ if (res.get("internet").equals("1")) {
+ labelInternet.setText("Ja");
+ } else {
+ labelInternet.setText("Nein");
+ }
+ labelRam.setText(res.get("ram"));
+ labelCPU.setText(res.get("cpu"));
+ labelID.setText(res.get("id"));
+ labelVersion.setText(res.get("version"));
+ textAreadesc.setText(res.get("desc"));
+ } catch (TException | ParseException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ }
}
diff --git a/Dozentenmodul/src/main/java/gui/image/EditImageAllgemein_GUI.java b/Dozentenmodul/src/main/java/gui/image/EditImageAllgemein_GUI.java
index 59483fde..4c6e5629 100644
--- a/Dozentenmodul/src/main/java/gui/image/EditImageAllgemein_GUI.java
+++ b/Dozentenmodul/src/main/java/gui/image/EditImageAllgemein_GUI.java
@@ -44,6 +44,7 @@ import server.Server.Client;
import thrift.ThriftConnection;
import util.GuiOrganizer;
import util.OpenLinks;
+import javax.swing.JScrollPane;
@SuppressWarnings("serial")
public class EditImageAllgemein_GUI extends JFrame {
@@ -55,6 +56,7 @@ public class EditImageAllgemein_GUI extends JFrame {
private JTextField Hochschule;
private JTextField EMail;
private JTextField imagename;
+ private JTextArea textAreadesc;
ThriftConnection con = new ThriftConnection();
Client client = models.Client.clientcon.getClient();
private JPanel panel_2;
@@ -63,6 +65,10 @@ public class EditImageAllgemein_GUI extends JFrame {
private JPanel buttonPane;
private JButton backButton;
private JButton okButton;
+ private boolean textfieldsHaveContent = false; //no textfield is empty
+ private boolean nameIsOK = false; //imagename only contains letters
+ private boolean descriptionLengthOK = false; //description may not be longer than MAX_DESCRIPTION_LENGTH
+ private final int MAX_DESCRIPTION_LENGTH = 254;
/**
* Create the dialog.
@@ -87,7 +93,7 @@ public class EditImageAllgemein_GUI extends JFrame {
e.printStackTrace();
}
// Setzt den Fenstertitel
- setTitle("bwLehrpool Suite *Prototyp* - Image bearbeiten");
+ setTitle("bwLehrpool Suite - Image bearbeiten");
// Zentriert das Fenster in der Bildmitte
setBounds(0, 0, 603, 722);
@@ -187,7 +193,7 @@ public class EditImageAllgemein_GUI extends JFrame {
JLabel lblImagename = new JLabel("Imagename: *");
lblImagename.setBackground(SystemColor.menu);
- lblImagename.setBounds(10, 31, 125, 20);
+ lblImagename.setBounds(10, 23, 125, 20);
panel_1.add(lblImagename);
imagename = new JTextField();
@@ -196,7 +202,7 @@ public class EditImageAllgemein_GUI extends JFrame {
imagename.setBackground(Color.WHITE);
imagename.setText(Image.image.getImagename());
imagename.setColumns(10);
- imagename.setBounds(145, 31, 350, 20);
+ imagename.setBounds(145, 23, 350, 20);
panel_1.add(imagename);
JTextArea txtrGebenSieBitte = new JTextArea();
@@ -205,8 +211,36 @@ public class EditImageAllgemein_GUI extends JFrame {
txtrGebenSieBitte.setFont(new Font("Tahoma", Font.PLAIN, 12));
txtrGebenSieBitte
.setText("Geben Sie bitte einen sprechenden Namen f\u00FCr das Image an.\r\nDieser soll jedoch recht allgemein gehalten werden.\r\nBeispiel: \"Programmieren\", nicht \"Programmieren 1\"");
- txtrGebenSieBitte.setBounds(145, 62, 350, 110);
+ txtrGebenSieBitte.setBounds(145, 48, 350, 55);
panel_1.add(txtrGebenSieBitte);
+
+ JLabel lblBeschreibung = new JLabel("Beschreibung: *");
+ lblBeschreibung.setBackground(SystemColor.menu);
+ lblBeschreibung.setBounds(10, 110, 125, 20);
+ panel_1.add(lblBeschreibung);
+
+ JScrollPane scrollPane = new JScrollPane();
+ scrollPane.setBounds(145, 110, 350, 60);
+ panel_1.add(scrollPane);
+
+ textAreadesc = new JTextArea();
+ textAreadesc.setFont(new Font("Tahoma", Font.PLAIN, 11));
+ textAreadesc.setLineWrap(true);
+ textAreadesc.setText((String) null);
+ textAreadesc.setText(Image.image.getDesc());// null am Anfang, aber
+ // speichert die Eingabe,
+ // wenn man zurueck kommt
+ // zur Seite
+ scrollPane.setViewportView(textAreadesc);
+
+ JTextArea textArea = new JTextArea();
+ textArea.setText("Geben Sie bitte eine Beschreibung für das Image an.\r\nDiese soll jedoch recht spezifisch gehalten werden.\r\nBeispiel: \"Java-Enticklung mit eclipse und MySQL\"");
+ textArea.setLineWrap(true);
+ textArea.setFont(new Font("Tahoma", Font.PLAIN, 12));
+ textArea.setEditable(false);
+ textArea.setBackground(SystemColor.menu);
+ textArea.setBounds(145, 177, 350, 49);
+ panel_1.add(textArea);
JPanel panel = new JPanel();
panel.setBounds(10, 402, 577, 33);
@@ -239,7 +273,7 @@ public class EditImageAllgemein_GUI extends JFrame {
label_1.setBounds(69, 11, 13, 14);
contentPanel.add(label_1);
- JLabel lblVlimage = new JLabel("VL-Image");
+ JLabel lblVlimage = new JLabel("Image");
lblVlimage.setForeground(Color.BLUE);
lblVlimage.setBounds(81, 11, 45, 14);
contentPanel.add(lblVlimage);
@@ -279,23 +313,27 @@ public class EditImageAllgemein_GUI extends JFrame {
okButton = new JButton("Weiter");
okButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
- // check is textfield is empty
- if (imagename.getText().length() <= 0) {
- JOptionPane.showMessageDialog(null,
- "Bitte geben Sie einen Labornamen ein.",
- "Daten nicht vollst\u00e4ndig",
- JOptionPane.INFORMATION_MESSAGE);
-
- } else {
+ // Prueft die Eingabe und leitet weiter zur naechsten
+ // Seite
+ if (checkContent() == true && checkNameIsLettersOrNumbers() == true && descriptionLenghtOK()== true) {
// setze Namen, egal ob alt oder nicht
Image.image.setImagename(imagename.getText());
- System.out.println("Changing name to:" + imagename.getText()+ "\nNewName is: "+Image.image.getNewName());
+ Image.image.setDesc(textAreadesc.getText());
+ // Info
+ System.out
+ .println("Alle Eingaben in Ordnung. Imagename= \""
+ + Image.image.getImagename()
+ + "\", Imagebeschreibung=\""
+ + Image.image.getDesc()+"\"");
EditImageTechnisch_GUI ea = new EditImageTechnisch_GUI();
ea.setVisible(true);
dispose();
+
+ } else {
+
}// end else
}
});
@@ -408,6 +446,7 @@ public class EditImageAllgemein_GUI extends JFrame {
Image.image.setRam(Integer.parseInt(map.get("ram")));
Image.image.setCpu(Integer.parseInt(map.get("cpu")));
Image.image.setImagepath(map.get("path"));
+ Image.image.setDesc(map.get("desc"));
Image.image.setFilesize(Long.parseLong(map.get("filesize")));
int mode=0;
if(map.get("shareMode").equals("only_local")){
@@ -418,13 +457,75 @@ public class EditImageAllgemein_GUI extends JFrame {
mode=1;
}
Image.image.setShareMode(mode);
+ Image.image.setOS(map.get("os"));
} catch (TException e) {
// TODO Auto-generated catch block
e.printStackTrace();
JOptionPane.showMessageDialog(null,
- e.getCause() + "\n" + e.getMessage(), "Debug-Message",
+ e.getCause() + "\n" + e.getStackTrace(), "Debug-Message",
JOptionPane.ERROR_MESSAGE);
}
- }
-
-}
+ }//end initData()
+
+ public boolean checkNameIsLettersOrNumbers() {
+ nameIsOK = false;
+
+ //only allow letter from alphabet and nothing else
+ if (imagename.getText().matches("[a-zA-Z0-9]+")) {
+ nameIsOK = true;
+ } else {
+ JOptionPane
+ .showMessageDialog(
+ null,
+ "Der Imagename darf keine Leer- oder Sonderzeichen enthalten.",
+ "Unerlaubte Zeichen",
+ JOptionPane.INFORMATION_MESSAGE);
+ }// if
+
+ return nameIsOK;
+ }// end nameIsOK
+
+ public boolean checkContent(){
+ textfieldsHaveContent=false;
+
+ //check if any textfield is empty
+ if(imagename.getText().isEmpty() == false
+ && textAreadesc.getText().isEmpty() == false
+ && Vorname.getText().isEmpty() == false
+ && Nachname.getText().isEmpty() == false
+ && Hochschule.getText().isEmpty() == false
+ && EMail.getText().isEmpty() == false) {
+ //all textfields have content
+ textfieldsHaveContent = true;
+ } else {
+ JOptionPane
+ .showMessageDialog(
+ null,
+ "Bitte geben Sie alle notwendigen Daten an!",
+ "Daten unvollst\u00e4ndig",
+ JOptionPane.INFORMATION_MESSAGE);
+ }//end if
+
+ return textfieldsHaveContent;
+ }//end checkContent
+
+ public boolean descriptionLenghtOK(){
+ descriptionLengthOK=false;
+
+ //max length is 254 chars
+ if (textAreadesc.getText().length() >= MAX_DESCRIPTION_LENGTH) {
+ descriptionLengthOK=false;
+ JOptionPane
+ .showMessageDialog(null,
+ "Die Beschreibung darf max 254 Zeichen enthalten. Aktuell enthält sie "+textAreadesc.getText().length()+".",
+ "Beschreibung zu umfangreich",
+ JOptionPane.INFORMATION_MESSAGE);
+ }else {
+ descriptionLengthOK=true;
+
+ }
+
+ return descriptionLengthOK;
+ }// enddescriptionLenghtOK()
+
+}//end class
diff --git a/Dozentenmodul/src/main/java/gui/image/EditImageFreigabe_GUI.java b/Dozentenmodul/src/main/java/gui/image/EditImageFreigabe_GUI.java
index e28b774b..147900fe 100644
--- a/Dozentenmodul/src/main/java/gui/image/EditImageFreigabe_GUI.java
+++ b/Dozentenmodul/src/main/java/gui/image/EditImageFreigabe_GUI.java
@@ -68,7 +68,7 @@ public class EditImageFreigabe_GUI extends JFrame {
// TODO Auto-generated catch block
e.printStackTrace();
}
- setTitle("bwLehrpool Suite *Prototyp* - Image erzeugen");
+ setTitle("bwLehrpool Suite - Image erzeugen");
setBounds(0, 0, 603, 722);
GuiOrganizer.centerGUI(this);
@@ -135,7 +135,7 @@ public class EditImageFreigabe_GUI extends JFrame {
label_1.setBounds(69, 11, 13, 14);
contentPanel.add(label_1);
- JLabel lblVlimage = new JLabel("VL-Image");
+ JLabel lblVlimage = new JLabel("Image");
lblVlimage.setForeground(Color.BLUE);
lblVlimage.setBounds(81, 11, 45, 14);
contentPanel.add(lblVlimage);
@@ -173,7 +173,7 @@ public class EditImageFreigabe_GUI extends JFrame {
continueButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Image.image.setShareMode(comboBox.getSelectedIndex());
- FTPEditUploader_GUI ea=new FTPEditUploader_GUI();
+ PermissionEditImage_GUI ea=new PermissionEditImage_GUI();
ea.setVisible(true);
dispose();
@@ -195,13 +195,7 @@ public class EditImageFreigabe_GUI extends JFrame {
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);
diff --git a/Dozentenmodul/src/main/java/gui/image/EditImageTechnisch_GUI.java b/Dozentenmodul/src/main/java/gui/image/EditImageTechnisch_GUI.java
index 6573b802..5da9259e 100644
--- a/Dozentenmodul/src/main/java/gui/image/EditImageTechnisch_GUI.java
+++ b/Dozentenmodul/src/main/java/gui/image/EditImageTechnisch_GUI.java
@@ -16,6 +16,7 @@ import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.net.URI;
import java.net.URISyntaxException;
+import java.util.List;
import javax.swing.ButtonGroup;
@@ -37,10 +38,16 @@ import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.border.EmptyBorder;
import javax.swing.border.TitledBorder;
+import server.Server.Client;
+import thrift.ThriftConnection;
import util.GuiOrganizer;
import util.OpenLinks;
import models.Image;
import models.Links;
+import javax.swing.JComboBox;
+
+import org.apache.thrift.TException;
+import javax.swing.JCheckBox;
@SuppressWarnings("serial")
public class EditImageTechnisch_GUI extends JFrame {
@@ -49,16 +56,22 @@ public class EditImageTechnisch_GUI extends JFrame {
String[] result;
JSpinner spinnerCPU;
JSpinner spinnerRam;
- JRadioButton rdbtnlicenseJa;
- JRadioButton rdbtnlicenseNein;
- JRadioButton rdbtnInternetJa;
- JRadioButton rdbtnInternetNein;
- JRadioButton radioButtonVorlageJa;
- JRadioButton radioButtonVorlageNein;
+ //JRadioButton rdbtnlicenseJa;
+ //JRadioButton rdbtnlicenseNein;
+ //JRadioButton rdbtnInternetJa;
+ //JRadioButton rdbtnInternetNein;
+ //JRadioButton radioButtonVorlageJa;
+ //JRadioButton radioButtonVorlageNein;
+ private JCheckBox chckbxIsTemplate;
+ private JCheckBox chckbxIsLicensed;
+ private JCheckBox chckbxIsInternetBlocked;
private final ButtonGroup buttonGrouplicense = new ButtonGroup();
private final ButtonGroup buttonGroupInternet = new ButtonGroup();
private final ButtonGroup buttonGroupVorlage = new ButtonGroup();
-
+ JComboBox comboBox;
+ ThriftConnection con = new ThriftConnection();
+ Client client = models.Client.clientcon.getClient();
+
/**
* Create the dialog.
*/
@@ -84,7 +97,7 @@ public class EditImageTechnisch_GUI extends JFrame {
e.printStackTrace();
}
// Setzt den Titel des Fensters
- setTitle("bwLehrpool Suite *Prototyp* - Image bearbeiten");
+ setTitle("bwLehrpool Suite - Image bearbeiten");
// Zentriert das Fenster
setBounds(0, 0, 603, 722);
GuiOrganizer.centerGUI(this);
@@ -111,7 +124,7 @@ public class EditImageTechnisch_GUI extends JFrame {
txtpnBitteWhlenSie.setBounds(10, 36, 509, 32);
panel.add(txtpnBitteWhlenSie);
}
- contentPanel.setBounds(10, 85, 577, 493);
+ contentPanel.setBounds(10, 85, 577, 532);
contentPanel.setBackground(SystemColor.menu);
contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
getContentPane().add(contentPanel);
@@ -121,75 +134,133 @@ public class EditImageTechnisch_GUI extends JFrame {
panel_1.setBackground(SystemColor.menu);
panel_1.setBorder(new TitledBorder(null, "Informationen zum Image",
TitledBorder.LEADING, TitledBorder.TOP, null, null));
- panel_1.setBounds(10, 25, 557, 136);
+ panel_1.setBounds(10, 25, 557, 167);
contentPanel.add(panel_1);
panel_1.setLayout(null);
JLabel lblNewLabel_2 = new JLabel(
"Image enth\u00E4lt lizenzpflichtige Software:");
- lblNewLabel_2.setBounds(10, 46, 250, 20);
+ lblNewLabel_2.setBounds(10, 77, 250, 20);
panel_1.add(lblNewLabel_2);
-
- rdbtnlicenseJa = new JRadioButton("Ja");
- rdbtnlicenseJa.setSelected(true);
- buttonGrouplicense.add(rdbtnlicenseJa);
- rdbtnlicenseJa.setBounds(266, 45, 109, 23);
- panel_1.add(rdbtnlicenseJa);
-
- rdbtnlicenseNein = new JRadioButton("Nein");
- buttonGrouplicense.add(rdbtnlicenseNein);
- rdbtnlicenseNein.setBounds(377, 45, 109, 23);
- panel_1.add(rdbtnlicenseNein);
- if (Image.image.isLicensed() == true) {
- rdbtnlicenseJa.setSelected(true);
- } else {
- rdbtnlicenseNein.setSelected(true);
- }
+
+ chckbxIsTemplate = new JCheckBox("");
+ chckbxIsTemplate.setBounds(266, 50, 97, 23);
+ panel_1.add(chckbxIsTemplate);
+
+ chckbxIsLicensed = new JCheckBox("");
+ chckbxIsLicensed.setBounds(266, 76, 97, 23);
+ panel_1.add(chckbxIsLicensed);
+
+ chckbxIsInternetBlocked = new JCheckBox("");
+ chckbxIsInternetBlocked.setBounds(266, 104, 97, 23);
+ panel_1.add(chckbxIsInternetBlocked);
+
+ //rdbtnlicenseJa = new JRadioButton("Ja");
+ //rdbtnlicenseJa.setSelected(true);
+ //buttonGrouplicense.add(rdbtnlicenseJa);
+ //rdbtnlicenseJa.setBounds(266, 76, 109, 23);
+ //panel_1.add(rdbtnlicenseJa);
+
+ //rdbtnlicenseNein = new JRadioButton("Nein");
+ //buttonGrouplicense.add(rdbtnlicenseNein);
+ //rdbtnlicenseNein.setBounds(377, 76, 53, 23);
+ //panel_1.add(rdbtnlicenseNein);
+
JLabel lblInternetIstInnerhalb = new JLabel(
"Internet ist innerhalb des Image gesperrt:");
- lblInternetIstInnerhalb.setBounds(10, 74, 250, 20);
+ lblInternetIstInnerhalb.setBounds(10, 105, 250, 20);
panel_1.add(lblInternetIstInnerhalb);
- rdbtnInternetJa = new JRadioButton("Ja");
+ /*rdbtnInternetJa = new JRadioButton("Ja");
buttonGroupInternet.add(rdbtnInternetJa);
- rdbtnInternetJa.setBounds(266, 73, 109, 23);
+ rdbtnInternetJa.setBounds(266, 104, 109, 23);
panel_1.add(rdbtnInternetJa);
rdbtnInternetNein = new JRadioButton("Nein");
rdbtnInternetNein.setSelected(true);
buttonGroupInternet.add(rdbtnInternetNein);
- rdbtnInternetNein.setBounds(377, 73, 109, 23);
+ rdbtnInternetNein.setBounds(377, 104, 53, 23);
panel_1.add(rdbtnInternetNein);
-
+ */
JLabel label = new JLabel("Lizenzserver eintragen:");
- label.setBounds(10, 103, 250, 20);
+ label.setBounds(10, 134, 250, 20);
panel_1.add(label);
JButton button = new JButton("Server-Adresse...");
button.setEnabled(false);
- button.setBounds(266, 102, 157, 23);
+ button.setBounds(266, 133, 157, 23);
panel_1.add(button);
JLabel label_4 = new JLabel("Image ist eine Vorlage:");
- label_4.setBounds(10, 20, 250, 20);
+ label_4.setBounds(10, 51, 250, 20);
panel_1.add(label_4);
- radioButtonVorlageJa = new JRadioButton("Ja");
- buttonGroupVorlage.add(radioButtonVorlageJa);
- radioButtonVorlageJa.setSelected(true);
- radioButtonVorlageJa.setBounds(266, 19, 41, 23);
- panel_1.add(radioButtonVorlageJa);
+ //radioButtonVorlageJa = new JRadioButton("Ja");
+ //buttonGroupVorlage.add(radioButtonVorlageJa);
+ //radioButtonVorlageJa.setBounds(266, 50, 41, 23);
+ //panel_1.add(radioButtonVorlageJa);
+
+ //radioButtonVorlageNein = new JRadioButton("Nein");
+ //radioButtonVorlageNein.setSelected(true);
+ //buttonGroupVorlage.add(radioButtonVorlageNein);
+ //radioButtonVorlageNein.setBounds(377, 50, 46, 23);
+ //panel_1.add(radioButtonVorlageNein);
+
+ JLabel lblBetriebssystem = new JLabel("Betriebssystem:");
+ lblBetriebssystem.setBounds(10, 26, 250, 20);
+ panel_1.add(lblBetriebssystem);
+
+ comboBox = new JComboBox();
+ try {
+ List<String> os=client.getAllOS();
+ for(int i=0;i<os.size();i++)
+ {
+ comboBox.addItem(os.get(i).toString());
+
+ }
+ } catch (TException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ System.out.println("OS Model:" + Image.image.getOS());
+ for(int i =0;i<comboBox.getItemCount();i++)
+ {
+ if(comboBox.getItemAt(i).equals(Image.image.getOS()+" bit")){
+
+ comboBox.setSelectedIndex(i);
+
+ }
+ }
+ System.out.println(comboBox.getSelectedItem().toString());
+ comboBox.setBounds(270, 26, 277, 20);
+ panel_1.add(comboBox);
+
+
- radioButtonVorlageNein = new JRadioButton("Nein");
- buttonGroupVorlage.add(radioButtonVorlageNein);
- radioButtonVorlageNein.setBounds(377, 19, 46, 23);
- panel_1.add(radioButtonVorlageNein);
if (Image.image.isVorlage() == true) {
- radioButtonVorlageJa.setSelected(true);
+ //radioButtonVorlageJa.setSelected(true);
+ chckbxIsTemplate.setSelected(true);
+ } else {
+ //radioButtonVorlageNein.setSelected(true);
+ chckbxIsTemplate.setSelected(false);
+ }
+
+ if(Image.image.isInternet() == true ){
+ chckbxIsInternetBlocked.setSelected(true);
+ } else {
+ chckbxIsInternetBlocked.setSelected(false);
+ }
+
+ if (Image.image.isLicensed() == true) {
+ //rdbtnlicenseJa.setSelected(true);
+ chckbxIsLicensed.setSelected(true);
+ chckbxIsLicensed.isSelected();
} else {
- radioButtonVorlageNein.setSelected(true);
+ //rdbtnlicenseNein.setSelected(true);
+ chckbxIsLicensed.setSelected(false);
}
+
JLabel lblHauptmen = new JLabel("Hauptmen\u00FC");
lblHauptmen.addMouseListener(new MouseAdapter() {
@Override
@@ -209,7 +280,7 @@ public class EditImageTechnisch_GUI extends JFrame {
label_1.setBounds(69, 0, 13, 14);
contentPanel.add(label_1);
- JLabel lblVlimage = new JLabel("VL-Image");
+ JLabel lblVlimage = new JLabel("Image");
lblVlimage.setForeground(Color.BLUE);
lblVlimage.setBounds(81, 0, 45, 14);
contentPanel.add(lblVlimage);
@@ -228,7 +299,7 @@ public class EditImageTechnisch_GUI extends JFrame {
"Empfehlung bez\u00fcglich Ressourcen", TitledBorder.LEADING,
TitledBorder.TOP, null, null));
panel_2.setBackground(SystemColor.menu);
- panel_2.setBounds(10, 172, 557, 338);
+ panel_2.setBounds(10, 203, 557, 329);
contentPanel.add(panel_2);
JTextArea txtrHinweisSolltenSie = new JTextArea();
@@ -236,26 +307,26 @@ public class EditImageTechnisch_GUI extends JFrame {
txtrHinweisSolltenSie.setFont(new Font("Tahoma", Font.PLAIN, 13));
txtrHinweisSolltenSie
.setText("Hinweis: Sollten Sie keine Software einsetzen, die viele Ressourcen ben\u00F6tigt,\r\nk\u00F6nnen Sie sich an den Beispielwerten orientieren.");
- txtrHinweisSolltenSie.setBounds(10, 25, 537, 55);
+ txtrHinweisSolltenSie.setBounds(10, 43, 537, 55);
panel_2.add(txtrHinweisSolltenSie);
JLabel lblNewLabel_3 = new JLabel(
"Wie viel Arbeitsspeicher empfehlen Sie f\u00FCr das Image:");
- lblNewLabel_3.setBounds(10, 91, 280, 20);
+ lblNewLabel_3.setBounds(10, 109, 280, 20);
panel_2.add(lblNewLabel_3);
JLabel lblMindestens = new JLabel("mindestens");
- lblMindestens.setBounds(315, 91, 60, 20);
+ lblMindestens.setBounds(315, 109, 60, 20);
panel_2.add(lblMindestens);
spinnerRam = new JSpinner();
spinnerRam.setModel(new SpinnerNumberModel(1, 1, 8, 1));
- spinnerRam.setBounds(385, 88, 29, 20);
+ spinnerRam.setBounds(385, 106, 29, 20);
spinnerRam.setValue(Image.image.getRam());
panel_2.add(spinnerRam);
JLabel lblGbyte = new JLabel("GByte");
- lblGbyte.setBounds(424, 91, 46, 20);
+ lblGbyte.setBounds(424, 109, 46, 20);
panel_2.add(lblGbyte);
JTextArea txtrBeispielWindows = new JTextArea();
@@ -263,7 +334,7 @@ public class EditImageTechnisch_GUI extends JFrame {
.setText("Beispiel:\r\nWindows 7 32/64 Bit: 2 GByte\r\nLinux/Unix 32/64 Bit: 1 GByte");
txtrBeispielWindows.setFont(new Font("Tahoma", Font.PLAIN, 11));
txtrBeispielWindows.setBackground(SystemColor.menu);
- txtrBeispielWindows.setBounds(20, 111, 280, 55);
+ txtrBeispielWindows.setBounds(20, 129, 280, 55);
panel_2.add(txtrBeispielWindows);
JTextArea txtrBeispielWindows_1 = new JTextArea();
@@ -271,26 +342,26 @@ public class EditImageTechnisch_GUI extends JFrame {
.setText("Beispiel:\r\nWindows 7 32/64 Bit: 1 Kern\r\nLinux/Unix 32/64 Bit: 1 Kern");
txtrBeispielWindows_1.setFont(new Font("Tahoma", Font.PLAIN, 11));
txtrBeispielWindows_1.setBackground(SystemColor.menu);
- txtrBeispielWindows_1.setBounds(20, 226, 280, 55);
+ txtrBeispielWindows_1.setBounds(20, 244, 280, 55);
panel_2.add(txtrBeispielWindows_1);
JLabel lblWieVieleCpus = new JLabel(
"Wie viele CPUs empfehlen Sie f\u00FCr das Image:");
- lblWieVieleCpus.setBounds(10, 201, 280, 20);
+ lblWieVieleCpus.setBounds(10, 219, 280, 20);
panel_2.add(lblWieVieleCpus);
JLabel label_3 = new JLabel("mindestens");
- label_3.setBounds(315, 201, 60, 20);
+ label_3.setBounds(315, 219, 60, 20);
panel_2.add(label_3);
spinnerCPU = new JSpinner();
spinnerCPU.setModel(new SpinnerNumberModel(1, 1, 4, 1));
- spinnerCPU.setBounds(385, 198, 29, 20);
+ spinnerCPU.setBounds(385, 216, 29, 20);
spinnerCPU.setValue(Image.image.getCpu());
panel_2.add(spinnerCPU);
JLabel lblKerne = new JLabel("Kerne");
- lblKerne.setBounds(424, 201, 46, 20);
+ lblKerne.setBounds(424, 219, 46, 20);
panel_2.add(lblKerne);
{
JPanel buttonPane = new JPanel();
@@ -307,17 +378,25 @@ public class EditImageTechnisch_GUI extends JFrame {
spinnerCPU.getValue().toString()).intValue());
Image.image.setRam(Integer.valueOf(
spinnerRam.getValue().toString()).intValue());
- if (rdbtnInternetJa.isSelected() == true) {
+ if (chckbxIsInternetBlocked.isSelected() == true) {
Image.image.setInternet(true);
} else {
Image.image.setInternet(false);
}
- if (rdbtnlicenseJa.isSelected() == true) {
+ if (chckbxIsLicensed.isSelected() == true) {
Image.image.setLicensed(true);
} else {
Image.image.setLicensed(false);
}
+
+ if (chckbxIsTemplate.isSelected() == true) {
+ Image.image.setVorlage(true);
+ } else {
+ Image.image.setVorlage(false);
+ }
+
+ Image.image.setOS(comboBox.getSelectedItem().toString());
// oeffnet das vorherige Fenster
EditImageAllgemein_GUI ei = new EditImageAllgemein_GUI();
ei.setVisible(true);
@@ -336,22 +415,26 @@ public class EditImageTechnisch_GUI extends JFrame {
spinnerCPU.getValue().toString()).intValue());
Image.image.setRam(Integer.valueOf(
spinnerRam.getValue().toString()).intValue());
- if (rdbtnInternetJa.isSelected() == true) {
+ if (chckbxIsInternetBlocked.isSelected() == true) {
Image.image.setInternet(true);
} else {
Image.image.setInternet(false);
}
- if (rdbtnlicenseJa.isSelected() == true) {
+ if (chckbxIsLicensed.isSelected() == true) {
Image.image.setLicensed(true);
} else {
Image.image.setLicensed(false);
}
- if (radioButtonVorlageJa.isSelected() == true) {
+
+ if (chckbxIsTemplate.isSelected() == true) {
Image.image.setVorlage(true);
} else {
Image.image.setVorlage(false);
}
+
+ Image.image.setOS(comboBox.getSelectedItem().toString());
+ System.out.println("Betriebssystem: "+Image.image.getOS()+", istVorlage: "+Image.image.isVorlage()+", Lizenzpflichtig: "+Image.image.isLicensed()+", Internetsperre: "+Image.image.isInternet()+", CPU: "+Image.image.getCpu()+", RAM: "+Image.image.getRam());
// oeffnet das naechste Fenster
EditImageFreigabe_GUI ea=new EditImageFreigabe_GUI();
ea.setVisible(true);
diff --git a/Dozentenmodul/src/main/java/gui/image/ExtendedSearchForImages_GUI.java b/Dozentenmodul/src/main/java/gui/image/ExtendedSearchForImages_GUI.java
deleted file mode 100644
index 872e8f8d..00000000
--- a/Dozentenmodul/src/main/java/gui/image/ExtendedSearchForImages_GUI.java
+++ /dev/null
@@ -1,278 +0,0 @@
-package gui.image;
-
-
-import gui.image.CreateImageAllgemein_GUI;
-import gui.image.FTPCreateUploader_GUI;
-import gui.intro.About_GUI;
-
-import java.awt.FlowLayout;
-import java.awt.Font;
-import java.awt.SystemColor;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.List;
-
-import javax.swing.JButton;
-import javax.swing.JCheckBox;
-import javax.swing.JComboBox;
-import javax.swing.JFrame;
-import javax.swing.JLabel;
-import javax.swing.JMenu;
-import javax.swing.JMenuBar;
-import javax.swing.JMenuItem;
-import javax.swing.JPanel;
-import javax.swing.JSeparator;
-import javax.swing.JTextField;
-import javax.swing.JTextPane;
-import javax.swing.UIManager;
-import javax.swing.UnsupportedLookAndFeelException;
-import javax.swing.border.EmptyBorder;
-import javax.swing.border.TitledBorder;
-
-import org.apache.thrift.TException;
-
-import models.Links;
-import models.Search;
-import server.Server.Client;
-import thrift.ThriftConnection;
-import util.GuiOrganizer;
-import util.OpenLinks;
-
-@SuppressWarnings("serial")
-public class ExtendedSearchForImages_GUI extends JFrame {
-
- private final JPanel contentPanel = new JPanel();
- String[] result;
- private JTextField textField;
- private JTextField textField_1;
- JCheckBox chckbxBestehendesImage;
- JCheckBox chckbxRohling;
- JComboBox<String> comboBox;
- Search search=new Search();
- ThriftConnection con = new ThriftConnection();
- Client client = models.Client.clientcon.getClient();
-
- /**
- * Create the dialog.
- */
- public ExtendedSearchForImages_GUI() {
-
- setResizable(false);
-
- try {
- UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
- } catch (ClassNotFoundException | InstantiationException
- | IllegalAccessException | UnsupportedLookAndFeelException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- setTitle("bwLehrpool Suite *Prototyp* - Erweiterte Suche");
- setBounds(0, 0, 603, 722);
- GuiOrganizer.centerGUI(this);
-
- getContentPane().setLayout(null);
- {
- JPanel panel = new JPanel();
- panel.setBackground(SystemColor.menu);
- panel.setBounds(10, 11, 577, 57);
- getContentPane().add(panel);
- panel.setLayout(null);
- {
- JLabel lblNewLabel = new JLabel("Weitere Suchoptionen");
- lblNewLabel.setBounds(10, 11, 509, 22);
- panel.add(lblNewLabel);
- lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18));
- }
-
- JTextPane txtpnBitteWhlenSie = new JTextPane();
- txtpnBitteWhlenSie.setEditable(false);
- txtpnBitteWhlenSie.setBackground(SystemColor.menu);
- txtpnBitteWhlenSie.setText("beschreibung");
- txtpnBitteWhlenSie.setBounds(10, 36, 509, 32);
- panel.add(txtpnBitteWhlenSie);
- }
- contentPanel.setBounds(10, 85, 577, 493);
- contentPanel.setBackground(SystemColor.menu);
- contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
- getContentPane().add(contentPanel);
- contentPanel.setLayout(null);
-
- JPanel panel_1 = new JPanel();
- panel_1.setBackground(SystemColor.menu);
- panel_1.setBorder(new TitledBorder(null, "Image-Typ", TitledBorder.LEADING, TitledBorder.TOP, null, null));
- panel_1.setBounds(10, 11, 557, 95);
- contentPanel.add(panel_1);
- panel_1.setLayout(null);
-
- JLabel lblNewLabel_2 = new JLabel("Image-Typ");
- lblNewLabel_2.setBounds(10, 39, 176, 20);
- panel_1.add(lblNewLabel_2);
-
- chckbxBestehendesImage = new JCheckBox("Bestehendes Image");
- chckbxBestehendesImage.setSelected(search.isExistingImage());
- chckbxBestehendesImage.setBounds(192, 38, 138, 23);
- panel_1.add(chckbxBestehendesImage);
-
- chckbxRohling = new JCheckBox("Rohling");
- chckbxRohling.setSelected(search.isRohling());
- chckbxRohling.setBounds(332, 38, 97, 23);
- panel_1.add(chckbxRohling);
-
- JPanel panel = new JPanel();
- panel.setLayout(null);
- panel.setBorder(new TitledBorder(null, "Image-Inhalt", TitledBorder.LEADING, TitledBorder.TOP, null, null));
- panel.setBackground(SystemColor.menu);
- panel.setBounds(10, 117, 557, 95);
- contentPanel.add(panel);
-
- JLabel lblEnthalteneSoftware = new JLabel("Enthaltene Software");
- lblEnthalteneSoftware.setBounds(10, 39, 176, 20);
- panel.add(lblEnthalteneSoftware);
-
- textField = new JTextField();
- textField.setBounds(196, 39, 351, 20);
- textField.setText(search.getSoftware());
- panel.add(textField);
- textField.setColumns(10);
-
- JLabel lblNewLabel_1 = new JLabel("Bitte mit ; getrennt angeben");
- lblNewLabel_1.setBounds(196, 70, 351, 14);
- panel.add(lblNewLabel_1);
-
- JPanel panel_2 = new JPanel();
- panel_2.setLayout(null);
- panel_2.setBorder(new TitledBorder(null, "Informationen zum Ersteller", TitledBorder.LEADING, TitledBorder.TOP, null, null));
- panel_2.setBackground(SystemColor.menu);
- panel_2.setBounds(10, 223, 557, 123);
- contentPanel.add(panel_2);
-
- JLabel lblNachnameDesErstellers = new JLabel("Nachname des Erstellers");
- lblNachnameDesErstellers.setBounds(10, 39, 176, 20);
- panel_2.add(lblNachnameDesErstellers);
-
- textField_1 = new JTextField();
- textField_1.setColumns(10);
- textField_1.setBounds(196, 39, 351, 20);
- textField_1.setText(search.getCreator());
- panel_2.add(textField_1);
-
- JLabel lblHochschuleuniversitt = new JLabel("Hochschule/Universit\u00E4t");
- lblHochschuleuniversitt.setBounds(10, 70, 176, 20);
- panel_2.add(lblHochschuleuniversitt);
-
- comboBox = new JComboBox<String>();
- try {
- List<String> universities=client.getAllUniversities();
- for(int i=0; i< universities.size();i++)
- {
- comboBox.addItem(universities.get(i).toString());
- }
- } catch (TException e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
- }
- comboBox.setBounds(196, 70, 351, 20);
- panel_2.add(comboBox);
- {
- JPanel buttonPane = new JPanel();
- buttonPane.setBounds(0, 640, 597, 33);
- buttonPane.setBackground(SystemColor.menu);
- buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
- getContentPane().add(buttonPane);
- {
- JButton cancelButton = new JButton("\u00DCbernehmen");
- cancelButton.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- search.setExistingImage(chckbxBestehendesImage.isSelected());
- search.setRohling(chckbxRohling.isSelected());
- search.setSoftware(textField.getText());
- search.setCreator(textField_1.getText());
- search.setHochschule(comboBox.getSelectedItem().toString());
- System.out.println("Working :" +search.getSoftware());
- dispose();
- }
- });
- cancelButton.setActionCommand("Cancel");
- buttonPane.add(cancelButton);
- }
- }
-
- JSeparator separator = new JSeparator();
- separator.setBounds(0, 78, 597, 2);
- getContentPane().add(separator);
-
- JSeparator separator_1 = new JSeparator();
- separator_1.setBounds(0, 627, 597, 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");
- mntmFaq.addMouseListener(new MouseAdapter() {
- @Override
- public void mousePressed(MouseEvent arg0) {
-
- OpenLinks open = new OpenLinks();
-
- URI windows;
- try {
- windows = new URI(Links.getFAQ());
-
- open.openWebpage(windows);
-
- } catch (URISyntaxException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- });
- mnNewMenu_1.add(mntmFaq);
-
-
- JMenuItem mntmOtrs = new JMenuItem("OTRS");
- mntmOtrs.addMouseListener(new MouseAdapter() {
- @Override
- public void mousePressed(MouseEvent arg0) {
-
- OpenLinks open = new OpenLinks();
-
- URI windows;
- try {
- windows = new URI(Links.getOTRS());
-
- open.openWebpage(windows);
-
- } catch (URISyntaxException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
- }
- });
- mnNewMenu_1.add(mntmOtrs);
-
- JMenuItem mntmAbout = new JMenuItem("About");
- mntmAbout.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- About_GUI ab = new About_GUI();
- ab.setVisible(true);
- }
- });
- mnNewMenu_1.add(mntmAbout);
-
- }
-}
diff --git a/Dozentenmodul/src/main/java/gui/image/FTPCreateUploader_GUI.java b/Dozentenmodul/src/main/java/gui/image/FTPCreateUploader_GUI.java
index 88457e5a..a9461bb4 100644
--- a/Dozentenmodul/src/main/java/gui/image/FTPCreateUploader_GUI.java
+++ b/Dozentenmodul/src/main/java/gui/image/FTPCreateUploader_GUI.java
@@ -14,6 +14,7 @@ import java.awt.event.WindowEvent;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.io.File;
+import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.text.DateFormat;
@@ -43,6 +44,8 @@ import models.SessionData;
import models.person;
import org.apache.thrift.TException;
+import org.ini4j.InvalidFileFormatException;
+import org.ini4j.Wini;
import server.Server.Client;
import thrift.ThriftConnection;
@@ -73,6 +76,7 @@ public class FTPCreateUploader_GUI extends JFrame implements
JLabel labelfilesize;
JLabel labelZeit;
JLabel labelverbleibend;
+ JFileChooser fc;
long filesize;
double speed;
long bytesread;
@@ -83,29 +87,47 @@ public class FTPCreateUploader_GUI extends JFrame implements
JButton btnUploadStarten = new JButton("Upload auf Server starten");
JButton btnZurck = new JButton("Zur\u00FCck");
int progress = 0; // progress of upload
+ private boolean isCurrentlyLoading = false; // currently up or downloading
+ // file
-
/**
* Create the frame.
*/
public FTPCreateUploader_GUI() {
+
+ final Object[] options = { "Beenden", "Abbrechen" };
+
addWindowListener(new WindowAdapter() {
+
@Override
public void windowClosing(WindowEvent arg0) {
+
if (taskrun == true) {
- try {
- client.DeleteFtpUser(user.userName);
- } catch (TException e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
- JOptionPane.showMessageDialog(null,
- e1.getCause()+"\n"+e1.getMessage(),
- "Debug-Message", JOptionPane.ERROR_MESSAGE);
- }
- task.cancel(true);
- }
- con.closeThriftConnection();
- System.exit(0);
+ // check if user wants to quit.
+ int choice = JOptionPane
+ .showOptionDialog(
+ null,
+ "Aktuell ist ein Upload aktiv. Wollen Sie diesen Abbrechen und das Programm beenden?",
+ "Upload aktiv",
+ JOptionPane.YES_NO_CANCEL_OPTION,
+ JOptionPane.QUESTION_MESSAGE, null,
+ options, options[1]);
+ // 0=beenden, 1=abbrechen
+ if (choice == 0) {
+ try {
+ client.DeleteFtpUser(user.userName);
+ } catch (TException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ task.cancel(true);
+ con.closeThriftConnection();
+ System.exit(0);
+ }// end if choice
+ } else {
+ // no upload running, close window
+ System.exit(0);
+ }// end if taskrun
}// end window closing
});
setResizable(false);
@@ -117,13 +139,15 @@ public class FTPCreateUploader_GUI extends JFrame implements
// TODO Auto-generated catch block
e.printStackTrace();
JOptionPane.showMessageDialog(null,
- e.getCause()+"\n"+e.getMessage(),
- "Debug-Message", JOptionPane.ERROR_MESSAGE);
+ e.getCause() + "\n" + e.getStackTrace(), "Debug-Message",
+ JOptionPane.ERROR_MESSAGE);
}
// filename=name;
setBackground(Color.WHITE);
- setTitle("Dozentenmodul *Prototyp* - Image erzeugen");
+ setTitle("Dozentenmodul - Image erzeugen");
+ // Aktion die beim Schliessen durchgefuehrt werden soll
+ setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
setBounds(0, 0, 603, 722);
GuiOrganizer.centerGUI(this);
@@ -137,7 +161,22 @@ public class FTPCreateUploader_GUI extends JFrame implements
JButton btnSpeicherortAuswhlen = new JButton("Image ausw\u00E4hlen");
btnSpeicherortAuswhlen.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
- JFileChooser fc = new JFileChooser();
+ try {
+ Wini ini = new Wini(
+ new File(
+ "C:\\Users\\"
+ + System.getProperty("user.name")
+ + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini"));
+ fc = new JFileChooser(ini.get("main",
+ "Letzter Uploadpfad", String.class));
+ } catch (InvalidFileFormatException e2) {
+ // TODO Auto-generated catch block
+ e2.printStackTrace();
+ } catch (IOException e2) {
+ // TODO Auto-generated catch block
+ e2.printStackTrace();
+ }
+
fc.setFileSelectionMode(JFileChooser.FILES_ONLY);
fc.showOpenDialog(getParent());
@@ -159,16 +198,28 @@ public class FTPCreateUploader_GUI extends JFrame implements
btnSpeicherortAuswhlen.setVerticalAlignment(SwingConstants.TOP);
contentPanel.add(btnSpeicherortAuswhlen);
}
-
lblPath = new JLabel("");
+ try {
+ Wini ini = new Wini(new File("C:\\Users\\"
+ + System.getProperty("user.name")
+ + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini"));
+ lblPath.setText(ini.get("main", "Letzter Uploadpfad", String.class));
+ } catch (InvalidFileFormatException e2) {
+ // TODO Auto-generated catch block
+ e2.printStackTrace();
+ } catch (IOException e2) {
+ // TODO Auto-generated catch block
+ e2.printStackTrace();
+ }
+
lblPath.addPropertyChangeListener(new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent arg0) {
- if (lblPath.getText().isEmpty()) {
+ if (lblPath.getText() == null) {
// wenn leer, dann upload button nicht freigeben
btnUploadStarten.setEnabled(false);
btnUploadStarten.setText("Bitte warten");
- } else {
- // wenn leer, dann upload button nicht freigeben
+ } else if (lblPath.getText().endsWith(".vmdk")) {
+ // wenn leer, dann upload button freigeben
btnUploadStarten.setEnabled(true);
btnUploadStarten.setText("Upload auf Server starten");
}
@@ -272,7 +323,7 @@ public class FTPCreateUploader_GUI extends JFrame implements
label_3.setBounds(80, 91, 14, 14);
contentPanel.add(label_3);
- JLabel lblVlimage = new JLabel("VL-Image");
+ JLabel lblVlimage = new JLabel("Image");
lblVlimage.setForeground(Color.BLUE);
lblVlimage.setBounds(91, 88, 46, 20);
contentPanel.add(lblVlimage);
@@ -315,19 +366,50 @@ public class FTPCreateUploader_GUI extends JFrame implements
finishButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
writeData();
+ try {
+ Wini ini = new Wini(
+ new File(
+ "C:\\Users\\"
+ + System.getProperty("user.name")
+ + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini"));
+
+ // check if path has content, then write to file
+ if (lblPath.getText().contains("\\") == true) {
+ System.out.println("Hole Infos aus Label: "
+ + lblPath.getText());
+ ini.put("main",
+ "Letzter Uploadpfad",
+ lblPath.getText().substring(
+ 0,
+ lblPath.getText().lastIndexOf(
+ "\\")));
+ ini.store();
+ } else {
+ System.out.println("Mache nix");
+ }// end if
+ } catch (InvalidFileFormatException e2) {
+ // TODO Auto-generated catch block
+ e2.printStackTrace();
+ } catch (IOException e2) {
+ // TODO Auto-generated catch block
+ e2.printStackTrace();
+ }
dispose();
MainMenue_GUI m = new MainMenue_GUI();
m.setVisible(true);
if (taskrun == true) {
try {
client.DeleteFtpUser(user.userName);
-
+
} catch (TException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
- JOptionPane.showMessageDialog(null,
- e1.getCause()+"\n"+e1.getMessage(),
- "Debug-Message", JOptionPane.ERROR_MESSAGE);
+ JOptionPane.showMessageDialog(
+ null,
+ e1.getCause() + "\n"
+ + e1.getStackTrace(),
+ "Debug-Message",
+ JOptionPane.ERROR_MESSAGE);
}
task.cancel(true);
}
@@ -337,11 +419,37 @@ public class FTPCreateUploader_GUI extends JFrame implements
btnZurck.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
- dispose();
-
- CreateImageTechnisch_GUI m = new CreateImageTechnisch_GUI();
- m.setVisible(true);
- }
+ // check if loading file or not
+ if (isCurrentlyLoading() == true) {
+ int choice = JOptionPane
+ .showOptionDialog(
+ null,
+ "Nicht abgeschlossene Uploads werden beendet. Trotzdem zurück gehen?",
+ "Warnung",
+ JOptionPane.YES_NO_CANCEL_OPTION,
+ JOptionPane.QUESTION_MESSAGE, null,
+ options, options[1]);
+ // 0=beenden, 1=abbrechen
+ if (choice == 0) {
+ try {
+ client.DeleteFtpUser(user.userName);
+ } catch (TException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ task.cancel(true);
+ // not loading files, go back one page
+ dispose();
+ PermissionCreateImage_GUI m = new PermissionCreateImage_GUI();
+ m.setVisible(true);
+
+ }// end if choice
+ } else {
+ dispose();
+ PermissionCreateImage_GUI m = new PermissionCreateImage_GUI();
+ m.setVisible(true);
+ }// end else
+ }// end action
});
btnZurck.setActionCommand("Cancel");
buttonPane.add(btnZurck);
@@ -352,55 +460,45 @@ public class FTPCreateUploader_GUI extends JFrame implements
JMenuBar menuBar = new JMenuBar();
setJMenuBar(menuBar);
-
+
JMenu menu = new JMenu("Hilfe");
menuBar.add(menu);
-
+
JMenuItem menuItem = new JMenuItem("FAQ");
menuItem.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent arg0) {
-
OpenLinks open = new OpenLinks();
-
URI windows;
try {
windows = new URI(Links.getFAQ());
-
open.openWebpage(windows);
-
} catch (URISyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
-
}
});
menu.add(menuItem);
-
+
JMenuItem menuItem_1 = new JMenuItem("OTRS");
menuItem_1.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent arg0) {
-
OpenLinks open = new OpenLinks();
-
URI windows;
try {
windows = new URI(Links.getOTRS());
-
open.openWebpage(windows);
-
} catch (URISyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
-
}
});
menu.add(menuItem_1);
-
+
JMenuItem mntmAbout = new JMenuItem("About");
mntmAbout.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
@@ -420,32 +518,32 @@ public class FTPCreateUploader_GUI extends JFrame implements
btnUploadStarten.setText("Bitte warten");
try {
- System.out.println("Test");
+ System.out.println("Getting FTP User");
user = client.getFtpUser();
- System.out.println("FTP name" + user.userName);
- System.out.println("FTP path" + user.path);
- System.out.println("FTP pass" + user.password);
+ System.out.println("FTP name: " + user.userName);
+ System.out.println("FTP path: " + user.path);
+ System.out.println("FTP pass: " + user.password);
} catch (TException e) {
// TODO Auto-generated catch block
e.printStackTrace();
JOptionPane.showMessageDialog(null,
- e.getCause()+"\n"+e.getMessage(),
- "Debug-Message", JOptionPane.ERROR_MESSAGE);
+ e.getCause() + "\n" + e.getStackTrace(), "Debug-Message",
+ JOptionPane.ERROR_MESSAGE);
}
DateFormat formatter = new SimpleDateFormat("yyyMMddhhmmss");
- System.out.println(formatter.format(new Date()) + "_"
- + person.verantwortlicher.getHochschule() + "_"
+ System.out.println("Setting new Name: " + formatter.format(new Date())
+ + "_" + person.verantwortlicher.getHochschule() + "_"
+ person.verantwortlicher.getUsername() + "_"
+ Image.image.getImagename() + ".vmdk");
Image.image.setNewName(formatter.format(new Date()) + "_"
+ person.verantwortlicher.getHochschule() + "_"
+ person.verantwortlicher.getUsername() + "_"
+ Image.image.getImagename() + ".vmdk");
- System.out.println("Uploading to host: "+host);
-
+ System.out.println("Uploading to host: " + host);
+
task = new UploadTask(host, port, user.userName, user.password,
- user.path+"temp/", uploadFile);
+ user.path + "temp/", uploadFile);
task.addPropertyChangeListener(this);
task.execute();
@@ -458,28 +556,16 @@ public class FTPCreateUploader_GUI extends JFrame implements
if ("progress" == arg0.getPropertyName()) {
progress = (Integer) arg0.getNewValue();
progressBar.setValue(progress);
-
- // Button zum Fertigstellen freischalten, wenn 100% erreicht sind
- if (progress == 0 || progress == 100) {
- // not uploading currently
- btnZurck.setEnabled(true);
- } else {
- // currently uploading, don't let user interact
- btnZurck.setEnabled(false);
- }
-
- // Fertigstellen erlauben wenn upload abgeschlossen
- if (progress == 100) {
- finishButton.setEnabled(true);
-
- } else {
- finishButton.setEnabled(false);
-
- }
}
-
+ // Fertigstellen erlauben wenn upload abgeschlossen
+ if (isCurrentlyLoading() == false) {
+ // isCurrentlyLoading();
+ finishButton.setEnabled(true);
+ } else {
+ finishButton.setEnabled(false);
+ }
if ("speed" == arg0.getPropertyName()) {
speed = (double) arg0.getNewValue();
@@ -520,8 +606,9 @@ public class FTPCreateUploader_GUI extends JFrame implements
public boolean writeData() {
try {
-
+
client.writeVLdata(Image.image.getImagename(),
+ Image.image.getDesc(),
person.verantwortlicher.getUsername(),
person.verantwortlicher.getVorname(),
person.verantwortlicher.getName(),
@@ -530,18 +617,43 @@ public class FTPCreateUploader_GUI extends JFrame implements
person.verantwortlicher.getTel(),
person.verantwortlicher.getFakultaet(),
Image.image.isLicensed(), Image.image.isInternet(),
- Image.image.getRam(), Image.image.getCpu(),
- "temp/" + Image.image.getNewName(),Image.image.isVorlage(),Image.image.getFilesize(),Image.image.getShareMode());
+ Image.image.getRam(), Image.image.getCpu(), "temp/"
+ + Image.image.getNewName(),
+ Image.image.isVorlage(), Image.image.getFilesize(),
+ Image.image.getShareMode(), Image.image.getOS());
+
client.startFileCopy(Image.image.getNewName());
+
+ client.writeImageRights(Image.image.getImagename(),
+ person.verantwortlicher.getUsername(),
+ person.verantwortlicher.getName(),
+ person.verantwortlicher.getVorname(),
+ person.verantwortlicher.getEMail(),
+ person.verantwortlicher.getHochschule(),
+ person.verantwortlicher.getRole());
} catch (TException e) {
// TODO Auto-generated catch block
e.printStackTrace();
JOptionPane.showMessageDialog(null,
- e.getCause()+"\n"+e.getMessage(),
- "Debug-Message", JOptionPane.ERROR_MESSAGE);
+ e.getCause() + "\n" + e.getStackTrace(), "Debug-Message",
+ JOptionPane.ERROR_MESSAGE);
return false;
}
return true;
- }
-} \ No newline at end of file
+ }// end writeData()
+
+ public boolean isCurrentlyLoading() {
+ isCurrentlyLoading = false;
+
+ if (labelverbleibend.getText().equals("0 MB")
+ || labelverbleibend.getText().equals("0")) {
+ isCurrentlyLoading = false;
+ } else {
+ isCurrentlyLoading = true;
+ }
+
+ return isCurrentlyLoading;
+ }// end isCurrentlyLoading()
+
+}// end class \ No newline at end of file
diff --git a/Dozentenmodul/src/main/java/gui/image/FTPDownloader_GUI.java b/Dozentenmodul/src/main/java/gui/image/FTPEditDownloader_GUI.java
index d21da67e..013c2774 100644
--- a/Dozentenmodul/src/main/java/gui/image/FTPDownloader_GUI.java
+++ b/Dozentenmodul/src/main/java/gui/image/FTPEditDownloader_GUI.java
@@ -2,6 +2,7 @@ package gui.image;
import java.awt.BorderLayout;
import java.awt.Color;
+import java.awt.Cursor;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.SystemColor;
@@ -14,6 +15,7 @@ import java.awt.event.WindowEvent;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.io.File;
+import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
@@ -39,6 +41,8 @@ import models.Links;
import models.SessionData;
import org.apache.thrift.TException;
+import org.ini4j.InvalidFileFormatException;
+import org.ini4j.Wini;
import server.Server.Client;
import server.User;
@@ -50,7 +54,8 @@ import gui.intro.About_GUI;
import gui.intro.MainMenue_GUI;
@SuppressWarnings("serial")
-public class FTPDownloader_GUI extends JFrame implements PropertyChangeListener {
+public class FTPEditDownloader_GUI extends JFrame implements
+ PropertyChangeListener {
@SuppressWarnings("unused")
private JPanel contentPane;
@@ -67,6 +72,7 @@ public class FTPDownloader_GUI extends JFrame implements PropertyChangeListener
JLabel lblBytesread;
JLabel lblNewLabel_3;
JLabel labelVerbleibend;
+ JFileChooser fc;
long filesize;
double speed;
int progress = 0; // progress of download
@@ -77,36 +83,49 @@ public class FTPDownloader_GUI extends JFrame implements PropertyChangeListener
Client client = models.Client.clientcon.getClient();
JButton btnZurck = new JButton("Zur\u00FCck");
JButton btnDownloadStarten = new JButton("Download starten");
- JButton btnMainMenu = new JButton("Hauptmen\u00FC");
-
+ private JLabel lblAnleitung;
+ private boolean isCurrentlyLoading = false; // currently up or downloading
+ // file
/**
* Create the frame.
*/
- public FTPDownloader_GUI() {
+ public FTPEditDownloader_GUI() {
+
+ final Object[] options = { "Beenden", "Abbrechen" };
+
addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
if (taskrun == true) {
- try {
- client.DeleteFtpUser(user.userName);
- con.closeThriftConnection();
- } catch (TException e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
- JOptionPane.showMessageDialog(null,
- e1.getCause()+"\n"+e1.getMessage(),
- "Debug-Message", JOptionPane.ERROR_MESSAGE);
- }
- task.cancel(true);
- }
- //dispose();
- System.exit(0);
- }//end window closing
+ // check if user wants to quit.
+ int choice = JOptionPane
+ .showOptionDialog(
+ null,
+ "Aktuell ist ein Download aktiv. Wollen Sie diesen Abbrechen und das Programm beenden?",
+ "Upload aktiv",
+ JOptionPane.YES_NO_CANCEL_OPTION,
+ JOptionPane.QUESTION_MESSAGE, null,
+ options, options[1]);
+ // 0=beenden, 1=abbrechen
+ if (choice == 0) {
+ try {
+ client.DeleteFtpUser(user.userName);
+ con.closeThriftConnection();
+ } catch (TException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ task.cancel(true);
+ System.exit(0);
+ }// end if coice
+ } else {
+ // no download running, close window
+ System.exit(0);
+ }// end if taskrun
+ }// end window closing
});
setResizable(false);
- // setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
-
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (ClassNotFoundException | InstantiationException
@@ -116,11 +135,13 @@ public class FTPDownloader_GUI extends JFrame implements PropertyChangeListener
}
setBackground(Color.WHITE);
- setTitle("Dozentenmodul *Prototyp* - Image herunterladen");
+ setTitle("Dozentenmodul - Image herunterladen");
+ // Aktion die beim Schliessen durchgefuehrt werden soll
+ setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
setBounds(0, 0, 603, 722);
GuiOrganizer.centerGUI(this);
-
+
getContentPane().setLayout(new BorderLayout());
contentPanel.setBackground(SystemColor.menu);
contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
@@ -131,10 +152,29 @@ public class FTPDownloader_GUI extends JFrame implements PropertyChangeListener
"Speicherort ausw\u00E4hlen");
btnSpeicherortAuswhlen.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
- JFileChooser fc = new JFileChooser();
- fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
- fc.showOpenDialog(getParent());
+ try {
+ Wini ini = new Wini(
+ new File(
+ "C:\\Users\\"
+ + System.getProperty("user.name")
+ + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini"));
+ System.out.println("FileChooser Pfad: "
+ + ini.get("main", "Letzter Downloadpfad",
+ String.class));
+ fc = new JFileChooser(ini.get("main",
+ "Letzter Downloadpfad", String.class));
+ fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
+
+ fc.showOpenDialog(getParent());
+ } catch (InvalidFileFormatException e2) {
+ // TODO Auto-generated catch block
+ e2.printStackTrace();
+ } catch (IOException e2) {
+ // TODO Auto-generated catch block
+ e2.printStackTrace();
+ }
+
File dir = fc.getSelectedFile();
// check if directory is selected
if (dir != null) {
@@ -153,14 +193,27 @@ public class FTPDownloader_GUI extends JFrame implements PropertyChangeListener
}
lblPath = new JLabel("");
+ try {
+ Wini ini = new Wini(new File("C:\\Users\\"
+ + System.getProperty("user.name")
+ + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini"));
+ lblPath.setText(ini.get("main", "Letzter Downloadpfad",
+ String.class));
+ } catch (InvalidFileFormatException e2) {
+ // TODO Auto-generated catch block
+ e2.printStackTrace();
+ } catch (IOException e2) {
+ // TODO Auto-generated catch block
+ e2.printStackTrace();
+ }
lblPath.addPropertyChangeListener(new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent arg0) {
- if (lblPath.getText().isEmpty()) {
+ if (lblPath.getText() == null) {
// wenn leer, dann upload button nicht freigeben
btnDownloadStarten.setEnabled(false);
btnDownloadStarten.setText("Bitte warten");
} else {
- // wenn leer, dann upload button nicht freigeben
+ // wenn leer, dann upload button freigeben
btnDownloadStarten.setEnabled(true);
btnDownloadStarten.setText("Download starten");
}
@@ -239,7 +292,8 @@ public class FTPDownloader_GUI extends JFrame implements PropertyChangeListener
panel.add(lblImageDownloader);
JTextPane txtpnWhlenSieEinen = new JTextPane();
- txtpnWhlenSieEinen.setText("W\u00E4hlen Sie einen Ort aus, um das von Ihnen gw\u00E4hlte Image erunter zu laden.");
+ txtpnWhlenSieEinen
+ .setText("W\u00E4hlen Sie einen Ort aus, um das von Ihnen gw\u00E4hlte Image erunter zu laden.");
txtpnWhlenSieEinen.setEditable(false);
txtpnWhlenSieEinen.setBackground(SystemColor.menu);
txtpnWhlenSieEinen.setBounds(10, 36, 509, 32);
@@ -258,7 +312,7 @@ public class FTPDownloader_GUI extends JFrame implements PropertyChangeListener
label_2.setBounds(80, 95, 14, 14);
contentPanel.add(label_2);
- JLabel label_3 = new JLabel("VL-Image");
+ JLabel label_3 = new JLabel("Image");
label_3.setForeground(Color.BLUE);
label_3.setBounds(91, 92, 46, 20);
contentPanel.add(label_3);
@@ -289,62 +343,52 @@ public class FTPDownloader_GUI extends JFrame implements PropertyChangeListener
JLabel lblKlickenSieAuf = new JLabel(
"Klicken Sie auf \"Fertigstellen\".");
- lblKlickenSieAuf.setBounds(98, 423, 241, 14);
+ lblKlickenSieAuf.setBounds(102, 423, 241, 14);
contentPanel.add(lblKlickenSieAuf);
-
+
JMenuBar menuBar = new JMenuBar();
menuBar.setBounds(0, 0, 597, 21);
contentPanel.add(menuBar);
-
+
JMenu menu = new JMenu("Hilfe");
menuBar.add(menu);
-
+
JMenuItem menuItem = new JMenuItem("FAQ");
menuItem.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent arg0) {
-
OpenLinks open = new OpenLinks();
-
URI windows;
try {
windows = new URI(Links.getFAQ());
-
open.openWebpage(windows);
-
} catch (URISyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
-
}
});
menu.add(menuItem);
-
+
JMenuItem menuItem_1 = new JMenuItem("OTRS");
menuItem_1.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent arg0) {
-
OpenLinks open = new OpenLinks();
-
URI windows;
try {
windows = new URI(Links.getOTRS());
-
open.openWebpage(windows);
-
} catch (URISyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
-
}
});
menu.add(menuItem_1);
-
+
JMenuItem mntmAbout = new JMenuItem("About");
mntmAbout.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
@@ -353,6 +397,27 @@ public class FTPDownloader_GUI extends JFrame implements PropertyChangeListener
}
});
menu.add(mntmAbout);
+
+ lblAnleitung = new JLabel(
+ "<HTML><U>Anleitung zum erstellen einer virtuellen Maschine herunterladen</U></HTML>");
+ lblAnleitung.setForeground(Color.BLUE);
+ lblAnleitung.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseClicked(MouseEvent arg0) {
+ OpenLinks open = new OpenLinks();
+
+ URI anleitung;
+ try {
+ anleitung = new URI(Links.getAnleitungVMDK());
+ open.openWebpage(anleitung);
+ } catch (URISyntaxException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ });
+ lblAnleitung.setBounds(102, 448, 311, 14);
+ contentPanel.add(lblAnleitung);
{
JPanel buttonPane = new JPanel();
buttonPane.setBackground(UIManager.getColor("Button.background"));
@@ -361,39 +426,77 @@ public class FTPDownloader_GUI extends JFrame implements PropertyChangeListener
{
btnZurck.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
- if (taskrun == true) {
- task.cancel(true);
+ // check if loading file or not
+ if (isCurrentlyLoading() == true) {
+ int choice = JOptionPane
+ .showOptionDialog(
+ null,
+ "Nicht abgeschlossene Uploads werden beendet. Trotzdem zurück gehen?",
+ "Warnung",
+ JOptionPane.YES_NO_CANCEL_OPTION,
+ JOptionPane.QUESTION_MESSAGE, null,
+ options, options[1]);
+ // 0=beenden, 1=abbrechen
+ if (choice == 0) {
+ task.cancel(true);
+ try {
+ client.DeleteFtpUser(user.userName);
+ } catch (TException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ try {
+ Wini ini = new Wini(
+ new File(
+ "C:\\Users\\"
+ + System.getProperty("user.name")
+ + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini"));
+ ini.put("main", "Letzter Downloadpfad",
+ lblPath.getText());
+ ini.store();
+ } catch (InvalidFileFormatException e2) {
+ // TODO Auto-generated catch block
+ e2.printStackTrace();
+ } catch (IOException e2) {
+ // TODO Auto-generated catch block
+ e2.printStackTrace();
+ }
+ // go back one page
+ SearchEditImage_GUI se = new SearchEditImage_GUI();
+ se.setVisible(true);
+ dispose();
+ }// end choice
+
+ } else {
+
try {
- client.DeleteFtpUser(user.userName);
- } catch (TException e1) {
+ Wini ini = new Wini(
+ new File(
+ "C:\\Users\\"
+ + System.getProperty("user.name")
+ + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini"));
+ ini.put("main", "Letzter Downloadpfad",
+ lblPath.getText());
+ ini.store();
+ } catch (InvalidFileFormatException e2) {
// TODO Auto-generated catch block
- e1.printStackTrace();
- JOptionPane.showMessageDialog(null,
- e1.getCause()+"\n"+e1.getMessage(),
- "Debug-Message", JOptionPane.ERROR_MESSAGE);
+ e2.printStackTrace();
+ } catch (IOException e2) {
+ // TODO Auto-generated catch block
+ e2.printStackTrace();
}
- }
-
- SearchEditImage_GUI se = new SearchEditImage_GUI();
- se.setVisible(true);
- dispose();
+ // go back one page
+ SearchEditImage_GUI se = new SearchEditImage_GUI();
+ se.setVisible(true);
+ dispose();
+
+ }// end else
+
}
});
btnZurck.setActionCommand("Cancel");
buttonPane.add(btnZurck);
}
-
-
- btnMainMenu.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent arg0) {
-
- MainMenue_GUI mm = new MainMenue_GUI();
- mm.setVisible(true);
- dispose();
- }
- });
- btnMainMenu.setActionCommand("Cancel");
- buttonPane.add(btnMainMenu);
}
setVisible(true);
@@ -408,19 +511,21 @@ public class FTPDownloader_GUI extends JFrame implements PropertyChangeListener
try {
user = client.getFtpUser();
- downloadFile = user.path+"/"+client.getPathOfImage(Image.image.getImageId(),
- Image.image.getVersion());
+ downloadFile = user.path
+ + "/"
+ + client.getPathOfImage(Image.image.getImageId(),
+ Image.image.getVersion());
} catch (TException e) {
// TODO Auto-generated catch block
e.printStackTrace();
JOptionPane.showMessageDialog(null,
- e.getCause()+"\n"+e.getMessage(),
- "Debug-Message", JOptionPane.ERROR_MESSAGE);
+ e.getCause() + "\n" + e.getStackTrace(), "Debug-Message",
+ JOptionPane.ERROR_MESSAGE);
}
task = new DownloadTask(host, port, user.userName, user.password,
- downloadFile, lblPath.getText(), this);
+ downloadFile, lblPath.getText());
task.addPropertyChangeListener(this);
task.execute();
taskrun = true;
@@ -433,22 +538,10 @@ public class FTPDownloader_GUI extends JFrame implements PropertyChangeListener
if ("progress" == arg0.getPropertyName()) {
progress = (Integer) arg0.getNewValue();
progressBar.setValue(progress);
-
- // Button zum Fertigstellen freischalten, wenn 100% erreicht sind
- if (progress == 0 || progress == 100) {
- // not uploading currently
- btnZurck.setEnabled(true);
- btnMainMenu.setEnabled(true);
- } else {
- // currently uploading, don't let user interact
- btnZurck.setEnabled(false);
- btnMainMenu.setEnabled(false);
- }
}
if ("speed" == arg0.getPropertyName()) {
speed = (double) arg0.getNewValue();
- // if(speed<=1){
downspeed.setText(String.valueOf(speed).substring(0,
String.valueOf(speed).lastIndexOf(".") + 3)
@@ -480,5 +573,18 @@ public class FTPDownloader_GUI extends JFrame implements PropertyChangeListener
}
- }
-} \ No newline at end of file
+ }// end PropertyChange()
+
+ public boolean isCurrentlyLoading() {
+ isCurrentlyLoading = false;
+
+ if (labelVerbleibend.getText().equals("0 MB") || labelVerbleibend.getText().equals("0")) {
+ isCurrentlyLoading = false;
+ } else {
+ isCurrentlyLoading = true;
+ }
+ System.out.println("isCurrentlyLoading="+isCurrentlyLoading);
+ return isCurrentlyLoading;
+ }// end isCurrentlyLoading()
+
+}// end class
diff --git a/Dozentenmodul/src/main/java/gui/image/FTPEditUploader_GUI.java b/Dozentenmodul/src/main/java/gui/image/FTPEditUploader_GUI.java
index 9e21aba3..5d679ea5 100644
--- a/Dozentenmodul/src/main/java/gui/image/FTPEditUploader_GUI.java
+++ b/Dozentenmodul/src/main/java/gui/image/FTPEditUploader_GUI.java
@@ -14,6 +14,7 @@ import java.awt.event.WindowEvent;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.io.File;
+import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.text.DateFormat;
@@ -43,6 +44,8 @@ import models.SessionData;
import models.person;
import org.apache.thrift.TException;
+import org.ini4j.InvalidFileFormatException;
+import org.ini4j.Wini;
import server.Server.Client;
import thrift.ThriftConnection;
@@ -73,9 +76,11 @@ public class FTPEditUploader_GUI extends JFrame implements
JLabel labelfilesize;
JLabel labelZeit;
JLabel labelverbleibend;
+ JFileChooser fc;
long filesize;
double speed;
long bytesread;
+ boolean fileupload = false;
boolean taskrun = false;
int progress = 0;
ThriftConnection con = new ThriftConnection();
@@ -84,31 +89,51 @@ public class FTPEditUploader_GUI extends JFrame implements
JButton btnSpeicherortAuswhlen = new JButton("Image ausw\u00E4hlen");
JButton finishButton = new JButton("Fertigstellen");
JButton btnZurck = new JButton("Zur\u00FCck");
+ private boolean isCurrentlyLoading = false; // currently up or downloading
+ // file
-
/**
* Create the frame.
*/
public FTPEditUploader_GUI() {
+
+ final Object[] options = { "Beenden", "Abbrechen" };
+
addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent arg0) {
- if (taskrun == true) {
- try {
- client.DeleteFtpUser(user.userName);
- } catch (TException e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
- }
- task.cancel(true);
- }
- con.closeThriftConnection();
- System.exit(0);
+ if (taskrun == true) {
+ // check if user wants to quit.
+ int choice = JOptionPane
+ .showOptionDialog(
+ null,
+ "Aktuell ist ein Upload aktiv. Wollen Sie diesen Abbrechen und das Programm beenden?",
+ "Upload aktiv",
+ JOptionPane.YES_NO_CANCEL_OPTION,
+ JOptionPane.QUESTION_MESSAGE, null,
+ options, options[1]);
+ // 0=beenden, 1=abbrechen
+ if (choice == 0) {
+ try {
+ client.DeleteFtpUser(user.userName);
+ } catch (TException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ task.cancel(true);
+ con.closeThriftConnection();
+ System.exit(0);
+ }// end if choice
+ } else {
+ // no upload running, close window
+ System.exit(0);
+ }// end if taskrun
}// end window closing
});
setResizable(false);
- // setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
+ // Aktion die beim Schliessen durchgefuehrt werden soll
+ setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
@@ -120,7 +145,7 @@ public class FTPEditUploader_GUI extends JFrame implements
// filename=name;
setBackground(Color.WHITE);
- setTitle("Dozentenmodul *Prototyp* - Image bearbeiten");
+ setTitle("Dozentenmodul - Image bearbeiten");
setBounds(0, 0, 603, 722);
GuiOrganizer.centerGUI(this);
@@ -134,14 +159,29 @@ public class FTPEditUploader_GUI extends JFrame implements
btnSpeicherortAuswhlen.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
- JFileChooser fc = new JFileChooser();
+ try {
+ Wini ini = new Wini(
+ new File(
+ "C:\\Users\\"
+ + System.getProperty("user.name")
+ + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini"));
+ fc = new JFileChooser(ini.get("main",
+ "Letzter Uploadpfad", String.class));
+ } catch (InvalidFileFormatException e2) {
+ // TODO Auto-generated catch block
+ e2.printStackTrace();
+ } catch (IOException e2) {
+ // TODO Auto-generated catch block
+ e2.printStackTrace();
+ }
+
fc.setFileSelectionMode(JFileChooser.FILES_ONLY);
fc.showOpenDialog(getParent());
File file = fc.getSelectedFile();
// check if a file is selected and exists
if (file != null) {
- // file exists
+ // file selected
uploadFile = file;
filename = uploadFile.getName();
lblPath.setText(file.getAbsolutePath());
@@ -158,14 +198,26 @@ public class FTPEditUploader_GUI extends JFrame implements
}
lblPath = new JLabel("");
+ try {
+ Wini ini = new Wini(new File("C:\\Users\\"
+ + System.getProperty("user.name")
+ + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini"));
+ lblPath.setText(ini.get("main", "Letzter Uploadpfad", String.class));
+ } catch (InvalidFileFormatException e2) {
+ // TODO Auto-generated catch block
+ e2.printStackTrace();
+ } catch (IOException e2) {
+ // TODO Auto-generated catch block
+ e2.printStackTrace();
+ }
lblPath.addPropertyChangeListener(new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent arg0) {
if (lblPath.getText().isEmpty()) {
// wenn leer, dann upload button nicht freigeben
btnUploadStarten.setEnabled(false);
btnUploadStarten.setText("Bitte warten");
- } else {
- // wenn leer, dann upload button nicht freigeben
+ } else if (lblPath.getText().endsWith(".vmdk")) {
+ // wenn leer, dann upload button freigeben
btnUploadStarten.setEnabled(true);
btnUploadStarten.setText("Upload auf Server starten");
}
@@ -263,7 +315,7 @@ public class FTPEditUploader_GUI extends JFrame implements
label_3.setBounds(80, 91, 14, 14);
contentPanel.add(label_3);
- JLabel lblVlimage = new JLabel("VL-Image");
+ JLabel lblVlimage = new JLabel("Image");
lblVlimage.setForeground(Color.BLUE);
lblVlimage.setBounds(91, 88, 46, 20);
contentPanel.add(lblVlimage);
@@ -302,11 +354,39 @@ public class FTPEditUploader_GUI extends JFrame implements
getContentPane().add(buttonPane, BorderLayout.SOUTH);
{
- //finishButton.setEnabled(false);
+ // finishButton.setEnabled(false);
finishButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
updateData();
+ try {
+ Wini ini = new Wini(
+ new File(
+ "C:\\Users\\"
+ + System.getProperty("user.name")
+ + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini"));
+
+ // check if path has content, then write to file
+ if (lblPath.getText().contains("\\") == true) {
+ System.out.println("Hole Infos aus Label: "
+ + lblPath.getText());
+ ini.put("main",
+ "Letzter Uploadpfad",
+ lblPath.getText().substring(
+ 0,
+ lblPath.getText().lastIndexOf(
+ "\\")));
+ ini.store();
+ } else {
+ System.out.println("Mache nix");
+ }// end if
+ } catch (InvalidFileFormatException e2) {
+ // TODO Auto-generated catch block
+ e2.printStackTrace();
+ } catch (IOException e2) {
+ // TODO Auto-generated catch block
+ e2.printStackTrace();
+ }
dispose();
MainMenue_GUI m = new MainMenue_GUI();
m.setVisible(true);
@@ -318,21 +398,52 @@ public class FTPEditUploader_GUI extends JFrame implements
} catch (TException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
- JOptionPane.showMessageDialog(null,
- e1.getCause()+"\n"+e1.getMessage(),
- "Debug-Message", JOptionPane.ERROR_MESSAGE);
+ JOptionPane.showMessageDialog(
+ null,
+ e1.getCause() + "\n"
+ + e1.getStackTrace(),
+ "Debug-Message",
+ JOptionPane.ERROR_MESSAGE);
}
task.cancel(true);
}
-
+
}
});
btnZurck.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
- dispose();
- EditImageTechnisch_GUI ei = new EditImageTechnisch_GUI();
- ei.setVisible(true);
- }
+
+ // check if loading file or not
+ if (isCurrentlyLoading() == true) {
+ int choice = JOptionPane
+ .showOptionDialog(
+ null,
+ "Nicht abgeschlossene Uploads werden beendet. Trotzdem zurück gehen?",
+ "Warnung",
+ JOptionPane.YES_NO_CANCEL_OPTION,
+ JOptionPane.QUESTION_MESSAGE, null,
+ options, options[1]);
+ // 0=beenden, 1=abbrechen
+ if (choice == 0) {
+ try {
+ client.DeleteFtpUser(user.userName);
+ } catch (TException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ task.cancel(true);
+ // not loading files, go back one page
+ dispose();
+ PermissionEditImage_GUI ei = new PermissionEditImage_GUI();
+ ei.setVisible(true);
+
+ }// end if coice
+ } else {
+ dispose();
+ PermissionEditImage_GUI ei = new PermissionEditImage_GUI();
+ ei.setVisible(true);
+ }// end else
+ }// end action
});
btnZurck.setActionCommand("Cancel");
@@ -344,58 +455,56 @@ public class FTPEditUploader_GUI extends JFrame implements
JMenuBar menuBar = new JMenuBar();
setJMenuBar(menuBar);
-
+
JMenu menu = new JMenu("Hilfe");
menuBar.add(menu);
-
+
JMenuItem menuItem = new JMenuItem("FAQ");
menuItem.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent arg0) {
-
+
OpenLinks open = new OpenLinks();
-
+
URI windows;
try {
windows = new URI(Links.getFAQ());
-
+
open.openWebpage(windows);
-
+
} catch (URISyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
-
-
+
}
});
menu.add(menuItem);
-
+
JMenuItem menuItem_1 = new JMenuItem("OTRS");
menuItem_1.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent arg0) {
OpenLinks open = new OpenLinks();
-
+
URI windows;
try {
windows = new URI(Links.getOTRS());
-
+
open.openWebpage(windows);
-
+
} catch (URISyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
-
}
});
menu.add(menuItem_1);
-
+
JMenuItem mntmAbout = new JMenuItem("About");
mntmAbout.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
@@ -409,31 +518,35 @@ public class FTPEditUploader_GUI extends JFrame implements
}
private void buttonUploadActionPerformed(ActionEvent event) {
-
+ fileupload = true;
progressBar.setValue(0);
btnUploadStarten.setEnabled(false); // verhindert einen weiteren klick
btnUploadStarten.setText("Bitte warten");
try {
user = client.getFtpUser();
- System.out.println("FTP name" + user.userName);
- System.out.println("FTP path" + user.path);
- System.out.println("FTP pass" + user.password);
+ System.out.println("FTP name: " + user.userName);
+ System.out.println("FTP path: " + user.path);
+ System.out.println("FTP pass: " + user.password);
} catch (TException e) {
// TODO Auto-generated catch block
e.printStackTrace();
JOptionPane.showMessageDialog(null,
- e.getCause()+"\n"+e.getMessage(),
- "Debug-Message", JOptionPane.ERROR_MESSAGE);
+ e.getCause() + "\n" + e.getStackTrace(), "Debug-Message",
+ JOptionPane.ERROR_MESSAGE);
}
DateFormat formatter = new SimpleDateFormat("yyyMMddhhmmss");
-
+
+ System.out.println("Setting new Name: " + formatter.format(new Date())
+ + "_" + person.verantwortlicher.getHochschule() + "_"
+ + person.verantwortlicher.getUsername() + "_"
+ + Image.image.getImagename() + ".vmdk");
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+"temp/", uploadFile);
+ user.path + "temp/", uploadFile);
task.addPropertyChangeListener(this);
task.execute();
@@ -442,28 +555,18 @@ public class FTPEditUploader_GUI extends JFrame implements
}
public void propertyChange(PropertyChangeEvent arg0) {
+ // set progressbar
if ("progress" == arg0.getPropertyName()) {
progress = (Integer) arg0.getNewValue();
progressBar.setValue(progress);
-
- // Button zum Fertigstellen freischalten, wenn 100% erreicht sind
- if (progress == 100) {
- // not uploading currently
- btnZurck.setEnabled(true);
- } else {
- // currently uploading, don't let user interact
- btnZurck.setEnabled(false);
- }
-
- // Fertigstellen erlauben wenn upload abgeschlossen
- if (progress == 100) {
- finishButton.setEnabled(true);
- } else {
- finishButton.setEnabled(false);
- }
}
-
+ // Fertigstellen erlauben wenn upload abgeschlossen
+ if (isCurrentlyLoading() == true) {
+ finishButton.setEnabled(false);
+ } else {
+ finishButton.setEnabled(true);
+ }
if ("speed" == arg0.getPropertyName()) {
speed = (double) arg0.getNewValue();
@@ -504,35 +607,58 @@ public class FTPEditUploader_GUI extends JFrame implements
public boolean updateData() {
try {
- System.out.println("NewName="+Image.image.getNewName());
- System.out.println("OldName="+Image.image.getImagename());
- if(Image.image.getNewName().isEmpty()){
+ System.out.println("NewName=" + Image.image.getNewName());
+ System.out.println("OldName=" + Image.image.getImagename());
+ if (Image.image.getNewName() != null) {
client.updateImageData(Image.image.getImagename(),
- Image.image.getImagename(),Image.image.getImagepath(), Image.image.isLicensed(),
+ Image.image.getImagename(), Image.image.getDesc(),
+ Image.image.getImagepath(), Image.image.isLicensed(),
Image.image.isInternet(), Image.image.getRam(),
Image.image.getCpu(), Image.image.getImageId(),
- Image.image.getVersion(), Image.image.isVorlage(),Image.image.getFilesize(),Image.image.getShareMode());
- client.startFileCopy(Image.image.getNewName());
- }
- else{
-
-
- client.updateImageData(Image.image.getImagename(),
- 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.isVorlage(),Image.image.getFilesize(),Image.image.getShareMode());
- client.startFileCopy(Image.image.getNewName());
+ Image.image.getVersion(), Image.image.isVorlage(),
+ Image.image.getFilesize(), Image.image.getShareMode(),
+ Image.image.getOS());
+ if (fileupload == true) {
+ client.startFileCopy(Image.image.getNewName());
+ }
+
+ } else {
+
+ client.updateImageData(Image.image.getImagename(),
+ Image.image.getImagename(), Image.image.getDesc(),
+ "temp/" + Image.image.getNewName(),
+ Image.image.isLicensed(), Image.image.isInternet(),
+ Image.image.getRam(), Image.image.getCpu(),
+ Image.image.getImageId(), Image.image.getVersion(),
+ Image.image.isVorlage(), Image.image.getFilesize(),
+ Image.image.getShareMode(), Image.image.getOS());
+
+ if (fileupload == true) {
+ client.startFileCopy(Image.image.getNewName());
+ }
}
} catch (TException e) {
// TODO Auto-generated catch block
e.printStackTrace();
JOptionPane.showMessageDialog(null,
- e.getCause()+"\n"+e.getMessage(),
- "Debug-Message", JOptionPane.ERROR_MESSAGE);
+ e.getCause() + "\n" + e.getStackTrace(), "Debug-Message",
+ JOptionPane.ERROR_MESSAGE);
return false;
}
return true;
}
-} \ No newline at end of file
+
+ public boolean isCurrentlyLoading() {
+ isCurrentlyLoading = false;
+
+ if (labelverbleibend.getText().equals("0 MB")
+ || labelverbleibend.getText().equals("0")) {
+ isCurrentlyLoading = false;
+ } else {
+ isCurrentlyLoading = true;
+ }
+ return isCurrentlyLoading;
+ }// end isCurrentlyLoading()
+
+}// end class \ No newline at end of file
diff --git a/Dozentenmodul/src/main/java/gui/image/FTPSearchDownloader_GUI.java b/Dozentenmodul/src/main/java/gui/image/FTPSearchDownloader_GUI.java
new file mode 100644
index 00000000..c3041e41
--- /dev/null
+++ b/Dozentenmodul/src/main/java/gui/image/FTPSearchDownloader_GUI.java
@@ -0,0 +1,635 @@
+package gui.image;
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.FlowLayout;
+import java.awt.Font;
+import java.awt.SystemColor;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.io.File;
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import javax.swing.JButton;
+import javax.swing.JFileChooser;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JProgressBar;
+import javax.swing.JSeparator;
+import javax.swing.JTextPane;
+import javax.swing.SwingConstants;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+import javax.swing.border.EmptyBorder;
+
+import models.Image;
+import models.Links;
+import models.SessionData;
+
+import org.apache.thrift.TException;
+import org.ini4j.InvalidFileFormatException;
+import org.ini4j.Wini;
+
+import server.Server.Client;
+import server.User;
+import thrift.ThriftConnection;
+import util.GuiOrganizer;
+import util.OpenLinks;
+import ftp.DownloadTask;
+import gui.intro.About_GUI;
+import gui.intro.MainMenue_GUI;
+
+@SuppressWarnings("serial")
+public class FTPSearchDownloader_GUI extends JFrame implements
+ PropertyChangeListener {
+
+ @SuppressWarnings("unused")
+ private JPanel contentPane;
+ private final JPanel contentPanel = new JPanel();
+ JLabel lblPath;
+ JLabel downspeed;
+ User user;
+ JProgressBar progressBar;
+ String host = SessionData.session.getServerAdress();
+ int port = 21;
+ String downloadFile = "";
+ static String arg = "";
+ DownloadTask task;
+ JLabel lblBytesread;
+ JLabel lblNewLabel_3;
+ JLabel labelVerbleibend;
+ JFileChooser fc;
+ long filesize;
+ double speed;
+ int progress = 0; // progress of download
+ long bytesread;
+ JLabel labelZeit;
+ boolean taskrun = false;
+ ThriftConnection con = new ThriftConnection();
+ Client client = models.Client.clientcon.getClient();
+ JButton btnZurck = new JButton("Zur\u00FCck");
+ JButton btnDownloadStarten = new JButton("Download starten");
+ JButton btnMainMenu = new JButton("Hauptmen\u00FC");
+ private JLabel lblAnleitung;
+ private boolean isCurrentlyLoading = false; // currently up or downloading
+ // file
+
+ /**
+ * Create the frame.
+ */
+ public FTPSearchDownloader_GUI() {
+
+ final Object[] options = { "Beenden", "Abbrechen" };
+
+ addWindowListener(new WindowAdapter() {
+ @Override
+ public void windowClosing(WindowEvent e) {
+ if (taskrun == true) {
+ // check if user wants to quit.
+ int choice = JOptionPane
+ .showOptionDialog(
+ null,
+ "Aktuell ist ein Download aktiv. Wollen Sie diesen Abbrechen und das Programm beenden?",
+ "Upload aktiv",
+ JOptionPane.YES_NO_CANCEL_OPTION,
+ JOptionPane.QUESTION_MESSAGE, null,
+ options, options[1]);
+ // 0=beenden, 1=abbrechen
+ if (choice == 0) {
+
+ try {
+ client.DeleteFtpUser(user.userName);
+ con.closeThriftConnection();
+ } catch (TException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ task.cancel(true);
+
+ System.exit(0);
+ }// end if choice
+ } else {
+ // no download running, close window
+ System.exit(0);
+ }// end if taskrun
+ }// end window closing
+ });
+ setResizable(false);
+
+ try {
+ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+ } catch (ClassNotFoundException | InstantiationException
+ | IllegalAccessException | UnsupportedLookAndFeelException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ setBackground(Color.WHITE);
+ setTitle("Dozentenmodul - Image herunterladen");
+ // Aktion die beim Schliessen durchgefuehrt werden soll
+ setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
+ setBounds(0, 0, 603, 722);
+ GuiOrganizer.centerGUI(this);
+
+ getContentPane().setLayout(new BorderLayout());
+ contentPanel.setBackground(SystemColor.menu);
+ 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) {
+ try {
+ Wini ini = new Wini(
+ new File(
+ "C:\\Users\\"
+ + System.getProperty("user.name")
+ + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini"));
+ System.out.println("FileChooser Pfad: "
+ + ini.get("main", "Letzter Downloadpfad",
+ String.class));
+ fc = new JFileChooser(ini.get("main",
+ "Letzter Downloadpfad", String.class));
+ fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
+
+ fc.showOpenDialog(getParent());
+ } catch (InvalidFileFormatException e2) {
+ // TODO Auto-generated catch block
+ e2.printStackTrace();
+ } catch (IOException e2) {
+ // TODO Auto-generated catch block
+ e2.printStackTrace();
+ }
+
+ File dir = fc.getSelectedFile();
+ // check if directory is selected
+ if (dir != null) {
+ // is selected
+ lblPath.setText(dir.getAbsolutePath());
+ } else {
+ // no directory selected
+ lblPath.setText("");
+ }// end if
+ }
+ });
+
+ btnSpeicherortAuswhlen.setBounds(102, 124, 173, 23);
+ btnSpeicherortAuswhlen.setVerticalAlignment(SwingConstants.TOP);
+ contentPanel.add(btnSpeicherortAuswhlen);
+ }
+
+ lblPath = new JLabel("");
+ try {
+ Wini ini = new Wini(new File("C:\\Users\\"
+ + System.getProperty("user.name")
+ + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini"));
+ lblPath.setText(ini.get("main", "Letzter Downloadpfad",
+ String.class));
+ } catch (InvalidFileFormatException e2) {
+ // TODO Auto-generated catch block
+ e2.printStackTrace();
+ } catch (IOException e2) {
+ // TODO Auto-generated catch block
+ e2.printStackTrace();
+ }
+ lblPath.addPropertyChangeListener(new PropertyChangeListener() {
+ public void propertyChange(PropertyChangeEvent arg0) {
+ if (lblPath.getText() == null) {
+ // wenn leer, dann upload button nicht freigeben
+ btnDownloadStarten.setEnabled(false);
+ btnDownloadStarten.setText("Bitte warten");
+ } else {
+ // wenn leer, dann upload button nicht freigeben
+ btnDownloadStarten.setEnabled(true);
+ btnDownloadStarten.setText("Download starten");
+ }
+ }
+ });
+ lblPath.setBounds(102, 158, 485, 23);
+ contentPanel.add(lblPath);
+
+ btnDownloadStarten.setEnabled(false);
+ btnDownloadStarten.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent arg0) {
+ buttonDownloadActionPerformed(arg0);
+ }
+ });
+
+ btnDownloadStarten.setBounds(102, 200, 173, 23);
+ contentPanel.add(btnDownloadStarten);
+
+ progressBar = new JProgressBar(0, 100);
+ progressBar.setStringPainted(true);
+
+ progressBar.setBounds(102, 234, 485, 30);
+ contentPanel.add(progressBar);
+
+ JLabel lblDownloadgeschwindigkeit = new JLabel(
+ "Downloadgeschwindigkeit:");
+ lblDownloadgeschwindigkeit.setBounds(102, 275, 141, 14);
+ contentPanel.add(lblDownloadgeschwindigkeit);
+
+ downspeed = new JLabel("0");
+ downspeed.setBounds(374, 275, 117, 14);
+ contentPanel.add(downspeed);
+
+ JLabel lblFertig = new JLabel("Fertig:");
+ lblFertig.setBounds(102, 325, 46, 14);
+ contentPanel.add(lblFertig);
+
+ lblBytesread = new JLabel("0");
+ lblBytesread.setBounds(183, 325, 108, 14);
+ contentPanel.add(lblBytesread);
+
+ JLabel lblVon = new JLabel("von:");
+ lblVon.setBounds(318, 325, 46, 14);
+ contentPanel.add(lblVon);
+
+ lblNewLabel_3 = new JLabel("0");
+ lblNewLabel_3.setBounds(374, 325, 117, 14);
+ contentPanel.add(lblNewLabel_3);
+
+ JLabel lblMbVerbleibend = new JLabel("Verbleibend:");
+ lblMbVerbleibend.setBounds(102, 350, 71, 14);
+ contentPanel.add(lblMbVerbleibend);
+
+ labelVerbleibend = new JLabel("0");
+ labelVerbleibend.setBounds(183, 350, 108, 14);
+ contentPanel.add(labelVerbleibend);
+
+ JLabel lblGeschtzteVerbleibendeZeit = new JLabel(
+ "Gesch\u00E4tzte Verbleibende Zeit:");
+ lblGeschtzteVerbleibendeZeit.setBounds(102, 300, 150, 14);
+ contentPanel.add(lblGeschtzteVerbleibendeZeit);
+
+ labelZeit = new JLabel("0");
+ labelZeit.setBounds(374, 300, 117, 14);
+ contentPanel.add(labelZeit);
+
+ JPanel panel = new JPanel();
+ panel.setLayout(null);
+ panel.setBackground(SystemColor.menu);
+ panel.setBounds(10, 24, 577, 57);
+ contentPanel.add(panel);
+
+ JLabel lblImageDownloader = new JLabel("Image Downloader");
+ lblImageDownloader.setFont(new Font("Tahoma", Font.BOLD, 18));
+ lblImageDownloader.setBounds(10, 11, 509, 22);
+ panel.add(lblImageDownloader);
+
+ JTextPane txtpnWhlenSieEinen = new JTextPane();
+ txtpnWhlenSieEinen
+ .setText("W\u00E4hlen Sie einen Ort aus, um das von Ihnen gw\u00E4hlte Image erunter zu laden.");
+ txtpnWhlenSieEinen.setEditable(false);
+ txtpnWhlenSieEinen.setBackground(SystemColor.menu);
+ txtpnWhlenSieEinen.setBounds(10, 36, 509, 32);
+ panel.add(txtpnWhlenSieEinen);
+
+ JSeparator separator = new JSeparator();
+ separator.setBounds(0, 88, 597, 2);
+ contentPanel.add(separator);
+
+ JLabel label_1 = new JLabel("Hauptmen\u00FC");
+ label_1.setForeground(Color.BLUE);
+ label_1.setBounds(20, 92, 61, 20);
+ contentPanel.add(label_1);
+
+ JLabel label_2 = new JLabel(">");
+ label_2.setBounds(80, 95, 14, 14);
+ contentPanel.add(label_2);
+
+ JLabel label_3 = new JLabel("Image");
+ label_3.setForeground(Color.BLUE);
+ label_3.setBounds(91, 92, 46, 20);
+ contentPanel.add(label_3);
+
+ JLabel label_4 = new JLabel(">");
+ label_4.setBounds(139, 95, 14, 14);
+ contentPanel.add(label_4);
+
+ JLabel label_5 = new JLabel("Neu/Bearbeiten");
+ label_5.setBounds(149, 95, 108, 14);
+ contentPanel.add(label_5);
+
+ JSeparator separator_1 = new JSeparator();
+ separator_1.setBounds(-10, 648, 597, 2);
+ contentPanel.add(separator_1);
+
+ JLabel lblSchritt = new JLabel("Schritt 1:");
+ lblSchritt.setBounds(24, 128, 57, 14);
+ contentPanel.add(lblSchritt);
+
+ JLabel lblSchritt_1 = new JLabel("Schritt 2:");
+ lblSchritt_1.setBounds(24, 204, 57, 14);
+ contentPanel.add(lblSchritt_1);
+
+ JLabel lblSchritt_3 = new JLabel("Schritt 3:");
+ lblSchritt_3.setBounds(20, 423, 57, 14);
+ contentPanel.add(lblSchritt_3);
+
+ JLabel lblKlickenSieAuf = new JLabel(
+ "Klicken Sie auf \"Fertigstellen\".");
+ lblKlickenSieAuf.setBounds(102, 423, 241, 14);
+ contentPanel.add(lblKlickenSieAuf);
+
+ JMenuBar menuBar = new JMenuBar();
+ menuBar.setBounds(0, 0, 597, 21);
+ contentPanel.add(menuBar);
+
+ JMenu menu = new JMenu("Hilfe");
+ menuBar.add(menu);
+
+ JMenuItem menuItem = new JMenuItem("FAQ");
+ menuItem.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mousePressed(MouseEvent arg0) {
+
+ OpenLinks open = new OpenLinks();
+
+ URI windows;
+ try {
+ windows = new URI(Links.getFAQ());
+
+ open.openWebpage(windows);
+
+ } catch (URISyntaxException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ }
+ });
+
+ menu.add(menuItem);
+
+ JMenuItem menuItem_1 = new JMenuItem("OTRS");
+ menuItem_1.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mousePressed(MouseEvent arg0) {
+
+ OpenLinks open = new OpenLinks();
+
+ URI windows;
+ try {
+ windows = new URI(Links.getOTRS());
+
+ open.openWebpage(windows);
+
+ } catch (URISyntaxException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ }
+ });
+
+ menu.add(menuItem_1);
+
+ JMenuItem mntmAbout = new JMenuItem("About");
+ mntmAbout.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ About_GUI ab = new About_GUI();
+ ab.setVisible(true);
+ }
+ });
+ menu.add(mntmAbout);
+
+ lblAnleitung = new JLabel(
+ "<HTML><U>Anleitung zum erstellen einer virtuellen Maschine herunterladen</U></HTML>");
+ lblAnleitung.setForeground(Color.BLUE);
+ lblAnleitung.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseClicked(MouseEvent arg0) {
+ OpenLinks open = new OpenLinks();
+
+ URI anleitung;
+ try {
+ anleitung = new URI(Links.getAnleitungVMDK());
+ open.openWebpage(anleitung);
+ } catch (URISyntaxException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ });
+ lblAnleitung.setBounds(102, 448, 311, 14);
+ contentPanel.add(lblAnleitung);
+
+ {
+ JPanel buttonPane = new JPanel();
+ buttonPane.setBackground(UIManager.getColor("Button.background"));
+ buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
+ getContentPane().add(buttonPane, BorderLayout.SOUTH);
+ {
+ btnZurck.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ // check if loading file or not
+ if (isCurrentlyLoading() == true) {
+ int choice = JOptionPane
+ .showOptionDialog(
+ null,
+ "Nicht abgeschlossene Uploads werden beendet. Trotzdem zurück gehen?",
+ "Warnung",
+ JOptionPane.YES_NO_CANCEL_OPTION,
+ JOptionPane.QUESTION_MESSAGE, null,
+ options, options[1]);
+ // 0=beenden, 1=abbrechen
+ if (choice == 0) {
+ task.cancel(true);
+ try {
+ client.DeleteFtpUser(user.userName);
+ } catch (TException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ try {
+ Wini ini = new Wini(
+ new File(
+ "C:\\Users\\"
+ + System.getProperty("user.name")
+ + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini"));
+ ini.put("main", "Letzter Downloadpfad",
+ lblPath.getText());
+ ini.store();
+ } catch (InvalidFileFormatException e2) {
+ // TODO Auto-generated catch block
+ e2.printStackTrace();
+ } catch (IOException e2) {
+ // TODO Auto-generated catch block
+ e2.printStackTrace();
+ }
+ // go back one page
+ SearchImage_GUI si = new SearchImage_GUI();
+ si.setVisible(true);
+ dispose();
+ }// end choice
+
+ } else {
+
+ try {
+ Wini ini = new Wini(
+ new File(
+ "C:\\Users\\"
+ + System.getProperty("user.name")
+ + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini"));
+ ini.put("main", "Letzter Downloadpfad",
+ lblPath.getText());
+ ini.store();
+ } catch (InvalidFileFormatException e2) {
+ // TODO Auto-generated catch block
+ e2.printStackTrace();
+ } catch (IOException e2) {
+ // TODO Auto-generated catch block
+ e2.printStackTrace();
+ }
+ // go back one page
+ SearchImage_GUI si = new SearchImage_GUI();
+ si.setVisible(true);
+ dispose();
+ }// end else
+ }//end action
+ });
+ btnZurck.setActionCommand("Cancel");
+ buttonPane.add(btnZurck);
+ }
+
+ btnMainMenu.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent arg0) {
+ try {
+ Wini ini = new Wini(
+ new File(
+ "C:\\Users\\"
+ + System.getProperty("user.name")
+ + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini"));
+ ini.put("main", "Letzter Downloadpfad",
+ lblPath.getText());
+ ini.store();
+ } catch (InvalidFileFormatException e2) {
+ // TODO Auto-generated catch block
+ e2.printStackTrace();
+ } catch (IOException e2) {
+ // TODO Auto-generated catch block
+ e2.printStackTrace();
+ }
+ MainMenue_GUI mm = new MainMenue_GUI();
+ mm.setVisible(true);
+ dispose();
+ }
+ });
+ btnMainMenu.setActionCommand("Cancel");
+ buttonPane.add(btnMainMenu);
+ }
+ setVisible(true);
+
+ }
+
+ private void buttonDownloadActionPerformed(ActionEvent event) {
+
+ progressBar.setValue(0);
+ btnDownloadStarten.setEnabled(false); // verhindert schnellen zweiten
+ // Klick
+ btnDownloadStarten.setText("Bitte warten");
+ try {
+ user = client.getFtpUser();
+
+ downloadFile = user.path
+ + "/"
+ + client.getPathOfImage(Image.image.getImageId(),
+ Image.image.getVersion());
+
+ } catch (TException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ JOptionPane.showMessageDialog(null,
+ e.getCause() + "\n" + e.getStackTrace(), "Debug-Message",
+ JOptionPane.ERROR_MESSAGE);
+ }
+
+ task = new DownloadTask(host, port, user.userName, user.password,
+ downloadFile, lblPath.getText());
+ task.addPropertyChangeListener(this);
+ task.execute();
+ taskrun = true;
+
+ }
+
+ public void propertyChange(PropertyChangeEvent arg0) {
+
+ progress = 0;
+ if ("progress" == arg0.getPropertyName()) {
+ progress = (Integer) arg0.getNewValue();
+ progressBar.setValue(progress);
+ }
+
+ // Button zum Fertigstellen freischalten, wenn 100% erreicht sind
+ if (isCurrentlyLoading() == true) {
+ // not uploading currently
+ btnMainMenu.setEnabled(false);
+ } else {
+ // currently uploading, don't let user interact
+ btnMainMenu.setEnabled(true);
+ }
+
+ if ("speed" == arg0.getPropertyName()) {
+ speed = (double) arg0.getNewValue();
+ // if(speed<=1){
+
+ downspeed.setText(String.valueOf(speed).substring(0,
+ String.valueOf(speed).lastIndexOf(".") + 3)
+ + " MB/s");
+
+ }
+ if ("bytesread" == arg0.getPropertyName()) {
+ bytesread = (long) arg0.getNewValue();
+ lblBytesread.setText((bytesread / 1024 / 1024) + " MB");
+ labelVerbleibend
+ .setText(((filesize / 1024 / 1024) - (bytesread / 1024 / 1024))
+ + " MB");
+
+ labelZeit
+ .setText(String
+ .valueOf(
+ ((((filesize / 1024 / 1024) - (bytesread / 1024 / 1024)) / speed) / 60) + 1)
+ .substring(
+ 0,
+ String.valueOf(
+ (((filesize / 1024 / 1024) - (bytesread / 1024 / 1024)) / speed) / 60)
+ .lastIndexOf("."))
+ + " Minuten");
+
+ }
+ if ("filesize" == arg0.getPropertyName()) {
+ filesize = (long) arg0.getNewValue();
+ lblNewLabel_3.setText((filesize / 1024 / 1024) + " MB");
+
+ }
+
+ }
+
+ public boolean isCurrentlyLoading() {
+ isCurrentlyLoading = false;
+
+ if (labelVerbleibend.getText().equals("0 MB") || labelVerbleibend.getText().equals("0")) {
+ isCurrentlyLoading = false;
+ } else {
+ isCurrentlyLoading = true;
+ }
+ return isCurrentlyLoading;
+ }// end isCurrentlyLoading()
+
+}// end class \ No newline at end of file
diff --git a/Dozentenmodul/src/main/java/gui/image/PermissionCreateImage_GUI.java b/Dozentenmodul/src/main/java/gui/image/PermissionCreateImage_GUI.java
new file mode 100644
index 00000000..d2b0dada
--- /dev/null
+++ b/Dozentenmodul/src/main/java/gui/image/PermissionCreateImage_GUI.java
@@ -0,0 +1,552 @@
+package gui.image;
+
+import gui.intro.About_GUI;
+import gui.intro.MainMenue_GUI;
+
+import java.awt.Checkbox;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.FlowLayout;
+import java.awt.Font;
+import java.awt.SystemColor;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import javax.swing.AbstractButton;
+import javax.swing.ButtonGroup;
+import javax.swing.DefaultComboBoxModel;
+import javax.swing.Icon;
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JComboBox;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.JPanel;
+import javax.swing.JSeparator;
+import javax.swing.JTextPane;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+import javax.swing.border.EmptyBorder;
+import javax.swing.border.TitledBorder;
+import javax.swing.table.DefaultTableCellRenderer;
+import javax.swing.table.DefaultTableModel;
+import javax.swing.table.JTableHeader;
+import javax.swing.table.TableCellEditor;
+import javax.swing.table.TableCellRenderer;
+import javax.swing.table.TableColumn;
+import javax.swing.table.TableColumnModel;
+
+import models.Image;
+import models.Links;
+import util.GuiOrganizer;
+import util.OpenLinks;
+import javax.swing.JTable;
+import javax.swing.JScrollPane;
+import javax.swing.ScrollPaneConstants;
+import javax.swing.JTextField;
+
+import org.eclipse.jface.viewers.CheckboxCellEditor;
+
+import java.awt.Choice;
+
+@SuppressWarnings("serial")
+public class PermissionCreateImage_GUI extends JFrame {
+
+ private final JPanel contentPanel = new JPanel();
+ String[] result;
+ private JTable table;
+ private Class[] classes;
+ Object[] titles = { "Name", "Read", "Write", "Link allowed","Admin"};
+
+ final DefaultTableModel model = new DefaultTableModel(titles, 0) {
+
+ public boolean isCellEditable(int rowIndex, int mColIndex) {
+ if (mColIndex >= 1) {
+ return true;
+ }
+ return false;
+ }
+
+ public Class getColumnClass(int c) {
+ switch (c) {
+ case 0:
+ return String.class;
+ default:
+ return Boolean.class;
+ }
+ }
+
+ };
+ private JTextField textField;
+ private JLabel lblRead;
+ private JLabel lblWrite;
+ private JLabel lblAdmin;
+ private JLabel lblLinkallowed;
+ private JLabel lblReadDesc;
+ private JLabel lblWriteDesc;
+ private JLabel lblAdminDesc;
+ private JLabel lblLinkallowedDesc;
+ private JCheckBox chckbxFrAlleSichtbar;
+ private JLabel lblFuerAlleSichtbar;
+
+ public PermissionCreateImage_GUI() {
+ addWindowListener(new WindowAdapter() {
+ @Override
+ public void windowClosing(WindowEvent arg0) {
+ System.exit(0);
+ }
+ });
+ setResizable(false);
+
+ try {
+ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+ } catch (ClassNotFoundException | InstantiationException
+ | IllegalAccessException | UnsupportedLookAndFeelException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ setTitle("bwLehrpool Suite - Image erzeugen");
+
+ setBounds(0, 0, 603, 722);
+ GuiOrganizer.centerGUI(this);
+
+ getContentPane().setLayout(null);
+ {
+ JPanel panel = new JPanel();
+ panel.setBackground(SystemColor.menu);
+ panel.setBounds(10, 11, 577, 57);
+ getContentPane().add(panel);
+ panel.setLayout(null);
+ {
+ JLabel lblNewLabel = new JLabel(
+ "Image Berechtigungen (Nur zur Veranschaulichung)");
+ lblNewLabel.setBounds(10, 11, 509, 22);
+ panel.add(lblNewLabel);
+ lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18));
+ }
+
+ JTextPane txtpnBitteWhlenSie = new JTextPane();
+ txtpnBitteWhlenSie.setEditable(false);
+ txtpnBitteWhlenSie.setBackground(SystemColor.menu);
+ txtpnBitteWhlenSie
+ .setText("Definieren Sie hier bitte die gew\u00FCnschten Berechtigungen f\u00FCr ihr Image");
+ txtpnBitteWhlenSie.setBounds(10, 36, 509, 32);
+ panel.add(txtpnBitteWhlenSie);
+ }
+ contentPanel.setBounds(10, 85, 577, 531);
+ contentPanel.setBackground(SystemColor.menu);
+ contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
+ getContentPane().add(contentPanel);
+ contentPanel.setLayout(null);
+
+ JPanel panel_1 = new JPanel();
+ panel_1.setBackground(SystemColor.menu);
+ panel_1.setBorder(new TitledBorder(null, "Berechtigungen",
+ TitledBorder.LEADING, TitledBorder.TOP, null, null));
+ panel_1.setBounds(10, 228, 557, 292);
+ contentPanel.add(panel_1);
+ panel_1.setLayout(null);
+
+ JScrollPane scrollPane = new JScrollPane();
+ scrollPane
+ .setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
+ scrollPane.setBounds(10, 21, 537, 260);
+ panel_1.add(scrollPane);
+
+ table = new JTable();
+ table.setModel(model);
+ table.setSelectionForeground(Color.WHITE);
+ Object[] rowdata = { "Max Mustermann", new Boolean(false),
+ new Boolean(false), new Boolean(false), new Boolean(false),
+ new Boolean(false) };
+ model.addRow(rowdata);
+
+ TableCellRenderer rend = table.getTableHeader().getDefaultRenderer();
+
+ TableColumn tc1 = table.getColumnModel().getColumn(1);
+ tc1.setCellEditor(table.getDefaultEditor(Boolean.class));
+ tc1.setCellRenderer(table.getDefaultRenderer(Boolean.class));
+ tc1.setHeaderRenderer(new CheckBoxHeader(new MyItemListener1(),
+ (String) titles[1]));
+
+ TableColumn tc2 = table.getColumnModel().getColumn(2);
+ tc2.setCellEditor(table.getDefaultEditor(Boolean.class));
+ tc2.setCellRenderer(table.getDefaultRenderer(Boolean.class));
+ tc2.setHeaderRenderer(new CheckBoxHeader(new MyItemListener2(),
+ (String) titles[2]));
+
+ TableColumn tc3 = table.getColumnModel().getColumn(3);
+ tc3.setCellEditor(table.getDefaultEditor(Boolean.class));
+ tc3.setCellRenderer(table.getDefaultRenderer(Boolean.class));
+ tc3.setHeaderRenderer(new CheckBoxHeader(new MyItemListener3(),
+ (String) titles[3]));
+
+ TableColumn tc4 = table.getColumnModel().getColumn(4);
+ tc4.setCellEditor(table.getDefaultEditor(Boolean.class));
+ tc4.setCellRenderer(table.getDefaultRenderer(Boolean.class));
+ tc4.setHeaderRenderer(new CheckBoxHeader(new MyItemListener4(),
+ (String) titles[4]));
+
+ /*
+ TableColumn tc5 = table.getColumnModel().getColumn(5);
+ tc5.setCellEditor(table.getDefaultEditor(Boolean.class));
+ tc5.setCellRenderer(table.getDefaultRenderer(Boolean.class));
+ tc5.setHeaderRenderer(new CheckBoxHeader(new MyItemListener5(),
+ (String) titles[5]));
+ */
+ scrollPane.setViewportView(table);
+
+ JLabel lblHauptmen = new JLabel("Hauptmen\u00FC");
+ lblHauptmen.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseClicked(MouseEvent arg0) {
+
+ PermissionCreateImage_GUI.this.setVisible(false);
+ MainMenue_GUI main = new MainMenue_GUI();
+ main.setVisible(true);
+ }
+ });
+ lblHauptmen.setForeground(Color.BLUE);
+ lblHauptmen.setBounds(10, 11, 61, 14);
+ contentPanel.add(lblHauptmen);
+
+ JLabel label_1 = new JLabel(">");
+ label_1.setBounds(69, 11, 13, 14);
+ contentPanel.add(label_1);
+
+ JLabel lblVlimage = new JLabel("Image");
+ lblVlimage.setForeground(Color.BLUE);
+ lblVlimage.setBounds(81, 11, 45, 14);
+ contentPanel.add(lblVlimage);
+
+ JLabel label_2 = new JLabel(">");
+ label_2.setBounds(133, 11, 13, 14);
+ contentPanel.add(label_2);
+
+ JLabel lblNewLabel_1 = new JLabel("Berechtigung");
+ lblNewLabel_1.setBounds(146, 11, 80, 14);
+ contentPanel.add(lblNewLabel_1);
+
+ JLabel lblName = new JLabel("Name:");
+ lblName.setBounds(10, 36, 46, 20);
+ contentPanel.add(lblName);
+
+ textField = new JTextField();
+ textField.setBounds(69, 36, 171, 20);
+ contentPanel.add(textField);
+ textField.setColumns(10);
+
+ JLabel lblHochschule = new JLabel("Hochschule:");
+ lblHochschule.setBounds(275, 36, 80, 20);
+ contentPanel.add(lblHochschule);
+
+ JComboBox comboBox = new JComboBox();
+ comboBox.setModel(new DefaultComboBoxModel(new String[] {
+ "Hochschule Offenburg", "Hochschule Reutlingen",
+ "Universit\u00E4t Freiburg" }));
+ comboBox.setBounds(365, 36, 202, 20);
+ contentPanel.add(comboBox);
+
+ JPanel panel_2 = new JPanel();
+ panel_2.setBackground(SystemColor.menu);
+ panel_2.setBorder(new TitledBorder(null, "Beschreibung",
+ TitledBorder.LEADING, TitledBorder.TOP, null, null));
+ panel_2.setBounds(10, 67, 557, 150);
+ contentPanel.add(panel_2);
+ panel_2.setLayout(null);
+
+ lblRead = new JLabel("Read");
+ lblRead.setBounds(20, 18, 90, 20);
+ panel_2.add(lblRead);
+
+ lblWrite = new JLabel("Write");
+ lblWrite.setBounds(20, 38, 90, 20);
+ panel_2.add(lblWrite);
+
+ lblAdmin = new JLabel("Admin");
+ lblAdmin.setBounds(20, 78, 90, 20);
+ panel_2.add(lblAdmin);
+
+ lblLinkallowed = new JLabel("Link allowed");
+ lblLinkallowed.setBounds(20, 58, 90, 20);
+ panel_2.add(lblLinkallowed);
+
+ lblReadDesc = new JLabel(
+ "Image lesen und starten, in Suchfenster und VMchooser sichtbar.");
+ lblReadDesc.setBounds(120, 18, 427, 20);
+ panel_2.add(lblReadDesc);
+
+ lblWriteDesc = new JLabel(
+ "Image anpassen und überschrieben, jedoch nicht löschen.");
+ lblWriteDesc.setBounds(120, 38, 380, 20);
+ panel_2.add(lblWriteDesc);
+
+ lblAdminDesc = new JLabel(
+ "<HTML>Volle Rechte: read, write, löschen, Link_allowed und<br>Berechtigungen für andere Benutzer festlegen.</HTML>");
+ lblAdminDesc.setBounds(120, 78, 380, 40);
+ panel_2.add(lblAdminDesc);
+
+ lblLinkallowedDesc = new JLabel(
+ "Erzeugung einer Veranstaltung auf ein Image ist erlaubt.");
+ lblLinkallowedDesc.setBounds(120, 58, 380, 20);
+ panel_2.add(lblLinkallowedDesc);
+
+ chckbxFrAlleSichtbar = new JCheckBox("");
+ chckbxFrAlleSichtbar.setBounds(115, 119, 21, 23);
+ panel_2.add(chckbxFrAlleSichtbar);
+
+ lblFuerAlleSichtbar = new JLabel("Für alle sichtbar");
+ lblFuerAlleSichtbar.setBounds(20, 120, 90, 20);
+ panel_2.add(lblFuerAlleSichtbar);
+ {
+ JPanel buttonPane = new JPanel();
+ buttonPane.setBounds(0, 640, 597, 33);
+ buttonPane.setBackground(SystemColor.menu);
+ buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
+ getContentPane().add(buttonPane);
+ {
+ JButton cancelButton = new JButton("Zur\u00FCck");
+ cancelButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+
+ CreateImageFreigabe_GUI sr = new CreateImageFreigabe_GUI();
+ sr.setVisible(true);
+ dispose();
+ }
+ });
+ cancelButton.setActionCommand("OK");
+ buttonPane.add(cancelButton);
+ // getRootPane().setDefaultButton(cancelButton);
+ }
+ {
+ JButton continueButton = new JButton("Weiter");
+ continueButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+
+ FTPCreateUploader_GUI ea = new FTPCreateUploader_GUI();
+ ea.setVisible(true);
+ dispose();
+
+ }
+ });
+ continueButton.setActionCommand("Cancel");
+ buttonPane.add(continueButton);
+ getRootPane().setDefaultButton(continueButton);
+ }
+ }
+
+ JSeparator separator = new JSeparator();
+ separator.setBounds(0, 78, 597, 2);
+ getContentPane().add(separator);
+
+ JSeparator separator_1 = new JSeparator();
+ separator_1.setBounds(0, 627, 597, 2);
+ getContentPane().add(separator_1);
+
+ JMenuBar menuBar = new JMenuBar();
+ setJMenuBar(menuBar);
+
+ JMenu mnNewMenu_1 = new JMenu("Hilfe");
+ menuBar.add(mnNewMenu_1);
+
+ JMenuItem mntmFaq = new JMenuItem("FAQ");
+ mntmFaq.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mousePressed(MouseEvent arg0) {
+
+ OpenLinks open = new OpenLinks();
+
+ URI windows;
+ try {
+ windows = new URI(Links.getFAQ());
+
+ open.openWebpage(windows);
+
+ } catch (URISyntaxException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ });
+ mnNewMenu_1.add(mntmFaq);
+
+ JMenuItem mntmOtrs = new JMenuItem("OTRS");
+ mntmOtrs.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mousePressed(MouseEvent arg0) {
+
+ OpenLinks open = new OpenLinks();
+
+ URI windows;
+ try {
+ windows = new URI(Links.getOTRS());
+
+ open.openWebpage(windows);
+
+ } catch (URISyntaxException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ }
+ });
+ mnNewMenu_1.add(mntmOtrs);
+
+ JMenuItem mntmAbout = new JMenuItem("About");
+ mntmAbout.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ About_GUI ab = new About_GUI();
+ ab.setVisible(true);
+ }
+ });
+ mnNewMenu_1.add(mntmAbout);
+
+ }
+
+ class MyItemListener1 implements ItemListener {
+ public void itemStateChanged(ItemEvent e) {
+ Object source = e.getSource();
+ if (source instanceof AbstractButton == false)
+ return;
+ boolean checked = e.getStateChange() == ItemEvent.SELECTED;
+ for (int x = 0, y = table.getRowCount(); x < y; x++) {
+ table.setValueAt(new Boolean(checked), x, 1);
+ }
+ }
+ }
+
+ class MyItemListener2 implements ItemListener {
+ public void itemStateChanged(ItemEvent e) {
+ Object source = e.getSource();
+ if (source instanceof AbstractButton == false)
+ return;
+ boolean checked = e.getStateChange() == ItemEvent.SELECTED;
+ for (int x = 0, y = table.getRowCount(); x < y; x++) {
+ table.setValueAt(new Boolean(checked), x, 2);
+ }
+ }
+ }
+
+ class MyItemListener3 implements ItemListener {
+ public void itemStateChanged(ItemEvent e) {
+ Object source = e.getSource();
+ if (source instanceof AbstractButton == false)
+ return;
+ boolean checked = e.getStateChange() == ItemEvent.SELECTED;
+ for (int x = 0, y = table.getRowCount(); x < y; x++) {
+ table.setValueAt(new Boolean(checked), x, 3);
+ }
+ }
+ }
+
+ class MyItemListener4 implements ItemListener {
+ public void itemStateChanged(ItemEvent e) {
+ Object source = e.getSource();
+ if (source instanceof AbstractButton == false)
+ return;
+ boolean checked = e.getStateChange() == ItemEvent.SELECTED;
+ for (int x = 0, y = table.getRowCount(); x < y; x++) {
+ table.setValueAt(new Boolean(checked), x, 4);
+ }
+ }
+ }
+
+ class MyItemListener5 implements ItemListener {
+ public void itemStateChanged(ItemEvent e) {
+ Object source = e.getSource();
+ if (source instanceof AbstractButton == false)
+ return;
+ boolean checked = e.getStateChange() == ItemEvent.SELECTED;
+ for (int x = 0, y = table.getRowCount(); x < y; x++) {
+ table.setValueAt(new Boolean(checked), x, 5);
+ }
+ }
+ }
+}
+
+class CheckBoxHeader extends JCheckBox implements TableCellRenderer,
+ MouseListener {
+ protected CheckBoxHeader rendererComponent;
+ protected int column;
+ protected boolean mousePressed = false;
+
+ public CheckBoxHeader(ItemListener itemListener, String text) {
+ rendererComponent = this;
+ rendererComponent.addItemListener(itemListener);
+ rendererComponent.setText(text);
+ }
+
+ public Component getTableCellRendererComponent(JTable table, Object value,
+ boolean isSelected, boolean hasFocus, int row, int column) {
+ if (table != null) {
+ JTableHeader header = table.getTableHeader();
+ if (header != null) {
+ rendererComponent.setForeground(header.getForeground());
+ rendererComponent.setBackground(header.getBackground());
+ rendererComponent.setFont(header.getFont());
+ rendererComponent.setBorder(header.getBorder());
+ header.addMouseListener(rendererComponent);
+ }
+ }
+ setColumn(column);
+ // rendererComponent.setText("Check All");
+ // setBorder(UIManager.getBorder("TableHeader.cellBorder"));
+
+ return rendererComponent;
+ }
+
+ protected void setColumn(int column) {
+ this.column = column;
+ }
+
+ public int getColumn() {
+ return column;
+ }
+
+ protected void handleClickEvent(MouseEvent e) {
+ if (mousePressed) {
+ mousePressed = false;
+ JTableHeader header = (JTableHeader) (e.getSource());
+ JTable tableView = header.getTable();
+ TableColumnModel columnModel = tableView.getColumnModel();
+ int viewColumn = columnModel.getColumnIndexAtX(e.getX());
+ int column = tableView.convertColumnIndexToModel(viewColumn);
+
+ if (viewColumn == this.column && e.getClickCount() == 1
+ && column != -1) {
+ doClick();
+ }
+ }
+ }
+
+ public void mouseClicked(MouseEvent e) {
+ handleClickEvent(e);
+ ((JTableHeader) e.getSource()).repaint();
+ }
+
+ public void mousePressed(MouseEvent e) {
+ mousePressed = true;
+ }
+
+ public void mouseReleased(MouseEvent e) {
+ }
+
+ public void mouseEntered(MouseEvent e) {
+ }
+
+ public void mouseExited(MouseEvent e) {
+ }
+}
diff --git a/Dozentenmodul/src/main/java/gui/image/PermissionEditImage_GUI.java b/Dozentenmodul/src/main/java/gui/image/PermissionEditImage_GUI.java
new file mode 100644
index 00000000..4d780e8f
--- /dev/null
+++ b/Dozentenmodul/src/main/java/gui/image/PermissionEditImage_GUI.java
@@ -0,0 +1,504 @@
+package gui.image;
+
+import gui.intro.About_GUI;
+import gui.intro.MainMenue_GUI;
+
+import java.awt.Checkbox;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.FlowLayout;
+import java.awt.Font;
+import java.awt.SystemColor;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import javax.swing.AbstractButton;
+import javax.swing.ButtonGroup;
+import javax.swing.DefaultComboBoxModel;
+import javax.swing.Icon;
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JComboBox;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.JPanel;
+import javax.swing.JSeparator;
+import javax.swing.JTextPane;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+import javax.swing.border.EmptyBorder;
+import javax.swing.border.TitledBorder;
+import javax.swing.table.DefaultTableCellRenderer;
+import javax.swing.table.DefaultTableModel;
+import javax.swing.table.JTableHeader;
+import javax.swing.table.TableCellEditor;
+import javax.swing.table.TableCellRenderer;
+import javax.swing.table.TableColumn;
+import javax.swing.table.TableColumnModel;
+
+import models.Image;
+import models.Links;
+import util.GuiOrganizer;
+import util.OpenLinks;
+import javax.swing.JTable;
+import javax.swing.JScrollPane;
+import javax.swing.ScrollPaneConstants;
+import javax.swing.JTextField;
+
+import org.eclipse.jface.viewers.CheckboxCellEditor;
+
+import java.awt.Choice;
+
+@SuppressWarnings("serial")
+public class PermissionEditImage_GUI extends JFrame {
+
+ private final JPanel contentPanel = new JPanel();
+ String[] result;
+ private JTable table;
+ private Class[] classes;
+ Object[] titles = { "Name", "Read", "Write", "Link allowed","Admin"};
+
+ final DefaultTableModel model = new DefaultTableModel(titles, 0) {
+
+ public boolean isCellEditable(int rowIndex, int mColIndex) {
+ if (mColIndex >= 1) {
+ return true;
+ }
+ return false;
+ }
+
+ public Class getColumnClass(int c) {
+ switch (c) {
+ case 0:
+ return String.class;
+ default:
+ return Boolean.class;
+ }
+ }
+
+ };
+ private JTextField textField;
+ private JLabel lblLinkAllowed;
+ private JLabel label_5;
+ private JLabel label_6;
+ private JLabel label_7;
+
+ public PermissionEditImage_GUI() {
+ addWindowListener(new WindowAdapter() {
+ @Override
+ public void windowClosing(WindowEvent arg0) {
+ System.exit(0);
+ }
+ });
+ setResizable(false);
+
+ try {
+ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+ } catch (ClassNotFoundException | InstantiationException
+ | IllegalAccessException | UnsupportedLookAndFeelException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ setTitle("bwLehrpool Suite - Image erzeugen");
+
+ setBounds(0, 0, 603, 722);
+ GuiOrganizer.centerGUI(this);
+
+ getContentPane().setLayout(null);
+ {
+ JPanel panel = new JPanel();
+ panel.setBackground(SystemColor.menu);
+ panel.setBounds(10, 11, 577, 57);
+ getContentPane().add(panel);
+ panel.setLayout(null);
+ {
+ JLabel lblNewLabel = new JLabel(
+ "Image Berechtigungen (Nur zur Veranschaulichung)");
+ lblNewLabel.setBounds(10, 11, 509, 22);
+ panel.add(lblNewLabel);
+ lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18));
+ }
+
+ JTextPane txtpnBitteWhlenSie = new JTextPane();
+ txtpnBitteWhlenSie.setEditable(false);
+ txtpnBitteWhlenSie.setBackground(SystemColor.menu);
+ txtpnBitteWhlenSie
+ .setText("Definieren Sie hier bitte die gew\u00FCnschten Berechtigungen f\u00FCr Ihr Image");
+ txtpnBitteWhlenSie.setBounds(10, 36, 509, 32);
+ panel.add(txtpnBitteWhlenSie);
+ }
+ contentPanel.setBounds(10, 85, 577, 531);
+ contentPanel.setBackground(SystemColor.menu);
+ contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
+ getContentPane().add(contentPanel);
+ contentPanel.setLayout(null);
+
+ JPanel panel_1 = new JPanel();
+ panel_1.setBackground(SystemColor.menu);
+ panel_1.setBorder(new TitledBorder(null, "Berechtigungen",
+ TitledBorder.LEADING, TitledBorder.TOP, null, null));
+ panel_1.setBounds(10, 228, 557, 292);
+ contentPanel.add(panel_1);
+ panel_1.setLayout(null);
+
+ JScrollPane scrollPane = new JScrollPane();
+ scrollPane
+ .setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
+ scrollPane.setBounds(10, 21, 537, 260);
+ panel_1.add(scrollPane);
+
+ table = new JTable();
+ table.setModel(model);
+ table.setSelectionForeground(Color.WHITE);
+ Object[] rowdata = { "Max Mustermann", new Boolean(false),
+ new Boolean(false), new Boolean(false), new Boolean(false) };
+ model.addRow(rowdata);
+
+ TableCellRenderer rend = table.getTableHeader().getDefaultRenderer();
+
+ TableColumn tc1 = table.getColumnModel().getColumn(1);
+ tc1.setCellEditor(table.getDefaultEditor(Boolean.class));
+ tc1.setCellRenderer(table.getDefaultRenderer(Boolean.class));
+ tc1.setHeaderRenderer(new CheckBoxHeader(new MyItemListener1(),
+ (String) titles[1]));
+
+ TableColumn tc2 = table.getColumnModel().getColumn(2);
+ tc2.setCellEditor(table.getDefaultEditor(Boolean.class));
+ tc2.setCellRenderer(table.getDefaultRenderer(Boolean.class));
+ tc2.setHeaderRenderer(new CheckBoxHeader(new MyItemListener2(),
+ (String) titles[2]));
+
+ TableColumn tc3 = table.getColumnModel().getColumn(3);
+ tc3.setCellEditor(table.getDefaultEditor(Boolean.class));
+ tc3.setCellRenderer(table.getDefaultRenderer(Boolean.class));
+ tc3.setHeaderRenderer(new CheckBoxHeader(new MyItemListener3(),
+ (String) titles[3]));
+
+ TableColumn tc4 = table.getColumnModel().getColumn(4);
+ tc4.setCellEditor(table.getDefaultEditor(Boolean.class));
+ tc4.setCellRenderer(table.getDefaultRenderer(Boolean.class));
+ tc4.setHeaderRenderer(new CheckBoxHeader(new MyItemListener4(),
+ (String) titles[4]));
+ /*
+ TableColumn tc5 = table.getColumnModel().getColumn(5);
+ tc5.setCellEditor(table.getDefaultEditor(Boolean.class));
+ tc5.setCellRenderer(table.getDefaultRenderer(Boolean.class));
+ tc5.setHeaderRenderer(new CheckBoxHeader(new MyItemListener5(),
+ (String) titles[5]));
+ */
+ scrollPane.setViewportView(table);
+
+ JLabel lblHauptmen = new JLabel("Hauptmen\u00FC");
+ lblHauptmen.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseClicked(MouseEvent arg0) {
+
+ PermissionEditImage_GUI.this.setVisible(false);
+ MainMenue_GUI main = new MainMenue_GUI();
+ main.setVisible(true);
+ }
+ });
+ lblHauptmen.setForeground(Color.BLUE);
+ lblHauptmen.setBounds(10, 11, 61, 14);
+ contentPanel.add(lblHauptmen);
+
+ JLabel label_1 = new JLabel(">");
+ label_1.setBounds(69, 11, 13, 14);
+ contentPanel.add(label_1);
+
+ JLabel lblVlimage = new JLabel("Image");
+ lblVlimage.setForeground(Color.BLUE);
+ lblVlimage.setBounds(81, 11, 45, 14);
+ contentPanel.add(lblVlimage);
+
+ JLabel label_2 = new JLabel(">");
+ label_2.setBounds(133, 11, 13, 14);
+ contentPanel.add(label_2);
+
+ JLabel lblNewLabel_1 = new JLabel("Berechtigung");
+ lblNewLabel_1.setBounds(146, 11, 80, 14);
+ contentPanel.add(lblNewLabel_1);
+
+ JLabel lblName = new JLabel("Name:");
+ lblName.setBounds(10, 36, 46, 20);
+ contentPanel.add(lblName);
+
+ textField = new JTextField();
+ textField.setBounds(69, 36, 171, 20);
+ contentPanel.add(textField);
+ textField.setColumns(10);
+
+ JLabel lblHochschule = new JLabel("Hochschule:");
+ lblHochschule.setBounds(275, 36, 80, 20);
+ contentPanel.add(lblHochschule);
+
+ JComboBox comboBox = new JComboBox();
+ comboBox.setModel(new DefaultComboBoxModel(new String[] {
+ "Hochschule Offenburg", "Hochschule Reutlingen",
+ "Universit\u00E4t Freiburg" }));
+ comboBox.setBounds(365, 36, 202, 20);
+ contentPanel.add(comboBox);
+
+ JPanel panel = new JPanel();
+ panel.setBounds(10, 67, 557, 150);
+ contentPanel.add(panel);
+ panel.setLayout(null);
+ panel.setBorder(new TitledBorder(null, "Beschreibung",
+ TitledBorder.LEADING, TitledBorder.TOP, null, null));
+ panel.setBackground(SystemColor.menu);
+
+ JLabel label = new JLabel("Read");
+ label.setBounds(20, 18, 90, 20);
+ panel.add(label);
+
+ JLabel label_3 = new JLabel("Write");
+ label_3.setBounds(20, 38, 90, 20);
+ panel.add(label_3);
+
+ JLabel lblImageLesenUnd = new JLabel(
+ "Image lesen und starten, in Suchfenster und VMchooser sichtbar.");
+ lblImageLesenUnd.setBounds(120, 18, 380, 20);
+ panel.add(lblImageLesenUnd);
+
+ JLabel lblImageAnpassenUnd = new JLabel(
+ "Image anpassen und \u00DCberschrieben, jedoch nicht l\u00F6schen.");
+ lblImageAnpassenUnd.setBounds(120, 38, 380, 20);
+ panel.add(lblImageAnpassenUnd);
+
+ lblLinkAllowed = new JLabel("Link");
+ lblLinkAllowed.setBounds(20, 58, 90, 20);
+ panel.add(lblLinkAllowed);
+
+ label_5 = new JLabel("Admin");
+ label_5.setBounds(20, 78, 90, 20);
+ panel.add(label_5);
+
+ label_6 = new JLabel("Erzeugung einer Veranstaltung auf ein Image ist erlaubt.");
+ label_6.setBounds(120, 58, 380, 20);
+ panel.add(label_6);
+
+ label_7 = new JLabel("<HTML>Volle Rechte: read, write, l\u00F6schen, Link_allowed und<br>Berechtigungen f\u00FCr andere Benutzer festlegen.</HTML>");
+ label_7.setBounds(120, 78, 380, 40);
+ panel.add(label_7);
+
+ JLabel label_4 = new JLabel("F\u00FCr alle sichtbar");
+ label_4.setBounds(20, 120, 90, 20);
+ panel.add(label_4);
+
+ JCheckBox checkBox = new JCheckBox("");
+ checkBox.setBounds(115, 120, 21, 23);
+ panel.add(checkBox);
+ {
+ JPanel buttonPane = new JPanel();
+ buttonPane.setBounds(0, 640, 597, 33);
+ buttonPane.setBackground(SystemColor.menu);
+ buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
+ getContentPane().add(buttonPane);
+ {
+ JButton cancelButton = new JButton("Zur\u00FCck");
+ cancelButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+
+ EditImageFreigabe_GUI sr = new EditImageFreigabe_GUI();
+ sr.setVisible(true);
+ dispose();
+ }
+ });
+ cancelButton.setActionCommand("OK");
+ buttonPane.add(cancelButton);
+ // getRootPane().setDefaultButton(cancelButton);
+ }
+ {
+ JButton continueButton = new JButton("Weiter");
+ continueButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+
+ FTPEditUploader_GUI ea = new FTPEditUploader_GUI();
+ ea.setVisible(true);
+ dispose();
+
+ }
+ });
+ continueButton.setActionCommand("Cancel");
+ buttonPane.add(continueButton);
+ getRootPane().setDefaultButton(continueButton);
+ }
+ }
+
+ JSeparator separator = new JSeparator();
+ separator.setBounds(0, 78, 597, 2);
+ getContentPane().add(separator);
+
+ JSeparator separator_1 = new JSeparator();
+ separator_1.setBounds(0, 627, 597, 2);
+ getContentPane().add(separator_1);
+
+ JMenuBar menuBar = new JMenuBar();
+ setJMenuBar(menuBar);
+
+ JMenu mnNewMenu_1 = new JMenu("Hilfe");
+ menuBar.add(mnNewMenu_1);
+
+ JMenuItem mntmFaq = new JMenuItem("FAQ");
+ mntmFaq.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mousePressed(MouseEvent arg0) {
+
+ OpenLinks open = new OpenLinks();
+
+ URI windows;
+ try {
+ windows = new URI(Links.getFAQ());
+
+ open.openWebpage(windows);
+
+ } catch (URISyntaxException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ });
+ mnNewMenu_1.add(mntmFaq);
+
+ JMenuItem mntmOtrs = new JMenuItem("OTRS");
+ mntmOtrs.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mousePressed(MouseEvent arg0) {
+
+ OpenLinks open = new OpenLinks();
+
+ URI windows;
+ try {
+ windows = new URI(Links.getOTRS());
+
+ open.openWebpage(windows);
+
+ } catch (URISyntaxException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ }
+ });
+ mnNewMenu_1.add(mntmOtrs);
+
+ JMenuItem mntmAbout = new JMenuItem("About");
+ mntmAbout.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ About_GUI ab = new About_GUI();
+ ab.setVisible(true);
+ }
+ });
+ mnNewMenu_1.add(mntmAbout);
+
+ }
+
+ class MyItemListener1 implements ItemListener {
+ public void itemStateChanged(ItemEvent e) {
+ Object source = e.getSource();
+ if (source instanceof AbstractButton == false)
+ return;
+ boolean checked = e.getStateChange() == ItemEvent.SELECTED;
+ for (int x = 0, y = table.getRowCount(); x < y; x++) {
+ table.setValueAt(new Boolean(checked), x, 1);
+ }
+ }
+ }
+
+ class MyItemListener2 implements ItemListener {
+ public void itemStateChanged(ItemEvent e) {
+ Object source = e.getSource();
+ if (source instanceof AbstractButton == false)
+ return;
+ boolean checked = e.getStateChange() == ItemEvent.SELECTED;
+ for (int x = 0, y = table.getRowCount(); x < y; x++) {
+ table.setValueAt(new Boolean(checked), x, 2);
+ }
+ }
+ }
+
+ class MyItemListener3 implements ItemListener {
+ public void itemStateChanged(ItemEvent e) {
+ Object source = e.getSource();
+ if (source instanceof AbstractButton == false)
+ return;
+ boolean checked = e.getStateChange() == ItemEvent.SELECTED;
+ for (int x = 0, y = table.getRowCount(); x < y; x++) {
+ table.setValueAt(new Boolean(checked), x, 3);
+ }
+ }
+ }
+
+ class MyItemListener4 implements ItemListener {
+ public void itemStateChanged(ItemEvent e) {
+ Object source = e.getSource();
+ if (source instanceof AbstractButton == false)
+ return;
+ boolean checked = e.getStateChange() == ItemEvent.SELECTED;
+ for (int x = 0, y = table.getRowCount(); x < y; x++) {
+ table.setValueAt(new Boolean(checked), x, 4);
+ }
+ }
+ }
+
+ class MyItemListener5 implements ItemListener {
+ public void itemStateChanged(ItemEvent e) {
+ Object source = e.getSource();
+ if (source instanceof AbstractButton == false)
+ return;
+ boolean checked = e.getStateChange() == ItemEvent.SELECTED;
+ for (int x = 0, y = table.getRowCount(); x < y; x++) {
+ table.setValueAt(new Boolean(checked), x, 5);
+ }
+ }
+ }
+}
+
+/*
+ * class CheckBoxHeader extends JCheckBox implements TableCellRenderer,
+ * MouseListener { protected CheckBoxHeader rendererComponent; protected int
+ * column; protected boolean mousePressed = false;
+ *
+ * public CheckBoxHeader(ItemListener itemListener ,String text) {
+ * rendererComponent = this; rendererComponent.addItemListener(itemListener);
+ * rendererComponent.setText(text); }
+ *
+ * public Component getTableCellRendererComponent( JTable table, Object value,
+ * boolean isSelected, boolean hasFocus, int row, int column) { if (table !=
+ * null) { JTableHeader header = table.getTableHeader(); if (header != null) {
+ * rendererComponent.setForeground(header.getForeground());
+ * rendererComponent.setBackground(header.getBackground());
+ * rendererComponent.setFont(header.getFont());
+ * rendererComponent.setBorder(header.getBorder());
+ * header.addMouseListener(rendererComponent); } } setColumn(column);
+ * //rendererComponent.setText("Check All");
+ * //setBorder(UIManager.getBorder("TableHeader.cellBorder"));
+ *
+ * return rendererComponent; } protected void setColumn(int column) {
+ * this.column = column; } public int getColumn() { return column; } protected
+ * void handleClickEvent(MouseEvent e) { if (mousePressed) { mousePressed=false;
+ * JTableHeader header = (JTableHeader)(e.getSource()); JTable tableView =
+ * header.getTable(); TableColumnModel columnModel = tableView.getColumnModel();
+ * int viewColumn = columnModel.getColumnIndexAtX(e.getX()); int column =
+ * tableView.convertColumnIndexToModel(viewColumn);
+ *
+ * if (viewColumn == this.column && e.getClickCount() == 1 && column != -1) {
+ * doClick(); } } } public void mouseClicked(MouseEvent e) {
+ * handleClickEvent(e); ((JTableHeader)e.getSource()).repaint(); } public void
+ * mousePressed(MouseEvent e) { mousePressed = true; } public void
+ * mouseReleased(MouseEvent e) { } public void mouseEntered(MouseEvent e) { }
+ * public void mouseExited(MouseEvent e) { } }
+ */
diff --git a/Dozentenmodul/src/main/java/gui/image/SearchEditImage_GUI.java b/Dozentenmodul/src/main/java/gui/image/SearchEditImage_GUI.java
index 58fba9e7..83e12b72 100644
--- a/Dozentenmodul/src/main/java/gui/image/SearchEditImage_GUI.java
+++ b/Dozentenmodul/src/main/java/gui/image/SearchEditImage_GUI.java
@@ -17,8 +17,11 @@ import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.net.URI;
import java.net.URISyntaxException;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
import java.util.Iterator;
import java.util.List;
+import java.util.Map;
import javax.swing.JButton;
import javax.swing.JComboBox;
@@ -34,6 +37,7 @@ import javax.swing.JScrollPane;
import javax.swing.JSeparator;
import javax.swing.JTabbedPane;
import javax.swing.JTable;
+import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.JTextPane;
import javax.swing.RowFilter;
@@ -43,6 +47,8 @@ import javax.swing.border.EmptyBorder;
import javax.swing.border.TitledBorder;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;
import javax.swing.table.TableRowSorter;
@@ -63,34 +69,65 @@ import util.OpenLinks;
public class SearchEditImage_GUI extends JFrame {
private final JPanel contentPanel = new JPanel();
+ JLabel labelName;
+ JLabel labelUpdate;
+ JLabel labelVerantwortlicher;
+ JLabel labelWeitereVerantwortliche;
+ JLabel labelVorlage;
+ JLabel labelLizenzSoftware;
+ JLabel labelInternet;
+ JLabel labelRam;
+ JLabel labelCPU;
+ JLabel labelID;
+ JLabel labelVersion;
+ JTextArea textAreadesc;
+ private JLabel labelOS;
String[] result;
JRadioButton rdbtnInternetJa;
JRadioButton rdbtnInternetNein;
JComboBox<String> comboBox;
JTable tableAllImages;
JTable tablemyImages;
- boolean activeSearch=false;
+ JTable tablePublicVorlagen;
+ boolean activeSearch = false;
private JTextField textFieldName;
JTabbedPane tabbedPane;
- String[] titles = { "Image-Name", "Lizenzpflichtig", "OS", "Veranstaltung",
- "Verantwortlicher", "Letztes Update", "Schlagwort", "ID", "Version" };
+ String[] titles = { "Name", "Lizenzpflichtig", "OS", "Veranstaltung",
+ "Verantwortlicher", "Letztes Update", "ID", "Version", "Template" };// Angezeigt
+ // werden
+ // aber
+ // nur
+ // Name (0),
+ // OS (2),
+ // Verantwortlicher (4),
+ // Letztes
+ // Update (5)
+
ThriftConnection con = new ThriftConnection();
Client client = models.Client.clientcon.getClient();
- final DefaultTableModel modelAll = new DefaultTableModel(titles, 0){
- public boolean isCellEditable(int rowIndex, int mColIndex) {
- return false;
- }
+ final DefaultTableModel modelAll = new DefaultTableModel(titles, 0) {
+ public boolean isCellEditable(int rowIndex, int mColIndex) {
+ return false;
+ }
};
- final DefaultTableModel modelMyImages = new DefaultTableModel(titles, 0){
- public boolean isCellEditable(int rowIndex, int mColIndex) {
- return false;
- }
+ final DefaultTableModel modelMyImages = new DefaultTableModel(titles, 0) {
+ public boolean isCellEditable(int rowIndex, int mColIndex) {
+ return false;
+ }
+ };
+ final DefaultTableModel modelPublicVorlagen = new DefaultTableModel(titles,
+ 0) {
+ public boolean isCellEditable(int rowIndex, int mColIndex) {
+ return false;
+ }
};
final TableRowSorter<TableModel> rowSorterAll = new TableRowSorter<TableModel>(
modelAll);
final TableRowSorter<TableModel> rowSorterMyImages = new TableRowSorter<TableModel>(
modelMyImages);
-
+ final TableRowSorter<TableModel> rowSorterPublicVorlagen = new TableRowSorter<TableModel>(
+ modelPublicVorlagen);
+ private JTextField textField;
/**
* Create the dialog.
@@ -108,6 +145,71 @@ public class SearchEditImage_GUI extends JFrame {
public void windowOpened(WindowEvent arg0) {
initTableModel(modelMyImages);
initTableModel(modelAll);
+ initTableModel(modelPublicVorlagen);
+
+ //auszublendende Angaben
+ //1=Lizenzpflichtig
+ //3=Veranstaltung
+ //6=ID
+ //7=Version
+ //8=Template
+ tablemyImages.getColumnModel().getColumn(1).setWidth(0);
+ tablemyImages.getColumnModel().getColumn(1).setMinWidth(0);
+ tablemyImages.getColumnModel().getColumn(1).setMaxWidth(0);
+ tablemyImages.getColumnModel().getColumn(3).setWidth(0);
+ tablemyImages.getColumnModel().getColumn(3).setMinWidth(0);
+ tablemyImages.getColumnModel().getColumn(3).setMaxWidth(0);
+ tablemyImages.getColumnModel().getColumn(8).setWidth(0);
+ tablemyImages.getColumnModel().getColumn(8).setMinWidth(0);
+ tablemyImages.getColumnModel().getColumn(8).setMaxWidth(0);
+ tablemyImages.getColumnModel().getColumn(6).setWidth(0);
+ tablemyImages.getColumnModel().getColumn(6).setMinWidth(0);
+ tablemyImages.getColumnModel().getColumn(6).setMaxWidth(0);
+ tablemyImages.getColumnModel().getColumn(7).setWidth(0);
+ tablemyImages.getColumnModel().getColumn(7).setMinWidth(0);
+ tablemyImages.getColumnModel().getColumn(7).setMaxWidth(0);
+
+ tablePublicVorlagen.getColumnModel().getColumn(1).setWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(1)
+ .setMinWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(1)
+ .setMaxWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(3).setWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(3)
+ .setMinWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(3)
+ .setMaxWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(8).setWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(8)
+ .setMinWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(8)
+ .setMaxWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(6).setWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(6)
+ .setMinWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(6)
+ .setMaxWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(7).setWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(7)
+ .setMinWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(7)
+ .setMaxWidth(0);
+
+ tableAllImages.getColumnModel().getColumn(1).setWidth(0);
+ tableAllImages.getColumnModel().getColumn(1).setMinWidth(0);
+ tableAllImages.getColumnModel().getColumn(1).setMaxWidth(0);
+ tableAllImages.getColumnModel().getColumn(3).setWidth(0);
+ tableAllImages.getColumnModel().getColumn(3).setMinWidth(0);
+ tableAllImages.getColumnModel().getColumn(3).setMaxWidth(0);
+ tableAllImages.getColumnModel().getColumn(8).setWidth(0);
+ tableAllImages.getColumnModel().getColumn(8).setMinWidth(0);
+ tableAllImages.getColumnModel().getColumn(8).setMaxWidth(0);
+ tableAllImages.getColumnModel().getColumn(6).setWidth(0);
+ tableAllImages.getColumnModel().getColumn(6).setMinWidth(0);
+ tableAllImages.getColumnModel().getColumn(6).setMaxWidth(0);
+ tableAllImages.getColumnModel().getColumn(7).setWidth(0);
+ tableAllImages.getColumnModel().getColumn(7).setMinWidth(0);
+ tableAllImages.getColumnModel().getColumn(7).setMaxWidth(0);
textFieldName.requestFocusInWindow();
}
});
@@ -123,9 +225,9 @@ public class SearchEditImage_GUI extends JFrame {
e.printStackTrace();
}
// Setzt den Fenstertitel
- setTitle("bwLehrpool Suite *Prototyp* - Image bearbeiten");
+ setTitle("bwLehrpool Suite - Image bearbeiten");
// Zentriert das Fenster in die Bildmitte
- setBounds(0, 0, 603, 722);
+ setBounds(0, 0, 918, 722);
GuiOrganizer.centerGUI(this);
final DefaultTableModel model = new DefaultTableModel(titles, 0);
@@ -134,11 +236,11 @@ public class SearchEditImage_GUI extends JFrame {
{
JPanel panel = new JPanel();
panel.setBackground(SystemColor.menu);
- panel.setBounds(10, 11, 577, 57);
+ panel.setBounds(10, 11, 892, 57);
getContentPane().add(panel);
panel.setLayout(null);
{
- JLabel lblNewLabel = new JLabel("Suche nach VL-Image");
+ JLabel lblNewLabel = new JLabel("Imageauswahl");
lblNewLabel.setBounds(10, 11, 509, 22);
panel.add(lblNewLabel);
lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18));
@@ -148,7 +250,7 @@ public class SearchEditImage_GUI extends JFrame {
txtpnBitteWhlenSie.setEditable(false);
txtpnBitteWhlenSie.setBackground(SystemColor.menu);
txtpnBitteWhlenSie
- .setText("Hier k\u00F6nnen Sie nach Ihrem gew\u00FCnschten VL-Image suchen und dieses f\u00FCr weitere Schritte ausw\u00E4hlen");
+ .setText("Hier k\u00F6nnen Sie nach Ihrem gew\u00FCnschten Image suchen und dieses f\u00FCr weitere Schritte ausw\u00E4hlen");
txtpnBitteWhlenSie.setBounds(10, 36, 509, 32);
panel.add(txtpnBitteWhlenSie);
}
@@ -162,12 +264,12 @@ public class SearchEditImage_GUI extends JFrame {
panel_1.setBackground(SystemColor.menu);
panel_1.setBorder(new TitledBorder(null, "Filterfunktionen",
TitledBorder.LEADING, TitledBorder.TOP, null, null));
- panel_1.setBounds(10, 49, 557, 131);
+ panel_1.setBounds(10, 49, 557, 98);
contentPanel.add(panel_1);
panel_1.setLayout(null);
- JLabel lblNewLabel_2 = new JLabel("Anzeigename:");
- lblNewLabel_2.setBounds(10, 30, 250, 20);
+ JLabel lblNewLabel_2 = new JLabel("Name:");
+ lblNewLabel_2.setBounds(10, 30, 80, 20);
panel_1.add(lblNewLabel_2);
JLabel lblInternetIstInnerhalb = new JLabel("Betriebssystem:");
@@ -183,48 +285,36 @@ public class SearchEditImage_GUI extends JFrame {
String stext = textFieldName.getText();
// Wenn Textfield nicht leer
- if (stext.isEmpty()==false) {
- activeSearch=true;
+ if (stext.isEmpty() == false) {
+ activeSearch = true;
// Filtere nach der Eingabe
rowSorterAll.setRowFilter(RowFilter.regexFilter(
textFieldName.getText(), 0));
rowSorterMyImages.setRowFilter(RowFilter.regexFilter(
textFieldName.getText(), 0));
- }
- else{
- activeSearch=false;
- String username = person.verantwortlicher.getName() + " "
- + person.verantwortlicher.getVorname();
- rowSorterMyImages.setRowFilter(RowFilter.regexFilter(
- username, 4));
- rowSorterAll.setRowFilter(null);
- }
+ rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter(
+ textFieldName.getText(), 0));
+ } else {
+ activeSearch = false;
+ String username = person.verantwortlicher.getName() + " "
+ + person.verantwortlicher.getVorname();
+ rowSorterMyImages.setRowFilter(RowFilter.regexFilter(
+ username, 4));
+ rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter(
+ "true", 8));
+ rowSorterAll.setRowFilter(null);
+ }
}
});
- textFieldName.setBounds(270, 30, 250, 20);
+ textFieldName.setBounds(96, 30, 166, 20);
panel_1.add(textFieldName);
textFieldName.setColumns(10);
- JLabel lblErweiterteSuche = new JLabel(
- "<html><u>Erweiterte Suche *Folgt noch*</u></html>");
- lblErweiterteSuche.addMouseListener(new MouseAdapter() {
- @Override
- public void mouseClicked(MouseEvent arg0) {
- // oeffnet das Fenster Extended GUI
-
- //ExtendedSearchForImages_GUI es = new ExtendedSearchForImages_GUI();
- //es.setVisible(true);
- }
- });
- lblErweiterteSuche.setForeground(Color.BLUE);
-
- lblErweiterteSuche.setBounds(365, 106, 155, 14);
- panel_1.add(lblErweiterteSuche);
-
comboBox = new JComboBox<String>();
try {
- // Holt sich eine Liste aller verfuegbaren Betriebssysteme vom Server
+ // Holt sich eine Liste aller verfuegbaren Betriebssysteme vom
+ // Server
List<String> list = client.getAllOS();
// Leeres Item hinzufuegen
comboBox.addItem("");
@@ -236,42 +326,53 @@ public class SearchEditImage_GUI extends JFrame {
// TODO Auto-generated catch block
e2.printStackTrace();
JOptionPane.showMessageDialog(null,
- e2.getCause()+"\n"+e2.getMessage(),
- "Debug-Message", JOptionPane.ERROR_MESSAGE);
+ e2.getCause() + "\n" + e2.getStackTrace(), "Debug-Message",
+ JOptionPane.ERROR_MESSAGE);
}
// Registriert Auswahlaenderungen der Box
comboBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
// Prueft das die Auswahl nicht leer ist
- if (comboBox.getSelectedItem().toString().isEmpty()==false) {
+ if (comboBox.getSelectedItem().toString().isEmpty() == false) {
// Filtert nach dem ausgewaehlten Betriebssystem
- activeSearch=true;
+ activeSearch = true;
rowSorterAll.setRowFilter(RowFilter.regexFilter(comboBox
.getSelectedItem().toString(), 2));
rowSorterMyImages.setRowFilter(RowFilter.regexFilter(
comboBox.getSelectedItem().toString(), 2));
- }
- else{
- activeSearch=false;
+ rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter(
+ comboBox.getSelectedItem().toString(), 2));
+ } else {
+ activeSearch = false;
String username = person.verantwortlicher.getName() + " "
+ person.verantwortlicher.getVorname();
rowSorterMyImages.setRowFilter(RowFilter.regexFilter(
username, 4));
-
+ rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter(
+ "true", 8));
rowSorterAll.setRowFilter(null);
}
}
});
- comboBox.setBounds(270, 58, 250, 20);
+ comboBox.setBounds(96, 58, 166, 20);
panel_1.add(comboBox);
+
+ JLabel label_3 = new JLabel("Beschreibung:");
+ label_3.setBounds(291, 30, 80, 20);
+ panel_1.add(label_3);
+
+ textField = new JTextField();
+ textField.setColumns(10);
+ textField.setBounds(381, 30, 166, 20);
+ panel_1.add(textField);
JLabel lblHauptmen = new JLabel("Hauptmen\u00FC");
lblHauptmen.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent arg0) {
// oeffnet das Hauuetmenue
-
+
SearchEditImage_GUI.this.setVisible(false);
MainMenue_GUI main = new MainMenue_GUI();
main.setVisible(true);
@@ -285,52 +386,63 @@ public class SearchEditImage_GUI extends JFrame {
label_1.setBounds(69, 11, 13, 14);
contentPanel.add(label_1);
- JLabel lblVlimage = new JLabel("VL-Image");
+ JLabel lblVlimage = new JLabel("Image");
lblVlimage.setForeground(Color.BLUE);
lblVlimage.setBounds(81, 11, 45, 14);
contentPanel.add(lblVlimage);
JLabel label_2 = new JLabel(">");
- label_2.setBounds(133, 11, 13, 14);
+ label_2.setBounds(116, 11, 13, 14);
contentPanel.add(label_2);
JLabel lblNewLabel_1 = new JLabel("Imageauswahl");
- lblNewLabel_1.setBounds(146, 11, 85, 14);
+ lblNewLabel_1.setBounds(129, 11, 85, 14);
contentPanel.add(lblNewLabel_1);
tabbedPane = new JTabbedPane(JTabbedPane.TOP);
tabbedPane.addChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent arg0) {
- if (tabbedPane.getSelectedIndex() == 0 && activeSearch==false) {
+ if (tabbedPane.getSelectedIndex() == 0 && activeSearch == false) {
String username = person.verantwortlicher.getName() + " "
+ person.verantwortlicher.getVorname();
- // String username="Spitzer Tobias";
rowSorterMyImages.setRowFilter(RowFilter.regexFilter(
username, 4));
- } else if(tabbedPane.getSelectedIndex()==1 && activeSearch==false){
+ } else if (tabbedPane.getSelectedIndex() == 1
+ && activeSearch == false) {
+ rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter(
+ "true", 8));
+ } else if (tabbedPane.getSelectedIndex() == 2
+ && activeSearch == false) {
rowSorterAll.setRowFilter(null);
}
}
});
- tabbedPane.setBounds(10, 197, 557, 300);
+ tabbedPane.setBounds(10, 158, 557, 339);
contentPanel.add(tabbedPane);
-
-
- JScrollPane scrollPaneAllImages = new JScrollPane();
- tableAllImages = new JTable();
- tableAllImages.setModel(modelAll);
- tableAllImages.getColumnModel().getColumn(1).sizeWidthToFit();
- tableAllImages.getColumnModel().getColumn(2).sizeWidthToFit();
- tableAllImages.getColumnModel().getColumn(3).sizeWidthToFit();
- tableAllImages.getColumnModel().getColumn(4).sizeWidthToFit();
- tableAllImages.getColumnModel().getColumn(5).sizeWidthToFit();
-
JScrollPane scrollPaneMyImage = new JScrollPane();
tablemyImages = new JTable();
+ tablemyImages.getSelectionModel().addListSelectionListener(
+ new ListSelectionListener() {
+ public void valueChanged(ListSelectionEvent e) {
+ String imageid = modelMyImages.getValueAt(
+ tablemyImages
+ .convertRowIndexToModel(tablemyImages
+ .getSelectedRow()), 6)
+ .toString();
+ //System.out.println(imageid);
+ String version = modelMyImages.getValueAt(
+ tablemyImages
+ .convertRowIndexToModel(tablemyImages
+ .getSelectedRow()), 7)
+ .toString();
+ //System.out.println(version);
+ writeImageData(imageid, version);
+ }
+ });
tablemyImages.setModel(modelMyImages);
tablemyImages.getColumnModel().getColumn(1).sizeWidthToFit();
tablemyImages.getColumnModel().getColumn(2).sizeWidthToFit();
@@ -341,10 +453,6 @@ public class SearchEditImage_GUI extends JFrame {
scrollPaneMyImage.setViewportView(tablemyImages);
tabbedPane.addTab("Meine Images", null, scrollPaneMyImage, null);
- tableAllImages.setRowSorter(rowSorterAll);
-
- scrollPaneAllImages.setViewportView(tableAllImages);
- tabbedPane.addTab("Alle", null, scrollPaneAllImages, null);
JScrollPane scrollPaneCoopImages = new JScrollPane();
JTable tableCoopImages = new JTable();
@@ -355,64 +463,196 @@ public class SearchEditImage_GUI extends JFrame {
tableCoopImages.getColumnModel().getColumn(4).sizeWidthToFit();
tableCoopImages.getColumnModel().getColumn(5).sizeWidthToFit();
- scrollPaneCoopImages.setViewportView(tableCoopImages);
- tabbedPane.addTab("Kooperative Images", null, scrollPaneCoopImages,
- null);
- tabbedPane.setEnabledAt(2, false);
-
- JScrollPane scrollPanePublicImages = new JScrollPane();
- JTable tablePublicImages = new JTable();
- tablePublicImages.setModel(model);
- tablePublicImages.getColumnModel().getColumn(1).sizeWidthToFit();
- tablePublicImages.getColumnModel().getColumn(2).sizeWidthToFit();
- tablePublicImages.getColumnModel().getColumn(3).sizeWidthToFit();
- tablePublicImages.getColumnModel().getColumn(4).sizeWidthToFit();
- tablePublicImages.getColumnModel().getColumn(5).sizeWidthToFit();
-
- scrollPanePublicImages.setViewportView(tablePublicImages);
- tabbedPane.addTab("\u00D6ffentliche Images", null,
- scrollPanePublicImages, null);
- tabbedPane.setEnabledAt(3, false);
-
JScrollPane scrollPanePublicVorlagen = new JScrollPane();
- JTable tablePublicVorlagen = new JTable();
- tablePublicVorlagen.setModel(model);
+ tablePublicVorlagen = new JTable();
+ tablePublicVorlagen.getSelectionModel().addListSelectionListener(
+ new ListSelectionListener() {
+ public void valueChanged(ListSelectionEvent e) {
+ String imageid = modelPublicVorlagen
+ .getValueAt(
+ tablePublicVorlagen
+ .convertRowIndexToModel(tablePublicVorlagen
+ .getSelectedRow()), 6)
+ .toString();
+ //System.out.println(imageid);
+ String version = modelPublicVorlagen
+ .getValueAt(
+ tablePublicVorlagen
+ .convertRowIndexToModel(tablePublicVorlagen
+ .getSelectedRow()), 7)
+ .toString();
+ //System.out.println(version);
+ writeImageData(imageid, version);
+ }
+ });
+ tablePublicVorlagen.setModel(modelPublicVorlagen);
tablePublicVorlagen.getColumnModel().getColumn(1).sizeWidthToFit();
tablePublicVorlagen.getColumnModel().getColumn(2).sizeWidthToFit();
tablePublicVorlagen.getColumnModel().getColumn(3).sizeWidthToFit();
tablePublicVorlagen.getColumnModel().getColumn(4).sizeWidthToFit();
tablePublicVorlagen.getColumnModel().getColumn(5).sizeWidthToFit();
-
+ tablePublicVorlagen.setRowSorter(rowSorterPublicVorlagen);
scrollPanePublicVorlagen.setViewportView(tablePublicVorlagen);
- tabbedPane.addTab("\u00D6ffentliche Vorlagen", null,
- scrollPanePublicVorlagen, null);
- tabbedPane.setEnabledAt(4, false);
+ tabbedPane.addTab("Vorlagen", null, scrollPanePublicVorlagen, null);
+
+ JScrollPane scrollPaneAllImages = new JScrollPane();
+ tableAllImages = new JTable();
+ tableAllImages.getSelectionModel().addListSelectionListener(
+ new ListSelectionListener() {
+ public void valueChanged(ListSelectionEvent e) {
+
+ String imageid = modelAll.getValueAt(
+ tableAllImages
+ .convertRowIndexToModel(tableAllImages
+ .getSelectedRow()), 6)
+ .toString();
+ //System.out.println(imageid);
+ String version = modelAll.getValueAt(
+ tableAllImages
+ .convertRowIndexToModel(tableAllImages
+ .getSelectedRow()), 7)
+ .toString();
+ //System.out.println(version);
+ writeImageData(imageid, version);
+
+ }
+ });
+ tableAllImages.setModel(modelAll);
+ tableAllImages.getColumnModel().getColumn(1).sizeWidthToFit();
+ tableAllImages.getColumnModel().getColumn(2).sizeWidthToFit();
+ tableAllImages.getColumnModel().getColumn(3).sizeWidthToFit();
+ tableAllImages.getColumnModel().getColumn(4).sizeWidthToFit();
+ tableAllImages.getColumnModel().getColumn(5).sizeWidthToFit();
+ tableAllImages.setRowSorter(rowSorterAll);
+
+ scrollPaneAllImages.setViewportView(tableAllImages);
+ tabbedPane.addTab("Alle", null, scrollPaneAllImages, null);
+
+ scrollPaneCoopImages.setViewportView(tableCoopImages);
+ tabbedPane.addTab("bwLehrpool", null, scrollPaneCoopImages, null);
+ tabbedPane.setEnabledAt(3, false);
JButton btnDownload = new JButton("Download");
btnDownload.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
// oeffnet den Downloader
- if (tablemyImages.getSelectedRow() != -1) {
- String imageid = modelMyImages.getValueAt(
- tablemyImages.convertRowIndexToModel(tablemyImages
- .getSelectedRow()), 7).toString();
-
- Image.image.setImageId(imageid);
- String imageversion = modelMyImages.getValueAt(
- tablemyImages.convertRowIndexToModel(tablemyImages
- .getSelectedRow()), 8).toString();
-
- Image.image.setVersion(imageversion);
- SearchEditImage_GUI.this.setVisible(false);
- FTPDownloader_GUI down = new FTPDownloader_GUI();
- down.setVisible(true);
-
-
+ String username = person.verantwortlicher.getName() + " "
+ + person.verantwortlicher.getVorname();
+ // check if user is in correct tab
+ if (tabbedPane.getSelectedIndex() == 0) {
+ // check if a row is selected
+ if (tablemyImages.getSelectedRow() != -1) {
+ String imageid = modelMyImages.getValueAt(
+ tablemyImages
+ .convertRowIndexToModel(tablemyImages
+ .getSelectedRow()), 6)
+ .toString();
+
+ Image.image.setImageId(imageid);
+ String imageversion = modelMyImages.getValueAt(
+ tablemyImages
+ .convertRowIndexToModel(tablemyImages
+ .getSelectedRow()), 7)
+ .toString();
+
+ Image.image.setVersion(imageversion);
+
+ FTPEditDownloader_GUI ea = new FTPEditDownloader_GUI();
+ ea.setVisible(true);
+ dispose();
+ }
+ } else if (tabbedPane.getSelectedIndex() == 1) {
+ if (tablePublicVorlagen.getSelectedRow() != -1) {
+ if (modelPublicVorlagen
+ .getValueAt(
+ tablePublicVorlagen
+ .convertRowIndexToModel(tablePublicVorlagen
+ .getSelectedRow()), 4)
+ .equals(username) == true
+ || modelPublicVorlagen
+ .getValueAt(
+ tablePublicVorlagen
+ .convertRowIndexToModel(tablePublicVorlagen
+ .getSelectedRow()),
+ 8).equals("true") == true) {
+ String imageid = modelPublicVorlagen
+ .getValueAt(
+ tablePublicVorlagen
+ .convertRowIndexToModel(tablePublicVorlagen
+ .getSelectedRow()),
+ 6).toString();
+
+ Image.image.setImageId(imageid);
+ String imageversion = modelPublicVorlagen
+ .getValueAt(
+ tablePublicVorlagen
+ .convertRowIndexToModel(tablePublicVorlagen
+ .getSelectedRow()),
+ 7).toString();
+
+ Image.image.setVersion(imageversion);
+
+ FTPEditDownloader_GUI ea = new FTPEditDownloader_GUI();
+ ea.setVisible(true);
+ dispose();
+ } else {
+ JOptionPane
+ .showMessageDialog(
+ null,
+ "Sie haben keine Berechtigung fremde Images herunterzuladen.",
+ "Message",
+ JOptionPane.INFORMATION_MESSAGE);
+ }
+ }
+ } else if (tabbedPane.getSelectedIndex() == 2) {
+ if (tableAllImages.getSelectedRow() != -1) {
+ if (modelAll.getValueAt(
+ tableAllImages
+ .convertRowIndexToModel(tableAllImages
+ .getSelectedRow()), 4).equals(
+ username) == true
+ || modelAll
+ .getValueAt(
+ tableAllImages
+ .convertRowIndexToModel(tableAllImages
+ .getSelectedRow()),
+ 8).equals("true") == true) {
+ String imageid = modelAll
+ .getValueAt(
+ tableAllImages
+ .convertRowIndexToModel(tableAllImages
+ .getSelectedRow()),
+ 6).toString();
+
+ Image.image.setImageId(imageid);
+ String imageversion = modelAll
+ .getValueAt(
+ tableAllImages
+ .convertRowIndexToModel(tableAllImages
+ .getSelectedRow()),
+ 7).toString();
+
+ Image.image.setVersion(imageversion);
+
+ FTPEditDownloader_GUI ea = new FTPEditDownloader_GUI();
+ ea.setVisible(true);
+ dispose();
+ } else {
+ JOptionPane
+ .showMessageDialog(
+ null,
+ "Sie haben keine Berechtigung fremde Images herunterzuladen.",
+ "Message",
+ JOptionPane.INFORMATION_MESSAGE);
+ }
+ }
} else {
- JOptionPane.showMessageDialog(null,
- "Bitte w\u00e4hlen Sie ein Image f\u00fcr den Download aus",
- "Message", JOptionPane.INFORMATION_MESSAGE);
+ JOptionPane
+ .showMessageDialog(
+ null,
+ "Bitte w\u00e4hlen Sie ein Image f\u00fcr den Download aus",
+ "Message", JOptionPane.INFORMATION_MESSAGE);
}
}
});
@@ -420,7 +660,7 @@ public class SearchEditImage_GUI extends JFrame {
contentPanel.add(btnDownload);
{
JPanel buttonPane = new JPanel();
- buttonPane.setBounds(0, 640, 597, 33);
+ buttonPane.setBounds(0, 640, 902, 33);
buttonPane.setBackground(SystemColor.menu);
buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
getContentPane().add(buttonPane);
@@ -429,7 +669,7 @@ public class SearchEditImage_GUI extends JFrame {
okButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
// oeffnet das Hauptmenue
-
+
MainMenue_GUI main = new MainMenue_GUI();
main.setVisible(true);
dispose();
@@ -443,18 +683,19 @@ public class SearchEditImage_GUI extends JFrame {
JButton cancelButton = new JButton("Weiter");
cancelButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
-
+ String username = person.verantwortlicher.getName()
+ + " " + person.verantwortlicher.getVorname();
// check if user is in correct tab
if (tabbedPane.getSelectedIndex() == 0) {
- //check if a row is selected
+ // check if a row is selected
if (tablemyImages.getSelectedRow() != -1) {
String imageid = modelMyImages
.getValueAt(
tablemyImages
.convertRowIndexToModel(tablemyImages
.getSelectedRow()),
- 7).toString();
+ 6).toString();
Image.image.setImageId(imageid);
String imageversion = modelMyImages
@@ -462,23 +703,80 @@ public class SearchEditImage_GUI extends JFrame {
tablemyImages
.convertRowIndexToModel(tablemyImages
.getSelectedRow()),
- 8).toString();
+ 7).toString();
+
+ Image.image.setVersion(imageversion);
+
+ EditImageAllgemein_GUI ea = new EditImageAllgemein_GUI();
+ ea.setVisible(true);
+ dispose();
+ }
+ } else if (tabbedPane.getSelectedIndex() == 1) {
+ if (tablePublicVorlagen.getSelectedRow() != -1
+ && modelPublicVorlagen
+ .getValueAt(
+ tablePublicVorlagen
+ .convertRowIndexToModel(tablePublicVorlagen
+ .getSelectedRow()),
+ 4).equals(username) == true) {
+ String imageid = modelPublicVorlagen
+ .getValueAt(
+ tablePublicVorlagen
+ .convertRowIndexToModel(tablePublicVorlagen
+ .getSelectedRow()),
+ 6).toString();
+
+ Image.image.setImageId(imageid);
+ String imageversion = modelPublicVorlagen
+ .getValueAt(
+ tablePublicVorlagen
+ .convertRowIndexToModel(tablePublicVorlagen
+ .getSelectedRow()),
+ 7).toString();
Image.image.setVersion(imageversion);
-
+
+ EditImageAllgemein_GUI ea = new EditImageAllgemein_GUI();
+ ea.setVisible(true);
+ dispose();
+ }
+ } else if (tabbedPane.getSelectedIndex() == 2) {
+ if (tableAllImages.getSelectedRow() != -1
+ && modelAll
+ .getValueAt(
+ tableAllImages
+ .convertRowIndexToModel(tableAllImages
+ .getSelectedRow()),
+ 4).equals(username) == true) {
+ String imageid = modelAll
+ .getValueAt(
+ tableAllImages
+ .convertRowIndexToModel(tableAllImages
+ .getSelectedRow()),
+ 6).toString();
+
+ Image.image.setImageId(imageid);
+ String imageversion = modelAll
+ .getValueAt(
+ tableAllImages
+ .convertRowIndexToModel(tableAllImages
+ .getSelectedRow()),
+ 7).toString();
+
+ Image.image.setVersion(imageversion);
+
EditImageAllgemein_GUI ea = new EditImageAllgemein_GUI();
ea.setVisible(true);
dispose();
} else {
- JOptionPane.showMessageDialog(null,
- "Bitte w\u00e4hlen Sie ein Image aus.",
- "Image Auswahl", JOptionPane.INFORMATION_MESSAGE);
- }// end check if row is selected
- } else {
- JOptionPane.showMessageDialog(null,
- "Bitte w\u00e4hlen Sie ein eigenes Image aus.",
- "Image Auswahl", JOptionPane.INFORMATION_MESSAGE);
- }//end check if correct tab is selected
+ JOptionPane
+ .showMessageDialog(
+ null,
+ "Bitte w\u00e4hlen Sie ein eigenes Image aus.",
+ "Image Auswahl",
+ JOptionPane.INFORMATION_MESSAGE);
+ }
+ }// end check if correct tab is selected
}
});
cancelButton.setActionCommand("Cancel");
@@ -487,13 +785,137 @@ public class SearchEditImage_GUI extends JFrame {
}
JSeparator separator = new JSeparator();
- separator.setBounds(0, 78, 597, 2);
+ separator.setBounds(0, 79, 912, 1);
getContentPane().add(separator);
JSeparator separator_1 = new JSeparator();
- separator_1.setBounds(0, 627, 597, 2);
+ separator_1.setBounds(0, 627, 912, 2);
getContentPane().add(separator_1);
+ JPanel panel = new JPanel();
+ panel.setLayout(null);
+ panel.setBorder(new TitledBorder(null, "Detailinformationen",
+
+ TitledBorder.LEADING, TitledBorder.TOP, null, null));
+ panel.setBackground(SystemColor.menu);
+ panel.setBounds(586, 85, 316, 531);
+ getContentPane().add(panel);
+
+ JLabel lblName = new JLabel("Name:");
+ lblName.setBounds(10, 87, 130, 14);
+ panel.add(lblName);
+
+ labelName = new JLabel("");
+ labelName.setBounds(10, 102, 296, 14);
+ panel.add(labelName);
+
+ JLabel lblVerantwortlicher = new JLabel("Verantwortlicher:");
+ lblVerantwortlicher.setBounds(10, 259, 130, 14);
+ panel.add(lblVerantwortlicher);
+
+ labelOS = new JLabel("");
+ labelOS.setBounds(10, 216, 296, 14);
+ panel.add(labelOS);
+
+ JLabel lblWeitereVerantwortliche = new JLabel("Betriebssystem:");
+ lblWeitereVerantwortliche.setBounds(10, 202, 130, 14);
+ panel.add(lblWeitereVerantwortliche);
+
+ labelVerantwortlicher = new JLabel("");
+ labelVerantwortlicher.setBounds(10, 272, 296, 14);
+ panel.add(labelVerantwortlicher);
+
+ JLabel label = new JLabel("Weitere Verantwortliche:");
+ label.setBounds(10, 284, 130, 14);
+ panel.add(label);
+
+ labelWeitereVerantwortliche = new JLabel("");
+ labelWeitereVerantwortliche.setBounds(10, 297, 296, 14);
+ panel.add(labelWeitereVerantwortliche);
+
+ labelUpdate = new JLabel("");
+ labelUpdate.setBounds(10, 245, 296, 14);
+ panel.add(labelUpdate);
+
+ JLabel lblLetztesUpdate = new JLabel("Letztes Update:");
+ lblLetztesUpdate.setBounds(10, 231, 130, 14);
+ panel.add(lblLetztesUpdate);
+
+ JLabel lblImageIstVorlage = new JLabel("Image ist Vorlage:");
+ lblImageIstVorlage.setBounds(10, 336, 130, 14);
+ panel.add(lblImageIstVorlage);
+
+ labelVorlage = new JLabel("");
+ labelVorlage.setBounds(10, 350, 296, 14);
+ panel.add(labelVorlage);
+
+ labelLizenzSoftware = new JLabel("");
+ labelLizenzSoftware.setBounds(10, 383, 296, 14);
+ panel.add(labelLizenzSoftware);
+
+ JLabel lblLizenzpflichtigeSoftware = new JLabel(
+ "Lizenzpflichtige Software:");
+ lblLizenzpflichtigeSoftware.setBounds(10, 367, 130, 14);
+ panel.add(lblLizenzpflichtigeSoftware);
+
+ JLabel lblInternet = new JLabel("Internetsperre vorhanden:");
+ lblInternet.setBounds(10, 400, 130, 14);
+ panel.add(lblInternet);
+
+ labelInternet = new JLabel("");
+ labelInternet.setBounds(10, 417, 296, 14);
+ panel.add(labelInternet);
+
+ JLabel lblEmpfehlungRam = new JLabel("Empfehlung RAM:");
+ lblEmpfehlungRam.setBounds(10, 432, 130, 14);
+ panel.add(lblEmpfehlungRam);
+
+ labelRam = new JLabel("");
+ labelRam.setBounds(10, 455, 296, 14);
+ panel.add(labelRam);
+
+ JLabel lblEmpfehlungCpu = new JLabel("Empfehlung CPU:");
+ lblEmpfehlungCpu.setBounds(10, 469, 130, 14);
+ panel.add(lblEmpfehlungCpu);
+
+ labelCPU = new JLabel("");
+ labelCPU.setBounds(10, 487, 296, 14);
+ panel.add(labelCPU);
+
+ JLabel lblTechnischeDaten = new JLabel("Technische Daten:");
+ lblTechnischeDaten.setBounds(10, 322, 296, 14);
+ panel.add(lblTechnischeDaten);
+
+ JLabel lblId = new JLabel("ID:");
+ lblId.setBounds(10, 23, 296, 14);
+ panel.add(lblId);
+
+ labelID = new JLabel("");
+ labelID.setBounds(10, 37, 296, 14);
+ panel.add(labelID);
+
+ labelVersion = new JLabel("");
+ labelVersion.setBounds(10, 73, 296, 14);
+ panel.add(labelVersion);
+
+ JLabel lblVersion = new JLabel("Version:");
+ lblVersion.setBounds(10, 57, 296, 14);
+ panel.add(lblVersion);
+
+ JLabel lblBeschreibung = new JLabel("Beschreibung:");
+ lblBeschreibung.setBounds(10, 119, 130, 14);
+ panel.add(lblBeschreibung);
+
+ JScrollPane scrollPane = new JScrollPane();
+ scrollPane.setBounds(10, 135, 296, 65);
+ panel.add(scrollPane);
+
+ textAreadesc = new JTextArea();
+ textAreadesc.setLineWrap(true);
+ textAreadesc.setEditable(false);
+ textAreadesc.setFont(new Font("Tahoma", Font.PLAIN, 11));
+ textAreadesc.setBackground(SystemColor.menu);
+ scrollPane.setViewportView(textAreadesc);
JMenuBar menuBar = new JMenuBar();
setJMenuBar(menuBar);
@@ -504,15 +926,15 @@ public class SearchEditImage_GUI extends JFrame {
mntmFaq.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent arg0) {
-
+
OpenLinks open = new OpenLinks();
-
+
URI windows;
try {
windows = new URI(Links.getFAQ());
-
+
open.openWebpage(windows);
-
+
} catch (URISyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
@@ -520,7 +942,6 @@ public class SearchEditImage_GUI extends JFrame {
}
});
mnNewMenu_1.add(mntmFaq);
-
JMenuItem mntmOtrs = new JMenuItem("OTRS");
mntmOtrs.addMouseListener(new MouseAdapter() {
@@ -528,22 +949,22 @@ public class SearchEditImage_GUI extends JFrame {
public void mousePressed(MouseEvent arg0) {
OpenLinks open = new OpenLinks();
-
+
URI windows;
try {
windows = new URI(Links.getOTRS());
-
+
open.openWebpage(windows);
-
+
} catch (URISyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
-
+
}
});
mnNewMenu_1.add(mntmOtrs);
-
+
JMenuItem mntmAbout = new JMenuItem("About");
mntmAbout.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
@@ -563,7 +984,8 @@ public class SearchEditImage_GUI extends JFrame {
images = client.getImageList();
Iterator<server.Image> i = images.iterator();
-
+ SimpleDateFormat in = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ SimpleDateFormat out = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss");
int x = 0;
while (i.hasNext()) {
@@ -573,9 +995,11 @@ public class SearchEditImage_GUI extends JFrame {
images.get(x).getOsName(),
images.get(x).getLectureName(),
images.get(x).getUserData(),
- images.get(x).getUpdateTime(), "", images.get(x).id,
- images.get(x).getVersion() };
+ out.format(in.parse(images.get(x).updateTime)),
+ images.get(x).id, images.get(x).getVersion(),
+ images.get(x).getIsTemplate() };
// Fuege diese Objekte der Tabelle hinzu
+
model.addRow(obj);
x++;
i.next();
@@ -583,14 +1007,49 @@ public class SearchEditImage_GUI extends JFrame {
}
return model;
- } catch (TException e1) {
+ } catch (TException | ParseException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
JOptionPane.showMessageDialog(null,
- e1.getCause()+"\n"+e1.getMessage(),
- "Debug-Message", JOptionPane.ERROR_MESSAGE);
+ e1.getCause() + "\n" + e1.getStackTrace(), "Debug-Message",
+ JOptionPane.ERROR_MESSAGE);
}
return model;
}
+ public void writeImageData(String id, String version) {
+ try {
+ SimpleDateFormat in = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ SimpleDateFormat out = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss");
+ Map<String, String> res = client.getImageData(id, version);
+ labelName.setText(res.get("name"));
+ labelOS.setText(res.get("os"));
+ labelUpdate.setText(out.format(in.parse(res.get("lastupdate"))));
+ labelVerantwortlicher.setText(res.get("owner"));
+ labelWeitereVerantwortliche.setText("Noch nicht Verf\u00fcgbar");
+ if (res.get("template").equals("true")) {
+ labelVorlage.setText("Ja");
+ } else {
+ labelVorlage.setText("Nein");
+ }
+ if (res.get("license").equals("1")) {
+ labelLizenzSoftware.setText("Ja");
+ } else {
+ labelLizenzSoftware.setText("Nein");
+ }
+ if (res.get("internet").equals("1")) {
+ labelInternet.setText("Ja");
+ } else {
+ labelInternet.setText("Nein");
+ }
+ labelRam.setText(res.get("ram"));
+ labelCPU.setText(res.get("cpu"));
+ labelID.setText(res.get("id"));
+ labelVersion.setText(res.get("version"));
+ textAreadesc.setText(res.get("desc"));
+ } catch (TException | ParseException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ }
}
diff --git a/Dozentenmodul/src/main/java/gui/image/SearchImage_GUI.java b/Dozentenmodul/src/main/java/gui/image/SearchImage_GUI.java
index c20ecc99..f41135b1 100644
--- a/Dozentenmodul/src/main/java/gui/image/SearchImage_GUI.java
+++ b/Dozentenmodul/src/main/java/gui/image/SearchImage_GUI.java
@@ -1,529 +1,963 @@
-package gui.image;
-
-import gui.intro.About_GUI;
-import gui.intro.MainMenue_GUI;
-
-import java.awt.Color;
-import java.awt.FlowLayout;
-import java.awt.Font;
-import java.awt.SystemColor;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.KeyAdapter;
-import java.awt.event.KeyEvent;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.swing.JButton;
-import javax.swing.JComboBox;
-import javax.swing.JFrame;
-import javax.swing.JLabel;
-import javax.swing.JMenu;
-import javax.swing.JMenuBar;
-import javax.swing.JMenuItem;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.swing.JRadioButton;
-import javax.swing.JScrollPane;
-import javax.swing.JSeparator;
-import javax.swing.JTabbedPane;
-import javax.swing.JTable;
-import javax.swing.JTextField;
-import javax.swing.JTextPane;
-import javax.swing.RowFilter;
-import javax.swing.UIManager;
-import javax.swing.UnsupportedLookAndFeelException;
-import javax.swing.border.EmptyBorder;
-import javax.swing.border.TitledBorder;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-import javax.swing.table.DefaultTableModel;
-import javax.swing.table.TableModel;
-import javax.swing.table.TableRowSorter;
-
-import models.Image;
-import models.Links;
-import models.person;
-
-import org.apache.thrift.TException;
-
-import server.Server.Client;
-import thrift.ThriftConnection;
-import util.GuiOrganizer;
-import util.OpenLinks;
-
-@SuppressWarnings("serial")
-public class SearchImage_GUI extends JFrame {
-
- private final JPanel contentPanel = new JPanel();
- String[] result;
- JRadioButton rdbtnInternetJa;
- JRadioButton rdbtnInternetNein;
- JComboBox<String> comboBox;
- JTable tableAllImages;
- JTable tablemyImages;
- private JTextField textFieldName;
- JTabbedPane tabbedPane;
- String[] titles = { "Image-Name", "Lizenzpflichtig", "OS", "Veranstaltung",
- "Verantwortlicher", "Letztes Update", "Schlagwort", "ID", "Version" };
- ThriftConnection con = new ThriftConnection();
- Client client = models.Client.clientcon.getClient();
- final DefaultTableModel modelAll = new DefaultTableModel(titles, 0){
- public boolean isCellEditable(int rowIndex, int mColIndex) {
- return false;
- }
- };
- final DefaultTableModel modelMyImages = new DefaultTableModel(titles, 0){
- public boolean isCellEditable(int rowIndex, int mColIndex) {
- return false;
- }
- };
- final TableRowSorter<TableModel> rowSorterAll = new TableRowSorter<TableModel>(
- modelAll);
- final TableRowSorter<TableModel> rowSorterMyImages = new TableRowSorter<TableModel>(
- modelMyImages);
-
-
- /**
- * Create the dialog.
- */
- public SearchImage_GUI() {
- addWindowListener(new WindowAdapter() {
- @Override
- public void windowClosing(WindowEvent arg0) {
- // Beendet die Anwendung nach klick auf X
- con.closeThriftConnection();
- System.exit(0);
- }
-
- @Override
- public void windowOpened(WindowEvent arg0) {
- textFieldName.requestFocusInWindow();
- }
- });
- // Verhindert das Vergroessern Des Fensters
- setResizable(false);
-
- try {
- // Setzt das Look & Feel auf System
- UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
- } catch (ClassNotFoundException | InstantiationException
- | IllegalAccessException | UnsupportedLookAndFeelException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- // Setzt den Fenstertitel
- setTitle("bwLehrpool Suite *Prototyp* - Suche VL-Image");
- // Zentriert das Fenster in die Bildmitte
- setBounds(0, 0, 603, 722);
- GuiOrganizer.centerGUI(this);
-
- final DefaultTableModel model = new DefaultTableModel(titles, 0);
-
- getContentPane().setLayout(null);
- {
- JPanel panel = new JPanel();
- panel.setBackground(SystemColor.menu);
- panel.setBounds(10, 11, 577, 57);
- getContentPane().add(panel);
- panel.setLayout(null);
- {
- JLabel lblNewLabel = new JLabel("Suche nach VL-Image");
- lblNewLabel.setBounds(10, 11, 509, 22);
- panel.add(lblNewLabel);
- lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18));
- }
-
- JTextPane txtpnBitteWhlenSie = new JTextPane();
- txtpnBitteWhlenSie.setEditable(false);
- txtpnBitteWhlenSie.setBackground(SystemColor.menu);
- txtpnBitteWhlenSie
- .setText("Hier k\u00F6nnen Sie nach Ihrem gew\u00FCnschten VL-Image suchen und dieses f\u00FCr weitere Schritte ausw\u00E4hlen");
- txtpnBitteWhlenSie.setBounds(10, 36, 509, 32);
- panel.add(txtpnBitteWhlenSie);
- }
- contentPanel.setBounds(10, 85, 577, 531);
- contentPanel.setBackground(SystemColor.menu);
- contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
- getContentPane().add(contentPanel);
- contentPanel.setLayout(null);
-
- JPanel panel_1 = new JPanel();
- panel_1.setBackground(SystemColor.menu);
- panel_1.setBorder(new TitledBorder(null, "Filterfunktionen",
- TitledBorder.LEADING, TitledBorder.TOP, null, null));
- panel_1.setBounds(10, 49, 557, 131);
- contentPanel.add(panel_1);
- panel_1.setLayout(null);
-
- JLabel lblNewLabel_2 = new JLabel("Anzeigename:");
- lblNewLabel_2.setBounds(10, 30, 250, 20);
- panel_1.add(lblNewLabel_2);
-
- JLabel lblInternetIstInnerhalb = new JLabel("Betriebssystem:");
- lblInternetIstInnerhalb.setBounds(10, 58, 250, 20);
- panel_1.add(lblInternetIstInnerhalb);
-
- textFieldName = new JTextField();
- // Key Listener der Tastatureingabe registriert
- textFieldName.addKeyListener(new KeyAdapter() {
- @Override
- public void keyReleased(KeyEvent e) {
- // Textfield eingabe auslesen
- String stext = textFieldName.getText();
-
- // Wenn Textfield nicht leer
- if (stext != "") {
- // Filtere nach der Eingabe
- rowSorterAll.setRowFilter(RowFilter.regexFilter(
- textFieldName.getText(), 0));
- rowSorterMyImages.setRowFilter(RowFilter.regexFilter(
- textFieldName.getText(), 0));
-
- }
- }
- });
-
- textFieldName.setBounds(270, 30, 250, 20);
- panel_1.add(textFieldName);
- textFieldName.setColumns(10);
-
- JLabel lblErweiterteSuche = new JLabel(
- "<html><u>Erweiterte Suche *Folgt noch*</u></html>");
- lblErweiterteSuche.addMouseListener(new MouseAdapter() {
- @Override
- public void mouseClicked(MouseEvent arg0) {
- // oeffnet das Fenster Extended GUI
-
- ExtendedSearchForImages_GUI es = new ExtendedSearchForImages_GUI();
- es.setVisible(true);
- }
- });
- lblErweiterteSuche.setForeground(Color.BLUE);
-
- lblErweiterteSuche.setBounds(360, 106, 160, 14);
- panel_1.add(lblErweiterteSuche);
-
- comboBox = new JComboBox<String>();
- try {
- // Holt sich eine Liste aller verfuegbaren Betriebssysteme vom Server
- List<String> list = client.getAllOS();
- // Leeres Item hinzufuegen
- comboBox.addItem("");
- for (int i = 0; i < list.size(); i++) {
- // Hinzufuegen der verfuegbaren Betriebssysteme
- comboBox.addItem(list.get(i));
- }
- } catch (TException e2) {
- // TODO Auto-generated catch block
- e2.printStackTrace();
- JOptionPane.showMessageDialog(null,
- e2.getCause()+"\n"+e2.getMessage(),
- "Debug-Message", JOptionPane.ERROR_MESSAGE);
- }
- // Registriert Auswahlaenderungen der Box
- comboBox.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent arg0) {
- // Prueft das die Auswahl nicht leer ist
- if (comboBox.getSelectedItem().toString() != "") {
- // Filtert nach dem ausgewaehlten Betriebssystem
- rowSorterAll.setRowFilter(RowFilter.regexFilter(comboBox
- .getSelectedItem().toString(), 2));
- rowSorterMyImages.setRowFilter(RowFilter.regexFilter(
- comboBox.getSelectedItem().toString(), 2));
- }
- }
-
- });
- comboBox.setBounds(270, 58, 250, 20);
- panel_1.add(comboBox);
-
- JLabel lblHauptmen = new JLabel("Hauptmen\u00FC");
- lblHauptmen.addMouseListener(new MouseAdapter() {
- @Override
- public void mouseClicked(MouseEvent arg0) {
- // oeffnet das Hauuetmenue
-
- SearchImage_GUI.this.setVisible(false);
- MainMenue_GUI main = new MainMenue_GUI();
- main.setVisible(true);
- }
- });
- lblHauptmen.setForeground(Color.BLUE);
- lblHauptmen.setBounds(10, 11, 61, 14);
- contentPanel.add(lblHauptmen);
-
- JLabel label_1 = new JLabel(">");
- label_1.setBounds(69, 11, 13, 14);
- contentPanel.add(label_1);
-
- JLabel lblVlimage = new JLabel("VL-Image");
- lblVlimage.setForeground(Color.BLUE);
- lblVlimage.setBounds(81, 11, 45, 14);
- contentPanel.add(lblVlimage);
-
- JLabel label_2 = new JLabel(">");
- label_2.setBounds(133, 11, 13, 14);
- contentPanel.add(label_2);
-
- JLabel lblNewLabel_1 = new JLabel("Imageauswahl");
- lblNewLabel_1.setBounds(146, 11, 85, 14);
- contentPanel.add(lblNewLabel_1);
-
- tabbedPane = new JTabbedPane(JTabbedPane.TOP);
- tabbedPane.addChangeListener(new ChangeListener() {
- public void stateChanged(ChangeEvent arg0) {
- if (tabbedPane.getSelectedIndex() == 0) {
-
- String username = person.verantwortlicher.getName() + " "
- + person.verantwortlicher.getVorname();
- // String username="Spitzer Tobias";
- rowSorterMyImages.setRowFilter(RowFilter.regexFilter(
- username, 4));
- } else if (tabbedPane.getSelectedIndex() == 1) {
-
- }
-
- }
- });
-
- tabbedPane.setBounds(10, 197, 557, 300);
- contentPanel.add(tabbedPane);
- initTableModel(modelMyImages);
-
- JScrollPane scrollPaneAllImages = new JScrollPane();
- tableAllImages = new JTable();
- tableAllImages.setModel(modelAll);
- tableAllImages.getColumnModel().getColumn(1).sizeWidthToFit();
- tableAllImages.getColumnModel().getColumn(2).sizeWidthToFit();
- tableAllImages.getColumnModel().getColumn(3).sizeWidthToFit();
- tableAllImages.getColumnModel().getColumn(4).sizeWidthToFit();
- tableAllImages.getColumnModel().getColumn(5).sizeWidthToFit();
- initTableModel(modelAll);
-
- JScrollPane scrollPaneMyImage = new JScrollPane();
- tablemyImages = new JTable();
- tablemyImages.setModel(modelMyImages);
- tablemyImages.getColumnModel().getColumn(1).sizeWidthToFit();
- tablemyImages.getColumnModel().getColumn(2).sizeWidthToFit();
- tablemyImages.getColumnModel().getColumn(3).sizeWidthToFit();
- tablemyImages.getColumnModel().getColumn(4).sizeWidthToFit();
- tablemyImages.getColumnModel().getColumn(5).sizeWidthToFit();
- tablemyImages.setRowSorter(rowSorterMyImages);
-
- scrollPaneMyImage.setViewportView(tablemyImages);
- tabbedPane.addTab("Meine Images", null, scrollPaneMyImage, null);
- tableAllImages.setRowSorter(rowSorterAll);
-
- scrollPaneAllImages.setViewportView(tableAllImages);
- tabbedPane.addTab("Alle", null, scrollPaneAllImages, null);
-
- JScrollPane scrollPaneCoopImages = new JScrollPane();
- JTable tableCoopImages = new JTable();
- tableCoopImages.setModel(model);
- tableCoopImages.getColumnModel().getColumn(1).sizeWidthToFit();
- tableCoopImages.getColumnModel().getColumn(2).sizeWidthToFit();
- tableCoopImages.getColumnModel().getColumn(3).sizeWidthToFit();
- tableCoopImages.getColumnModel().getColumn(4).sizeWidthToFit();
- tableCoopImages.getColumnModel().getColumn(5).sizeWidthToFit();
-
- scrollPaneCoopImages.setViewportView(tableCoopImages);
- tabbedPane.addTab("Kooperative Images", null, scrollPaneCoopImages,
- null);
- tabbedPane.setEnabledAt(2, false);
-
- JScrollPane scrollPanePublicImages = new JScrollPane();
- JTable tablePublicImages = new JTable();
- tablePublicImages.setModel(model);
- tablePublicImages.getColumnModel().getColumn(1).sizeWidthToFit();
- tablePublicImages.getColumnModel().getColumn(2).sizeWidthToFit();
- tablePublicImages.getColumnModel().getColumn(3).sizeWidthToFit();
- tablePublicImages.getColumnModel().getColumn(4).sizeWidthToFit();
- tablePublicImages.getColumnModel().getColumn(5).sizeWidthToFit();
-
- scrollPanePublicImages.setViewportView(tablePublicImages);
- tabbedPane.addTab("\u00D6ffentliche Images", null,
- scrollPanePublicImages, null);
- tabbedPane.setEnabledAt(3, false);
-
- JScrollPane scrollPanePublicVorlagen = new JScrollPane();
- JTable tablePublicVorlagen = new JTable();
- tablePublicVorlagen.setModel(model);
- tablePublicVorlagen.getColumnModel().getColumn(1).sizeWidthToFit();
- tablePublicVorlagen.getColumnModel().getColumn(2).sizeWidthToFit();
- tablePublicVorlagen.getColumnModel().getColumn(3).sizeWidthToFit();
- tablePublicVorlagen.getColumnModel().getColumn(4).sizeWidthToFit();
- tablePublicVorlagen.getColumnModel().getColumn(5).sizeWidthToFit();
-
- scrollPanePublicVorlagen.setViewportView(tablePublicVorlagen);
- tabbedPane.addTab("\u00D6ffentliche Vorlagen", null,
- scrollPanePublicVorlagen, null);
- tabbedPane.setEnabledAt(4, false);
-
- JButton btnDownload = new JButton("Download");
- btnDownload.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent arg0) {
- // oeffnet den Downloader
-
- if (tablemyImages.getSelectedRow() != -1) {
- String imageid = modelMyImages.getValueAt(
- tablemyImages.convertRowIndexToModel(tablemyImages
- .getSelectedRow()), 7).toString();
-
- Image.image.setImageId(imageid);
- String imageversion = modelMyImages.getValueAt(
- tablemyImages.convertRowIndexToModel(tablemyImages
- .getSelectedRow()), 8).toString();
-
- Image.image.setVersion(imageversion);
- SearchImage_GUI.this.setVisible(false);
- FTPDownloader_GUI down = new FTPDownloader_GUI();
- down.setVisible(true);
-
-
- } else {
- JOptionPane.showMessageDialog(null,
- "Bitte w\u00e4hlen Sie ein Image f\u00fcr den Download aus",
- "Message", JOptionPane.INFORMATION_MESSAGE);
- }
- }
- });
- btnDownload.setBounds(449, 508, 118, 23);
- contentPanel.add(btnDownload);
- {
- JPanel buttonPane = new JPanel();
- buttonPane.setBounds(0, 640, 597, 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) {
- // oeffnet das Hauptmenue
-
- MainMenue_GUI main = new MainMenue_GUI();
- main.setVisible(true);
- dispose();
- }
- });
- okButton.setActionCommand("OK");
- buttonPane.add(okButton);
- getRootPane().setDefaultButton(okButton);
- }
- }
-
- JSeparator separator = new JSeparator();
- separator.setBounds(0, 78, 597, 2);
- getContentPane().add(separator);
-
- JSeparator separator_1 = new JSeparator();
- separator_1.setBounds(0, 627, 597, 2);
- getContentPane().add(separator_1);
-
- JMenuBar menuBar = new JMenuBar();
- setJMenuBar(menuBar);
-
- JMenu mnNewMenu_1 = new JMenu("Hilfe");
- menuBar.add(mnNewMenu_1);
-
- JMenuItem mntmFaq = new JMenuItem("FAQ");
- mntmFaq.addMouseListener(new MouseAdapter() {
- @Override
- public void mousePressed(MouseEvent arg0) {
-
- OpenLinks open = new OpenLinks();
-
- URI windows;
- try {
- windows = new URI(Links.getFAQ());
-
- open.openWebpage(windows);
-
- } catch (URISyntaxException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- });
- mnNewMenu_1.add(mntmFaq);
-
-
- JMenuItem mntmOtrs = new JMenuItem("OTRS");
- mntmOtrs.addMouseListener(new MouseAdapter() {
- @Override
- public void mousePressed(MouseEvent arg0) {
-
- OpenLinks open = new OpenLinks();
-
- URI windows;
- try {
- windows = new URI(Links.getOTRS());
-
- open.openWebpage(windows);
-
- } catch (URISyntaxException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
- }
- });
- mnNewMenu_1.add(mntmOtrs);
-
- JMenuItem mntmAbout = new JMenuItem("About");
- mntmAbout.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- About_GUI ab = new About_GUI();
- ab.setVisible(true);
- }
- });
- mnNewMenu_1.add(mntmAbout);
-
- }
-
- // Initiale Beffuelung eines Table models
- public DefaultTableModel initTableModel(DefaultTableModel model) {
- List<server.Image> images;
- try {
- // Hole eine Liste der Images
- images = client.getImageList();
-
- Iterator<server.Image> i = images.iterator();
-
- int x = 0;
-
- while (i.hasNext()) {
- // erzeuge Objekte fuer die Tabelle
- Object[] obj = { images.get(x).getImageName(),
- images.get(x).getLicenseRestriction(),
- images.get(x).getOsName(),
- images.get(x).getLectureName(),
- images.get(x).getUserData(),
- images.get(x).getUpdateTime(), "", images.get(x).id,
- images.get(x).getVersion() };
- // Fuege diese Objekte der Tabelle hinzu
- model.addRow(obj);
- x++;
- i.next();
-
- }
-
- return model;
- } catch (TException e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
- JOptionPane.showMessageDialog(null,
- e1.getCause()+"\n"+e1.getMessage(),
- "Debug-Message", JOptionPane.ERROR_MESSAGE);
- }
- return model;
- }
-
-}
+package gui.image;
+
+import gui.intro.About_GUI;
+import gui.intro.MainMenue_GUI;
+
+import java.awt.Color;
+import java.awt.FlowLayout;
+import java.awt.Font;
+import java.awt.SystemColor;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.KeyAdapter;
+import java.awt.event.KeyEvent;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.swing.JButton;
+import javax.swing.JComboBox;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+import javax.swing.JScrollPane;
+import javax.swing.JSeparator;
+import javax.swing.JTabbedPane;
+import javax.swing.JTable;
+import javax.swing.JTextArea;
+import javax.swing.JTextField;
+import javax.swing.JTextPane;
+import javax.swing.RowFilter;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+import javax.swing.border.EmptyBorder;
+import javax.swing.border.TitledBorder;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
+import javax.swing.event.TableModelEvent;
+import javax.swing.event.TableModelListener;
+import javax.swing.table.DefaultTableModel;
+import javax.swing.table.TableModel;
+import javax.swing.table.TableRowSorter;
+
+import models.Image;
+import models.Links;
+import models.person;
+
+import org.apache.thrift.TException;
+
+import server.Server.Client;
+import thrift.ThriftConnection;
+import util.GuiOrganizer;
+import util.OpenLinks;
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeEvent;
+
+@SuppressWarnings("serial")
+public class SearchImage_GUI extends JFrame {
+
+ private final JPanel contentPanel = new JPanel();
+ JLabel labelName;
+ JLabel labelUpdate;
+ JLabel labelVerantwortlicher;
+ JLabel labelWeitereVerantwortliche;
+ JLabel labelVorlage;
+ JLabel labelLizenzSoftware;
+ JLabel labelInternet;
+ JLabel labelRam;
+ JLabel labelCPU;
+ JLabel labelID;
+ JLabel labelVersion;
+ JTextArea textAreadesc;
+ private JLabel labelOS;
+ String[] result;
+ JRadioButton rdbtnInternetJa;
+ JRadioButton rdbtnInternetNein;
+ JComboBox<String> comboBox;
+ JTable tableAllImages;
+ JTable tablemyImages;
+ JTable tablePublicVorlagen;
+ private JTextField textFieldName;
+ JTabbedPane tabbedPane;
+ boolean activeSearch = false;
+ String[] titles = { "Name", "Lizenzpflichtig", "OS", "Veranstaltung",
+ "Verantwortlicher", "Letztes Update", "ID", "Version", "Template" }; // Angezeigt
+ // werden
+ // aber
+ // nur
+ // Name
+ // (0),
+ // OS
+ // (2),
+ // Verantwortlicher
+ // (4),
+ // Letztes
+ // Update
+ // (5)
+ ThriftConnection con = new ThriftConnection();
+ Client client = models.Client.clientcon.getClient();
+ final DefaultTableModel modelAll = new DefaultTableModel(titles, 0) {
+ public boolean isCellEditable(int rowIndex, int mColIndex) {
+ return false;
+ }
+ };
+ final DefaultTableModel modelMyImages = new DefaultTableModel(titles, 0) {
+ public boolean isCellEditable(int rowIndex, int mColIndex) {
+ return false;
+ }
+ };
+ final DefaultTableModel modelPublicVorlagen = new DefaultTableModel(titles,
+ 0) {
+ public boolean isCellEditable(int rowIndex, int mColIndex) {
+ return false;
+ }
+ };
+ final TableRowSorter<TableModel> rowSorterAll = new TableRowSorter<TableModel>(
+ modelAll);
+ final TableRowSorter<TableModel> rowSorterMyImages = new TableRowSorter<TableModel>(
+ modelMyImages);
+ final TableRowSorter<TableModel> rowSorterPublicVorlagen = new TableRowSorter<TableModel>(
+ modelPublicVorlagen);
+ private JTextField textField;
+
+ /**
+ * Create the dialog.
+ */
+ public SearchImage_GUI() {
+ addWindowListener(new WindowAdapter() {
+ @Override
+ public void windowClosing(WindowEvent arg0) {
+ // Beendet die Anwendung nach klick auf X
+ con.closeThriftConnection();
+ System.exit(0);
+ }
+
+ @Override
+ public void windowOpened(WindowEvent arg0) {
+ initTableModel(modelAll);
+ initTableModel(modelMyImages);
+ initTableModel(modelPublicVorlagen);
+
+ // auszublendende Angaben
+ // 1=Lizenzpflichtig
+ // 3=Veranstaltung
+ // 6=ID
+ // 7=Version
+ // 8=Template
+ tablemyImages.getColumnModel().getColumn(1).setWidth(0);
+ tablemyImages.getColumnModel().getColumn(1).setMinWidth(0);
+ tablemyImages.getColumnModel().getColumn(1).setMaxWidth(0);
+ tablemyImages.getColumnModel().getColumn(3).setWidth(0);
+ tablemyImages.getColumnModel().getColumn(3).setMinWidth(0);
+ tablemyImages.getColumnModel().getColumn(3).setMaxWidth(0);
+ tablemyImages.getColumnModel().getColumn(8).setWidth(0);
+ tablemyImages.getColumnModel().getColumn(8).setMinWidth(0);
+ tablemyImages.getColumnModel().getColumn(8).setMaxWidth(0);
+ tablemyImages.getColumnModel().getColumn(6).setWidth(0);
+ tablemyImages.getColumnModel().getColumn(6).setMinWidth(0);
+ tablemyImages.getColumnModel().getColumn(6).setMaxWidth(0);
+ tablemyImages.getColumnModel().getColumn(7).setWidth(0);
+ tablemyImages.getColumnModel().getColumn(7).setMinWidth(0);
+ tablemyImages.getColumnModel().getColumn(7).setMaxWidth(0);
+
+ tablePublicVorlagen.getColumnModel().getColumn(1).setWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(1)
+ .setMinWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(1)
+ .setMaxWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(3).setWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(3)
+ .setMinWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(3)
+ .setMaxWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(8).setWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(8)
+ .setMinWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(8)
+ .setMaxWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(6).setWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(6)
+ .setMinWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(6)
+ .setMaxWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(7).setWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(7)
+ .setMinWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(7)
+ .setMaxWidth(0);
+
+ tableAllImages.getColumnModel().getColumn(1).setWidth(0);
+ tableAllImages.getColumnModel().getColumn(1).setMinWidth(0);
+ tableAllImages.getColumnModel().getColumn(1).setMaxWidth(0);
+ tableAllImages.getColumnModel().getColumn(3).setWidth(0);
+ tableAllImages.getColumnModel().getColumn(3).setMinWidth(0);
+ tableAllImages.getColumnModel().getColumn(3).setMaxWidth(0);
+ tableAllImages.getColumnModel().getColumn(8).setWidth(0);
+ tableAllImages.getColumnModel().getColumn(8).setMinWidth(0);
+ tableAllImages.getColumnModel().getColumn(8).setMaxWidth(0);
+ tableAllImages.getColumnModel().getColumn(6).setWidth(0);
+ tableAllImages.getColumnModel().getColumn(6).setMinWidth(0);
+ tableAllImages.getColumnModel().getColumn(6).setMaxWidth(0);
+ tableAllImages.getColumnModel().getColumn(7).setWidth(0);
+ tableAllImages.getColumnModel().getColumn(7).setMinWidth(0);
+ tableAllImages.getColumnModel().getColumn(7).setMaxWidth(0);
+ textFieldName.requestFocusInWindow();
+ }
+ });
+ // Verhindert das Vergroessern Des Fensters
+ setResizable(false);
+
+ try {
+ // Setzt das Look & Feel auf System
+ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+ } catch (ClassNotFoundException | InstantiationException
+ | IllegalAccessException | UnsupportedLookAndFeelException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ // Setzt den Fenstertitel
+ setTitle("bwLehrpool Suite - Image suchen");
+ // Zentriert das Fenster in die Bildmitte
+ setBounds(0, 0, 918, 722);
+ GuiOrganizer.centerGUI(this);
+
+ final DefaultTableModel model = new DefaultTableModel(titles, 0);
+
+ getContentPane().setLayout(null);
+ {
+ JPanel panel = new JPanel();
+ panel.setBackground(SystemColor.menu);
+ panel.setBounds(10, 11, 892, 57);
+ getContentPane().add(panel);
+ panel.setLayout(null);
+ {
+ JLabel lblNewLabel = new JLabel("Imagesuche");
+ lblNewLabel.setBounds(10, 11, 509, 22);
+ panel.add(lblNewLabel);
+ lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18));
+ }
+
+ JTextPane txtpnBitteWhlenSie = new JTextPane();
+ txtpnBitteWhlenSie.setEditable(false);
+ txtpnBitteWhlenSie.setBackground(SystemColor.menu);
+ txtpnBitteWhlenSie
+ .setText("Hier k\u00F6nnen Sie nach Ihrem gew\u00FCnschten Image suchen und dieses f\u00FCr weitere Schritte ausw\u00E4hlen");
+ txtpnBitteWhlenSie.setBounds(10, 36, 509, 32);
+ panel.add(txtpnBitteWhlenSie);
+ }
+ contentPanel.setBounds(10, 85, 577, 531);
+ contentPanel.setBackground(SystemColor.menu);
+ contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
+ getContentPane().add(contentPanel);
+ contentPanel.setLayout(null);
+
+ JPanel panel_1 = new JPanel();
+ panel_1.setBackground(SystemColor.menu);
+ panel_1.setBorder(new TitledBorder(null, "Filterfunktionen",
+ TitledBorder.LEADING, TitledBorder.TOP, null, null));
+ panel_1.setBounds(10, 49, 557, 98);
+ contentPanel.add(panel_1);
+ panel_1.setLayout(null);
+
+ JLabel lblNewLabel_2 = new JLabel("Anzeigename:");
+ lblNewLabel_2.setBounds(10, 30, 80, 20);
+ panel_1.add(lblNewLabel_2);
+
+ JLabel lblInternetIstInnerhalb = new JLabel("Betriebssystem:");
+ lblInternetIstInnerhalb.setBounds(10, 58, 80, 20);
+ panel_1.add(lblInternetIstInnerhalb);
+
+ textFieldName = new JTextField();
+ // Key Listener der Tastatureingabe registriert
+ textFieldName.addKeyListener(new KeyAdapter() {
+ @Override
+ public void keyReleased(KeyEvent e) {
+ // Textfield eingabe auslesen
+ String stext = textFieldName.getText();
+
+ // Wenn Textfield nicht leer
+ if (stext != "") {
+ activeSearch = true;
+ // Filtere nach der Eingabe
+ rowSorterAll.setRowFilter(RowFilter.regexFilter(
+ textFieldName.getText(), 0));
+ rowSorterMyImages.setRowFilter(RowFilter.regexFilter(
+ textFieldName.getText(), 0));
+ rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter(
+ textFieldName.getText(), 0));
+
+ } else {
+ activeSearch = false;
+ String username = person.verantwortlicher.getName() + " "
+ + person.verantwortlicher.getVorname();
+ rowSorterMyImages.setRowFilter(RowFilter.regexFilter(
+ username, 4));
+ rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter(
+ "true", 8));
+ rowSorterAll.setRowFilter(null);
+ }
+ }
+ });
+
+ textFieldName.setBounds(96, 30, 166, 20);
+ panel_1.add(textFieldName);
+ textFieldName.setColumns(10);
+
+ comboBox = new JComboBox<String>();
+ try {
+ // Holt sich eine Liste aller verfuegbaren Betriebssysteme vom
+ // Server
+ List<String> list = client.getAllOS();
+ // Leeres Item hinzufuegen
+ comboBox.addItem("");
+ for (int i = 0; i < list.size(); i++) {
+ // Hinzufuegen der verfuegbaren Betriebssysteme
+ comboBox.addItem(list.get(i));
+ }
+ } catch (TException e2) {
+ // TODO Auto-generated catch block
+ e2.printStackTrace();
+ JOptionPane.showMessageDialog(null,
+ e2.getCause() + "\n" + e2.getStackTrace(), "Debug-Message",
+ JOptionPane.ERROR_MESSAGE);
+ }
+ // Registriert Auswahlaenderungen der Box
+ comboBox.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent arg0) {
+ // Prueft das die Auswahl nicht leer ist
+ if (comboBox.getSelectedItem().toString() != "") {
+ activeSearch = true;
+ rowSorterAll.setRowFilter(RowFilter.regexFilter(comboBox
+ .getSelectedItem().toString(), 2));
+ rowSorterMyImages.setRowFilter(RowFilter.regexFilter(
+ comboBox.getSelectedItem().toString(), 2));
+ rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter(
+ comboBox.getSelectedItem().toString(), 2));
+ } else {
+ activeSearch = false;
+ String username = person.verantwortlicher.getName() + " "
+ + person.verantwortlicher.getVorname();
+ rowSorterMyImages.setRowFilter(RowFilter.regexFilter(
+ username, 4));
+ rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter(
+ "true", 8));
+ rowSorterAll.setRowFilter(null);
+ }
+ }
+
+ });
+ comboBox.setBounds(96, 58, 166, 20);
+ panel_1.add(comboBox);
+
+ JLabel label_3 = new JLabel("Beschreibung:");
+ label_3.setBounds(291, 30, 80, 20);
+ panel_1.add(label_3);
+
+ textField = new JTextField();
+ textField.setColumns(10);
+ textField.setBounds(381, 30, 166, 20);
+ panel_1.add(textField);
+
+ JLabel lblHauptmen = new JLabel("Hauptmen\u00FC");
+ lblHauptmen.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseClicked(MouseEvent arg0) {
+ // oeffnet das Hauuetmenue
+
+ SearchImage_GUI.this.setVisible(false);
+ MainMenue_GUI main = new MainMenue_GUI();
+ main.setVisible(true);
+ }
+ });
+ lblHauptmen.setForeground(Color.BLUE);
+ lblHauptmen.setBounds(10, 11, 61, 14);
+ contentPanel.add(lblHauptmen);
+
+ JLabel label_1 = new JLabel(">");
+ label_1.setBounds(69, 11, 13, 14);
+ contentPanel.add(label_1);
+
+ JLabel lblVlimage = new JLabel("Image");
+ lblVlimage.setForeground(Color.BLUE);
+ lblVlimage.setBounds(81, 11, 45, 14);
+ contentPanel.add(lblVlimage);
+
+ JLabel label_2 = new JLabel(">");
+ label_2.setBounds(116, 11, 13, 14);
+ contentPanel.add(label_2);
+
+ JLabel lblNewLabel_1 = new JLabel("Imageauswahl");
+ lblNewLabel_1.setBounds(129, 11, 85, 14);
+ contentPanel.add(lblNewLabel_1);
+
+ tabbedPane = new JTabbedPane(JTabbedPane.TOP);
+ tabbedPane.addChangeListener(new ChangeListener() {
+ public void stateChanged(ChangeEvent arg0) {
+ if (tabbedPane.getSelectedIndex() == 0 && activeSearch == false) {
+
+ String username = person.verantwortlicher.getName() + " "
+ + person.verantwortlicher.getVorname();
+ rowSorterMyImages.setRowFilter(RowFilter.regexFilter(
+ username, 4));
+ } else if (tabbedPane.getSelectedIndex() == 1
+ && activeSearch == false) {
+ rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter(
+ "true", 8));
+ } else if (tabbedPane.getSelectedIndex() == 2
+ && activeSearch == false) {
+ rowSorterAll.setRowFilter(null);
+ }
+
+ }
+ });
+
+ tabbedPane.setBounds(10, 158, 557, 339);
+ contentPanel.add(tabbedPane);
+
+ JScrollPane scrollPaneAllImages = new JScrollPane();
+ tableAllImages = new JTable();
+ tableAllImages.getSelectionModel().addListSelectionListener(
+ new ListSelectionListener() {
+ public void valueChanged(ListSelectionEvent e) {
+
+ String imageid = modelAll.getValueAt(
+ tableAllImages
+ .convertRowIndexToModel(tableAllImages
+ .getSelectedRow()), 6)
+ .toString();
+ //System.out.println(imageid);
+ String version = modelAll.getValueAt(
+ tableAllImages
+ .convertRowIndexToModel(tableAllImages
+ .getSelectedRow()), 7)
+ .toString();
+ //System.out.println(version);
+ writeImageData(imageid, version);
+
+ }
+ });
+ tableAllImages.setModel(modelAll);
+ tableAllImages.getColumnModel().getColumn(1).sizeWidthToFit();
+ tableAllImages.getColumnModel().getColumn(2).sizeWidthToFit();
+ tableAllImages.getColumnModel().getColumn(3).sizeWidthToFit();
+ tableAllImages.getColumnModel().getColumn(4).sizeWidthToFit();
+ tableAllImages.getColumnModel().getColumn(5).sizeWidthToFit();
+
+ JScrollPane scrollPaneMyImage = new JScrollPane();
+ tablemyImages = new JTable();
+ tablemyImages.getSelectionModel().addListSelectionListener(
+ new ListSelectionListener() {
+ public void valueChanged(ListSelectionEvent e) {
+ String imageid = modelMyImages.getValueAt(
+ tablemyImages
+ .convertRowIndexToModel(tablemyImages
+ .getSelectedRow()), 6)
+ .toString();
+ //System.out.println(imageid);
+ String version = modelMyImages.getValueAt(
+ tablemyImages
+ .convertRowIndexToModel(tablemyImages
+ .getSelectedRow()), 7)
+ .toString();
+ //System.out.println(version);
+ writeImageData(imageid, version);
+ }
+ });
+ tablemyImages.setModel(modelMyImages);
+ tablemyImages.getColumnModel().getColumn(1).sizeWidthToFit();
+ tablemyImages.getColumnModel().getColumn(2).sizeWidthToFit();
+ tablemyImages.getColumnModel().getColumn(3).sizeWidthToFit();
+ tablemyImages.getColumnModel().getColumn(4).sizeWidthToFit();
+ tablemyImages.getColumnModel().getColumn(5).sizeWidthToFit();
+ tablemyImages.setRowSorter(rowSorterMyImages);
+
+ scrollPaneMyImage.setViewportView(tablemyImages);
+ tabbedPane.addTab("Meine Images", null, scrollPaneMyImage, null);
+
+ JScrollPane scrollPanePublicVorlagen = new JScrollPane();
+ tablePublicVorlagen = new JTable();
+ tablePublicVorlagen.getSelectionModel().addListSelectionListener(
+ new ListSelectionListener() {
+ public void valueChanged(ListSelectionEvent e) {
+ String imageid = modelPublicVorlagen
+ .getValueAt(
+ tablePublicVorlagen
+ .convertRowIndexToModel(tablePublicVorlagen
+ .getSelectedRow()), 6)
+ .toString();
+ //System.out.println(imageid);
+ String version = modelPublicVorlagen
+ .getValueAt(
+ tablePublicVorlagen
+ .convertRowIndexToModel(tablePublicVorlagen
+ .getSelectedRow()), 7)
+ .toString();
+ //System.out.println(version);
+ writeImageData(imageid, version);
+ }
+ });
+ tablePublicVorlagen.setModel(modelPublicVorlagen);
+ tablePublicVorlagen.getColumnModel().getColumn(1).sizeWidthToFit();
+ tablePublicVorlagen.getColumnModel().getColumn(2).sizeWidthToFit();
+ tablePublicVorlagen.getColumnModel().getColumn(3).sizeWidthToFit();
+ tablePublicVorlagen.getColumnModel().getColumn(4).sizeWidthToFit();
+ tablePublicVorlagen.getColumnModel().getColumn(5).sizeWidthToFit();
+ tablePublicVorlagen.setRowSorter(rowSorterPublicVorlagen);
+ scrollPanePublicVorlagen.setViewportView(tablePublicVorlagen);
+ tabbedPane.addTab("Vorlagen", null, scrollPanePublicVorlagen, null);
+ tableAllImages.setRowSorter(rowSorterAll);
+
+ scrollPaneAllImages.setViewportView(tableAllImages);
+ tabbedPane.addTab("Alle", null, scrollPaneAllImages, null);
+
+ JScrollPane scrollPaneCoopImages = new JScrollPane();
+ JTable tableCoopImages = new JTable();
+ tableCoopImages.setModel(model);
+ tableCoopImages.getColumnModel().getColumn(1).sizeWidthToFit();
+ tableCoopImages.getColumnModel().getColumn(2).sizeWidthToFit();
+ tableCoopImages.getColumnModel().getColumn(3).sizeWidthToFit();
+ tableCoopImages.getColumnModel().getColumn(4).sizeWidthToFit();
+ tableCoopImages.getColumnModel().getColumn(5).sizeWidthToFit();
+
+ scrollPaneCoopImages.setViewportView(tableCoopImages);
+ tabbedPane.addTab("bwLehrpool", null, scrollPaneCoopImages, null);
+ tabbedPane.setEnabledAt(3, false);
+
+ JButton btnDownload = new JButton("Download");
+ btnDownload.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent arg0) {
+ // oeffnet den Downloader
+ String username = person.verantwortlicher.getName() + " "
+ + person.verantwortlicher.getVorname();
+ //
+ // meine Images
+ //
+ if (tabbedPane.getSelectedIndex() == 0) {
+ if (tablemyImages.getSelectedRow() != -1) {
+ String imageid = modelMyImages.getValueAt(
+ tablemyImages
+ .convertRowIndexToModel(tablemyImages
+ .getSelectedRow()), 6)
+ .toString();
+
+ Image.image.setImageId(imageid);
+ String imageversion = modelMyImages.getValueAt(
+ tablemyImages
+ .convertRowIndexToModel(tablemyImages
+ .getSelectedRow()), 7)
+ .toString();
+
+ Image.image.setVersion(imageversion);
+ SearchImage_GUI.this.setVisible(false);
+ FTPSearchDownloader_GUI down = new FTPSearchDownloader_GUI();
+ down.setVisible(true);
+
+ }
+ } else if (tabbedPane.getSelectedIndex() == 1) {
+ //
+ // Vorlagen Images
+ //
+
+ if (tablePublicVorlagen.getSelectedRow() != -1
+ // && modelPublicVorlagen
+ // .getValueAt(
+ // tablePublicVorlagen
+ // .convertRowIndexToModel(tablePublicVorlagen
+ // .getSelectedRow()),
+ // 4).equals(username) == true
+ ) {
+ String imageid = modelPublicVorlagen
+ .getValueAt(
+ tablePublicVorlagen
+ .convertRowIndexToModel(tablePublicVorlagen
+ .getSelectedRow()), 6)
+ .toString();
+
+ Image.image.setImageId(imageid);
+ String imageversion = modelPublicVorlagen
+ .getValueAt(
+ tablePublicVorlagen
+ .convertRowIndexToModel(tablePublicVorlagen
+ .getSelectedRow()), 7)
+ .toString();
+
+ Image.image.setVersion(imageversion);
+
+ SearchImage_GUI.this.setVisible(false);
+ FTPSearchDownloader_GUI down = new FTPSearchDownloader_GUI();
+ down.setVisible(true);
+ }
+ } else if (tabbedPane.getSelectedIndex() == 2) {
+ //
+ // Alle Images
+ //
+ /**
+ * if (tableAllImages.getSelectedRow() != -1 && modelAll
+ * .getValueAt( tableAllImages
+ * .convertRowIndexToModel(tableAllImages
+ * .getSelectedRow()), 4).equals(username) == true) {
+ **/
+ if (tableAllImages.getSelectedRow() != -1) {
+ // nur eigene Images downloadbar
+ if (modelAll.getValueAt(
+ tableAllImages
+ .convertRowIndexToModel(tableAllImages
+ .getSelectedRow()), 4).equals(
+ username) == true
+ || modelAll
+ .getValueAt(
+ tableAllImages
+ .convertRowIndexToModel(tableAllImages
+ .getSelectedRow()),
+ 8).equals("true") == true) {
+ String imageid = modelAll
+ .getValueAt(
+ tableAllImages
+ .convertRowIndexToModel(tableAllImages
+ .getSelectedRow()),
+ 6).toString();
+
+ Image.image.setImageId(imageid);
+ String imageversion = modelAll
+ .getValueAt(
+ tableAllImages
+ .convertRowIndexToModel(tableAllImages
+ .getSelectedRow()),
+ 7).toString();
+
+ Image.image.setVersion(imageversion);
+
+ SearchImage_GUI.this.setVisible(false);
+ FTPSearchDownloader_GUI down = new FTPSearchDownloader_GUI();
+ down.setVisible(true);
+ } else {
+ JOptionPane
+ .showMessageDialog(
+ null,
+ "Sie haben keine Berechtigung fremde Images herunterzuladen.",
+ "Message",
+ JOptionPane.INFORMATION_MESSAGE);
+ }
+
+ }
+
+ } else {
+ //
+ // nichts markiert
+ //
+ JOptionPane
+ .showMessageDialog(
+ null,
+ "Bitte w\u00e4hlen Sie ein Image f\u00fcr den Download aus",
+ "Message", JOptionPane.INFORMATION_MESSAGE);
+ }
+ }
+ });
+ btnDownload.setBounds(449, 508, 118, 23);
+ contentPanel.add(btnDownload);
+ {
+ JPanel buttonPane = new JPanel();
+ buttonPane.setBounds(0, 640, 902, 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) {
+ // oeffnet das Hauptmenue
+
+ MainMenue_GUI main = new MainMenue_GUI();
+ main.setVisible(true);
+ dispose();
+ }
+ });
+ okButton.setActionCommand("OK");
+ buttonPane.add(okButton);
+ getRootPane().setDefaultButton(okButton);
+ }
+ }
+
+ JSeparator separator = new JSeparator();
+ separator.setBounds(0, 79, 912, 1);
+ getContentPane().add(separator);
+
+ JSeparator separator_1 = new JSeparator();
+ separator_1.setBounds(0, 627, 912, 2);
+ getContentPane().add(separator_1);
+
+ JPanel panel = new JPanel();
+ panel.setLayout(null);
+ panel.setBorder(new TitledBorder(null, "Detailinformationen",
+
+ TitledBorder.LEADING, TitledBorder.TOP, null, null));
+ panel.setBackground(SystemColor.menu);
+ panel.setBounds(586, 85, 316, 531);
+ getContentPane().add(panel);
+
+ JLabel lblName = new JLabel("Name:");
+ lblName.setBounds(10, 87, 130, 14);
+ panel.add(lblName);
+
+ labelName = new JLabel("");
+ labelName.setBounds(10, 102, 296, 14);
+ panel.add(labelName);
+
+ JLabel lblVerantwortlicher = new JLabel("Verantwortlicher:");
+ lblVerantwortlicher.setBounds(10, 259, 130, 14);
+ panel.add(lblVerantwortlicher);
+
+ labelOS = new JLabel("");
+ labelOS.setBounds(10, 216, 296, 14);
+ panel.add(labelOS);
+
+ JLabel lblWeitereVerantwortliche = new JLabel("Betriebssystem:");
+ lblWeitereVerantwortliche.setBounds(10, 202, 130, 14);
+ panel.add(lblWeitereVerantwortliche);
+
+ labelVerantwortlicher = new JLabel("");
+ labelVerantwortlicher.setBounds(10, 272, 296, 14);
+ panel.add(labelVerantwortlicher);
+
+ JLabel label = new JLabel("Weitere Ansprechpartner:");
+ label.setBounds(10, 284, 130, 14);
+ panel.add(label);
+
+ labelWeitereVerantwortliche = new JLabel("");
+ labelWeitereVerantwortliche.setBounds(10, 297, 296, 14);
+ panel.add(labelWeitereVerantwortliche);
+
+ labelUpdate = new JLabel("");
+ labelUpdate.setBounds(10, 245, 296, 14);
+ panel.add(labelUpdate);
+
+ JLabel lblLetztesUpdate = new JLabel("Letztes Update:");
+ lblLetztesUpdate.setBounds(10, 231, 130, 14);
+ panel.add(lblLetztesUpdate);
+
+ JLabel lblImageIstVorlage = new JLabel("Image ist Vorlage:");
+ lblImageIstVorlage.setBounds(10, 336, 130, 14);
+ panel.add(lblImageIstVorlage);
+
+ labelVorlage = new JLabel("");
+ labelVorlage.setBounds(10, 350, 296, 14);
+ panel.add(labelVorlage);
+
+ labelLizenzSoftware = new JLabel("");
+ labelLizenzSoftware.setBounds(10, 383, 296, 14);
+ panel.add(labelLizenzSoftware);
+
+ JLabel lblLizenzpflichtigeSoftware = new JLabel(
+ "Lizenzpflichtige Software:");
+ lblLizenzpflichtigeSoftware.setBounds(10, 367, 130, 14);
+ panel.add(lblLizenzpflichtigeSoftware);
+
+ JLabel lblInternet = new JLabel("Internetsperre vorhanden:");
+ lblInternet.setBounds(10, 400, 130, 14);
+ panel.add(lblInternet);
+
+ labelInternet = new JLabel("");
+ labelInternet.setBounds(10, 417, 296, 14);
+ panel.add(labelInternet);
+
+ JLabel lblEmpfehlungRam = new JLabel("Empfehlung RAM:");
+ lblEmpfehlungRam.setBounds(10, 432, 130, 14);
+ panel.add(lblEmpfehlungRam);
+
+ labelRam = new JLabel("");
+ labelRam.setBounds(10, 455, 296, 14);
+ panel.add(labelRam);
+
+ JLabel lblEmpfehlungCpu = new JLabel("Empfehlung CPU:");
+ lblEmpfehlungCpu.setBounds(10, 469, 130, 14);
+ panel.add(lblEmpfehlungCpu);
+
+ labelCPU = new JLabel("");
+ labelCPU.setBounds(10, 487, 296, 14);
+ panel.add(labelCPU);
+
+ JLabel lblTechnischeDaten = new JLabel("Technische Daten:");
+ lblTechnischeDaten.setBounds(10, 322, 296, 14);
+ panel.add(lblTechnischeDaten);
+
+ JLabel lblId = new JLabel("ID:");
+ lblId.setBounds(10, 23, 296, 14);
+ panel.add(lblId);
+
+ labelID = new JLabel("");
+ labelID.setBounds(10, 37, 296, 14);
+ panel.add(labelID);
+
+ labelVersion = new JLabel("");
+ labelVersion.setBounds(10, 73, 296, 14);
+ panel.add(labelVersion);
+
+ JLabel lblVersion = new JLabel("Version:");
+ lblVersion.setBounds(10, 57, 296, 14);
+ panel.add(lblVersion);
+
+ JLabel lblBeschreibung = new JLabel("Beschreibung:");
+ lblBeschreibung.setBounds(10, 119, 130, 14);
+ panel.add(lblBeschreibung);
+
+ JScrollPane scrollPane = new JScrollPane();
+ scrollPane.setBounds(10, 135, 296, 65);
+ panel.add(scrollPane);
+
+ textAreadesc = new JTextArea();
+ textAreadesc.setEditable(false);
+ textAreadesc.setFont(new Font("Tahoma", Font.PLAIN, 11));
+ textAreadesc.setLineWrap(true);
+ textAreadesc.setBackground(SystemColor.menu);
+ scrollPane.setViewportView(textAreadesc);
+ JMenuBar menuBar = new JMenuBar();
+ setJMenuBar(menuBar);
+
+ JMenu mnNewMenu_1 = new JMenu("Hilfe");
+ menuBar.add(mnNewMenu_1);
+
+ JMenuItem mntmFaq = new JMenuItem("FAQ");
+ mntmFaq.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mousePressed(MouseEvent arg0) {
+
+ OpenLinks open = new OpenLinks();
+
+ URI windows;
+ try {
+ windows = new URI(Links.getFAQ());
+
+ open.openWebpage(windows);
+
+ } catch (URISyntaxException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ });
+ mnNewMenu_1.add(mntmFaq);
+
+ JMenuItem mntmOtrs = new JMenuItem("OTRS");
+ mntmOtrs.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mousePressed(MouseEvent arg0) {
+
+ OpenLinks open = new OpenLinks();
+
+ URI windows;
+ try {
+ windows = new URI(Links.getOTRS());
+
+ open.openWebpage(windows);
+
+ } catch (URISyntaxException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ }
+ });
+ mnNewMenu_1.add(mntmOtrs);
+
+ JMenuItem mntmAbout = new JMenuItem("About");
+ mntmAbout.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ About_GUI ab = new About_GUI();
+ ab.setVisible(true);
+ }
+ });
+ mnNewMenu_1.add(mntmAbout);
+
+ }
+
+ // Initiale Beffuelung eines Table models
+ public DefaultTableModel initTableModel(DefaultTableModel model) {
+ List<server.Image> images;
+ try {
+ // Hole eine Liste der Images
+ images = client.getImageList();
+
+ Iterator<server.Image> i = images.iterator();
+ SimpleDateFormat in = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ SimpleDateFormat out = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss");
+ int x = 0;
+
+ while (i.hasNext()) {
+ // erzeuge Objekte fuer die Tabelle
+ Object[] obj = { images.get(x).getImageName(),
+ images.get(x).getLicenseRestriction(),
+ images.get(x).getOsName(),
+ images.get(x).getLectureName(),
+ images.get(x).getUserData(),
+ out.format(in.parse(images.get(x).updateTime)),
+ images.get(x).id, images.get(x).getVersion(),
+ images.get(x).getIsTemplate() };
+ // Fuege diese Objekte der Tabelle hinzu
+ model.addRow(obj);
+ x++;
+ i.next();
+
+ }
+
+ return model;
+ } catch (TException | ParseException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ JOptionPane.showMessageDialog(null,
+ e1.getCause() + "\n" + e1.getStackTrace(), "Debug-Message",
+ JOptionPane.ERROR_MESSAGE);
+ }
+ return model;
+ }
+
+ public void writeImageData(String id, String version) {
+ try {
+ SimpleDateFormat in = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ SimpleDateFormat out = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss");
+ Map<String, String> res = client.getImageData(id, version);
+ labelName.setText(res.get("name"));
+ labelOS.setText(res.get("os"));
+ labelUpdate.setText(out.format(in.parse(res.get("lastupdate"))));
+ labelVerantwortlicher.setText(res.get("owner") + " (" + res.get("mail") + ")");
+ labelWeitereVerantwortliche.setText("Keine");
+ if (res.get("template").equals("true")) {
+ labelVorlage.setText("Ja");
+ } else {
+ labelVorlage.setText("Nein");
+ }
+ if (res.get("license").equals("1")) {
+ labelLizenzSoftware.setText("Ja");
+ } else {
+ labelLizenzSoftware.setText("Nein");
+ }
+ if (res.get("internet").equals("1")) {
+ labelInternet.setText("Ja");
+ } else {
+ labelInternet.setText("Nein");
+ }
+ labelRam.setText(res.get("ram"));
+ labelCPU.setText(res.get("cpu"));
+ labelID.setText(res.get("id"));
+ labelVersion.setText(res.get("version"));
+ textAreadesc.setText(res.get("desc"));
+ } catch (TException | ParseException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ }
+}
diff --git a/Dozentenmodul/src/main/java/gui/image/SearchMethodLecture_GUI.java b/Dozentenmodul/src/main/java/gui/image/SearchMethodLecture_GUI.java
deleted file mode 100644
index 4eda36f0..00000000
--- a/Dozentenmodul/src/main/java/gui/image/SearchMethodLecture_GUI.java
+++ /dev/null
@@ -1,290 +0,0 @@
-package gui.image;
-
-import gui.intro.About_GUI;
-import gui.intro.MainMenue_GUI;
-
-import java.awt.Color;
-import java.awt.FlowLayout;
-import java.awt.Font;
-import java.awt.SystemColor;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.net.URI;
-import java.net.URISyntaxException;
-
-import javax.swing.ButtonGroup;
-import javax.swing.JButton;
-import javax.swing.JFrame;
-import javax.swing.JLabel;
-import javax.swing.JMenu;
-import javax.swing.JMenuBar;
-import javax.swing.JMenuItem;
-import javax.swing.JPanel;
-import javax.swing.JRadioButton;
-import javax.swing.JSeparator;
-import javax.swing.JTextArea;
-import javax.swing.JTextPane;
-import javax.swing.UIManager;
-import javax.swing.UnsupportedLookAndFeelException;
-import javax.swing.border.EmptyBorder;
-import javax.swing.border.TitledBorder;
-
-import models.Links;
-import util.GuiOrganizer;
-import util.OpenLinks;
-
-@SuppressWarnings("serial")
-public class SearchMethodLecture_GUI extends JFrame {
-
- private final JPanel contentPanel = new JPanel();
- String[] result;
- JRadioButton rdbtnSearchByImage;
- JRadioButton rdbtnSearchByLecture;
- private final ButtonGroup buttonGroup = new ButtonGroup();
-
-
-
- /**
- * Create the dialog.
- */
- public SearchMethodLecture_GUI() {
- addWindowListener(new WindowAdapter() {
- @Override
- public void windowClosing(WindowEvent arg0) {
- System.exit(0);
- }
- });
- setResizable(false);
-
- try {
- UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
- } catch (ClassNotFoundException | InstantiationException
- | IllegalAccessException | UnsupportedLookAndFeelException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- setTitle("bwLehrpool Suite *Prototyp* - Suchmethode w\u00E4hlen");
-
- setBounds(0, 0, 603, 722);
- GuiOrganizer.centerGUI(this);
-
- getContentPane().setLayout(null);
- {
- JPanel panel = new JPanel();
- panel.setBackground(SystemColor.menu);
- panel.setBounds(10, 11, 577, 57);
- getContentPane().add(panel);
- panel.setLayout(null);
- {
- JLabel lblNewLabel = new JLabel("Suchmethode ausw\u00E4hlen");
- lblNewLabel.setBounds(10, 11, 509, 22);
- panel.add(lblNewLabel);
- lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18));
- }
-
- JTextPane txtpnBitteWhlenSie = new JTextPane();
- txtpnBitteWhlenSie.setEditable(false);
- txtpnBitteWhlenSie.setBackground(SystemColor.menu);
- txtpnBitteWhlenSie
- .setText("Geben Sie bitte an, nach welchem Kriterium Sie suchen m\u00F6chten.");
- txtpnBitteWhlenSie.setBounds(10, 36, 509, 32);
- panel.add(txtpnBitteWhlenSie);
- }
- contentPanel.setBounds(10, 85, 577, 493);
- contentPanel.setBackground(SystemColor.menu);
- contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
- getContentPane().add(contentPanel);
- contentPanel.setLayout(null);
-
- JPanel panel_1 = new JPanel();
- panel_1.setBackground(SystemColor.menu);
- panel_1.setBorder(new TitledBorder(null,
- "W\u00e4hlen Sie bitte die Suchmethode Ihrer Suche",
- TitledBorder.LEADING, TitledBorder.TOP, null, null));
- panel_1.setBounds(10, 36, 557, 369);
- contentPanel.add(panel_1);
- panel_1.setLayout(null);
-
- rdbtnSearchByImage = new JRadioButton(
- "Nach einem VL-Image oder Vorlagen suchen");
- buttonGroup.add(rdbtnSearchByImage);
- rdbtnSearchByImage.setBounds(6, 38, 545, 23);
- panel_1.add(rdbtnSearchByImage);
-
- JTextArea txtrHierKlickenWenn = new JTextArea();
- txtrHierKlickenWenn.setBackground(SystemColor.menu);
- txtrHierKlickenWenn.setLineWrap(true);
- txtrHierKlickenWenn.setFont(new Font("Tahoma", Font.PLAIN, 11));
- txtrHierKlickenWenn
- .setText("Hier klicken, wenn Sie nach einem konkreten Image suchen, von dem Sie exakte Daten kennen. Hierzu geh\u00F6ren z.B. das Betriebssystem oder die installierte Software.\r\nEs werden zudem alle Vorlagen aufgelistet.");
- txtrHierKlickenWenn.setBounds(25, 68, 518, 80);
- panel_1.add(txtrHierKlickenWenn);
-
- JTextArea txtrHierKlickenWenn_1 = new JTextArea();
- txtrHierKlickenWenn_1
- .setText("Hier klicken, wenn Sie nur wissen f\u00FCr welche Veranstaltung das gesuchte Image verwendet wird. Hierzu geh\u00F6ren z.B. der Name des Dozenten oder der Name der Veranstaltung.");
- txtrHierKlickenWenn_1.setLineWrap(true);
- txtrHierKlickenWenn_1.setFont(new Font("Tahoma", Font.PLAIN, 11));
- txtrHierKlickenWenn_1.setBackground(SystemColor.menu);
- txtrHierKlickenWenn_1.setBounds(25, 210, 518, 80);
- panel_1.add(txtrHierKlickenWenn_1);
-
- rdbtnSearchByLecture = new JRadioButton(
- "Nach einer Veranstaltung suchen");
- buttonGroup.add(rdbtnSearchByLecture);
- rdbtnSearchByLecture.setBounds(6, 180, 545, 23);
- panel_1.add(rdbtnSearchByLecture);
-
- JPanel panel = new JPanel();
- panel.setBounds(10, 402, 577, 33);
- contentPanel.add(panel);
- panel.setLayout(null);
- panel.setBorder(new EmptyBorder(5, 5, 5, 5));
- panel.setBackground(SystemColor.menu);
-
- JLabel lblHauptmen = new JLabel("Hauptmen\u00FC");
- lblHauptmen.addMouseListener(new MouseAdapter() {
- @Override
- public void mouseClicked(MouseEvent arg0) {
-
- SearchMethodLecture_GUI.this.setVisible(false);
- MainMenue_GUI main = new MainMenue_GUI();
- main.setVisible(true);
- }
- });
- lblHauptmen.setForeground(Color.BLUE);
- lblHauptmen.setBounds(10, 11, 61, 14);
- contentPanel.add(lblHauptmen);
-
- JLabel label_1 = new JLabel(">");
- label_1.setBounds(69, 11, 13, 14);
- contentPanel.add(label_1);
-
- JLabel lblVlimage = new JLabel("VL-Image");
- lblVlimage.setForeground(Color.BLUE);
- lblVlimage.setBounds(81, 11, 45, 14);
- contentPanel.add(lblVlimage);
-
- JLabel label_2 = new JLabel(">");
- label_2.setBounds(133, 11, 13, 14);
- contentPanel.add(label_2);
-
- JLabel lblNewLabel_1 = new JLabel("Suchmethode");
- lblNewLabel_1.setBounds(146, 11, 82, 14);
- contentPanel.add(lblNewLabel_1);
- {
- JPanel buttonPane = new JPanel();
- buttonPane.setBounds(0, 640, 597, 33);
- buttonPane.setBackground(SystemColor.menu);
- buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
- getContentPane().add(buttonPane);
- {
- JButton backButton = new JButton("Zur\u00FCck");
- backButton.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- MainMenue_GUI sr = new MainMenue_GUI();
- sr.setVisible(true);
- dispose();
- }
- });
- backButton.setActionCommand("CANCEL");
- buttonPane.add(backButton);
- getRootPane().setDefaultButton(backButton);
- }
- {
- JButton continueButton = new JButton("Weiter");
- continueButton.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
-
- if (rdbtnSearchByImage.isSelected() == true) {
- SearchImage_GUI si = new SearchImage_GUI();
- si.setVisible(true);
- dispose();
- }
- }
-
- });
- continueButton.setActionCommand("OK");
- buttonPane.add(continueButton);
- }
- }
-
- JSeparator separator = new JSeparator();
- separator.setBounds(0, 78, 597, 2);
- getContentPane().add(separator);
-
- JSeparator separator_1 = new JSeparator();
- separator_1.setBounds(0, 627, 597, 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");
- mntmFaq.addMouseListener(new MouseAdapter() {
- @Override
- public void mousePressed(MouseEvent arg0) {
-
- OpenLinks open = new OpenLinks();
-
- URI windows;
- try {
- windows = new URI(Links.getFAQ());
-
- open.openWebpage(windows);
-
- } catch (URISyntaxException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- });
- mnNewMenu_1.add(mntmFaq);
-
-
- JMenuItem mntmOtrs = new JMenuItem("OTRS");
- mntmOtrs.addMouseListener(new MouseAdapter() {
- @Override
- public void mousePressed(MouseEvent arg0) {
-
- OpenLinks open = new OpenLinks();
-
- URI windows;
- try {
- windows = new URI(Links.getOTRS());
-
- open.openWebpage(windows);
-
- } catch (URISyntaxException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
- }
- });
- mnNewMenu_1.add(mntmOtrs);
-
- JMenuItem mntmAbout = new JMenuItem("About");
- mntmAbout.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- About_GUI ab = new About_GUI();
- ab.setVisible(true);
- }
- });
- mnNewMenu_1.add(mntmAbout);
-
- }
-}
diff --git a/Dozentenmodul/src/main/java/gui/intro/About_GUI.java b/Dozentenmodul/src/main/java/gui/intro/About_GUI.java
index 3e10d1d9..a97a217b 100644
--- a/Dozentenmodul/src/main/java/gui/intro/About_GUI.java
+++ b/Dozentenmodul/src/main/java/gui/intro/About_GUI.java
@@ -16,6 +16,8 @@ import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.border.EmptyBorder;
+import models.Version;
+
import util.GuiOrganizer;
@SuppressWarnings("serial")
@@ -39,11 +41,11 @@ public class About_GUI extends JFrame {
// TODO Auto-generated catch block
e.printStackTrace();
JOptionPane.showMessageDialog(null,
- e.getCause() + "\n" + e.getMessage(), "Debug-Message",
+ e.getCause() + "\n" + e.getStackTrace(), "Debug-Message",
JOptionPane.ERROR_MESSAGE);
}
// Titel des Fensters setzen
- setTitle("Dozentenmodul *Prototyp* - About");
+ setTitle("Dozentenmodul - About");
// Aktion die beim Schliessen durchgefuehrt werden soll
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
// Groesse des Fensters definieren
@@ -86,7 +88,7 @@ public class About_GUI extends JFrame {
txtpnVersionVBuilddate = new JTextPane();
txtpnVersionVBuilddate
- .setText("Version: v0.1\r\nBuild-Date: 03.06.2014\r\n\r\nContact: michael.wilson@hs-offenburg.de\r\nWebsite: http://bwlehrpool.hs-offenburg.de/");
+ .setText("Version: "+Version.getVersion()+"\r\nBuild-Date: "+Version.getBuildDate()+"\r\n\r\nContact: michael.wilson@hs-offenburg.de\r\nWebsite: http://bwlehrpool.hs-offenburg.de/");
txtpnVersionVBuilddate.setEditable(false);
txtpnVersionVBuilddate.setBackground(SystemColor.menu);
txtpnVersionVBuilddate.setBounds(62, 95, 224, 90);
diff --git a/Dozentenmodul/src/main/java/gui/intro/BillOfRights_GUI.java b/Dozentenmodul/src/main/java/gui/intro/BillOfRights_GUI.java
index 21d15d40..b11dc746 100644
--- a/Dozentenmodul/src/main/java/gui/intro/BillOfRights_GUI.java
+++ b/Dozentenmodul/src/main/java/gui/intro/BillOfRights_GUI.java
@@ -75,7 +75,7 @@ public class BillOfRights_GUI extends JFrame {
e.printStackTrace();
}
//Setzt den Fenstertitel
- setTitle("bwLehrpool Suite *Prototyp*");
+ setTitle("bwLehrpool Suite");
//Zentiert das Fenster in der Bildschirmmitte
setBounds(0, 0, 603, 722);
@@ -136,13 +136,13 @@ public class BillOfRights_GUI extends JFrame {
// TODO Auto-generated catch block
e1.printStackTrace();
JOptionPane.showMessageDialog(null,
- e1.getCause()+"\n"+e1.getMessage(),
+ e1.getCause()+"\n"+e1.getStackTrace(),
"Debug-Message", JOptionPane.ERROR_MESSAGE);
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
JOptionPane.showMessageDialog(null,
- e1.getCause()+"\n"+e1.getMessage(),
+ e1.getCause()+"\n"+e1.getStackTrace(),
"Debug-Message", JOptionPane.ERROR_MESSAGE);
}
VmWareLink_GUI ac=new VmWareLink_GUI();
diff --git a/Dozentenmodul/src/main/java/gui/intro/Login_GUI.java b/Dozentenmodul/src/main/java/gui/intro/Login_GUI.java
index e07bfd7d..b27c7179 100644
--- a/Dozentenmodul/src/main/java/gui/intro/Login_GUI.java
+++ b/Dozentenmodul/src/main/java/gui/intro/Login_GUI.java
@@ -28,6 +28,7 @@ import models.SessionData;
import models.person;
import org.apache.thrift.TException;
+import org.ini4j.InvalidFileFormatException;
import org.ini4j.Wini;
import org.openslx.imagemaster.thrift.iface.ImageServer.Client;
@@ -36,6 +37,7 @@ import thrift.ThriftConnection;
import org.openslx.imagemaster.thrift.iface.UserInfo;
import util.GuiOrganizer;
import config.config_file;
+import javax.swing.JCheckBox;
@SuppressWarnings("serial")
public class Login_GUI extends JFrame {
@@ -50,7 +52,8 @@ public class Login_GUI extends JFrame {
MasterThriftConnection thrift;
Client client;
String token;
-
+ JCheckBox chckbxBenutzernameSpeichern;
+
/**
* Launch the application.
*/
@@ -101,12 +104,9 @@ public class Login_GUI extends JFrame {
| IllegalAccessException | UnsupportedLookAndFeelException e) {
// TODO Auto-generated catch block
e.printStackTrace();
- JOptionPane.showMessageDialog(null,
- e.getCause() + "\n" + e.getMessage(), "Debug-Message",
- JOptionPane.ERROR_MESSAGE);
}
// Titel des Fensters setzen
- setTitle("Dozentenmodul *Prototyp*");
+ setTitle("bwLehrpool Suite");
// Aktion die beim Schliessen durchgefuehrt werden soll
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
@@ -114,6 +114,8 @@ public class Login_GUI extends JFrame {
setBounds(0, 0, 603, 400);
GuiOrganizer.centerGUI(this);
+
+
// Erzeugen eines Panels
contentPane = new JPanel();
// Hintergrund Farbe des Panels setzen
@@ -136,16 +138,55 @@ public class Login_GUI extends JFrame {
imgLabel.setIcon(new ImageIcon(scaled));
// Hinzufuegen des Logos in das Fenster
contentPane.add(imgLabel);
+
+ chckbxBenutzernameSpeichern = new JCheckBox("Benutzername speichern");
+ chckbxBenutzernameSpeichern.setBounds(292, 222, 237, 23);
+ contentPane.add(chckbxBenutzernameSpeichern);
// Erzeugen und Hinzufuegen des Labels
JLabel LabelUser = new JLabel("bwIDM-Benutzername:");
LabelUser.setBounds(111, 164, 134, 20);
contentPane.add(LabelUser);
+
+ // Erzeugen und Hinzufuegen des Passwortfeldes
+ lblpass = new JPasswordField();
+ lblpass.setToolTipText("Bitte geben Sie Ihr bwIDM-Passwort ein.");
+ lblpass.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ performLogin();
+ }
+ });
+ lblpass.setBounds(292, 195, 237, 20);
+ contentPane.add(lblpass);
// Erzeugen und Hinzufuegen des Textfeldes
lblusername = new JTextField();
lblusername
.setToolTipText("Bitte geben Sie Ihren bwIDM-Benutzernamen ein.");
+ try {
+ Wini ini = new Wini(
+ new File(
+ "C:\\Users\\"
+ + System.getProperty("user.name")
+ + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini"));
+ if(ini.get("main", "Benutzername").isEmpty()){
+
+ }else{
+ lblusername.setText(ini.get("main", "Benutzername").toString());
+
+ }
+
+ if(ini.get("main", "Benutzername speichern", Boolean.class)==true){
+ chckbxBenutzernameSpeichern.setSelected(true);
+
+ }
+ } catch (InvalidFileFormatException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ } catch (IOException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
lblusername.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
performLogin();
@@ -159,32 +200,31 @@ public class Login_GUI extends JFrame {
JLabel LabelPass = new JLabel("bwIDM-Passwort:");
LabelPass.setBounds(111, 195, 134, 20);
contentPane.add(LabelPass);
-
+
+ lblConnectionInfo.setHorizontalAlignment(SwingConstants.LEFT);
+ lblConnectionInfo.setBounds(111, 290, 418, 20);
+ lblConnectionInfo.setEnabled(true);
+ lblConnectionInfo.setText("Info: Bereit f\u00FCr Login");
+
+ contentPane.add(lblConnectionInfo);
+
// Erzeugen, Hinzufuegen und definierung der Aktion des Buttons
JButton BtnLogin = new JButton("Login");
BtnLogin.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
+
performLogin();
}// end actionPerformed
});
- BtnLogin.setBounds(292, 244, 237, 23);
+ BtnLogin.setBounds(292, 252, 237, 23);
contentPane.add(BtnLogin);
- // Erzeugen und Hinzufuegen des Passwortfeldes
- lblpass = new JPasswordField();
- lblpass.setToolTipText("Bitte geben Sie Ihr bwIDM-Passwort ein.");
- lblpass.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- performLogin();
- }
- });
- lblpass.setBounds(292, 195, 237, 20);
- contentPane.add(lblpass);
- lblConnectionInfo.setHorizontalAlignment(SwingConstants.LEFT);
- lblConnectionInfo.setBounds(292, 290, 237, 20);
- contentPane.add(lblConnectionInfo);
+
+
+
+
//GuiOrganizer.centerGUI(this);
}// end LoginGUI()
@@ -198,26 +238,49 @@ public class Login_GUI extends JFrame {
org.openslx.imagemaster.thrift.iface.SessionData result = null;
try {
+
login = true;
String passText = new String(lblpass.getPassword());
// check if client has received a connection with information or a
// null package
if (checkClientPackage() == true) {
- // package has information
- System.out.println("Auth");
+
+ // package has information
+ //User-Info
+
+ System.out.println("Authentifiziere - warte auf Masterserver");
+ lblConnectionInfo.setForeground(Color.black);
+
+ lblConnectionInfo.setText("Authentifiziere - warte auf Antwort von Server...");
+
result = client.authenticate(lblusername.getText(), passText);
- System.out.println("Succes Auth");
+
+ //User-Info
+ System.out.println("Authentifizierung erfolgreich");
+ lblConnectionInfo.setForeground(Color.green);
+ lblConnectionInfo.setText("Authentifizierung erfolgreich");
+
+ //set Information
SessionData.session.setAuthToken(result.authToken);
SessionData.session.setSessionID(result.sessionId);
SessionData.session.setServerAdress(result.serverAddress);
- System.out.println("Master");
+
+
+ //User-Info
+ lblConnectionInfo.setForeground(Color.black);
+ lblConnectionInfo.setText("Hole Verbindungsdaten von Server...");
+ System.out.println("warte auf Masterserver");
// set connection to bwLehrpoolSuiteServer
ThriftConnection bwthrift = new ThriftConnection();
server.Server.Client bwClient = bwthrift.getThriftConnection();
models.Client.clientcon.setClient(bwClient);
- System.out.println("Client");
+
+ //User-Info
+ System.out.println("Client macht weiter");
System.out.println("Session-ID: " + result.sessionId
+ "\nToken: " + result.authToken);
+ lblConnectionInfo.setForeground(Color.green);
+ lblConnectionInfo.setText("Daten erhalten.");
if (login == true) {
//Daten speichern
@@ -227,7 +290,7 @@ public class Login_GUI extends JFrame {
"Error: Token ist null", "Token defekt",
JOptionPane.ERROR_MESSAGE);
}
- System.out.println("Hole jetzt Infos aus SessionData...");
+ System.out.println("Arbeite ab jetzt mit Infos aus SessionData.");
UserInfo user = client.getUserFromToken(SessionData.session
.getAuthToken());
@@ -241,6 +304,14 @@ public class Login_GUI extends JFrame {
person.verantwortlicher.setEMail(user.eMail);
person.verantwortlicher.setHochschule(hochschule);
+
+ //Sp�ter �ber result.getRole zum Beispiel die Rolle holen
+ person.verantwortlicher.setRole("Dozent");
+ //person.verantwortlicher.setRole("Admin");
+ //person.verantwortlicher.setRole("Student");
+ //person.verantwortlicher.setRole("GetToTheChopper!");
+
+
try {
// Lege config File an und entscheide welches Fenster
// als naechstes geoeffnet wird
@@ -249,6 +320,35 @@ public class Login_GUI extends JFrame {
"C:\\Users\\"
+ System.getProperty("user.name")
+ "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini"));
+ if(lblusername.getText().equals(ini.get("main","Benutzername",String.class))==true){
+ if(chckbxBenutzernameSpeichern.isSelected()){
+ ini.put("main", "Benutzername", lblusername.getText());
+ ini.put("main", "Benutzername speichern", true);
+ ini.store();
+ }
+ else{
+ ini.put("main", "Benutzername", "");
+ ini.put("main", "Benutzername speichern", false);
+ ini.store();
+ }
+ }else{
+
+ if(chckbxBenutzernameSpeichern.isSelected()){
+ ini.put("main", "Benutzername", lblusername.getText());
+ ini.put("main", "Benutzername speichern", true);
+ ini.put("main", "BillOfRights",false);
+ ini.put("main", "vmware",false);
+ ini.store();
+ }
+ else{
+ ini.put("main", "Benutzername", "");
+ ini.put("main", "Benutzername speichern", false);
+ ini.put("main", "BillOfRights",false);
+ ini.put("main", "vmware",false);
+ ini.store();
+ }
+ }
+
// Pruefe ob Bills Of Rights schon akzeptiert wurden,
// wenn
// nicht zeige diese an
@@ -273,12 +373,11 @@ public class Login_GUI extends JFrame {
setVisible(false);
}
}
+
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
- JOptionPane.showMessageDialog(null, e.getCause() + "\n"
- + e.getMessage(), "Debug-Message",
- JOptionPane.ERROR_MESSAGE);
+
}
} else {
@@ -296,6 +395,9 @@ public class Login_GUI extends JFrame {
}
} catch (org.openslx.imagemaster.thrift.iface.AuthenticationException e) {
+ lblConnectionInfo.setForeground(Color.red);
+ lblConnectionInfo
+ .setText("Fehler: Falscher Benutzername oder Passwort.");
System.out
.println("Authentifizierung fehlgeschlagen: " + e.message);
JOptionPane
@@ -305,26 +407,21 @@ public class Login_GUI extends JFrame {
"Anmeldung fehlgeschlagen",
JOptionPane.ERROR_MESSAGE);
e.printStackTrace();
- JOptionPane.showMessageDialog(null,
- e.getCause() + "\n" + e.getMessage(), "Message",
- JOptionPane.ERROR_MESSAGE);
return;
} catch (TException e) {
// TODO Auto-generated catch block
e.printStackTrace();
- JOptionPane.showMessageDialog(null,
- e.getCause() + "\n" + e.getMessage(), "Debug-Message",
- JOptionPane.ERROR_MESSAGE);
- return;
+
}
}// end performLogin
public boolean checkClientPackage() {
// check if client is null or has been returned with information
+ System.out.println("Prüfe Eingangsdaten");
if (client != null) {
// client contains information
isClientReturnedCorrectly = true;
- System.out.println("Verbindungsinformationen erhalten");
+ System.out.println("Verbindungsdaten erhalten");
} else {
// client has returned with error
isClientReturnedCorrectly = false;
@@ -334,5 +431,4 @@ public class Login_GUI extends JFrame {
return isClientReturnedCorrectly;
}// end checkServerConnection()
-
}// end class
diff --git a/Dozentenmodul/src/main/java/gui/intro/MainMenue_GUI.java b/Dozentenmodul/src/main/java/gui/intro/MainMenue_GUI.java
index 7a57cd90..956ca63d 100644
--- a/Dozentenmodul/src/main/java/gui/intro/MainMenue_GUI.java
+++ b/Dozentenmodul/src/main/java/gui/intro/MainMenue_GUI.java
@@ -30,6 +30,7 @@ import javax.swing.JLabel;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
+import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JSeparator;
@@ -42,8 +43,10 @@ import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.border.EmptyBorder;
import javax.swing.border.TitledBorder;
+import models.ImageRights;
import models.Links;
import models.SessionData;
+import models.person;
import util.GuiOrganizer;
import util.OpenLinks;
@@ -66,11 +69,18 @@ public class MainMenue_GUI extends JFrame {
private final ButtonGroup buttonGroup = new ButtonGroup();
private JMenuItem mntmAbout;
+ // for testing
+ ImageRights imageRights = new ImageRights();
/**
* Create the dialog.
*/
public MainMenue_GUI() {
+
+ // Leerzeile auf Konsole bei Rueckkehr ins Hauptmenue fuer leichteres
+ // Lesen
+ System.out.println("\n");
+
addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent arg0) {
@@ -84,7 +94,8 @@ public class MainMenue_GUI extends JFrame {
// TODO Auto-generated catch block
e.printStackTrace();
}
- setTitle("bwLehrpool Suite *Prototyp* - Connected Server: "+SessionData.session.getServerAdress());
+ setTitle("bwLehrpool Suite - Connected Server: "
+ + SessionData.session.getServerAdress());
setBounds(0, 0, 603, 722);
GuiOrganizer.centerGUI(this);
@@ -119,25 +130,24 @@ public class MainMenue_GUI extends JFrame {
JPanel panelImage = new JPanel();
panelImage.setBackground(SystemColor.menu);
- panelImage.setBorder(new TitledBorder(null, "VL-Image",
+ panelImage.setBorder(new TitledBorder(null, "Image",
TitledBorder.LEADING, TitledBorder.TOP, null, null));
- panelImage.setBounds(10, 146, 270, 170);
+ panelImage.setBounds(10, 221, 270, 133);
contentPanel.add(panelImage);
panelImage.setLayout(null);
rdbtnImageNew = new JRadioButton("Neu");
rdbtnImageNew
.setToolTipText("Hier k\u00F6nnen Sie eine standard Laborvorlage downloaden");
- rdbtnImageNew.setBounds(6, 22, 159, 23);
+ rdbtnImageNew.setBounds(20, 22, 159, 23);
panelImage.add(rdbtnImageNew);
- rdbtnImageNew.setSelected(true);
buttonGroup.add(rdbtnImageNew);
rdbtnImageNew.setBackground(SystemColor.menu);
rdbtnImageEdit = new JRadioButton("Bearbeiten");
rdbtnImageEdit
.setToolTipText("Hier k\u00F6nnen Sie ein bestehendes Labor zum ver\u00E4ndern downloaden");
- rdbtnImageEdit.setBounds(6, 48, 185, 23);
+ rdbtnImageEdit.setBounds(20, 48, 185, 23);
panelImage.add(rdbtnImageEdit);
buttonGroup.add(rdbtnImageEdit);
rdbtnImageEdit.setHorizontalAlignment(SwingConstants.LEFT);
@@ -150,7 +160,7 @@ public class MainMenue_GUI extends JFrame {
.setToolTipText("Hier k\u00F6nnen Sie ein bestehendes Labor zum ver\u00E4ndern downloaden");
rdbtnImageDelete.setHorizontalAlignment(SwingConstants.LEFT);
rdbtnImageDelete.setBackground(SystemColor.menu);
- rdbtnImageDelete.setBounds(6, 74, 185, 23);
+ rdbtnImageDelete.setBounds(20, 74, 185, 23);
panelImage.add(rdbtnImageDelete);
rdbtnImageSearchDownload = new JRadioButton("Suche und Download");
@@ -159,7 +169,7 @@ public class MainMenue_GUI extends JFrame {
.setToolTipText("Hier k\u00F6nnen Sie ein bestehendes Labor zum ver\u00E4ndern downloaden");
rdbtnImageSearchDownload.setHorizontalAlignment(SwingConstants.LEFT);
rdbtnImageSearchDownload.setBackground(SystemColor.menu);
- rdbtnImageSearchDownload.setBounds(6, 100, 185, 23);
+ rdbtnImageSearchDownload.setBounds(20, 100, 185, 23);
panelImage.add(rdbtnImageSearchDownload);
JPanel panelDesc = new JPanel();
@@ -168,12 +178,14 @@ public class MainMenue_GUI extends JFrame {
.getBorder("TitledBorder.border"), "Erkl\u00e4rung",
TitledBorder.LEADING, TitledBorder.TOP, null, null));
panelDesc.setBackground(SystemColor.menu);
- panelDesc.setBounds(290, 146, 270, 170);
+ panelDesc.setBounds(10, 364, 270, 133);
contentPanel.add(panelDesc);
ScrollPane scrollPaneDesc = new ScrollPane();
- scrollPaneDesc.setBounds(10, 15, 250, 145);
+ scrollPaneDesc.setBounds(10, 15, 250, 110);
final JTextArea txtDesc = new JTextArea();
+ txtDesc.setEditable(false);
+ txtDesc.setBounds(280, 211, 10, 10);
txtDesc.setLineWrap(true);
txtDesc.setWrapStyleWord(true);
txtDesc.setFont(new Font("Tahoma", Font.PLAIN, 11));
@@ -189,21 +201,21 @@ public class MainMenue_GUI extends JFrame {
.getBorder("TitledBorder.border"), "Veranstaltung (VMChooser)",
TitledBorder.LEADING, TitledBorder.TOP, null, null));
panelVeranstaltung.setBackground(SystemColor.menu);
- panelVeranstaltung.setBounds(10, 327, 270, 170);
+ panelVeranstaltung.setBounds(290, 221, 270, 133);
contentPanel.add(panelVeranstaltung);
rdbtnLectureNew = new JRadioButton("Neu");
buttonGroup.add(rdbtnLectureNew);
rdbtnLectureNew
.setToolTipText("Hier k\u00F6nnen Sie Ihre Labordaten eingeben");
- rdbtnLectureNew.setBounds(6, 24, 185, 23);
+ rdbtnLectureNew.setBounds(20, 24, 185, 23);
panelVeranstaltung.add(rdbtnLectureNew);
rdbtnLectureNew.setBackground(SystemColor.menu);
rdbtnLectureEdit = new JRadioButton("Bearbeiten");
rdbtnLectureEdit
.setToolTipText("Hier k\u00F6nnen Sie einen Link auf ein bestehendes Labor erzeugen");
- rdbtnLectureEdit.setBounds(6, 50, 230, 23);
+ rdbtnLectureEdit.setBounds(20, 50, 230, 23);
panelVeranstaltung.add(rdbtnLectureEdit);
buttonGroup.add(rdbtnLectureEdit);
rdbtnLectureEdit.setBackground(SystemColor.menu);
@@ -211,7 +223,7 @@ public class MainMenue_GUI extends JFrame {
rdbtnLectureDelete = new JRadioButton("L\u00F6schen");
rdbtnLectureDelete
.setToolTipText("Hier k\u00F6nnen Sie ein Labor l\u00F6schen");
- rdbtnLectureDelete.setBounds(6, 76, 175, 23);
+ rdbtnLectureDelete.setBounds(20, 76, 175, 23);
panelVeranstaltung.add(rdbtnLectureDelete);
buttonGroup.add(rdbtnLectureDelete);
rdbtnLectureDelete.setBackground(SystemColor.menu);
@@ -221,7 +233,7 @@ public class MainMenue_GUI extends JFrame {
rdbtnLectureSearch
.setToolTipText("Hier k\u00F6nnen Sie ein Labor l\u00F6schen");
rdbtnLectureSearch.setBackground(SystemColor.menu);
- rdbtnLectureSearch.setBounds(6, 102, 175, 23);
+ rdbtnLectureSearch.setBounds(20, 102, 175, 23);
panelVeranstaltung.add(rdbtnLectureSearch);
JPanel panelNews = new JPanel();
@@ -230,22 +242,30 @@ public class MainMenue_GUI extends JFrame {
.getBorder("TitledBorder.border"), "News",
TitledBorder.LEADING, TitledBorder.TOP, null, null));
panelNews.setBackground(SystemColor.menu);
- panelNews.setBounds(290, 327, 270, 170);
+ panelNews.setBounds(290, 364, 270, 133);
contentPanel.add(panelNews);
ScrollPane scrollPaneNews = new ScrollPane();
- // scrollPaneDesc.setBounds(10, 15, 250, 145);
- scrollPaneNews.setBounds(10, 15, 250, 145);
+ scrollPaneNews.setBounds(10, 15, 250, 110);
JTextArea txtNews = new JTextArea();
+ txtNews.setEditable(false);
txtNews.setFont(new Font("Tahoma", Font.PLAIN, 11));
txtNews.setBackground(SystemColor.menu);
txtNews.setWrapStyleWord(true);
txtNews.setLineWrap(true);
- txtNews.setText("Hier werden mal die Neuigkeiten stehen. Diese kommen direkt vom Satelliten, sind als HS-spezifisch :)");
+ txtNews.setText("Hier werden mal die Neuigkeiten stehen. Diese kommen direkt vom Satelliten und sind HS-spezifisch.");
scrollPaneNews.add(txtNews);
panelNews.add(scrollPaneNews);
/*
+ * Ber\u00fccksichtigen der Rechte für GUI
+ */
+ // set the rights for this user
+ setRoleRights();
+ processRights();
+ setCorrectRadioButton();
+
+ /*
* Funktion Texte f\u00fcr das Klicken der RadioButtons
*/
rdbtnImageNew.addActionListener(new ActionListener() {
@@ -318,11 +338,12 @@ public class MainMenue_GUI extends JFrame {
+ "Intelligenz\" lauten und referenzieren dabei auf das allgemeine Image <br>"
+ "\"Programmieren\".</html>");
lblGrafik.setIcon(new ImageIcon(MainMenue_GUI.class
- .getResource("/img/Image_zu_Veranstaltung_HDD.png")));
+ .getResource("/e4_n_imgs2_bwl_vmc_v2.png")));
+
// ToolTipp lange anzeigen - 60sec
ToolTipManager.sharedInstance().setDismissDelay(60000);
ToolTipManager.sharedInstance().registerComponent(lblGrafik);
- lblGrafik.setBounds(82, 3, 391, 110);
+ lblGrafik.setBounds(10, -12, 547, 189);
contentPanel.add(lblGrafik);
JTextPane txtpnUmDetaillierteInformationen = new JTextPane();
@@ -330,7 +351,7 @@ public class MainMenue_GUI extends JFrame {
.setText("Um detaillierte Informationen zu erhalten, fahren Sie bitte mit der Maus \u00FCber die Grafik.");
txtpnUmDetaillierteInformationen.setEditable(false);
txtpnUmDetaillierteInformationen.setBackground(SystemColor.menu);
- txtpnUmDetaillierteInformationen.setBounds(10, 113, 509, 22);
+ txtpnUmDetaillierteInformationen.setBounds(10, 188, 509, 22);
contentPanel.add(txtpnUmDetaillierteInformationen);
{
JPanel buttonPane = new JPanel();
@@ -380,7 +401,10 @@ public class MainMenue_GUI extends JFrame {
SearchLecture_GUI sl = new SearchLecture_GUI();
sl.setVisible(true);
dispose();
- }
+ } else
+ JOptionPane.showMessageDialog(null,
+ "Keine Auswahl getroffen.",
+ "Auswahl fehlt", JOptionPane.ERROR_MESSAGE);
}
});
continueButton.setActionCommand("OK");
@@ -409,15 +433,11 @@ public class MainMenue_GUI extends JFrame {
mntmFaq.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent arg0) {
-
OpenLinks open = new OpenLinks();
-
URI windows;
try {
windows = new URI(Links.getFAQ());
-
open.openWebpage(windows);
-
} catch (URISyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
@@ -425,30 +445,24 @@ public class MainMenue_GUI extends JFrame {
}
});
mnNewMenu_1.add(mntmFaq);
-
JMenuItem mntmOtrs = new JMenuItem("OTRS");
mntmOtrs.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent arg0) {
-
OpenLinks open = new OpenLinks();
-
URI windows;
try {
windows = new URI(Links.getOTRS());
-
open.openWebpage(windows);
-
} catch (URISyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
-
}
});
mnNewMenu_1.add(mntmOtrs);
-
+
mntmAbout = new JMenuItem("About");
mntmAbout.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
@@ -459,4 +473,134 @@ public class MainMenue_GUI extends JFrame {
mnNewMenu_1.add(mntmAbout);
}// end main
+
+ private void processRights() {
+
+ /*
+ * Legt anhand der Rolle fest, welche Operationen der user machen darf.
+ * Rolle kommt vom Masterserver
+ */
+
+ // Image
+ if (person.verantwortlicher.getRole().equals("Student")) {
+ rdbtnImageNew.setEnabled(false);
+ rdbtnImageEdit.setEnabled(false);
+ rdbtnImageDelete.setEnabled(false);
+ rdbtnImageSearchDownload.setEnabled(true);
+ } else if (person.verantwortlicher.getRole().equals("Dozent")
+ || person.verantwortlicher.getRole().equals("Admin")) {
+ rdbtnImageNew.setEnabled(true);
+ rdbtnImageEdit.setEnabled(true);
+ rdbtnImageDelete.setEnabled(true);
+ rdbtnImageSearchDownload.setEnabled(true);
+ } else {
+ rdbtnImageNew.setEnabled(false);
+ rdbtnImageEdit.setEnabled(false);
+ rdbtnImageDelete.setEnabled(false);
+ rdbtnImageSearchDownload.setEnabled(false);
+ }
+
+ // Veranstaltung
+ if (person.verantwortlicher.getRole().equals("Student")) {
+ rdbtnLectureNew.setEnabled(false);
+ rdbtnLectureEdit.setEnabled(false);
+ rdbtnLectureDelete.setEnabled(false);
+ rdbtnLectureSearch.setEnabled(true);
+ } else if (person.verantwortlicher.getRole().equals("Dozent")
+ || person.verantwortlicher.getRole().equals("Admin")) {
+ rdbtnLectureNew.setEnabled(true);
+ rdbtnLectureEdit.setEnabled(true);
+ rdbtnLectureDelete.setEnabled(true);
+ rdbtnLectureSearch.setEnabled(true);
+ } else {
+ rdbtnLectureNew.setEnabled(false);
+ rdbtnLectureEdit.setEnabled(false);
+ rdbtnLectureDelete.setEnabled(false);
+ rdbtnLectureSearch.setEnabled(false);
+ }
+
+ }// end processRights()
+
+ public void setRoleRights() {
+ // Set rights for user, depending on the role that is returned by the
+ // masterserver
+
+ System.out.println("Ihre Rolle ist nun: "
+ + person.verantwortlicher.getRole());
+ // role==Student
+ if (person.verantwortlicher.getRole().equals("Student")) {
+ ImageRights.rights.setRead(1);
+ ImageRights.rights.setWrite(0);
+ ImageRights.rights.setChangePermission(0);
+ ImageRights.rights.setAdmin(0);
+ ImageRights.rights.setLinkAllowed(0);
+ System.out.println("Rechte (r,w,cp,a,la): "
+ + ImageRights.rights.getRead() + ","
+ + ImageRights.rights.getWrite() + ","
+ + ImageRights.rights.getChangePermission() + ","
+ + ImageRights.rights.getAdmin() + ","
+ + ImageRights.rights.getLinkAllowed());
+
+ } else if (person.verantwortlicher.getRole().equals("Dozent")) { // role==Dozent
+ ImageRights.rights.setRead(1);
+ ImageRights.rights.setWrite(1);
+ ImageRights.rights.setChangePermission(0);
+ ImageRights.rights.setAdmin(0);
+ ImageRights.rights.setLinkAllowed(1);
+ System.out.println("Rechte (r,w,cp,a,la): "
+ + ImageRights.rights.getRead() + ","
+ + ImageRights.rights.getWrite() + ","
+ + ImageRights.rights.getChangePermission() + ","
+ + ImageRights.rights.getAdmin() + ","
+ + ImageRights.rights.getLinkAllowed());
+ } else if (person.verantwortlicher.getRole().equals("Admin")) { // role==Admin
+ ImageRights.rights.setRead(1);
+ ImageRights.rights.setWrite(1);
+ ImageRights.rights.setChangePermission(1);
+ ImageRights.rights.setAdmin(1);
+ ImageRights.rights.setLinkAllowed(1);
+ System.out.println("Rechte (r,w,cp,a,la): "
+ + ImageRights.rights.getRead() + ","
+ + ImageRights.rights.getWrite() + ","
+ + ImageRights.rights.getChangePermission() + ","
+ + ImageRights.rights.getAdmin() + ","
+ + ImageRights.rights.getLinkAllowed());
+ } else { // role==Nothing
+ ImageRights.rights.setRead(0);
+ ImageRights.rights.setWrite(0);
+ ImageRights.rights.setChangePermission(0);
+ ImageRights.rights.setAdmin(0);
+ ImageRights.rights.setLinkAllowed(0);
+ System.out.println("Rechte (r,w,cp,a,la): "
+ + ImageRights.rights.getRead() + ","
+ + ImageRights.rights.getWrite() + ","
+ + ImageRights.rights.getChangePermission() + ","
+ + ImageRights.rights.getAdmin() + ","
+ + ImageRights.rights.getLinkAllowed());
+ }// end if else
+ }// end setRoleRights
+
+ public void setCorrectRadioButton() {
+ // get the first enabled RadioButton depending on role an rights. Start
+ // at top
+
+ if (rdbtnImageNew.isEnabled() == true) {
+ rdbtnImageNew.setSelected(true);
+ } else if (rdbtnImageEdit.isEnabled() == true) {
+ rdbtnImageEdit.setSelected(true);
+ } else if (rdbtnImageDelete.isEnabled() == true) {
+ rdbtnImageDelete.setSelected(true);
+ } else if (rdbtnImageSearchDownload.isEnabled() == true) {
+ rdbtnImageSearchDownload.setSelected(true);
+ } else if (rdbtnLectureNew.isEnabled() == true) {
+ rdbtnLectureNew.setSelected(true);
+ } else if (rdbtnLectureEdit.isEnabled() == true) {
+ rdbtnLectureEdit.setSelected(true);
+ } else if (rdbtnLectureDelete.isEnabled() == true) {
+ rdbtnLectureDelete.setSelected(true);
+ } else if (rdbtnLectureSearch.isEnabled() == true) {
+ rdbtnLectureSearch.setSelected(true);
+ }
+
+ }// end setCorrectRadioButton()
}// end class
diff --git a/Dozentenmodul/src/main/java/gui/intro/VmWareLink_GUI.java b/Dozentenmodul/src/main/java/gui/intro/VmWareLink_GUI.java
index 87c6b2a2..d5350fbd 100644
--- a/Dozentenmodul/src/main/java/gui/intro/VmWareLink_GUI.java
+++ b/Dozentenmodul/src/main/java/gui/intro/VmWareLink_GUI.java
@@ -68,7 +68,7 @@ public class VmWareLink_GUI extends JFrame {
// TODO Auto-generated catch block
e.printStackTrace();
}
- setTitle("Dozentenmodul *Prototyp*");
+ setTitle("bwLehrpool Suite");
setBounds(0, 0, 603, 722);
GuiOrganizer.centerGUI(this);
@@ -105,24 +105,6 @@ public class VmWareLink_GUI extends JFrame {
contentPanel.add(txtpnUmIhreVmdk);
JLabel lblNewLabel_1 = new JLabel("<html><b>Windows: </b></html>");
- lblNewLabel_1.addMouseListener(new MouseAdapter() {
- @Override
- public void mouseReleased(MouseEvent arg0) {
- URI url;
- try {
- url = new URI("https://my.vmware.com/web/vmware/free#desktop_end_user_computing/vmware_player/6_0");
- Desktop.getDesktop().browse(url);
- } catch (URISyntaxException | IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- JOptionPane.showMessageDialog(null,
- e.getCause()+"\n"+e.getMessage(),
- "Debug-Message", JOptionPane.ERROR_MESSAGE);
- }
-
- }
- });
-
lblNewLabel_1.setBounds(10, 93, 499, 14);
contentPanel.add(lblNewLabel_1);
@@ -139,13 +121,13 @@ public class VmWareLink_GUI extends JFrame {
// TODO Auto-generated catch block
e1.printStackTrace();
JOptionPane.showMessageDialog(null,
- e1.getCause()+"\n"+e1.getMessage(),
+ e1.getCause()+"\n"+e1.getStackTrace(),
"Debug-Message", JOptionPane.ERROR_MESSAGE);
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
JOptionPane.showMessageDialog(null,
- e1.getCause()+"\n"+e1.getMessage(),
+ e1.getCause()+"\n"+e1.getStackTrace(),
"Debug-Message", JOptionPane.ERROR_MESSAGE);
}
}
diff --git a/Dozentenmodul/src/main/java/gui/lecture/CreateLectureAllgemein_GUI.java b/Dozentenmodul/src/main/java/gui/lecture/CreateLectureAllgemein_GUI.java
index 44e8bd50..76bf3933 100644
--- a/Dozentenmodul/src/main/java/gui/lecture/CreateLectureAllgemein_GUI.java
+++ b/Dozentenmodul/src/main/java/gui/lecture/CreateLectureAllgemein_GUI.java
@@ -16,6 +16,7 @@ import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.net.URI;
import java.net.URISyntaxException;
+import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
@@ -45,6 +46,8 @@ import util.GuiOrganizer;
import util.OpenLinks;
import com.toedter.calendar.JDateChooser;
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeEvent;
@SuppressWarnings("serial")
public class CreateLectureAllgemein_GUI extends JFrame {
@@ -63,12 +66,16 @@ public class CreateLectureAllgemein_GUI extends JFrame {
JDateChooser dateChooserstart;
Date startDate = new Date();
Date endDate;
+ private boolean descriptionLengthOK = false; // description may not be
+ // longer than
+ // MAX_DESCRIPTION_LENGTH
+ private final int MAX_DESCRIPTION_LENGTH = 254;
+
int maxLifeTime = 180; // Anzahl Tage, die eine Veranstaltung in der Zukunft
// aktiv sein darf
boolean isDateOrderCorrect, isDateMaxLifeTimeCorrect,
isAllInformationReady = false;
-
/**
* Create the dialog.
*/
@@ -93,7 +100,7 @@ public class CreateLectureAllgemein_GUI extends JFrame {
// TODO Auto-generated catch block
e.printStackTrace();
}
- setTitle("bwLehrpool Suite *Prototyp* - Veranstaltung erzeugen");
+ setTitle("bwLehrpool Suite - Veranstaltung erzeugen");
setBounds(0, 0, 603, 722);
GuiOrganizer.centerGUI(this);
@@ -214,17 +221,17 @@ public class CreateLectureAllgemein_GUI extends JFrame {
label_1.setBounds(69, 11, 13, 14);
contentPanel.add(label_1);
- JLabel lblVlimage = new JLabel("VL-Image");
+ JLabel lblVlimage = new JLabel("Veranstaltung");
lblVlimage.setForeground(Color.BLUE);
- lblVlimage.setBounds(81, 11, 45, 14);
+ lblVlimage.setBounds(81, 11, 70, 14);
contentPanel.add(lblVlimage);
JLabel label_2 = new JLabel(">");
- label_2.setBounds(133, 11, 13, 14);
+ label_2.setBounds(161, 11, 13, 14);
contentPanel.add(label_2);
JLabel lblNewLabel_1 = new JLabel("Neu");
- lblNewLabel_1.setBounds(146, 11, 46, 14);
+ lblNewLabel_1.setBounds(174, 11, 46, 14);
contentPanel.add(lblNewLabel_1);
JPanel panel_2 = new JPanel();
@@ -235,9 +242,9 @@ public class CreateLectureAllgemein_GUI extends JFrame {
panel_2.setBounds(10, 36, 557, 284);
contentPanel.add(panel_2);
- JLabel label_3 = new JLabel("Laborname (Anzeigename): *");
- label_3.setBounds(10, 25, 180, 14);
- panel_2.add(label_3);
+ JLabel lblAnzeigename = new JLabel("Anzeigename: *");
+ lblAnzeigename.setBounds(10, 25, 180, 14);
+ panel_2.add(lblAnzeigename);
txtFldVeranstaltungsname = new JTextField();
txtFldVeranstaltungsname.setColumns(10);
@@ -269,11 +276,34 @@ public class CreateLectureAllgemein_GUI extends JFrame {
scrollPane.add(description);
description.setBounds(0, 0, 4, 22);
scrollPane.add(description);
+ dateChooserstart = new JDateChooser();
+ dateChooserstart
+ .addPropertyChangeListener(new PropertyChangeListener() {
+ public void propertyChange(PropertyChangeEvent arg0) {
+ endDate = addDays(dateChooserstart.getDate(),
+ maxLifeTime); // Datum darf weiter als 6
+ // Monate in der Zukunft
+ // liegen
+ }
+ });
+ if (Lecture.lecture.getStartdate() == null) {
+ // is not defined yet
+ dateChooserstart.setDate(startDate);
+ } else {
+ // already defined from last visit on this page
+ dateChooserstart.setDate(Lecture.lecture.getStartdate());
+ }
+ dateChooserstart.setDateFormatString("yyyy-MM-dd HH:mm:ss");
+ dateChooserstart.setBounds(226, 188, 143, 20);
+ panel_2.add(dateChooserstart);
dateChooserend = new JDateChooser();
- endDate = addDays(new Date(), maxLifeTime); // Datum darf weiter als 6
- // Monate in der Zukunft
- // liegen
+ endDate = addDays(dateChooserstart.getDate(), maxLifeTime); // Datum
+ // darf
+ // weiter
+ // als 6
+ // Monate in der Zukunft
+ // liegen
dateChooserend.setDate(endDate);
if (Lecture.lecture.getEnddate() == null) {
// is not defined yet
@@ -282,7 +312,7 @@ public class CreateLectureAllgemein_GUI extends JFrame {
// already defined from last visit on this page
dateChooserend.setDate(Lecture.lecture.getEnddate());
}
- dateChooserend.setDateFormatString("yyyy-MM-dd hh:mm:ss");
+ dateChooserend.setDateFormatString("yyyy-MM-dd HH:mm:ss");
dateChooserend.setBounds(404, 188, 143, 20);
panel_2.add(dateChooserend);
@@ -290,18 +320,6 @@ public class CreateLectureAllgemein_GUI extends JFrame {
lblBis.setBounds(378, 188, 21, 20);
panel_2.add(lblBis);
- dateChooserstart = new JDateChooser();
- if (Lecture.lecture.getStartdate() == null) {
- // is not defined yet
- dateChooserstart.setDate(startDate);
- } else {
- // already defined from last visit on this page
- dateChooserstart.setDate(Lecture.lecture.getStartdate());
- }
- dateChooserstart.setDateFormatString("yyyy-MM-dd hh:mm:ss");
- dateChooserstart.setBounds(226, 188, 143, 20);
- panel_2.add(dateChooserstart);
-
JLabel label_6 = new JLabel("von:");
label_6.setBounds(200, 188, 30, 20);
panel_2.add(label_6);
@@ -338,7 +356,7 @@ public class CreateLectureAllgemein_GUI extends JFrame {
JLabel lblimVmchooserSichtbar = new JLabel("(im VMChooser sichtbar)");
lblimVmchooserSichtbar.setBounds(10, 245, 127, 14);
panel_2.add(lblimVmchooserSichtbar);
-
+
JLabel lblmaxMonate = new JLabel("(max. 6 Monate)");
lblmaxMonate.setBounds(10, 208, 127, 14);
panel_2.add(lblmaxMonate);
@@ -403,7 +421,9 @@ public class CreateLectureAllgemein_GUI extends JFrame {
"Das End-Datum liegt zu weit in der Zukunft. Erlaubt ist maximal:\n"
+ endDate, "Datum fehlerhaft",
JOptionPane.INFORMATION_MESSAGE);
- dateChooserend.setDate(endDate); //setze Datum auf maximum
+
+ dateChooserend.setDate(endDate); // setze Datum auf
+ // maximum
} else {
// bereit
isDateMaxLifeTimeCorrect = true;
@@ -434,7 +454,8 @@ public class CreateLectureAllgemein_GUI extends JFrame {
// weiter
if (isAllInformationReady == true
&& isDateMaxLifeTimeCorrect == true
- && isDateOrderCorrect == true) {
+ && isDateOrderCorrect == true
+ && descriptionLenghtOK() == true) {
// everything is ok, proceed
Lecture.lecture.setName(txtFldVeranstaltungsname
.getText());
@@ -442,10 +463,11 @@ public class CreateLectureAllgemein_GUI extends JFrame {
Lecture.lecture.setEnddate(dateChooserend.getDate());
Lecture.lecture.setStartdate(dateChooserstart
.getDate());
+
Image.image.setImagename(txtFldVeranstaltungsname
.getText());
- CreateLectureLink_GUI ev = new CreateLectureLink_GUI();
+ PermissionCreateLecture_GUI ev = new PermissionCreateLecture_GUI();
ev.setVisible(true);
dispose();
}
@@ -485,15 +507,11 @@ public class CreateLectureAllgemein_GUI extends JFrame {
mntmFaq.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent arg0) {
-
OpenLinks open = new OpenLinks();
-
URI windows;
try {
windows = new URI(Links.getFAQ());
-
open.openWebpage(windows);
-
} catch (URISyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
@@ -501,7 +519,6 @@ public class CreateLectureAllgemein_GUI extends JFrame {
}
});
mnNewMenu_1.add(mntmFaq);
-
JMenuItem mntmOtrs = new JMenuItem("OTRS");
mntmOtrs.addMouseListener(new MouseAdapter() {
@@ -509,22 +526,19 @@ public class CreateLectureAllgemein_GUI extends JFrame {
public void mousePressed(MouseEvent arg0) {
OpenLinks open = new OpenLinks();
-
+
URI windows;
try {
windows = new URI(Links.getOTRS());
-
open.openWebpage(windows);
-
} catch (URISyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
-
}
});
mnNewMenu_1.add(mntmOtrs);
-
+
JMenuItem mnmtAbout = new JMenuItem("About");
mnmtAbout.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
@@ -541,5 +555,25 @@ public class CreateLectureAllgemein_GUI extends JFrame {
cal.setTime(date);
cal.add(Calendar.DATE, days); // minus number would decrement the days
return cal.getTime();
- }
-}
+ }// end addDays()
+
+ public boolean descriptionLenghtOK() {
+ descriptionLengthOK = false;
+
+ // max length is 254 chars
+ if (description.getText().length() >= MAX_DESCRIPTION_LENGTH) {
+ descriptionLengthOK = false;
+ JOptionPane.showMessageDialog(null,
+ "Die Beschreibung darf max 254 Zeichen enthalten. Aktuell enthält sie "
+ + description.getText().length() + ".",
+ "Beschreibung zu umfangreich",
+ JOptionPane.INFORMATION_MESSAGE);
+ } else {
+ descriptionLengthOK = true;
+
+ }
+
+ return descriptionLengthOK;
+ }// enddescriptionLenghtOK()
+
+}// end class
diff --git a/Dozentenmodul/src/main/java/gui/lecture/CreateLectureLink_GUI.java b/Dozentenmodul/src/main/java/gui/lecture/CreateLectureLink_GUI.java
index 0f30aa15..f4d1bdd8 100644
--- a/Dozentenmodul/src/main/java/gui/lecture/CreateLectureLink_GUI.java
+++ b/Dozentenmodul/src/main/java/gui/lecture/CreateLectureLink_GUI.java
@@ -18,10 +18,11 @@ import java.awt.event.WindowEvent;
import java.net.URI;
import java.net.URISyntaxException;
import java.text.DateFormat;
+import java.text.ParseException;
import java.text.SimpleDateFormat;
-import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
+import java.util.Map;
import javax.swing.JButton;
import javax.swing.JComboBox;
@@ -37,13 +38,17 @@ import javax.swing.JScrollPane;
import javax.swing.JSeparator;
import javax.swing.JTabbedPane;
import javax.swing.JTable;
+import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.JTextPane;
+import javax.swing.RowFilter;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.border.EmptyBorder;
import javax.swing.border.TitledBorder;
import javax.swing.table.DefaultTableModel;
+import javax.swing.table.TableModel;
+import javax.swing.table.TableRowSorter;
import models.Lecture;
import models.Links;
@@ -55,6 +60,10 @@ import server.Server.Client;
import thrift.ThriftConnection;
import util.GuiOrganizer;
import util.OpenLinks;
+import javax.swing.event.ChangeListener;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
@SuppressWarnings("serial")
public class CreateLectureLink_GUI extends JFrame {
@@ -64,17 +73,52 @@ public class CreateLectureLink_GUI extends JFrame {
JRadioButton rdbtnInternetJa;
JRadioButton rdbtnInternetNein;
JComboBox<String> comboBox;
+ JTabbedPane tabbedPane;
+ JLabel labelName;
+ JLabel labelUpdate;
+ JLabel labelVerantwortlicher;
+ JLabel labelWeitereVerantwortliche;
+ JLabel labelVorlage;
+ JLabel labelLizenzSoftware;
+ JLabel labelInternet;
+ JLabel labelRam;
+ JLabel labelCPU;
+ JLabel labelID;
+ JLabel labelVersion;
+ JTextArea textAreadesc;
+ private JLabel labelOS;
JTable tableAllImages = new JTable();
JTable tablemyImages = new JTable();
JTable tableCoopImages = new JTable();
- JTable tablePublicImages = new JTable();
JTable tablePublicVorlagen = new JTable();
+ boolean activeSearch=false;
private JTextField textFieldName;
String[] titles = { "Image-Name", "Lizenzpflichtig", "OS", "Veranstaltung",
- "Verantwortlicher", "Letztes Update", "Schlagwort" };
+ "Verantwortlicher", "Letztes Update", "ID", "Version","Template" };
ThriftConnection con = new ThriftConnection();
Client client = models.Client.clientcon.getClient();
-
+ final DefaultTableModel modelAll = new DefaultTableModel(titles, 0){
+ public boolean isCellEditable(int rowIndex, int mColIndex) {
+ return false;
+ }
+ };
+ final DefaultTableModel modelMyImages = new DefaultTableModel(titles, 0){
+ public boolean isCellEditable(int rowIndex, int mColIndex) {
+ return false;
+ }
+ };
+ final DefaultTableModel modelPublicVorlagen = new DefaultTableModel(titles, 0){
+ public boolean isCellEditable(int rowIndex, int mColIndex) {
+ return false;
+ }
+ };
+ final TableRowSorter<TableModel> rowSorterAll = new TableRowSorter<TableModel>(
+ modelAll);
+ final TableRowSorter<TableModel> rowSorterMyImages = new TableRowSorter<TableModel>(
+ modelMyImages);
+ final TableRowSorter<TableModel> rowSorterPublicVorlagen = new TableRowSorter<TableModel>(
+ modelPublicVorlagen);
+ private JTextField textField;
/**
* Create the dialog.
@@ -89,6 +133,71 @@ public class CreateLectureLink_GUI extends JFrame {
@Override
public void windowOpened(WindowEvent arg0) {
+ try {
+ initTableModel(modelMyImages);
+ initTableModel(modelAll);
+ initTableModel(modelPublicVorlagen);
+ } catch (TException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (ParseException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ // auszublendende Angaben
+ // 1=Lizenzpflichtig
+ // 3=Veranstaltung
+ // 6=ID
+ // 7=Version
+ // 8=Template
+ tablemyImages.getColumnModel().getColumn(1).setWidth(0);
+ tablemyImages.getColumnModel().getColumn(1).setMinWidth(0);
+ tablemyImages.getColumnModel().getColumn(1).setMaxWidth(0);
+ tablemyImages.getColumnModel().getColumn(3).setWidth(0);
+ tablemyImages.getColumnModel().getColumn(3).setMinWidth(0);
+ tablemyImages.getColumnModel().getColumn(3).setMaxWidth(0);
+ tablemyImages.getColumnModel().getColumn(8).setWidth(0);
+ tablemyImages.getColumnModel().getColumn(8).setMinWidth(0);
+ tablemyImages.getColumnModel().getColumn(8).setMaxWidth(0);
+ tablemyImages.getColumnModel().getColumn(6).setWidth(0);
+ tablemyImages.getColumnModel().getColumn(6).setMinWidth(0);
+ tablemyImages.getColumnModel().getColumn(6).setMaxWidth(0);
+ tablemyImages.getColumnModel().getColumn(7).setWidth(0);
+ tablemyImages.getColumnModel().getColumn(7).setMinWidth(0);
+ tablemyImages.getColumnModel().getColumn(7).setMaxWidth(0);
+
+ tablePublicVorlagen.getColumnModel().getColumn(1).setWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(1).setMinWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(1).setMaxWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(3).setWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(3).setMinWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(3).setMaxWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(8).setWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(8).setMinWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(8).setMaxWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(6).setWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(6).setMinWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(6).setMaxWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(7).setWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(7).setMinWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(7).setMaxWidth(0);
+
+ tableAllImages.getColumnModel().getColumn(1).setWidth(0);
+ tableAllImages.getColumnModel().getColumn(1).setMinWidth(0);
+ tableAllImages.getColumnModel().getColumn(1).setMaxWidth(0);
+ tableAllImages.getColumnModel().getColumn(3).setWidth(0);
+ tableAllImages.getColumnModel().getColumn(3).setMinWidth(0);
+ tableAllImages.getColumnModel().getColumn(3).setMaxWidth(0);
+ tableAllImages.getColumnModel().getColumn(8).setWidth(0);
+ tableAllImages.getColumnModel().getColumn(8).setMinWidth(0);
+ tableAllImages.getColumnModel().getColumn(8).setMaxWidth(0);
+ tableAllImages.getColumnModel().getColumn(6).setWidth(0);
+ tableAllImages.getColumnModel().getColumn(6).setMinWidth(0);
+ tableAllImages.getColumnModel().getColumn(6).setMaxWidth(0);
+ tableAllImages.getColumnModel().getColumn(7).setWidth(0);
+ tableAllImages.getColumnModel().getColumn(7).setMinWidth(0);
+ tableAllImages.getColumnModel().getColumn(7).setMaxWidth(0);
textFieldName.requestFocusInWindow();
}
});
@@ -101,18 +210,18 @@ public class CreateLectureLink_GUI extends JFrame {
// TODO Auto-generated catch block
e.printStackTrace();
}
- setTitle("bwLehrpool Suite *Prototyp* - Veranstaltung erzeugen");
- setBounds(0, 0, 603, 722);
+ setTitle("bwLehrpool Suite - Veranstaltung erzeugen");
+ setBounds(0, 0, 918, 722);
GuiOrganizer.centerGUI(this);
- final DefaultTableModel modelAll = new DefaultTableModel(titles, 0);
+
final DefaultTableModel model = new DefaultTableModel(titles, 0);
getContentPane().setLayout(null);
{
JPanel panel = new JPanel();
panel.setBackground(SystemColor.menu);
- panel.setBounds(10, 11, 577, 57);
+ panel.setBounds(10, 11, 892, 57);
getContentPane().add(panel);
panel.setLayout(null);
{
@@ -140,16 +249,16 @@ public class CreateLectureLink_GUI extends JFrame {
panel_1.setBackground(SystemColor.menu);
panel_1.setBorder(new TitledBorder(null, "Filterfunktionen",
TitledBorder.LEADING, TitledBorder.TOP, null, null));
- panel_1.setBounds(10, 49, 557, 131);
+ panel_1.setBounds(10, 49, 557, 92);
contentPanel.add(panel_1);
panel_1.setLayout(null);
JLabel lblNewLabel_2 = new JLabel("Anzeigename:");
- lblNewLabel_2.setBounds(10, 30, 250, 20);
+ lblNewLabel_2.setBounds(10, 30, 80, 20);
panel_1.add(lblNewLabel_2);
JLabel lblInternetIstInnerhalb = new JLabel("Betriebssystem:");
- lblInternetIstInnerhalb.setBounds(10, 58, 250, 20);
+ lblInternetIstInnerhalb.setBounds(10, 58, 80, 20);
panel_1.add(lblInternetIstInnerhalb);
textFieldName = new JTextField();
@@ -157,41 +266,36 @@ public class CreateLectureLink_GUI extends JFrame {
@Override
public void keyReleased(KeyEvent e) {
String stext = textFieldName.getText();
- modelAll.setRowCount(0);
- initTableModel(modelAll);
-
- if (stext != "")
- for (int i = 0; i < modelAll.getRowCount(); i++) {
-
- if (modelAll.getValueAt(i, 0).toString()
- .startsWith(stext)) {
-
- } else {
- modelAll.removeRow(i);
- }
- }
+ // Wenn Textfield nicht leer
+ if (stext != "") {
+ activeSearch=true;
+ // Filtere nach der Eingabe
+ rowSorterAll.setRowFilter(RowFilter.regexFilter(
+ textFieldName.getText(), 0));
+ rowSorterMyImages.setRowFilter(RowFilter.regexFilter(
+ textFieldName.getText(), 0));
+ rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter(
+ textFieldName.getText(), 0));
+
+ }else{
+ activeSearch=false;
+ String username = person.verantwortlicher.getName() + " "
+ + person.verantwortlicher.getVorname();
+ rowSorterMyImages.setRowFilter(RowFilter.regexFilter(
+ username, 4));
+ rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter(
+ "true", 8));
+ rowSorterAll.setRowFilter(null);
+ }
}
});
- textFieldName.setBounds(270, 30, 250, 20);
+ textFieldName.setBounds(96, 30, 166, 20);
panel_1.add(textFieldName);
textFieldName.setColumns(10);
- JLabel lblErweiterteSuche = new JLabel(
- "<html><u>Erweiterte Suche</u></html>");
- lblErweiterteSuche.addMouseListener(new MouseAdapter() {
- @Override
- public void mouseClicked(MouseEvent arg0) {
- ExtendedSearchForLectures_GUI es = new ExtendedSearchForLectures_GUI();
- es.setVisible(true);
- }
- });
- lblErweiterteSuche.setForeground(Color.BLUE);
-
- lblErweiterteSuche.setBounds(431, 106, 89, 14);
- panel_1.add(lblErweiterteSuche);
comboBox = new JComboBox<String>();
try {
@@ -204,29 +308,43 @@ public class CreateLectureLink_GUI extends JFrame {
// TODO Auto-generated catch block
e.printStackTrace();
JOptionPane.showMessageDialog(null,
- e.getCause()+"\n"+e.getMessage(),
+ e.getCause()+"\n"+e.getStackTrace(),
"Debug-Message", JOptionPane.ERROR_MESSAGE);
}
comboBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
- modelAll.setRowCount(0);
- initTableModel(modelAll);
- String selItem = comboBox.getSelectedItem().toString();
- if (selItem != "") {
- for (int i = 0; i < modelAll.getRowCount(); i++) {
-
- if (modelAll.getValueAt(i, 2).equals(selItem)) {
-
- } else {
- modelAll.removeRow(i);
- }
- }
-
+ // Prueft das die Auswahl nicht leer ist
+ if (comboBox.getSelectedItem().toString() != "") {
+ activeSearch=true;
+ rowSorterAll.setRowFilter(RowFilter.regexFilter(comboBox
+ .getSelectedItem().toString(), 2));
+ rowSorterMyImages.setRowFilter(RowFilter.regexFilter(
+ comboBox.getSelectedItem().toString(), 2));
+ rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter(
+ comboBox.getSelectedItem().toString(), 2));
+ }else{
+ activeSearch=false;
+ String username = person.verantwortlicher.getName() + " "
+ + person.verantwortlicher.getVorname();
+ rowSorterMyImages.setRowFilter(RowFilter.regexFilter(
+ username, 4));
+ rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter(
+ "true", 8));
+ rowSorterAll.setRowFilter(null);
}
}
});
- comboBox.setBounds(270, 58, 250, 20);
+ comboBox.setBounds(96, 58, 166, 20);
panel_1.add(comboBox);
+
+ JLabel label_3 = new JLabel("Beschreibung:");
+ label_3.setBounds(291, 30, 80, 20);
+ panel_1.add(label_3);
+
+ textField = new JTextField();
+ textField.setColumns(10);
+ textField.setBounds(381, 30, 166, 20);
+ panel_1.add(textField);
JLabel lblHauptmen = new JLabel("Hauptmen\u00FC");
lblHauptmen.addMouseListener(new MouseAdapter() {
@@ -259,31 +377,65 @@ public class CreateLectureLink_GUI extends JFrame {
lblNewLabel_1.setBounds(164, 11, 85, 14);
contentPanel.add(lblNewLabel_1);
- JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
+ tabbedPane = new JTabbedPane(JTabbedPane.TOP);
+ tabbedPane.addChangeListener(new ChangeListener() {
+ public void stateChanged(ChangeEvent arg0) {
+ if (tabbedPane.getSelectedIndex() == 0 && activeSearch==false) {
+
+ String username = person.verantwortlicher.getName() + " "
+ + person.verantwortlicher.getVorname();
+ rowSorterMyImages.setRowFilter(RowFilter.regexFilter(
+ username, 4));
+ }else if(tabbedPane.getSelectedIndex()==1 && activeSearch==false){
+ rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter("true", 8));
+ } else if(tabbedPane.getSelectedIndex()==2 && activeSearch==false){
+ rowSorterAll.setRowFilter(null);
+ }
- tabbedPane.setBounds(10, 197, 557, 300);
+ }
+
+ });
+
+ tabbedPane.setBounds(10, 152, 557, 345);
contentPanel.add(tabbedPane);
JScrollPane scrollPaneMyImage = new JScrollPane();
-
- tablemyImages.setModel(model);
+ tablemyImages.getSelectionModel().addListSelectionListener( new ListSelectionListener()
+ {
+ public void valueChanged(ListSelectionEvent e)
+ {
+ String imageid = modelMyImages
+ .getValueAt(
+ tablemyImages
+ .convertRowIndexToModel(tablemyImages
+ .getSelectedRow()), 6)
+ .toString();
+ //System.out.println(imageid);
+ String version = modelMyImages
+ .getValueAt(
+ tablemyImages
+ .convertRowIndexToModel(tablemyImages
+ .getSelectedRow()), 7)
+ .toString();
+ //System.out.println(version);
+ try {
+ writeImageData(imageid, version);
+ } catch (TException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ } catch (ParseException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ }
+ });
+ tablemyImages.setModel(modelMyImages);
tablemyImages.getColumnModel().getColumn(1).sizeWidthToFit();
tablemyImages.getColumnModel().getColumn(2).sizeWidthToFit();
tablemyImages.getColumnModel().getColumn(3).sizeWidthToFit();
tablemyImages.getColumnModel().getColumn(4).sizeWidthToFit();
tablemyImages.getColumnModel().getColumn(5).sizeWidthToFit();
-
- JScrollPane scrollPaneAllImages = new JScrollPane();
- tableAllImages = new JTable();
- tableAllImages.setModel(modelAll);
- tableAllImages.getColumnModel().getColumn(1).sizeWidthToFit();
- tableAllImages.getColumnModel().getColumn(2).sizeWidthToFit();
- tableAllImages.getColumnModel().getColumn(3).sizeWidthToFit();
- tableAllImages.getColumnModel().getColumn(4).sizeWidthToFit();
- tableAllImages.getColumnModel().getColumn(5).sizeWidthToFit();
-
- scrollPaneAllImages.setViewportView(tableAllImages);
- tabbedPane.addTab("Alle", null, scrollPaneAllImages, null);
+ tablemyImages.setRowSorter(rowSorterMyImages);
scrollPaneMyImage.setViewportView(tablemyImages);
tabbedPane.addTab("Meine Images", null, scrollPaneMyImage, null);
@@ -297,43 +449,102 @@ public class CreateLectureLink_GUI extends JFrame {
tableCoopImages.getColumnModel().getColumn(4).sizeWidthToFit();
tableCoopImages.getColumnModel().getColumn(5).sizeWidthToFit();
- scrollPaneCoopImages.setViewportView(tableCoopImages);
- tabbedPane.addTab("Kooperative Images", null, scrollPaneCoopImages,
- null);
- tabbedPane.setEnabledAt(2, false);
-
- JScrollPane scrollPanePublicImages = new JScrollPane();
+
+ JScrollPane scrollPanePublicVorlagen = new JScrollPane();
+ tablePublicVorlagen.getSelectionModel().addListSelectionListener( new ListSelectionListener()
+ {
+ public void valueChanged(ListSelectionEvent e)
+ {
+ String imageid = modelPublicVorlagen
+ .getValueAt(
+ tablePublicVorlagen
+ .convertRowIndexToModel(tablePublicVorlagen
+ .getSelectedRow()), 6)
+ .toString();
+ //System.out.println(imageid);
+ String version = modelPublicVorlagen
+ .getValueAt(
+ tablePublicVorlagen
+ .convertRowIndexToModel(tablePublicVorlagen
+ .getSelectedRow()), 7)
+ .toString();
+ //System.out.println(version);
+ try {
+ writeImageData(imageid, version);
+ } catch (TException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ } catch (ParseException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ }
+ });
+ tablePublicVorlagen.setModel(modelPublicVorlagen);
+ tablePublicVorlagen.getColumnModel().getColumn(1).sizeWidthToFit();
+ tablePublicVorlagen.getColumnModel().getColumn(2).sizeWidthToFit();
+ tablePublicVorlagen.getColumnModel().getColumn(3).sizeWidthToFit();
+ tablePublicVorlagen.getColumnModel().getColumn(4).sizeWidthToFit();
+ tablePublicVorlagen.getColumnModel().getColumn(5).sizeWidthToFit();
+ tablePublicVorlagen.setRowSorter(rowSorterPublicVorlagen);
+ scrollPanePublicVorlagen.setViewportView(tablePublicVorlagen);
+ tabbedPane.addTab("Vorlagen", null,
+ scrollPanePublicVorlagen, null);
+
+ JScrollPane scrollPaneAllImages = new JScrollPane();
+ tableAllImages = new JTable();
+ tableAllImages.getSelectionModel().addListSelectionListener( new ListSelectionListener()
+ {
+ public void valueChanged(ListSelectionEvent e)
+ {
+
+ String imageid = modelAll
+ .getValueAt(
+ tableAllImages
+ .convertRowIndexToModel(tableAllImages
+ .getSelectedRow()), 6)
+ .toString();
+ //System.out.println(imageid);
+ String version = modelAll
+ .getValueAt(
+ tableAllImages
+ .convertRowIndexToModel(tableAllImages
+ .getSelectedRow()), 7)
+ .toString();
+ //System.out.println(version);
+ try {
+ writeImageData(imageid, version);
+ } catch (TException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ } catch (ParseException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
- tablePublicImages.setModel(model);
- tablePublicImages.getColumnModel().getColumn(1).sizeWidthToFit();
- tablePublicImages.getColumnModel().getColumn(2).sizeWidthToFit();
- tablePublicImages.getColumnModel().getColumn(3).sizeWidthToFit();
- tablePublicImages.getColumnModel().getColumn(4).sizeWidthToFit();
- tablePublicImages.getColumnModel().getColumn(5).sizeWidthToFit();
+ }
+ });
+ tableAllImages.setModel(modelAll);
+ tableAllImages.getColumnModel().getColumn(1).sizeWidthToFit();
+ tableAllImages.getColumnModel().getColumn(2).sizeWidthToFit();
+ tableAllImages.getColumnModel().getColumn(3).sizeWidthToFit();
+ tableAllImages.getColumnModel().getColumn(4).sizeWidthToFit();
+ tableAllImages.getColumnModel().getColumn(5).sizeWidthToFit();
+ tableAllImages.setRowSorter(rowSorterAll);
+
+ scrollPaneAllImages.setViewportView(tableAllImages);
+ tabbedPane.addTab("Alle", null, scrollPaneAllImages, null);
+
+
- scrollPanePublicImages.setViewportView(tablePublicImages);
- tabbedPane.addTab("\u00D6ffentliche Images", null,
- scrollPanePublicImages, null);
+ scrollPaneCoopImages.setViewportView(tableCoopImages);
+ tabbedPane.addTab("bwLehrpool", null, scrollPaneCoopImages,
+ null);
tabbedPane.setEnabledAt(3, false);
- JScrollPane scrollPanePublicVorlagen = new JScrollPane();
-
- tablePublicVorlagen.setModel(model);
- tablePublicVorlagen.getColumnModel().getColumn(1).sizeWidthToFit();
- tablePublicVorlagen.getColumnModel().getColumn(2).sizeWidthToFit();
- tablePublicVorlagen.getColumnModel().getColumn(3).sizeWidthToFit();
- tablePublicVorlagen.getColumnModel().getColumn(4).sizeWidthToFit();
- tablePublicVorlagen.getColumnModel().getColumn(5).sizeWidthToFit();
-
- scrollPanePublicVorlagen.setViewportView(tablePublicVorlagen);
- tabbedPane.addTab("\u00D6ffentliche Vorlagen", null,
- scrollPanePublicVorlagen, null);
- tabbedPane.setEnabledAt(4, false);
-
- initTableModel(modelAll);
{
JPanel buttonPane = new JPanel();
- buttonPane.setBounds(0, 640, 597, 33);
+ buttonPane.setBounds(0, 640, 902, 33);
buttonPane.setBackground(SystemColor.menu);
buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
getContentPane().add(buttonPane);
@@ -342,7 +553,7 @@ public class CreateLectureLink_GUI extends JFrame {
cancelButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
- CreateLectureAllgemein_GUI eVAG = new CreateLectureAllgemein_GUI();
+ PermissionCreateLecture_GUI eVAG = new PermissionCreateLecture_GUI();
eVAG.setVisible(true);
dispose();
}
@@ -356,13 +567,118 @@ public class CreateLectureLink_GUI extends JFrame {
"Veranstaltung erzeugen und abschlie\u00DFen");
doLinkButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
-
+ String username = person.verantwortlicher.getName() + " "
+ + person.verantwortlicher.getVorname();
// check if a row is selected
- if ((tableAllImages.getSelectedRow() != -1)
- || (tablemyImages.getSelectedRow() != -1)
- || (tableCoopImages.getSelectedRow() != -1)
- || (tablePublicImages.getSelectedRow() != -1)
- || (tablePublicVorlagen.getSelectedRow() != -1)) {
+ if (tablemyImages.getSelectedRow() != -1){
+
+ // a row is selected, do operations
+ String imagename = tablemyImages.getValueAt(
+ tablemyImages.getSelectedRow(), 0)
+ .toString();
+ try {
+ DateFormat formatter = new SimpleDateFormat(
+ "yyyy-MM-dd HH:mm:ss");
+ client.writeLecturedata(
+ Lecture.lecture.getName(),
+ Lecture.lecture.getShortDesc(),
+ Lecture.lecture.getDesc(),
+ formatter.format(
+ Lecture.lecture.getStartdate())
+ .toString(),
+ formatter.format(
+ Lecture.lecture.getEnddate())
+ .toString(),
+ Lecture.lecture.isActive(),
+ imagename,
+ person.verantwortlicher.getUsername(),
+ person.verantwortlicher.getVorname(),
+ person.verantwortlicher.getName(),
+ person.verantwortlicher.getHochschule(),
+ person.verantwortlicher.getEMail(),
+ person.verantwortlicher.getTel(),
+ person.verantwortlicher.getFakultaet());
+ client.writeLectureRights(Lecture.lecture.getName(), person.verantwortlicher.getUsername(), person.verantwortlicher.getName(), person.verantwortlicher.getVorname(), person.verantwortlicher.getEMail(), person.verantwortlicher.getHochschule(), person.verantwortlicher.getRole());
+ JOptionPane
+ .showMessageDialog(
+ null,
+ "Ihre Veranstaltung wurde erfolgreich angelegt. Sie kehren nun zum Hauptmen\u00fc zur\u00fcck.",
+ "Veranstaltung angelegt",
+ JOptionPane.INFORMATION_MESSAGE);
+ // zurueck zum Menue
+ MainMenue_GUI m = new MainMenue_GUI();
+ m.setVisible(true);
+ } catch (TException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ JOptionPane
+ .showMessageDialog(
+ null,
+ "Beim Anlegen Ihrer Veranstaltung ist ein Fehler aufgetreten.",
+ "Error",
+ JOptionPane.ERROR_MESSAGE);
+ JOptionPane.showMessageDialog(null,
+ e1.getCause()+"\n"+e1.getStackTrace(),
+ "Debug-Message", JOptionPane.ERROR_MESSAGE);
+ }
+
+ dispose();
+
+ }else if (tablePublicVorlagen.getSelectedRow() != -1){
+
+ // a row is selected, do operations
+ String imagename = tablePublicVorlagen.getValueAt(
+ tablePublicVorlagen.getSelectedRow(), 0)
+ .toString();
+ try {
+ DateFormat formatter = new SimpleDateFormat(
+ "yyyy-MM-dd hh:mm:ss");
+ client.writeLecturedata(
+ Lecture.lecture.getName(),
+ Lecture.lecture.getShortDesc(),
+ Lecture.lecture.getDesc(),
+ formatter.format(
+ Lecture.lecture.getStartdate())
+ .toString(),
+ formatter.format(
+ Lecture.lecture.getEnddate())
+ .toString(),
+ Lecture.lecture.isActive(),
+ imagename,
+ person.verantwortlicher.getUsername(),
+ person.verantwortlicher.getVorname(),
+ person.verantwortlicher.getName(),
+ person.verantwortlicher.getHochschule(),
+ person.verantwortlicher.getEMail(),
+ person.verantwortlicher.getTel(),
+ person.verantwortlicher.getFakultaet());
+ client.writeLectureRights(Lecture.lecture.getName(), person.verantwortlicher.getUsername(), person.verantwortlicher.getName(), person.verantwortlicher.getVorname(), person.verantwortlicher.getEMail(), person.verantwortlicher.getHochschule(), person.verantwortlicher.getRole());
+ JOptionPane
+ .showMessageDialog(
+ null,
+ "Ihre Veranstaltung wurde erfolgreich angelegt. Sie kehren nun zum Hauptmen\u00fc zur\u00fcck.",
+ "Veranstaltung angelegt",
+ JOptionPane.INFORMATION_MESSAGE);
+ // zurueck zum Menue
+ MainMenue_GUI m = new MainMenue_GUI();
+ m.setVisible(true);
+ } catch (TException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ JOptionPane
+ .showMessageDialog(
+ null,
+ "Beim Anlegen Ihrer Veranstaltung ist ein Fehler aufgetreten.",
+ "Error",
+ JOptionPane.ERROR_MESSAGE);
+ JOptionPane.showMessageDialog(null,
+ e1.getCause()+"\n"+e1.getStackTrace(),
+ "Debug-Message", JOptionPane.ERROR_MESSAGE);
+ }
+
+ dispose();
+
+ }else if (tableAllImages.getSelectedRow() != -1 &&tableAllImages.getValueAt(tableAllImages.getSelectedRow(), 4).toString().equals(username)){
// a row is selected, do operations
String imagename = tableAllImages.getValueAt(
@@ -390,6 +706,7 @@ public class CreateLectureLink_GUI extends JFrame {
person.verantwortlicher.getEMail(),
person.verantwortlicher.getTel(),
person.verantwortlicher.getFakultaet());
+ client.writeLectureRights(Lecture.lecture.getName(), person.verantwortlicher.getUsername(), person.verantwortlicher.getName(), person.verantwortlicher.getVorname(), person.verantwortlicher.getEMail(), person.verantwortlicher.getHochschule(), person.verantwortlicher.getRole());
JOptionPane
.showMessageDialog(
null,
@@ -409,13 +726,14 @@ public class CreateLectureLink_GUI extends JFrame {
"Error",
JOptionPane.ERROR_MESSAGE);
JOptionPane.showMessageDialog(null,
- e1.getCause()+"\n"+e1.getMessage(),
+ e1.getCause()+"\n"+e1.getStackTrace(),
"Debug-Message", JOptionPane.ERROR_MESSAGE);
}
dispose();
- } else {
+ }
+ else {
// nothing selected
JOptionPane.showMessageDialog(null,
"Bitte w\u00e4hlen Sie ein Image aus.",
@@ -431,21 +749,138 @@ public class CreateLectureLink_GUI extends JFrame {
}
JSeparator separator = new JSeparator();
- separator.setBounds(0, 78, 597, 2);
+ separator.setBounds(0, 79, 912, 1);
getContentPane().add(separator);
JSeparator separator_1 = new JSeparator();
- separator_1.setBounds(0, 627, 597, 2);
+ separator_1.setBounds(0, 627, 912, 2);
getContentPane().add(separator_1);
+ JPanel panel = new JPanel();
+ panel.setLayout(null);
+ panel.setBorder(new TitledBorder(null, "Detailinformationen",
+
+ TitledBorder.LEADING, TitledBorder.TOP, null, null));
+ panel.setBackground(SystemColor.menu);
+ panel.setBounds(586, 85, 316, 531);
+ getContentPane().add(panel);
+
+ JLabel lblName = new JLabel("Name:");
+ lblName.setBounds(10, 87, 130, 14);
+ panel.add(lblName);
+
+ labelName = new JLabel("");
+ labelName.setBounds(10, 102, 296, 14);
+ panel.add(labelName);
+
+ JLabel lblVerantwortlicher = new JLabel("Verantwortlicher:");
+ lblVerantwortlicher.setBounds(10, 259, 130, 14);
+ panel.add(lblVerantwortlicher);
+
+ labelOS = new JLabel("");
+ labelOS.setBounds(10, 216, 296, 14);
+ panel.add(labelOS);
+
+ JLabel lblWeitereVerantwortliche = new JLabel("Betriebssystem:");
+ lblWeitereVerantwortliche.setBounds(10, 202, 130, 14);
+ panel.add(lblWeitereVerantwortliche);
+
+ labelVerantwortlicher = new JLabel("");
+ labelVerantwortlicher.setBounds(10, 272, 296, 14);
+ panel.add(labelVerantwortlicher);
+
+ JLabel label = new JLabel("Weitere Verantwortliche:");
+ label.setBounds(10, 284, 130, 14);
+ panel.add(label);
+
+ labelWeitereVerantwortliche = new JLabel("");
+ labelWeitereVerantwortliche.setBounds(10, 297, 296, 14);
+ panel.add(labelWeitereVerantwortliche);
+
+ labelUpdate = new JLabel("");
+ labelUpdate.setBounds(10, 245, 296, 14);
+ panel.add(labelUpdate);
+
+ JLabel lblLetztesUpdate = new JLabel("Letztes Update:");
+ lblLetztesUpdate.setBounds(10, 231, 130, 14);
+ panel.add(lblLetztesUpdate);
+
+ JLabel lblImageIstVorlage = new JLabel("Image ist Vorlage:");
+ lblImageIstVorlage.setBounds(10, 336, 130, 14);
+ panel.add(lblImageIstVorlage);
+
+ labelVorlage = new JLabel("");
+ labelVorlage.setBounds(10, 350, 296, 14);
+ panel.add(labelVorlage);
+
+ labelLizenzSoftware = new JLabel("");
+ labelLizenzSoftware.setBounds(10, 383, 296, 14);
+ panel.add(labelLizenzSoftware);
+
+ JLabel lblLizenzpflichtigeSoftware = new JLabel("Lizenzpflichtige Software:");
+ lblLizenzpflichtigeSoftware.setBounds(10, 367, 130, 14);
+ panel.add(lblLizenzpflichtigeSoftware);
+
+ JLabel lblInternet = new JLabel("Internetsperre vorhanden:");
+ lblInternet.setBounds(10, 400, 130, 14);
+ panel.add(lblInternet);
+
+ labelInternet = new JLabel("");
+ labelInternet.setBounds(10, 417, 296, 14);
+ panel.add(labelInternet);
+
+ JLabel lblEmpfehlungRam = new JLabel("Empfehlung RAM:");
+ lblEmpfehlungRam.setBounds(10, 432, 130, 14);
+ panel.add(lblEmpfehlungRam);
+
+ labelRam = new JLabel("");
+ labelRam.setBounds(10, 455, 296, 14);
+ panel.add(labelRam);
+
+ JLabel lblEmpfehlungCpu = new JLabel("Empfehlung CPU:");
+ lblEmpfehlungCpu.setBounds(10, 469, 130, 14);
+ panel.add(lblEmpfehlungCpu);
+
+ labelCPU = new JLabel("");
+ labelCPU.setBounds(10, 487, 296, 14);
+ panel.add(labelCPU);
+
+ JLabel lblTechnischeDaten = new JLabel("Technische Daten:");
+ lblTechnischeDaten.setBounds(10, 322, 296, 14);
+ panel.add(lblTechnischeDaten);
+
+ JLabel lblId = new JLabel("ID:");
+ lblId.setBounds(10, 23, 296, 14);
+ panel.add(lblId);
+
+ labelID = new JLabel("");
+ labelID.setBounds(10, 37, 296, 14);
+ panel.add(labelID);
+
+ labelVersion = new JLabel("");
+ labelVersion.setBounds(10, 73, 296, 14);
+ panel.add(labelVersion);
+
+ JLabel lblVersion = new JLabel("Version:");
+ lblVersion.setBounds(10, 57, 296, 14);
+ panel.add(lblVersion);
+
+ JLabel lblBeschreibung = new JLabel("Beschreibung:");
+ lblBeschreibung.setBounds(10, 119, 130, 14);
+ panel.add(lblBeschreibung);
+
+ JScrollPane scrollPane = new JScrollPane();
+ scrollPane.setBounds(10, 135, 296, 65);
+ panel.add(scrollPane);
+
+ textAreadesc = new JTextArea();
+ textAreadesc.setLineWrap(true);
+ textAreadesc.setBackground(SystemColor.menu);
+ scrollPane.setViewportView(textAreadesc);
+
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);
@@ -505,36 +940,74 @@ public class CreateLectureLink_GUI extends JFrame {
}
- public DefaultTableModel initTableModel(DefaultTableModel model) {
+ // Initiale Beffuelung eines Table models
+ public DefaultTableModel initTableModel(DefaultTableModel model) throws TException, ParseException {
List<server.Image> images;
- try {
+
+ // Hole eine Liste der Images
images = client.getImageList();
+
Iterator<server.Image> i = images.iterator();
- List<Object[]> ListObj = new ArrayList<Object[]>();
+ SimpleDateFormat in=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
+ SimpleDateFormat out=new SimpleDateFormat("dd.MM.yyyy hh:mm:ss");
int x = 0;
while (i.hasNext()) {
-
- i.next();
+ // erzeuge Objekte fuer die Tabelle
Object[] obj = { images.get(x).getImageName(),
images.get(x).getLicenseRestriction(),
images.get(x).getOsName(),
images.get(x).getLectureName(),
images.get(x).getUserData(),
- images.get(x).getUpdateTime()
- };
- ListObj.add(obj);
- model.addRow(ListObj.get(x));
+ out.format(in.parse(images.get(x).updateTime)), images.get(x).id,
+ images.get(x).getVersion(),
+ images.get(x).getIsTemplate()};
+ // Fuege diese Objekte der Tabelle hinzu
+
+ model.addRow(obj);
x++;
+ i.next();
}
return model;
- } catch (TException e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
- }
- return model;
+
+
}
+ public void writeImageData(String id, String version) throws TException, ParseException{
+
+ SimpleDateFormat in=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
+ SimpleDateFormat out=new SimpleDateFormat("dd.MM.yyyy hh:mm:ss");
+ Map<String,String> res=client.getImageData(id,version);
+ labelName.setText(res.get("name"));
+ labelOS.setText(res.get("os"));
+ labelUpdate.setText(out.format(in.parse(res.get("lastupdate"))));
+ labelVerantwortlicher.setText(res.get("owner"));
+ labelWeitereVerantwortliche.setText("Noch nicht Verf�gbar");
+ if(res.get("template").equals("true")){
+ labelVorlage.setText("Ja");
+ }else{
+ labelVorlage.setText("Nein");
+ }
+ if(res.get("license").equals("1")){
+ labelLizenzSoftware.setText("Ja");
+ }
+ else
+ {
+ labelLizenzSoftware.setText("Nein");
+ }
+ if(res.get("internet").equals("1")){
+ labelInternet.setText("Ja");
+ }
+ else
+ {
+ labelInternet.setText("Nein");
+ }
+ labelRam.setText(res.get("ram"));
+ labelCPU.setText(res.get("cpu"));
+ labelID.setText(res.get("id"));
+ labelVersion.setText(res.get("version"));
+ textAreadesc.setText(res.get("desc"));
+ }
}
diff --git a/Dozentenmodul/src/main/java/gui/lecture/DeleteLecture_GUI.java b/Dozentenmodul/src/main/java/gui/lecture/DeleteLecture_GUI.java
index c638e440..ffadde1c 100644
--- a/Dozentenmodul/src/main/java/gui/lecture/DeleteLecture_GUI.java
+++ b/Dozentenmodul/src/main/java/gui/lecture/DeleteLecture_GUI.java
@@ -17,8 +17,11 @@ import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.net.URI;
import java.net.URISyntaxException;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
import java.util.Iterator;
import java.util.List;
+import java.util.Map;
import javax.swing.JButton;
import javax.swing.JFrame;
@@ -33,15 +36,19 @@ import javax.swing.JScrollPane;
import javax.swing.JSeparator;
import javax.swing.JTabbedPane;
import javax.swing.JTable;
+import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.JTextPane;
import javax.swing.RowFilter;
+import javax.swing.ScrollPaneConstants;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.border.EmptyBorder;
import javax.swing.border.TitledBorder;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;
import javax.swing.table.TableRowSorter;
@@ -63,13 +70,19 @@ public class DeleteLecture_GUI extends JFrame {
String[] result;
JRadioButton rdbtnInternetJa;
JRadioButton rdbtnInternetNein;
+ JLabel labelAktiv;
+ JLabel labelstartdate;
+ JLabel labelenddate;
+ JLabel labelimageversion;
+ JTextArea labelName;
+ JTextArea labelimage;
+ JTextArea labeldesc;
+ JLabel labelVerantwortlicher;
JTable tableAllLectures;
JTable tablemyLectures;
- JTable tableCoopImages;
- JTable tablePublicVorlagen;
- JTable tablePublicImages;
private JTextField textFieldName;
JTabbedPane tabbedPane;
+ boolean activeSearch=false;
String[] titles = { "Veranstaltungsname", "Beschreibung",
"G\u00fcltigkeitsdatum", "Aktiv", "Letzte Benutzung",
"Verantwortlicher", "Image", "Schlagwort", "ID" };
@@ -82,6 +95,7 @@ public class DeleteLecture_GUI extends JFrame {
final TableRowSorter<TableModel> rowSorterMyLectures = new TableRowSorter<TableModel>(
modelMyLectures);
private JButton button;
+ private JTextField textField;
/**
@@ -95,6 +109,63 @@ public class DeleteLecture_GUI extends JFrame {
con.closeThriftConnection();
System.exit(0);
}
+ @Override
+ public void windowOpened(WindowEvent arg0) {
+ textFieldName.requestFocusInWindow();
+ try {
+ initTableModel(modelMyLectures);
+ initTableModel(modelAll);
+
+ } catch (ParseException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ // auszublendende Angaben
+ // 1=Beschreibung
+ // 2=G\u00fcltigkeitsdatum
+ // 3=Aktiv
+ // 6=Image
+ // 7=Schlagwort
+ // 8=ID
+ tablemyLectures.getColumnModel().getColumn(1).setWidth(0);
+ tablemyLectures.getColumnModel().getColumn(1).setMinWidth(0);
+ tablemyLectures.getColumnModel().getColumn(1).setMaxWidth(0);
+ tablemyLectures.getColumnModel().getColumn(2).setWidth(0);
+ tablemyLectures.getColumnModel().getColumn(2).setMinWidth(0);
+ tablemyLectures.getColumnModel().getColumn(2).setMaxWidth(0);
+ tablemyLectures.getColumnModel().getColumn(3).setWidth(0);
+ tablemyLectures.getColumnModel().getColumn(3).setMinWidth(0);
+ tablemyLectures.getColumnModel().getColumn(3).setMaxWidth(0);
+ tablemyLectures.getColumnModel().getColumn(6).setWidth(0);
+ tablemyLectures.getColumnModel().getColumn(6).setMinWidth(0);
+ tablemyLectures.getColumnModel().getColumn(6).setMaxWidth(0);
+ tablemyLectures.getColumnModel().getColumn(7).setWidth(0);
+ tablemyLectures.getColumnModel().getColumn(7).setMinWidth(0);
+ tablemyLectures.getColumnModel().getColumn(7).setMaxWidth(0);
+ tablemyLectures.getColumnModel().getColumn(8).setWidth(0);
+ tablemyLectures.getColumnModel().getColumn(8).setMinWidth(0);
+ tablemyLectures.getColumnModel().getColumn(8).setMaxWidth(0);
+
+ tableAllLectures.getColumnModel().getColumn(1).setWidth(0);
+ tableAllLectures.getColumnModel().getColumn(1).setMinWidth(0);
+ tableAllLectures.getColumnModel().getColumn(1).setMaxWidth(0);
+ tableAllLectures.getColumnModel().getColumn(2).setWidth(0);
+ tableAllLectures.getColumnModel().getColumn(2).setMinWidth(0);
+ tableAllLectures.getColumnModel().getColumn(2).setMaxWidth(0);
+ tableAllLectures.getColumnModel().getColumn(3).setWidth(0);
+ tableAllLectures.getColumnModel().getColumn(3).setMinWidth(0);
+ tableAllLectures.getColumnModel().getColumn(3).setMaxWidth(0);
+ tableAllLectures.getColumnModel().getColumn(6).setWidth(0);
+ tableAllLectures.getColumnModel().getColumn(6).setMinWidth(0);
+ tableAllLectures.getColumnModel().getColumn(6).setMaxWidth(0);
+ tableAllLectures.getColumnModel().getColumn(7).setWidth(0);
+ tableAllLectures.getColumnModel().getColumn(7).setMinWidth(0);
+ tableAllLectures.getColumnModel().getColumn(7).setMaxWidth(0);
+ tableAllLectures.getColumnModel().getColumn(8).setWidth(0);
+ tableAllLectures.getColumnModel().getColumn(8).setMinWidth(0);
+ tableAllLectures.getColumnModel().getColumn(8).setMaxWidth(0);
+ }
});
// Verhindert das Vergroessern Des Fensters
setResizable(false);
@@ -108,18 +179,17 @@ public class DeleteLecture_GUI extends JFrame {
e.printStackTrace();
}
// Setzt den Fenstertitel
- setTitle("bwLehrpool Suite *Prototyp* - Veranstaltung l\u00F6schen");
+ setTitle("bwLehrpool Suite - Veranstaltung l\u00F6schen");
// Zentriert das Fenster in die Bildmitte
- setBounds(0, 0, 603, 722);
+ setBounds(0, 0, 842, 722);
GuiOrganizer.centerGUI(this);
- final DefaultTableModel model = new DefaultTableModel(titles, 0);
getContentPane().setLayout(null);
{
JPanel panel = new JPanel();
panel.setBackground(SystemColor.menu);
- panel.setBounds(10, 11, 577, 57);
+ panel.setBounds(10, 11, 816, 57);
getContentPane().add(panel);
panel.setLayout(null);
{
@@ -138,7 +208,7 @@ public class DeleteLecture_GUI extends JFrame {
txtpnBitteWhlenSie.setBounds(10, 36, 509, 32);
panel.add(txtpnBitteWhlenSie);
}
- contentPanel.setBounds(10, 85, 577, 531);
+ contentPanel.setBounds(10, 85, 570, 518);
contentPanel.setBackground(SystemColor.menu);
contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
getContentPane().add(contentPanel);
@@ -148,12 +218,12 @@ public class DeleteLecture_GUI extends JFrame {
panel_1.setBackground(SystemColor.menu);
panel_1.setBorder(new TitledBorder(null, "Filterfunktionen",
TitledBorder.LEADING, TitledBorder.TOP, null, null));
- panel_1.setBounds(10, 49, 557, 131);
+ panel_1.setBounds(10, 49, 557, 64);
contentPanel.add(panel_1);
panel_1.setLayout(null);
- JLabel lblNewLabel_2 = new JLabel("Anzeigename:");
- lblNewLabel_2.setBounds(10, 30, 250, 20);
+ JLabel lblNewLabel_2 = new JLabel("Name:");
+ lblNewLabel_2.setBounds(10, 30, 80, 20);
panel_1.add(lblNewLabel_2);
textFieldName = new JTextField();
@@ -163,38 +233,38 @@ public class DeleteLecture_GUI extends JFrame {
public void keyReleased(KeyEvent e) {
// Textfield eingabe auslesen
String stext = textFieldName.getText();
-
// Wenn Textfield nicht leer
if (stext != "") {
+ activeSearch=true;
// Filtere nach der Eingabe
rowSorterAll.setRowFilter(RowFilter.regexFilter(
textFieldName.getText(), 0));
rowSorterMyLectures.setRowFilter(RowFilter.regexFilter(
textFieldName.getText(), 0));
+ }else{
+ activeSearch=false;
+ String username = person.verantwortlicher.getName() + " "
+ + person.verantwortlicher.getVorname();
+ rowSorterMyLectures.setRowFilter(RowFilter.regexFilter(
+ username, 5));
+ rowSorterAll.setRowFilter(null);
}
}
});
- textFieldName.setBounds(270, 30, 250, 20);
+ textFieldName.setBounds(96, 30, 166, 20);
panel_1.add(textFieldName);
textFieldName.setColumns(10);
-
- JLabel lblErweiterteSuche = new JLabel(
- "<html><u>Erweiterte Suche*Folgt noch*</u></html>");
- lblErweiterteSuche.addMouseListener(new MouseAdapter() {
- @Override
- public void mouseClicked(MouseEvent arg0) {
- // oeffnet das Fenster Extended GUI
-
- //ExtendedSearchForImages_GUI es = new ExtendedSearchForImages_GUI();
- //es.setVisible(true);
- }
- });
- lblErweiterteSuche.setForeground(Color.BLUE);
-
- lblErweiterteSuche.setBounds(336, 106, 184, 14);
- panel_1.add(lblErweiterteSuche);
+
+ JLabel label = new JLabel("Beschreibung:");
+ label.setBounds(291, 30, 80, 20);
+ panel_1.add(label);
+
+ textField = new JTextField();
+ textField.setColumns(10);
+ textField.setBounds(381, 30, 166, 20);
+ panel_1.add(textField);
JLabel lblHauptmen = new JLabel("Hauptmen\u00FC");
lblHauptmen.addMouseListener(new MouseAdapter() {
@@ -224,7 +294,7 @@ public class DeleteLecture_GUI extends JFrame {
label_2.setBounds(152, 11, 13, 14);
contentPanel.add(label_2);
- JLabel lblNewLabel_1 = new JLabel("Veranstaltungsauswahl");
+ JLabel lblNewLabel_1 = new JLabel("Veranstaltung l\u00F6schen");
lblNewLabel_1.setBounds(166, 11, 128, 14);
contentPanel.add(lblNewLabel_1);
@@ -238,28 +308,73 @@ public class DeleteLecture_GUI extends JFrame {
rowSorterMyLectures.setRowFilter(RowFilter.regexFilter(
username, 5));
} else if (tabbedPane.getSelectedIndex() == 1) {
-
+ rowSorterAll.setRowFilter(null);
}
}
});
- tabbedPane.setBounds(10, 197, 557, 300);
+ tabbedPane.setBounds(10, 123, 557, 397);
contentPanel.add(tabbedPane);
- initTableModel(modelMyLectures);
+
JScrollPane scrollPaneAllImages = new JScrollPane();
tableAllLectures = new JTable();
+ tableAllLectures.getSelectionModel().addListSelectionListener( new ListSelectionListener()
+ {
+ public void valueChanged(ListSelectionEvent e)
+ {
+ String imageid = modelAll
+ .getValueAt(
+ tableAllLectures
+ .convertRowIndexToModel(tableAllLectures
+ .getSelectedRow()), 8)
+ .toString();
+ //System.out.println(imageid);
+
+ try {
+ writeLectureData(imageid);
+ } catch (TException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ } catch (ParseException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ }
+ });
tableAllLectures.setModel(modelAll);
tableAllLectures.getColumnModel().getColumn(1).sizeWidthToFit();
tableAllLectures.getColumnModel().getColumn(2).sizeWidthToFit();
tableAllLectures.getColumnModel().getColumn(3).sizeWidthToFit();
tableAllLectures.getColumnModel().getColumn(4).sizeWidthToFit();
tableAllLectures.getColumnModel().getColumn(5).sizeWidthToFit();
- initTableModel(modelAll);
-
+ tableAllLectures.setRowSorter(rowSorterAll);
JScrollPane scrollPaneMyImage = new JScrollPane();
tablemyLectures = new JTable();
+ tablemyLectures.getSelectionModel().addListSelectionListener( new ListSelectionListener()
+ {
+ public void valueChanged(ListSelectionEvent e)
+ {
+ String imageid = modelMyLectures
+ .getValueAt(
+ tablemyLectures
+ .convertRowIndexToModel(tablemyLectures
+ .getSelectedRow()), 8)
+ .toString();
+ //System.out.println(imageid);
+
+ try {
+ writeLectureData(imageid);
+ } catch (TException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ } catch (ParseException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ }
+ });
tablemyLectures.setModel(modelMyLectures);
tablemyLectures.getColumnModel().getColumn(1).sizeWidthToFit();
@@ -272,103 +387,13 @@ public class DeleteLecture_GUI extends JFrame {
scrollPaneMyImage.setViewportView(tablemyLectures);
tabbedPane.addTab("Meine Veranstaltungen", null, scrollPaneMyImage,
null);
- tableAllLectures.setRowSorter(rowSorterAll);
+
scrollPaneAllImages.setViewportView(tableAllLectures);
tabbedPane.addTab("Alle", null, scrollPaneAllImages, null);
-
- JScrollPane scrollPaneCoopImages = new JScrollPane();
- tableCoopImages = new JTable();
- tableCoopImages.setModel(model);
- tableCoopImages.getColumnModel().getColumn(1).sizeWidthToFit();
- tableCoopImages.getColumnModel().getColumn(2).sizeWidthToFit();
- tableCoopImages.getColumnModel().getColumn(3).sizeWidthToFit();
- tableCoopImages.getColumnModel().getColumn(4).sizeWidthToFit();
- tableCoopImages.getColumnModel().getColumn(5).sizeWidthToFit();
-
- scrollPaneCoopImages.setViewportView(tableCoopImages);
- tabbedPane.addTab("Kooperative Veranstaltungen", null,
- scrollPaneCoopImages, null);
- tabbedPane.setEnabledAt(2, false);
-
- JScrollPane scrollPanePublicImages = new JScrollPane();
- tablePublicImages = new JTable();
- tablePublicImages.setModel(model);
- tablePublicImages.getColumnModel().getColumn(1).sizeWidthToFit();
- tablePublicImages.getColumnModel().getColumn(2).sizeWidthToFit();
- tablePublicImages.getColumnModel().getColumn(3).sizeWidthToFit();
- tablePublicImages.getColumnModel().getColumn(4).sizeWidthToFit();
- tablePublicImages.getColumnModel().getColumn(5).sizeWidthToFit();
-
- scrollPanePublicImages.setViewportView(tablePublicImages);
- tabbedPane.addTab("\u00D6ffentliche Images", null,
- scrollPanePublicImages, null);
- tabbedPane.setEnabledAt(3, false);
-
- JScrollPane scrollPanePublicVorlagen = new JScrollPane();
- tablePublicVorlagen = new JTable();
- tablePublicVorlagen.setModel(model);
- tablePublicVorlagen.getColumnModel().getColumn(1).sizeWidthToFit();
- tablePublicVorlagen.getColumnModel().getColumn(2).sizeWidthToFit();
- tablePublicVorlagen.getColumnModel().getColumn(3).sizeWidthToFit();
- tablePublicVorlagen.getColumnModel().getColumn(4).sizeWidthToFit();
- tablePublicVorlagen.getColumnModel().getColumn(5).sizeWidthToFit();
-
- scrollPanePublicVorlagen.setViewportView(tablePublicVorlagen);
- tabbedPane.addTab("\u00D6ffentliche Vorlagen", null,
- scrollPanePublicVorlagen, null);
- tabbedPane.setEnabledAt(4, false);
-
- button = new JButton("L\u00F6schen");
- button.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- String lectureID="";
- int eingabe;
-
- //check if a row is selected
- if (tablemyLectures.getSelectedRowCount() !=0){
- //a row is selected
- //ask for confirmation
- eingabe = JOptionPane.showConfirmDialog(null,
- "Wollen Sie diese Daten l\u00f6schen?", "L\u00f6schen?",
- JOptionPane.YES_NO_OPTION);
-
- if (eingabe == JOptionPane.YES_OPTION) {
- //user has confirmed deletion, now get the ID of the selected lecture
- lectureID = modelMyLectures.getValueAt(tablemyLectures.convertColumnIndexToModel(tablemyLectures.getSelectedRow()), 8).toString();
- System.out.println("L\u00f6sche Lecture "+lectureID);
- try {
- if(client.deleteLecture(lectureID, person.verantwortlicher.getHochschule(),person.verantwortlicher.getUsername())){
- System.out.println("L\u00f6schen erfolgreich");
- //delete successful
-
- DeleteLecture_GUI dl = new DeleteLecture_GUI();
- dl.setVisible(true);
- dispose();
- } else {
- //delete not successful
- JOptionPane
- .showMessageDialog(
- null,
- "L\u00f6schen aus Datenbank fehlgeschlagen.",
- "Fehler",
- JOptionPane.INFORMATION_MESSAGE);
- }
- } catch (TException e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
- }//end delete
- }//end ask for confirmation
-
- }//end check if a row is selected
-
- }
- });
- button.setBounds(459, 508, 118, 23);
- contentPanel.add(button);
{
JPanel buttonPane = new JPanel();
- buttonPane.setBounds(0, 640, 597, 33);
+ buttonPane.setBounds(0, 640, 826, 33);
buttonPane.setBackground(SystemColor.menu);
buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
getContentPane().add(buttonPane);
@@ -390,12 +415,195 @@ public class DeleteLecture_GUI extends JFrame {
}
JSeparator separator = new JSeparator();
- separator.setBounds(0, 78, 597, 2);
+ separator.setBounds(0, 79, 836, 1);
getContentPane().add(separator);
JSeparator separator_1 = new JSeparator();
- separator_1.setBounds(0, 627, 597, 2);
+ separator_1.setBounds(0, 628, 836, 1);
getContentPane().add(separator_1);
+
+ JPanel panel = new JPanel();
+ panel.setLayout(null);
+ panel.setBorder(new TitledBorder(null, "Detailinformationen",
+
+ TitledBorder.LEADING, TitledBorder.TOP, null, null));
+ panel.setBackground(SystemColor.menu);
+ panel.setBounds(591, 85, 235, 518);
+ getContentPane().add(panel);
+
+ JLabel lblNewLabel_3 = new JLabel("Name:");
+ lblNewLabel_3.setBounds(10, 27, 104, 14);
+ panel.add(lblNewLabel_3);
+
+ JLabel lblAktiv = new JLabel("Aktiv:");
+ lblAktiv.setBounds(10, 98, 104, 14);
+ panel.add(lblAktiv);
+
+ labelAktiv = new JLabel("");
+ labelAktiv.setBounds(10, 114, 218, 14);
+ panel.add(labelAktiv);
+
+ labelstartdate = new JLabel("");
+ labelstartdate.setBounds(10, 147, 218, 14);
+ panel.add(labelstartdate);
+
+ JLabel lblStartdatum = new JLabel("Startdatum:");
+ lblStartdatum.setBounds(10, 129, 104, 14);
+ panel.add(lblStartdatum);
+
+ labelenddate = new JLabel("");
+ labelenddate.setBounds(10, 175, 218, 14);
+ panel.add(labelenddate);
+
+ JLabel lblEnddatum = new JLabel("Enddatum:");
+ lblEnddatum.setBounds(10, 161, 104, 14);
+ panel.add(lblEnddatum);
+
+ JLabel lblBeschreibung = new JLabel("Beschreibung:");
+ lblBeschreibung.setBounds(10, 189, 104, 14);
+ panel.add(lblBeschreibung);
+
+ JLabel lblImage = new JLabel("Image:");
+ lblImage.setBounds(10, 293, 104, 14);
+ panel.add(lblImage);
+
+ labelVerantwortlicher = new JLabel("");
+ labelVerantwortlicher.setBounds(10, 426, 218, 14);
+ panel.add(labelVerantwortlicher);
+
+ JLabel lblVerantwortlicher = new JLabel("Verantwortlicher:");
+ lblVerantwortlicher.setBounds(10, 411, 104, 14);
+ panel.add(lblVerantwortlicher);
+
+ JLabel lblImageversion = new JLabel("Imageversion:");
+ lblImageversion.setBounds(10, 381, 104, 14);
+ panel.add(lblImageversion);
+
+ labelimageversion = new JLabel("");
+ labelimageversion.setBounds(10, 399, 218, 14);
+ panel.add(labelimageversion);
+
+
+ labeldesc = new JTextArea();
+ labeldesc.setFont(new Font("Tahoma", Font.PLAIN, 11));
+ labeldesc.setEditable(false);
+ labeldesc.setLineWrap(true);
+ labeldesc.setBackground(SystemColor.menu);
+ labeldesc.setBounds(124, 127, 104, 110);
+ JScrollPane scrollPane = new JScrollPane(labeldesc);
+ scrollPane.setBounds(10, 209, 218, 81);
+ panel.add(scrollPane);
+ //panel.add(labeldesc);
+
+ labelimage = new JTextArea();
+ labelimage.setLineWrap(true);
+ labelimage.setFont(new Font("Tahoma", Font.PLAIN, 11));
+ labelimage.setEditable(false);
+ labelimage.setBackground(SystemColor.menu);
+ labelimage.setBounds(124, 248, 101, 81);
+ JScrollPane scrollPaneImage = new JScrollPane(labelimage);
+ scrollPaneImage.setBounds(10, 309, 215, 69);
+ panel.add(scrollPaneImage);
+
+ labelName = new JTextArea();
+ labelName.setEditable(false);
+ labelName.setFont(new Font("Tahoma", Font.PLAIN, 11));
+ labelName.setBackground(SystemColor.menu);
+ labelName.setBounds(124, 22, 101, 55);
+ JScrollPane scrollPaneName = new JScrollPane(labelName);
+ scrollPaneName.setBounds(10, 40, 218, 55);
+ panel.add(scrollPaneName);
+
+ button = new JButton("L\u00F6schen");
+ button.setBounds(469, 606, 118, 23);
+ getContentPane().add(button);
+ button.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ String lectureID="";
+ int eingabe;
+ String username = person.verantwortlicher.getName() + " "
+ + person.verantwortlicher.getVorname();
+ //check if a row is selected
+ if (tablemyLectures.getSelectedRowCount() !=0){
+ //a row is selected
+ //ask for confirmation
+ eingabe = JOptionPane.showConfirmDialog(null,
+ "Wollen Sie diese Daten l\u00f6schen?", "L\u00f6schen?",
+ JOptionPane.YES_NO_OPTION);
+
+ if (eingabe == JOptionPane.YES_OPTION) {
+ //user has confirmed deletion, now get the ID of the selected lecture
+ lectureID = modelMyLectures.getValueAt(tablemyLectures.convertColumnIndexToModel(tablemyLectures.getSelectedRow()), 8).toString();
+ System.out.println("L\u00f6sche Lecture "+lectureID);
+ try {
+ if(client.deleteLecture(lectureID, person.verantwortlicher.getHochschule(),person.verantwortlicher.getUsername())){
+ System.out.println("L\u00f6schen erfolgreich");
+ //delete successful
+
+ DeleteLecture_GUI dl = new DeleteLecture_GUI();
+ dl.setVisible(true);
+ dispose();
+ } else {
+ //delete not successful
+ JOptionPane
+ .showMessageDialog(
+ null,
+ "L\u00f6schen aus Datenbank fehlgeschlagen.",
+ "Fehler",
+ JOptionPane.INFORMATION_MESSAGE);
+ }
+ } catch (TException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }//end delete
+ }//end ask for confirmation
+
+ }//end check if a row is selected
+ else if (tableAllLectures.getSelectedRowCount() !=0 && tableAllLectures.getValueAt(tableAllLectures.getSelectedRow(), 5).toString().equals(username)){
+ //a row is selected
+ //ask for confirmation
+ eingabe = JOptionPane.showConfirmDialog(null,
+ "Wollen Sie diese Daten l\u00f6schen?", "L\u00f6schen?",
+ JOptionPane.YES_NO_OPTION);
+
+ if (eingabe == JOptionPane.YES_OPTION) {
+ //user has confirmed deletion, now get the ID of the selected lecture
+ lectureID = tableAllLectures.getValueAt(tableAllLectures.convertColumnIndexToModel(tableAllLectures.getSelectedRow()), 8).toString();
+ System.out.println("L\u00f6sche Lecture "+lectureID);
+ try {
+ if(client.deleteLecture(lectureID, person.verantwortlicher.getHochschule(),person.verantwortlicher.getUsername())){
+ System.out.println("L\u00f6schen erfolgreich");
+ //delete successful
+
+ DeleteLecture_GUI dl = new DeleteLecture_GUI();
+ dl.setVisible(true);
+ dispose();
+ } else {
+ //delete not successful
+ JOptionPane
+ .showMessageDialog(
+ null,
+ "L\u00f6schen aus Datenbank fehlgeschlagen.",
+ "Fehler",
+ JOptionPane.INFORMATION_MESSAGE);
+ }
+ } catch (TException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }//end delete
+ }//end ask for confirmation
+
+ } else { //end check if a row is selected
+ JOptionPane
+ .showMessageDialog(
+ null,
+ "Bitte w\u00e4hlen Sie ein eigenes Image aus.",
+ "Message",
+ JOptionPane.INFORMATION_MESSAGE);
+ }
+
+ }
+ });
JMenuBar menuBar = new JMenuBar();
setJMenuBar(menuBar);
@@ -459,13 +667,14 @@ public class DeleteLecture_GUI extends JFrame {
}
// Initiale Beffuelung eines Table models
- public DefaultTableModel initTableModel(DefaultTableModel model) {
+ public DefaultTableModel initTableModel(DefaultTableModel model) throws ParseException {
List<server.Lecture> lectures;
try {
// Hole eine Liste der Images
lectures = client.getLectureList();
Iterator<server.Lecture> i = lectures.iterator();
-
+ SimpleDateFormat in=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ SimpleDateFormat out=new SimpleDateFormat("dd.MM.yyyy HH:mm:ss");
int x = 0;
while (i.hasNext()) {
@@ -473,11 +682,11 @@ public class DeleteLecture_GUI extends JFrame {
Object[] obj = {
lectures.get(x).lecturename,
lectures.get(x).desc,
- lectures.get(x).starttime + " "
- + lectures.get(x).endtime,
- lectures.get(x).isActive, lectures.get(x).lastused,
- lectures.get(x).username, " ",
- lectures.get(x).imagename, lectures.get(x).id };
+ out.format(in.parse(lectures.get(x).starttime)) + " "
+ + out.format(in.parse(lectures.get(x).endtime)),
+ lectures.get(x).isActive, out.format(in.parse(lectures.get(x).lastused)),
+ lectures.get(x).username,
+ lectures.get(x).imagename," " ,lectures.get(x).id };
// Fuege diese Objekte der Tabelle hinzu
model.addRow(obj);
x++;
@@ -492,4 +701,20 @@ public class DeleteLecture_GUI extends JFrame {
}
return model;
}
+ public void writeLectureData(String id) throws TException, ParseException{
+
+ SimpleDateFormat in=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ SimpleDateFormat out=new SimpleDateFormat("dd.MM.yyyy HH:mm:ss");
+ Map<String,String> res=client.getLectureData(id);
+ labelName.setText(res.get("name"));
+ labelAktiv.setText(res.get("isActive"));
+ labeldesc.setText(res.get("desc"));
+ labelVerantwortlicher.setText(res.get("owner"));
+ labelstartdate.setText(out.format(in.parse(res.get("startTime"))));
+ labelenddate.setText(out.format(in.parse(res.get("endTime"))));
+ labelimage.setText(res.get("imagepath").substring(res.get("imagepath").indexOf("/")+1));
+ labelimageversion.setText(res.get("imageversion"));
+
+
+}
}
diff --git a/Dozentenmodul/src/main/java/gui/lecture/EditLectureAllgemein_GUI.java b/Dozentenmodul/src/main/java/gui/lecture/EditLectureAllgemein_GUI.java
index b72efce9..457b67db 100644
--- a/Dozentenmodul/src/main/java/gui/lecture/EditLectureAllgemein_GUI.java
+++ b/Dozentenmodul/src/main/java/gui/lecture/EditLectureAllgemein_GUI.java
@@ -1,6 +1,5 @@
package gui.lecture;
-
import gui.intro.About_GUI;
import gui.intro.MainMenue_GUI;
@@ -17,6 +16,8 @@ import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.net.URI;
import java.net.URISyntaxException;
+import java.util.Calendar;
+import java.util.Date;
import javax.swing.ButtonGroup;
import javax.swing.JButton;
@@ -25,6 +26,7 @@ import javax.swing.JLabel;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
+import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JSeparator;
@@ -44,7 +46,8 @@ import util.GuiOrganizer;
import util.OpenLinks;
import com.toedter.calendar.JDateChooser;
-
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeEvent;
@SuppressWarnings("serial")
public class EditLectureAllgemein_GUI extends JFrame {
@@ -61,8 +64,18 @@ public class EditLectureAllgemein_GUI extends JFrame {
JDateChooser dateChooserend;
JDateChooser dateChooserstart;
JRadioButton radioButtonno;
+ Date startDate = new Date();
+ Date endDate;
private final ButtonGroup buttonGroup = new ButtonGroup();
-
+ private boolean descriptionLengthOK = false; // description may not be
+ // longer than
+ // MAX_DESCRIPTION_LENGTH
+ private final int MAX_DESCRIPTION_LENGTH = 254;
+
+ int maxLifeTime = 180; // Anzahl Tage, die eine Veranstaltung in der Zukunft
+ // aktiv sein darf
+ boolean isDateOrderCorrect, isDateMaxLifeTimeCorrect,
+ isAllInformationReady = false;
/**
* Create the dialog.
@@ -75,7 +88,7 @@ public class EditLectureAllgemein_GUI extends JFrame {
}
});
setResizable(false);
-
+
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (ClassNotFoundException | InstantiationException
@@ -83,7 +96,8 @@ public class EditLectureAllgemein_GUI extends JFrame {
// TODO Auto-generated catch block
e.printStackTrace();
}
- setTitle("bwLehrpool Suite *Prototyp* - Veranstaltung bearbeiten");;
+ setTitle("bwLehrpool Suite - Veranstaltung bearbeiten");
+ ;
setBounds(0, 0, 603, 722);
GuiOrganizer.centerGUI(this);
@@ -100,11 +114,12 @@ public class EditLectureAllgemein_GUI extends JFrame {
panel.add(lblNewLabel);
lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18));
}
-
+
JTextPane txtpnBitteWhlenSie = new JTextPane();
txtpnBitteWhlenSie.setEditable(false);
txtpnBitteWhlenSie.setBackground(SystemColor.menu);
- txtpnBitteWhlenSie.setText("Geben Sie hier bitte einen sprechenden Imagename sowie Ihre Kontaktdaten an");
+ txtpnBitteWhlenSie
+ .setText("Geben Sie hier bitte einen sprechenden Imagename sowie Ihre Kontaktdaten an");
txtpnBitteWhlenSie.setBounds(10, 36, 509, 21);
panel.add(txtpnBitteWhlenSie);
}
@@ -113,19 +128,20 @@ public class EditLectureAllgemein_GUI extends JFrame {
contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
getContentPane().add(contentPanel);
contentPanel.setLayout(null);
-
+
JPanel panel_1 = new JPanel();
panel_1.setBackground(SystemColor.menu);
- panel_1.setBorder(new TitledBorder(null, "Informationen zum Besitzer", TitledBorder.LEADING, TitledBorder.TOP, null, null));
+ panel_1.setBorder(new TitledBorder(null, "Informationen zum Besitzer",
+ TitledBorder.LEADING, TitledBorder.TOP, null, null));
panel_1.setBounds(10, 331, 557, 162);
contentPanel.add(panel_1);
panel_1.setLayout(null);
-
+
JLabel label = new JLabel("Vorname: *");
label.setBackground(SystemColor.menu);
label.setBounds(10, 33, 125, 20);
panel_1.add(label);
-
+
Vorname = new JTextField();
Vorname.setEditable(false);
Vorname.setEnabled(false);
@@ -134,12 +150,12 @@ public class EditLectureAllgemein_GUI extends JFrame {
Vorname.setColumns(10);
Vorname.setBounds(145, 33, 350, 20);
panel_1.add(Vorname);
-
+
JLabel label_7 = new JLabel("Nachname: *");
label_7.setBackground(SystemColor.menu);
label_7.setBounds(10, 64, 125, 20);
panel_1.add(label_7);
-
+
Nachname = new JTextField();
Nachname.setEnabled(false);
Nachname.setEditable(false);
@@ -148,12 +164,12 @@ public class EditLectureAllgemein_GUI extends JFrame {
Nachname.setColumns(10);
Nachname.setBounds(145, 64, 350, 20);
panel_1.add(Nachname);
-
+
JLabel label_8 = new JLabel("Hochschule: *");
label_8.setBackground(SystemColor.menu);
label_8.setBounds(10, 95, 125, 20);
panel_1.add(label_8);
-
+
Hochschule = new JTextField();
Hochschule.setEnabled(false);
Hochschule.setEditable(false);
@@ -162,12 +178,12 @@ public class EditLectureAllgemein_GUI extends JFrame {
Hochschule.setColumns(10);
Hochschule.setBounds(145, 95, 350, 20);
panel_1.add(Hochschule);
-
+
JLabel label_9 = new JLabel("E-Mail: *");
label_9.setBackground(SystemColor.menu);
label_9.setBounds(10, 126, 125, 20);
panel_1.add(label_9);
-
+
EMail = new JTextField();
EMail.setEnabled(false);
EMail.setEditable(false);
@@ -176,62 +192,63 @@ public class EditLectureAllgemein_GUI extends JFrame {
EMail.setColumns(10);
EMail.setBounds(145, 126, 350, 20);
panel_1.add(EMail);
-
+
JPanel panel = new JPanel();
panel.setBounds(10, 402, 577, 33);
contentPanel.add(panel);
panel.setLayout(null);
panel.setBorder(new EmptyBorder(5, 5, 5, 5));
panel.setBackground(SystemColor.menu);
-
+
JLabel lblHauptmen = new JLabel("Hauptmen\u00FC");
lblHauptmen.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent arg0) {
-
+
EditLectureAllgemein_GUI.this.setVisible(false);
- MainMenue_GUI main=new MainMenue_GUI();
+ MainMenue_GUI main = new MainMenue_GUI();
main.setVisible(true);
}
});
lblHauptmen.setForeground(Color.BLUE);
lblHauptmen.setBounds(10, 11, 61, 14);
contentPanel.add(lblHauptmen);
-
+
JLabel label_1 = new JLabel(">");
label_1.setBounds(69, 11, 13, 14);
contentPanel.add(label_1);
-
- JLabel lblVlimage = new JLabel("VL-Image");
+
+ JLabel lblVlimage = new JLabel("Veranstaltung");
lblVlimage.setForeground(Color.BLUE);
- lblVlimage.setBounds(81, 11, 45, 14);
+ lblVlimage.setBounds(81, 11, 84, 14);
contentPanel.add(lblVlimage);
-
+
JLabel label_2 = new JLabel(">");
- label_2.setBounds(133, 11, 13, 14);
+ label_2.setBounds(175, 11, 13, 14);
contentPanel.add(label_2);
-
- JLabel lblNewLabel_1 = new JLabel("Neu");
- lblNewLabel_1.setBounds(146, 11, 46, 14);
+
+ JLabel lblNewLabel_1 = new JLabel("Bearbeiten");
+ lblNewLabel_1.setBounds(188, 11, 72, 14);
contentPanel.add(lblNewLabel_1);
-
+
JPanel panel_2 = new JPanel();
panel_2.setLayout(null);
- panel_2.setBorder(new TitledBorder(null, "Veranstaltungsdaten", TitledBorder.LEADING, TitledBorder.TOP, null, null));
+ panel_2.setBorder(new TitledBorder(null, "Veranstaltungsdaten",
+ TitledBorder.LEADING, TitledBorder.TOP, null, null));
panel_2.setBackground(SystemColor.menu);
panel_2.setBounds(10, 36, 557, 284);
contentPanel.add(panel_2);
-
+
JLabel label_3 = new JLabel("Laborname (Anzeigename): *");
label_3.setBounds(10, 25, 180, 14);
panel_2.add(label_3);
-
+
textFieldLaborname = new JTextField();
textFieldLaborname.setText(Lecture.lecture.getName());
textFieldLaborname.setColumns(10);
textFieldLaborname.setBounds(200, 22, 347, 20);
panel_2.add(textFieldLaborname);
-
+
JTextArea textArea = new JTextArea();
textArea.setEditable(false);
textArea.setWrapStyleWord(true);
@@ -241,11 +258,11 @@ public class EditLectureAllgemein_GUI extends JFrame {
textArea.setBackground(SystemColor.menu);
textArea.setBounds(10, 49, 537, 49);
panel_2.add(textArea);
-
+
JLabel label_4 = new JLabel("Beschreibung: *");
label_4.setBounds(10, 111, 180, 14);
panel_2.add(label_4);
-
+
ScrollPane scrollPane = new ScrollPane();
scrollPane.setBounds(200, 104, 347, 78);
panel_2.add(scrollPane);
@@ -256,56 +273,92 @@ public class EditLectureAllgemein_GUI extends JFrame {
scrollPane.add(description);
description.setBounds(0, 0, 4, 22);
scrollPane.add(description);
-
+
dateChooserend = new JDateChooser();
- dateChooserend.setDateFormatString("dd-MM-yyyy hh:mm:ss");
+ dateChooserend.setDateFormatString("dd-MM-yyyy HH:mm:ss");
dateChooserend.setDate(Lecture.lecture.getEnddate());
- dateChooserend.setBounds(385, 188, 100, 20);
+ dateChooserend.setBounds(404, 188, 143, 20);
panel_2.add(dateChooserend);
-
+
JLabel label_5 = new JLabel("bis");
- label_5.setBounds(351, 188, 24, 20);
+ label_5.setBounds(378, 188, 21, 20);
panel_2.add(label_5);
-
+
dateChooserstart = new JDateChooser();
- dateChooserstart.setDateFormatString("yyyy-MM-dd hh:mm:ss");
+ dateChooserstart
+ .addPropertyChangeListener(new PropertyChangeListener() {
+ public void propertyChange(PropertyChangeEvent arg0) {
+ endDate = addDays(dateChooserstart.getDate(),
+ maxLifeTime); // Datum darf weiter als 6
+ // Monate in der Zukunft
+ // liegen
+ }
+ });
+
+ // initialize
+ if (Lecture.lecture.getStartdate() == null) {
+ // is not defined yet
+ dateChooserstart.setDate(startDate);
+ } else {
+ // already defined from last visit on this page
+ dateChooserstart.setDate(Lecture.lecture.getStartdate());
+ }
+
+ if (Lecture.lecture.getEnddate() == null) {
+ // is not defined yet
+ dateChooserend.setDate(endDate);
+ } else {
+ // already defined from last visit on this page
+ dateChooserend.setDate(Lecture.lecture.getEnddate());
+ }
+
+ dateChooserstart.setDateFormatString("yyyy-MM-dd HH:mm:ss");
dateChooserstart.setDate(Lecture.lecture.getStartdate());
- dateChooserstart.setBounds(240, 188, 101, 20);
+ dateChooserstart.setBounds(226, 188, 143, 20);
panel_2.add(dateChooserstart);
-
+
JLabel label_6 = new JLabel("von:");
label_6.setBounds(200, 188, 30, 20);
panel_2.add(label_6);
-
+
JLabel label_10 = new JLabel("G\u00FCltigkeitsdatum: *");
label_10.setBounds(10, 188, 250, 14);
panel_2.add(label_10);
-
+
JLabel label_11 = new JLabel("Aktiv:");
label_11.setBounds(10, 229, 250, 14);
panel_2.add(label_11);
-
+
radioButtonyes = new JRadioButton("Ja");
buttonGroup.add(radioButtonyes);
- if(Lecture.lecture.isActive()==true)
- {
- radioButtonyes.setSelected(true);
- }else
- {
- radioButtonno.setSelected(true);
- }
-
radioButtonyes.setBounds(240, 225, 109, 23);
panel_2.add(radioButtonyes);
-
radioButtonno = new JRadioButton("Nein");
buttonGroup.add(radioButtonno);
radioButtonno.setBounds(385, 225, 109, 23);
panel_2.add(radioButtonno);
-
+
+ radioButtonyes.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent arg0) {
+ radioButtonyes.setSelected(true);
+ radioButtonno.setSelected(false);
+ }
+ });
+ radioButtonno.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ radioButtonno.setSelected(true);
+ radioButtonyes.setSelected(false);
+ }
+ });
+
JLabel label_12 = new JLabel("(Im VMChooser sichtbar)");
label_12.setBounds(10, 254, 250, 14);
panel_2.add(label_12);
+
+ JLabel lblmaxMonate = new JLabel("(max. 6 Monate)");
+ lblmaxMonate.setBounds(10, 208, 127, 14);
+ panel_2.add(lblmaxMonate);
+
{
JPanel buttonPane = new JPanel();
buttonPane.setBounds(0, 640, 597, 33);
@@ -316,22 +369,20 @@ public class EditLectureAllgemein_GUI extends JFrame {
JButton okButton = new JButton("Zur\u00FCck");
okButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
- if(radioButtonyes.isSelected()==true)
- {
+
+ if (radioButtonyes.isSelected() == true) {
Lecture.lecture.setActive(true);
- }
- else
- {
+ } else {
Lecture.lecture.setActive(false);
}
-
+
Lecture.lecture.setName(textFieldLaborname.getText());
Lecture.lecture.setDesc(description.getText());
Lecture.lecture.setEnddate(dateChooserend.getDate());
Lecture.lecture.setStartdate(dateChooserstart.getDate());
Image.image.setImagename(textFieldLaborname.getText());
-
- MainMenue_GUI sr=new MainMenue_GUI();
+
+ MainMenue_GUI sr = new MainMenue_GUI();
sr.setVisible(true);
dispose();
}
@@ -343,71 +394,141 @@ public class EditLectureAllgemein_GUI extends JFrame {
{
JButton cancelButton = new JButton("Weiter");
cancelButton.addActionListener(new ActionListener() {
+ /*
+ * public void actionPerformed(ActionEvent e) {
+ * if(radioButtonyes.isSelected()==true) {
+ * Lecture.lecture.setActive(true); } else {
+ * Lecture.lecture.setActive(false); }
+ *
+ * Lecture.lecture.setName(textFieldLaborname.getText());
+ * Lecture.lecture.setNewName(textFieldLaborname.getText());
+ * Lecture.lecture.setDesc(description.getText());
+ * Lecture.lecture.setEnddate(dateChooserend.getDate());
+ * Lecture.lecture.setStartdate(dateChooserstart.getDate());
+ * Image.image.setImagename(textFieldLaborname.getText());
+ *
+ *
+ * PermissionEditLecture_GUI ev=new
+ * PermissionEditLecture_GUI(); ev.setVisible(true);
+ * dispose(); }
+ */
public void actionPerformed(ActionEvent e) {
- if(radioButtonyes.isSelected()==true)
- {
- Lecture.lecture.setActive(true);
+ // liegt das End-Datum vor dem Start-Datum?
+ if (dateChooserend.getDate().before(
+ dateChooserstart.getDate())) {
+ // datum ist falsch rum
+ isDateOrderCorrect = false;
+ JOptionPane
+ .showMessageDialog(
+ null,
+ "Das End-Datum liegt vor dem Start-Datum. Bitte \u00e4ndern.",
+ "Datum fehlerhaft",
+ JOptionPane.INFORMATION_MESSAGE);
+ } else {
+ // bereit
+ isDateOrderCorrect = true;
+ }
+ // liegt das eingegebene Datum nach dem erlaubten
+ // End-Datum?
+ if (dateChooserend.getDate().after(endDate)) {
+ // Datum zu weit weg
+ isDateMaxLifeTimeCorrect = false;
+ JOptionPane.showMessageDialog(null,
+ "Das End-Datum liegt zu weit in der Zukunft. Erlaubt ist maximal:\n"
+ + endDate, "Datum fehlerhaft",
+ JOptionPane.INFORMATION_MESSAGE);
+
+ dateChooserend.setDate(endDate); // setze Datum auf
+ // maximum
+ } else {
+ // bereit
+ isDateMaxLifeTimeCorrect = true;
+ }
+ // Pruefen ob alles eingegeben wurde
+ if (textFieldLaborname.getText().isEmpty() == true
+ || description.getText().isEmpty() == true) {
+ // mind 1 Textfeld ist leer
+ isAllInformationReady = false;
+ JOptionPane
+ .showMessageDialog(
+ null,
+ "Bitte geben Sie einen Veranstaltungsnamen und eine Beschreibung ein.",
+ "Datum fehlerhaft",
+ JOptionPane.INFORMATION_MESSAGE);
+ } else {
+ // Textfelder bereit
+ isAllInformationReady = true;
}
- else
- {
+
+ // welcher Radiobutton ist geklickt?
+ if (radioButtonyes.isSelected() == true) {
+ Lecture.lecture.setActive(true);
+ } else {
Lecture.lecture.setActive(false);
}
-
- Lecture.lecture.setName(textFieldLaborname.getText());
- Lecture.lecture.setNewName(textFieldLaborname.getText());
- Lecture.lecture.setDesc(description.getText());
- Lecture.lecture.setEnddate(dateChooserend.getDate());
- Lecture.lecture.setStartdate(dateChooserstart.getDate());
- Image.image.setImagename(textFieldLaborname.getText());
-
+ // Pruefe ob alle Eingaben korrekt sind, dann mache
+ // weiter
+ if (isAllInformationReady == true
+ && isDateMaxLifeTimeCorrect == true
+ && isDateOrderCorrect == true
+ && descriptionLenghtOK() == true) {
+ // everything is ok, proceed
+ Lecture.lecture.setName(textFieldLaborname
+ .getText());
+ Lecture.lecture.setDesc(description.getText());
+ Lecture.lecture.setEnddate(dateChooserend.getDate());
+ Lecture.lecture.setStartdate(dateChooserstart
+ .getDate());
+
+ Image.image.setImagename(textFieldLaborname
+ .getText());
+
+ PermissionCreateLecture_GUI ev = new PermissionCreateLecture_GUI();
+ ev.setVisible(true);
+ dispose();
+ }
- EditLectureLink_GUI ev=new EditLectureLink_GUI();
- ev.setVisible(true);
- dispose();
}
+
});
cancelButton.setActionCommand("Cancel");
buttonPane.add(cancelButton);
}
}
-
+
JSeparator separator = new JSeparator();
separator.setBounds(0, 78, 597, 2);
getContentPane().add(separator);
-
+
JSeparator separator_1 = new JSeparator();
separator_1.setBounds(0, 627, 597, 2);
getContentPane().add(separator_1);
-
+
JLabel lblPflichtfelder = new JLabel("* Pflichtfelder");
lblPflichtfelder.setBounds(32, 602, 136, 14);
getContentPane().add(lblPflichtfelder);
-
+
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");
mntmFaq.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent arg0) {
-
OpenLinks open = new OpenLinks();
-
URI windows;
try {
windows = new URI(Links.getFAQ());
-
open.openWebpage(windows);
-
} catch (URISyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
@@ -415,30 +536,24 @@ public class EditLectureAllgemein_GUI extends JFrame {
}
});
mnNewMenu_1.add(mntmFaq);
-
JMenuItem mntmOtrs = new JMenuItem("OTRS");
mntmOtrs.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent arg0) {
-
OpenLinks open = new OpenLinks();
-
URI windows;
try {
windows = new URI(Links.getOTRS());
-
open.openWebpage(windows);
-
} catch (URISyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
-
}
});
mnNewMenu_1.add(mntmOtrs);
-
+
JMenuItem mntmAbout = new JMenuItem("About");
mntmAbout.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
@@ -447,8 +562,33 @@ public class EditLectureAllgemein_GUI extends JFrame {
}
});
mnNewMenu_1.add(mntmAbout);
-
+
}
-
-} \ No newline at end of file
+ public Date addDays(Date date, int days) {
+ Calendar cal = Calendar.getInstance();
+ cal.setTime(date);
+ cal.add(Calendar.DATE, days); // minus number would decrement the days
+ return cal.getTime();
+ }// end addDays()
+
+ public boolean descriptionLenghtOK() {
+ descriptionLengthOK = false;
+
+ // max length is 254 chars
+ if (description.getText().length() >= MAX_DESCRIPTION_LENGTH) {
+ descriptionLengthOK = false;
+ JOptionPane.showMessageDialog(null,
+ "Die Beschreibung darf max 254 Zeichen enthalten. Aktuell enthält sie "
+ + description.getText().length() + ".",
+ "Beschreibung zu umfangreich",
+ JOptionPane.INFORMATION_MESSAGE);
+ } else {
+ descriptionLengthOK = true;
+
+ }
+
+ return descriptionLengthOK;
+ }// enddescriptionLenghtOK()
+
+}// end class \ No newline at end of file
diff --git a/Dozentenmodul/src/main/java/gui/lecture/EditLectureLink_GUI.java b/Dozentenmodul/src/main/java/gui/lecture/EditLectureLink_GUI.java
index f7b38b06..773a01b7 100644
--- a/Dozentenmodul/src/main/java/gui/lecture/EditLectureLink_GUI.java
+++ b/Dozentenmodul/src/main/java/gui/lecture/EditLectureLink_GUI.java
@@ -18,10 +18,12 @@ import java.awt.event.WindowEvent;
import java.net.URI;
import java.net.URISyntaxException;
import java.text.DateFormat;
+import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
+import java.util.Map;
import javax.swing.JButton;
import javax.swing.JComboBox;
@@ -37,13 +39,17 @@ import javax.swing.JScrollPane;
import javax.swing.JSeparator;
import javax.swing.JTabbedPane;
import javax.swing.JTable;
+import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.JTextPane;
+import javax.swing.RowFilter;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.border.EmptyBorder;
import javax.swing.border.TitledBorder;
import javax.swing.table.DefaultTableModel;
+import javax.swing.table.TableModel;
+import javax.swing.table.TableRowSorter;
import models.Lecture;
import models.Links;
@@ -55,6 +61,10 @@ import server.Server.Client;
import thrift.ThriftConnection;
import util.GuiOrganizer;
import util.OpenLinks;
+import javax.swing.event.ChangeListener;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
@SuppressWarnings("serial")
public class EditLectureLink_GUI extends JFrame {
@@ -64,17 +74,52 @@ public class EditLectureLink_GUI extends JFrame {
JRadioButton rdbtnInternetJa;
JRadioButton rdbtnInternetNein;
JComboBox<String> comboBox;
+ JLabel labelName;
+ JLabel labelUpdate;
+ JLabel labelVerantwortlicher;
+ JLabel labelWeitereVerantwortliche;
+ JLabel labelVorlage;
+ JLabel labelLizenzSoftware;
+ JLabel labelInternet;
+ JLabel labelRam;
+ JLabel labelID;
+ JLabel labelVersion;
+ JTextArea textAreadesc;
+ JLabel labelCPU;
+ private JLabel labelOS;
JTable tableAllImages = new JTable();
JTable tablemyImages = new JTable();
JTable tableCoopImages = new JTable();
- JTable tablePublicImages = new JTable();
JTable tablePublicVorlagen = new JTable();
private JTextField textFieldName;
+ JTabbedPane tabbedPane;
+ boolean activeSearch=false;
String[] titles = { "Image-Name", "Lizenzpflichtig", "OS", "Veranstaltung",
- "Verantwortlicher", "Letztes Update", "Schlagwort", "ID", "Version" };
+ "Verantwortlicher", "Letztes Update", "ID", "Version","Template" };
ThriftConnection con = new ThriftConnection();
Client client = models.Client.clientcon.getClient();
-
+ final DefaultTableModel modelAll = new DefaultTableModel(titles, 0){
+ public boolean isCellEditable(int rowIndex, int mColIndex) {
+ return false;
+ }
+ };
+ final DefaultTableModel modelMyImages = new DefaultTableModel(titles, 0){
+ public boolean isCellEditable(int rowIndex, int mColIndex) {
+ return false;
+ }
+ };
+ final DefaultTableModel modelPublicVorlagen = new DefaultTableModel(titles, 0){
+ public boolean isCellEditable(int rowIndex, int mColIndex) {
+ return false;
+ }
+ };
+ final TableRowSorter<TableModel> rowSorterAll = new TableRowSorter<TableModel>(
+ modelAll);
+ final TableRowSorter<TableModel> rowSorterMyImages = new TableRowSorter<TableModel>(
+ modelMyImages);
+ final TableRowSorter<TableModel> rowSorterPublicVorlagen = new TableRowSorter<TableModel>(
+ modelPublicVorlagen);
+ private JTextField textField;
/**
* Create the dialog.
*/
@@ -85,6 +130,75 @@ public class EditLectureLink_GUI extends JFrame {
con.closeThriftConnection();
System.exit(0);
}
+ @Override
+ public void windowOpened(WindowEvent arg0) {
+ try {
+ initTableModel(modelAll);
+ initTableModel(modelMyImages);
+ initTableModel(modelPublicVorlagen);
+ } catch (TException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (ParseException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ // auszublendende Angaben
+ // 1=Lizenzpflichtig
+ // 3=Veranstaltung
+ // 6=ID
+ // 7=Version
+ // 8=Template
+ tablemyImages.getColumnModel().getColumn(1).setWidth(0);
+ tablemyImages.getColumnModel().getColumn(1).setMinWidth(0);
+ tablemyImages.getColumnModel().getColumn(1).setMaxWidth(0);
+ tablemyImages.getColumnModel().getColumn(3).setWidth(0);
+ tablemyImages.getColumnModel().getColumn(3).setMinWidth(0);
+ tablemyImages.getColumnModel().getColumn(3).setMaxWidth(0);
+ tablemyImages.getColumnModel().getColumn(8).setWidth(0);
+ tablemyImages.getColumnModel().getColumn(8).setMinWidth(0);
+ tablemyImages.getColumnModel().getColumn(8).setMaxWidth(0);
+ tablemyImages.getColumnModel().getColumn(6).setWidth(0);
+ tablemyImages.getColumnModel().getColumn(6).setMinWidth(0);
+ tablemyImages.getColumnModel().getColumn(6).setMaxWidth(0);
+ tablemyImages.getColumnModel().getColumn(7).setWidth(0);
+ tablemyImages.getColumnModel().getColumn(7).setMinWidth(0);
+ tablemyImages.getColumnModel().getColumn(7).setMaxWidth(0);
+
+ tablePublicVorlagen.getColumnModel().getColumn(1).setWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(1).setMinWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(1).setMaxWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(3).setWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(3).setMinWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(3).setMaxWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(8).setWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(8).setMinWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(8).setMaxWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(6).setWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(6).setMinWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(6).setMaxWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(7).setWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(7).setMinWidth(0);
+ tablePublicVorlagen.getColumnModel().getColumn(7).setMaxWidth(0);
+
+ tableAllImages.getColumnModel().getColumn(1).setWidth(0);
+ tableAllImages.getColumnModel().getColumn(1).setMinWidth(0);
+ tableAllImages.getColumnModel().getColumn(1).setMaxWidth(0);
+ tableAllImages.getColumnModel().getColumn(3).setWidth(0);
+ tableAllImages.getColumnModel().getColumn(3).setMinWidth(0);
+ tableAllImages.getColumnModel().getColumn(3).setMaxWidth(0);
+ tableAllImages.getColumnModel().getColumn(8).setWidth(0);
+ tableAllImages.getColumnModel().getColumn(8).setMinWidth(0);
+ tableAllImages.getColumnModel().getColumn(8).setMaxWidth(0);
+ tableAllImages.getColumnModel().getColumn(6).setWidth(0);
+ tableAllImages.getColumnModel().getColumn(6).setMinWidth(0);
+ tableAllImages.getColumnModel().getColumn(6).setMaxWidth(0);
+ tableAllImages.getColumnModel().getColumn(7).setWidth(0);
+ tableAllImages.getColumnModel().getColumn(7).setMinWidth(0);
+ tableAllImages.getColumnModel().getColumn(7).setMaxWidth(0);
+ textFieldName.requestFocusInWindow();
+ }
});
setResizable(false);
@@ -95,12 +209,12 @@ public class EditLectureLink_GUI extends JFrame {
// TODO Auto-generated catch block
e.printStackTrace();
}
- setTitle("bwLehrpool Suite *Prototyp* - Veranstaltung bearbeiten");
+ setTitle("bwLehrpool Suite - Veranstaltung bearbeiten");
- setBounds(0, 0, 603, 722);
+ setBounds(0, 0, 918, 722);
GuiOrganizer.centerGUI(this);
- final DefaultTableModel modelAll = new DefaultTableModel(titles, 0);
+
final DefaultTableModel model = new DefaultTableModel(titles, 0);
getContentPane().setLayout(null);
@@ -135,16 +249,16 @@ public class EditLectureLink_GUI extends JFrame {
panel_1.setBackground(SystemColor.menu);
panel_1.setBorder(new TitledBorder(null, "Filterfunktionen",
TitledBorder.LEADING, TitledBorder.TOP, null, null));
- panel_1.setBounds(10, 49, 557, 131);
+ panel_1.setBounds(10, 49, 557, 91);
contentPanel.add(panel_1);
panel_1.setLayout(null);
- JLabel lblNewLabel_2 = new JLabel("Anzeigename:");
- lblNewLabel_2.setBounds(10, 30, 250, 20);
+ JLabel lblNewLabel_2 = new JLabel("Name:");
+ lblNewLabel_2.setBounds(10, 30, 80, 20);
panel_1.add(lblNewLabel_2);
JLabel lblInternetIstInnerhalb = new JLabel("Betriebssystem:");
- lblInternetIstInnerhalb.setBounds(10, 58, 250, 20);
+ lblInternetIstInnerhalb.setBounds(10, 58, 80, 20);
panel_1.add(lblInternetIstInnerhalb);
textFieldName = new JTextField();
@@ -152,43 +266,36 @@ public class EditLectureLink_GUI extends JFrame {
@Override
public void keyReleased(KeyEvent e) {
String stext = textFieldName.getText();
- modelAll.setRowCount(0);
- initTableModel(modelAll);
-
- if (stext != "")
- for (int i = 0; i < modelAll.getRowCount(); i++) {
-
- if (modelAll.getValueAt(i, 0).toString()
- .startsWith(stext)) {
-
- } else {
- modelAll.removeRow(i);
- }
- }
+ // Wenn Textfield nicht leer
+ if (stext != "") {
+ activeSearch=true;
+ // Filtere nach der Eingabe
+ rowSorterAll.setRowFilter(RowFilter.regexFilter(
+ textFieldName.getText(), 0));
+ rowSorterMyImages.setRowFilter(RowFilter.regexFilter(
+ textFieldName.getText(), 0));
+ rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter(
+ textFieldName.getText(), 0));
+
+ }else{
+ activeSearch=false;
+ String username = person.verantwortlicher.getName() + " "
+ + person.verantwortlicher.getVorname();
+ rowSorterMyImages.setRowFilter(RowFilter.regexFilter(
+ username, 4));
+ rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter(
+ "true", 8));
+ rowSorterAll.setRowFilter(null);
+ }
}
});
- textFieldName.setBounds(270, 30, 250, 20);
+ textFieldName.setBounds(96, 30, 166, 20);
panel_1.add(textFieldName);
textFieldName.setColumns(10);
- JLabel lblErweiterteSuche = new JLabel(
- "<html><u>Erweiterte Suche *Folgt noch*</u></html>");
- lblErweiterteSuche.addMouseListener(new MouseAdapter() {
- @Override
- public void mouseClicked(MouseEvent arg0) {
- // ExtendedSearchForImages_GUI es = new
- // ExtendedSearchForImages_GUI();
- // es.setVisible(true);
- }
- });
- lblErweiterteSuche.setForeground(Color.BLUE);
-
- lblErweiterteSuche.setBounds(317, 106, 203, 14);
- panel_1.add(lblErweiterteSuche);
-
comboBox = new JComboBox<String>();
try {
List<String> list = client.getAllOS();
@@ -202,24 +309,38 @@ public class EditLectureLink_GUI extends JFrame {
}
comboBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
- modelAll.setRowCount(0);
- initTableModel(modelAll);
- String selItem = comboBox.getSelectedItem().toString();
- if (selItem != "") {
- for (int i = 0; i < modelAll.getRowCount(); i++) {
-
- if (modelAll.getValueAt(i, 2).equals(selItem)) {
-
- } else {
- modelAll.removeRow(i);
- }
- }
-
+ // Prueft das die Auswahl nicht leer ist
+ if (comboBox.getSelectedItem().toString() != "") {
+ activeSearch=true;
+ rowSorterAll.setRowFilter(RowFilter.regexFilter(comboBox
+ .getSelectedItem().toString(), 2));
+ rowSorterMyImages.setRowFilter(RowFilter.regexFilter(
+ comboBox.getSelectedItem().toString(), 2));
+ rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter(
+ comboBox.getSelectedItem().toString(), 2));
+ }else{
+ activeSearch=false;
+ String username = person.verantwortlicher.getName() + " "
+ + person.verantwortlicher.getVorname();
+ rowSorterMyImages.setRowFilter(RowFilter.regexFilter(
+ username, 4));
+ rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter(
+ "true", 8));
+ rowSorterAll.setRowFilter(null);
}
}
});
- comboBox.setBounds(270, 58, 250, 20);
+ comboBox.setBounds(96, 58, 166, 20);
panel_1.add(comboBox);
+
+ JLabel label_3 = new JLabel("Beschreibung:");
+ label_3.setBounds(291, 30, 80, 20);
+ panel_1.add(label_3);
+
+ textField = new JTextField();
+ textField.setColumns(10);
+ textField.setBounds(381, 30, 166, 20);
+ panel_1.add(textField);
JLabel lblHauptmen = new JLabel("Hauptmen\u00FC");
lblHauptmen.addMouseListener(new MouseAdapter() {
@@ -252,34 +373,128 @@ public class EditLectureLink_GUI extends JFrame {
lblNewLabel_1.setBounds(164, 11, 113, 14);
contentPanel.add(lblNewLabel_1);
- JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
-
- tabbedPane.setBounds(10, 197, 557, 300);
- contentPanel.add(tabbedPane);
+ tabbedPane = new JTabbedPane(JTabbedPane.TOP);
+ tabbedPane.addChangeListener(new ChangeListener() {
+ public void stateChanged(ChangeEvent arg0) {
+ if (tabbedPane.getSelectedIndex() == 0 && activeSearch==false) {
+
+ String username = person.verantwortlicher.getName() + " "
+ + person.verantwortlicher.getVorname();
+ rowSorterMyImages.setRowFilter(RowFilter.regexFilter(
+ username, 4));
+ }else if(tabbedPane.getSelectedIndex()==1 && activeSearch==false){
+ rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter("true", 8));
+ } else if(tabbedPane.getSelectedIndex()==2 && activeSearch==false){
+ rowSorterAll.setRowFilter(null);
+ }
- JScrollPane scrollPaneMyImage = new JScrollPane();
+ }
+ });
- tablemyImages.setModel(model);
- tablemyImages.getColumnModel().getColumn(1).sizeWidthToFit();
- tablemyImages.getColumnModel().getColumn(2).sizeWidthToFit();
- tablemyImages.getColumnModel().getColumn(3).sizeWidthToFit();
- tablemyImages.getColumnModel().getColumn(4).sizeWidthToFit();
- tablemyImages.getColumnModel().getColumn(5).sizeWidthToFit();
+ tabbedPane.setBounds(10, 158, 557, 339);
+ contentPanel.add(tabbedPane);
JScrollPane scrollPaneAllImages = new JScrollPane();
+ tableAllImages.getSelectionModel().addListSelectionListener( new ListSelectionListener()
+ {
+ public void valueChanged(ListSelectionEvent e)
+ {
+
+ String imageid = modelAll
+ .getValueAt(
+ tableAllImages
+ .convertRowIndexToModel(tableAllImages
+ .getSelectedRow()), 6)
+ .toString();
+ //System.out.println(imageid);
+ String version = modelAll
+ .getValueAt(
+ tableAllImages
+ .convertRowIndexToModel(tableAllImages
+ .getSelectedRow()), 7)
+ .toString();
+ //System.out.println(version);
+ writeImageData(imageid, version);
+
+ }
+ });
tableAllImages.setModel(modelAll);
tableAllImages.getColumnModel().getColumn(1).sizeWidthToFit();
tableAllImages.getColumnModel().getColumn(2).sizeWidthToFit();
tableAllImages.getColumnModel().getColumn(3).sizeWidthToFit();
tableAllImages.getColumnModel().getColumn(4).sizeWidthToFit();
tableAllImages.getColumnModel().getColumn(5).sizeWidthToFit();
+ tableAllImages.setRowSorter(rowSorterAll);
+ JScrollPane scrollPaneMyImage = new JScrollPane();
+ tablemyImages.getSelectionModel().addListSelectionListener( new ListSelectionListener()
+ {
+ public void valueChanged(ListSelectionEvent e)
+ {
+ String imageid = modelMyImages
+ .getValueAt(
+ tablemyImages
+ .convertRowIndexToModel(tablemyImages
+ .getSelectedRow()), 6)
+ .toString();
+ //System.out.println(imageid);
+ String version = modelMyImages
+ .getValueAt(
+ tablemyImages
+ .convertRowIndexToModel(tablemyImages
+ .getSelectedRow()), 7)
+ .toString();
+ //System.out.println(version);
+ writeImageData(imageid, version);
+ }
+ });
+ tablemyImages.setModel(modelMyImages);
+ tablemyImages.getColumnModel().getColumn(1).sizeWidthToFit();
+ tablemyImages.getColumnModel().getColumn(2).sizeWidthToFit();
+ tablemyImages.getColumnModel().getColumn(3).sizeWidthToFit();
+ tablemyImages.getColumnModel().getColumn(4).sizeWidthToFit();
+ tablemyImages.getColumnModel().getColumn(5).sizeWidthToFit();
+ tablemyImages.setRowSorter(rowSorterMyImages);
+ scrollPaneMyImage.setViewportView(tablemyImages);
+ tabbedPane.addTab("Meine Images", null, scrollPaneMyImage, null);
+
+ JScrollPane scrollPanePublicVorlagen = new JScrollPane();
+ scrollPanePublicVorlagen.setEnabled(false);
+ tablePublicVorlagen.getSelectionModel().addListSelectionListener( new ListSelectionListener()
+ {
+ public void valueChanged(ListSelectionEvent e)
+ {
+ String imageid = modelPublicVorlagen
+ .getValueAt(
+ tablePublicVorlagen
+ .convertRowIndexToModel(tablePublicVorlagen
+ .getSelectedRow()), 6)
+ .toString();
+ //System.out.println(imageid);
+ String version = modelPublicVorlagen
+ .getValueAt(
+ tablePublicVorlagen
+ .convertRowIndexToModel(tablePublicVorlagen
+ .getSelectedRow()), 7)
+ .toString();
+ //System.out.println(version);
+ writeImageData(imageid, version);
+ }
+ });
+ tablePublicVorlagen.setModel(modelPublicVorlagen);
+ tablePublicVorlagen.getColumnModel().getColumn(1).sizeWidthToFit();
+ tablePublicVorlagen.getColumnModel().getColumn(2).sizeWidthToFit();
+ tablePublicVorlagen.getColumnModel().getColumn(3).sizeWidthToFit();
+ tablePublicVorlagen.getColumnModel().getColumn(4).sizeWidthToFit();
+ tablePublicVorlagen.getColumnModel().getColumn(5).sizeWidthToFit();
+ tablePublicVorlagen.setRowSorter(rowSorterPublicVorlagen);
+ scrollPanePublicVorlagen.setViewportView(tablePublicVorlagen);
+ tabbedPane.addTab("Vorlagen", null,
+ scrollPanePublicVorlagen, null);
+
scrollPaneAllImages.setViewportView(tableAllImages);
tabbedPane.addTab("Alle", null, scrollPaneAllImages, null);
- scrollPaneMyImage.setViewportView(tablemyImages);
- tabbedPane.addTab("Meine Images", null, scrollPaneMyImage, null);
-
JScrollPane scrollPaneCoopImages = new JScrollPane();
tableCoopImages.setModel(model);
@@ -290,47 +505,19 @@ public class EditLectureLink_GUI extends JFrame {
tableCoopImages.getColumnModel().getColumn(5).sizeWidthToFit();
scrollPaneCoopImages.setViewportView(tableCoopImages);
- tabbedPane.addTab("Kooperative Images", null, scrollPaneCoopImages,
+ tabbedPane.addTab("bwLehrpool", null, scrollPaneCoopImages,
null);
- tabbedPane.setEnabledAt(2, false);
-
- JScrollPane scrollPanePublicImages = new JScrollPane();
-
- tablePublicImages.setModel(model);
- tablePublicImages.getColumnModel().getColumn(1).sizeWidthToFit();
- tablePublicImages.getColumnModel().getColumn(2).sizeWidthToFit();
- tablePublicImages.getColumnModel().getColumn(3).sizeWidthToFit();
- tablePublicImages.getColumnModel().getColumn(4).sizeWidthToFit();
- tablePublicImages.getColumnModel().getColumn(5).sizeWidthToFit();
-
- scrollPanePublicImages.setViewportView(tablePublicImages);
- tabbedPane.addTab("\u00D6ffentliche Images", null,
- scrollPanePublicImages, null);
tabbedPane.setEnabledAt(3, false);
- JScrollPane scrollPanePublicVorlagen = new JScrollPane();
-
- tablePublicVorlagen.setModel(model);
- tablePublicVorlagen.getColumnModel().getColumn(1).sizeWidthToFit();
- tablePublicVorlagen.getColumnModel().getColumn(2).sizeWidthToFit();
- tablePublicVorlagen.getColumnModel().getColumn(3).sizeWidthToFit();
- tablePublicVorlagen.getColumnModel().getColumn(4).sizeWidthToFit();
- tablePublicVorlagen.getColumnModel().getColumn(5).sizeWidthToFit();
-
- scrollPanePublicVorlagen.setViewportView(tablePublicVorlagen);
- tabbedPane.addTab("\u00D6ffentliche Vorlagen", null,
- scrollPanePublicVorlagen, null);
- tabbedPane.setEnabledAt(4, false);
-
JButton btnLinkLschen = new JButton("Link l\u00F6schen");
btnLinkLschen.setEnabled(false);
btnLinkLschen.setBounds(478, 508, 89, 23);
contentPanel.add(btnLinkLschen);
- initTableModel(modelAll);
+
{
JPanel buttonPane = new JPanel();
- buttonPane.setBounds(0, 640, 597, 33);
+ buttonPane.setBounds(0, 640, 902, 33);
buttonPane.setBackground(SystemColor.menu);
buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
getContentPane().add(buttonPane);
@@ -339,7 +526,7 @@ public class EditLectureLink_GUI extends JFrame {
okButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
- EditLectureAllgemein_GUI el = new EditLectureAllgemein_GUI();
+ PermissionEditLecture_GUI el = new PermissionEditLecture_GUI();
el.setVisible(true);
dispose();
}
@@ -353,21 +540,16 @@ public class EditLectureLink_GUI extends JFrame {
"Veranstaltung \u00e4ndern und abschlie\u00DFen");
cancelButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
-
+ String username = person.verantwortlicher.getName() + " "
+ + person.verantwortlicher.getVorname();
// check if a row is selected
- if ((tableAllImages.getSelectedRow() != -1)
- || (tablemyImages.getSelectedRow() != -1)
- || (tableCoopImages.getSelectedRow() != -1)
- || (tablePublicImages.getSelectedRow() != -1)
- || (tablePublicVorlagen.getSelectedRow() != -1)) {
+ if (tablemyImages.getSelectedRow() != -1){
// a row is selected, do operations
- String imagename = tableAllImages.getValueAt(
- tableAllImages.getSelectedRow(), 0)
+ String imagename = tablemyImages.getValueAt(
+ tablemyImages.getSelectedRow(), 0)
.toString();
-
try {
-
DateFormat formatter = new SimpleDateFormat(
"yyyy-MM-dd hh:mm:ss");
client.updateLecturedata(
@@ -382,7 +564,18 @@ public class EditLectureLink_GUI extends JFrame {
Lecture.lecture.getEnddate())
.toString(),
Lecture.lecture.isActive(),
- imagename,
+ modelMyImages
+ .getValueAt(
+ tablemyImages
+ .convertRowIndexToModel(tablemyImages
+ .getSelectedRow()), 6).toString(),
+ modelMyImages
+ .getValueAt(
+ tablemyImages
+ .convertRowIndexToModel(tablemyImages
+ .getSelectedRow()), 7)
+ .toString(),
+ person.verantwortlicher.getUsername(),
person.verantwortlicher.getVorname(),
person.verantwortlicher.getName(),
person.verantwortlicher.getHochschule(),
@@ -390,32 +583,170 @@ public class EditLectureLink_GUI extends JFrame {
person.verantwortlicher.getTel(),
person.verantwortlicher.getFakultaet(),
Lecture.lecture.getid());
+ JOptionPane
+ .showMessageDialog(
+ null,
+ "Ihre Veranstaltung wurde erfolgreich ge�ndert. Sie kehren nun zum Hauptmen\u00fc zur\u00fcck.",
+ "Veranstaltung angelegt",
+ JOptionPane.INFORMATION_MESSAGE);
+ // zurueck zum Menue
+ MainMenue_GUI m = new MainMenue_GUI();
+ m.setVisible(true);
+ } catch (TException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ JOptionPane
+ .showMessageDialog(
+ null,
+ "Beim Anlegen Ihrer Veranstaltung ist ein Fehler aufgetreten.",
+ "Error",
+ JOptionPane.ERROR_MESSAGE);
+ JOptionPane.showMessageDialog(null,
+ e1.getCause()+"\n"+e1.getStackTrace(),
+ "Debug-Message", JOptionPane.ERROR_MESSAGE);
+ }
+
+ dispose();
+ }else if (tablePublicVorlagen.getSelectedRow() != -1 &&tablePublicVorlagen.getValueAt(tablePublicVorlagen.getSelectedRow(), 4).toString().equals(username)){
+
+ // a row is selected, do operations
+ String imagename = tablePublicVorlagen.getValueAt(
+ tablePublicVorlagen.getSelectedRow(), 0)
+ .toString();
+ try {
+ DateFormat formatter = new SimpleDateFormat(
+ "yyyy-MM-dd hh:mm:ss");
+ client.updateLecturedata(
+ Lecture.lecture.getName(),
+ Lecture.lecture.getNewName(),
+ Lecture.lecture.getShortDesc(),
+ Lecture.lecture.getDesc(),
+ formatter.format(
+ Lecture.lecture.getStartdate())
+ .toString(),
+ formatter.format(
+ Lecture.lecture.getEnddate())
+ .toString(),
+ Lecture.lecture.isActive(),
+ modelPublicVorlagen
+ .getValueAt(
+ tablePublicVorlagen
+ .convertRowIndexToModel(tablePublicVorlagen
+ .getSelectedRow()), 6).toString(),
+ modelPublicVorlagen
+ .getValueAt(
+ tablePublicVorlagen
+ .convertRowIndexToModel(tablePublicVorlagen
+ .getSelectedRow()), 7).toString(),
+ person.verantwortlicher.getUsername(),
+ person.verantwortlicher.getVorname(),
+ person.verantwortlicher.getName(),
+ person.verantwortlicher.getHochschule(),
+ person.verantwortlicher.getEMail(),
+ person.verantwortlicher.getTel(),
+ person.verantwortlicher.getFakultaet(),
+ Lecture.lecture.getid());
JOptionPane
.showMessageDialog(
null,
- "Ihre Veranstaltung wurde erfolgreich angelegt. Sie kehren nun zum Hauptmen\u00fc zur\u00fcck.",
+ "Ihre Veranstaltung wurde erfolgreich ge�ndert. Sie kehren nun zum Hauptmen\u00fc zur\u00fcck.",
"Veranstaltung angelegt",
JOptionPane.INFORMATION_MESSAGE);
+ // zurueck zum Menue
+ MainMenue_GUI m = new MainMenue_GUI();
+ m.setVisible(true);
+ } catch (TException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ JOptionPane
+ .showMessageDialog(
+ null,
+ "Beim Anlegen Ihrer Veranstaltung ist ein Fehler aufgetreten.",
+ "Error",
+ JOptionPane.ERROR_MESSAGE);
+ JOptionPane.showMessageDialog(null,
+ e1.getCause()+"\n"+e1.getStackTrace(),
+ "Debug-Message", JOptionPane.ERROR_MESSAGE);
+ }
+
+ dispose();
+
+ }else if (tableAllImages.getSelectedRow() != -1 &&tableAllImages.getValueAt(tableAllImages.getSelectedRow(), 4).toString().equals(username)){
+ // a row is selected, do operations
+ String imagename = tableAllImages.getValueAt(
+ tableAllImages.getSelectedRow(), 0)
+ .toString();
+ try {
+ DateFormat formatter = new SimpleDateFormat(
+ "yyyy-MM-dd hh:mm:ss");
+ client.updateLecturedata(
+ Lecture.lecture.getName(),
+ Lecture.lecture.getNewName(),
+ Lecture.lecture.getShortDesc(),
+ Lecture.lecture.getDesc(),
+ formatter.format(
+ Lecture.lecture.getStartdate())
+ .toString(),
+ formatter.format(
+ Lecture.lecture.getEnddate())
+ .toString(),
+ Lecture.lecture.isActive(),
+ modelAll
+ .getValueAt(
+ tableAllImages
+ .convertRowIndexToModel(tableAllImages
+ .getSelectedRow()), 6)
+ .toString(),
+ modelAll
+ .getValueAt(
+ tableAllImages
+ .convertRowIndexToModel(tableAllImages
+ .getSelectedRow()), 7)
+ .toString(),
+ person.verantwortlicher.getUsername(),
+ person.verantwortlicher.getVorname(),
+ person.verantwortlicher.getName(),
+ person.verantwortlicher.getHochschule(),
+ person.verantwortlicher.getEMail(),
+ person.verantwortlicher.getTel(),
+ person.verantwortlicher.getFakultaet(),
+ Lecture.lecture.getid());
+ JOptionPane
+ .showMessageDialog(
+ null,
+ "Ihre Veranstaltung wurde erfolgreich ge�ndert. Sie kehren nun zum Hauptmen\u00fc zur\u00fcck.",
+ "Veranstaltung angelegt",
+ JOptionPane.INFORMATION_MESSAGE);
+ // zurueck zum Menue
+ MainMenue_GUI m = new MainMenue_GUI();
+ m.setVisible(true);
} catch (TException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
+ JOptionPane
+ .showMessageDialog(
+ null,
+ "Beim Anlegen Ihrer Veranstaltung ist ein Fehler aufgetreten.",
+ "Error",
+ JOptionPane.ERROR_MESSAGE);
+ JOptionPane.showMessageDialog(null,
+ e1.getCause()+"\n"+e1.getStackTrace(),
+ "Debug-Message", JOptionPane.ERROR_MESSAGE);
}
+
+ dispose();
- } else {
+ }
+ else {
// nothing selected
JOptionPane.showMessageDialog(null,
"Bitte w\u00e4hlen Sie ein Image aus.",
"Image Auswahl",
JOptionPane.INFORMATION_MESSAGE);
-
}
- MainMenue_GUI m = new MainMenue_GUI();
- m.setVisible(true);
- dispose();
-
}
});
cancelButton.setActionCommand("Cancel");
@@ -424,22 +755,138 @@ public class EditLectureLink_GUI extends JFrame {
}
JSeparator separator = new JSeparator();
- separator.setBounds(0, 78, 597, 2);
+ separator.setBounds(0, 79, 912, 1);
getContentPane().add(separator);
JSeparator separator_1 = new JSeparator();
- separator_1.setBounds(0, 627, 597, 2);
+ separator_1.setBounds(0, 627, 912, 2);
getContentPane().add(separator_1);
+
+ JPanel panel = new JPanel();
+ panel.setLayout(null);
+ panel.setBorder(new TitledBorder(null, "Detailinformationen",
+
+ TitledBorder.LEADING, TitledBorder.TOP, null, null));
+ panel.setBackground(SystemColor.menu);
+ panel.setBounds(586, 85, 316, 531);
+ getContentPane().add(panel);
+
+ JLabel lblName = new JLabel("Name:");
+ lblName.setBounds(10, 87, 130, 14);
+ panel.add(lblName);
+
+ labelName = new JLabel("");
+ labelName.setBounds(10, 102, 296, 14);
+ panel.add(labelName);
+
+ JLabel lblVerantwortlicher = new JLabel("Verantwortlicher:");
+ lblVerantwortlicher.setBounds(10, 259, 130, 14);
+ panel.add(lblVerantwortlicher);
+
+ labelOS = new JLabel("");
+ labelOS.setBounds(10, 216, 296, 14);
+ panel.add(labelOS);
+
+ JLabel lblWeitereVerantwortliche = new JLabel("Betriebssystem:");
+ lblWeitereVerantwortliche.setBounds(10, 202, 130, 14);
+ panel.add(lblWeitereVerantwortliche);
+
+ labelVerantwortlicher = new JLabel("");
+ labelVerantwortlicher.setBounds(10, 272, 296, 14);
+ panel.add(labelVerantwortlicher);
+
+ JLabel label = new JLabel("Weitere Verantwortliche:");
+ label.setBounds(10, 284, 130, 14);
+ panel.add(label);
+
+ labelWeitereVerantwortliche = new JLabel("");
+ labelWeitereVerantwortliche.setBounds(10, 297, 296, 14);
+ panel.add(labelWeitereVerantwortliche);
+
+ labelUpdate = new JLabel("");
+ labelUpdate.setBounds(10, 245, 296, 14);
+ panel.add(labelUpdate);
+
+ JLabel lblLetztesUpdate = new JLabel("Letztes Update:");
+ lblLetztesUpdate.setBounds(10, 231, 130, 14);
+ panel.add(lblLetztesUpdate);
+
+ JLabel lblImageIstVorlage = new JLabel("Image ist Vorlage:");
+ lblImageIstVorlage.setBounds(10, 336, 130, 14);
+ panel.add(lblImageIstVorlage);
+
+ labelVorlage = new JLabel("");
+ labelVorlage.setBounds(10, 350, 296, 14);
+ panel.add(labelVorlage);
+
+ labelLizenzSoftware = new JLabel("");
+ labelLizenzSoftware.setBounds(10, 383, 296, 14);
+ panel.add(labelLizenzSoftware);
+
+ JLabel lblLizenzpflichtigeSoftware = new JLabel("Lizenzpflichtige Software:");
+ lblLizenzpflichtigeSoftware.setBounds(10, 367, 130, 14);
+ panel.add(lblLizenzpflichtigeSoftware);
+
+ JLabel lblInternet = new JLabel("Internetsperre vorhanden:");
+ lblInternet.setBounds(10, 400, 130, 14);
+ panel.add(lblInternet);
+
+ labelInternet = new JLabel("");
+ labelInternet.setBounds(10, 417, 296, 14);
+ panel.add(labelInternet);
+
+ JLabel lblEmpfehlungRam = new JLabel("Empfehlung RAM:");
+ lblEmpfehlungRam.setBounds(10, 432, 130, 14);
+ panel.add(lblEmpfehlungRam);
+
+ labelRam = new JLabel("");
+ labelRam.setBounds(10, 455, 296, 14);
+ panel.add(labelRam);
+
+ JLabel lblEmpfehlungCpu = new JLabel("Empfehlung CPU:");
+ lblEmpfehlungCpu.setBounds(10, 469, 130, 14);
+ panel.add(lblEmpfehlungCpu);
+
+ labelCPU = new JLabel("");
+ labelCPU.setBounds(10, 487, 296, 14);
+ panel.add(labelCPU);
+
+ JLabel lblTechnischeDaten = new JLabel("Technische Daten:");
+ lblTechnischeDaten.setBounds(10, 322, 296, 14);
+ panel.add(lblTechnischeDaten);
+
+ JLabel lblId = new JLabel("ID:");
+ lblId.setBounds(10, 23, 296, 14);
+ panel.add(lblId);
+
+ labelID = new JLabel("");
+ labelID.setBounds(10, 37, 296, 14);
+ panel.add(labelID);
+
+ labelVersion = new JLabel("");
+ labelVersion.setBounds(10, 73, 296, 14);
+ panel.add(labelVersion);
+
+ JLabel lblVersion = new JLabel("Version:");
+ lblVersion.setBounds(10, 57, 296, 14);
+ panel.add(lblVersion);
+
+ JLabel lblBeschreibung = new JLabel("Beschreibung:");
+ lblBeschreibung.setBounds(10, 119, 130, 14);
+ panel.add(lblBeschreibung);
+
+ JScrollPane scrollPane = new JScrollPane();
+ scrollPane.setBounds(10, 135, 296, 65);
+ panel.add(scrollPane);
+
+ textAreadesc = new JTextArea();
+ textAreadesc.setLineWrap(true);
+ textAreadesc.setBackground(SystemColor.menu);
+ scrollPane.setViewportView(textAreadesc);
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);
@@ -498,35 +945,76 @@ public class EditLectureLink_GUI extends JFrame {
}
- public DefaultTableModel initTableModel(DefaultTableModel model) {
+ // Initiale Beffuelung eines Table models
+ public DefaultTableModel initTableModel(DefaultTableModel model) throws TException, ParseException {
List<server.Image> images;
- try {
+
+ // Hole eine Liste der Images
images = client.getImageList();
+
Iterator<server.Image> i = images.iterator();
- List<Object[]> ListObj = new ArrayList<Object[]>();
+ SimpleDateFormat in=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
+ SimpleDateFormat out=new SimpleDateFormat("dd.MM.yyyy hh:mm:ss");
int x = 0;
while (i.hasNext()) {
-
- i.next();
+ // erzeuge Objekte fuer die Tabelle
Object[] obj = { images.get(x).getImageName(),
images.get(x).getLicenseRestriction(),
images.get(x).getOsName(),
images.get(x).getLectureName(),
images.get(x).getUserData(),
- images.get(x).getUpdateTime(), "", images.get(x).id,
- images.get(x).getVersion() };
- ListObj.add(obj);
- model.addRow(ListObj.get(x));
+ out.format(in.parse(images.get(x).updateTime)), images.get(x).id,
+ images.get(x).getVersion(),
+ images.get(x).getIsTemplate() };
+ // Fuege diese Objekte der Tabelle hinzu
+ model.addRow(obj);
x++;
+ i.next();
}
return model;
- } catch (TException e1) {
+
+
+ }
+ public void writeImageData(String id, String version){
+ try {
+ SimpleDateFormat in=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
+ SimpleDateFormat out=new SimpleDateFormat("dd.MM.yyyy hh:mm:ss");
+ Map<String,String> res=client.getImageData(id,version);
+ labelName.setText(res.get("name"));
+ labelOS.setText(res.get("os"));
+ labelUpdate.setText(out.format(in.parse(res.get("lastupdate"))));
+ labelVerantwortlicher.setText(res.get("owner"));
+ labelWeitereVerantwortliche.setText("Noch nicht Verf�gbar");
+ if(res.get("template").equals("true")){
+ labelVorlage.setText("Ja");
+ }else{
+ labelVorlage.setText("Nein");
+ }
+ if(res.get("license").equals("1")){
+ labelLizenzSoftware.setText("Ja");
+ }
+ else
+ {
+ labelLizenzSoftware.setText("Nein");
+ }
+ if(res.get("internet").equals("1")){
+ labelInternet.setText("Ja");
+ }
+ else
+ {
+ labelInternet.setText("Nein");
+ }
+ labelRam.setText(res.get("ram"));
+ labelCPU.setText(res.get("cpu"));
+ labelID.setText(res.get("id"));
+ labelVersion.setText(res.get("version"));
+ textAreadesc.setText(res.get("desc"));
+ } catch (TException | ParseException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
- return model;
}
}
diff --git a/Dozentenmodul/src/main/java/gui/lecture/EditLectureSearch_GUI.java b/Dozentenmodul/src/main/java/gui/lecture/EditLectureSearch_GUI.java
index 58329ae2..6f0786ef 100644
--- a/Dozentenmodul/src/main/java/gui/lecture/EditLectureSearch_GUI.java
+++ b/Dozentenmodul/src/main/java/gui/lecture/EditLectureSearch_GUI.java
@@ -22,6 +22,7 @@ import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Iterator;
import java.util.List;
+import java.util.Map;
import javax.swing.JButton;
import javax.swing.JFrame;
@@ -36,15 +37,19 @@ import javax.swing.JScrollPane;
import javax.swing.JSeparator;
import javax.swing.JTabbedPane;
import javax.swing.JTable;
+import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.JTextPane;
import javax.swing.RowFilter;
+import javax.swing.ScrollPaneConstants;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.border.EmptyBorder;
import javax.swing.border.TitledBorder;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;
import javax.swing.table.TableRowSorter;
@@ -67,34 +72,40 @@ public class EditLectureSearch_GUI extends JFrame {
String[] result;
JRadioButton rdbtnInternetJa;
JRadioButton rdbtnInternetNein;
+ JLabel labelAktiv;
+ JLabel labelstartdate;
+ JLabel labelenddate;
+ JLabel labelimageversion;
+ JTextArea labelName;
+ JTextArea labelimage;
+ JTextArea labeldesc;
+ JLabel labelVerantwortlicher;
JTable tableAllLectures;
JTable tablemyLectures;
- JTable tableCoopImages;
- JTable tablePublicVorlagen;
- JTable tablePublicImages;
private JTextField textFieldName;
JTabbedPane tabbedPane;
+ boolean activeSearch = false;
String[] titles = { "Veranstaltungsname", "Beschreibung",
"G\u00fcltigkeitsdatum", "Aktiv", "Letzte Benutzung",
"Verantwortlicher", "Image", "Schlagwort", "ID" };
ThriftConnection con = new ThriftConnection();
Client client = models.Client.clientcon.getClient();
- final DefaultTableModel modelAll = new DefaultTableModel(titles, 0){
- public boolean isCellEditable(int rowIndex, int mColIndex) {
- return false;
- }
+ final DefaultTableModel modelAll = new DefaultTableModel(titles, 0) {
+ public boolean isCellEditable(int rowIndex, int mColIndex) {
+ return false;
+ }
};
- final DefaultTableModel modelMyLectures = new DefaultTableModel(titles, 0){
- public boolean isCellEditable(int rowIndex, int mColIndex) {
- return false;
- }
+ final DefaultTableModel modelMyLectures = new DefaultTableModel(titles, 0) {
+ public boolean isCellEditable(int rowIndex, int mColIndex) {
+ return false;
+ }
};
final TableRowSorter<TableModel> rowSorterAll = new TableRowSorter<TableModel>(
modelAll);
final TableRowSorter<TableModel> rowSorterMyLectures = new TableRowSorter<TableModel>(
modelMyLectures);
+ private JTextField textField;
-
/**
* Create the dialog.
*/
@@ -106,6 +117,64 @@ public class EditLectureSearch_GUI extends JFrame {
con.closeThriftConnection();
System.exit(0);
}
+
+ @Override
+ public void windowOpened(WindowEvent arg0) {
+ textFieldName.requestFocusInWindow();
+ try {
+ initTableModel(modelMyLectures);
+ initTableModel(modelAll);
+
+ } catch (ParseException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ // auszublendende Angaben
+ // 1=Beschreibung
+ // 2=G\u00fcltigkeitsdatum
+ // 3=Aktiv
+ // 6=Image
+ // 7=Schlagwort
+ // 8=ID
+ tablemyLectures.getColumnModel().getColumn(1).setWidth(0);
+ tablemyLectures.getColumnModel().getColumn(1).setMinWidth(0);
+ tablemyLectures.getColumnModel().getColumn(1).setMaxWidth(0);
+ tablemyLectures.getColumnModel().getColumn(2).setWidth(0);
+ tablemyLectures.getColumnModel().getColumn(2).setMinWidth(0);
+ tablemyLectures.getColumnModel().getColumn(2).setMaxWidth(0);
+ tablemyLectures.getColumnModel().getColumn(3).setWidth(0);
+ tablemyLectures.getColumnModel().getColumn(3).setMinWidth(0);
+ tablemyLectures.getColumnModel().getColumn(3).setMaxWidth(0);
+ tablemyLectures.getColumnModel().getColumn(6).setWidth(0);
+ tablemyLectures.getColumnModel().getColumn(6).setMinWidth(0);
+ tablemyLectures.getColumnModel().getColumn(6).setMaxWidth(0);
+ tablemyLectures.getColumnModel().getColumn(7).setWidth(0);
+ tablemyLectures.getColumnModel().getColumn(7).setMinWidth(0);
+ tablemyLectures.getColumnModel().getColumn(7).setMaxWidth(0);
+ tablemyLectures.getColumnModel().getColumn(8).setWidth(0);
+ tablemyLectures.getColumnModel().getColumn(8).setMinWidth(0);
+ tablemyLectures.getColumnModel().getColumn(8).setMaxWidth(0);
+
+ tableAllLectures.getColumnModel().getColumn(1).setWidth(0);
+ tableAllLectures.getColumnModel().getColumn(1).setMinWidth(0);
+ tableAllLectures.getColumnModel().getColumn(1).setMaxWidth(0);
+ tableAllLectures.getColumnModel().getColumn(2).setWidth(0);
+ tableAllLectures.getColumnModel().getColumn(2).setMinWidth(0);
+ tableAllLectures.getColumnModel().getColumn(2).setMaxWidth(0);
+ tableAllLectures.getColumnModel().getColumn(3).setWidth(0);
+ tableAllLectures.getColumnModel().getColumn(3).setMinWidth(0);
+ tableAllLectures.getColumnModel().getColumn(3).setMaxWidth(0);
+ tableAllLectures.getColumnModel().getColumn(6).setWidth(0);
+ tableAllLectures.getColumnModel().getColumn(6).setMinWidth(0);
+ tableAllLectures.getColumnModel().getColumn(6).setMaxWidth(0);
+ tableAllLectures.getColumnModel().getColumn(7).setWidth(0);
+ tableAllLectures.getColumnModel().getColumn(7).setMinWidth(0);
+ tableAllLectures.getColumnModel().getColumn(7).setMaxWidth(0);
+ tableAllLectures.getColumnModel().getColumn(8).setWidth(0);
+ tableAllLectures.getColumnModel().getColumn(8).setMinWidth(0);
+ tableAllLectures.getColumnModel().getColumn(8).setMaxWidth(0);
+ }
});
// Verhindert das Vergroessern Des Fensters
setResizable(false);
@@ -119,18 +188,16 @@ public class EditLectureSearch_GUI extends JFrame {
e.printStackTrace();
}
// Setzt den Fenstertitel
- setTitle("bwLehrpool Suite *Prototyp* - Veranstaltung bearbeiten");
+ setTitle("bwLehrpool Suite - Veranstaltung bearbeiten");
// Zentriert das Fenster in die Bildmitte
- setBounds(0, 0, 603, 722);
+ setBounds(0, 0, 842, 722);
GuiOrganizer.centerGUI(this);
- final DefaultTableModel model = new DefaultTableModel(titles, 0);
-
getContentPane().setLayout(null);
{
JPanel panel = new JPanel();
panel.setBackground(SystemColor.menu);
- panel.setBounds(10, 11, 577, 57);
+ panel.setBounds(10, 11, 816, 57);
getContentPane().add(panel);
panel.setLayout(null);
{
@@ -158,12 +225,12 @@ public class EditLectureSearch_GUI extends JFrame {
panel_1.setBackground(SystemColor.menu);
panel_1.setBorder(new TitledBorder(null, "Filterfunktionen",
TitledBorder.LEADING, TitledBorder.TOP, null, null));
- panel_1.setBounds(10, 49, 557, 131);
+ panel_1.setBounds(10, 49, 557, 66);
contentPanel.add(panel_1);
panel_1.setLayout(null);
- JLabel lblNewLabel_2 = new JLabel("Anzeigename:");
- lblNewLabel_2.setBounds(10, 30, 250, 20);
+ JLabel lblNewLabel_2 = new JLabel("Name:");
+ lblNewLabel_2.setBounds(10, 30, 80, 20);
panel_1.add(lblNewLabel_2);
textFieldName = new JTextField();
@@ -173,45 +240,45 @@ public class EditLectureSearch_GUI extends JFrame {
public void keyReleased(KeyEvent e) {
// Textfield eingabe auslesen
String stext = textFieldName.getText();
-
// Wenn Textfield nicht leer
if (stext != "") {
+ activeSearch = true;
// Filtere nach der Eingabe
rowSorterAll.setRowFilter(RowFilter.regexFilter(
textFieldName.getText(), 0));
rowSorterMyLectures.setRowFilter(RowFilter.regexFilter(
textFieldName.getText(), 0));
+ } else {
+ activeSearch = false;
+ String username = person.verantwortlicher.getName() + " "
+ + person.verantwortlicher.getVorname();
+ rowSorterMyLectures.setRowFilter(RowFilter.regexFilter(
+ username, 5));
+ rowSorterAll.setRowFilter(null);
}
}
});
- textFieldName.setBounds(270, 30, 250, 20);
+ textFieldName.setBounds(96, 30, 166, 20);
panel_1.add(textFieldName);
textFieldName.setColumns(10);
-
- JLabel lblErweiterteSuche = new JLabel(
- "<html><u>Erweiterte Suche *Folgt noch*</u></html>");
- lblErweiterteSuche.addMouseListener(new MouseAdapter() {
- @Override
- public void mouseClicked(MouseEvent arg0) {
- // oeffnet das Fenster Extended GUI
-
- //ExtendedSearchForImages_GUI es = new ExtendedSearchForImages_GUI();
- //es.setVisible(true);
- }
- });
- lblErweiterteSuche.setForeground(Color.BLUE);
-
- lblErweiterteSuche.setBounds(326, 106, 194, 14);
- panel_1.add(lblErweiterteSuche);
+
+ JLabel label = new JLabel("Beschreibung:");
+ label.setBounds(291, 30, 80, 20);
+ panel_1.add(label);
+
+ textField = new JTextField();
+ textField.setColumns(10);
+ textField.setBounds(381, 30, 166, 20);
+ panel_1.add(textField);
JLabel lblHauptmen = new JLabel("Hauptmen\u00FC");
lblHauptmen.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent arg0) {
// oeffnet das Hauptmenue
-
+
EditLectureSearch_GUI.this.setVisible(false);
MainMenue_GUI main = new MainMenue_GUI();
main.setVisible(true);
@@ -248,28 +315,69 @@ public class EditLectureSearch_GUI extends JFrame {
rowSorterMyLectures.setRowFilter(RowFilter.regexFilter(
username, 5));
} else if (tabbedPane.getSelectedIndex() == 1) {
-
+ rowSorterAll.setRowFilter(null);
}
}
});
- tabbedPane.setBounds(10, 197, 557, 323);
+ tabbedPane.setBounds(10, 123, 557, 397);
contentPanel.add(tabbedPane);
- initTableModel(modelMyLectures);
JScrollPane scrollPaneAllImages = new JScrollPane();
tableAllLectures = new JTable();
+ tableAllLectures.getSelectionModel().addListSelectionListener(
+ new ListSelectionListener() {
+ public void valueChanged(ListSelectionEvent e) {
+ String imageid = modelAll
+ .getValueAt(
+ tableAllLectures
+ .convertRowIndexToModel(tableAllLectures
+ .getSelectedRow()), 8)
+ .toString();
+ //System.out.println(imageid);
+
+ try {
+ writeLectureData(imageid);
+ } catch (TException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ } catch (ParseException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ }
+ });
tableAllLectures.setModel(modelAll);
tableAllLectures.getColumnModel().getColumn(1).sizeWidthToFit();
tableAllLectures.getColumnModel().getColumn(2).sizeWidthToFit();
tableAllLectures.getColumnModel().getColumn(3).sizeWidthToFit();
tableAllLectures.getColumnModel().getColumn(4).sizeWidthToFit();
tableAllLectures.getColumnModel().getColumn(5).sizeWidthToFit();
- initTableModel(modelAll);
JScrollPane scrollPaneMyImage = new JScrollPane();
tablemyLectures = new JTable();
+ tablemyLectures.getSelectionModel().addListSelectionListener(
+ new ListSelectionListener() {
+ public void valueChanged(ListSelectionEvent e) {
+ String imageid = modelMyLectures.getValueAt(
+ tablemyLectures
+ .convertRowIndexToModel(tablemyLectures
+ .getSelectedRow()), 8)
+ .toString();
+ //System.out.println(imageid);
+
+ try {
+ writeLectureData(imageid);
+ } catch (TException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ } catch (ParseException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ }
+ });
tablemyLectures.setModel(modelMyLectures);
tablemyLectures.getColumnModel().getColumn(1).sizeWidthToFit();
@@ -286,51 +394,9 @@ public class EditLectureSearch_GUI extends JFrame {
scrollPaneAllImages.setViewportView(tableAllLectures);
tabbedPane.addTab("Alle", null, scrollPaneAllImages, null);
-
- JScrollPane scrollPaneCoopImages = new JScrollPane();
- tableCoopImages = new JTable();
- tableCoopImages.setModel(model);
- tableCoopImages.getColumnModel().getColumn(1).sizeWidthToFit();
- tableCoopImages.getColumnModel().getColumn(2).sizeWidthToFit();
- tableCoopImages.getColumnModel().getColumn(3).sizeWidthToFit();
- tableCoopImages.getColumnModel().getColumn(4).sizeWidthToFit();
- tableCoopImages.getColumnModel().getColumn(5).sizeWidthToFit();
-
- scrollPaneCoopImages.setViewportView(tableCoopImages);
- tabbedPane.addTab("Kooperative Veranstaltungen", null,
- scrollPaneCoopImages, null);
- tabbedPane.setEnabledAt(2, false);
-
- JScrollPane scrollPanePublicImages = new JScrollPane();
- tablePublicImages = new JTable();
- tablePublicImages.setModel(model);
- tablePublicImages.getColumnModel().getColumn(1).sizeWidthToFit();
- tablePublicImages.getColumnModel().getColumn(2).sizeWidthToFit();
- tablePublicImages.getColumnModel().getColumn(3).sizeWidthToFit();
- tablePublicImages.getColumnModel().getColumn(4).sizeWidthToFit();
- tablePublicImages.getColumnModel().getColumn(5).sizeWidthToFit();
-
- scrollPanePublicImages.setViewportView(tablePublicImages);
- tabbedPane.addTab("\u00D6ffentliche Images", null,
- scrollPanePublicImages, null);
- tabbedPane.setEnabledAt(3, false);
-
- JScrollPane scrollPanePublicVorlagen = new JScrollPane();
- tablePublicVorlagen = new JTable();
- tablePublicVorlagen.setModel(model);
- tablePublicVorlagen.getColumnModel().getColumn(1).sizeWidthToFit();
- tablePublicVorlagen.getColumnModel().getColumn(2).sizeWidthToFit();
- tablePublicVorlagen.getColumnModel().getColumn(3).sizeWidthToFit();
- tablePublicVorlagen.getColumnModel().getColumn(4).sizeWidthToFit();
- tablePublicVorlagen.getColumnModel().getColumn(5).sizeWidthToFit();
-
- scrollPanePublicVorlagen.setViewportView(tablePublicVorlagen);
- tabbedPane.addTab("\u00D6ffentliche Vorlagen", null,
- scrollPanePublicVorlagen, null);
- tabbedPane.setEnabledAt(4, false);
{
JPanel buttonPane = new JPanel();
- buttonPane.setBounds(0, 640, 597, 33);
+ buttonPane.setBounds(0, 640, 826, 33);
buttonPane.setBackground(SystemColor.menu);
buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
getContentPane().add(buttonPane);
@@ -339,7 +405,7 @@ public class EditLectureSearch_GUI extends JFrame {
btnBack.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
// oeffnet das Hauptmenue
-
+
MainMenue_GUI main = new MainMenue_GUI();
main.setVisible(true);
dispose();
@@ -353,103 +419,185 @@ public class EditLectureSearch_GUI extends JFrame {
JButton btnContinue = new JButton("Weiter");
btnContinue.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
+ String username = person.verantwortlicher.getName()
+ + " " + person.verantwortlicher.getVorname();
// check if a row is selected
- if ((tableAllLectures.getSelectedRow() != -1)
- || (tablemyLectures.getSelectedRow() != -1)
- || (tableCoopImages.getSelectedRow() != -1)
- || (tablePublicImages.getSelectedRow() != -1)
- || (tablePublicVorlagen.getSelectedRow() != -1)) {
+ if (tablemyLectures.getSelectedRow() != -1) {
// a row is selected, do operations
- if (tabbedPane.getSelectedIndex() == 0) {
+ Lecture.lecture.setid(modelMyLectures
+ .getValueAt(
+ tablemyLectures
+ .convertRowIndexToModel(tablemyLectures
+ .getSelectedRow()),
+ 8).toString());
+ Lecture.lecture.setName(modelMyLectures
+ .getValueAt(
+ tablemyLectures
+ .convertRowIndexToModel(tablemyLectures
+ .getSelectedRow()),
+ 0).toString());
+ Lecture.lecture.setDesc(modelMyLectures
+ .getValueAt(
+ tablemyLectures
+ .convertRowIndexToModel(tablemyLectures
+ .getSelectedRow()),
+ 1).toString());
+ String date = modelMyLectures
+ .getValueAt(
+ tablemyLectures
+ .convertRowIndexToModel(tablemyLectures
+ .getSelectedRow()),
+ 2).toString();
+
+ Lecture.lecture.setLinkedImagename(modelMyLectures
+ .getValueAt(
+ tablemyLectures
+ .convertRowIndexToModel(tablemyLectures
+ .getSelectedRow()),
+ 6).toString());
+
+ int zweitesLeerzeichen = date.indexOf(" ",
+ date.indexOf(" ") + 1);
+
+ String startdate = date.substring(0,
+ zweitesLeerzeichen);
+ String enddate = date.substring(zweitesLeerzeichen);
+ SimpleDateFormat out = new SimpleDateFormat(
+ "yyyy-MM-dd HH:mm:ss");
+ SimpleDateFormat in = new SimpleDateFormat(
+ "dd.MM.yyyy HH:mm:ss");
+ try {
+ enddate = out.format(in.parse(enddate));
+ startdate = out.format(in.parse(startdate));
+ } catch (ParseException e2) {
+ // TODO Auto-generated catch block
+ e2.printStackTrace();
+ }
- Lecture.lecture.setid(modelMyLectures
- .getValueAt(
- tablemyLectures
- .convertRowIndexToModel(tablemyLectures
- .getSelectedRow()),
- 8).toString());
- Lecture.lecture.setName(modelMyLectures
- .getValueAt(
- tablemyLectures
- .convertRowIndexToModel(tablemyLectures
- .getSelectedRow()),
- 0).toString());
- Lecture.lecture.setDesc(modelMyLectures
- .getValueAt(
- tablemyLectures
- .convertRowIndexToModel(tablemyLectures
- .getSelectedRow()),
- 1).toString());
- String date = modelMyLectures
- .getValueAt(
- tablemyLectures
- .convertRowIndexToModel(tablemyLectures
- .getSelectedRow()),
- 2).toString();
-
- Lecture.lecture.setLinkedImagename(modelMyLectures
- .getValueAt(
- tablemyLectures
- .convertRowIndexToModel(tablemyLectures
- .getSelectedRow()),
- 6).toString());
-
- int zweitesLeerzeichen = date.indexOf(" ",
- date.indexOf(" ") + 1);
-
- String startdate = date.substring(0,
- zweitesLeerzeichen);
- String enddate = date
- .substring(zweitesLeerzeichen);
- DateFormat df = new SimpleDateFormat(
- "yyyy-MM-dd hh:mm:ss");
-
- try {
- // Format has to be "yyyy-MM-dd hh:mm:ss"
- Lecture.lecture.setEnddate(df
- .parse(enddate));
- Lecture.lecture.setStartdate(df
- .parse(startdate));
- } catch (ParseException e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
- }
- if (modelMyLectures
+ DateFormat df = new SimpleDateFormat(
+ "yyyy-MM-dd HH:mm:ss");
+
+ try {
+ // Format has to be "yyyy-MM-dd HH:mm:ss"
+ Lecture.lecture.setEnddate(df.parse(enddate));
+ Lecture.lecture.setStartdate(df
+ .parse(startdate));
+ } catch (ParseException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ if (modelMyLectures
+ .getValueAt(
+ tablemyLectures
+ .convertRowIndexToModel(tablemyLectures
+ .getSelectedRow()),
+ 3).toString().equals("1")) {
+ Lecture.lecture.setActive(true);
+ } else {
+ Lecture.lecture.setActive(false);
+ }
+
+ // EditImageAllgemein_GUI ea=new
+ // EditImageAllgemein_GUI();
+ EditLectureAllgemein_GUI el = new EditLectureAllgemein_GUI();
+ el.setVisible(true);
+ dispose();
+ } else if (tableAllLectures.getSelectedRow() != -1
+ && tableAllLectures
.getValueAt(
- tablemyLectures
- .convertRowIndexToModel(tablemyLectures
- .getSelectedRow()),
- 3).toString().equals("1")) {
- Lecture.lecture.setActive(true);
- } else {
- Lecture.lecture.setActive(false);
- }
-
-
- // EditImageAllgemein_GUI ea=new
- // EditImageAllgemein_GUI();
- EditLectureAllgemein_GUI el = new EditLectureAllgemein_GUI();
- el.setVisible(true);
- dispose();
+ tableAllLectures
+ .getSelectedRow(), 5)
+ .toString().equals(username)) {
+
+ // a row is selected, do operations
+
+ Lecture.lecture.setid(modelAll
+ .getValueAt(
+ tableAllLectures
+ .convertRowIndexToModel(tableAllLectures
+ .getSelectedRow()),
+ 8).toString());
+ Lecture.lecture.setName(modelAll
+ .getValueAt(
+ tableAllLectures
+ .convertRowIndexToModel(tableAllLectures
+ .getSelectedRow()),
+ 0).toString());
+ Lecture.lecture.setDesc(modelAll
+ .getValueAt(
+ tableAllLectures
+ .convertRowIndexToModel(tableAllLectures
+ .getSelectedRow()),
+ 1).toString());
+ String date = modelAll
+ .getValueAt(
+ tableAllLectures
+ .convertRowIndexToModel(tableAllLectures
+ .getSelectedRow()),
+ 2).toString();
+
+ Lecture.lecture.setLinkedImagename(modelAll
+ .getValueAt(
+ tableAllLectures
+ .convertRowIndexToModel(tableAllLectures
+ .getSelectedRow()),
+ 6).toString());
+
+ int zweitesLeerzeichen = date.indexOf(" ",
+ date.indexOf(" ") + 1);
+
+ String startdate = date.substring(0,
+ zweitesLeerzeichen);
+ String enddate = date.substring(zweitesLeerzeichen);
+ SimpleDateFormat out = new SimpleDateFormat(
+ "yyyy-MM-dd HH:mm:ss");
+ SimpleDateFormat in = new SimpleDateFormat(
+ "dd.MM.yyyy HH:mm:ss");
+ try {
+ enddate = out.format(in.parse(enddate));
+ startdate = out.format(in.parse(startdate));
+ } catch (ParseException e2) {
+ // TODO Auto-generated catch block
+ e2.printStackTrace();
+ }
+ DateFormat df = new SimpleDateFormat(
+ "yyyy-MM-dd HH:mm:ss");
+
+ try {
+ // Format has to be "yyyy-MM-dd HH:mm:ss"
+ Lecture.lecture.setEnddate(df.parse(enddate));
+ Lecture.lecture.setStartdate(df
+ .parse(startdate));
+ } catch (ParseException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ if (modelAll
+ .getValueAt(
+ tableAllLectures
+ .convertRowIndexToModel(tableAllLectures
+ .getSelectedRow()),
+ 3).toString().equals("1")) {
+ Lecture.lecture.setActive(true);
} else {
- JOptionPane
- .showMessageDialog(
- null,
- "Bitte w\u00f4hlen Sie ein eigenes Image aus",
- "Message",
- JOptionPane.INFORMATION_MESSAGE);
+ Lecture.lecture.setActive(false);
}
+
+ EditLectureAllgemein_GUI el = new EditLectureAllgemein_GUI();
+ el.setVisible(true);
+ dispose();
} else {
- // nothing selected
- JOptionPane.showMessageDialog(null,
- "Bitte w\u00f4hlen Sie ein Image aus.",
- "Image Auswahl",
- JOptionPane.INFORMATION_MESSAGE);
- }// end check if a row is selected
+ JOptionPane
+ .showMessageDialog(
+ null,
+ "Bitte w\u00e4hlen Sie ein eigenes Image aus.",
+ "Message",
+ JOptionPane.INFORMATION_MESSAGE);
+ } // End Else
+ } // Action
- }
});
btnContinue.setActionCommand("Cancel");
buttonPane.add(btnContinue);
@@ -457,13 +605,105 @@ public class EditLectureSearch_GUI extends JFrame {
}
JSeparator separator = new JSeparator();
- separator.setBounds(0, 78, 597, 2);
+ separator.setBounds(0, 79, 836, 1);
getContentPane().add(separator);
JSeparator separator_1 = new JSeparator();
- separator_1.setBounds(0, 627, 597, 2);
+ separator_1.setBounds(0, 628, 836, 1);
getContentPane().add(separator_1);
+ JPanel panel = new JPanel();
+ panel.setLayout(null);
+ panel.setBorder(new TitledBorder(null, "Detailinformationen",
+
+ TitledBorder.LEADING, TitledBorder.TOP, null, null));
+ panel.setBackground(SystemColor.menu);
+ panel.setBounds(591, 85, 235, 518);
+ getContentPane().add(panel);
+
+ JLabel lblNewLabel_3 = new JLabel("Name:");
+ lblNewLabel_3.setBounds(10, 27, 104, 14);
+ panel.add(lblNewLabel_3);
+
+ JLabel lblAktiv = new JLabel("Aktiv:");
+ lblAktiv.setBounds(10, 98, 104, 14);
+ panel.add(lblAktiv);
+
+ labelAktiv = new JLabel("");
+ labelAktiv.setBounds(10, 114, 218, 14);
+ panel.add(labelAktiv);
+
+ labelstartdate = new JLabel("");
+ labelstartdate.setBounds(10, 147, 218, 14);
+ panel.add(labelstartdate);
+
+ JLabel lblStartdatum = new JLabel("Startdatum:");
+ lblStartdatum.setBounds(10, 129, 104, 14);
+ panel.add(lblStartdatum);
+
+ labelenddate = new JLabel("");
+ labelenddate.setBounds(10, 175, 218, 14);
+ panel.add(labelenddate);
+
+ JLabel lblEnddatum = new JLabel("Enddatum:");
+ lblEnddatum.setBounds(10, 161, 104, 14);
+ panel.add(lblEnddatum);
+
+ JLabel lblBeschreibung = new JLabel("Beschreibung:");
+ lblBeschreibung.setBounds(10, 189, 104, 14);
+ panel.add(lblBeschreibung);
+
+ JLabel lblImage = new JLabel("Image:");
+ lblImage.setBounds(10, 293, 104, 14);
+ panel.add(lblImage);
+
+ labelVerantwortlicher = new JLabel("");
+ labelVerantwortlicher.setBounds(10, 426, 218, 14);
+ panel.add(labelVerantwortlicher);
+
+ JLabel lblVerantwortlicher = new JLabel("Verantwortlicher:");
+ lblVerantwortlicher.setBounds(10, 411, 104, 14);
+ panel.add(lblVerantwortlicher);
+
+ JLabel lblImageversion = new JLabel("Imageversion:");
+ lblImageversion.setBounds(10, 381, 104, 14);
+ panel.add(lblImageversion);
+
+ labelimageversion = new JLabel("");
+ labelimageversion.setBounds(10, 399, 218, 14);
+ panel.add(labelimageversion);
+
+ labeldesc = new JTextArea();
+ labeldesc.setFont(new Font("Tahoma", Font.PLAIN, 11));
+ labeldesc.setEditable(false);
+ labeldesc.setLineWrap(true);
+ labeldesc.setBackground(SystemColor.menu);
+ labeldesc.setBounds(124, 127, 104, 110);
+ JScrollPane scrollPane = new JScrollPane(labeldesc);
+ scrollPane.setBounds(10, 209, 218, 81);
+ panel.add(scrollPane);
+ // panel.add(labeldesc);
+
+ labelimage = new JTextArea();
+ labelimage.setLineWrap(true);
+ labelimage.setFont(new Font("Tahoma", Font.PLAIN, 11));
+ labelimage.setEditable(false);
+ labelimage.setBackground(SystemColor.menu);
+ labelimage.setBounds(124, 248, 101, 81);
+ JScrollPane scrollPaneImage = new JScrollPane(labelimage);
+ scrollPaneImage.setBounds(10, 309, 215, 69);
+ panel.add(scrollPaneImage);
+
+ labelName = new JTextArea();
+ labelName.setEditable(false);
+ labelName.setFont(new Font("Tahoma", Font.PLAIN, 11));
+ labelName.setBackground(SystemColor.menu);
+ labelName.setBounds(124, 22, 101, 55);
+ JScrollPane scrollPaneName = new JScrollPane(labelName);
+ scrollPaneName.setBounds(10, 40, 218, 55);
+ panel.add(scrollPaneName);
+ // panel.add(labelName);
+ // panel.add(labelimage);
JMenuBar menuBar = new JMenuBar();
setJMenuBar(menuBar);
@@ -474,15 +714,15 @@ public class EditLectureSearch_GUI extends JFrame {
mntmFaq.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent arg0) {
-
+
OpenLinks open = new OpenLinks();
-
+
URI windows;
try {
windows = new URI(Links.getFAQ());
-
+
open.openWebpage(windows);
-
+
} catch (URISyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
@@ -490,7 +730,6 @@ public class EditLectureSearch_GUI extends JFrame {
}
});
mnNewMenu_1.add(mntmFaq);
-
JMenuItem mntmOtrs = new JMenuItem("OTRS");
mntmOtrs.addMouseListener(new MouseAdapter() {
@@ -498,22 +737,22 @@ public class EditLectureSearch_GUI extends JFrame {
public void mousePressed(MouseEvent arg0) {
OpenLinks open = new OpenLinks();
-
+
URI windows;
try {
windows = new URI(Links.getOTRS());
-
+
open.openWebpage(windows);
-
+
} catch (URISyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
-
+
}
});
mnNewMenu_1.add(mntmOtrs);
-
+
JMenuItem mntmAbout = new JMenuItem("About");
mntmAbout.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
@@ -526,27 +765,32 @@ public class EditLectureSearch_GUI extends JFrame {
}
// Initiale Beffuelung eines Table models
- public DefaultTableModel initTableModel(DefaultTableModel model) {
+ public DefaultTableModel initTableModel(DefaultTableModel model)
+ throws ParseException {
List<server.Lecture> lectures;
try {
// Hole eine Liste der Images
lectures = client.getLectureList();
Iterator<server.Lecture> i = lectures.iterator();
-
+ SimpleDateFormat in = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ SimpleDateFormat out = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss");
int x = 0;
while (i.hasNext()) {
// erzeuge Objekte fuer die Tabelle
+
Object[] obj = {
lectures.get(x).lecturename,
lectures.get(x).desc,
- lectures.get(x).starttime + " "
- + lectures.get(x).endtime,
- lectures.get(x).isActive, lectures.get(x).lastused,
- lectures.get(x).username, " ",
- lectures.get(x).imagename, lectures.get(x).id };
+ out.format(in.parse(lectures.get(x).starttime)) + " "
+ + out.format(in.parse(lectures.get(x).endtime)),
+ lectures.get(x).isActive,
+ out.format(in.parse(lectures.get(x).lastused)),
+ lectures.get(x).username, lectures.get(x).imagename,
+ " ", lectures.get(x).id };
// Fuege diese Objekte der Tabelle hinzu
model.addRow(obj);
+
x++;
i.next();
@@ -560,4 +804,21 @@ public class EditLectureSearch_GUI extends JFrame {
return model;
}
+ public void writeLectureData(String id) throws TException, ParseException {
+
+ SimpleDateFormat in = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ SimpleDateFormat out = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss");
+ Map<String, String> res = client.getLectureData(id);
+ labelName.setText(res.get("name"));
+ labelAktiv.setText(res.get("isActive"));
+ labeldesc.setText(res.get("desc"));
+ labelVerantwortlicher.setText(res.get("owner"));
+ labelstartdate.setText(out.format(in.parse(res.get("startTime"))));
+ labelenddate.setText(out.format(in.parse(res.get("endTime"))));
+ labelimage.setText(res.get("imagepath").substring(
+ res.get("imagepath").indexOf("/") + 1));
+ labelimageversion.setText(res.get("imageversion"));
+
+ }
+
}
diff --git a/Dozentenmodul/src/main/java/gui/lecture/ExtendedSearchForLectures_GUI.java b/Dozentenmodul/src/main/java/gui/lecture/ExtendedSearchForLectures_GUI.java
deleted file mode 100644
index 9afb1790..00000000
--- a/Dozentenmodul/src/main/java/gui/lecture/ExtendedSearchForLectures_GUI.java
+++ /dev/null
@@ -1,269 +0,0 @@
-package gui.lecture;
-
-
-import gui.image.CreateImageAllgemein_GUI;
-import gui.image.FTPCreateUploader_GUI;
-import gui.intro.About_GUI;
-
-import java.awt.FlowLayout;
-import java.awt.Font;
-import java.awt.SystemColor;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.net.URI;
-import java.net.URISyntaxException;
-
-import javax.swing.JButton;
-import javax.swing.JCheckBox;
-import javax.swing.JComboBox;
-import javax.swing.JFrame;
-import javax.swing.JLabel;
-import javax.swing.JMenu;
-import javax.swing.JMenuBar;
-import javax.swing.JMenuItem;
-import javax.swing.JPanel;
-import javax.swing.JSeparator;
-import javax.swing.JTextField;
-import javax.swing.JTextPane;
-import javax.swing.UIManager;
-import javax.swing.UnsupportedLookAndFeelException;
-import javax.swing.border.EmptyBorder;
-import javax.swing.border.TitledBorder;
-
-import models.Links;
-import util.GuiOrganizer;
-import util.OpenLinks;
-
-@SuppressWarnings("serial")
-public class ExtendedSearchForLectures_GUI extends JFrame {
-
- private final JPanel contentPanel = new JPanel();
- String[] result;
- private JTextField textField;
- private JTextField textField_1;
-
-
- /**
- * Create the dialog.
- */
- public ExtendedSearchForLectures_GUI() {
-
- setResizable(false);
-
- try {
- UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
- } catch (ClassNotFoundException | InstantiationException
- | IllegalAccessException | UnsupportedLookAndFeelException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- setTitle("bwLehrpool Suite *Prototyp* - Erweiterte Suche");
- setBounds(0, 0, 603, 722);
- GuiOrganizer.centerGUI(this);
-
- getContentPane().setLayout(null);
- {
- JPanel panel = new JPanel();
- panel.setBackground(SystemColor.menu);
- panel.setBounds(10, 11, 577, 57);
- getContentPane().add(panel);
- panel.setLayout(null);
- {
- JLabel lblNewLabel = new JLabel("Weitere Suchoptionen");
- lblNewLabel.setBounds(10, 11, 509, 22);
- panel.add(lblNewLabel);
- lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18));
- }
-
- JTextPane txtpnBitteWhlenSie = new JTextPane();
- txtpnBitteWhlenSie.setEditable(false);
- txtpnBitteWhlenSie.setBackground(SystemColor.menu);
- txtpnBitteWhlenSie.setText("beschreibung");
- txtpnBitteWhlenSie.setBounds(10, 36, 509, 32);
- panel.add(txtpnBitteWhlenSie);
- }
- contentPanel.setBounds(10, 85, 577, 493);
- contentPanel.setBackground(SystemColor.menu);
- contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
- getContentPane().add(contentPanel);
- contentPanel.setLayout(null);
-
- JPanel panel_1 = new JPanel();
- panel_1.setBackground(SystemColor.menu);
- panel_1.setBorder(new TitledBorder(null, "Image-Typ", TitledBorder.LEADING, TitledBorder.TOP, null, null));
- panel_1.setBounds(10, 11, 557, 95);
- contentPanel.add(panel_1);
- panel_1.setLayout(null);
-
- JLabel lblNewLabel_2 = new JLabel("Image-Typ");
- lblNewLabel_2.setBounds(10, 39, 176, 20);
- panel_1.add(lblNewLabel_2);
-
- JCheckBox chckbxBestehendesImage = new JCheckBox("Bestehendes Image");
- chckbxBestehendesImage.setSelected(true);
- chckbxBestehendesImage.setBounds(192, 38, 138, 23);
- panel_1.add(chckbxBestehendesImage);
-
- JCheckBox chckbxRohling = new JCheckBox("Rohling");
- chckbxRohling.setSelected(true);
- chckbxRohling.setBounds(332, 38, 97, 23);
- panel_1.add(chckbxRohling);
-
- JPanel panel = new JPanel();
- panel.setLayout(null);
- panel.setBorder(new TitledBorder(null, "Image-Inhalt", TitledBorder.LEADING, TitledBorder.TOP, null, null));
- panel.setBackground(SystemColor.menu);
- panel.setBounds(10, 117, 557, 95);
- contentPanel.add(panel);
-
- JLabel lblEnthalteneSoftware = new JLabel("Enthaltene Software");
- lblEnthalteneSoftware.setBounds(10, 39, 176, 20);
- panel.add(lblEnthalteneSoftware);
-
- textField = new JTextField();
- textField.setBounds(196, 39, 351, 20);
- panel.add(textField);
- textField.setColumns(10);
-
- JLabel lblNewLabel_1 = new JLabel("Bitte mit ; getrennt angeben");
- lblNewLabel_1.setBounds(196, 70, 351, 14);
- panel.add(lblNewLabel_1);
-
- JPanel panel_2 = new JPanel();
- panel_2.setLayout(null);
- panel_2.setBorder(new TitledBorder(null, "Informationen zum Ersteller", TitledBorder.LEADING, TitledBorder.TOP, null, null));
- panel_2.setBackground(SystemColor.menu);
- panel_2.setBounds(10, 223, 557, 123);
- contentPanel.add(panel_2);
-
- JLabel lblNachnameDesErstellers = new JLabel("Nachname des Erstellers");
- lblNachnameDesErstellers.setBounds(10, 39, 176, 20);
- panel_2.add(lblNachnameDesErstellers);
-
- textField_1 = new JTextField();
- textField_1.setColumns(10);
- textField_1.setBounds(196, 39, 351, 20);
- panel_2.add(textField_1);
-
- JLabel lblHochschuleuniversitt = new JLabel("Hochschule/Universit\u00E4t");
- lblHochschuleuniversitt.setBounds(10, 70, 176, 20);
- panel_2.add(lblHochschuleuniversitt);
-
- JComboBox<String> comboBox = new JComboBox<String>();
- comboBox.setBounds(196, 70, 351, 20);
- panel_2.add(comboBox);
- {
- JPanel buttonPane = new JPanel();
- buttonPane.setBounds(0, 640, 597, 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) {
-
-
- CreateImageAllgemein_GUI sr=new CreateImageAllgemein_GUI();
- sr.setVisible(true);
- dispose();
- }
- });
- okButton.setActionCommand("OK");
- buttonPane.add(okButton);
- getRootPane().setDefaultButton(okButton);
- }
- {
- JButton cancelButton = new JButton("\u00DCbernehmen");
- cancelButton.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
-
-
- FTPCreateUploader_GUI ea=new FTPCreateUploader_GUI();
- ea.setVisible(true);
- dispose();
-
- }
- });
- cancelButton.setActionCommand("Cancel");
- buttonPane.add(cancelButton);
- }
- }
-
- JSeparator separator = new JSeparator();
- separator.setBounds(0, 78, 597, 2);
- getContentPane().add(separator);
-
- JSeparator separator_1 = new JSeparator();
- separator_1.setBounds(0, 627, 597, 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");
- mntmFaq.addMouseListener(new MouseAdapter() {
- @Override
- public void mousePressed(MouseEvent arg0) {
-
- OpenLinks open = new OpenLinks();
-
- URI windows;
- try {
- windows = new URI(Links.getFAQ());
-
- open.openWebpage(windows);
-
- } catch (URISyntaxException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- });
- mnNewMenu_1.add(mntmFaq);
-
-
- JMenuItem mntmOtrs = new JMenuItem("OTRS");
- mntmOtrs.addMouseListener(new MouseAdapter() {
- @Override
- public void mousePressed(MouseEvent arg0) {
-
- OpenLinks open = new OpenLinks();
-
- URI windows;
- try {
- windows = new URI(Links.getOTRS());
-
- open.openWebpage(windows);
-
- } catch (URISyntaxException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
- }
- });
- mnNewMenu_1.add(mntmOtrs);
-
- JMenuItem mntmAbout = new JMenuItem("About");
- mntmAbout.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- About_GUI ab = new About_GUI();
- ab.setVisible(true);
- }
- });
- mnNewMenu_1.add(mntmAbout);
-
- }
-}
diff --git a/Dozentenmodul/src/main/java/gui/lecture/PermissionCreateLecture_GUI.java b/Dozentenmodul/src/main/java/gui/lecture/PermissionCreateLecture_GUI.java
new file mode 100644
index 00000000..cfd2337c
--- /dev/null
+++ b/Dozentenmodul/src/main/java/gui/lecture/PermissionCreateLecture_GUI.java
@@ -0,0 +1,546 @@
+package gui.lecture;
+
+
+import gui.intro.About_GUI;
+import gui.intro.MainMenue_GUI;
+
+import java.awt.Checkbox;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.FlowLayout;
+import java.awt.Font;
+import java.awt.SystemColor;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import javax.swing.AbstractButton;
+import javax.swing.ButtonGroup;
+import javax.swing.DefaultComboBoxModel;
+import javax.swing.Icon;
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JComboBox;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.JPanel;
+import javax.swing.JSeparator;
+import javax.swing.JTextPane;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+import javax.swing.border.EmptyBorder;
+import javax.swing.border.TitledBorder;
+import javax.swing.table.DefaultTableCellRenderer;
+import javax.swing.table.DefaultTableModel;
+import javax.swing.table.JTableHeader;
+import javax.swing.table.TableCellEditor;
+import javax.swing.table.TableCellRenderer;
+import javax.swing.table.TableColumn;
+import javax.swing.table.TableColumnModel;
+
+import models.Image;
+import models.Links;
+import util.GuiOrganizer;
+import util.OpenLinks;
+import javax.swing.JTable;
+import javax.swing.JScrollPane;
+import javax.swing.ScrollPaneConstants;
+import javax.swing.JTextField;
+
+import org.eclipse.jface.viewers.CheckboxCellEditor;
+
+import java.awt.Choice;
+import javax.swing.JRadioButton;
+
+@SuppressWarnings("serial")
+public class PermissionCreateLecture_GUI extends JFrame {
+
+ private final JPanel contentPanel = new JPanel();
+ String[] result;
+ private JTable table;
+ private Class[] classes;
+ Object[] titles = { "Name","Read", "Write","Admin"};
+
+ final DefaultTableModel model = new DefaultTableModel(titles, 0){
+
+
+
+ public boolean isCellEditable(int rowIndex, int mColIndex) {
+ if(mColIndex>=1){
+ return true;
+ }
+ return false;
+ }
+ public Class getColumnClass(int c) {
+ switch(c){
+ case 0:
+ return String.class;
+ default:
+ return Boolean.class;
+ }
+ }
+
+
+
+ };
+ private JTextField textField;
+ private JTable table_1;
+ private final ButtonGroup buttonGroup = new ButtonGroup();
+
+ public PermissionCreateLecture_GUI() {
+ addWindowListener(new WindowAdapter() {
+ @Override
+ public void windowClosing(WindowEvent arg0) {
+ System.exit(0);
+ }
+ });
+ setResizable(false);
+
+ try {
+ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+ } catch (ClassNotFoundException | InstantiationException
+ | IllegalAccessException | UnsupportedLookAndFeelException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ setTitle("bwLehrpool Suite - Berechtigungen");
+
+ setBounds(0, 0, 603, 722);
+ GuiOrganizer.centerGUI(this);
+
+ getContentPane().setLayout(null);
+ {
+ JPanel panel = new JPanel();
+ panel.setBackground(SystemColor.menu);
+ panel.setBounds(10, 11, 577, 57);
+ getContentPane().add(panel);
+ panel.setLayout(null);
+ {
+ JLabel lblNewLabel = new JLabel("Veranstaltungen - Berechtigungen (Nur zur Veranschaulichung)");
+ lblNewLabel.setBounds(10, 11, 509, 22);
+ panel.add(lblNewLabel);
+ lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18));
+ }
+
+ JTextPane txtpnBitteWhlenSie = new JTextPane();
+ txtpnBitteWhlenSie.setEditable(false);
+ txtpnBitteWhlenSie.setBackground(SystemColor.menu);
+ txtpnBitteWhlenSie.setText("Definieren Sie hier bitte die gew\u00FCnschten Berechtigungen f\u00FCr ihr Lecture");
+ txtpnBitteWhlenSie.setBounds(10, 36, 509, 32);
+ panel.add(txtpnBitteWhlenSie);
+ }
+ contentPanel.setBounds(10, 85, 577, 531);
+ contentPanel.setBackground(SystemColor.menu);
+ contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
+ getContentPane().add(contentPanel);
+ contentPanel.setLayout(null);
+
+ JPanel panel_1 = new JPanel();
+ panel_1.setBackground(SystemColor.menu);
+ panel_1.setBorder(new TitledBorder(null, "Suite-Berechtigungen", TitledBorder.LEADING, TitledBorder.TOP, null, null));
+ panel_1.setBounds(10, 207, 311, 313);
+ contentPanel.add(panel_1);
+ panel_1.setLayout(null);
+
+ JScrollPane scrollPane = new JScrollPane();
+ scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
+ scrollPane.setBounds(10, 21, 291, 249);
+ panel_1.add(scrollPane);
+
+ table = new JTable();
+ table.setModel(model);
+ table.setSelectionForeground(Color.WHITE);
+ Object[] rowdata={"Max Mustermann", new Boolean(false),new Boolean(false),new Boolean(false),new Boolean(false)};
+ model.addRow(rowdata);
+
+ TableCellRenderer rend=table.getTableHeader().getDefaultRenderer();
+
+
+ TableColumn tc1 = table.getColumnModel().getColumn(1);
+ tc1.setCellEditor(table.getDefaultEditor(Boolean.class));
+ tc1.setCellRenderer(table.getDefaultRenderer(Boolean.class));
+ tc1.setHeaderRenderer(new CheckBoxHeader(new MyItemListener1(),(String) titles[1]));
+
+ TableColumn tc2 = table.getColumnModel().getColumn(2);
+ tc2.setCellEditor(table.getDefaultEditor(Boolean.class));
+ tc2.setCellRenderer(table.getDefaultRenderer(Boolean.class));
+ tc2.setHeaderRenderer(new CheckBoxHeader(new MyItemListener2(),(String) titles[2]));
+
+ TableColumn tc3 = table.getColumnModel().getColumn(3);
+ tc3.setCellEditor(table.getDefaultEditor(Boolean.class));
+ tc3.setCellRenderer(table.getDefaultRenderer(Boolean.class));
+ tc3.setHeaderRenderer(new CheckBoxHeader(new MyItemListener3(),(String) titles[3]));
+ /*
+ TableColumn tc4 = table.getColumnModel().getColumn(4);
+ tc4.setCellEditor(table.getDefaultEditor(Boolean.class));
+ tc4.setCellRenderer(table.getDefaultRenderer(Boolean.class));
+ tc4.setHeaderRenderer(new CheckBoxHeader(new MyItemListener4(),(String) titles[4]));
+ */
+ scrollPane.setViewportView(table);
+
+ JButton btnHinzufgen_1 = new JButton("Hinzuf\u00FCgen");
+ btnHinzufgen_1.setEnabled(false);
+ btnHinzufgen_1.setBounds(10, 279, 89, 23);
+ panel_1.add(btnHinzufgen_1);
+
+ JButton btnLschen_1 = new JButton("L\u00F6schen");
+ btnLschen_1.setEnabled(false);
+ btnLschen_1.setBounds(109, 279, 89, 23);
+ panel_1.add(btnLschen_1);
+
+ JLabel lblHauptmen = new JLabel("Hauptmen\u00FC");
+ lblHauptmen.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseClicked(MouseEvent arg0) {
+
+ PermissionCreateLecture_GUI.this.setVisible(false);
+ MainMenue_GUI main=new MainMenue_GUI();
+ main.setVisible(true);
+ }
+ });
+ lblHauptmen.setForeground(Color.BLUE);
+ lblHauptmen.setBounds(10, 11, 61, 14);
+ contentPanel.add(lblHauptmen);
+
+ JLabel label_1 = new JLabel(">");
+ label_1.setBounds(69, 11, 13, 14);
+ contentPanel.add(label_1);
+
+ JLabel lblVlimage = new JLabel("Veranstaltung");
+ lblVlimage.setForeground(Color.BLUE);
+ lblVlimage.setBounds(81, 11, 90, 14);
+ contentPanel.add(lblVlimage);
+
+ JLabel label_2 = new JLabel(">");
+ label_2.setBounds(181, 11, 13, 14);
+ contentPanel.add(label_2);
+
+ JLabel lblNewLabel_1 = new JLabel("Berechtigungen");
+ lblNewLabel_1.setBounds(194, 11, 95, 14);
+ contentPanel.add(lblNewLabel_1);
+
+ JLabel lblName = new JLabel("Name:");
+ lblName.setBounds(10, 36, 46, 20);
+ contentPanel.add(lblName);
+
+ textField = new JTextField();
+ textField.setBounds(69, 36, 171, 20);
+ contentPanel.add(textField);
+ textField.setColumns(10);
+
+ JLabel lblHochschule = new JLabel("Hochschule:");
+ lblHochschule.setBounds(275, 36, 80, 20);
+ contentPanel.add(lblHochschule);
+
+ JComboBox comboBox = new JComboBox();
+ comboBox.setModel(new DefaultComboBoxModel(new String[] {"Hochschule Offenburg", "Hochschule Reutlingen", "Universit\u00E4t Freiburg"}));
+ comboBox.setBounds(365, 36, 202, 20);
+ contentPanel.add(comboBox);
+
+ JPanel panel = new JPanel();
+ panel.setBounds(10, 67, 557, 129);
+ contentPanel.add(panel);
+ panel.setLayout(null);
+ panel.setBorder(new TitledBorder(null, "Beschreibung", TitledBorder.LEADING, TitledBorder.TOP, null, null));
+ panel.setBackground(SystemColor.menu);
+
+ JLabel label = new JLabel("Read");
+ label.setBounds(20, 18, 90, 20);
+ panel.add(label);
+
+ JLabel label_3 = new JLabel("Write");
+ label_3.setBounds(20, 38, 90, 20);
+ panel.add(label_3);
+
+ JLabel label_5 = new JLabel("Admin");
+ label_5.setBounds(20, 78, 90, 20);
+ panel.add(label_5);
+
+ JLabel label_7 = new JLabel("Image darf gelesen und gestartet werden und ist in Suchfenster sichtbar.");
+ label_7.setBounds(120, 18, 380, 20);
+ panel.add(label_7);
+
+ JLabel lblimageDarfAngepasst = new JLabel("<HTML>Image darf angepasst und &uuml;berschrieben, jedoch nicht gel&ouml;scht werden. Berechtigungen f&uuml;r andere Benutzer festlegen</HTML>");
+ lblimageDarfAngepasst.setBounds(120, 38, 380, 45);
+ panel.add(lblimageDarfAngepasst);
+
+ JLabel lblvolleRechteRead = new JLabel("<HTML>Volle Rechte: read, write, l&ouml;schen und Berechtigungen f&uuml;r andere Benutzer festlegen.</HTML>");
+ lblvolleRechteRead.setBounds(120, 78, 380, 40);
+ panel.add(lblvolleRechteRead);
+
+ JPanel panel_2 = new JPanel();
+ panel_2.setBounds(331, 207, 236, 313);
+ contentPanel.add(panel_2);
+ panel_2.setLayout(null);
+ panel_2.setBorder(new TitledBorder(null, "Sichtbarkeit im VMChooser", TitledBorder.LEADING, TitledBorder.TOP, null, null));
+ panel_2.setBackground(SystemColor.menu);
+
+ JScrollPane scrollPane_1 = new JScrollPane();
+ scrollPane_1.setEnabled(false);
+ scrollPane_1.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
+ scrollPane_1.setBounds(23, 83, 203, 185);
+ panel_2.add(scrollPane_1);
+
+ table_1 = new JTable();
+ scrollPane_1.setViewportView(table_1);
+
+ JRadioButton rdbtnAlle = new JRadioButton("Sichtbar f\u00FCr alle");
+ rdbtnAlle.setEnabled(false);
+ rdbtnAlle.setSelected(true);
+ buttonGroup.add(rdbtnAlle);
+ rdbtnAlle.setBounds(6, 27, 109, 23);
+ panel_2.add(rdbtnAlle);
+
+ JRadioButton rdbtnIndividuell = new JRadioButton("Individuell");
+ rdbtnIndividuell.setEnabled(false);
+ buttonGroup.add(rdbtnIndividuell);
+ rdbtnIndividuell.setBounds(6, 53, 109, 23);
+ panel_2.add(rdbtnIndividuell);
+
+ JButton btnHinzufgen = new JButton("Hinzuf\u00FCgen");
+ btnHinzufgen.setEnabled(false);
+ btnHinzufgen.setBounds(23, 279, 89, 23);
+ panel_2.add(btnHinzufgen);
+
+ JButton btnLschen = new JButton("L\u00F6schen");
+ btnLschen.setEnabled(false);
+ btnLschen.setBounds(122, 279, 89, 23);
+ panel_2.add(btnLschen);
+ {
+ JPanel buttonPane = new JPanel();
+ buttonPane.setBounds(0, 640, 597, 33);
+ buttonPane.setBackground(SystemColor.menu);
+ buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
+ getContentPane().add(buttonPane);
+ {
+ JButton cancelButton = new JButton("Zur\u00FCck");
+ cancelButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+
+
+ CreateLectureAllgemein_GUI sr=new CreateLectureAllgemein_GUI();
+ sr.setVisible(true);
+ dispose();
+ }
+ });
+ cancelButton.setActionCommand("OK");
+ buttonPane.add(cancelButton);
+ //getRootPane().setDefaultButton(cancelButton);
+ }
+ {
+ JButton continueButton = new JButton("Weiter");
+ continueButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+
+ CreateLectureLink_GUI ea=new CreateLectureLink_GUI();
+ ea.setVisible(true);
+ dispose();
+
+ }
+ });
+ continueButton.setActionCommand("Cancel");
+ buttonPane.add(continueButton);
+ getRootPane().setDefaultButton(continueButton);
+ }
+ }
+
+ JSeparator separator = new JSeparator();
+ separator.setBounds(0, 78, 597, 2);
+ getContentPane().add(separator);
+
+ JSeparator separator_1 = new JSeparator();
+ separator_1.setBounds(0, 627, 597, 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");
+ mntmFaq.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mousePressed(MouseEvent arg0) {
+
+ OpenLinks open = new OpenLinks();
+
+ URI windows;
+ try {
+ windows = new URI(Links.getFAQ());
+
+ open.openWebpage(windows);
+
+ } catch (URISyntaxException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ });
+ mnNewMenu_1.add(mntmFaq);
+
+
+ JMenuItem mntmOtrs = new JMenuItem("OTRS");
+ mntmOtrs.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mousePressed(MouseEvent arg0) {
+
+ OpenLinks open = new OpenLinks();
+
+ URI windows;
+ try {
+ windows = new URI(Links.getOTRS());
+
+ open.openWebpage(windows);
+
+ } catch (URISyntaxException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ }
+ });
+ mnNewMenu_1.add(mntmOtrs);
+
+ JMenuItem mntmAbout = new JMenuItem("About");
+ mntmAbout.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ About_GUI ab = new About_GUI();
+ ab.setVisible(true);
+ }
+ });
+ mnNewMenu_1.add(mntmAbout);
+
+ }
+ class MyItemListener1 implements ItemListener
+ {
+ public void itemStateChanged(ItemEvent e) {
+ Object source = e.getSource();
+ if (source instanceof AbstractButton == false) return;
+ boolean checked = e.getStateChange() == ItemEvent.SELECTED;
+ for(int x = 0, y = table.getRowCount(); x < y; x++)
+ {
+ table.setValueAt(new Boolean(checked),x,1);
+ }
+ }
+ }
+ class MyItemListener2 implements ItemListener
+ {
+ public void itemStateChanged(ItemEvent e) {
+ Object source = e.getSource();
+ if (source instanceof AbstractButton == false) return;
+ boolean checked = e.getStateChange() == ItemEvent.SELECTED;
+ for(int x = 0, y = table.getRowCount(); x < y; x++)
+ {
+ table.setValueAt(new Boolean(checked),x,2);
+ }
+ }
+ }
+ class MyItemListener3 implements ItemListener
+ {
+ public void itemStateChanged(ItemEvent e) {
+ Object source = e.getSource();
+ if (source instanceof AbstractButton == false) return;
+ boolean checked = e.getStateChange() == ItemEvent.SELECTED;
+ for(int x = 0, y = table.getRowCount(); x < y; x++)
+ {
+ table.setValueAt(new Boolean(checked),x,3);
+ }
+ }
+ }
+ class MyItemListener4 implements ItemListener
+ {
+ public void itemStateChanged(ItemEvent e) {
+ Object source = e.getSource();
+ if (source instanceof AbstractButton == false) return;
+ boolean checked = e.getStateChange() == ItemEvent.SELECTED;
+ for(int x = 0, y = table.getRowCount(); x < y; x++)
+ {
+ table.setValueAt(new Boolean(checked),x,4);
+ }
+ }
+ }
+}
+class CheckBoxHeader extends JCheckBox
+implements TableCellRenderer, MouseListener {
+protected CheckBoxHeader rendererComponent;
+protected int column;
+protected boolean mousePressed = false;
+
+public CheckBoxHeader(ItemListener itemListener ,String text) {
+rendererComponent = this;
+rendererComponent.addItemListener(itemListener);
+rendererComponent.setText(text);
+}
+
+public Component getTableCellRendererComponent(
+ JTable table, Object value,
+ boolean isSelected, boolean hasFocus, int row, int column) {
+if (table != null) {
+ JTableHeader header = table.getTableHeader();
+ if (header != null) {
+ rendererComponent.setForeground(header.getForeground());
+ rendererComponent.setBackground(header.getBackground());
+ rendererComponent.setFont(header.getFont());
+ rendererComponent.setBorder(header.getBorder());
+ header.addMouseListener(rendererComponent);
+ }
+}
+setColumn(column);
+//rendererComponent.setText("Check All");
+//setBorder(UIManager.getBorder("TableHeader.cellBorder"));
+
+return rendererComponent;
+}
+protected void setColumn(int column) {
+this.column = column;
+}
+public int getColumn() {
+return column;
+}
+protected void handleClickEvent(MouseEvent e) {
+if (mousePressed) {
+ mousePressed=false;
+ JTableHeader header = (JTableHeader)(e.getSource());
+ JTable tableView = header.getTable();
+ TableColumnModel columnModel = tableView.getColumnModel();
+ int viewColumn = columnModel.getColumnIndexAtX(e.getX());
+ int column = tableView.convertColumnIndexToModel(viewColumn);
+
+ if (viewColumn == this.column && e.getClickCount() == 1 && column != -1) {
+ doClick();
+ }
+}
+}
+public void mouseClicked(MouseEvent e) {
+handleClickEvent(e);
+((JTableHeader)e.getSource()).repaint();
+}
+public void mousePressed(MouseEvent e) {
+mousePressed = true;
+}
+public void mouseReleased(MouseEvent e) {
+}
+public void mouseEntered(MouseEvent e) {
+}
+public void mouseExited(MouseEvent e) {
+}
+}
diff --git a/Dozentenmodul/src/main/java/gui/image/PermissionImage_GUI.java b/Dozentenmodul/src/main/java/gui/lecture/PermissionEditLecture_GUI.java
index 43b5eb48..da8864c7 100644
--- a/Dozentenmodul/src/main/java/gui/image/PermissionImage_GUI.java
+++ b/Dozentenmodul/src/main/java/gui/lecture/PermissionEditLecture_GUI.java
@@ -1,4 +1,4 @@
-package gui.image;
+package gui.lecture;
import gui.intro.About_GUI;
@@ -64,14 +64,13 @@ import org.eclipse.jface.viewers.CheckboxCellEditor;
import java.awt.Choice;
@SuppressWarnings("serial")
-public class PermissionImage_GUI extends JFrame {
+public class PermissionEditLecture_GUI extends JFrame {
private final JPanel contentPanel = new JPanel();
String[] result;
private JTable table;
private Class[] classes;
- Object[] titles = { "Name","Read", "Write",
- "Admin", "ChangePermission"};
+ Object[] titles = { "Name","Read", "Write","Admin"};
final DefaultTableModel model = new DefaultTableModel(titles, 0){
@@ -96,15 +95,8 @@ public class PermissionImage_GUI extends JFrame {
};
private JTextField textField;
- /**
- * Create the dialog.
- */
- public static void main(String [ ] args)
- {
- PermissionImage_GUI gui=new PermissionImage_GUI();
- gui.setVisible(true);
- }
- public PermissionImage_GUI() {
+
+ public PermissionEditLecture_GUI() {
addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent arg0) {
@@ -120,7 +112,7 @@ public class PermissionImage_GUI extends JFrame {
// TODO Auto-generated catch block
e.printStackTrace();
}
- setTitle("bwLehrpool Suite *Prototyp* - Image erzeugen");
+ setTitle("bwLehrpool Suite - Berechtigungen");
setBounds(0, 0, 603, 722);
GuiOrganizer.centerGUI(this);
@@ -133,7 +125,7 @@ public class PermissionImage_GUI extends JFrame {
getContentPane().add(panel);
panel.setLayout(null);
{
- JLabel lblNewLabel = new JLabel("Image Berechtigungen");
+ JLabel lblNewLabel = new JLabel("Lecture Berechtigungen (Nur zur Veranschaulichung)");
lblNewLabel.setBounds(10, 11, 509, 22);
panel.add(lblNewLabel);
lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18));
@@ -142,7 +134,7 @@ public class PermissionImage_GUI extends JFrame {
JTextPane txtpnBitteWhlenSie = new JTextPane();
txtpnBitteWhlenSie.setEditable(false);
txtpnBitteWhlenSie.setBackground(SystemColor.menu);
- txtpnBitteWhlenSie.setText("Definieren Sie hier bitte die gew\u00FCnschten Berechtigungen f\u00FCr ihr Image");
+ txtpnBitteWhlenSie.setText("Definieren Sie hier bitte die gew\u00FCnschten Berechtigungen f\u00FCr ihr Lecture");
txtpnBitteWhlenSie.setBounds(10, 36, 509, 32);
panel.add(txtpnBitteWhlenSie);
}
@@ -152,22 +144,53 @@ public class PermissionImage_GUI extends JFrame {
getContentPane().add(contentPanel);
contentPanel.setLayout(null);
+ JPanel panel = new JPanel();
+ panel.setLayout(null);
+ panel.setBorder(new TitledBorder(null, "Beschreibung", TitledBorder.LEADING, TitledBorder.TOP, null, null));
+ panel.setBackground(SystemColor.menu);
+ panel.setBounds(10, 67, 557, 129);
+ contentPanel.add(panel);
+
+ JLabel label = new JLabel("Read");
+ label.setBounds(20, 18, 90, 20);
+ panel.add(label);
+
+ JLabel label_3 = new JLabel("Image darf gelesen und gestartet werden und ist in Suchfenster sichtbar.");
+ label_3.setBounds(120, 18, 380, 20);
+ panel.add(label_3);
+
+ JLabel label_4 = new JLabel("Write");
+ label_4.setBounds(20, 38, 90, 20);
+ panel.add(label_4);
+
+ JLabel label_5 = new JLabel("<HTML>Image darf angepasst und überschrieben, jedoch nicht gelöscht werden. Berechtigungen für andere Benutzer festlegen</HTML>");
+ label_5.setBounds(120, 38, 380, 45);
+ panel.add(label_5);
+
+ JLabel label_6 = new JLabel("Admin");
+ label_6.setBounds(20, 78, 90, 20);
+ panel.add(label_6);
+
+ JLabel label_7 = new JLabel("<HTML>Volle Rechte: read, write, löschen und Berechtigungen für andere Benutzer festlegen.</HTML>");
+ label_7.setBounds(120, 78, 380, 40);
+ panel.add(label_7);
+
JPanel panel_1 = new JPanel();
panel_1.setBackground(SystemColor.menu);
panel_1.setBorder(new TitledBorder(null, "Berechtigungen", TitledBorder.LEADING, TitledBorder.TOP, null, null));
- panel_1.setBounds(10, 75, 557, 445);
+ panel_1.setBounds(10, 207, 557, 313);
contentPanel.add(panel_1);
panel_1.setLayout(null);
JScrollPane scrollPane = new JScrollPane();
scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
- scrollPane.setBounds(10, 21, 537, 413);
+ scrollPane.setBounds(10, 21, 537, 281);
panel_1.add(scrollPane);
table = new JTable();
table.setModel(model);
table.setSelectionForeground(Color.WHITE);
- Object[] rowdata={"Spitzer Tobias", new Boolean(false),new Boolean(false),new Boolean(false),new Boolean(false)};
+ Object[] rowdata={"Max Mustermann", new Boolean(false),new Boolean(false),new Boolean(false),new Boolean(false)};
model.addRow(rowdata);
TableCellRenderer rend=table.getTableHeader().getDefaultRenderer();
@@ -187,12 +210,12 @@ public class PermissionImage_GUI extends JFrame {
tc3.setCellEditor(table.getDefaultEditor(Boolean.class));
tc3.setCellRenderer(table.getDefaultRenderer(Boolean.class));
tc3.setHeaderRenderer(new CheckBoxHeader(new MyItemListener3(),(String) titles[3]));
-
+ /*
TableColumn tc4 = table.getColumnModel().getColumn(4);
tc4.setCellEditor(table.getDefaultEditor(Boolean.class));
tc4.setCellRenderer(table.getDefaultRenderer(Boolean.class));
tc4.setHeaderRenderer(new CheckBoxHeader(new MyItemListener4(),(String) titles[4]));
-
+ */
scrollPane.setViewportView(table);
JLabel lblHauptmen = new JLabel("Hauptmen\u00FC");
@@ -200,7 +223,7 @@ public class PermissionImage_GUI extends JFrame {
@Override
public void mouseClicked(MouseEvent arg0) {
- PermissionImage_GUI.this.setVisible(false);
+ PermissionEditLecture_GUI.this.setVisible(false);
MainMenue_GUI main=new MainMenue_GUI();
main.setVisible(true);
}
@@ -213,17 +236,17 @@ public class PermissionImage_GUI extends JFrame {
label_1.setBounds(69, 11, 13, 14);
contentPanel.add(label_1);
- JLabel lblVlimage = new JLabel("VL-Image");
+ JLabel lblVlimage = new JLabel("Veranstaltung");
lblVlimage.setForeground(Color.BLUE);
- lblVlimage.setBounds(81, 11, 45, 14);
+ lblVlimage.setBounds(81, 11, 90, 14);
contentPanel.add(lblVlimage);
JLabel label_2 = new JLabel(">");
- label_2.setBounds(133, 11, 13, 14);
+ label_2.setBounds(181, 11, 13, 14);
contentPanel.add(label_2);
- JLabel lblNewLabel_1 = new JLabel("Neu");
- lblNewLabel_1.setBounds(146, 11, 46, 14);
+ JLabel lblNewLabel_1 = new JLabel("Berechtigungen");
+ lblNewLabel_1.setBounds(194, 11, 99, 14);
contentPanel.add(lblNewLabel_1);
JLabel lblName = new JLabel("Name:");
@@ -240,7 +263,7 @@ public class PermissionImage_GUI extends JFrame {
contentPanel.add(lblHochschule);
JComboBox comboBox = new JComboBox();
- comboBox.setModel(new DefaultComboBoxModel(new String[] {"Hochschule Offenburg", "Universit\u00E4t Freiburg"}));
+ comboBox.setModel(new DefaultComboBoxModel(new String[] {"Hochschule Offenburg", "Hochschule Reutlingen", "Universit\u00E4t Freiburg"}));
comboBox.setBounds(365, 36, 202, 20);
contentPanel.add(comboBox);
{
@@ -255,7 +278,7 @@ public class PermissionImage_GUI extends JFrame {
public void actionPerformed(ActionEvent e) {
- EditImageTechnisch_GUI sr=new EditImageTechnisch_GUI();
+ EditLectureAllgemein_GUI sr=new EditLectureAllgemein_GUI();
sr.setVisible(true);
dispose();
}
@@ -269,7 +292,7 @@ public class PermissionImage_GUI extends JFrame {
continueButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
- FTPEditUploader_GUI ea=new FTPEditUploader_GUI();
+ EditLectureLink_GUI ea=new EditLectureLink_GUI();
ea.setVisible(true);
dispose();
@@ -404,7 +427,7 @@ public class PermissionImage_GUI extends JFrame {
}
}
}
-class CheckBoxHeader extends JCheckBox
+/*class CheckBoxHeader extends JCheckBox
implements TableCellRenderer, MouseListener {
protected CheckBoxHeader rendererComponent;
protected int column;
@@ -468,4 +491,4 @@ public void mouseEntered(MouseEvent e) {
}
public void mouseExited(MouseEvent e) {
}
-}
+} */
diff --git a/Dozentenmodul/src/main/java/gui/lecture/SearchLecture_GUI.java b/Dozentenmodul/src/main/java/gui/lecture/SearchLecture_GUI.java
index 6035ebf5..7a6c2118 100644
--- a/Dozentenmodul/src/main/java/gui/lecture/SearchLecture_GUI.java
+++ b/Dozentenmodul/src/main/java/gui/lecture/SearchLecture_GUI.java
@@ -1,453 +1,627 @@
-package gui.lecture;
-
-import gui.intro.About_GUI;
-import gui.intro.MainMenue_GUI;
-
-import java.awt.Color;
-import java.awt.FlowLayout;
-import java.awt.Font;
-import java.awt.SystemColor;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.KeyAdapter;
-import java.awt.event.KeyEvent;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.swing.JButton;
-import javax.swing.JFrame;
-import javax.swing.JLabel;
-import javax.swing.JMenu;
-import javax.swing.JMenuBar;
-import javax.swing.JMenuItem;
-import javax.swing.JPanel;
-import javax.swing.JRadioButton;
-import javax.swing.JScrollPane;
-import javax.swing.JSeparator;
-import javax.swing.JTabbedPane;
-import javax.swing.JTable;
-import javax.swing.JTextField;
-import javax.swing.JTextPane;
-import javax.swing.RowFilter;
-import javax.swing.UIManager;
-import javax.swing.UnsupportedLookAndFeelException;
-import javax.swing.border.EmptyBorder;
-import javax.swing.border.TitledBorder;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-import javax.swing.table.DefaultTableModel;
-import javax.swing.table.TableModel;
-import javax.swing.table.TableRowSorter;
-
-import models.Links;
-import models.person;
-
-import org.apache.thrift.TException;
-
-import server.Server.Client;
-import thrift.ThriftConnection;
-import util.GuiOrganizer;
-import util.OpenLinks;
-
-@SuppressWarnings("serial")
-public class SearchLecture_GUI extends JFrame {
-
- private final JPanel contentPanel = new JPanel();
- String[] result;
- JRadioButton rdbtnInternetJa;
- JRadioButton rdbtnInternetNein;
- JTable tableAllLectures;
- JTable tablemyLectures;
- JTable tableCoopImages;
- JTable tablePublicVorlagen;
- JTable tablePublicImages;
- private JTextField textFieldName;
- JTabbedPane tabbedPane;
- String[] titles = { "Veranstaltungsname", "Beschreibung",
- "G\u00fcltigkeitsdatum", "Aktiv", "Letzte Benutzung",
- "Verantwortlicher", "Image", "Schlagwort", "ID" };
- ThriftConnection con = new ThriftConnection();
- Client client = models.Client.clientcon.getClient();
- final DefaultTableModel modelAll = new DefaultTableModel(titles, 0){
- public boolean isCellEditable(int rowIndex, int mColIndex) {
- return false;
- }
- };
- final DefaultTableModel modelMyLectures = new DefaultTableModel(titles, 0){
- public boolean isCellEditable(int rowIndex, int mColIndex) {
- return false;
- }
- };
- final TableRowSorter<TableModel> rowSorterAll = new TableRowSorter<TableModel>(
- modelAll);
- final TableRowSorter<TableModel> rowSorterMyLectures = new TableRowSorter<TableModel>(
- modelMyLectures);
-
-
- /**
- * Create the dialog.
- */
- public SearchLecture_GUI() {
- addWindowListener(new WindowAdapter() {
- @Override
- public void windowClosing(WindowEvent arg0) {
- // Beendet die Anwendung nach klick auf X
- con.closeThriftConnection();
- System.exit(0);
- }
- });
- // Verhindert das Vergroessern Des Fensters
- setResizable(false);
-
- try {
- // Setzt das Look & Feel auf System
- UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
- } catch (ClassNotFoundException | InstantiationException
- | IllegalAccessException | UnsupportedLookAndFeelException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- // Setzt den Fenstertitel
- setTitle("bwLehrpool Suite *Prototyp* - Veranstaltung suchen");
- // Zentriert das Fenster in die Bildmitte 2;
- setBounds(0, 0, 603, 722);
- GuiOrganizer.centerGUI(this);
-
- final DefaultTableModel model = new DefaultTableModel(titles, 0);
-
- getContentPane().setLayout(null);
- {
- JPanel panel = new JPanel();
- panel.setBackground(SystemColor.menu);
- panel.setBounds(10, 11, 577, 57);
- getContentPane().add(panel);
- panel.setLayout(null);
- {
- JLabel lblNewLabel = new JLabel("Suche nach Veranstaltung");
- lblNewLabel.setBounds(10, 11, 509, 22);
- panel.add(lblNewLabel);
- lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18));
- }
-
- JTextPane txtpnBitteWhlenSie = new JTextPane();
- txtpnBitteWhlenSie.setEditable(false);
- txtpnBitteWhlenSie.setBackground(SystemColor.menu);
- txtpnBitteWhlenSie
- .setText("Hier k\u00F6nnen Sie nach Ihrem gew\u00FCnschten VL-Image suchen und dieses f\u00FCr weitere Schritte ausw\u00E4hlen");
- txtpnBitteWhlenSie.setBounds(10, 36, 509, 32);
- panel.add(txtpnBitteWhlenSie);
- }
- contentPanel.setBounds(10, 85, 577, 531);
- contentPanel.setBackground(SystemColor.menu);
- contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
- getContentPane().add(contentPanel);
- contentPanel.setLayout(null);
-
- JPanel panel_1 = new JPanel();
- panel_1.setBackground(SystemColor.menu);
- panel_1.setBorder(new TitledBorder(null, "Filterfunktionen",
- TitledBorder.LEADING, TitledBorder.TOP, null, null));
- panel_1.setBounds(10, 49, 557, 131);
- contentPanel.add(panel_1);
- panel_1.setLayout(null);
-
- JLabel lblNewLabel_2 = new JLabel("Anzeigename:");
- lblNewLabel_2.setBounds(10, 30, 250, 20);
- panel_1.add(lblNewLabel_2);
-
- textFieldName = new JTextField();
- // Key Listener der Tastatureingabe registriert
- textFieldName.addKeyListener(new KeyAdapter() {
- @Override
- public void keyReleased(KeyEvent e) {
- // Textfield eingabe auslesen
- String stext = textFieldName.getText();
-
- // Wenn Textfield nicht leer
- if (stext != "") {
- // Filtere nach der Eingabe
- rowSorterAll.setRowFilter(RowFilter.regexFilter(
- textFieldName.getText(), 0));
- rowSorterMyLectures.setRowFilter(RowFilter.regexFilter(
- textFieldName.getText(), 0));
-
- }
- }
- });
-
- textFieldName.setBounds(270, 30, 250, 20);
- panel_1.add(textFieldName);
- textFieldName.setColumns(10);
-
- JLabel lblErweiterteSuche = new JLabel(
- "<html><u>Erweiterte Suche *Folgt noch*</u></html>");
- lblErweiterteSuche.addMouseListener(new MouseAdapter() {
- @Override
- public void mouseClicked(MouseEvent arg0) {
- // oeffnet das Fenster Extended GUI
-
- //ExtendedSearchForImages_GUI es = new ExtendedSearchForImages_GUI();
- //es.setVisible(true);
- }
- });
- lblErweiterteSuche.setForeground(Color.BLUE);
-
- lblErweiterteSuche.setBounds(315, 106, 205, 14);
- panel_1.add(lblErweiterteSuche);
-
- JLabel lblHauptmen = new JLabel("Hauptmen\u00FC");
- lblHauptmen.addMouseListener(new MouseAdapter() {
- @Override
- public void mouseClicked(MouseEvent arg0) {
- // oeffnet das Hauptmenue
-
- SearchLecture_GUI.this.setVisible(false);
- MainMenue_GUI main = new MainMenue_GUI();
- main.setVisible(true);
- }
- });
- lblHauptmen.setForeground(Color.BLUE);
- lblHauptmen.setBounds(10, 11, 61, 14);
- contentPanel.add(lblHauptmen);
-
- JLabel label_1 = new JLabel(">");
- label_1.setBounds(69, 11, 13, 14);
- contentPanel.add(label_1);
-
- JLabel lblVlimage = new JLabel("Veranstaltung");
- lblVlimage.setForeground(Color.BLUE);
- lblVlimage.setBounds(81, 11, 75, 14);
- contentPanel.add(lblVlimage);
-
- JLabel label_2 = new JLabel(">");
- label_2.setBounds(152, 11, 13, 14);
- contentPanel.add(label_2);
-
- JLabel lblNewLabel_1 = new JLabel("Veranstaltungsauswahl");
- lblNewLabel_1.setBounds(166, 11, 128, 14);
- contentPanel.add(lblNewLabel_1);
-
- tabbedPane = new JTabbedPane(JTabbedPane.TOP);
- tabbedPane.addChangeListener(new ChangeListener() {
- public void stateChanged(ChangeEvent arg0) {
- if (tabbedPane.getSelectedIndex() == 0) {
-
- String username = person.verantwortlicher.getName() + " "
- + person.verantwortlicher.getVorname();
- rowSorterMyLectures.setRowFilter(RowFilter.regexFilter(
- username, 5));
- } else if (tabbedPane.getSelectedIndex() == 1) {
-
- }
-
- }
- });
-
- tabbedPane.setBounds(10, 197, 557, 323);
- contentPanel.add(tabbedPane);
- initTableModel(modelMyLectures);
-
- JScrollPane scrollPaneAllImages = new JScrollPane();
- tableAllLectures = new JTable();
- tableAllLectures.setModel(modelAll);
- tableAllLectures.getColumnModel().getColumn(1).sizeWidthToFit();
- tableAllLectures.getColumnModel().getColumn(2).sizeWidthToFit();
- tableAllLectures.getColumnModel().getColumn(3).sizeWidthToFit();
- tableAllLectures.getColumnModel().getColumn(4).sizeWidthToFit();
- tableAllLectures.getColumnModel().getColumn(5).sizeWidthToFit();
- initTableModel(modelAll);
-
- JScrollPane scrollPaneMyImage = new JScrollPane();
- tablemyLectures = new JTable();
- tablemyLectures.setModel(modelMyLectures);
-
- tablemyLectures.getColumnModel().getColumn(1).sizeWidthToFit();
- tablemyLectures.getColumnModel().getColumn(2).sizeWidthToFit();
- tablemyLectures.getColumnModel().getColumn(3).sizeWidthToFit();
- tablemyLectures.getColumnModel().getColumn(4).sizeWidthToFit();
- tablemyLectures.getColumnModel().getColumn(5).sizeWidthToFit();
- tablemyLectures.setRowSorter(rowSorterMyLectures);
-
- scrollPaneMyImage.setViewportView(tablemyLectures);
- tabbedPane.addTab("Meine Veranstaltungen", null, scrollPaneMyImage,
- null);
- tableAllLectures.setRowSorter(rowSorterAll);
-
- scrollPaneAllImages.setViewportView(tableAllLectures);
- tabbedPane.addTab("Alle", null, scrollPaneAllImages, null);
-
- JScrollPane scrollPaneCoopImages = new JScrollPane();
- tableCoopImages = new JTable();
- tableCoopImages.setModel(model);
- tableCoopImages.getColumnModel().getColumn(1).sizeWidthToFit();
- tableCoopImages.getColumnModel().getColumn(2).sizeWidthToFit();
- tableCoopImages.getColumnModel().getColumn(3).sizeWidthToFit();
- tableCoopImages.getColumnModel().getColumn(4).sizeWidthToFit();
- tableCoopImages.getColumnModel().getColumn(5).sizeWidthToFit();
-
- scrollPaneCoopImages.setViewportView(tableCoopImages);
- tabbedPane.addTab("Kooperative Veranstaltungen", null,
- scrollPaneCoopImages, null);
- tabbedPane.setEnabledAt(2, false);
-
- JScrollPane scrollPanePublicImages = new JScrollPane();
- tablePublicImages = new JTable();
- tablePublicImages.setModel(model);
- tablePublicImages.getColumnModel().getColumn(1).sizeWidthToFit();
- tablePublicImages.getColumnModel().getColumn(2).sizeWidthToFit();
- tablePublicImages.getColumnModel().getColumn(3).sizeWidthToFit();
- tablePublicImages.getColumnModel().getColumn(4).sizeWidthToFit();
- tablePublicImages.getColumnModel().getColumn(5).sizeWidthToFit();
-
- scrollPanePublicImages.setViewportView(tablePublicImages);
- tabbedPane.addTab("\u00D6ffentliche Images", null,
- scrollPanePublicImages, null);
- tabbedPane.setEnabledAt(3, false);
-
- JScrollPane scrollPanePublicVorlagen = new JScrollPane();
- tablePublicVorlagen = new JTable();
- tablePublicVorlagen.setModel(model);
- tablePublicVorlagen.getColumnModel().getColumn(1).sizeWidthToFit();
- tablePublicVorlagen.getColumnModel().getColumn(2).sizeWidthToFit();
- tablePublicVorlagen.getColumnModel().getColumn(3).sizeWidthToFit();
- tablePublicVorlagen.getColumnModel().getColumn(4).sizeWidthToFit();
- tablePublicVorlagen.getColumnModel().getColumn(5).sizeWidthToFit();
-
- scrollPanePublicVorlagen.setViewportView(tablePublicVorlagen);
- tabbedPane.addTab("\u00D6ffentliche Vorlagen", null,
- scrollPanePublicVorlagen, null);
- tabbedPane.setEnabledAt(4, false);
- {
- JPanel buttonPane = new JPanel();
- buttonPane.setBounds(0, 640, 597, 33);
- buttonPane.setBackground(SystemColor.menu);
- buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
- getContentPane().add(buttonPane);
- {
- JButton btnBack = new JButton("Zur\u00FCck");
- btnBack.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- // oeffnet das Hauptmenue
-
- MainMenue_GUI main = new MainMenue_GUI();
- main.setVisible(true);
- dispose();
- }
- });
- btnBack.setActionCommand("OK");
- buttonPane.add(btnBack);
- getRootPane().setDefaultButton(btnBack);
- }
- }
-
- JSeparator separator = new JSeparator();
- separator.setBounds(0, 78, 597, 2);
- getContentPane().add(separator);
-
- JSeparator separator_1 = new JSeparator();
- separator_1.setBounds(0, 627, 597, 2);
- getContentPane().add(separator_1);
-
- JMenuBar menuBar = new JMenuBar();
- setJMenuBar(menuBar);
-
- JMenu mnNewMenu_1 = new JMenu("Hilfe");
- menuBar.add(mnNewMenu_1);
-
- JMenuItem mntmFaq = new JMenuItem("FAQ");
- mntmFaq.addMouseListener(new MouseAdapter() {
- @Override
- public void mousePressed(MouseEvent arg0) {
-
- OpenLinks open = new OpenLinks();
-
- URI windows;
- try {
- windows = new URI(Links.getFAQ());
-
- open.openWebpage(windows);
-
- } catch (URISyntaxException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- });
- mnNewMenu_1.add(mntmFaq);
-
-
- JMenuItem mntmOtrs = new JMenuItem("OTRS");
- mntmOtrs.addMouseListener(new MouseAdapter() {
- @Override
- public void mousePressed(MouseEvent arg0) {
-
- OpenLinks open = new OpenLinks();
-
- URI windows;
- try {
- windows = new URI(Links.getOTRS());
-
- open.openWebpage(windows);
-
- } catch (URISyntaxException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
- }
- });
- mnNewMenu_1.add(mntmOtrs);
-
- JMenuItem mntmAbout = new JMenuItem("About");
- mntmAbout.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- About_GUI ab = new About_GUI();
- ab.setVisible(true);
- }
- });
- mnNewMenu_1.add(mntmAbout);
-
- }
-
- // Initiale Beffuelung eines Table models
- public DefaultTableModel initTableModel(DefaultTableModel model) {
- List<server.Lecture> lectures;
- try {
- // Hole eine Liste der Images
- lectures = client.getLectureList();
- Iterator<server.Lecture> i = lectures.iterator();
-
- int x = 0;
-
- while (i.hasNext()) {
- // erzeuge Objekte fuer die Tabelle
- Object[] obj = {
- lectures.get(x).lecturename,
- lectures.get(x).desc,
- lectures.get(x).starttime + " "
- + lectures.get(x).endtime,
- lectures.get(x).isActive, lectures.get(x).lastused,
- lectures.get(x).username, " ",
- lectures.get(x).imagename, lectures.get(x).id };
- // Fuege diese Objekte der Tabelle hinzu
- model.addRow(obj);
- x++;
- i.next();
-
- }
-
- return model;
- } catch (TException e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
- }
- return model;
- }
-
-}
+package gui.lecture;
+
+import gui.intro.About_GUI;
+import gui.intro.MainMenue_GUI;
+
+import java.awt.Color;
+import java.awt.FlowLayout;
+import java.awt.Font;
+import java.awt.Point;
+import java.awt.SystemColor;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.KeyAdapter;
+import java.awt.event.KeyEvent;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.swing.JButton;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+import javax.swing.JScrollPane;
+import javax.swing.JSeparator;
+import javax.swing.JTabbedPane;
+import javax.swing.JTable;
+import javax.swing.JTextField;
+import javax.swing.JTextPane;
+import javax.swing.RowFilter;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+import javax.swing.border.EmptyBorder;
+import javax.swing.border.TitledBorder;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
+import javax.swing.table.DefaultTableModel;
+import javax.swing.table.TableModel;
+import javax.swing.table.TableRowSorter;
+
+import models.Links;
+import models.person;
+
+import org.apache.thrift.TException;
+
+import server.Server.Client;
+import thrift.ThriftConnection;
+import util.GuiOrganizer;
+import util.OpenLinks;
+import javax.swing.JTextArea;
+import javax.swing.ScrollPaneConstants;
+
+@SuppressWarnings("serial")
+public class SearchLecture_GUI extends JFrame {
+
+ private final JPanel contentPanel = new JPanel();
+ String[] result;
+ JRadioButton rdbtnInternetJa;
+ JRadioButton rdbtnInternetNein;
+ JLabel labelAktiv;
+ JLabel labelstartdate;
+ JLabel labelenddate;
+ JLabel labelimageversion;
+ JTextArea labelName;
+ JTextArea labelimage;
+ JTextArea labeldesc;
+ JLabel labelVerantwortlicher;
+ JTable tableAllLectures;
+ JTable tablemyLectures;
+ private JTextField textFieldName;
+ JTabbedPane tabbedPane;
+ boolean activeSearch=false;
+ String[] titles = { "Veranstaltungsname", "Beschreibung",
+ "G\u00fcltigkeitsdatum", "Aktiv", "Letzte Benutzung",
+ "Verantwortlicher", "Image", "Schlagwort", "ID" };
+ ThriftConnection con = new ThriftConnection();
+ Client client = models.Client.clientcon.getClient();
+ final DefaultTableModel modelAll = new DefaultTableModel(titles, 0){
+ public boolean isCellEditable(int rowIndex, int mColIndex) {
+ return false;
+ }
+ };
+ final DefaultTableModel modelMyLectures = new DefaultTableModel(titles, 0){
+ public boolean isCellEditable(int rowIndex, int mColIndex) {
+ return false;
+ }
+ };
+ final TableRowSorter<TableModel> rowSorterAll = new TableRowSorter<TableModel>(
+ modelAll);
+ final TableRowSorter<TableModel> rowSorterMyLectures = new TableRowSorter<TableModel>(
+ modelMyLectures);
+ private JTextField textField;
+
+
+ /**
+ * Create the dialog.
+ */
+ public SearchLecture_GUI() {
+ addWindowListener(new WindowAdapter() {
+ @Override
+ public void windowClosing(WindowEvent arg0) {
+ // Beendet die Anwendung nach klick auf X
+ con.closeThriftConnection();
+ System.exit(0);
+ }
+ @Override
+ public void windowOpened(WindowEvent arg0) {
+ try {
+ initTableModel(modelMyLectures);
+ initTableModel(modelAll);
+
+ } catch (ParseException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ tablemyLectures.getColumnModel().getColumn(1).setWidth(0);
+ tablemyLectures.getColumnModel().getColumn(1).setMinWidth(0);
+ tablemyLectures.getColumnModel().getColumn(1).setMaxWidth(0);
+ tablemyLectures.getColumnModel().getColumn(2).setWidth(0);
+ tablemyLectures.getColumnModel().getColumn(2).setMinWidth(0);
+ tablemyLectures.getColumnModel().getColumn(2).setMaxWidth(0);
+ tablemyLectures.getColumnModel().getColumn(3).setWidth(0);
+ tablemyLectures.getColumnModel().getColumn(3).setMinWidth(0);
+ tablemyLectures.getColumnModel().getColumn(3).setMaxWidth(0);
+ tablemyLectures.getColumnModel().getColumn(6).setWidth(0);
+ tablemyLectures.getColumnModel().getColumn(6).setMinWidth(0);
+ tablemyLectures.getColumnModel().getColumn(6).setMaxWidth(0);
+ tablemyLectures.getColumnModel().getColumn(7).setWidth(0);
+ tablemyLectures.getColumnModel().getColumn(7).setMinWidth(0);
+ tablemyLectures.getColumnModel().getColumn(7).setMaxWidth(0);
+ tablemyLectures.getColumnModel().getColumn(8).setWidth(0);
+ tablemyLectures.getColumnModel().getColumn(8).setMinWidth(0);
+ tablemyLectures.getColumnModel().getColumn(8).setMaxWidth(0);
+ tableAllLectures.getColumnModel().getColumn(1).setWidth(0);
+ tableAllLectures.getColumnModel().getColumn(1).setMinWidth(0);
+ tableAllLectures.getColumnModel().getColumn(1).setMaxWidth(0);
+ tableAllLectures.getColumnModel().getColumn(2).setWidth(0);
+ tableAllLectures.getColumnModel().getColumn(2).setMinWidth(0);
+ tableAllLectures.getColumnModel().getColumn(2).setMaxWidth(0);
+ tableAllLectures.getColumnModel().getColumn(3).setWidth(0);
+ tableAllLectures.getColumnModel().getColumn(3).setMinWidth(0);
+ tableAllLectures.getColumnModel().getColumn(3).setMaxWidth(0);
+ tableAllLectures.getColumnModel().getColumn(6).setWidth(0);
+ tableAllLectures.getColumnModel().getColumn(6).setMinWidth(0);
+ tableAllLectures.getColumnModel().getColumn(6).setMaxWidth(0);
+ tableAllLectures.getColumnModel().getColumn(7).setWidth(0);
+ tableAllLectures.getColumnModel().getColumn(7).setMinWidth(0);
+ tableAllLectures.getColumnModel().getColumn(7).setMaxWidth(0);
+ tableAllLectures.getColumnModel().getColumn(8).setWidth(0);
+ tableAllLectures.getColumnModel().getColumn(8).setMinWidth(0);
+ tableAllLectures.getColumnModel().getColumn(8).setMaxWidth(0);
+ }
+ });
+ // Verhindert das Vergroessern Des Fensters
+ setResizable(false);
+
+ try {
+ // Setzt das Look & Feel auf System
+ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+ } catch (ClassNotFoundException | InstantiationException
+ | IllegalAccessException | UnsupportedLookAndFeelException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ // Setzt den Fenstertitel
+ setTitle("bwLehrpool Suite - Veranstaltung suchen");
+ // Zentriert das Fenster in die Bildmitte 2;
+ setBounds(0, 0, 842, 722);
+ GuiOrganizer.centerGUI(this);
+
+ getContentPane().setLayout(null);
+ {
+ JPanel panel = new JPanel();
+ panel.setBackground(SystemColor.menu);
+ panel.setBounds(10, 11, 816, 57);
+ getContentPane().add(panel);
+ panel.setLayout(null);
+ {
+ JLabel lblNewLabel = new JLabel("Suche nach Veranstaltung");
+ lblNewLabel.setBounds(10, 11, 509, 22);
+ panel.add(lblNewLabel);
+ lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18));
+ }
+
+ JTextPane txtpnBitteWhlenSie = new JTextPane();
+ txtpnBitteWhlenSie.setEditable(false);
+ txtpnBitteWhlenSie.setBackground(SystemColor.menu);
+ txtpnBitteWhlenSie
+ .setText("Hier k\u00F6nnen Sie nach Ihrer gew\u00fcnschten Veranstaltung suchen und diese f\u00fcr weitere Schritte ausw\u00e4hlen.");
+ txtpnBitteWhlenSie.setBounds(10, 36, 509, 32);
+ panel.add(txtpnBitteWhlenSie);
+ }
+ contentPanel.setBounds(10, 85, 577, 531);
+ contentPanel.setBackground(SystemColor.menu);
+ contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
+ getContentPane().add(contentPanel);
+ contentPanel.setLayout(null);
+
+ JPanel panel_1 = new JPanel();
+ panel_1.setBackground(SystemColor.menu);
+ panel_1.setBorder(new TitledBorder(null, "Filterfunktionen",
+ TitledBorder.LEADING, TitledBorder.TOP, null, null));
+ panel_1.setBounds(10, 49, 557, 63);
+ contentPanel.add(panel_1);
+ panel_1.setLayout(null);
+
+ JLabel lblNewLabel_2 = new JLabel("Name:");
+ lblNewLabel_2.setBounds(10, 30, 80, 20);
+ panel_1.add(lblNewLabel_2);
+
+ textFieldName = new JTextField();
+ // Key Listener der Tastatureingabe registriert
+ textFieldName.addKeyListener(new KeyAdapter() {
+ @Override
+ public void keyReleased(KeyEvent e) {
+ // Textfield eingabe auslesen
+ String stext = textFieldName.getText();
+ // Wenn Textfield nicht leer
+ if (stext != "") {
+ activeSearch=true;
+ // Filtere nach der Eingabe
+ rowSorterAll.setRowFilter(RowFilter.regexFilter(
+ textFieldName.getText(), 0));
+ rowSorterMyLectures.setRowFilter(RowFilter.regexFilter(
+ textFieldName.getText(), 0));
+
+ }else{
+ activeSearch=false;
+ String username = person.verantwortlicher.getName() + " "
+ + person.verantwortlicher.getVorname();
+ rowSorterMyLectures.setRowFilter(RowFilter.regexFilter(
+ username, 5));
+ rowSorterAll.setRowFilter(null);
+ }
+ }
+ });
+
+ textFieldName.setBounds(96, 30, 166, 20);
+ panel_1.add(textFieldName);
+ textFieldName.setColumns(10);
+
+ JLabel label = new JLabel("Beschreibung:");
+ label.setBounds(291, 30, 80, 20);
+ panel_1.add(label);
+
+ textField = new JTextField();
+ textField.setColumns(10);
+ textField.setBounds(381, 30, 166, 20);
+ panel_1.add(textField);
+
+ JLabel lblHauptmen = new JLabel("Hauptmen\u00fc");
+ lblHauptmen.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseClicked(MouseEvent arg0) {
+ // oeffnet das Hauptmenue
+
+ SearchLecture_GUI.this.setVisible(false);
+ MainMenue_GUI main = new MainMenue_GUI();
+ main.setVisible(true);
+ }
+ });
+ lblHauptmen.setForeground(Color.BLUE);
+ lblHauptmen.setBounds(10, 11, 61, 14);
+ contentPanel.add(lblHauptmen);
+
+ JLabel label_1 = new JLabel(">");
+ label_1.setBounds(69, 11, 13, 14);
+ contentPanel.add(label_1);
+
+ JLabel lblVlimage = new JLabel("Veranstaltung");
+ lblVlimage.setForeground(Color.BLUE);
+ lblVlimage.setBounds(81, 11, 75, 14);
+ contentPanel.add(lblVlimage);
+
+ JLabel label_2 = new JLabel(">");
+ label_2.setBounds(152, 11, 13, 14);
+ contentPanel.add(label_2);
+
+ JLabel lblNewLabel_1 = new JLabel("Veranstaltungssuche");
+ lblNewLabel_1.setBounds(166, 11, 128, 14);
+ contentPanel.add(lblNewLabel_1);
+
+ tabbedPane = new JTabbedPane(JTabbedPane.TOP);
+ tabbedPane.addChangeListener(new ChangeListener() {
+ public void stateChanged(ChangeEvent arg0) {
+ if (tabbedPane.getSelectedIndex() == 0) {
+
+ String username = person.verantwortlicher.getName() + " "
+ + person.verantwortlicher.getVorname();
+ rowSorterMyLectures.setRowFilter(RowFilter.regexFilter(
+ username, 5));
+ } else if (tabbedPane.getSelectedIndex() == 1) {
+
+ }
+
+ }
+ });
+
+ tabbedPane.setBounds(10, 123, 557, 397);
+ contentPanel.add(tabbedPane);
+
+
+ JScrollPane scrollPaneAllImages = new JScrollPane();
+ tableAllLectures = new JTable();
+ tableAllLectures.getSelectionModel().addListSelectionListener( new ListSelectionListener()
+ {
+ public void valueChanged(ListSelectionEvent e)
+ {
+ String imageid = modelAll
+ .getValueAt(
+ tableAllLectures
+ .convertRowIndexToModel(tableAllLectures
+ .getSelectedRow()), 8)
+ .toString();
+ //System.out.println(imageid);
+
+ try {
+ writeLectureData(imageid);
+ } catch (TException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ } catch (ParseException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ }
+ });
+ tableAllLectures.setModel(modelAll);
+ tableAllLectures.getColumnModel().getColumn(1).sizeWidthToFit();
+ tableAllLectures.getColumnModel().getColumn(2).sizeWidthToFit();
+ tableAllLectures.getColumnModel().getColumn(3).sizeWidthToFit();
+ tableAllLectures.getColumnModel().getColumn(4).sizeWidthToFit();
+ tableAllLectures.getColumnModel().getColumn(5).sizeWidthToFit();
+
+ JScrollPane scrollPaneMyImage = new JScrollPane();
+ tablemyLectures = new JTable();
+ tablemyLectures.getSelectionModel().addListSelectionListener( new ListSelectionListener()
+ {
+ public void valueChanged(ListSelectionEvent e)
+ {
+ String imageid = modelMyLectures
+ .getValueAt(
+ tablemyLectures
+ .convertRowIndexToModel(tablemyLectures
+ .getSelectedRow()), 8)
+ .toString();
+ //System.out.println(imageid);
+
+ try {
+ writeLectureData(imageid);
+ } catch (TException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ } catch (ParseException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ }
+ });
+ tablemyLectures.setModel(modelMyLectures);
+
+ tablemyLectures.getColumnModel().getColumn(1).sizeWidthToFit();
+ tablemyLectures.getColumnModel().getColumn(2).sizeWidthToFit();
+ tablemyLectures.getColumnModel().getColumn(3).sizeWidthToFit();
+ tablemyLectures.getColumnModel().getColumn(4).sizeWidthToFit();
+ tablemyLectures.getColumnModel().getColumn(5).sizeWidthToFit();
+ tablemyLectures.setRowSorter(rowSorterMyLectures);
+
+ scrollPaneMyImage.setViewportView(tablemyLectures);
+ tabbedPane.addTab("Meine Veranstaltungen", null, scrollPaneMyImage,
+ null);
+ tableAllLectures.setRowSorter(rowSorterAll);
+
+ scrollPaneAllImages.setViewportView(tableAllLectures);
+ tabbedPane.addTab("Alle", null, scrollPaneAllImages, null);
+ {
+ JPanel buttonPane = new JPanel();
+ buttonPane.setBounds(0, 640, 826, 33);
+ buttonPane.setBackground(SystemColor.menu);
+ buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
+ getContentPane().add(buttonPane);
+ {
+ JButton btnBack = new JButton("Zur\u00FCck");
+ btnBack.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ // oeffnet das Hauptmenue
+
+ MainMenue_GUI main = new MainMenue_GUI();
+ main.setVisible(true);
+ dispose();
+ }
+ });
+ btnBack.setActionCommand("OK");
+ buttonPane.add(btnBack);
+ getRootPane().setDefaultButton(btnBack);
+ }
+ }
+
+ JSeparator separator = new JSeparator();
+ separator.setBounds(0, 79, 836, 1);
+ getContentPane().add(separator);
+
+ JSeparator separator_1 = new JSeparator();
+ separator_1.setBounds(0, 628, 836, 1);
+ getContentPane().add(separator_1);
+
+ JPanel panel = new JPanel();
+ panel.setLayout(null);
+ panel.setBorder(new TitledBorder(null, "Detailinformationen",
+ TitledBorder.LEADING, TitledBorder.TOP, null, null));
+ panel.setBackground(SystemColor.menu);
+ panel.setBounds(591, 85, 235, 518);
+ getContentPane().add(panel);
+
+ JLabel lblNewLabel_3 = new JLabel("Name:");
+ lblNewLabel_3.setBounds(10, 27, 104, 14);
+ panel.add(lblNewLabel_3);
+
+ JLabel lblAktiv = new JLabel("Aktiv:");
+ lblAktiv.setBounds(10, 98, 104, 14);
+ panel.add(lblAktiv);
+
+ labelAktiv = new JLabel("");
+ labelAktiv.setBounds(10, 114, 218, 14);
+ panel.add(labelAktiv);
+
+ labelstartdate = new JLabel("");
+ labelstartdate.setBounds(10, 147, 218, 14);
+ panel.add(labelstartdate);
+
+ JLabel lblStartdatum = new JLabel("Startdatum:");
+ lblStartdatum.setBounds(10, 129, 104, 14);
+ panel.add(lblStartdatum);
+
+ labelenddate = new JLabel("");
+ labelenddate.setBounds(10, 175, 218, 14);
+ panel.add(labelenddate);
+
+ JLabel lblEnddatum = new JLabel("Enddatum:");
+ lblEnddatum.setBounds(10, 161, 104, 14);
+ panel.add(lblEnddatum);
+
+ JLabel lblBeschreibung = new JLabel("Beschreibung:");
+ lblBeschreibung.setBounds(10, 189, 104, 14);
+ panel.add(lblBeschreibung);
+
+ JLabel lblImage = new JLabel("Image:");
+ lblImage.setBounds(10, 293, 104, 14);
+ panel.add(lblImage);
+
+ labelVerantwortlicher = new JLabel("");
+ labelVerantwortlicher.setBounds(10, 426, 218, 14);
+ panel.add(labelVerantwortlicher);
+
+ JLabel lblVerantwortlicher = new JLabel("Verantwortlicher:");
+ lblVerantwortlicher.setBounds(10, 411, 104, 14);
+ panel.add(lblVerantwortlicher);
+
+ JLabel lblImageversion = new JLabel("Imageversion:");
+ lblImageversion.setBounds(10, 381, 104, 14);
+ panel.add(lblImageversion);
+
+ labelimageversion = new JLabel("");
+ labelimageversion.setBounds(10, 399, 218, 14);
+ panel.add(labelimageversion);
+
+
+ labeldesc = new JTextArea();
+ labeldesc.setFont(new Font("Tahoma", Font.PLAIN, 11));
+ labeldesc.setEditable(false);
+ labeldesc.setLineWrap(true);
+ labeldesc.setBackground(SystemColor.menu);
+ labeldesc.setBounds(124, 127, 104, 110);
+ JScrollPane scrollPane = new JScrollPane(labeldesc);
+ scrollPane.setBounds(10, 209, 218, 81);
+ panel.add(scrollPane);
+ //panel.add(labeldesc);
+
+ labelimage = new JTextArea();
+ labelimage.setLineWrap(true);
+ labelimage.setFont(new Font("Tahoma", Font.PLAIN, 11));
+ labelimage.setEditable(false);
+ labelimage.setBackground(SystemColor.menu);
+ labelimage.setBounds(124, 248, 101, 81);
+ JScrollPane scrollPaneImage = new JScrollPane(labelimage);
+ scrollPaneImage.setBounds(10, 309, 215, 69);
+ panel.add(scrollPaneImage);
+
+ labelName = new JTextArea();
+ labelName.setEditable(false);
+ labelName.setFont(new Font("Tahoma", Font.PLAIN, 11));
+ labelName.setBackground(SystemColor.menu);
+ labelName.setBounds(124, 22, 101, 55);
+ JScrollPane scrollPaneName = new JScrollPane(labelName);
+ scrollPaneName.setBounds(10, 40, 218, 55);
+ panel.add(scrollPaneName);
+ //panel.add(labelName);
+ //panel.add(labelimage);
+
+ JMenuBar menuBar = new JMenuBar();
+ setJMenuBar(menuBar);
+
+ JMenu mnNewMenu_1 = new JMenu("Hilfe");
+ menuBar.add(mnNewMenu_1);
+
+ JMenuItem mntmFaq = new JMenuItem("FAQ");
+ mntmFaq.addMouseListener(new MouseAdapter() {
+ @SuppressWarnings("static-access")
+ @Override
+ public void mousePressed(MouseEvent arg0) {
+
+ OpenLinks open = new OpenLinks();
+
+ URI windows;
+ try {
+ windows = new URI(Links.getFAQ());
+
+ open.openWebpage(windows);
+
+ } catch (URISyntaxException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ });
+ mnNewMenu_1.add(mntmFaq);
+
+
+ JMenuItem mntmOtrs = new JMenuItem("OTRS");
+ mntmOtrs.addMouseListener(new MouseAdapter() {
+ @SuppressWarnings("static-access")
+ @Override
+ public void mousePressed(MouseEvent arg0) {
+
+ OpenLinks open = new OpenLinks();
+
+ URI windows;
+ try {
+ windows = new URI(Links.getOTRS());
+
+ open.openWebpage(windows);
+
+ } catch (URISyntaxException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ }
+ });
+ mnNewMenu_1.add(mntmOtrs);
+
+ JMenuItem mntmAbout = new JMenuItem("About");
+ mntmAbout.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ About_GUI ab = new About_GUI();
+ ab.setVisible(true);
+ }
+ });
+ mnNewMenu_1.add(mntmAbout);
+
+ }
+
+ // Initiale Beffuelung eines Table models
+ public DefaultTableModel initTableModel(DefaultTableModel model) throws ParseException {
+ List<server.Lecture> lectures;
+ try {
+ // Hole eine Liste der Images
+ lectures = client.getLectureList();
+ Iterator<server.Lecture> i = lectures.iterator();
+ SimpleDateFormat in=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ SimpleDateFormat out=new SimpleDateFormat("dd.MM.yyyy HH:mm:ss");
+ int x = 0;
+
+ while (i.hasNext()) {
+ // erzeuge Objekte fuer die Tabelle
+ Object[] obj = {
+ lectures.get(x).lecturename,
+ lectures.get(x).desc,
+ out.format(in.parse(lectures.get(x).starttime)) + " "
+ + out.format(in.parse(lectures.get(x).endtime)),
+ lectures.get(x).isActive, out.format(in.parse(lectures.get(x).lastused)),
+ lectures.get(x).username,
+ lectures.get(x).imagename," " ,lectures.get(x).id };
+ // Fuege diese Objekte der Tabelle hinzu
+ model.addRow(obj);
+ x++;
+ i.next();
+
+ }
+
+ return model;
+ } catch (TException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ return model;
+ }
+ public void writeLectureData(String id) throws TException, ParseException{
+
+ SimpleDateFormat in=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ SimpleDateFormat out=new SimpleDateFormat("dd.MM.yyyy HH:mm:ss");
+ Map<String,String> res=client.getLectureData(id);
+ labelName.setText(res.get("name"));
+ labelAktiv.setText(res.get("isActive"));
+ labeldesc.setText(res.get("desc"));
+ labelVerantwortlicher.setText(res.get("owner"));
+ labelstartdate.setText(out.format(in.parse(res.get("startTime"))));
+ labelenddate.setText(out.format(in.parse(res.get("endTime"))));
+ labelimage.setText(res.get("imagepath").substring(res.get("imagepath").indexOf("/")+1));
+ labelimageversion.setText(res.get("imageversion"));
+
+
+ }
+}
diff --git a/Dozentenmodul/src/main/java/models/Image.java b/Dozentenmodul/src/main/java/models/Image.java
index a18ae8fe..fc31e583 100644
--- a/Dozentenmodul/src/main/java/models/Image.java
+++ b/Dozentenmodul/src/main/java/models/Image.java
@@ -13,6 +13,8 @@ public class Image {
private String newName;
private String imagepath;
+
+ private String OS;
private int shareMode;
@@ -27,16 +29,34 @@ public class Image {
private int cpu;
private long filesize;
+
+ private String desc;
public static Image image =new Image();
-
+
+
+ public String getDesc() {
+ return desc;
+ }
+
+ public void setDesc(String desc) {
+ this.desc = desc;
+ }
+
+ public String getOS() {
+ return OS;
+ }
+
+ public void setOS(String oS) {
+ OS = oS;
+ }
- public int getShareMode() {
+ public int getShareMode() {
return shareMode;
diff --git a/Dozentenmodul/src/main/java/models/ImageRights.java b/Dozentenmodul/src/main/java/models/ImageRights.java
new file mode 100644
index 00000000..1b7e0e55
--- /dev/null
+++ b/Dozentenmodul/src/main/java/models/ImageRights.java
@@ -0,0 +1,45 @@
+package models;
+
+public class ImageRights {
+
+ private int read;
+ private int write;
+ private int changePermission;
+ private int admin;
+ private int linkAllowed;
+
+ public static ImageRights rights =new ImageRights();
+ public int getRead() {
+ return read;
+ }
+ public void setRead(int read) {
+ this.read = read;
+ }
+ public int getWrite() {
+ return write;
+ }
+ public void setWrite(int write) {
+ this.write = write;
+ }
+ public int getChangePermission() {
+ return changePermission;
+ }
+ public void setChangePermission(int changePermission) {
+ this.changePermission = changePermission;
+ }
+ public int getAdmin() {
+ return admin;
+ }
+ public void setAdmin(int admin) {
+ this.admin = admin;
+ }
+ public int getLinkAllowed() {
+ return linkAllowed;
+ }
+ public void setLinkAllowed(int linkAllowed) {
+ this.linkAllowed = linkAllowed;
+ }
+
+
+
+}
diff --git a/Dozentenmodul/src/main/java/models/LectureRights.java b/Dozentenmodul/src/main/java/models/LectureRights.java
new file mode 100644
index 00000000..c136141f
--- /dev/null
+++ b/Dozentenmodul/src/main/java/models/LectureRights.java
@@ -0,0 +1,37 @@
+package models;
+
+public class LectureRights {
+ private int recRead;
+ private int recWrite;
+ private int recChangePermission;
+ private int recAdmin;
+
+ public static LectureRights rights =new LectureRights();
+
+ public int getRecRead() {
+ return recRead;
+ }
+ public void setRecRead(int recRead) {
+ this.recRead = recRead;
+ }
+ public int getRecWrite() {
+ return recWrite;
+ }
+ public void setRecWrite(int recWrite) {
+ this.recWrite = recWrite;
+ }
+ public int getRecChangePermission() {
+ return recChangePermission;
+ }
+ public void setRecChangePermission(int recChangePermission) {
+ this.recChangePermission = recChangePermission;
+ }
+ public int getRecAdmin() {
+ return recAdmin;
+ }
+ public void setRecAdmin(int recAdmin) {
+ this.recAdmin = recAdmin;
+ }
+
+
+}
diff --git a/Dozentenmodul/src/main/java/models/Links.java b/Dozentenmodul/src/main/java/models/Links.java
index 693fbb3e..80e3182e 100644
--- a/Dozentenmodul/src/main/java/models/Links.java
+++ b/Dozentenmodul/src/main/java/models/Links.java
@@ -1,161 +1,31 @@
package models;
-import java.awt.Desktop;
-import java.io.IOException;
-import java.net.URISyntaxException;
-import java.net.URL;
-
public class Links {
private static String FAQ = "http://bwlehrpool.hs-offenburg.de/";
- private static String OTRS = "https://bwlehrpool-otrs.rz.hs-offenburg.de/otrs/customer.pl";
+ private static String OTRS = "http://bwlehrpool.hs-offenburg.de/";
private static String uriWindows = "https://my.vmware.com/de/web/vmware/free#desktop_end_user_computing/vmware_player/6_0";
private static String uriLinux = "https://my.vmware.com/de/web/vmware/free#desktop_end_user_computing/vmware_player/6_0";
+ private static String AnleitungVMDK = "http://www.hs-offenburg.de/fileadmin/Einrichtungen/hrz/Projekte/bwLehrpool/3_bwLehrpool_-_Image_einbinden_und_starten.pdf";
public static String getFAQ() {
return FAQ;
}
+ public static String getAnleitungVMDK(){
+ return AnleitungVMDK;
+ }
+
public static String getOTRS() {
return OTRS;
}
- public static void openFAQ() {
-
- String faq = FAQ;
- Runtime rt = Runtime.getRuntime();
- String os = System.getProperty("os.name");
-
- try {
-
-
- if (os.indexOf( "Win" ) >= 0) {
-
- rt.exec( "rundll32 url.dll,FileProtocolHandler " + faq);
-
- } else if (os.indexOf( "Mac" ) >= 0) {
-
- rt.exec( "open " + faq);
-
- } else if (os.indexOf( "nix") >=0 || os.indexOf( "nux") >=0) {
-
- // Do a best guess on unix until we get a platform independent way
- // Build a list of browsers to try, in this order.
- String[] browsers = {"epiphany", "firefox", "mozilla", "konqueror",
- "netscape","opera","links","lynx"};
-
- StringBuffer cmd = new StringBuffer();
- for (int i=0; i<browsers.length; i++)
- cmd.append( (i==0 ? "" : " || " ) + browsers[i] +" \"" + faq + "\" ");
-
- rt.exec(new String[] { "sh", "-c", cmd.toString() });
- }
-
- if (os.indexOf("Win") >= 0) {
-
- // this doesn't support showing urls in the form of
- // "page.html#nameLink"
- rt.exec("rundll32 url.dll,FileProtocolHandler " + faq);
-
- } else if (os.indexOf("Mac") >= 0) {
-
- rt.exec("open " + faq);
-
- } else if (os.indexOf("nix") >= 0 || os.indexOf("nux") >= 0) {
-
- // Do a best guess on unix until we get a platform independent
- // way
- // Build a list of browsers to try, in this order.
- String[] browsers = { "epiphany", "firefox", "mozilla",
- "konqueror", "netscape", "opera", "links", "lynx" };
-
- // Build a command string which looks like
- // "browser1 "url" || browser2 "url" ||..."
- StringBuffer cmd = new StringBuffer();
- for (int i = 0; i < browsers.length; i++)
- cmd.append((i == 0 ? "" : " || ") + browsers[i] + " \""
- + faq + "\" ");
-
- rt.exec(new String[] { "sh", "-c", cmd.toString() });
- }
-
-
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
- }
-
- public static void openOTRS() {
-
- String otrs = OTRS;
- Runtime rt = Runtime.getRuntime();
- String os = System.getProperty("os.name");
-
- try {
-
- if (os.indexOf( "Win" ) >= 0) {
-
- rt.exec( "rundll32 url.dll,FileProtocolHandler " + otrs);
-
- } else if (os.indexOf( "Mac" ) >= 0) {
-
- rt.exec( "open " + otrs);
-
- } else if (os.indexOf( "nix") >=0 || os.indexOf( "nux") >=0) {
-
- String[] browsers = {"epiphany", "firefox", "mozilla", "konqueror",
- "netscape","opera","links","lynx"};
-
- StringBuffer cmd = new StringBuffer();
- for (int i=0; i<browsers.length; i++)
- cmd.append( (i==0 ? "" : " || " ) + browsers[i] +" \"" + otrs + "\" ");
-
- rt.exec(new String[] { "sh", "-c", cmd.toString() });
- }
-
- if (os.indexOf("Win") >= 0) {
-
- // this doesn't support showing urls in the form of
- // "page.html#nameLink"
- rt.exec("rundll32 url.dll,FileProtocolHandler " + otrs);
-
- } else if (os.indexOf("Mac") >= 0) {
-
- rt.exec("open " + otrs);
-
- } else if (os.indexOf("nix") >= 0 || os.indexOf("nux") >= 0) {
-
- // Do a best guess on unix until we get a platform independent
- // way
- // Build a list of browsers to try, in this order.
- String[] browsers = { "epiphany", "firefox", "mozilla",
- "konqueror", "netscape", "opera", "links", "lynx" };
-
- // Build a command string which looks like
- // "browser1 "url" || browser2 "url" ||..."
- StringBuffer cmd = new StringBuffer();
- for (int i = 0; i < browsers.length; i++)
- cmd.append((i == 0 ? "" : " || ") + browsers[i] + " \""
- + otrs + "\" ");
-
- rt.exec(new String[] { "sh", "-c", cmd.toString() });
- }
-
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
- }
-
public static String getUriWindows() {
return uriWindows;
}
public static String getUriLinux() {
return uriLinux;
- }
+ }
-}
+}// end class
diff --git a/Dozentenmodul/src/main/java/models/SessionData.java b/Dozentenmodul/src/main/java/models/SessionData.java
index 187dc59f..d085bc29 100644
--- a/Dozentenmodul/src/main/java/models/SessionData.java
+++ b/Dozentenmodul/src/main/java/models/SessionData.java
@@ -5,6 +5,7 @@ public class SessionData {
private String sessionID;
private String authToken;
private String serverAdress;
+
public static SessionData session =new SessionData();
public String getSessionID() {
@@ -25,6 +26,7 @@ public class SessionData {
public void setServerAdress(String serverAdress) {
this.serverAdress = serverAdress;
}
+
}
diff --git a/Dozentenmodul/src/main/java/models/Version.java b/Dozentenmodul/src/main/java/models/Version.java
new file mode 100644
index 00000000..b44819e4
--- /dev/null
+++ b/Dozentenmodul/src/main/java/models/Version.java
@@ -0,0 +1,24 @@
+package models;
+
+public class Version {
+
+ private static String Version = "1.06";
+ private static String BuildDate = "04.09.2014";
+
+
+ public static String getVersion() {
+ return Version;
+ }
+ public static void setVersion(String version) {
+ Version = version;
+ }
+ public static String getBuildDate() {
+ return BuildDate;
+ }
+ public static void setBuildDate(String buildDate) {
+ BuildDate = buildDate;
+ }
+
+
+
+}
diff --git a/Dozentenmodul/src/main/java/models/person.java b/Dozentenmodul/src/main/java/models/person.java
index 6e066730..479c2ecd 100644
--- a/Dozentenmodul/src/main/java/models/person.java
+++ b/Dozentenmodul/src/main/java/models/person.java
@@ -17,11 +17,21 @@ public class person{
private String Fakultaet;
private boolean ischecked;
+
+ private String role;
public static person verantwortlicher=new person();
+ public String getRole() {
+ return role;
+ }
+
+ public void setRole(String role) {
+ this.role = role;
+ }
+
public String getUsername() {
return username;
diff --git a/Dozentenmodul/src/main/java/thrift/MasterThriftConnection.java b/Dozentenmodul/src/main/java/thrift/MasterThriftConnection.java
index d328d7bf..a84931c6 100644
--- a/Dozentenmodul/src/main/java/thrift/MasterThriftConnection.java
+++ b/Dozentenmodul/src/main/java/thrift/MasterThriftConnection.java
@@ -26,9 +26,6 @@ public class MasterThriftConnection {
transport.open();
} catch (TTransportException e) {
System.out.println("Keine Verbindung m\u00f6glich!");
- JOptionPane.showMessageDialog(null,
- e.getCause()+"\n"+e.getMessage(),
- "Debug-Message", JOptionPane.ERROR_MESSAGE);
return null;
}
diff --git a/Dozentenmodul/src/main/java/util/GuiOrganizer.java b/Dozentenmodul/src/main/java/util/GuiOrganizer.java
index f03c3811..5d6b2de8 100644
--- a/Dozentenmodul/src/main/java/util/GuiOrganizer.java
+++ b/Dozentenmodul/src/main/java/util/GuiOrganizer.java
@@ -5,22 +5,15 @@ import java.awt.Toolkit;
import java.awt.Window;
public abstract class GuiOrganizer {
-
-
-
- /*receive GUI, set it to center of the screen*/
- public static void centerGUI(Window gui)
- {
- Dimension dm = Toolkit.getDefaultToolkit().getScreenSize();
- double width = dm.getWidth();
- double height = dm.getHeight();
- double xPosition = (width / 2 - gui.getWidth() / 2);
- double yPosition = (height / 2 - gui.getHeight() / 2);
- gui.setLocation((int) xPosition, (int) yPosition);
- }
+ /* receive GUI, set it to center of the screen */
+ public static void centerGUI(Window gui) {
+ Dimension dm = Toolkit.getDefaultToolkit().getScreenSize();
+ double width = dm.getWidth();
+ double height = dm.getHeight();
+ double xPosition = (width / 2 - gui.getWidth() / 2);
+ double yPosition = (height / 2 - gui.getHeight() / 2);
+ gui.setLocation((int) xPosition, (int) yPosition);
+ }
-
-
-
}
diff --git a/Dozentenmodul/src/main/java/util/OpenLinks.java b/Dozentenmodul/src/main/java/util/OpenLinks.java
index a3968825..2dd7b936 100644
--- a/Dozentenmodul/src/main/java/util/OpenLinks.java
+++ b/Dozentenmodul/src/main/java/util/OpenLinks.java
@@ -3,18 +3,23 @@ package util;
import java.awt.Desktop;
import java.net.URI;
+import javax.swing.JOptionPane;
+
public class OpenLinks {
-
public static void openWebpage(URI uri) {
- Desktop desktop = Desktop.isDesktopSupported() ? Desktop.getDesktop() : null;
- if (desktop != null && desktop.isSupported(Desktop.Action.BROWSE)) {
- try {
- desktop.browse(uri);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
+ Desktop desktop = Desktop.isDesktopSupported() ? Desktop.getDesktop()
+ : null;
+ if (desktop != null && desktop.isSupported(Desktop.Action.BROWSE)) {
+ try {
+ desktop.browse(uri);
+ } catch (Exception e) {
+ e.printStackTrace();
+ JOptionPane.showMessageDialog(null,
+ e.getCause() + "\n" + e.getStackTrace(),
+ "Debug-Message", JOptionPane.ERROR_MESSAGE);
+ }
+ }
}// end openWebpage
-
+
}
diff --git a/Dozentenmodulserver/src/main/java/server/Image.java b/Dozentenmodulserver/src/main/java/server/Image.java
index 34c2b45c..16fc1ef5 100644
--- a/Dozentenmodulserver/src/main/java/server/Image.java
+++ b/Dozentenmodulserver/src/main/java/server/Image.java
@@ -43,6 +43,7 @@ public class Image implements org.apache.thrift.TBase<Image, Image._Fields>, jav
private static final org.apache.thrift.protocol.TField LECTURE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("lectureName", org.apache.thrift.protocol.TType.STRING, (short)-6);
private static final org.apache.thrift.protocol.TField UPDATE_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("updateTime", org.apache.thrift.protocol.TType.STRING, (short)-7);
private static final org.apache.thrift.protocol.TField USER_DATA_FIELD_DESC = new org.apache.thrift.protocol.TField("userData", org.apache.thrift.protocol.TType.STRING, (short)-8);
+ private static final org.apache.thrift.protocol.TField IS_TEMPLATE_FIELD_DESC = new org.apache.thrift.protocol.TField("isTemplate", org.apache.thrift.protocol.TType.STRING, (short)-9);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
@@ -58,6 +59,7 @@ public class Image implements org.apache.thrift.TBase<Image, Image._Fields>, jav
public String lectureName; // required
public String updateTime; // required
public String userData; // required
+ public String isTemplate; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
@@ -68,7 +70,8 @@ public class Image implements org.apache.thrift.TBase<Image, Image._Fields>, jav
OS_NAME((short)-5, "osName"),
LECTURE_NAME((short)-6, "lectureName"),
UPDATE_TIME((short)-7, "updateTime"),
- USER_DATA((short)-8, "userData");
+ USER_DATA((short)-8, "userData"),
+ IS_TEMPLATE((short)-9, "isTemplate");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@@ -99,6 +102,8 @@ public class Image implements org.apache.thrift.TBase<Image, Image._Fields>, jav
return UPDATE_TIME;
case -8: // USER_DATA
return USER_DATA;
+ case -9: // IS_TEMPLATE
+ return IS_TEMPLATE;
default:
return null;
}
@@ -158,6 +163,8 @@ public class Image implements org.apache.thrift.TBase<Image, Image._Fields>, jav
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.USER_DATA, new org.apache.thrift.meta_data.FieldMetaData("userData", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.IS_TEMPLATE, new org.apache.thrift.meta_data.FieldMetaData("isTemplate", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Image.class, metaDataMap);
}
@@ -173,7 +180,8 @@ public class Image implements org.apache.thrift.TBase<Image, Image._Fields>, jav
String osName,
String lectureName,
String updateTime,
- String userData)
+ String userData,
+ String isTemplate)
{
this();
this.id = id;
@@ -184,6 +192,7 @@ public class Image implements org.apache.thrift.TBase<Image, Image._Fields>, jav
this.lectureName = lectureName;
this.updateTime = updateTime;
this.userData = userData;
+ this.isTemplate = isTemplate;
}
/**
@@ -214,6 +223,9 @@ public class Image implements org.apache.thrift.TBase<Image, Image._Fields>, jav
if (other.isSetUserData()) {
this.userData = other.userData;
}
+ if (other.isSetIsTemplate()) {
+ this.isTemplate = other.isTemplate;
+ }
}
public Image deepCopy() {
@@ -230,6 +242,7 @@ public class Image implements org.apache.thrift.TBase<Image, Image._Fields>, jav
this.lectureName = null;
this.updateTime = null;
this.userData = null;
+ this.isTemplate = null;
}
public String getId() {
@@ -424,6 +437,30 @@ public class Image implements org.apache.thrift.TBase<Image, Image._Fields>, jav
}
}
+ public String getIsTemplate() {
+ return this.isTemplate;
+ }
+
+ public Image setIsTemplate(String isTemplate) {
+ this.isTemplate = isTemplate;
+ return this;
+ }
+
+ public void unsetIsTemplate() {
+ this.isTemplate = null;
+ }
+
+ /** Returns true if field isTemplate is set (has been assigned a value) and false otherwise */
+ public boolean isSetIsTemplate() {
+ return this.isTemplate != null;
+ }
+
+ public void setIsTemplateIsSet(boolean value) {
+ if (!value) {
+ this.isTemplate = null;
+ }
+ }
+
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case ID:
@@ -490,6 +527,14 @@ public class Image implements org.apache.thrift.TBase<Image, Image._Fields>, jav
}
break;
+ case IS_TEMPLATE:
+ if (value == null) {
+ unsetIsTemplate();
+ } else {
+ setIsTemplate((String)value);
+ }
+ break;
+
}
}
@@ -519,6 +564,9 @@ public class Image implements org.apache.thrift.TBase<Image, Image._Fields>, jav
case USER_DATA:
return getUserData();
+ case IS_TEMPLATE:
+ return getIsTemplate();
+
}
throw new IllegalStateException();
}
@@ -546,6 +594,8 @@ public class Image implements org.apache.thrift.TBase<Image, Image._Fields>, jav
return isSetUpdateTime();
case USER_DATA:
return isSetUserData();
+ case IS_TEMPLATE:
+ return isSetIsTemplate();
}
throw new IllegalStateException();
}
@@ -635,6 +685,15 @@ public class Image implements org.apache.thrift.TBase<Image, Image._Fields>, jav
return false;
}
+ boolean this_present_isTemplate = true && this.isSetIsTemplate();
+ boolean that_present_isTemplate = true && that.isSetIsTemplate();
+ if (this_present_isTemplate || that_present_isTemplate) {
+ if (!(this_present_isTemplate && that_present_isTemplate))
+ return false;
+ if (!this.isTemplate.equals(that.isTemplate))
+ return false;
+ }
+
return true;
}
@@ -731,6 +790,16 @@ public class Image implements org.apache.thrift.TBase<Image, Image._Fields>, jav
return lastComparison;
}
}
+ lastComparison = Boolean.valueOf(isSetIsTemplate()).compareTo(other.isSetIsTemplate());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetIsTemplate()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isTemplate, other.isTemplate);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
return 0;
}
@@ -814,6 +883,14 @@ public class Image implements org.apache.thrift.TBase<Image, Image._Fields>, jav
sb.append(this.userData);
}
first = false;
+ if (!first) sb.append(", ");
+ sb.append("isTemplate:");
+ if (this.isTemplate == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.isTemplate);
+ }
+ first = false;
sb.append(")");
return sb.toString();
}
@@ -921,6 +998,14 @@ public class Image implements org.apache.thrift.TBase<Image, Image._Fields>, jav
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
+ case -9: // IS_TEMPLATE
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.isTemplate = iprot.readString();
+ struct.setIsTemplateIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
@@ -936,6 +1021,11 @@ public class Image implements org.apache.thrift.TBase<Image, Image._Fields>, jav
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.isTemplate != null) {
+ oprot.writeFieldBegin(IS_TEMPLATE_FIELD_DESC);
+ oprot.writeString(struct.isTemplate);
+ oprot.writeFieldEnd();
+ }
if (struct.userData != null) {
oprot.writeFieldBegin(USER_DATA_FIELD_DESC);
oprot.writeString(struct.userData);
@@ -1018,7 +1108,10 @@ public class Image implements org.apache.thrift.TBase<Image, Image._Fields>, jav
if (struct.isSetUserData()) {
optionals.set(7);
}
- oprot.writeBitSet(optionals, 8);
+ if (struct.isSetIsTemplate()) {
+ optionals.set(8);
+ }
+ oprot.writeBitSet(optionals, 9);
if (struct.isSetId()) {
oprot.writeString(struct.id);
}
@@ -1043,12 +1136,15 @@ public class Image implements org.apache.thrift.TBase<Image, Image._Fields>, jav
if (struct.isSetUserData()) {
oprot.writeString(struct.userData);
}
+ if (struct.isSetIsTemplate()) {
+ oprot.writeString(struct.isTemplate);
+ }
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, Image struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(8);
+ BitSet incoming = iprot.readBitSet(9);
if (incoming.get(0)) {
struct.id = iprot.readString();
struct.setIdIsSet(true);
@@ -1081,6 +1177,10 @@ public class Image implements org.apache.thrift.TBase<Image, Image._Fields>, jav
struct.userData = iprot.readString();
struct.setUserDataIsSet(true);
}
+ if (incoming.get(8)) {
+ struct.isTemplate = iprot.readString();
+ struct.setIsTemplateIsSet(true);
+ }
}
}
diff --git a/Dozentenmodulserver/src/main/java/server/Server.java b/Dozentenmodulserver/src/main/java/server/Server.java
index 8e36bd49..ab527168 100644
--- a/Dozentenmodulserver/src/main/java/server/Server.java
+++ b/Dozentenmodulserver/src/main/java/server/Server.java
@@ -42,7 +42,7 @@ public class Server {
public String getPathOfImage(String image_id, String version) throws org.apache.thrift.TException;
- public boolean writeVLdata(String imagename, String login, String firstname, String lastname, String university, String Mail, String Tel, String Fak, boolean license, boolean internet, long ram, long cpu, String imagePath, boolean isTemplate, long filesize, long shareMode) throws org.apache.thrift.TException;
+ public boolean writeVLdata(String imagename, String desc, String login, String firstname, String lastname, String university, String Mail, String Tel, String Fak, boolean license, boolean internet, long ram, long cpu, String imagePath, boolean isTemplate, long filesize, long shareMode, String os) throws org.apache.thrift.TException;
public List<Image> getImageList() throws org.apache.thrift.TException;
@@ -60,13 +60,13 @@ public class Server {
public Map<String,String> getImageData(String imageid, String imageversion) throws org.apache.thrift.TException;
- public boolean updateImageData(String name, String newName, String image_path, boolean license, boolean internet, long ram, long cpu, String id, String version, boolean isTemplate, long filesize, long shareMode) throws org.apache.thrift.TException;
+ public Map<String,String> getLectureData(String lectureid) throws org.apache.thrift.TException;
- public Map<String,String> getLectureData(String lecturename) throws org.apache.thrift.TException;
+ public boolean updateImageData(String name, String newName, String desc, String image_path, boolean license, boolean internet, long ram, long cpu, String id, String version, boolean isTemplate, long filesize, long shareMode, String os) throws org.apache.thrift.TException;
public boolean deleteImageData(String id, String version) throws org.apache.thrift.TException;
- public boolean updateLecturedata(String name, String newName, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imagename, String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id) throws org.apache.thrift.TException;
+ public boolean updateLecturedata(String name, String newName, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imageid, String imageversion, String user, String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id) throws org.apache.thrift.TException;
public boolean deleteImageServer(String id, String version) throws org.apache.thrift.TException;
@@ -74,6 +74,14 @@ public class Server {
public boolean deleteLecture(String id, String hs, String user) throws org.apache.thrift.TException;
+ public boolean checkUser(String username) throws org.apache.thrift.TException;
+
+ public boolean createUser(String loginName, String lastName, String firstName, String mail, String university) throws org.apache.thrift.TException;
+
+ public boolean writeImageRights(String imagename, String username, String lastName, String firstName, String mail, String university, String role) throws org.apache.thrift.TException;
+
+ public boolean writeLectureRights(String lecturename, String username, String lastName, String firstName, String mail, String university, String role) throws org.apache.thrift.TException;
+
}
public interface AsyncIface {
@@ -84,7 +92,7 @@ public class Server {
public void getPathOfImage(String image_id, String version, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
- public void writeVLdata(String imagename, String login, String firstname, String lastname, String university, String Mail, String Tel, String Fak, boolean license, boolean internet, long ram, long cpu, String imagePath, boolean isTemplate, long filesize, long shareMode, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+ public void writeVLdata(String imagename, String desc, String login, String firstname, String lastname, String university, String Mail, String Tel, String Fak, boolean license, boolean internet, long ram, long cpu, String imagePath, boolean isTemplate, long filesize, long shareMode, String os, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void getImageList(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
@@ -102,13 +110,13 @@ public class Server {
public void getImageData(String imageid, String imageversion, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
- public void updateImageData(String name, String newName, String image_path, boolean license, boolean internet, long ram, long cpu, String id, String version, boolean isTemplate, long filesize, long shareMode, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+ public void getLectureData(String lectureid, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
- public void getLectureData(String lecturename, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+ public void updateImageData(String name, String newName, String desc, String image_path, boolean license, boolean internet, long ram, long cpu, String id, String version, boolean isTemplate, long filesize, long shareMode, String os, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void deleteImageData(String id, String version, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
- public void updateLecturedata(String name, String newName, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imagename, String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+ public void updateLecturedata(String name, String newName, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imageid, String imageversion, String user, String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void deleteImageServer(String id, String version, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
@@ -116,6 +124,14 @@ public class Server {
public void deleteLecture(String id, String hs, String user, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+ public void checkUser(String username, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+ public void createUser(String loginName, String lastName, String firstName, String mail, String university, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+ public void writeImageRights(String imagename, String username, String lastName, String firstName, String mail, String university, String role, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+ public void writeLectureRights(String lecturename, String username, String lastName, String firstName, String mail, String university, String role, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
}
public static class Client extends org.apache.thrift.TServiceClient implements Iface {
@@ -207,16 +223,17 @@ public class Server {
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPathOfImage failed: unknown result");
}
- public boolean writeVLdata(String imagename, String login, String firstname, String lastname, String university, String Mail, String Tel, String Fak, boolean license, boolean internet, long ram, long cpu, String imagePath, boolean isTemplate, long filesize, long shareMode) throws org.apache.thrift.TException
+ public boolean writeVLdata(String imagename, String desc, String login, String firstname, String lastname, String university, String Mail, String Tel, String Fak, boolean license, boolean internet, long ram, long cpu, String imagePath, boolean isTemplate, long filesize, long shareMode, String os) throws org.apache.thrift.TException
{
- send_writeVLdata(imagename, login, firstname, lastname, university, Mail, Tel, Fak, license, internet, ram, cpu, imagePath, isTemplate, filesize, shareMode);
+ send_writeVLdata(imagename, desc, login, firstname, lastname, university, Mail, Tel, Fak, license, internet, ram, cpu, imagePath, isTemplate, filesize, shareMode, os);
return recv_writeVLdata();
}
- public void send_writeVLdata(String imagename, String login, String firstname, String lastname, String university, String Mail, String Tel, String Fak, boolean license, boolean internet, long ram, long cpu, String imagePath, boolean isTemplate, long filesize, long shareMode) throws org.apache.thrift.TException
+ public void send_writeVLdata(String imagename, String desc, String login, String firstname, String lastname, String university, String Mail, String Tel, String Fak, boolean license, boolean internet, long ram, long cpu, String imagePath, boolean isTemplate, long filesize, long shareMode, String os) throws org.apache.thrift.TException
{
writeVLdata_args args = new writeVLdata_args();
args.setImagename(imagename);
+ args.setDesc(desc);
args.setLogin(login);
args.setFirstname(firstname);
args.setLastname(lastname);
@@ -232,6 +249,7 @@ public class Server {
args.setIsTemplate(isTemplate);
args.setFilesize(filesize);
args.setShareMode(shareMode);
+ args.setOs(os);
sendBase("writeVLdata", args);
}
@@ -440,17 +458,41 @@ public class Server {
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getImageData failed: unknown result");
}
- public boolean updateImageData(String name, String newName, String image_path, boolean license, boolean internet, long ram, long cpu, String id, String version, boolean isTemplate, long filesize, long shareMode) throws org.apache.thrift.TException
+ public Map<String,String> getLectureData(String lectureid) throws org.apache.thrift.TException
+ {
+ send_getLectureData(lectureid);
+ return recv_getLectureData();
+ }
+
+ public void send_getLectureData(String lectureid) throws org.apache.thrift.TException
{
- send_updateImageData(name, newName, image_path, license, internet, ram, cpu, id, version, isTemplate, filesize, shareMode);
+ getLectureData_args args = new getLectureData_args();
+ args.setLectureid(lectureid);
+ sendBase("getLectureData", args);
+ }
+
+ public Map<String,String> recv_getLectureData() throws org.apache.thrift.TException
+ {
+ getLectureData_result result = new getLectureData_result();
+ receiveBase(result, "getLectureData");
+ if (result.isSetSuccess()) {
+ return result.success;
+ }
+ throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getLectureData failed: unknown result");
+ }
+
+ public boolean updateImageData(String name, String newName, String desc, String image_path, boolean license, boolean internet, long ram, long cpu, String id, String version, boolean isTemplate, long filesize, long shareMode, String os) throws org.apache.thrift.TException
+ {
+ send_updateImageData(name, newName, desc, image_path, license, internet, ram, cpu, id, version, isTemplate, filesize, shareMode, os);
return recv_updateImageData();
}
- public void send_updateImageData(String name, String newName, String image_path, boolean license, boolean internet, long ram, long cpu, String id, String version, boolean isTemplate, long filesize, long shareMode) throws org.apache.thrift.TException
+ public void send_updateImageData(String name, String newName, String desc, String image_path, boolean license, boolean internet, long ram, long cpu, String id, String version, boolean isTemplate, long filesize, long shareMode, String os) throws org.apache.thrift.TException
{
updateImageData_args args = new updateImageData_args();
args.setName(name);
args.setNewName(newName);
+ args.setDesc(desc);
args.setImage_path(image_path);
args.setLicense(license);
args.setInternet(internet);
@@ -461,6 +503,7 @@ public class Server {
args.setIsTemplate(isTemplate);
args.setFilesize(filesize);
args.setShareMode(shareMode);
+ args.setOs(os);
sendBase("updateImageData", args);
}
@@ -474,29 +517,6 @@ public class Server {
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "updateImageData failed: unknown result");
}
- public Map<String,String> getLectureData(String lecturename) throws org.apache.thrift.TException
- {
- send_getLectureData(lecturename);
- return recv_getLectureData();
- }
-
- public void send_getLectureData(String lecturename) throws org.apache.thrift.TException
- {
- getLectureData_args args = new getLectureData_args();
- args.setLecturename(lecturename);
- sendBase("getLectureData", args);
- }
-
- public Map<String,String> recv_getLectureData() throws org.apache.thrift.TException
- {
- getLectureData_result result = new getLectureData_result();
- receiveBase(result, "getLectureData");
- if (result.isSetSuccess()) {
- return result.success;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getLectureData failed: unknown result");
- }
-
public boolean deleteImageData(String id, String version) throws org.apache.thrift.TException
{
send_deleteImageData(id, version);
@@ -521,13 +541,13 @@ public class Server {
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "deleteImageData failed: unknown result");
}
- public boolean updateLecturedata(String name, String newName, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imagename, String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id) throws org.apache.thrift.TException
+ public boolean updateLecturedata(String name, String newName, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imageid, String imageversion, String user, String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id) throws org.apache.thrift.TException
{
- send_updateLecturedata(name, newName, shortdesc, desc, startDate, endDate, isActive, imagename, firstname, lastname, university, Mail, Tel, Fak, id);
+ send_updateLecturedata(name, newName, shortdesc, desc, startDate, endDate, isActive, imageid, imageversion, user, firstname, lastname, university, Mail, Tel, Fak, id);
return recv_updateLecturedata();
}
- public void send_updateLecturedata(String name, String newName, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imagename, String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id) throws org.apache.thrift.TException
+ public void send_updateLecturedata(String name, String newName, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imageid, String imageversion, String user, String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id) throws org.apache.thrift.TException
{
updateLecturedata_args args = new updateLecturedata_args();
args.setName(name);
@@ -537,7 +557,9 @@ public class Server {
args.setStartDate(startDate);
args.setEndDate(endDate);
args.setIsActive(isActive);
- args.setImagename(imagename);
+ args.setImageid(imageid);
+ args.setImageversion(imageversion);
+ args.setUser(user);
args.setFirstname(firstname);
args.setLastname(lastname);
args.setUniversity(university);
@@ -631,6 +653,114 @@ public class Server {
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "deleteLecture failed: unknown result");
}
+ public boolean checkUser(String username) throws org.apache.thrift.TException
+ {
+ send_checkUser(username);
+ return recv_checkUser();
+ }
+
+ public void send_checkUser(String username) throws org.apache.thrift.TException
+ {
+ checkUser_args args = new checkUser_args();
+ args.setUsername(username);
+ sendBase("checkUser", args);
+ }
+
+ public boolean recv_checkUser() throws org.apache.thrift.TException
+ {
+ checkUser_result result = new checkUser_result();
+ receiveBase(result, "checkUser");
+ if (result.isSetSuccess()) {
+ return result.success;
+ }
+ throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "checkUser failed: unknown result");
+ }
+
+ public boolean createUser(String loginName, String lastName, String firstName, String mail, String university) throws org.apache.thrift.TException
+ {
+ send_createUser(loginName, lastName, firstName, mail, university);
+ return recv_createUser();
+ }
+
+ public void send_createUser(String loginName, String lastName, String firstName, String mail, String university) throws org.apache.thrift.TException
+ {
+ createUser_args args = new createUser_args();
+ args.setLoginName(loginName);
+ args.setLastName(lastName);
+ args.setFirstName(firstName);
+ args.setMail(mail);
+ args.setUniversity(university);
+ sendBase("createUser", args);
+ }
+
+ public boolean recv_createUser() throws org.apache.thrift.TException
+ {
+ createUser_result result = new createUser_result();
+ receiveBase(result, "createUser");
+ if (result.isSetSuccess()) {
+ return result.success;
+ }
+ throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "createUser failed: unknown result");
+ }
+
+ public boolean writeImageRights(String imagename, String username, String lastName, String firstName, String mail, String university, String role) throws org.apache.thrift.TException
+ {
+ send_writeImageRights(imagename, username, lastName, firstName, mail, university, role);
+ return recv_writeImageRights();
+ }
+
+ public void send_writeImageRights(String imagename, String username, String lastName, String firstName, String mail, String university, String role) throws org.apache.thrift.TException
+ {
+ writeImageRights_args args = new writeImageRights_args();
+ args.setImagename(imagename);
+ args.setUsername(username);
+ args.setLastName(lastName);
+ args.setFirstName(firstName);
+ args.setMail(mail);
+ args.setUniversity(university);
+ args.setRole(role);
+ sendBase("writeImageRights", args);
+ }
+
+ public boolean recv_writeImageRights() throws org.apache.thrift.TException
+ {
+ writeImageRights_result result = new writeImageRights_result();
+ receiveBase(result, "writeImageRights");
+ if (result.isSetSuccess()) {
+ return result.success;
+ }
+ throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "writeImageRights failed: unknown result");
+ }
+
+ public boolean writeLectureRights(String lecturename, String username, String lastName, String firstName, String mail, String university, String role) throws org.apache.thrift.TException
+ {
+ send_writeLectureRights(lecturename, username, lastName, firstName, mail, university, role);
+ return recv_writeLectureRights();
+ }
+
+ public void send_writeLectureRights(String lecturename, String username, String lastName, String firstName, String mail, String university, String role) throws org.apache.thrift.TException
+ {
+ writeLectureRights_args args = new writeLectureRights_args();
+ args.setLecturename(lecturename);
+ args.setUsername(username);
+ args.setLastName(lastName);
+ args.setFirstName(firstName);
+ args.setMail(mail);
+ args.setUniversity(university);
+ args.setRole(role);
+ sendBase("writeLectureRights", args);
+ }
+
+ public boolean recv_writeLectureRights() throws org.apache.thrift.TException
+ {
+ writeLectureRights_result result = new writeLectureRights_result();
+ receiveBase(result, "writeLectureRights");
+ if (result.isSetSuccess()) {
+ return result.success;
+ }
+ throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "writeLectureRights failed: unknown result");
+ }
+
}
public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface {
public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
@@ -745,15 +875,16 @@ public class Server {
}
}
- public void writeVLdata(String imagename, String login, String firstname, String lastname, String university, String Mail, String Tel, String Fak, boolean license, boolean internet, long ram, long cpu, String imagePath, boolean isTemplate, long filesize, long shareMode, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+ public void writeVLdata(String imagename, String desc, String login, String firstname, String lastname, String university, String Mail, String Tel, String Fak, boolean license, boolean internet, long ram, long cpu, String imagePath, boolean isTemplate, long filesize, long shareMode, String os, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
- writeVLdata_call method_call = new writeVLdata_call(imagename, login, firstname, lastname, university, Mail, Tel, Fak, license, internet, ram, cpu, imagePath, isTemplate, filesize, shareMode, resultHandler, this, ___protocolFactory, ___transport);
+ writeVLdata_call method_call = new writeVLdata_call(imagename, desc, login, firstname, lastname, university, Mail, Tel, Fak, license, internet, ram, cpu, imagePath, isTemplate, filesize, shareMode, os, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class writeVLdata_call extends org.apache.thrift.async.TAsyncMethodCall {
private String imagename;
+ private String desc;
private String login;
private String firstname;
private String lastname;
@@ -769,9 +900,11 @@ public class Server {
private boolean isTemplate;
private long filesize;
private long shareMode;
- public writeVLdata_call(String imagename, String login, String firstname, String lastname, String university, String Mail, String Tel, String Fak, boolean license, boolean internet, long ram, long cpu, String imagePath, boolean isTemplate, long filesize, long shareMode, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+ private String os;
+ public writeVLdata_call(String imagename, String desc, String login, String firstname, String lastname, String university, String Mail, String Tel, String Fak, boolean license, boolean internet, long ram, long cpu, String imagePath, boolean isTemplate, long filesize, long shareMode, String os, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.imagename = imagename;
+ this.desc = desc;
this.login = login;
this.firstname = firstname;
this.lastname = lastname;
@@ -787,12 +920,14 @@ public class Server {
this.isTemplate = isTemplate;
this.filesize = filesize;
this.shareMode = shareMode;
+ this.os = os;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("writeVLdata", org.apache.thrift.protocol.TMessageType.CALL, 0));
writeVLdata_args args = new writeVLdata_args();
args.setImagename(imagename);
+ args.setDesc(desc);
args.setLogin(login);
args.setFirstname(firstname);
args.setLastname(lastname);
@@ -808,6 +943,7 @@ public class Server {
args.setIsTemplate(isTemplate);
args.setFilesize(filesize);
args.setShareMode(shareMode);
+ args.setOs(os);
args.write(prot);
prot.writeMessageEnd();
}
@@ -1111,9 +1247,41 @@ public class Server {
}
}
- public void updateImageData(String name, String newName, String image_path, boolean license, boolean internet, long ram, long cpu, String id, String version, boolean isTemplate, long filesize, long shareMode, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+ public void getLectureData(String lectureid, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
- updateImageData_call method_call = new updateImageData_call(name, newName, image_path, license, internet, ram, cpu, id, version, isTemplate, filesize, shareMode, resultHandler, this, ___protocolFactory, ___transport);
+ getLectureData_call method_call = new getLectureData_call(lectureid, resultHandler, this, ___protocolFactory, ___transport);
+ this.___currentMethod = method_call;
+ ___manager.call(method_call);
+ }
+
+ public static class getLectureData_call extends org.apache.thrift.async.TAsyncMethodCall {
+ private String lectureid;
+ public getLectureData_call(String lectureid, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+ super(client, protocolFactory, transport, resultHandler, false);
+ this.lectureid = lectureid;
+ }
+
+ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+ prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getLectureData", org.apache.thrift.protocol.TMessageType.CALL, 0));
+ getLectureData_args args = new getLectureData_args();
+ args.setLectureid(lectureid);
+ args.write(prot);
+ prot.writeMessageEnd();
+ }
+
+ public Map<String,String> getResult() throws org.apache.thrift.TException {
+ if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
+ throw new IllegalStateException("Method call not finished!");
+ }
+ org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
+ org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
+ return (new Client(prot)).recv_getLectureData();
+ }
+ }
+
+ public void updateImageData(String name, String newName, String desc, String image_path, boolean license, boolean internet, long ram, long cpu, String id, String version, boolean isTemplate, long filesize, long shareMode, String os, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+ checkReady();
+ updateImageData_call method_call = new updateImageData_call(name, newName, desc, image_path, license, internet, ram, cpu, id, version, isTemplate, filesize, shareMode, os, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
@@ -1121,6 +1289,7 @@ public class Server {
public static class updateImageData_call extends org.apache.thrift.async.TAsyncMethodCall {
private String name;
private String newName;
+ private String desc;
private String image_path;
private boolean license;
private boolean internet;
@@ -1131,10 +1300,12 @@ public class Server {
private boolean isTemplate;
private long filesize;
private long shareMode;
- public updateImageData_call(String name, String newName, String image_path, boolean license, boolean internet, long ram, long cpu, String id, String version, boolean isTemplate, long filesize, long shareMode, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+ private String os;
+ public updateImageData_call(String name, String newName, String desc, String image_path, boolean license, boolean internet, long ram, long cpu, String id, String version, boolean isTemplate, long filesize, long shareMode, String os, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.name = name;
this.newName = newName;
+ this.desc = desc;
this.image_path = image_path;
this.license = license;
this.internet = internet;
@@ -1145,6 +1316,7 @@ public class Server {
this.isTemplate = isTemplate;
this.filesize = filesize;
this.shareMode = shareMode;
+ this.os = os;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
@@ -1152,6 +1324,7 @@ public class Server {
updateImageData_args args = new updateImageData_args();
args.setName(name);
args.setNewName(newName);
+ args.setDesc(desc);
args.setImage_path(image_path);
args.setLicense(license);
args.setInternet(internet);
@@ -1162,6 +1335,7 @@ public class Server {
args.setIsTemplate(isTemplate);
args.setFilesize(filesize);
args.setShareMode(shareMode);
+ args.setOs(os);
args.write(prot);
prot.writeMessageEnd();
}
@@ -1176,38 +1350,6 @@ public class Server {
}
}
- public void getLectureData(String lecturename, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- getLectureData_call method_call = new getLectureData_call(lecturename, resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class getLectureData_call extends org.apache.thrift.async.TAsyncMethodCall {
- private String lecturename;
- public getLectureData_call(String lecturename, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
- super(client, protocolFactory, transport, resultHandler, false);
- this.lecturename = lecturename;
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getLectureData", org.apache.thrift.protocol.TMessageType.CALL, 0));
- getLectureData_args args = new getLectureData_args();
- args.setLecturename(lecturename);
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public Map<String,String> getResult() throws org.apache.thrift.TException {
- if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
- throw new IllegalStateException("Method call not finished!");
- }
- org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
- org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
- return (new Client(prot)).recv_getLectureData();
- }
- }
-
public void deleteImageData(String id, String version, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
deleteImageData_call method_call = new deleteImageData_call(id, version, resultHandler, this, ___protocolFactory, ___transport);
@@ -1243,9 +1385,9 @@ public class Server {
}
}
- public void updateLecturedata(String name, String newName, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imagename, String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+ public void updateLecturedata(String name, String newName, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imageid, String imageversion, String user, String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
- updateLecturedata_call method_call = new updateLecturedata_call(name, newName, shortdesc, desc, startDate, endDate, isActive, imagename, firstname, lastname, university, Mail, Tel, Fak, id, resultHandler, this, ___protocolFactory, ___transport);
+ updateLecturedata_call method_call = new updateLecturedata_call(name, newName, shortdesc, desc, startDate, endDate, isActive, imageid, imageversion, user, firstname, lastname, university, Mail, Tel, Fak, id, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
@@ -1258,7 +1400,9 @@ public class Server {
private String startDate;
private String endDate;
private boolean isActive;
- private String imagename;
+ private String imageid;
+ private String imageversion;
+ private String user;
private String firstname;
private String lastname;
private String university;
@@ -1266,7 +1410,7 @@ public class Server {
private String Tel;
private String Fak;
private String id;
- public updateLecturedata_call(String name, String newName, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imagename, String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+ public updateLecturedata_call(String name, String newName, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imageid, String imageversion, String user, String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.name = name;
this.newName = newName;
@@ -1275,7 +1419,9 @@ public class Server {
this.startDate = startDate;
this.endDate = endDate;
this.isActive = isActive;
- this.imagename = imagename;
+ this.imageid = imageid;
+ this.imageversion = imageversion;
+ this.user = user;
this.firstname = firstname;
this.lastname = lastname;
this.university = university;
@@ -1295,7 +1441,9 @@ public class Server {
args.setStartDate(startDate);
args.setEndDate(endDate);
args.setIsActive(isActive);
- args.setImagename(imagename);
+ args.setImageid(imageid);
+ args.setImageversion(imageversion);
+ args.setUser(user);
args.setFirstname(firstname);
args.setLastname(lastname);
args.setUniversity(university);
@@ -1425,6 +1573,182 @@ public class Server {
}
}
+ public void checkUser(String username, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+ checkReady();
+ checkUser_call method_call = new checkUser_call(username, resultHandler, this, ___protocolFactory, ___transport);
+ this.___currentMethod = method_call;
+ ___manager.call(method_call);
+ }
+
+ public static class checkUser_call extends org.apache.thrift.async.TAsyncMethodCall {
+ private String username;
+ public checkUser_call(String username, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+ super(client, protocolFactory, transport, resultHandler, false);
+ this.username = username;
+ }
+
+ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+ prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("checkUser", org.apache.thrift.protocol.TMessageType.CALL, 0));
+ checkUser_args args = new checkUser_args();
+ args.setUsername(username);
+ args.write(prot);
+ prot.writeMessageEnd();
+ }
+
+ public boolean getResult() throws org.apache.thrift.TException {
+ if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
+ throw new IllegalStateException("Method call not finished!");
+ }
+ org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
+ org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
+ return (new Client(prot)).recv_checkUser();
+ }
+ }
+
+ public void createUser(String loginName, String lastName, String firstName, String mail, String university, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+ checkReady();
+ createUser_call method_call = new createUser_call(loginName, lastName, firstName, mail, university, resultHandler, this, ___protocolFactory, ___transport);
+ this.___currentMethod = method_call;
+ ___manager.call(method_call);
+ }
+
+ public static class createUser_call extends org.apache.thrift.async.TAsyncMethodCall {
+ private String loginName;
+ private String lastName;
+ private String firstName;
+ private String mail;
+ private String university;
+ public createUser_call(String loginName, String lastName, String firstName, String mail, String university, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+ super(client, protocolFactory, transport, resultHandler, false);
+ this.loginName = loginName;
+ this.lastName = lastName;
+ this.firstName = firstName;
+ this.mail = mail;
+ this.university = university;
+ }
+
+ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+ prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createUser", org.apache.thrift.protocol.TMessageType.CALL, 0));
+ createUser_args args = new createUser_args();
+ args.setLoginName(loginName);
+ args.setLastName(lastName);
+ args.setFirstName(firstName);
+ args.setMail(mail);
+ args.setUniversity(university);
+ args.write(prot);
+ prot.writeMessageEnd();
+ }
+
+ public boolean getResult() throws org.apache.thrift.TException {
+ if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
+ throw new IllegalStateException("Method call not finished!");
+ }
+ org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
+ org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
+ return (new Client(prot)).recv_createUser();
+ }
+ }
+
+ public void writeImageRights(String imagename, String username, String lastName, String firstName, String mail, String university, String role, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+ checkReady();
+ writeImageRights_call method_call = new writeImageRights_call(imagename, username, lastName, firstName, mail, university, role, resultHandler, this, ___protocolFactory, ___transport);
+ this.___currentMethod = method_call;
+ ___manager.call(method_call);
+ }
+
+ public static class writeImageRights_call extends org.apache.thrift.async.TAsyncMethodCall {
+ private String imagename;
+ private String username;
+ private String lastName;
+ private String firstName;
+ private String mail;
+ private String university;
+ private String role;
+ public writeImageRights_call(String imagename, String username, String lastName, String firstName, String mail, String university, String role, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+ super(client, protocolFactory, transport, resultHandler, false);
+ this.imagename = imagename;
+ this.username = username;
+ this.lastName = lastName;
+ this.firstName = firstName;
+ this.mail = mail;
+ this.university = university;
+ this.role = role;
+ }
+
+ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+ prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("writeImageRights", org.apache.thrift.protocol.TMessageType.CALL, 0));
+ writeImageRights_args args = new writeImageRights_args();
+ args.setImagename(imagename);
+ args.setUsername(username);
+ args.setLastName(lastName);
+ args.setFirstName(firstName);
+ args.setMail(mail);
+ args.setUniversity(university);
+ args.setRole(role);
+ args.write(prot);
+ prot.writeMessageEnd();
+ }
+
+ public boolean getResult() throws org.apache.thrift.TException {
+ if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
+ throw new IllegalStateException("Method call not finished!");
+ }
+ org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
+ org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
+ return (new Client(prot)).recv_writeImageRights();
+ }
+ }
+
+ public void writeLectureRights(String lecturename, String username, String lastName, String firstName, String mail, String university, String role, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+ checkReady();
+ writeLectureRights_call method_call = new writeLectureRights_call(lecturename, username, lastName, firstName, mail, university, role, resultHandler, this, ___protocolFactory, ___transport);
+ this.___currentMethod = method_call;
+ ___manager.call(method_call);
+ }
+
+ public static class writeLectureRights_call extends org.apache.thrift.async.TAsyncMethodCall {
+ private String lecturename;
+ private String username;
+ private String lastName;
+ private String firstName;
+ private String mail;
+ private String university;
+ private String role;
+ public writeLectureRights_call(String lecturename, String username, String lastName, String firstName, String mail, String university, String role, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+ super(client, protocolFactory, transport, resultHandler, false);
+ this.lecturename = lecturename;
+ this.username = username;
+ this.lastName = lastName;
+ this.firstName = firstName;
+ this.mail = mail;
+ this.university = university;
+ this.role = role;
+ }
+
+ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+ prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("writeLectureRights", org.apache.thrift.protocol.TMessageType.CALL, 0));
+ writeLectureRights_args args = new writeLectureRights_args();
+ args.setLecturename(lecturename);
+ args.setUsername(username);
+ args.setLastName(lastName);
+ args.setFirstName(firstName);
+ args.setMail(mail);
+ args.setUniversity(university);
+ args.setRole(role);
+ args.write(prot);
+ prot.writeMessageEnd();
+ }
+
+ public boolean getResult() throws org.apache.thrift.TException {
+ if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
+ throw new IllegalStateException("Method call not finished!");
+ }
+ org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
+ org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
+ return (new Client(prot)).recv_writeLectureRights();
+ }
+ }
+
}
public static class Processor<I extends Iface> extends org.apache.thrift.TBaseProcessor<I> implements org.apache.thrift.TProcessor {
@@ -1450,13 +1774,17 @@ public class Server {
processMap.put("writeLecturedata", new writeLecturedata());
processMap.put("startFileCopy", new startFileCopy());
processMap.put("getImageData", new getImageData());
- processMap.put("updateImageData", new updateImageData());
processMap.put("getLectureData", new getLectureData());
+ processMap.put("updateImageData", new updateImageData());
processMap.put("deleteImageData", new deleteImageData());
processMap.put("updateLecturedata", new updateLecturedata());
processMap.put("deleteImageServer", new deleteImageServer());
processMap.put("connectedToLecture", new connectedToLecture());
processMap.put("deleteLecture", new deleteLecture());
+ processMap.put("checkUser", new checkUser());
+ processMap.put("createUser", new createUser());
+ processMap.put("writeImageRights", new writeImageRights());
+ processMap.put("writeLectureRights", new writeLectureRights());
return processMap;
}
@@ -1536,7 +1864,7 @@ public class Server {
public writeVLdata_result getResult(I iface, writeVLdata_args args) throws org.apache.thrift.TException {
writeVLdata_result result = new writeVLdata_result();
- result.success = iface.writeVLdata(args.imagename, args.login, args.firstname, args.lastname, args.university, args.Mail, args.Tel, args.Fak, args.license, args.internet, args.ram, args.cpu, args.imagePath, args.isTemplate, args.filesize, args.shareMode);
+ result.success = iface.writeVLdata(args.imagename, args.desc, args.login, args.firstname, args.lastname, args.university, args.Mail, args.Tel, args.Fak, args.license, args.internet, args.ram, args.cpu, args.imagePath, args.isTemplate, args.filesize, args.shareMode, args.os);
result.setSuccessIsSet(true);
return result;
}
@@ -1704,43 +2032,43 @@ public class Server {
}
}
- public static class updateImageData<I extends Iface> extends org.apache.thrift.ProcessFunction<I, updateImageData_args> {
- public updateImageData() {
- super("updateImageData");
+ public static class getLectureData<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getLectureData_args> {
+ public getLectureData() {
+ super("getLectureData");
}
- public updateImageData_args getEmptyArgsInstance() {
- return new updateImageData_args();
+ public getLectureData_args getEmptyArgsInstance() {
+ return new getLectureData_args();
}
protected boolean isOneway() {
return false;
}
- public updateImageData_result getResult(I iface, updateImageData_args args) throws org.apache.thrift.TException {
- updateImageData_result result = new updateImageData_result();
- result.success = iface.updateImageData(args.name, args.newName, args.image_path, args.license, args.internet, args.ram, args.cpu, args.id, args.version, args.isTemplate, args.filesize, args.shareMode);
- result.setSuccessIsSet(true);
+ public getLectureData_result getResult(I iface, getLectureData_args args) throws org.apache.thrift.TException {
+ getLectureData_result result = new getLectureData_result();
+ result.success = iface.getLectureData(args.lectureid);
return result;
}
}
- public static class getLectureData<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getLectureData_args> {
- public getLectureData() {
- super("getLectureData");
+ public static class updateImageData<I extends Iface> extends org.apache.thrift.ProcessFunction<I, updateImageData_args> {
+ public updateImageData() {
+ super("updateImageData");
}
- public getLectureData_args getEmptyArgsInstance() {
- return new getLectureData_args();
+ public updateImageData_args getEmptyArgsInstance() {
+ return new updateImageData_args();
}
protected boolean isOneway() {
return false;
}
- public getLectureData_result getResult(I iface, getLectureData_args args) throws org.apache.thrift.TException {
- getLectureData_result result = new getLectureData_result();
- result.success = iface.getLectureData(args.lecturename);
+ public updateImageData_result getResult(I iface, updateImageData_args args) throws org.apache.thrift.TException {
+ updateImageData_result result = new updateImageData_result();
+ result.success = iface.updateImageData(args.name, args.newName, args.desc, args.image_path, args.license, args.internet, args.ram, args.cpu, args.id, args.version, args.isTemplate, args.filesize, args.shareMode, args.os);
+ result.setSuccessIsSet(true);
return result;
}
}
@@ -1781,7 +2109,7 @@ public class Server {
public updateLecturedata_result getResult(I iface, updateLecturedata_args args) throws org.apache.thrift.TException {
updateLecturedata_result result = new updateLecturedata_result();
- result.success = iface.updateLecturedata(args.name, args.newName, args.shortdesc, args.desc, args.startDate, args.endDate, args.isActive, args.imagename, args.firstname, args.lastname, args.university, args.Mail, args.Tel, args.Fak, args.id);
+ result.success = iface.updateLecturedata(args.name, args.newName, args.shortdesc, args.desc, args.startDate, args.endDate, args.isActive, args.imageid, args.imageversion, args.user, args.firstname, args.lastname, args.university, args.Mail, args.Tel, args.Fak, args.id);
result.setSuccessIsSet(true);
return result;
}
@@ -1850,6 +2178,90 @@ public class Server {
}
}
+ public static class checkUser<I extends Iface> extends org.apache.thrift.ProcessFunction<I, checkUser_args> {
+ public checkUser() {
+ super("checkUser");
+ }
+
+ public checkUser_args getEmptyArgsInstance() {
+ return new checkUser_args();
+ }
+
+ protected boolean isOneway() {
+ return false;
+ }
+
+ public checkUser_result getResult(I iface, checkUser_args args) throws org.apache.thrift.TException {
+ checkUser_result result = new checkUser_result();
+ result.success = iface.checkUser(args.username);
+ result.setSuccessIsSet(true);
+ return result;
+ }
+ }
+
+ public static class createUser<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createUser_args> {
+ public createUser() {
+ super("createUser");
+ }
+
+ public createUser_args getEmptyArgsInstance() {
+ return new createUser_args();
+ }
+
+ protected boolean isOneway() {
+ return false;
+ }
+
+ public createUser_result getResult(I iface, createUser_args args) throws org.apache.thrift.TException {
+ createUser_result result = new createUser_result();
+ result.success = iface.createUser(args.loginName, args.lastName, args.firstName, args.mail, args.university);
+ result.setSuccessIsSet(true);
+ return result;
+ }
+ }
+
+ public static class writeImageRights<I extends Iface> extends org.apache.thrift.ProcessFunction<I, writeImageRights_args> {
+ public writeImageRights() {
+ super("writeImageRights");
+ }
+
+ public writeImageRights_args getEmptyArgsInstance() {
+ return new writeImageRights_args();
+ }
+
+ protected boolean isOneway() {
+ return false;
+ }
+
+ public writeImageRights_result getResult(I iface, writeImageRights_args args) throws org.apache.thrift.TException {
+ writeImageRights_result result = new writeImageRights_result();
+ result.success = iface.writeImageRights(args.imagename, args.username, args.lastName, args.firstName, args.mail, args.university, args.role);
+ result.setSuccessIsSet(true);
+ return result;
+ }
+ }
+
+ public static class writeLectureRights<I extends Iface> extends org.apache.thrift.ProcessFunction<I, writeLectureRights_args> {
+ public writeLectureRights() {
+ super("writeLectureRights");
+ }
+
+ public writeLectureRights_args getEmptyArgsInstance() {
+ return new writeLectureRights_args();
+ }
+
+ protected boolean isOneway() {
+ return false;
+ }
+
+ public writeLectureRights_result getResult(I iface, writeLectureRights_args args) throws org.apache.thrift.TException {
+ writeLectureRights_result result = new writeLectureRights_result();
+ result.success = iface.writeLectureRights(args.lecturename, args.username, args.lastName, args.firstName, args.mail, args.university, args.role);
+ result.setSuccessIsSet(true);
+ return result;
+ }
+ }
+
}
public static class AsyncProcessor<I extends AsyncIface> extends org.apache.thrift.TBaseAsyncProcessor<I> {
@@ -1875,13 +2287,17 @@ public class Server {
processMap.put("writeLecturedata", new writeLecturedata());
processMap.put("startFileCopy", new startFileCopy());
processMap.put("getImageData", new getImageData());
- processMap.put("updateImageData", new updateImageData());
processMap.put("getLectureData", new getLectureData());
+ processMap.put("updateImageData", new updateImageData());
processMap.put("deleteImageData", new deleteImageData());
processMap.put("updateLecturedata", new updateLecturedata());
processMap.put("deleteImageServer", new deleteImageServer());
processMap.put("connectedToLecture", new connectedToLecture());
processMap.put("deleteLecture", new deleteLecture());
+ processMap.put("checkUser", new checkUser());
+ processMap.put("createUser", new createUser());
+ processMap.put("writeImageRights", new writeImageRights());
+ processMap.put("writeLectureRights", new writeLectureRights());
return processMap;
}
@@ -2087,7 +2503,7 @@ public class Server {
}
public void start(I iface, writeVLdata_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws TException {
- iface.writeVLdata(args.imagename, args.login, args.firstname, args.lastname, args.university, args.Mail, args.Tel, args.Fak, args.license, args.internet, args.ram, args.cpu, args.imagePath, args.isTemplate, args.filesize, args.shareMode,resultHandler);
+ iface.writeVLdata(args.imagename, args.desc, args.login, args.firstname, args.lastname, args.university, args.Mail, args.Tel, args.Fak, args.license, args.internet, args.ram, args.cpu, args.imagePath, args.isTemplate, args.filesize, args.shareMode, args.os,resultHandler);
}
}
@@ -2501,22 +2917,21 @@ public class Server {
}
}
- public static class updateImageData<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, updateImageData_args, Boolean> {
- public updateImageData() {
- super("updateImageData");
+ public static class getLectureData<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getLectureData_args, Map<String,String>> {
+ public getLectureData() {
+ super("getLectureData");
}
- public updateImageData_args getEmptyArgsInstance() {
- return new updateImageData_args();
+ public getLectureData_args getEmptyArgsInstance() {
+ return new getLectureData_args();
}
- public AsyncMethodCallback<Boolean> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+ public AsyncMethodCallback<Map<String,String>> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
- return new AsyncMethodCallback<Boolean>() {
- public void onComplete(Boolean o) {
- updateImageData_result result = new updateImageData_result();
+ return new AsyncMethodCallback<Map<String,String>>() {
+ public void onComplete(Map<String,String> o) {
+ getLectureData_result result = new getLectureData_result();
result.success = o;
- result.setSuccessIsSet(true);
try {
fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
return;
@@ -2528,7 +2943,7 @@ public class Server {
public void onError(Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TBase msg;
- updateImageData_result result = new updateImageData_result();
+ getLectureData_result result = new getLectureData_result();
{
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
@@ -2548,26 +2963,27 @@ public class Server {
return false;
}
- public void start(I iface, updateImageData_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws TException {
- iface.updateImageData(args.name, args.newName, args.image_path, args.license, args.internet, args.ram, args.cpu, args.id, args.version, args.isTemplate, args.filesize, args.shareMode,resultHandler);
+ public void start(I iface, getLectureData_args args, org.apache.thrift.async.AsyncMethodCallback<Map<String,String>> resultHandler) throws TException {
+ iface.getLectureData(args.lectureid,resultHandler);
}
}
- public static class getLectureData<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getLectureData_args, Map<String,String>> {
- public getLectureData() {
- super("getLectureData");
+ public static class updateImageData<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, updateImageData_args, Boolean> {
+ public updateImageData() {
+ super("updateImageData");
}
- public getLectureData_args getEmptyArgsInstance() {
- return new getLectureData_args();
+ public updateImageData_args getEmptyArgsInstance() {
+ return new updateImageData_args();
}
- public AsyncMethodCallback<Map<String,String>> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+ public AsyncMethodCallback<Boolean> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
- return new AsyncMethodCallback<Map<String,String>>() {
- public void onComplete(Map<String,String> o) {
- getLectureData_result result = new getLectureData_result();
+ return new AsyncMethodCallback<Boolean>() {
+ public void onComplete(Boolean o) {
+ updateImageData_result result = new updateImageData_result();
result.success = o;
+ result.setSuccessIsSet(true);
try {
fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
return;
@@ -2579,7 +2995,7 @@ public class Server {
public void onError(Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TBase msg;
- getLectureData_result result = new getLectureData_result();
+ updateImageData_result result = new updateImageData_result();
{
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
@@ -2599,8 +3015,8 @@ public class Server {
return false;
}
- public void start(I iface, getLectureData_args args, org.apache.thrift.async.AsyncMethodCallback<Map<String,String>> resultHandler) throws TException {
- iface.getLectureData(args.lecturename,resultHandler);
+ public void start(I iface, updateImageData_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws TException {
+ iface.updateImageData(args.name, args.newName, args.desc, args.image_path, args.license, args.internet, args.ram, args.cpu, args.id, args.version, args.isTemplate, args.filesize, args.shareMode, args.os,resultHandler);
}
}
@@ -2704,7 +3120,7 @@ public class Server {
}
public void start(I iface, updateLecturedata_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws TException {
- iface.updateLecturedata(args.name, args.newName, args.shortdesc, args.desc, args.startDate, args.endDate, args.isActive, args.imagename, args.firstname, args.lastname, args.university, args.Mail, args.Tel, args.Fak, args.id,resultHandler);
+ iface.updateLecturedata(args.name, args.newName, args.shortdesc, args.desc, args.startDate, args.endDate, args.isActive, args.imageid, args.imageversion, args.user, args.firstname, args.lastname, args.university, args.Mail, args.Tel, args.Fak, args.id,resultHandler);
}
}
@@ -2864,6 +3280,214 @@ public class Server {
}
}
+ public static class checkUser<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, checkUser_args, Boolean> {
+ public checkUser() {
+ super("checkUser");
+ }
+
+ public checkUser_args getEmptyArgsInstance() {
+ return new checkUser_args();
+ }
+
+ public AsyncMethodCallback<Boolean> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+ final org.apache.thrift.AsyncProcessFunction fcall = this;
+ return new AsyncMethodCallback<Boolean>() {
+ public void onComplete(Boolean o) {
+ checkUser_result result = new checkUser_result();
+ result.success = o;
+ result.setSuccessIsSet(true);
+ try {
+ fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+ return;
+ } catch (Exception e) {
+ LOGGER.error("Exception writing to internal frame buffer", e);
+ }
+ fb.close();
+ }
+ public void onError(Exception e) {
+ byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+ org.apache.thrift.TBase msg;
+ checkUser_result result = new checkUser_result();
+ {
+ msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+ msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+ }
+ try {
+ fcall.sendResponse(fb,msg,msgType,seqid);
+ return;
+ } catch (Exception ex) {
+ LOGGER.error("Exception writing to internal frame buffer", ex);
+ }
+ fb.close();
+ }
+ };
+ }
+
+ protected boolean isOneway() {
+ return false;
+ }
+
+ public void start(I iface, checkUser_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws TException {
+ iface.checkUser(args.username,resultHandler);
+ }
+ }
+
+ public static class createUser<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, createUser_args, Boolean> {
+ public createUser() {
+ super("createUser");
+ }
+
+ public createUser_args getEmptyArgsInstance() {
+ return new createUser_args();
+ }
+
+ public AsyncMethodCallback<Boolean> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+ final org.apache.thrift.AsyncProcessFunction fcall = this;
+ return new AsyncMethodCallback<Boolean>() {
+ public void onComplete(Boolean o) {
+ createUser_result result = new createUser_result();
+ result.success = o;
+ result.setSuccessIsSet(true);
+ try {
+ fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+ return;
+ } catch (Exception e) {
+ LOGGER.error("Exception writing to internal frame buffer", e);
+ }
+ fb.close();
+ }
+ public void onError(Exception e) {
+ byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+ org.apache.thrift.TBase msg;
+ createUser_result result = new createUser_result();
+ {
+ msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+ msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+ }
+ try {
+ fcall.sendResponse(fb,msg,msgType,seqid);
+ return;
+ } catch (Exception ex) {
+ LOGGER.error("Exception writing to internal frame buffer", ex);
+ }
+ fb.close();
+ }
+ };
+ }
+
+ protected boolean isOneway() {
+ return false;
+ }
+
+ public void start(I iface, createUser_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws TException {
+ iface.createUser(args.loginName, args.lastName, args.firstName, args.mail, args.university,resultHandler);
+ }
+ }
+
+ public static class writeImageRights<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, writeImageRights_args, Boolean> {
+ public writeImageRights() {
+ super("writeImageRights");
+ }
+
+ public writeImageRights_args getEmptyArgsInstance() {
+ return new writeImageRights_args();
+ }
+
+ public AsyncMethodCallback<Boolean> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+ final org.apache.thrift.AsyncProcessFunction fcall = this;
+ return new AsyncMethodCallback<Boolean>() {
+ public void onComplete(Boolean o) {
+ writeImageRights_result result = new writeImageRights_result();
+ result.success = o;
+ result.setSuccessIsSet(true);
+ try {
+ fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+ return;
+ } catch (Exception e) {
+ LOGGER.error("Exception writing to internal frame buffer", e);
+ }
+ fb.close();
+ }
+ public void onError(Exception e) {
+ byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+ org.apache.thrift.TBase msg;
+ writeImageRights_result result = new writeImageRights_result();
+ {
+ msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+ msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+ }
+ try {
+ fcall.sendResponse(fb,msg,msgType,seqid);
+ return;
+ } catch (Exception ex) {
+ LOGGER.error("Exception writing to internal frame buffer", ex);
+ }
+ fb.close();
+ }
+ };
+ }
+
+ protected boolean isOneway() {
+ return false;
+ }
+
+ public void start(I iface, writeImageRights_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws TException {
+ iface.writeImageRights(args.imagename, args.username, args.lastName, args.firstName, args.mail, args.university, args.role,resultHandler);
+ }
+ }
+
+ public static class writeLectureRights<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, writeLectureRights_args, Boolean> {
+ public writeLectureRights() {
+ super("writeLectureRights");
+ }
+
+ public writeLectureRights_args getEmptyArgsInstance() {
+ return new writeLectureRights_args();
+ }
+
+ public AsyncMethodCallback<Boolean> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+ final org.apache.thrift.AsyncProcessFunction fcall = this;
+ return new AsyncMethodCallback<Boolean>() {
+ public void onComplete(Boolean o) {
+ writeLectureRights_result result = new writeLectureRights_result();
+ result.success = o;
+ result.setSuccessIsSet(true);
+ try {
+ fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+ return;
+ } catch (Exception e) {
+ LOGGER.error("Exception writing to internal frame buffer", e);
+ }
+ fb.close();
+ }
+ public void onError(Exception e) {
+ byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+ org.apache.thrift.TBase msg;
+ writeLectureRights_result result = new writeLectureRights_result();
+ {
+ msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+ msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+ }
+ try {
+ fcall.sendResponse(fb,msg,msgType,seqid);
+ return;
+ } catch (Exception ex) {
+ LOGGER.error("Exception writing to internal frame buffer", ex);
+ }
+ fb.close();
+ }
+ };
+ }
+
+ protected boolean isOneway() {
+ return false;
+ }
+
+ public void start(I iface, writeLectureRights_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws TException {
+ iface.writeLectureRights(args.lecturename, args.username, args.lastName, args.firstName, args.mail, args.university, args.role,resultHandler);
+ }
+ }
+
}
public static class getFtpUser_args implements org.apache.thrift.TBase<getFtpUser_args, getFtpUser_args._Fields>, java.io.Serializable, Cloneable, Comparable<getFtpUser_args> {
@@ -4991,21 +5615,23 @@ public class Server {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("writeVLdata_args");
private static final org.apache.thrift.protocol.TField IMAGENAME_FIELD_DESC = new org.apache.thrift.protocol.TField("imagename", org.apache.thrift.protocol.TType.STRING, (short)-1);
- private static final org.apache.thrift.protocol.TField LOGIN_FIELD_DESC = new org.apache.thrift.protocol.TField("login", org.apache.thrift.protocol.TType.STRING, (short)-2);
- private static final org.apache.thrift.protocol.TField FIRSTNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("firstname", org.apache.thrift.protocol.TType.STRING, (short)-3);
- private static final org.apache.thrift.protocol.TField LASTNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("lastname", org.apache.thrift.protocol.TType.STRING, (short)-4);
- private static final org.apache.thrift.protocol.TField UNIVERSITY_FIELD_DESC = new org.apache.thrift.protocol.TField("university", org.apache.thrift.protocol.TType.STRING, (short)-5);
- private static final org.apache.thrift.protocol.TField MAIL_FIELD_DESC = new org.apache.thrift.protocol.TField("Mail", org.apache.thrift.protocol.TType.STRING, (short)-6);
- private static final org.apache.thrift.protocol.TField TEL_FIELD_DESC = new org.apache.thrift.protocol.TField("Tel", org.apache.thrift.protocol.TType.STRING, (short)-7);
- private static final org.apache.thrift.protocol.TField FAK_FIELD_DESC = new org.apache.thrift.protocol.TField("Fak", org.apache.thrift.protocol.TType.STRING, (short)-8);
- private static final org.apache.thrift.protocol.TField LICENSE_FIELD_DESC = new org.apache.thrift.protocol.TField("license", org.apache.thrift.protocol.TType.BOOL, (short)-9);
- private static final org.apache.thrift.protocol.TField INTERNET_FIELD_DESC = new org.apache.thrift.protocol.TField("internet", org.apache.thrift.protocol.TType.BOOL, (short)-10);
- private static final org.apache.thrift.protocol.TField RAM_FIELD_DESC = new org.apache.thrift.protocol.TField("ram", org.apache.thrift.protocol.TType.I64, (short)-11);
- private static final org.apache.thrift.protocol.TField CPU_FIELD_DESC = new org.apache.thrift.protocol.TField("cpu", org.apache.thrift.protocol.TType.I64, (short)-12);
- private static final org.apache.thrift.protocol.TField IMAGE_PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("imagePath", org.apache.thrift.protocol.TType.STRING, (short)-13);
- private static final org.apache.thrift.protocol.TField IS_TEMPLATE_FIELD_DESC = new org.apache.thrift.protocol.TField("isTemplate", org.apache.thrift.protocol.TType.BOOL, (short)-14);
- private static final org.apache.thrift.protocol.TField FILESIZE_FIELD_DESC = new org.apache.thrift.protocol.TField("filesize", org.apache.thrift.protocol.TType.I64, (short)-15);
- private static final org.apache.thrift.protocol.TField SHARE_MODE_FIELD_DESC = new org.apache.thrift.protocol.TField("shareMode", org.apache.thrift.protocol.TType.I64, (short)-16);
+ private static final org.apache.thrift.protocol.TField DESC_FIELD_DESC = new org.apache.thrift.protocol.TField("desc", org.apache.thrift.protocol.TType.STRING, (short)-2);
+ private static final org.apache.thrift.protocol.TField LOGIN_FIELD_DESC = new org.apache.thrift.protocol.TField("login", org.apache.thrift.protocol.TType.STRING, (short)-3);
+ private static final org.apache.thrift.protocol.TField FIRSTNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("firstname", org.apache.thrift.protocol.TType.STRING, (short)-4);
+ private static final org.apache.thrift.protocol.TField LASTNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("lastname", org.apache.thrift.protocol.TType.STRING, (short)-5);
+ private static final org.apache.thrift.protocol.TField UNIVERSITY_FIELD_DESC = new org.apache.thrift.protocol.TField("university", org.apache.thrift.protocol.TType.STRING, (short)-6);
+ private static final org.apache.thrift.protocol.TField MAIL_FIELD_DESC = new org.apache.thrift.protocol.TField("Mail", org.apache.thrift.protocol.TType.STRING, (short)-7);
+ private static final org.apache.thrift.protocol.TField TEL_FIELD_DESC = new org.apache.thrift.protocol.TField("Tel", org.apache.thrift.protocol.TType.STRING, (short)-8);
+ private static final org.apache.thrift.protocol.TField FAK_FIELD_DESC = new org.apache.thrift.protocol.TField("Fak", org.apache.thrift.protocol.TType.STRING, (short)-9);
+ private static final org.apache.thrift.protocol.TField LICENSE_FIELD_DESC = new org.apache.thrift.protocol.TField("license", org.apache.thrift.protocol.TType.BOOL, (short)-10);
+ private static final org.apache.thrift.protocol.TField INTERNET_FIELD_DESC = new org.apache.thrift.protocol.TField("internet", org.apache.thrift.protocol.TType.BOOL, (short)-11);
+ private static final org.apache.thrift.protocol.TField RAM_FIELD_DESC = new org.apache.thrift.protocol.TField("ram", org.apache.thrift.protocol.TType.I64, (short)-12);
+ private static final org.apache.thrift.protocol.TField CPU_FIELD_DESC = new org.apache.thrift.protocol.TField("cpu", org.apache.thrift.protocol.TType.I64, (short)-13);
+ private static final org.apache.thrift.protocol.TField IMAGE_PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("imagePath", org.apache.thrift.protocol.TType.STRING, (short)-14);
+ private static final org.apache.thrift.protocol.TField IS_TEMPLATE_FIELD_DESC = new org.apache.thrift.protocol.TField("isTemplate", org.apache.thrift.protocol.TType.BOOL, (short)-15);
+ private static final org.apache.thrift.protocol.TField FILESIZE_FIELD_DESC = new org.apache.thrift.protocol.TField("filesize", org.apache.thrift.protocol.TType.I64, (short)-16);
+ private static final org.apache.thrift.protocol.TField SHARE_MODE_FIELD_DESC = new org.apache.thrift.protocol.TField("shareMode", org.apache.thrift.protocol.TType.I64, (short)-17);
+ private static final org.apache.thrift.protocol.TField OS_FIELD_DESC = new org.apache.thrift.protocol.TField("os", org.apache.thrift.protocol.TType.STRING, (short)-18);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
@@ -5014,6 +5640,7 @@ public class Server {
}
public String imagename; // required
+ public String desc; // required
public String login; // required
public String firstname; // required
public String lastname; // required
@@ -5029,25 +5656,28 @@ public class Server {
public boolean isTemplate; // required
public long filesize; // required
public long shareMode; // required
+ public String os; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
IMAGENAME((short)-1, "imagename"),
- LOGIN((short)-2, "login"),
- FIRSTNAME((short)-3, "firstname"),
- LASTNAME((short)-4, "lastname"),
- UNIVERSITY((short)-5, "university"),
- MAIL((short)-6, "Mail"),
- TEL((short)-7, "Tel"),
- FAK((short)-8, "Fak"),
- LICENSE((short)-9, "license"),
- INTERNET((short)-10, "internet"),
- RAM((short)-11, "ram"),
- CPU((short)-12, "cpu"),
- IMAGE_PATH((short)-13, "imagePath"),
- IS_TEMPLATE((short)-14, "isTemplate"),
- FILESIZE((short)-15, "filesize"),
- SHARE_MODE((short)-16, "shareMode");
+ DESC((short)-2, "desc"),
+ LOGIN((short)-3, "login"),
+ FIRSTNAME((short)-4, "firstname"),
+ LASTNAME((short)-5, "lastname"),
+ UNIVERSITY((short)-6, "university"),
+ MAIL((short)-7, "Mail"),
+ TEL((short)-8, "Tel"),
+ FAK((short)-9, "Fak"),
+ LICENSE((short)-10, "license"),
+ INTERNET((short)-11, "internet"),
+ RAM((short)-12, "ram"),
+ CPU((short)-13, "cpu"),
+ IMAGE_PATH((short)-14, "imagePath"),
+ IS_TEMPLATE((short)-15, "isTemplate"),
+ FILESIZE((short)-16, "filesize"),
+ SHARE_MODE((short)-17, "shareMode"),
+ OS((short)-18, "os");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@@ -5064,36 +5694,40 @@ public class Server {
switch(fieldId) {
case -1: // IMAGENAME
return IMAGENAME;
- case -2: // LOGIN
+ case -2: // DESC
+ return DESC;
+ case -3: // LOGIN
return LOGIN;
- case -3: // FIRSTNAME
+ case -4: // FIRSTNAME
return FIRSTNAME;
- case -4: // LASTNAME
+ case -5: // LASTNAME
return LASTNAME;
- case -5: // UNIVERSITY
+ case -6: // UNIVERSITY
return UNIVERSITY;
- case -6: // MAIL
+ case -7: // MAIL
return MAIL;
- case -7: // TEL
+ case -8: // TEL
return TEL;
- case -8: // FAK
+ case -9: // FAK
return FAK;
- case -9: // LICENSE
+ case -10: // LICENSE
return LICENSE;
- case -10: // INTERNET
+ case -11: // INTERNET
return INTERNET;
- case -11: // RAM
+ case -12: // RAM
return RAM;
- case -12: // CPU
+ case -13: // CPU
return CPU;
- case -13: // IMAGE_PATH
+ case -14: // IMAGE_PATH
return IMAGE_PATH;
- case -14: // IS_TEMPLATE
+ case -15: // IS_TEMPLATE
return IS_TEMPLATE;
- case -15: // FILESIZE
+ case -16: // FILESIZE
return FILESIZE;
- case -16: // SHARE_MODE
+ case -17: // SHARE_MODE
return SHARE_MODE;
+ case -18: // OS
+ return OS;
default:
return null;
}
@@ -5147,6 +5781,8 @@ public class Server {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.IMAGENAME, new org.apache.thrift.meta_data.FieldMetaData("imagename", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.DESC, new org.apache.thrift.meta_data.FieldMetaData("desc", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.LOGIN, new org.apache.thrift.meta_data.FieldMetaData("login", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.FIRSTNAME, new org.apache.thrift.meta_data.FieldMetaData("firstname", org.apache.thrift.TFieldRequirementType.DEFAULT,
@@ -5177,6 +5813,8 @@ public class Server {
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.SHARE_MODE, new org.apache.thrift.meta_data.FieldMetaData("shareMode", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64 , "int")));
+ tmpMap.put(_Fields.OS, new org.apache.thrift.meta_data.FieldMetaData("os", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(writeVLdata_args.class, metaDataMap);
}
@@ -5186,6 +5824,7 @@ public class Server {
public writeVLdata_args(
String imagename,
+ String desc,
String login,
String firstname,
String lastname,
@@ -5200,10 +5839,12 @@ public class Server {
String imagePath,
boolean isTemplate,
long filesize,
- long shareMode)
+ long shareMode,
+ String os)
{
this();
this.imagename = imagename;
+ this.desc = desc;
this.login = login;
this.firstname = firstname;
this.lastname = lastname;
@@ -5226,6 +5867,7 @@ public class Server {
setFilesizeIsSet(true);
this.shareMode = shareMode;
setShareModeIsSet(true);
+ this.os = os;
}
/**
@@ -5236,6 +5878,9 @@ public class Server {
if (other.isSetImagename()) {
this.imagename = other.imagename;
}
+ if (other.isSetDesc()) {
+ this.desc = other.desc;
+ }
if (other.isSetLogin()) {
this.login = other.login;
}
@@ -5267,6 +5912,9 @@ public class Server {
this.isTemplate = other.isTemplate;
this.filesize = other.filesize;
this.shareMode = other.shareMode;
+ if (other.isSetOs()) {
+ this.os = other.os;
+ }
}
public writeVLdata_args deepCopy() {
@@ -5276,6 +5924,7 @@ public class Server {
@Override
public void clear() {
this.imagename = null;
+ this.desc = null;
this.login = null;
this.firstname = null;
this.lastname = null;
@@ -5298,6 +5947,7 @@ public class Server {
this.filesize = 0;
setShareModeIsSet(false);
this.shareMode = 0;
+ this.os = null;
}
public String getImagename() {
@@ -5324,6 +5974,30 @@ public class Server {
}
}
+ public String getDesc() {
+ return this.desc;
+ }
+
+ public writeVLdata_args setDesc(String desc) {
+ this.desc = desc;
+ return this;
+ }
+
+ public void unsetDesc() {
+ this.desc = null;
+ }
+
+ /** Returns true if field desc is set (has been assigned a value) and false otherwise */
+ public boolean isSetDesc() {
+ return this.desc != null;
+ }
+
+ public void setDescIsSet(boolean value) {
+ if (!value) {
+ this.desc = null;
+ }
+ }
+
public String getLogin() {
return this.login;
}
@@ -5677,6 +6351,30 @@ public class Server {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SHAREMODE_ISSET_ID, value);
}
+ public String getOs() {
+ return this.os;
+ }
+
+ public writeVLdata_args setOs(String os) {
+ this.os = os;
+ return this;
+ }
+
+ public void unsetOs() {
+ this.os = null;
+ }
+
+ /** Returns true if field os is set (has been assigned a value) and false otherwise */
+ public boolean isSetOs() {
+ return this.os != null;
+ }
+
+ public void setOsIsSet(boolean value) {
+ if (!value) {
+ this.os = null;
+ }
+ }
+
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case IMAGENAME:
@@ -5687,6 +6385,14 @@ public class Server {
}
break;
+ case DESC:
+ if (value == null) {
+ unsetDesc();
+ } else {
+ setDesc((String)value);
+ }
+ break;
+
case LOGIN:
if (value == null) {
unsetLogin();
@@ -5807,6 +6513,14 @@ public class Server {
}
break;
+ case OS:
+ if (value == null) {
+ unsetOs();
+ } else {
+ setOs((String)value);
+ }
+ break;
+
}
}
@@ -5815,6 +6529,9 @@ public class Server {
case IMAGENAME:
return getImagename();
+ case DESC:
+ return getDesc();
+
case LOGIN:
return getLogin();
@@ -5860,6 +6577,9 @@ public class Server {
case SHARE_MODE:
return Long.valueOf(getShareMode());
+ case OS:
+ return getOs();
+
}
throw new IllegalStateException();
}
@@ -5873,6 +6593,8 @@ public class Server {
switch (field) {
case IMAGENAME:
return isSetImagename();
+ case DESC:
+ return isSetDesc();
case LOGIN:
return isSetLogin();
case FIRSTNAME:
@@ -5903,6 +6625,8 @@ public class Server {
return isSetFilesize();
case SHARE_MODE:
return isSetShareMode();
+ case OS:
+ return isSetOs();
}
throw new IllegalStateException();
}
@@ -5929,6 +6653,15 @@ public class Server {
return false;
}
+ boolean this_present_desc = true && this.isSetDesc();
+ boolean that_present_desc = true && that.isSetDesc();
+ if (this_present_desc || that_present_desc) {
+ if (!(this_present_desc && that_present_desc))
+ return false;
+ if (!this.desc.equals(that.desc))
+ return false;
+ }
+
boolean this_present_login = true && this.isSetLogin();
boolean that_present_login = true && that.isSetLogin();
if (this_present_login || that_present_login) {
@@ -6064,6 +6797,15 @@ public class Server {
return false;
}
+ boolean this_present_os = true && this.isSetOs();
+ boolean that_present_os = true && that.isSetOs();
+ if (this_present_os || that_present_os) {
+ if (!(this_present_os && that_present_os))
+ return false;
+ if (!this.os.equals(that.os))
+ return false;
+ }
+
return true;
}
@@ -6090,6 +6832,16 @@ public class Server {
return lastComparison;
}
}
+ lastComparison = Boolean.valueOf(isSetDesc()).compareTo(other.isSetDesc());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetDesc()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.desc, other.desc);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
lastComparison = Boolean.valueOf(isSetLogin()).compareTo(other.isSetLogin());
if (lastComparison != 0) {
return lastComparison;
@@ -6240,6 +6992,16 @@ public class Server {
return lastComparison;
}
}
+ lastComparison = Boolean.valueOf(isSetOs()).compareTo(other.isSetOs());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetOs()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.os, other.os);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
return 0;
}
@@ -6268,6 +7030,14 @@ public class Server {
}
first = false;
if (!first) sb.append(", ");
+ sb.append("desc:");
+ if (this.desc == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.desc);
+ }
+ first = false;
+ if (!first) sb.append(", ");
sb.append("login:");
if (this.login == null) {
sb.append("null");
@@ -6359,6 +7129,14 @@ public class Server {
sb.append("shareMode:");
sb.append(this.shareMode);
first = false;
+ if (!first) sb.append(", ");
+ sb.append("os:");
+ if (this.os == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.os);
+ }
+ first = false;
sb.append(")");
return sb.toString();
}
@@ -6412,7 +7190,15 @@ public class Server {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case -2: // LOGIN
+ case -2: // DESC
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.desc = iprot.readString();
+ struct.setDescIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case -3: // LOGIN
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.login = iprot.readString();
struct.setLoginIsSet(true);
@@ -6420,7 +7206,7 @@ public class Server {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case -3: // FIRSTNAME
+ case -4: // FIRSTNAME
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.firstname = iprot.readString();
struct.setFirstnameIsSet(true);
@@ -6428,7 +7214,7 @@ public class Server {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case -4: // LASTNAME
+ case -5: // LASTNAME
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.lastname = iprot.readString();
struct.setLastnameIsSet(true);
@@ -6436,7 +7222,7 @@ public class Server {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case -5: // UNIVERSITY
+ case -6: // UNIVERSITY
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.university = iprot.readString();
struct.setUniversityIsSet(true);
@@ -6444,7 +7230,7 @@ public class Server {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case -6: // MAIL
+ case -7: // MAIL
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.Mail = iprot.readString();
struct.setMailIsSet(true);
@@ -6452,7 +7238,7 @@ public class Server {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case -7: // TEL
+ case -8: // TEL
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.Tel = iprot.readString();
struct.setTelIsSet(true);
@@ -6460,7 +7246,7 @@ public class Server {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case -8: // FAK
+ case -9: // FAK
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.Fak = iprot.readString();
struct.setFakIsSet(true);
@@ -6468,7 +7254,7 @@ public class Server {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case -9: // LICENSE
+ case -10: // LICENSE
if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
struct.license = iprot.readBool();
struct.setLicenseIsSet(true);
@@ -6476,7 +7262,7 @@ public class Server {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case -10: // INTERNET
+ case -11: // INTERNET
if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
struct.internet = iprot.readBool();
struct.setInternetIsSet(true);
@@ -6484,7 +7270,7 @@ public class Server {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case -11: // RAM
+ case -12: // RAM
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.ram = iprot.readI64();
struct.setRamIsSet(true);
@@ -6492,7 +7278,7 @@ public class Server {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case -12: // CPU
+ case -13: // CPU
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.cpu = iprot.readI64();
struct.setCpuIsSet(true);
@@ -6500,7 +7286,7 @@ public class Server {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case -13: // IMAGE_PATH
+ case -14: // IMAGE_PATH
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.imagePath = iprot.readString();
struct.setImagePathIsSet(true);
@@ -6508,7 +7294,7 @@ public class Server {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case -14: // IS_TEMPLATE
+ case -15: // IS_TEMPLATE
if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
struct.isTemplate = iprot.readBool();
struct.setIsTemplateIsSet(true);
@@ -6516,7 +7302,7 @@ public class Server {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case -15: // FILESIZE
+ case -16: // FILESIZE
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.filesize = iprot.readI64();
struct.setFilesizeIsSet(true);
@@ -6524,7 +7310,7 @@ public class Server {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case -16: // SHARE_MODE
+ case -17: // SHARE_MODE
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.shareMode = iprot.readI64();
struct.setShareModeIsSet(true);
@@ -6532,6 +7318,14 @@ public class Server {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
+ case -18: // OS
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.os = iprot.readString();
+ struct.setOsIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
@@ -6547,6 +7341,11 @@ public class Server {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.os != null) {
+ oprot.writeFieldBegin(OS_FIELD_DESC);
+ oprot.writeString(struct.os);
+ oprot.writeFieldEnd();
+ }
oprot.writeFieldBegin(SHARE_MODE_FIELD_DESC);
oprot.writeI64(struct.shareMode);
oprot.writeFieldEnd();
@@ -6608,6 +7407,11 @@ public class Server {
oprot.writeString(struct.login);
oprot.writeFieldEnd();
}
+ if (struct.desc != null) {
+ oprot.writeFieldBegin(DESC_FIELD_DESC);
+ oprot.writeString(struct.desc);
+ oprot.writeFieldEnd();
+ }
if (struct.imagename != null) {
oprot.writeFieldBegin(IMAGENAME_FIELD_DESC);
oprot.writeString(struct.imagename);
@@ -6634,55 +7438,64 @@ public class Server {
if (struct.isSetImagename()) {
optionals.set(0);
}
- if (struct.isSetLogin()) {
+ if (struct.isSetDesc()) {
optionals.set(1);
}
- if (struct.isSetFirstname()) {
+ if (struct.isSetLogin()) {
optionals.set(2);
}
- if (struct.isSetLastname()) {
+ if (struct.isSetFirstname()) {
optionals.set(3);
}
- if (struct.isSetUniversity()) {
+ if (struct.isSetLastname()) {
optionals.set(4);
}
- if (struct.isSetMail()) {
+ if (struct.isSetUniversity()) {
optionals.set(5);
}
- if (struct.isSetTel()) {
+ if (struct.isSetMail()) {
optionals.set(6);
}
- if (struct.isSetFak()) {
+ if (struct.isSetTel()) {
optionals.set(7);
}
- if (struct.isSetLicense()) {
+ if (struct.isSetFak()) {
optionals.set(8);
}
- if (struct.isSetInternet()) {
+ if (struct.isSetLicense()) {
optionals.set(9);
}
- if (struct.isSetRam()) {
+ if (struct.isSetInternet()) {
optionals.set(10);
}
- if (struct.isSetCpu()) {
+ if (struct.isSetRam()) {
optionals.set(11);
}
- if (struct.isSetImagePath()) {
+ if (struct.isSetCpu()) {
optionals.set(12);
}
- if (struct.isSetIsTemplate()) {
+ if (struct.isSetImagePath()) {
optionals.set(13);
}
- if (struct.isSetFilesize()) {
+ if (struct.isSetIsTemplate()) {
optionals.set(14);
}
- if (struct.isSetShareMode()) {
+ if (struct.isSetFilesize()) {
optionals.set(15);
}
- oprot.writeBitSet(optionals, 16);
+ if (struct.isSetShareMode()) {
+ optionals.set(16);
+ }
+ if (struct.isSetOs()) {
+ optionals.set(17);
+ }
+ oprot.writeBitSet(optionals, 18);
if (struct.isSetImagename()) {
oprot.writeString(struct.imagename);
}
+ if (struct.isSetDesc()) {
+ oprot.writeString(struct.desc);
+ }
if (struct.isSetLogin()) {
oprot.writeString(struct.login);
}
@@ -6728,76 +7541,87 @@ public class Server {
if (struct.isSetShareMode()) {
oprot.writeI64(struct.shareMode);
}
+ if (struct.isSetOs()) {
+ oprot.writeString(struct.os);
+ }
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, writeVLdata_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(16);
+ BitSet incoming = iprot.readBitSet(18);
if (incoming.get(0)) {
struct.imagename = iprot.readString();
struct.setImagenameIsSet(true);
}
if (incoming.get(1)) {
+ struct.desc = iprot.readString();
+ struct.setDescIsSet(true);
+ }
+ if (incoming.get(2)) {
struct.login = iprot.readString();
struct.setLoginIsSet(true);
}
- if (incoming.get(2)) {
+ if (incoming.get(3)) {
struct.firstname = iprot.readString();
struct.setFirstnameIsSet(true);
}
- if (incoming.get(3)) {
+ if (incoming.get(4)) {
struct.lastname = iprot.readString();
struct.setLastnameIsSet(true);
}
- if (incoming.get(4)) {
+ if (incoming.get(5)) {
struct.university = iprot.readString();
struct.setUniversityIsSet(true);
}
- if (incoming.get(5)) {
+ if (incoming.get(6)) {
struct.Mail = iprot.readString();
struct.setMailIsSet(true);
}
- if (incoming.get(6)) {
+ if (incoming.get(7)) {
struct.Tel = iprot.readString();
struct.setTelIsSet(true);
}
- if (incoming.get(7)) {
+ if (incoming.get(8)) {
struct.Fak = iprot.readString();
struct.setFakIsSet(true);
}
- if (incoming.get(8)) {
+ if (incoming.get(9)) {
struct.license = iprot.readBool();
struct.setLicenseIsSet(true);
}
- if (incoming.get(9)) {
+ if (incoming.get(10)) {
struct.internet = iprot.readBool();
struct.setInternetIsSet(true);
}
- if (incoming.get(10)) {
+ if (incoming.get(11)) {
struct.ram = iprot.readI64();
struct.setRamIsSet(true);
}
- if (incoming.get(11)) {
+ if (incoming.get(12)) {
struct.cpu = iprot.readI64();
struct.setCpuIsSet(true);
}
- if (incoming.get(12)) {
+ if (incoming.get(13)) {
struct.imagePath = iprot.readString();
struct.setImagePathIsSet(true);
}
- if (incoming.get(13)) {
+ if (incoming.get(14)) {
struct.isTemplate = iprot.readBool();
struct.setIsTemplateIsSet(true);
}
- if (incoming.get(14)) {
+ if (incoming.get(15)) {
struct.filesize = iprot.readI64();
struct.setFilesizeIsSet(true);
}
- if (incoming.get(15)) {
+ if (incoming.get(16)) {
struct.shareMode = iprot.readI64();
struct.setShareModeIsSet(true);
}
+ if (incoming.get(17)) {
+ struct.os = iprot.readString();
+ struct.setOsIsSet(true);
+ }
}
}
@@ -14197,21 +15021,783 @@ public class Server {
}
+ public static class getLectureData_args implements org.apache.thrift.TBase<getLectureData_args, getLectureData_args._Fields>, java.io.Serializable, Cloneable, Comparable<getLectureData_args> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getLectureData_args");
+
+ private static final org.apache.thrift.protocol.TField LECTUREID_FIELD_DESC = new org.apache.thrift.protocol.TField("lectureid", org.apache.thrift.protocol.TType.STRING, (short)-1);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new getLectureData_argsStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new getLectureData_argsTupleSchemeFactory());
+ }
+
+ public String lectureid; // required
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ LECTUREID((short)-1, "lectureid");
+
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+ static {
+ for (_Fields field : EnumSet.allOf(_Fields.class)) {
+ byName.put(field.getFieldName(), field);
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, or null if its not found.
+ */
+ public static _Fields findByThriftId(int fieldId) {
+ switch(fieldId) {
+ case -1: // LECTUREID
+ return LECTUREID;
+ default:
+ return null;
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, throwing an exception
+ * if it is not found.
+ */
+ public static _Fields findByThriftIdOrThrow(int fieldId) {
+ _Fields fields = findByThriftId(fieldId);
+ if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+ return fields;
+ }
+
+ /**
+ * Find the _Fields constant that matches name, or null if its not found.
+ */
+ public static _Fields findByName(String name) {
+ return byName.get(name);
+ }
+
+ private final short _thriftId;
+ private final String _fieldName;
+
+ _Fields(short thriftId, String fieldName) {
+ _thriftId = thriftId;
+ _fieldName = fieldName;
+ }
+
+ public short getThriftFieldId() {
+ return _thriftId;
+ }
+
+ public String getFieldName() {
+ return _fieldName;
+ }
+ }
+
+ // isset id assignments
+ public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+ static {
+ Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+ tmpMap.put(_Fields.LECTUREID, new org.apache.thrift.meta_data.FieldMetaData("lectureid", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getLectureData_args.class, metaDataMap);
+ }
+
+ public getLectureData_args() {
+ }
+
+ public getLectureData_args(
+ String lectureid)
+ {
+ this();
+ this.lectureid = lectureid;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public getLectureData_args(getLectureData_args other) {
+ if (other.isSetLectureid()) {
+ this.lectureid = other.lectureid;
+ }
+ }
+
+ public getLectureData_args deepCopy() {
+ return new getLectureData_args(this);
+ }
+
+ @Override
+ public void clear() {
+ this.lectureid = null;
+ }
+
+ public String getLectureid() {
+ return this.lectureid;
+ }
+
+ public getLectureData_args setLectureid(String lectureid) {
+ this.lectureid = lectureid;
+ return this;
+ }
+
+ public void unsetLectureid() {
+ this.lectureid = null;
+ }
+
+ /** Returns true if field lectureid is set (has been assigned a value) and false otherwise */
+ public boolean isSetLectureid() {
+ return this.lectureid != null;
+ }
+
+ public void setLectureidIsSet(boolean value) {
+ if (!value) {
+ this.lectureid = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case LECTUREID:
+ if (value == null) {
+ unsetLectureid();
+ } else {
+ setLectureid((String)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case LECTUREID:
+ return getLectureid();
+
+ }
+ throw new IllegalStateException();
+ }
+
+ /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+ public boolean isSet(_Fields field) {
+ if (field == null) {
+ throw new IllegalArgumentException();
+ }
+
+ switch (field) {
+ case LECTUREID:
+ return isSetLectureid();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof getLectureData_args)
+ return this.equals((getLectureData_args)that);
+ return false;
+ }
+
+ public boolean equals(getLectureData_args that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_lectureid = true && this.isSetLectureid();
+ boolean that_present_lectureid = true && that.isSetLectureid();
+ if (this_present_lectureid || that_present_lectureid) {
+ if (!(this_present_lectureid && that_present_lectureid))
+ return false;
+ if (!this.lectureid.equals(that.lectureid))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ @Override
+ public int compareTo(getLectureData_args other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ lastComparison = Boolean.valueOf(isSetLectureid()).compareTo(other.isSetLectureid());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetLectureid()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lectureid, other.lectureid);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ return 0;
+ }
+
+ public _Fields fieldForId(int fieldId) {
+ return _Fields.findByThriftId(fieldId);
+ }
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("getLectureData_args(");
+ boolean first = true;
+
+ sb.append("lectureid:");
+ if (this.lectureid == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.lectureid);
+ }
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ // check for sub-struct validity
+ }
+
+ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+ try {
+ write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+ try {
+ read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private static class getLectureData_argsStandardSchemeFactory implements SchemeFactory {
+ public getLectureData_argsStandardScheme getScheme() {
+ return new getLectureData_argsStandardScheme();
+ }
+ }
+
+ private static class getLectureData_argsStandardScheme extends StandardScheme<getLectureData_args> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, getLectureData_args struct) throws org.apache.thrift.TException {
+ org.apache.thrift.protocol.TField schemeField;
+ iprot.readStructBegin();
+ while (true)
+ {
+ schemeField = iprot.readFieldBegin();
+ if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
+ break;
+ }
+ switch (schemeField.id) {
+ case -1: // LECTUREID
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.lectureid = iprot.readString();
+ struct.setLectureidIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ default:
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ iprot.readFieldEnd();
+ }
+ iprot.readStructEnd();
+
+ // check for required fields of primitive type, which can't be checked in the validate method
+ struct.validate();
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot, getLectureData_args struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.lectureid != null) {
+ oprot.writeFieldBegin(LECTUREID_FIELD_DESC);
+ oprot.writeString(struct.lectureid);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class getLectureData_argsTupleSchemeFactory implements SchemeFactory {
+ public getLectureData_argsTupleScheme getScheme() {
+ return new getLectureData_argsTupleScheme();
+ }
+ }
+
+ private static class getLectureData_argsTupleScheme extends TupleScheme<getLectureData_args> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, getLectureData_args struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetLectureid()) {
+ optionals.set(0);
+ }
+ oprot.writeBitSet(optionals, 1);
+ if (struct.isSetLectureid()) {
+ oprot.writeString(struct.lectureid);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, getLectureData_args struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(1);
+ if (incoming.get(0)) {
+ struct.lectureid = iprot.readString();
+ struct.setLectureidIsSet(true);
+ }
+ }
+ }
+
+ }
+
+ public static class getLectureData_result implements org.apache.thrift.TBase<getLectureData_result, getLectureData_result._Fields>, java.io.Serializable, Cloneable, Comparable<getLectureData_result> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getLectureData_result");
+
+ private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.MAP, (short)0);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new getLectureData_resultStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new getLectureData_resultTupleSchemeFactory());
+ }
+
+ public Map<String,String> success; // required
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ SUCCESS((short)0, "success");
+
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+ static {
+ for (_Fields field : EnumSet.allOf(_Fields.class)) {
+ byName.put(field.getFieldName(), field);
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, or null if its not found.
+ */
+ public static _Fields findByThriftId(int fieldId) {
+ switch(fieldId) {
+ case 0: // SUCCESS
+ return SUCCESS;
+ default:
+ return null;
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, throwing an exception
+ * if it is not found.
+ */
+ public static _Fields findByThriftIdOrThrow(int fieldId) {
+ _Fields fields = findByThriftId(fieldId);
+ if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+ return fields;
+ }
+
+ /**
+ * Find the _Fields constant that matches name, or null if its not found.
+ */
+ public static _Fields findByName(String name) {
+ return byName.get(name);
+ }
+
+ private final short _thriftId;
+ private final String _fieldName;
+
+ _Fields(short thriftId, String fieldName) {
+ _thriftId = thriftId;
+ _fieldName = fieldName;
+ }
+
+ public short getThriftFieldId() {
+ return _thriftId;
+ }
+
+ public String getFieldName() {
+ return _fieldName;
+ }
+ }
+
+ // isset id assignments
+ public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+ static {
+ Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+ tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING),
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getLectureData_result.class, metaDataMap);
+ }
+
+ public getLectureData_result() {
+ }
+
+ public getLectureData_result(
+ Map<String,String> success)
+ {
+ this();
+ this.success = success;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public getLectureData_result(getLectureData_result other) {
+ if (other.isSetSuccess()) {
+ Map<String,String> __this__success = new HashMap<String,String>(other.success);
+ this.success = __this__success;
+ }
+ }
+
+ public getLectureData_result deepCopy() {
+ return new getLectureData_result(this);
+ }
+
+ @Override
+ public void clear() {
+ this.success = null;
+ }
+
+ public int getSuccessSize() {
+ return (this.success == null) ? 0 : this.success.size();
+ }
+
+ public void putToSuccess(String key, String val) {
+ if (this.success == null) {
+ this.success = new HashMap<String,String>();
+ }
+ this.success.put(key, val);
+ }
+
+ public Map<String,String> getSuccess() {
+ return this.success;
+ }
+
+ public getLectureData_result setSuccess(Map<String,String> success) {
+ this.success = success;
+ return this;
+ }
+
+ public void unsetSuccess() {
+ this.success = null;
+ }
+
+ /** Returns true if field success is set (has been assigned a value) and false otherwise */
+ public boolean isSetSuccess() {
+ return this.success != null;
+ }
+
+ public void setSuccessIsSet(boolean value) {
+ if (!value) {
+ this.success = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case SUCCESS:
+ if (value == null) {
+ unsetSuccess();
+ } else {
+ setSuccess((Map<String,String>)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case SUCCESS:
+ return getSuccess();
+
+ }
+ throw new IllegalStateException();
+ }
+
+ /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+ public boolean isSet(_Fields field) {
+ if (field == null) {
+ throw new IllegalArgumentException();
+ }
+
+ switch (field) {
+ case SUCCESS:
+ return isSetSuccess();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof getLectureData_result)
+ return this.equals((getLectureData_result)that);
+ return false;
+ }
+
+ public boolean equals(getLectureData_result that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_success = true && this.isSetSuccess();
+ boolean that_present_success = true && that.isSetSuccess();
+ if (this_present_success || that_present_success) {
+ if (!(this_present_success && that_present_success))
+ return false;
+ if (!this.success.equals(that.success))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ @Override
+ public int compareTo(getLectureData_result other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetSuccess()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ return 0;
+ }
+
+ public _Fields fieldForId(int fieldId) {
+ return _Fields.findByThriftId(fieldId);
+ }
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("getLectureData_result(");
+ boolean first = true;
+
+ sb.append("success:");
+ if (this.success == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.success);
+ }
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ // check for sub-struct validity
+ }
+
+ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+ try {
+ write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+ try {
+ read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private static class getLectureData_resultStandardSchemeFactory implements SchemeFactory {
+ public getLectureData_resultStandardScheme getScheme() {
+ return new getLectureData_resultStandardScheme();
+ }
+ }
+
+ private static class getLectureData_resultStandardScheme extends StandardScheme<getLectureData_result> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, getLectureData_result struct) throws org.apache.thrift.TException {
+ org.apache.thrift.protocol.TField schemeField;
+ iprot.readStructBegin();
+ while (true)
+ {
+ schemeField = iprot.readFieldBegin();
+ if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
+ break;
+ }
+ switch (schemeField.id) {
+ case 0: // SUCCESS
+ if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
+ {
+ org.apache.thrift.protocol.TMap _map52 = iprot.readMapBegin();
+ struct.success = new HashMap<String,String>(2*_map52.size);
+ for (int _i53 = 0; _i53 < _map52.size; ++_i53)
+ {
+ String _key54;
+ String _val55;
+ _key54 = iprot.readString();
+ _val55 = iprot.readString();
+ struct.success.put(_key54, _val55);
+ }
+ iprot.readMapEnd();
+ }
+ struct.setSuccessIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ default:
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ iprot.readFieldEnd();
+ }
+ iprot.readStructEnd();
+
+ // check for required fields of primitive type, which can't be checked in the validate method
+ struct.validate();
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot, getLectureData_result struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.success != null) {
+ oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
+ {
+ oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.success.size()));
+ for (Map.Entry<String, String> _iter56 : struct.success.entrySet())
+ {
+ oprot.writeString(_iter56.getKey());
+ oprot.writeString(_iter56.getValue());
+ }
+ oprot.writeMapEnd();
+ }
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class getLectureData_resultTupleSchemeFactory implements SchemeFactory {
+ public getLectureData_resultTupleScheme getScheme() {
+ return new getLectureData_resultTupleScheme();
+ }
+ }
+
+ private static class getLectureData_resultTupleScheme extends TupleScheme<getLectureData_result> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, getLectureData_result struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetSuccess()) {
+ optionals.set(0);
+ }
+ oprot.writeBitSet(optionals, 1);
+ if (struct.isSetSuccess()) {
+ {
+ oprot.writeI32(struct.success.size());
+ for (Map.Entry<String, String> _iter57 : struct.success.entrySet())
+ {
+ oprot.writeString(_iter57.getKey());
+ oprot.writeString(_iter57.getValue());
+ }
+ }
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, getLectureData_result struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(1);
+ if (incoming.get(0)) {
+ {
+ org.apache.thrift.protocol.TMap _map58 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
+ struct.success = new HashMap<String,String>(2*_map58.size);
+ for (int _i59 = 0; _i59 < _map58.size; ++_i59)
+ {
+ String _key60;
+ String _val61;
+ _key60 = iprot.readString();
+ _val61 = iprot.readString();
+ struct.success.put(_key60, _val61);
+ }
+ }
+ struct.setSuccessIsSet(true);
+ }
+ }
+ }
+
+ }
+
public static class updateImageData_args implements org.apache.thrift.TBase<updateImageData_args, updateImageData_args._Fields>, java.io.Serializable, Cloneable, Comparable<updateImageData_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("updateImageData_args");
private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)-1);
private static final org.apache.thrift.protocol.TField NEW_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("newName", org.apache.thrift.protocol.TType.STRING, (short)-2);
- private static final org.apache.thrift.protocol.TField IMAGE_PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("image_path", org.apache.thrift.protocol.TType.STRING, (short)-3);
- private static final org.apache.thrift.protocol.TField LICENSE_FIELD_DESC = new org.apache.thrift.protocol.TField("license", org.apache.thrift.protocol.TType.BOOL, (short)-4);
- private static final org.apache.thrift.protocol.TField INTERNET_FIELD_DESC = new org.apache.thrift.protocol.TField("internet", org.apache.thrift.protocol.TType.BOOL, (short)-5);
- private static final org.apache.thrift.protocol.TField RAM_FIELD_DESC = new org.apache.thrift.protocol.TField("ram", org.apache.thrift.protocol.TType.I64, (short)-6);
- private static final org.apache.thrift.protocol.TField CPU_FIELD_DESC = new org.apache.thrift.protocol.TField("cpu", org.apache.thrift.protocol.TType.I64, (short)-7);
- private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)-8);
- private static final org.apache.thrift.protocol.TField VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("version", org.apache.thrift.protocol.TType.STRING, (short)-9);
- private static final org.apache.thrift.protocol.TField IS_TEMPLATE_FIELD_DESC = new org.apache.thrift.protocol.TField("isTemplate", org.apache.thrift.protocol.TType.BOOL, (short)-10);
- private static final org.apache.thrift.protocol.TField FILESIZE_FIELD_DESC = new org.apache.thrift.protocol.TField("filesize", org.apache.thrift.protocol.TType.I64, (short)-11);
- private static final org.apache.thrift.protocol.TField SHARE_MODE_FIELD_DESC = new org.apache.thrift.protocol.TField("shareMode", org.apache.thrift.protocol.TType.I64, (short)-12);
+ private static final org.apache.thrift.protocol.TField DESC_FIELD_DESC = new org.apache.thrift.protocol.TField("desc", org.apache.thrift.protocol.TType.STRING, (short)-3);
+ private static final org.apache.thrift.protocol.TField IMAGE_PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("image_path", org.apache.thrift.protocol.TType.STRING, (short)-4);
+ private static final org.apache.thrift.protocol.TField LICENSE_FIELD_DESC = new org.apache.thrift.protocol.TField("license", org.apache.thrift.protocol.TType.BOOL, (short)-5);
+ private static final org.apache.thrift.protocol.TField INTERNET_FIELD_DESC = new org.apache.thrift.protocol.TField("internet", org.apache.thrift.protocol.TType.BOOL, (short)-6);
+ private static final org.apache.thrift.protocol.TField RAM_FIELD_DESC = new org.apache.thrift.protocol.TField("ram", org.apache.thrift.protocol.TType.I64, (short)-7);
+ private static final org.apache.thrift.protocol.TField CPU_FIELD_DESC = new org.apache.thrift.protocol.TField("cpu", org.apache.thrift.protocol.TType.I64, (short)-8);
+ private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)-9);
+ private static final org.apache.thrift.protocol.TField VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("version", org.apache.thrift.protocol.TType.STRING, (short)-10);
+ private static final org.apache.thrift.protocol.TField IS_TEMPLATE_FIELD_DESC = new org.apache.thrift.protocol.TField("isTemplate", org.apache.thrift.protocol.TType.BOOL, (short)-11);
+ private static final org.apache.thrift.protocol.TField FILESIZE_FIELD_DESC = new org.apache.thrift.protocol.TField("filesize", org.apache.thrift.protocol.TType.I64, (short)-12);
+ private static final org.apache.thrift.protocol.TField SHARE_MODE_FIELD_DESC = new org.apache.thrift.protocol.TField("shareMode", org.apache.thrift.protocol.TType.I64, (short)-13);
+ private static final org.apache.thrift.protocol.TField OS_FIELD_DESC = new org.apache.thrift.protocol.TField("os", org.apache.thrift.protocol.TType.STRING, (short)-14);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
@@ -14221,6 +15807,7 @@ public class Server {
public String name; // required
public String newName; // required
+ public String desc; // required
public String image_path; // required
public boolean license; // required
public boolean internet; // required
@@ -14231,21 +15818,24 @@ public class Server {
public boolean isTemplate; // required
public long filesize; // required
public long shareMode; // required
+ public String os; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
NAME((short)-1, "name"),
NEW_NAME((short)-2, "newName"),
- IMAGE_PATH((short)-3, "image_path"),
- LICENSE((short)-4, "license"),
- INTERNET((short)-5, "internet"),
- RAM((short)-6, "ram"),
- CPU((short)-7, "cpu"),
- ID((short)-8, "id"),
- VERSION((short)-9, "version"),
- IS_TEMPLATE((short)-10, "isTemplate"),
- FILESIZE((short)-11, "filesize"),
- SHARE_MODE((short)-12, "shareMode");
+ DESC((short)-3, "desc"),
+ IMAGE_PATH((short)-4, "image_path"),
+ LICENSE((short)-5, "license"),
+ INTERNET((short)-6, "internet"),
+ RAM((short)-7, "ram"),
+ CPU((short)-8, "cpu"),
+ ID((short)-9, "id"),
+ VERSION((short)-10, "version"),
+ IS_TEMPLATE((short)-11, "isTemplate"),
+ FILESIZE((short)-12, "filesize"),
+ SHARE_MODE((short)-13, "shareMode"),
+ OS((short)-14, "os");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@@ -14264,26 +15854,30 @@ public class Server {
return NAME;
case -2: // NEW_NAME
return NEW_NAME;
- case -3: // IMAGE_PATH
+ case -3: // DESC
+ return DESC;
+ case -4: // IMAGE_PATH
return IMAGE_PATH;
- case -4: // LICENSE
+ case -5: // LICENSE
return LICENSE;
- case -5: // INTERNET
+ case -6: // INTERNET
return INTERNET;
- case -6: // RAM
+ case -7: // RAM
return RAM;
- case -7: // CPU
+ case -8: // CPU
return CPU;
- case -8: // ID
+ case -9: // ID
return ID;
- case -9: // VERSION
+ case -10: // VERSION
return VERSION;
- case -10: // IS_TEMPLATE
+ case -11: // IS_TEMPLATE
return IS_TEMPLATE;
- case -11: // FILESIZE
+ case -12: // FILESIZE
return FILESIZE;
- case -12: // SHARE_MODE
+ case -13: // SHARE_MODE
return SHARE_MODE;
+ case -14: // OS
+ return OS;
default:
return null;
}
@@ -14339,6 +15933,8 @@ public class Server {
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.NEW_NAME, new org.apache.thrift.meta_data.FieldMetaData("newName", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.DESC, new org.apache.thrift.meta_data.FieldMetaData("desc", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.IMAGE_PATH, new org.apache.thrift.meta_data.FieldMetaData("image_path", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.LICENSE, new org.apache.thrift.meta_data.FieldMetaData("license", org.apache.thrift.TFieldRequirementType.DEFAULT,
@@ -14359,6 +15955,8 @@ public class Server {
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.SHARE_MODE, new org.apache.thrift.meta_data.FieldMetaData("shareMode", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64 , "int")));
+ tmpMap.put(_Fields.OS, new org.apache.thrift.meta_data.FieldMetaData("os", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(updateImageData_args.class, metaDataMap);
}
@@ -14369,6 +15967,7 @@ public class Server {
public updateImageData_args(
String name,
String newName,
+ String desc,
String image_path,
boolean license,
boolean internet,
@@ -14378,11 +15977,13 @@ public class Server {
String version,
boolean isTemplate,
long filesize,
- long shareMode)
+ long shareMode,
+ String os)
{
this();
this.name = name;
this.newName = newName;
+ this.desc = desc;
this.image_path = image_path;
this.license = license;
setLicenseIsSet(true);
@@ -14400,6 +16001,7 @@ public class Server {
setFilesizeIsSet(true);
this.shareMode = shareMode;
setShareModeIsSet(true);
+ this.os = os;
}
/**
@@ -14413,6 +16015,9 @@ public class Server {
if (other.isSetNewName()) {
this.newName = other.newName;
}
+ if (other.isSetDesc()) {
+ this.desc = other.desc;
+ }
if (other.isSetImage_path()) {
this.image_path = other.image_path;
}
@@ -14429,6 +16034,9 @@ public class Server {
this.isTemplate = other.isTemplate;
this.filesize = other.filesize;
this.shareMode = other.shareMode;
+ if (other.isSetOs()) {
+ this.os = other.os;
+ }
}
public updateImageData_args deepCopy() {
@@ -14439,6 +16047,7 @@ public class Server {
public void clear() {
this.name = null;
this.newName = null;
+ this.desc = null;
this.image_path = null;
setLicenseIsSet(false);
this.license = false;
@@ -14456,6 +16065,7 @@ public class Server {
this.filesize = 0;
setShareModeIsSet(false);
this.shareMode = 0;
+ this.os = null;
}
public String getName() {
@@ -14506,6 +16116,30 @@ public class Server {
}
}
+ public String getDesc() {
+ return this.desc;
+ }
+
+ public updateImageData_args setDesc(String desc) {
+ this.desc = desc;
+ return this;
+ }
+
+ public void unsetDesc() {
+ this.desc = null;
+ }
+
+ /** Returns true if field desc is set (has been assigned a value) and false otherwise */
+ public boolean isSetDesc() {
+ return this.desc != null;
+ }
+
+ public void setDescIsSet(boolean value) {
+ if (!value) {
+ this.desc = null;
+ }
+ }
+
public String getImage_path() {
return this.image_path;
}
@@ -14739,6 +16373,30 @@ public class Server {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SHAREMODE_ISSET_ID, value);
}
+ public String getOs() {
+ return this.os;
+ }
+
+ public updateImageData_args setOs(String os) {
+ this.os = os;
+ return this;
+ }
+
+ public void unsetOs() {
+ this.os = null;
+ }
+
+ /** Returns true if field os is set (has been assigned a value) and false otherwise */
+ public boolean isSetOs() {
+ return this.os != null;
+ }
+
+ public void setOsIsSet(boolean value) {
+ if (!value) {
+ this.os = null;
+ }
+ }
+
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case NAME:
@@ -14757,6 +16415,14 @@ public class Server {
}
break;
+ case DESC:
+ if (value == null) {
+ unsetDesc();
+ } else {
+ setDesc((String)value);
+ }
+ break;
+
case IMAGE_PATH:
if (value == null) {
unsetImage_path();
@@ -14837,6 +16503,14 @@ public class Server {
}
break;
+ case OS:
+ if (value == null) {
+ unsetOs();
+ } else {
+ setOs((String)value);
+ }
+ break;
+
}
}
@@ -14848,6 +16522,9 @@ public class Server {
case NEW_NAME:
return getNewName();
+ case DESC:
+ return getDesc();
+
case IMAGE_PATH:
return getImage_path();
@@ -14878,6 +16555,9 @@ public class Server {
case SHARE_MODE:
return Long.valueOf(getShareMode());
+ case OS:
+ return getOs();
+
}
throw new IllegalStateException();
}
@@ -14893,6 +16573,8 @@ public class Server {
return isSetName();
case NEW_NAME:
return isSetNewName();
+ case DESC:
+ return isSetDesc();
case IMAGE_PATH:
return isSetImage_path();
case LICENSE:
@@ -14913,6 +16595,8 @@ public class Server {
return isSetFilesize();
case SHARE_MODE:
return isSetShareMode();
+ case OS:
+ return isSetOs();
}
throw new IllegalStateException();
}
@@ -14948,6 +16632,15 @@ public class Server {
return false;
}
+ boolean this_present_desc = true && this.isSetDesc();
+ boolean that_present_desc = true && that.isSetDesc();
+ if (this_present_desc || that_present_desc) {
+ if (!(this_present_desc && that_present_desc))
+ return false;
+ if (!this.desc.equals(that.desc))
+ return false;
+ }
+
boolean this_present_image_path = true && this.isSetImage_path();
boolean that_present_image_path = true && that.isSetImage_path();
if (this_present_image_path || that_present_image_path) {
@@ -15038,6 +16731,15 @@ public class Server {
return false;
}
+ boolean this_present_os = true && this.isSetOs();
+ boolean that_present_os = true && that.isSetOs();
+ if (this_present_os || that_present_os) {
+ if (!(this_present_os && that_present_os))
+ return false;
+ if (!this.os.equals(that.os))
+ return false;
+ }
+
return true;
}
@@ -15074,6 +16776,16 @@ public class Server {
return lastComparison;
}
}
+ lastComparison = Boolean.valueOf(isSetDesc()).compareTo(other.isSetDesc());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetDesc()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.desc, other.desc);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
lastComparison = Boolean.valueOf(isSetImage_path()).compareTo(other.isSetImage_path());
if (lastComparison != 0) {
return lastComparison;
@@ -15174,6 +16886,16 @@ public class Server {
return lastComparison;
}
}
+ lastComparison = Boolean.valueOf(isSetOs()).compareTo(other.isSetOs());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetOs()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.os, other.os);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
return 0;
}
@@ -15210,6 +16932,14 @@ public class Server {
}
first = false;
if (!first) sb.append(", ");
+ sb.append("desc:");
+ if (this.desc == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.desc);
+ }
+ first = false;
+ if (!first) sb.append(", ");
sb.append("image_path:");
if (this.image_path == null) {
sb.append("null");
@@ -15261,6 +16991,14 @@ public class Server {
sb.append("shareMode:");
sb.append(this.shareMode);
first = false;
+ if (!first) sb.append(", ");
+ sb.append("os:");
+ if (this.os == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.os);
+ }
+ first = false;
sb.append(")");
return sb.toString();
}
@@ -15322,7 +17060,15 @@ public class Server {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case -3: // IMAGE_PATH
+ case -3: // DESC
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.desc = iprot.readString();
+ struct.setDescIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case -4: // IMAGE_PATH
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.image_path = iprot.readString();
struct.setImage_pathIsSet(true);
@@ -15330,7 +17076,7 @@ public class Server {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case -4: // LICENSE
+ case -5: // LICENSE
if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
struct.license = iprot.readBool();
struct.setLicenseIsSet(true);
@@ -15338,7 +17084,7 @@ public class Server {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case -5: // INTERNET
+ case -6: // INTERNET
if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
struct.internet = iprot.readBool();
struct.setInternetIsSet(true);
@@ -15346,7 +17092,7 @@ public class Server {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case -6: // RAM
+ case -7: // RAM
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.ram = iprot.readI64();
struct.setRamIsSet(true);
@@ -15354,7 +17100,7 @@ public class Server {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case -7: // CPU
+ case -8: // CPU
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.cpu = iprot.readI64();
struct.setCpuIsSet(true);
@@ -15362,7 +17108,7 @@ public class Server {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case -8: // ID
+ case -9: // ID
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.id = iprot.readString();
struct.setIdIsSet(true);
@@ -15370,7 +17116,7 @@ public class Server {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case -9: // VERSION
+ case -10: // VERSION
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.version = iprot.readString();
struct.setVersionIsSet(true);
@@ -15378,7 +17124,7 @@ public class Server {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case -10: // IS_TEMPLATE
+ case -11: // IS_TEMPLATE
if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
struct.isTemplate = iprot.readBool();
struct.setIsTemplateIsSet(true);
@@ -15386,7 +17132,7 @@ public class Server {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case -11: // FILESIZE
+ case -12: // FILESIZE
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.filesize = iprot.readI64();
struct.setFilesizeIsSet(true);
@@ -15394,7 +17140,7 @@ public class Server {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case -12: // SHARE_MODE
+ case -13: // SHARE_MODE
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.shareMode = iprot.readI64();
struct.setShareModeIsSet(true);
@@ -15402,6 +17148,14 @@ public class Server {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
+ case -14: // OS
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.os = iprot.readString();
+ struct.setOsIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
@@ -15417,6 +17171,11 @@ public class Server {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.os != null) {
+ oprot.writeFieldBegin(OS_FIELD_DESC);
+ oprot.writeString(struct.os);
+ oprot.writeFieldEnd();
+ }
oprot.writeFieldBegin(SHARE_MODE_FIELD_DESC);
oprot.writeI64(struct.shareMode);
oprot.writeFieldEnd();
@@ -15453,6 +17212,11 @@ public class Server {
oprot.writeString(struct.image_path);
oprot.writeFieldEnd();
}
+ if (struct.desc != null) {
+ oprot.writeFieldBegin(DESC_FIELD_DESC);
+ oprot.writeString(struct.desc);
+ oprot.writeFieldEnd();
+ }
if (struct.newName != null) {
oprot.writeFieldBegin(NEW_NAME_FIELD_DESC);
oprot.writeString(struct.newName);
@@ -15487,43 +17251,52 @@ public class Server {
if (struct.isSetNewName()) {
optionals.set(1);
}
- if (struct.isSetImage_path()) {
+ if (struct.isSetDesc()) {
optionals.set(2);
}
- if (struct.isSetLicense()) {
+ if (struct.isSetImage_path()) {
optionals.set(3);
}
- if (struct.isSetInternet()) {
+ if (struct.isSetLicense()) {
optionals.set(4);
}
- if (struct.isSetRam()) {
+ if (struct.isSetInternet()) {
optionals.set(5);
}
- if (struct.isSetCpu()) {
+ if (struct.isSetRam()) {
optionals.set(6);
}
- if (struct.isSetId()) {
+ if (struct.isSetCpu()) {
optionals.set(7);
}
- if (struct.isSetVersion()) {
+ if (struct.isSetId()) {
optionals.set(8);
}
- if (struct.isSetIsTemplate()) {
+ if (struct.isSetVersion()) {
optionals.set(9);
}
- if (struct.isSetFilesize()) {
+ if (struct.isSetIsTemplate()) {
optionals.set(10);
}
- if (struct.isSetShareMode()) {
+ if (struct.isSetFilesize()) {
optionals.set(11);
}
- oprot.writeBitSet(optionals, 12);
+ if (struct.isSetShareMode()) {
+ optionals.set(12);
+ }
+ if (struct.isSetOs()) {
+ optionals.set(13);
+ }
+ oprot.writeBitSet(optionals, 14);
if (struct.isSetName()) {
oprot.writeString(struct.name);
}
if (struct.isSetNewName()) {
oprot.writeString(struct.newName);
}
+ if (struct.isSetDesc()) {
+ oprot.writeString(struct.desc);
+ }
if (struct.isSetImage_path()) {
oprot.writeString(struct.image_path);
}
@@ -15554,12 +17327,15 @@ public class Server {
if (struct.isSetShareMode()) {
oprot.writeI64(struct.shareMode);
}
+ if (struct.isSetOs()) {
+ oprot.writeString(struct.os);
+ }
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, updateImageData_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(12);
+ BitSet incoming = iprot.readBitSet(14);
if (incoming.get(0)) {
struct.name = iprot.readString();
struct.setNameIsSet(true);
@@ -15569,45 +17345,53 @@ public class Server {
struct.setNewNameIsSet(true);
}
if (incoming.get(2)) {
+ struct.desc = iprot.readString();
+ struct.setDescIsSet(true);
+ }
+ if (incoming.get(3)) {
struct.image_path = iprot.readString();
struct.setImage_pathIsSet(true);
}
- if (incoming.get(3)) {
+ if (incoming.get(4)) {
struct.license = iprot.readBool();
struct.setLicenseIsSet(true);
}
- if (incoming.get(4)) {
+ if (incoming.get(5)) {
struct.internet = iprot.readBool();
struct.setInternetIsSet(true);
}
- if (incoming.get(5)) {
+ if (incoming.get(6)) {
struct.ram = iprot.readI64();
struct.setRamIsSet(true);
}
- if (incoming.get(6)) {
+ if (incoming.get(7)) {
struct.cpu = iprot.readI64();
struct.setCpuIsSet(true);
}
- if (incoming.get(7)) {
+ if (incoming.get(8)) {
struct.id = iprot.readString();
struct.setIdIsSet(true);
}
- if (incoming.get(8)) {
+ if (incoming.get(9)) {
struct.version = iprot.readString();
struct.setVersionIsSet(true);
}
- if (incoming.get(9)) {
+ if (incoming.get(10)) {
struct.isTemplate = iprot.readBool();
struct.setIsTemplateIsSet(true);
}
- if (incoming.get(10)) {
+ if (incoming.get(11)) {
struct.filesize = iprot.readI64();
struct.setFilesizeIsSet(true);
}
- if (incoming.get(11)) {
+ if (incoming.get(12)) {
struct.shareMode = iprot.readI64();
struct.setShareModeIsSet(true);
}
+ if (incoming.get(13)) {
+ struct.os = iprot.readString();
+ struct.setOsIsSet(true);
+ }
}
}
@@ -15967,766 +17751,6 @@ public class Server {
}
- public static class getLectureData_args implements org.apache.thrift.TBase<getLectureData_args, getLectureData_args._Fields>, java.io.Serializable, Cloneable, Comparable<getLectureData_args> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getLectureData_args");
-
- private static final org.apache.thrift.protocol.TField LECTURENAME_FIELD_DESC = new org.apache.thrift.protocol.TField("lecturename", org.apache.thrift.protocol.TType.STRING, (short)-1);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new getLectureData_argsStandardSchemeFactory());
- schemes.put(TupleScheme.class, new getLectureData_argsTupleSchemeFactory());
- }
-
- public String lecturename; // required
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- LECTURENAME((short)-1, "lecturename");
-
- private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
- static {
- for (_Fields field : EnumSet.allOf(_Fields.class)) {
- byName.put(field.getFieldName(), field);
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, or null if its not found.
- */
- public static _Fields findByThriftId(int fieldId) {
- switch(fieldId) {
- case -1: // LECTURENAME
- return LECTURENAME;
- default:
- return null;
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, throwing an exception
- * if it is not found.
- */
- public static _Fields findByThriftIdOrThrow(int fieldId) {
- _Fields fields = findByThriftId(fieldId);
- if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
- return fields;
- }
-
- /**
- * Find the _Fields constant that matches name, or null if its not found.
- */
- public static _Fields findByName(String name) {
- return byName.get(name);
- }
-
- private final short _thriftId;
- private final String _fieldName;
-
- _Fields(short thriftId, String fieldName) {
- _thriftId = thriftId;
- _fieldName = fieldName;
- }
-
- public short getThriftFieldId() {
- return _thriftId;
- }
-
- public String getFieldName() {
- return _fieldName;
- }
- }
-
- // isset id assignments
- public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
- static {
- Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
- tmpMap.put(_Fields.LECTURENAME, new org.apache.thrift.meta_data.FieldMetaData("lecturename", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getLectureData_args.class, metaDataMap);
- }
-
- public getLectureData_args() {
- }
-
- public getLectureData_args(
- String lecturename)
- {
- this();
- this.lecturename = lecturename;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public getLectureData_args(getLectureData_args other) {
- if (other.isSetLecturename()) {
- this.lecturename = other.lecturename;
- }
- }
-
- public getLectureData_args deepCopy() {
- return new getLectureData_args(this);
- }
-
- @Override
- public void clear() {
- this.lecturename = null;
- }
-
- public String getLecturename() {
- return this.lecturename;
- }
-
- public getLectureData_args setLecturename(String lecturename) {
- this.lecturename = lecturename;
- return this;
- }
-
- public void unsetLecturename() {
- this.lecturename = null;
- }
-
- /** Returns true if field lecturename is set (has been assigned a value) and false otherwise */
- public boolean isSetLecturename() {
- return this.lecturename != null;
- }
-
- public void setLecturenameIsSet(boolean value) {
- if (!value) {
- this.lecturename = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case LECTURENAME:
- if (value == null) {
- unsetLecturename();
- } else {
- setLecturename((String)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case LECTURENAME:
- return getLecturename();
-
- }
- throw new IllegalStateException();
- }
-
- /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
- public boolean isSet(_Fields field) {
- if (field == null) {
- throw new IllegalArgumentException();
- }
-
- switch (field) {
- case LECTURENAME:
- return isSetLecturename();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof getLectureData_args)
- return this.equals((getLectureData_args)that);
- return false;
- }
-
- public boolean equals(getLectureData_args that) {
- if (that == null)
- return false;
-
- boolean this_present_lecturename = true && this.isSetLecturename();
- boolean that_present_lecturename = true && that.isSetLecturename();
- if (this_present_lecturename || that_present_lecturename) {
- if (!(this_present_lecturename && that_present_lecturename))
- return false;
- if (!this.lecturename.equals(that.lecturename))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- return 0;
- }
-
- @Override
- public int compareTo(getLectureData_args other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(isSetLecturename()).compareTo(other.isSetLecturename());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetLecturename()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lecturename, other.lecturename);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- return 0;
- }
-
- public _Fields fieldForId(int fieldId) {
- return _Fields.findByThriftId(fieldId);
- }
-
- public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
- schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
- }
-
- public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
- schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder("getLectureData_args(");
- boolean first = true;
-
- sb.append("lecturename:");
- if (this.lecturename == null) {
- sb.append("null");
- } else {
- sb.append(this.lecturename);
- }
- first = false;
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- // check for sub-struct validity
- }
-
- private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
- try {
- write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
- }
- }
-
- private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
- try {
- read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
- }
- }
-
- private static class getLectureData_argsStandardSchemeFactory implements SchemeFactory {
- public getLectureData_argsStandardScheme getScheme() {
- return new getLectureData_argsStandardScheme();
- }
- }
-
- private static class getLectureData_argsStandardScheme extends StandardScheme<getLectureData_args> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, getLectureData_args struct) throws org.apache.thrift.TException {
- org.apache.thrift.protocol.TField schemeField;
- iprot.readStructBegin();
- while (true)
- {
- schemeField = iprot.readFieldBegin();
- if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
- break;
- }
- switch (schemeField.id) {
- case -1: // LECTURENAME
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.lecturename = iprot.readString();
- struct.setLecturenameIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- default:
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- iprot.readFieldEnd();
- }
- iprot.readStructEnd();
-
- // check for required fields of primitive type, which can't be checked in the validate method
- struct.validate();
- }
-
- public void write(org.apache.thrift.protocol.TProtocol oprot, getLectureData_args struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.lecturename != null) {
- oprot.writeFieldBegin(LECTURENAME_FIELD_DESC);
- oprot.writeString(struct.lecturename);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class getLectureData_argsTupleSchemeFactory implements SchemeFactory {
- public getLectureData_argsTupleScheme getScheme() {
- return new getLectureData_argsTupleScheme();
- }
- }
-
- private static class getLectureData_argsTupleScheme extends TupleScheme<getLectureData_args> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, getLectureData_args struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- BitSet optionals = new BitSet();
- if (struct.isSetLecturename()) {
- optionals.set(0);
- }
- oprot.writeBitSet(optionals, 1);
- if (struct.isSetLecturename()) {
- oprot.writeString(struct.lecturename);
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, getLectureData_args struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(1);
- if (incoming.get(0)) {
- struct.lecturename = iprot.readString();
- struct.setLecturenameIsSet(true);
- }
- }
- }
-
- }
-
- public static class getLectureData_result implements org.apache.thrift.TBase<getLectureData_result, getLectureData_result._Fields>, java.io.Serializable, Cloneable, Comparable<getLectureData_result> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getLectureData_result");
-
- private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.MAP, (short)0);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new getLectureData_resultStandardSchemeFactory());
- schemes.put(TupleScheme.class, new getLectureData_resultTupleSchemeFactory());
- }
-
- public Map<String,String> success; // required
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- SUCCESS((short)0, "success");
-
- private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
- static {
- for (_Fields field : EnumSet.allOf(_Fields.class)) {
- byName.put(field.getFieldName(), field);
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, or null if its not found.
- */
- public static _Fields findByThriftId(int fieldId) {
- switch(fieldId) {
- case 0: // SUCCESS
- return SUCCESS;
- default:
- return null;
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, throwing an exception
- * if it is not found.
- */
- public static _Fields findByThriftIdOrThrow(int fieldId) {
- _Fields fields = findByThriftId(fieldId);
- if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
- return fields;
- }
-
- /**
- * Find the _Fields constant that matches name, or null if its not found.
- */
- public static _Fields findByName(String name) {
- return byName.get(name);
- }
-
- private final short _thriftId;
- private final String _fieldName;
-
- _Fields(short thriftId, String fieldName) {
- _thriftId = thriftId;
- _fieldName = fieldName;
- }
-
- public short getThriftFieldId() {
- return _thriftId;
- }
-
- public String getFieldName() {
- return _fieldName;
- }
- }
-
- // isset id assignments
- public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
- static {
- Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
- tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING),
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getLectureData_result.class, metaDataMap);
- }
-
- public getLectureData_result() {
- }
-
- public getLectureData_result(
- Map<String,String> success)
- {
- this();
- this.success = success;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public getLectureData_result(getLectureData_result other) {
- if (other.isSetSuccess()) {
- Map<String,String> __this__success = new HashMap<String,String>(other.success);
- this.success = __this__success;
- }
- }
-
- public getLectureData_result deepCopy() {
- return new getLectureData_result(this);
- }
-
- @Override
- public void clear() {
- this.success = null;
- }
-
- public int getSuccessSize() {
- return (this.success == null) ? 0 : this.success.size();
- }
-
- public void putToSuccess(String key, String val) {
- if (this.success == null) {
- this.success = new HashMap<String,String>();
- }
- this.success.put(key, val);
- }
-
- public Map<String,String> getSuccess() {
- return this.success;
- }
-
- public getLectureData_result setSuccess(Map<String,String> success) {
- this.success = success;
- return this;
- }
-
- public void unsetSuccess() {
- this.success = null;
- }
-
- /** Returns true if field success is set (has been assigned a value) and false otherwise */
- public boolean isSetSuccess() {
- return this.success != null;
- }
-
- public void setSuccessIsSet(boolean value) {
- if (!value) {
- this.success = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case SUCCESS:
- if (value == null) {
- unsetSuccess();
- } else {
- setSuccess((Map<String,String>)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case SUCCESS:
- return getSuccess();
-
- }
- throw new IllegalStateException();
- }
-
- /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
- public boolean isSet(_Fields field) {
- if (field == null) {
- throw new IllegalArgumentException();
- }
-
- switch (field) {
- case SUCCESS:
- return isSetSuccess();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof getLectureData_result)
- return this.equals((getLectureData_result)that);
- return false;
- }
-
- public boolean equals(getLectureData_result that) {
- if (that == null)
- return false;
-
- boolean this_present_success = true && this.isSetSuccess();
- boolean that_present_success = true && that.isSetSuccess();
- if (this_present_success || that_present_success) {
- if (!(this_present_success && that_present_success))
- return false;
- if (!this.success.equals(that.success))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- return 0;
- }
-
- @Override
- public int compareTo(getLectureData_result other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetSuccess()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- return 0;
- }
-
- public _Fields fieldForId(int fieldId) {
- return _Fields.findByThriftId(fieldId);
- }
-
- public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
- schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
- }
-
- public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
- schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder("getLectureData_result(");
- boolean first = true;
-
- sb.append("success:");
- if (this.success == null) {
- sb.append("null");
- } else {
- sb.append(this.success);
- }
- first = false;
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- // check for sub-struct validity
- }
-
- private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
- try {
- write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
- }
- }
-
- private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
- try {
- read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
- }
- }
-
- private static class getLectureData_resultStandardSchemeFactory implements SchemeFactory {
- public getLectureData_resultStandardScheme getScheme() {
- return new getLectureData_resultStandardScheme();
- }
- }
-
- private static class getLectureData_resultStandardScheme extends StandardScheme<getLectureData_result> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, getLectureData_result struct) throws org.apache.thrift.TException {
- org.apache.thrift.protocol.TField schemeField;
- iprot.readStructBegin();
- while (true)
- {
- schemeField = iprot.readFieldBegin();
- if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
- break;
- }
- switch (schemeField.id) {
- case 0: // SUCCESS
- if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
- {
- org.apache.thrift.protocol.TMap _map52 = iprot.readMapBegin();
- struct.success = new HashMap<String,String>(2*_map52.size);
- for (int _i53 = 0; _i53 < _map52.size; ++_i53)
- {
- String _key54;
- String _val55;
- _key54 = iprot.readString();
- _val55 = iprot.readString();
- struct.success.put(_key54, _val55);
- }
- iprot.readMapEnd();
- }
- struct.setSuccessIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- default:
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- iprot.readFieldEnd();
- }
- iprot.readStructEnd();
-
- // check for required fields of primitive type, which can't be checked in the validate method
- struct.validate();
- }
-
- public void write(org.apache.thrift.protocol.TProtocol oprot, getLectureData_result struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.success != null) {
- oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.success.size()));
- for (Map.Entry<String, String> _iter56 : struct.success.entrySet())
- {
- oprot.writeString(_iter56.getKey());
- oprot.writeString(_iter56.getValue());
- }
- oprot.writeMapEnd();
- }
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class getLectureData_resultTupleSchemeFactory implements SchemeFactory {
- public getLectureData_resultTupleScheme getScheme() {
- return new getLectureData_resultTupleScheme();
- }
- }
-
- private static class getLectureData_resultTupleScheme extends TupleScheme<getLectureData_result> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, getLectureData_result struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- BitSet optionals = new BitSet();
- if (struct.isSetSuccess()) {
- optionals.set(0);
- }
- oprot.writeBitSet(optionals, 1);
- if (struct.isSetSuccess()) {
- {
- oprot.writeI32(struct.success.size());
- for (Map.Entry<String, String> _iter57 : struct.success.entrySet())
- {
- oprot.writeString(_iter57.getKey());
- oprot.writeString(_iter57.getValue());
- }
- }
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, getLectureData_result struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(1);
- if (incoming.get(0)) {
- {
- org.apache.thrift.protocol.TMap _map58 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
- struct.success = new HashMap<String,String>(2*_map58.size);
- for (int _i59 = 0; _i59 < _map58.size; ++_i59)
- {
- String _key60;
- String _val61;
- _key60 = iprot.readString();
- _val61 = iprot.readString();
- struct.success.put(_key60, _val61);
- }
- }
- struct.setSuccessIsSet(true);
- }
- }
- }
-
- }
-
public static class deleteImageData_args implements org.apache.thrift.TBase<deleteImageData_args, deleteImageData_args._Fields>, java.io.Serializable, Cloneable, Comparable<deleteImageData_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteImageData_args");
@@ -17545,14 +18569,16 @@ public class Server {
private static final org.apache.thrift.protocol.TField START_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("startDate", org.apache.thrift.protocol.TType.STRING, (short)-5);
private static final org.apache.thrift.protocol.TField END_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("endDate", org.apache.thrift.protocol.TType.STRING, (short)-6);
private static final org.apache.thrift.protocol.TField IS_ACTIVE_FIELD_DESC = new org.apache.thrift.protocol.TField("isActive", org.apache.thrift.protocol.TType.BOOL, (short)-7);
- private static final org.apache.thrift.protocol.TField IMAGENAME_FIELD_DESC = new org.apache.thrift.protocol.TField("imagename", org.apache.thrift.protocol.TType.STRING, (short)-8);
- private static final org.apache.thrift.protocol.TField FIRSTNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("firstname", org.apache.thrift.protocol.TType.STRING, (short)-9);
- private static final org.apache.thrift.protocol.TField LASTNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("lastname", org.apache.thrift.protocol.TType.STRING, (short)-10);
- private static final org.apache.thrift.protocol.TField UNIVERSITY_FIELD_DESC = new org.apache.thrift.protocol.TField("university", org.apache.thrift.protocol.TType.STRING, (short)-11);
- private static final org.apache.thrift.protocol.TField MAIL_FIELD_DESC = new org.apache.thrift.protocol.TField("Mail", org.apache.thrift.protocol.TType.STRING, (short)-12);
- private static final org.apache.thrift.protocol.TField TEL_FIELD_DESC = new org.apache.thrift.protocol.TField("Tel", org.apache.thrift.protocol.TType.STRING, (short)-13);
- private static final org.apache.thrift.protocol.TField FAK_FIELD_DESC = new org.apache.thrift.protocol.TField("Fak", org.apache.thrift.protocol.TType.STRING, (short)-14);
- private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)-15);
+ private static final org.apache.thrift.protocol.TField IMAGEID_FIELD_DESC = new org.apache.thrift.protocol.TField("imageid", org.apache.thrift.protocol.TType.STRING, (short)-8);
+ private static final org.apache.thrift.protocol.TField IMAGEVERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("imageversion", org.apache.thrift.protocol.TType.STRING, (short)-9);
+ private static final org.apache.thrift.protocol.TField USER_FIELD_DESC = new org.apache.thrift.protocol.TField("user", org.apache.thrift.protocol.TType.STRING, (short)-10);
+ private static final org.apache.thrift.protocol.TField FIRSTNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("firstname", org.apache.thrift.protocol.TType.STRING, (short)-11);
+ private static final org.apache.thrift.protocol.TField LASTNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("lastname", org.apache.thrift.protocol.TType.STRING, (short)-12);
+ private static final org.apache.thrift.protocol.TField UNIVERSITY_FIELD_DESC = new org.apache.thrift.protocol.TField("university", org.apache.thrift.protocol.TType.STRING, (short)-13);
+ private static final org.apache.thrift.protocol.TField MAIL_FIELD_DESC = new org.apache.thrift.protocol.TField("Mail", org.apache.thrift.protocol.TType.STRING, (short)-14);
+ private static final org.apache.thrift.protocol.TField TEL_FIELD_DESC = new org.apache.thrift.protocol.TField("Tel", org.apache.thrift.protocol.TType.STRING, (short)-15);
+ private static final org.apache.thrift.protocol.TField FAK_FIELD_DESC = new org.apache.thrift.protocol.TField("Fak", org.apache.thrift.protocol.TType.STRING, (short)-16);
+ private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)-17);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
@@ -17567,7 +18593,9 @@ public class Server {
public String startDate; // required
public String endDate; // required
public boolean isActive; // required
- public String imagename; // required
+ public String imageid; // required
+ public String imageversion; // required
+ public String user; // required
public String firstname; // required
public String lastname; // required
public String university; // required
@@ -17585,14 +18613,16 @@ public class Server {
START_DATE((short)-5, "startDate"),
END_DATE((short)-6, "endDate"),
IS_ACTIVE((short)-7, "isActive"),
- IMAGENAME((short)-8, "imagename"),
- FIRSTNAME((short)-9, "firstname"),
- LASTNAME((short)-10, "lastname"),
- UNIVERSITY((short)-11, "university"),
- MAIL((short)-12, "Mail"),
- TEL((short)-13, "Tel"),
- FAK((short)-14, "Fak"),
- ID((short)-15, "id");
+ IMAGEID((short)-8, "imageid"),
+ IMAGEVERSION((short)-9, "imageversion"),
+ USER((short)-10, "user"),
+ FIRSTNAME((short)-11, "firstname"),
+ LASTNAME((short)-12, "lastname"),
+ UNIVERSITY((short)-13, "university"),
+ MAIL((short)-14, "Mail"),
+ TEL((short)-15, "Tel"),
+ FAK((short)-16, "Fak"),
+ ID((short)-17, "id");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@@ -17621,21 +18651,25 @@ public class Server {
return END_DATE;
case -7: // IS_ACTIVE
return IS_ACTIVE;
- case -8: // IMAGENAME
- return IMAGENAME;
- case -9: // FIRSTNAME
+ case -8: // IMAGEID
+ return IMAGEID;
+ case -9: // IMAGEVERSION
+ return IMAGEVERSION;
+ case -10: // USER
+ return USER;
+ case -11: // FIRSTNAME
return FIRSTNAME;
- case -10: // LASTNAME
+ case -12: // LASTNAME
return LASTNAME;
- case -11: // UNIVERSITY
+ case -13: // UNIVERSITY
return UNIVERSITY;
- case -12: // MAIL
+ case -14: // MAIL
return MAIL;
- case -13: // TEL
+ case -15: // TEL
return TEL;
- case -14: // FAK
+ case -16: // FAK
return FAK;
- case -15: // ID
+ case -17: // ID
return ID;
default:
return null;
@@ -17696,7 +18730,11 @@ public class Server {
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.IS_ACTIVE, new org.apache.thrift.meta_data.FieldMetaData("isActive", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
- tmpMap.put(_Fields.IMAGENAME, new org.apache.thrift.meta_data.FieldMetaData("imagename", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ tmpMap.put(_Fields.IMAGEID, new org.apache.thrift.meta_data.FieldMetaData("imageid", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.IMAGEVERSION, new org.apache.thrift.meta_data.FieldMetaData("imageversion", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.USER, new org.apache.thrift.meta_data.FieldMetaData("user", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.FIRSTNAME, new org.apache.thrift.meta_data.FieldMetaData("firstname", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
@@ -17727,7 +18765,9 @@ public class Server {
String startDate,
String endDate,
boolean isActive,
- String imagename,
+ String imageid,
+ String imageversion,
+ String user,
String firstname,
String lastname,
String university,
@@ -17745,7 +18785,9 @@ public class Server {
this.endDate = endDate;
this.isActive = isActive;
setIsActiveIsSet(true);
- this.imagename = imagename;
+ this.imageid = imageid;
+ this.imageversion = imageversion;
+ this.user = user;
this.firstname = firstname;
this.lastname = lastname;
this.university = university;
@@ -17779,8 +18821,14 @@ public class Server {
this.endDate = other.endDate;
}
this.isActive = other.isActive;
- if (other.isSetImagename()) {
- this.imagename = other.imagename;
+ if (other.isSetImageid()) {
+ this.imageid = other.imageid;
+ }
+ if (other.isSetImageversion()) {
+ this.imageversion = other.imageversion;
+ }
+ if (other.isSetUser()) {
+ this.user = other.user;
}
if (other.isSetFirstname()) {
this.firstname = other.firstname;
@@ -17819,7 +18867,9 @@ public class Server {
this.endDate = null;
setIsActiveIsSet(false);
this.isActive = false;
- this.imagename = null;
+ this.imageid = null;
+ this.imageversion = null;
+ this.user = null;
this.firstname = null;
this.lastname = null;
this.university = null;
@@ -17996,27 +19046,75 @@ public class Server {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ISACTIVE_ISSET_ID, value);
}
- public String getImagename() {
- return this.imagename;
+ public String getImageid() {
+ return this.imageid;
}
- public updateLecturedata_args setImagename(String imagename) {
- this.imagename = imagename;
+ public updateLecturedata_args setImageid(String imageid) {
+ this.imageid = imageid;
return this;
}
- public void unsetImagename() {
- this.imagename = null;
+ public void unsetImageid() {
+ this.imageid = null;
}
- /** Returns true if field imagename is set (has been assigned a value) and false otherwise */
- public boolean isSetImagename() {
- return this.imagename != null;
+ /** Returns true if field imageid is set (has been assigned a value) and false otherwise */
+ public boolean isSetImageid() {
+ return this.imageid != null;
}
- public void setImagenameIsSet(boolean value) {
+ public void setImageidIsSet(boolean value) {
if (!value) {
- this.imagename = null;
+ this.imageid = null;
+ }
+ }
+
+ public String getImageversion() {
+ return this.imageversion;
+ }
+
+ public updateLecturedata_args setImageversion(String imageversion) {
+ this.imageversion = imageversion;
+ return this;
+ }
+
+ public void unsetImageversion() {
+ this.imageversion = null;
+ }
+
+ /** Returns true if field imageversion is set (has been assigned a value) and false otherwise */
+ public boolean isSetImageversion() {
+ return this.imageversion != null;
+ }
+
+ public void setImageversionIsSet(boolean value) {
+ if (!value) {
+ this.imageversion = null;
+ }
+ }
+
+ public String getUser() {
+ return this.user;
+ }
+
+ public updateLecturedata_args setUser(String user) {
+ this.user = user;
+ return this;
+ }
+
+ public void unsetUser() {
+ this.user = null;
+ }
+
+ /** Returns true if field user is set (has been assigned a value) and false otherwise */
+ public boolean isSetUser() {
+ return this.user != null;
+ }
+
+ public void setUserIsSet(boolean value) {
+ if (!value) {
+ this.user = null;
}
}
@@ -18246,11 +19344,27 @@ public class Server {
}
break;
- case IMAGENAME:
+ case IMAGEID:
if (value == null) {
- unsetImagename();
+ unsetImageid();
} else {
- setImagename((String)value);
+ setImageid((String)value);
+ }
+ break;
+
+ case IMAGEVERSION:
+ if (value == null) {
+ unsetImageversion();
+ } else {
+ setImageversion((String)value);
+ }
+ break;
+
+ case USER:
+ if (value == null) {
+ unsetUser();
+ } else {
+ setUser((String)value);
}
break;
@@ -18336,8 +19450,14 @@ public class Server {
case IS_ACTIVE:
return Boolean.valueOf(isIsActive());
- case IMAGENAME:
- return getImagename();
+ case IMAGEID:
+ return getImageid();
+
+ case IMAGEVERSION:
+ return getImageversion();
+
+ case USER:
+ return getUser();
case FIRSTNAME:
return getFirstname();
@@ -18385,8 +19505,12 @@ public class Server {
return isSetEndDate();
case IS_ACTIVE:
return isSetIsActive();
- case IMAGENAME:
- return isSetImagename();
+ case IMAGEID:
+ return isSetImageid();
+ case IMAGEVERSION:
+ return isSetImageversion();
+ case USER:
+ return isSetUser();
case FIRSTNAME:
return isSetFirstname();
case LASTNAME:
@@ -18481,12 +19605,30 @@ public class Server {
return false;
}
- boolean this_present_imagename = true && this.isSetImagename();
- boolean that_present_imagename = true && that.isSetImagename();
- if (this_present_imagename || that_present_imagename) {
- if (!(this_present_imagename && that_present_imagename))
+ boolean this_present_imageid = true && this.isSetImageid();
+ boolean that_present_imageid = true && that.isSetImageid();
+ if (this_present_imageid || that_present_imageid) {
+ if (!(this_present_imageid && that_present_imageid))
return false;
- if (!this.imagename.equals(that.imagename))
+ if (!this.imageid.equals(that.imageid))
+ return false;
+ }
+
+ boolean this_present_imageversion = true && this.isSetImageversion();
+ boolean that_present_imageversion = true && that.isSetImageversion();
+ if (this_present_imageversion || that_present_imageversion) {
+ if (!(this_present_imageversion && that_present_imageversion))
+ return false;
+ if (!this.imageversion.equals(that.imageversion))
+ return false;
+ }
+
+ boolean this_present_user = true && this.isSetUser();
+ boolean that_present_user = true && that.isSetUser();
+ if (this_present_user || that_present_user) {
+ if (!(this_present_user && that_present_user))
+ return false;
+ if (!this.user.equals(that.user))
return false;
}
@@ -18639,12 +19781,32 @@ public class Server {
return lastComparison;
}
}
- lastComparison = Boolean.valueOf(isSetImagename()).compareTo(other.isSetImagename());
+ lastComparison = Boolean.valueOf(isSetImageid()).compareTo(other.isSetImageid());
if (lastComparison != 0) {
return lastComparison;
}
- if (isSetImagename()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.imagename, other.imagename);
+ if (isSetImageid()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.imageid, other.imageid);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetImageversion()).compareTo(other.isSetImageversion());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetImageversion()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.imageversion, other.imageversion);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetUser()).compareTo(other.isSetUser());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetUser()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.user, other.user);
if (lastComparison != 0) {
return lastComparison;
}
@@ -18791,11 +19953,27 @@ public class Server {
sb.append(this.isActive);
first = false;
if (!first) sb.append(", ");
- sb.append("imagename:");
- if (this.imagename == null) {
+ sb.append("imageid:");
+ if (this.imageid == null) {
sb.append("null");
} else {
- sb.append(this.imagename);
+ sb.append(this.imageid);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("imageversion:");
+ if (this.imageversion == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.imageversion);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("user:");
+ if (this.user == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.user);
}
first = false;
if (!first) sb.append(", ");
@@ -18955,15 +20133,31 @@ public class Server {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case -8: // IMAGENAME
+ case -8: // IMAGEID
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.imagename = iprot.readString();
- struct.setImagenameIsSet(true);
+ struct.imageid = iprot.readString();
+ struct.setImageidIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case -9: // FIRSTNAME
+ case -9: // IMAGEVERSION
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.imageversion = iprot.readString();
+ struct.setImageversionIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case -10: // USER
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.user = iprot.readString();
+ struct.setUserIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case -11: // FIRSTNAME
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.firstname = iprot.readString();
struct.setFirstnameIsSet(true);
@@ -18971,7 +20165,7 @@ public class Server {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case -10: // LASTNAME
+ case -12: // LASTNAME
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.lastname = iprot.readString();
struct.setLastnameIsSet(true);
@@ -18979,7 +20173,7 @@ public class Server {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case -11: // UNIVERSITY
+ case -13: // UNIVERSITY
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.university = iprot.readString();
struct.setUniversityIsSet(true);
@@ -18987,7 +20181,7 @@ public class Server {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case -12: // MAIL
+ case -14: // MAIL
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.Mail = iprot.readString();
struct.setMailIsSet(true);
@@ -18995,7 +20189,7 @@ public class Server {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case -13: // TEL
+ case -15: // TEL
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.Tel = iprot.readString();
struct.setTelIsSet(true);
@@ -19003,7 +20197,7 @@ public class Server {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case -14: // FAK
+ case -16: // FAK
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.Fak = iprot.readString();
struct.setFakIsSet(true);
@@ -19011,7 +20205,7 @@ public class Server {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case -15: // ID
+ case -17: // ID
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.id = iprot.readString();
struct.setIdIsSet(true);
@@ -19069,9 +20263,19 @@ public class Server {
oprot.writeString(struct.firstname);
oprot.writeFieldEnd();
}
- if (struct.imagename != null) {
- oprot.writeFieldBegin(IMAGENAME_FIELD_DESC);
- oprot.writeString(struct.imagename);
+ if (struct.user != null) {
+ oprot.writeFieldBegin(USER_FIELD_DESC);
+ oprot.writeString(struct.user);
+ oprot.writeFieldEnd();
+ }
+ if (struct.imageversion != null) {
+ oprot.writeFieldBegin(IMAGEVERSION_FIELD_DESC);
+ oprot.writeString(struct.imageversion);
+ oprot.writeFieldEnd();
+ }
+ if (struct.imageid != null) {
+ oprot.writeFieldBegin(IMAGEID_FIELD_DESC);
+ oprot.writeString(struct.imageid);
oprot.writeFieldEnd();
}
oprot.writeFieldBegin(IS_ACTIVE_FIELD_DESC);
@@ -19146,31 +20350,37 @@ public class Server {
if (struct.isSetIsActive()) {
optionals.set(6);
}
- if (struct.isSetImagename()) {
+ if (struct.isSetImageid()) {
optionals.set(7);
}
- if (struct.isSetFirstname()) {
+ if (struct.isSetImageversion()) {
optionals.set(8);
}
- if (struct.isSetLastname()) {
+ if (struct.isSetUser()) {
optionals.set(9);
}
- if (struct.isSetUniversity()) {
+ if (struct.isSetFirstname()) {
optionals.set(10);
}
- if (struct.isSetMail()) {
+ if (struct.isSetLastname()) {
optionals.set(11);
}
- if (struct.isSetTel()) {
+ if (struct.isSetUniversity()) {
optionals.set(12);
}
- if (struct.isSetFak()) {
+ if (struct.isSetMail()) {
optionals.set(13);
}
- if (struct.isSetId()) {
+ if (struct.isSetTel()) {
optionals.set(14);
}
- oprot.writeBitSet(optionals, 15);
+ if (struct.isSetFak()) {
+ optionals.set(15);
+ }
+ if (struct.isSetId()) {
+ optionals.set(16);
+ }
+ oprot.writeBitSet(optionals, 17);
if (struct.isSetName()) {
oprot.writeString(struct.name);
}
@@ -19192,8 +20402,14 @@ public class Server {
if (struct.isSetIsActive()) {
oprot.writeBool(struct.isActive);
}
- if (struct.isSetImagename()) {
- oprot.writeString(struct.imagename);
+ if (struct.isSetImageid()) {
+ oprot.writeString(struct.imageid);
+ }
+ if (struct.isSetImageversion()) {
+ oprot.writeString(struct.imageversion);
+ }
+ if (struct.isSetUser()) {
+ oprot.writeString(struct.user);
}
if (struct.isSetFirstname()) {
oprot.writeString(struct.firstname);
@@ -19221,7 +20437,7 @@ public class Server {
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, updateLecturedata_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(15);
+ BitSet incoming = iprot.readBitSet(17);
if (incoming.get(0)) {
struct.name = iprot.readString();
struct.setNameIsSet(true);
@@ -19251,34 +20467,42 @@ public class Server {
struct.setIsActiveIsSet(true);
}
if (incoming.get(7)) {
- struct.imagename = iprot.readString();
- struct.setImagenameIsSet(true);
+ struct.imageid = iprot.readString();
+ struct.setImageidIsSet(true);
}
if (incoming.get(8)) {
+ struct.imageversion = iprot.readString();
+ struct.setImageversionIsSet(true);
+ }
+ if (incoming.get(9)) {
+ struct.user = iprot.readString();
+ struct.setUserIsSet(true);
+ }
+ if (incoming.get(10)) {
struct.firstname = iprot.readString();
struct.setFirstnameIsSet(true);
}
- if (incoming.get(9)) {
+ if (incoming.get(11)) {
struct.lastname = iprot.readString();
struct.setLastnameIsSet(true);
}
- if (incoming.get(10)) {
+ if (incoming.get(12)) {
struct.university = iprot.readString();
struct.setUniversityIsSet(true);
}
- if (incoming.get(11)) {
+ if (incoming.get(13)) {
struct.Mail = iprot.readString();
struct.setMailIsSet(true);
}
- if (incoming.get(12)) {
+ if (incoming.get(14)) {
struct.Tel = iprot.readString();
struct.setTelIsSet(true);
}
- if (incoming.get(13)) {
+ if (incoming.get(15)) {
struct.Fak = iprot.readString();
struct.setFakIsSet(true);
}
- if (incoming.get(14)) {
+ if (incoming.get(16)) {
struct.id = iprot.readString();
struct.setIdIsSet(true);
}
@@ -22165,4 +23389,4436 @@ public class Server {
}
+ public static class checkUser_args implements org.apache.thrift.TBase<checkUser_args, checkUser_args._Fields>, java.io.Serializable, Cloneable, Comparable<checkUser_args> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("checkUser_args");
+
+ private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)-1);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new checkUser_argsStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new checkUser_argsTupleSchemeFactory());
+ }
+
+ public String username; // required
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ USERNAME((short)-1, "username");
+
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+ static {
+ for (_Fields field : EnumSet.allOf(_Fields.class)) {
+ byName.put(field.getFieldName(), field);
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, or null if its not found.
+ */
+ public static _Fields findByThriftId(int fieldId) {
+ switch(fieldId) {
+ case -1: // USERNAME
+ return USERNAME;
+ default:
+ return null;
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, throwing an exception
+ * if it is not found.
+ */
+ public static _Fields findByThriftIdOrThrow(int fieldId) {
+ _Fields fields = findByThriftId(fieldId);
+ if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+ return fields;
+ }
+
+ /**
+ * Find the _Fields constant that matches name, or null if its not found.
+ */
+ public static _Fields findByName(String name) {
+ return byName.get(name);
+ }
+
+ private final short _thriftId;
+ private final String _fieldName;
+
+ _Fields(short thriftId, String fieldName) {
+ _thriftId = thriftId;
+ _fieldName = fieldName;
+ }
+
+ public short getThriftFieldId() {
+ return _thriftId;
+ }
+
+ public String getFieldName() {
+ return _fieldName;
+ }
+ }
+
+ // isset id assignments
+ public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+ static {
+ Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+ tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(checkUser_args.class, metaDataMap);
+ }
+
+ public checkUser_args() {
+ }
+
+ public checkUser_args(
+ String username)
+ {
+ this();
+ this.username = username;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public checkUser_args(checkUser_args other) {
+ if (other.isSetUsername()) {
+ this.username = other.username;
+ }
+ }
+
+ public checkUser_args deepCopy() {
+ return new checkUser_args(this);
+ }
+
+ @Override
+ public void clear() {
+ this.username = null;
+ }
+
+ public String getUsername() {
+ return this.username;
+ }
+
+ public checkUser_args setUsername(String username) {
+ this.username = username;
+ return this;
+ }
+
+ public void unsetUsername() {
+ this.username = null;
+ }
+
+ /** Returns true if field username is set (has been assigned a value) and false otherwise */
+ public boolean isSetUsername() {
+ return this.username != null;
+ }
+
+ public void setUsernameIsSet(boolean value) {
+ if (!value) {
+ this.username = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case USERNAME:
+ if (value == null) {
+ unsetUsername();
+ } else {
+ setUsername((String)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case USERNAME:
+ return getUsername();
+
+ }
+ throw new IllegalStateException();
+ }
+
+ /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+ public boolean isSet(_Fields field) {
+ if (field == null) {
+ throw new IllegalArgumentException();
+ }
+
+ switch (field) {
+ case USERNAME:
+ return isSetUsername();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof checkUser_args)
+ return this.equals((checkUser_args)that);
+ return false;
+ }
+
+ public boolean equals(checkUser_args that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_username = true && this.isSetUsername();
+ boolean that_present_username = true && that.isSetUsername();
+ if (this_present_username || that_present_username) {
+ if (!(this_present_username && that_present_username))
+ return false;
+ if (!this.username.equals(that.username))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ @Override
+ public int compareTo(checkUser_args other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ lastComparison = Boolean.valueOf(isSetUsername()).compareTo(other.isSetUsername());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetUsername()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, other.username);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ return 0;
+ }
+
+ public _Fields fieldForId(int fieldId) {
+ return _Fields.findByThriftId(fieldId);
+ }
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("checkUser_args(");
+ boolean first = true;
+
+ sb.append("username:");
+ if (this.username == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.username);
+ }
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ // check for sub-struct validity
+ }
+
+ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+ try {
+ write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+ try {
+ read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private static class checkUser_argsStandardSchemeFactory implements SchemeFactory {
+ public checkUser_argsStandardScheme getScheme() {
+ return new checkUser_argsStandardScheme();
+ }
+ }
+
+ private static class checkUser_argsStandardScheme extends StandardScheme<checkUser_args> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, checkUser_args struct) throws org.apache.thrift.TException {
+ org.apache.thrift.protocol.TField schemeField;
+ iprot.readStructBegin();
+ while (true)
+ {
+ schemeField = iprot.readFieldBegin();
+ if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
+ break;
+ }
+ switch (schemeField.id) {
+ case -1: // USERNAME
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.username = iprot.readString();
+ struct.setUsernameIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ default:
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ iprot.readFieldEnd();
+ }
+ iprot.readStructEnd();
+
+ // check for required fields of primitive type, which can't be checked in the validate method
+ struct.validate();
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot, checkUser_args struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.username != null) {
+ oprot.writeFieldBegin(USERNAME_FIELD_DESC);
+ oprot.writeString(struct.username);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class checkUser_argsTupleSchemeFactory implements SchemeFactory {
+ public checkUser_argsTupleScheme getScheme() {
+ return new checkUser_argsTupleScheme();
+ }
+ }
+
+ private static class checkUser_argsTupleScheme extends TupleScheme<checkUser_args> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, checkUser_args struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetUsername()) {
+ optionals.set(0);
+ }
+ oprot.writeBitSet(optionals, 1);
+ if (struct.isSetUsername()) {
+ oprot.writeString(struct.username);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, checkUser_args struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(1);
+ if (incoming.get(0)) {
+ struct.username = iprot.readString();
+ struct.setUsernameIsSet(true);
+ }
+ }
+ }
+
+ }
+
+ public static class checkUser_result implements org.apache.thrift.TBase<checkUser_result, checkUser_result._Fields>, java.io.Serializable, Cloneable, Comparable<checkUser_result> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("checkUser_result");
+
+ private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new checkUser_resultStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new checkUser_resultTupleSchemeFactory());
+ }
+
+ public boolean success; // required
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ SUCCESS((short)0, "success");
+
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+ static {
+ for (_Fields field : EnumSet.allOf(_Fields.class)) {
+ byName.put(field.getFieldName(), field);
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, or null if its not found.
+ */
+ public static _Fields findByThriftId(int fieldId) {
+ switch(fieldId) {
+ case 0: // SUCCESS
+ return SUCCESS;
+ default:
+ return null;
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, throwing an exception
+ * if it is not found.
+ */
+ public static _Fields findByThriftIdOrThrow(int fieldId) {
+ _Fields fields = findByThriftId(fieldId);
+ if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+ return fields;
+ }
+
+ /**
+ * Find the _Fields constant that matches name, or null if its not found.
+ */
+ public static _Fields findByName(String name) {
+ return byName.get(name);
+ }
+
+ private final short _thriftId;
+ private final String _fieldName;
+
+ _Fields(short thriftId, String fieldName) {
+ _thriftId = thriftId;
+ _fieldName = fieldName;
+ }
+
+ public short getThriftFieldId() {
+ return _thriftId;
+ }
+
+ public String getFieldName() {
+ return _fieldName;
+ }
+ }
+
+ // isset id assignments
+ private static final int __SUCCESS_ISSET_ID = 0;
+ private byte __isset_bitfield = 0;
+ public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+ static {
+ Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+ tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(checkUser_result.class, metaDataMap);
+ }
+
+ public checkUser_result() {
+ }
+
+ public checkUser_result(
+ boolean success)
+ {
+ this();
+ this.success = success;
+ setSuccessIsSet(true);
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public checkUser_result(checkUser_result other) {
+ __isset_bitfield = other.__isset_bitfield;
+ this.success = other.success;
+ }
+
+ public checkUser_result deepCopy() {
+ return new checkUser_result(this);
+ }
+
+ @Override
+ public void clear() {
+ setSuccessIsSet(false);
+ this.success = false;
+ }
+
+ public boolean isSuccess() {
+ return this.success;
+ }
+
+ public checkUser_result setSuccess(boolean success) {
+ this.success = success;
+ setSuccessIsSet(true);
+ return this;
+ }
+
+ public void unsetSuccess() {
+ __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID);
+ }
+
+ /** Returns true if field success is set (has been assigned a value) and false otherwise */
+ public boolean isSetSuccess() {
+ return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);
+ }
+
+ public void setSuccessIsSet(boolean value) {
+ __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value);
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case SUCCESS:
+ if (value == null) {
+ unsetSuccess();
+ } else {
+ setSuccess((Boolean)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case SUCCESS:
+ return Boolean.valueOf(isSuccess());
+
+ }
+ throw new IllegalStateException();
+ }
+
+ /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+ public boolean isSet(_Fields field) {
+ if (field == null) {
+ throw new IllegalArgumentException();
+ }
+
+ switch (field) {
+ case SUCCESS:
+ return isSetSuccess();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof checkUser_result)
+ return this.equals((checkUser_result)that);
+ return false;
+ }
+
+ public boolean equals(checkUser_result that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_success = true;
+ boolean that_present_success = true;
+ if (this_present_success || that_present_success) {
+ if (!(this_present_success && that_present_success))
+ return false;
+ if (this.success != that.success)
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ @Override
+ public int compareTo(checkUser_result other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetSuccess()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ return 0;
+ }
+
+ public _Fields fieldForId(int fieldId) {
+ return _Fields.findByThriftId(fieldId);
+ }
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("checkUser_result(");
+ boolean first = true;
+
+ sb.append("success:");
+ sb.append(this.success);
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ // check for sub-struct validity
+ }
+
+ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+ try {
+ write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+ try {
+ // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
+ __isset_bitfield = 0;
+ read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private static class checkUser_resultStandardSchemeFactory implements SchemeFactory {
+ public checkUser_resultStandardScheme getScheme() {
+ return new checkUser_resultStandardScheme();
+ }
+ }
+
+ private static class checkUser_resultStandardScheme extends StandardScheme<checkUser_result> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, checkUser_result struct) throws org.apache.thrift.TException {
+ org.apache.thrift.protocol.TField schemeField;
+ iprot.readStructBegin();
+ while (true)
+ {
+ schemeField = iprot.readFieldBegin();
+ if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
+ break;
+ }
+ switch (schemeField.id) {
+ case 0: // SUCCESS
+ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
+ struct.success = iprot.readBool();
+ struct.setSuccessIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ default:
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ iprot.readFieldEnd();
+ }
+ iprot.readStructEnd();
+
+ // check for required fields of primitive type, which can't be checked in the validate method
+ struct.validate();
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot, checkUser_result struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.isSetSuccess()) {
+ oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
+ oprot.writeBool(struct.success);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class checkUser_resultTupleSchemeFactory implements SchemeFactory {
+ public checkUser_resultTupleScheme getScheme() {
+ return new checkUser_resultTupleScheme();
+ }
+ }
+
+ private static class checkUser_resultTupleScheme extends TupleScheme<checkUser_result> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, checkUser_result struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetSuccess()) {
+ optionals.set(0);
+ }
+ oprot.writeBitSet(optionals, 1);
+ if (struct.isSetSuccess()) {
+ oprot.writeBool(struct.success);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, checkUser_result struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(1);
+ if (incoming.get(0)) {
+ struct.success = iprot.readBool();
+ struct.setSuccessIsSet(true);
+ }
+ }
+ }
+
+ }
+
+ public static class createUser_args implements org.apache.thrift.TBase<createUser_args, createUser_args._Fields>, java.io.Serializable, Cloneable, Comparable<createUser_args> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createUser_args");
+
+ private static final org.apache.thrift.protocol.TField LOGIN_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("loginName", org.apache.thrift.protocol.TType.STRING, (short)-1);
+ private static final org.apache.thrift.protocol.TField LAST_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("lastName", org.apache.thrift.protocol.TType.STRING, (short)-2);
+ private static final org.apache.thrift.protocol.TField FIRST_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("firstName", org.apache.thrift.protocol.TType.STRING, (short)-3);
+ private static final org.apache.thrift.protocol.TField MAIL_FIELD_DESC = new org.apache.thrift.protocol.TField("mail", org.apache.thrift.protocol.TType.STRING, (short)-4);
+ private static final org.apache.thrift.protocol.TField UNIVERSITY_FIELD_DESC = new org.apache.thrift.protocol.TField("university", org.apache.thrift.protocol.TType.STRING, (short)-5);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new createUser_argsStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new createUser_argsTupleSchemeFactory());
+ }
+
+ public String loginName; // required
+ public String lastName; // required
+ public String firstName; // required
+ public String mail; // required
+ public String university; // required
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ LOGIN_NAME((short)-1, "loginName"),
+ LAST_NAME((short)-2, "lastName"),
+ FIRST_NAME((short)-3, "firstName"),
+ MAIL((short)-4, "mail"),
+ UNIVERSITY((short)-5, "university");
+
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+ static {
+ for (_Fields field : EnumSet.allOf(_Fields.class)) {
+ byName.put(field.getFieldName(), field);
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, or null if its not found.
+ */
+ public static _Fields findByThriftId(int fieldId) {
+ switch(fieldId) {
+ case -1: // LOGIN_NAME
+ return LOGIN_NAME;
+ case -2: // LAST_NAME
+ return LAST_NAME;
+ case -3: // FIRST_NAME
+ return FIRST_NAME;
+ case -4: // MAIL
+ return MAIL;
+ case -5: // UNIVERSITY
+ return UNIVERSITY;
+ default:
+ return null;
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, throwing an exception
+ * if it is not found.
+ */
+ public static _Fields findByThriftIdOrThrow(int fieldId) {
+ _Fields fields = findByThriftId(fieldId);
+ if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+ return fields;
+ }
+
+ /**
+ * Find the _Fields constant that matches name, or null if its not found.
+ */
+ public static _Fields findByName(String name) {
+ return byName.get(name);
+ }
+
+ private final short _thriftId;
+ private final String _fieldName;
+
+ _Fields(short thriftId, String fieldName) {
+ _thriftId = thriftId;
+ _fieldName = fieldName;
+ }
+
+ public short getThriftFieldId() {
+ return _thriftId;
+ }
+
+ public String getFieldName() {
+ return _fieldName;
+ }
+ }
+
+ // isset id assignments
+ public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+ static {
+ Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+ tmpMap.put(_Fields.LOGIN_NAME, new org.apache.thrift.meta_data.FieldMetaData("loginName", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.LAST_NAME, new org.apache.thrift.meta_data.FieldMetaData("lastName", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.FIRST_NAME, new org.apache.thrift.meta_data.FieldMetaData("firstName", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.MAIL, new org.apache.thrift.meta_data.FieldMetaData("mail", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.UNIVERSITY, new org.apache.thrift.meta_data.FieldMetaData("university", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createUser_args.class, metaDataMap);
+ }
+
+ public createUser_args() {
+ }
+
+ public createUser_args(
+ String loginName,
+ String lastName,
+ String firstName,
+ String mail,
+ String university)
+ {
+ this();
+ this.loginName = loginName;
+ this.lastName = lastName;
+ this.firstName = firstName;
+ this.mail = mail;
+ this.university = university;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public createUser_args(createUser_args other) {
+ if (other.isSetLoginName()) {
+ this.loginName = other.loginName;
+ }
+ if (other.isSetLastName()) {
+ this.lastName = other.lastName;
+ }
+ if (other.isSetFirstName()) {
+ this.firstName = other.firstName;
+ }
+ if (other.isSetMail()) {
+ this.mail = other.mail;
+ }
+ if (other.isSetUniversity()) {
+ this.university = other.university;
+ }
+ }
+
+ public createUser_args deepCopy() {
+ return new createUser_args(this);
+ }
+
+ @Override
+ public void clear() {
+ this.loginName = null;
+ this.lastName = null;
+ this.firstName = null;
+ this.mail = null;
+ this.university = null;
+ }
+
+ public String getLoginName() {
+ return this.loginName;
+ }
+
+ public createUser_args setLoginName(String loginName) {
+ this.loginName = loginName;
+ return this;
+ }
+
+ public void unsetLoginName() {
+ this.loginName = null;
+ }
+
+ /** Returns true if field loginName is set (has been assigned a value) and false otherwise */
+ public boolean isSetLoginName() {
+ return this.loginName != null;
+ }
+
+ public void setLoginNameIsSet(boolean value) {
+ if (!value) {
+ this.loginName = null;
+ }
+ }
+
+ public String getLastName() {
+ return this.lastName;
+ }
+
+ public createUser_args setLastName(String lastName) {
+ this.lastName = lastName;
+ return this;
+ }
+
+ public void unsetLastName() {
+ this.lastName = null;
+ }
+
+ /** Returns true if field lastName is set (has been assigned a value) and false otherwise */
+ public boolean isSetLastName() {
+ return this.lastName != null;
+ }
+
+ public void setLastNameIsSet(boolean value) {
+ if (!value) {
+ this.lastName = null;
+ }
+ }
+
+ public String getFirstName() {
+ return this.firstName;
+ }
+
+ public createUser_args setFirstName(String firstName) {
+ this.firstName = firstName;
+ return this;
+ }
+
+ public void unsetFirstName() {
+ this.firstName = null;
+ }
+
+ /** Returns true if field firstName is set (has been assigned a value) and false otherwise */
+ public boolean isSetFirstName() {
+ return this.firstName != null;
+ }
+
+ public void setFirstNameIsSet(boolean value) {
+ if (!value) {
+ this.firstName = null;
+ }
+ }
+
+ public String getMail() {
+ return this.mail;
+ }
+
+ public createUser_args setMail(String mail) {
+ this.mail = mail;
+ return this;
+ }
+
+ public void unsetMail() {
+ this.mail = null;
+ }
+
+ /** Returns true if field mail is set (has been assigned a value) and false otherwise */
+ public boolean isSetMail() {
+ return this.mail != null;
+ }
+
+ public void setMailIsSet(boolean value) {
+ if (!value) {
+ this.mail = null;
+ }
+ }
+
+ public String getUniversity() {
+ return this.university;
+ }
+
+ public createUser_args setUniversity(String university) {
+ this.university = university;
+ return this;
+ }
+
+ public void unsetUniversity() {
+ this.university = null;
+ }
+
+ /** Returns true if field university is set (has been assigned a value) and false otherwise */
+ public boolean isSetUniversity() {
+ return this.university != null;
+ }
+
+ public void setUniversityIsSet(boolean value) {
+ if (!value) {
+ this.university = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case LOGIN_NAME:
+ if (value == null) {
+ unsetLoginName();
+ } else {
+ setLoginName((String)value);
+ }
+ break;
+
+ case LAST_NAME:
+ if (value == null) {
+ unsetLastName();
+ } else {
+ setLastName((String)value);
+ }
+ break;
+
+ case FIRST_NAME:
+ if (value == null) {
+ unsetFirstName();
+ } else {
+ setFirstName((String)value);
+ }
+ break;
+
+ case MAIL:
+ if (value == null) {
+ unsetMail();
+ } else {
+ setMail((String)value);
+ }
+ break;
+
+ case UNIVERSITY:
+ if (value == null) {
+ unsetUniversity();
+ } else {
+ setUniversity((String)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case LOGIN_NAME:
+ return getLoginName();
+
+ case LAST_NAME:
+ return getLastName();
+
+ case FIRST_NAME:
+ return getFirstName();
+
+ case MAIL:
+ return getMail();
+
+ case UNIVERSITY:
+ return getUniversity();
+
+ }
+ throw new IllegalStateException();
+ }
+
+ /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+ public boolean isSet(_Fields field) {
+ if (field == null) {
+ throw new IllegalArgumentException();
+ }
+
+ switch (field) {
+ case LOGIN_NAME:
+ return isSetLoginName();
+ case LAST_NAME:
+ return isSetLastName();
+ case FIRST_NAME:
+ return isSetFirstName();
+ case MAIL:
+ return isSetMail();
+ case UNIVERSITY:
+ return isSetUniversity();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof createUser_args)
+ return this.equals((createUser_args)that);
+ return false;
+ }
+
+ public boolean equals(createUser_args that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_loginName = true && this.isSetLoginName();
+ boolean that_present_loginName = true && that.isSetLoginName();
+ if (this_present_loginName || that_present_loginName) {
+ if (!(this_present_loginName && that_present_loginName))
+ return false;
+ if (!this.loginName.equals(that.loginName))
+ return false;
+ }
+
+ boolean this_present_lastName = true && this.isSetLastName();
+ boolean that_present_lastName = true && that.isSetLastName();
+ if (this_present_lastName || that_present_lastName) {
+ if (!(this_present_lastName && that_present_lastName))
+ return false;
+ if (!this.lastName.equals(that.lastName))
+ return false;
+ }
+
+ boolean this_present_firstName = true && this.isSetFirstName();
+ boolean that_present_firstName = true && that.isSetFirstName();
+ if (this_present_firstName || that_present_firstName) {
+ if (!(this_present_firstName && that_present_firstName))
+ return false;
+ if (!this.firstName.equals(that.firstName))
+ return false;
+ }
+
+ boolean this_present_mail = true && this.isSetMail();
+ boolean that_present_mail = true && that.isSetMail();
+ if (this_present_mail || that_present_mail) {
+ if (!(this_present_mail && that_present_mail))
+ return false;
+ if (!this.mail.equals(that.mail))
+ return false;
+ }
+
+ boolean this_present_university = true && this.isSetUniversity();
+ boolean that_present_university = true && that.isSetUniversity();
+ if (this_present_university || that_present_university) {
+ if (!(this_present_university && that_present_university))
+ return false;
+ if (!this.university.equals(that.university))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ @Override
+ public int compareTo(createUser_args other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ lastComparison = Boolean.valueOf(isSetLoginName()).compareTo(other.isSetLoginName());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetLoginName()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.loginName, other.loginName);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetLastName()).compareTo(other.isSetLastName());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetLastName()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lastName, other.lastName);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetFirstName()).compareTo(other.isSetFirstName());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetFirstName()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.firstName, other.firstName);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetMail()).compareTo(other.isSetMail());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetMail()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mail, other.mail);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetUniversity()).compareTo(other.isSetUniversity());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetUniversity()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.university, other.university);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ return 0;
+ }
+
+ public _Fields fieldForId(int fieldId) {
+ return _Fields.findByThriftId(fieldId);
+ }
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("createUser_args(");
+ boolean first = true;
+
+ sb.append("loginName:");
+ if (this.loginName == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.loginName);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("lastName:");
+ if (this.lastName == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.lastName);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("firstName:");
+ if (this.firstName == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.firstName);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("mail:");
+ if (this.mail == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.mail);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("university:");
+ if (this.university == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.university);
+ }
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ // check for sub-struct validity
+ }
+
+ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+ try {
+ write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+ try {
+ read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private static class createUser_argsStandardSchemeFactory implements SchemeFactory {
+ public createUser_argsStandardScheme getScheme() {
+ return new createUser_argsStandardScheme();
+ }
+ }
+
+ private static class createUser_argsStandardScheme extends StandardScheme<createUser_args> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, createUser_args struct) throws org.apache.thrift.TException {
+ org.apache.thrift.protocol.TField schemeField;
+ iprot.readStructBegin();
+ while (true)
+ {
+ schemeField = iprot.readFieldBegin();
+ if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
+ break;
+ }
+ switch (schemeField.id) {
+ case -1: // LOGIN_NAME
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.loginName = iprot.readString();
+ struct.setLoginNameIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case -2: // LAST_NAME
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.lastName = iprot.readString();
+ struct.setLastNameIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case -3: // FIRST_NAME
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.firstName = iprot.readString();
+ struct.setFirstNameIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case -4: // MAIL
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.mail = iprot.readString();
+ struct.setMailIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case -5: // UNIVERSITY
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.university = iprot.readString();
+ struct.setUniversityIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ default:
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ iprot.readFieldEnd();
+ }
+ iprot.readStructEnd();
+
+ // check for required fields of primitive type, which can't be checked in the validate method
+ struct.validate();
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot, createUser_args struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.university != null) {
+ oprot.writeFieldBegin(UNIVERSITY_FIELD_DESC);
+ oprot.writeString(struct.university);
+ oprot.writeFieldEnd();
+ }
+ if (struct.mail != null) {
+ oprot.writeFieldBegin(MAIL_FIELD_DESC);
+ oprot.writeString(struct.mail);
+ oprot.writeFieldEnd();
+ }
+ if (struct.firstName != null) {
+ oprot.writeFieldBegin(FIRST_NAME_FIELD_DESC);
+ oprot.writeString(struct.firstName);
+ oprot.writeFieldEnd();
+ }
+ if (struct.lastName != null) {
+ oprot.writeFieldBegin(LAST_NAME_FIELD_DESC);
+ oprot.writeString(struct.lastName);
+ oprot.writeFieldEnd();
+ }
+ if (struct.loginName != null) {
+ oprot.writeFieldBegin(LOGIN_NAME_FIELD_DESC);
+ oprot.writeString(struct.loginName);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class createUser_argsTupleSchemeFactory implements SchemeFactory {
+ public createUser_argsTupleScheme getScheme() {
+ return new createUser_argsTupleScheme();
+ }
+ }
+
+ private static class createUser_argsTupleScheme extends TupleScheme<createUser_args> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, createUser_args struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetLoginName()) {
+ optionals.set(0);
+ }
+ if (struct.isSetLastName()) {
+ optionals.set(1);
+ }
+ if (struct.isSetFirstName()) {
+ optionals.set(2);
+ }
+ if (struct.isSetMail()) {
+ optionals.set(3);
+ }
+ if (struct.isSetUniversity()) {
+ optionals.set(4);
+ }
+ oprot.writeBitSet(optionals, 5);
+ if (struct.isSetLoginName()) {
+ oprot.writeString(struct.loginName);
+ }
+ if (struct.isSetLastName()) {
+ oprot.writeString(struct.lastName);
+ }
+ if (struct.isSetFirstName()) {
+ oprot.writeString(struct.firstName);
+ }
+ if (struct.isSetMail()) {
+ oprot.writeString(struct.mail);
+ }
+ if (struct.isSetUniversity()) {
+ oprot.writeString(struct.university);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, createUser_args struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(5);
+ if (incoming.get(0)) {
+ struct.loginName = iprot.readString();
+ struct.setLoginNameIsSet(true);
+ }
+ if (incoming.get(1)) {
+ struct.lastName = iprot.readString();
+ struct.setLastNameIsSet(true);
+ }
+ if (incoming.get(2)) {
+ struct.firstName = iprot.readString();
+ struct.setFirstNameIsSet(true);
+ }
+ if (incoming.get(3)) {
+ struct.mail = iprot.readString();
+ struct.setMailIsSet(true);
+ }
+ if (incoming.get(4)) {
+ struct.university = iprot.readString();
+ struct.setUniversityIsSet(true);
+ }
+ }
+ }
+
+ }
+
+ public static class createUser_result implements org.apache.thrift.TBase<createUser_result, createUser_result._Fields>, java.io.Serializable, Cloneable, Comparable<createUser_result> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createUser_result");
+
+ private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new createUser_resultStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new createUser_resultTupleSchemeFactory());
+ }
+
+ public boolean success; // required
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ SUCCESS((short)0, "success");
+
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+ static {
+ for (_Fields field : EnumSet.allOf(_Fields.class)) {
+ byName.put(field.getFieldName(), field);
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, or null if its not found.
+ */
+ public static _Fields findByThriftId(int fieldId) {
+ switch(fieldId) {
+ case 0: // SUCCESS
+ return SUCCESS;
+ default:
+ return null;
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, throwing an exception
+ * if it is not found.
+ */
+ public static _Fields findByThriftIdOrThrow(int fieldId) {
+ _Fields fields = findByThriftId(fieldId);
+ if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+ return fields;
+ }
+
+ /**
+ * Find the _Fields constant that matches name, or null if its not found.
+ */
+ public static _Fields findByName(String name) {
+ return byName.get(name);
+ }
+
+ private final short _thriftId;
+ private final String _fieldName;
+
+ _Fields(short thriftId, String fieldName) {
+ _thriftId = thriftId;
+ _fieldName = fieldName;
+ }
+
+ public short getThriftFieldId() {
+ return _thriftId;
+ }
+
+ public String getFieldName() {
+ return _fieldName;
+ }
+ }
+
+ // isset id assignments
+ private static final int __SUCCESS_ISSET_ID = 0;
+ private byte __isset_bitfield = 0;
+ public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+ static {
+ Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+ tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createUser_result.class, metaDataMap);
+ }
+
+ public createUser_result() {
+ }
+
+ public createUser_result(
+ boolean success)
+ {
+ this();
+ this.success = success;
+ setSuccessIsSet(true);
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public createUser_result(createUser_result other) {
+ __isset_bitfield = other.__isset_bitfield;
+ this.success = other.success;
+ }
+
+ public createUser_result deepCopy() {
+ return new createUser_result(this);
+ }
+
+ @Override
+ public void clear() {
+ setSuccessIsSet(false);
+ this.success = false;
+ }
+
+ public boolean isSuccess() {
+ return this.success;
+ }
+
+ public createUser_result setSuccess(boolean success) {
+ this.success = success;
+ setSuccessIsSet(true);
+ return this;
+ }
+
+ public void unsetSuccess() {
+ __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID);
+ }
+
+ /** Returns true if field success is set (has been assigned a value) and false otherwise */
+ public boolean isSetSuccess() {
+ return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);
+ }
+
+ public void setSuccessIsSet(boolean value) {
+ __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value);
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case SUCCESS:
+ if (value == null) {
+ unsetSuccess();
+ } else {
+ setSuccess((Boolean)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case SUCCESS:
+ return Boolean.valueOf(isSuccess());
+
+ }
+ throw new IllegalStateException();
+ }
+
+ /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+ public boolean isSet(_Fields field) {
+ if (field == null) {
+ throw new IllegalArgumentException();
+ }
+
+ switch (field) {
+ case SUCCESS:
+ return isSetSuccess();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof createUser_result)
+ return this.equals((createUser_result)that);
+ return false;
+ }
+
+ public boolean equals(createUser_result that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_success = true;
+ boolean that_present_success = true;
+ if (this_present_success || that_present_success) {
+ if (!(this_present_success && that_present_success))
+ return false;
+ if (this.success != that.success)
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ @Override
+ public int compareTo(createUser_result other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetSuccess()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ return 0;
+ }
+
+ public _Fields fieldForId(int fieldId) {
+ return _Fields.findByThriftId(fieldId);
+ }
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("createUser_result(");
+ boolean first = true;
+
+ sb.append("success:");
+ sb.append(this.success);
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ // check for sub-struct validity
+ }
+
+ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+ try {
+ write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+ try {
+ // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
+ __isset_bitfield = 0;
+ read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private static class createUser_resultStandardSchemeFactory implements SchemeFactory {
+ public createUser_resultStandardScheme getScheme() {
+ return new createUser_resultStandardScheme();
+ }
+ }
+
+ private static class createUser_resultStandardScheme extends StandardScheme<createUser_result> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, createUser_result struct) throws org.apache.thrift.TException {
+ org.apache.thrift.protocol.TField schemeField;
+ iprot.readStructBegin();
+ while (true)
+ {
+ schemeField = iprot.readFieldBegin();
+ if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
+ break;
+ }
+ switch (schemeField.id) {
+ case 0: // SUCCESS
+ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
+ struct.success = iprot.readBool();
+ struct.setSuccessIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ default:
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ iprot.readFieldEnd();
+ }
+ iprot.readStructEnd();
+
+ // check for required fields of primitive type, which can't be checked in the validate method
+ struct.validate();
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot, createUser_result struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.isSetSuccess()) {
+ oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
+ oprot.writeBool(struct.success);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class createUser_resultTupleSchemeFactory implements SchemeFactory {
+ public createUser_resultTupleScheme getScheme() {
+ return new createUser_resultTupleScheme();
+ }
+ }
+
+ private static class createUser_resultTupleScheme extends TupleScheme<createUser_result> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, createUser_result struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetSuccess()) {
+ optionals.set(0);
+ }
+ oprot.writeBitSet(optionals, 1);
+ if (struct.isSetSuccess()) {
+ oprot.writeBool(struct.success);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, createUser_result struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(1);
+ if (incoming.get(0)) {
+ struct.success = iprot.readBool();
+ struct.setSuccessIsSet(true);
+ }
+ }
+ }
+
+ }
+
+ public static class writeImageRights_args implements org.apache.thrift.TBase<writeImageRights_args, writeImageRights_args._Fields>, java.io.Serializable, Cloneable, Comparable<writeImageRights_args> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("writeImageRights_args");
+
+ private static final org.apache.thrift.protocol.TField IMAGENAME_FIELD_DESC = new org.apache.thrift.protocol.TField("imagename", org.apache.thrift.protocol.TType.STRING, (short)-1);
+ private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)-2);
+ private static final org.apache.thrift.protocol.TField LAST_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("lastName", org.apache.thrift.protocol.TType.STRING, (short)-3);
+ private static final org.apache.thrift.protocol.TField FIRST_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("firstName", org.apache.thrift.protocol.TType.STRING, (short)-4);
+ private static final org.apache.thrift.protocol.TField MAIL_FIELD_DESC = new org.apache.thrift.protocol.TField("mail", org.apache.thrift.protocol.TType.STRING, (short)-5);
+ private static final org.apache.thrift.protocol.TField UNIVERSITY_FIELD_DESC = new org.apache.thrift.protocol.TField("university", org.apache.thrift.protocol.TType.STRING, (short)-6);
+ private static final org.apache.thrift.protocol.TField ROLE_FIELD_DESC = new org.apache.thrift.protocol.TField("role", org.apache.thrift.protocol.TType.STRING, (short)-7);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new writeImageRights_argsStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new writeImageRights_argsTupleSchemeFactory());
+ }
+
+ public String imagename; // required
+ public String username; // required
+ public String lastName; // required
+ public String firstName; // required
+ public String mail; // required
+ public String university; // required
+ public String role; // required
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ IMAGENAME((short)-1, "imagename"),
+ USERNAME((short)-2, "username"),
+ LAST_NAME((short)-3, "lastName"),
+ FIRST_NAME((short)-4, "firstName"),
+ MAIL((short)-5, "mail"),
+ UNIVERSITY((short)-6, "university"),
+ ROLE((short)-7, "role");
+
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+ static {
+ for (_Fields field : EnumSet.allOf(_Fields.class)) {
+ byName.put(field.getFieldName(), field);
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, or null if its not found.
+ */
+ public static _Fields findByThriftId(int fieldId) {
+ switch(fieldId) {
+ case -1: // IMAGENAME
+ return IMAGENAME;
+ case -2: // USERNAME
+ return USERNAME;
+ case -3: // LAST_NAME
+ return LAST_NAME;
+ case -4: // FIRST_NAME
+ return FIRST_NAME;
+ case -5: // MAIL
+ return MAIL;
+ case -6: // UNIVERSITY
+ return UNIVERSITY;
+ case -7: // ROLE
+ return ROLE;
+ default:
+ return null;
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, throwing an exception
+ * if it is not found.
+ */
+ public static _Fields findByThriftIdOrThrow(int fieldId) {
+ _Fields fields = findByThriftId(fieldId);
+ if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+ return fields;
+ }
+
+ /**
+ * Find the _Fields constant that matches name, or null if its not found.
+ */
+ public static _Fields findByName(String name) {
+ return byName.get(name);
+ }
+
+ private final short _thriftId;
+ private final String _fieldName;
+
+ _Fields(short thriftId, String fieldName) {
+ _thriftId = thriftId;
+ _fieldName = fieldName;
+ }
+
+ public short getThriftFieldId() {
+ return _thriftId;
+ }
+
+ public String getFieldName() {
+ return _fieldName;
+ }
+ }
+
+ // isset id assignments
+ public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+ static {
+ Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+ tmpMap.put(_Fields.IMAGENAME, new org.apache.thrift.meta_data.FieldMetaData("imagename", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.LAST_NAME, new org.apache.thrift.meta_data.FieldMetaData("lastName", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.FIRST_NAME, new org.apache.thrift.meta_data.FieldMetaData("firstName", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.MAIL, new org.apache.thrift.meta_data.FieldMetaData("mail", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.UNIVERSITY, new org.apache.thrift.meta_data.FieldMetaData("university", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.ROLE, new org.apache.thrift.meta_data.FieldMetaData("role", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(writeImageRights_args.class, metaDataMap);
+ }
+
+ public writeImageRights_args() {
+ }
+
+ public writeImageRights_args(
+ String imagename,
+ String username,
+ String lastName,
+ String firstName,
+ String mail,
+ String university,
+ String role)
+ {
+ this();
+ this.imagename = imagename;
+ this.username = username;
+ this.lastName = lastName;
+ this.firstName = firstName;
+ this.mail = mail;
+ this.university = university;
+ this.role = role;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public writeImageRights_args(writeImageRights_args other) {
+ if (other.isSetImagename()) {
+ this.imagename = other.imagename;
+ }
+ if (other.isSetUsername()) {
+ this.username = other.username;
+ }
+ if (other.isSetLastName()) {
+ this.lastName = other.lastName;
+ }
+ if (other.isSetFirstName()) {
+ this.firstName = other.firstName;
+ }
+ if (other.isSetMail()) {
+ this.mail = other.mail;
+ }
+ if (other.isSetUniversity()) {
+ this.university = other.university;
+ }
+ if (other.isSetRole()) {
+ this.role = other.role;
+ }
+ }
+
+ public writeImageRights_args deepCopy() {
+ return new writeImageRights_args(this);
+ }
+
+ @Override
+ public void clear() {
+ this.imagename = null;
+ this.username = null;
+ this.lastName = null;
+ this.firstName = null;
+ this.mail = null;
+ this.university = null;
+ this.role = null;
+ }
+
+ public String getImagename() {
+ return this.imagename;
+ }
+
+ public writeImageRights_args setImagename(String imagename) {
+ this.imagename = imagename;
+ return this;
+ }
+
+ public void unsetImagename() {
+ this.imagename = null;
+ }
+
+ /** Returns true if field imagename is set (has been assigned a value) and false otherwise */
+ public boolean isSetImagename() {
+ return this.imagename != null;
+ }
+
+ public void setImagenameIsSet(boolean value) {
+ if (!value) {
+ this.imagename = null;
+ }
+ }
+
+ public String getUsername() {
+ return this.username;
+ }
+
+ public writeImageRights_args setUsername(String username) {
+ this.username = username;
+ return this;
+ }
+
+ public void unsetUsername() {
+ this.username = null;
+ }
+
+ /** Returns true if field username is set (has been assigned a value) and false otherwise */
+ public boolean isSetUsername() {
+ return this.username != null;
+ }
+
+ public void setUsernameIsSet(boolean value) {
+ if (!value) {
+ this.username = null;
+ }
+ }
+
+ public String getLastName() {
+ return this.lastName;
+ }
+
+ public writeImageRights_args setLastName(String lastName) {
+ this.lastName = lastName;
+ return this;
+ }
+
+ public void unsetLastName() {
+ this.lastName = null;
+ }
+
+ /** Returns true if field lastName is set (has been assigned a value) and false otherwise */
+ public boolean isSetLastName() {
+ return this.lastName != null;
+ }
+
+ public void setLastNameIsSet(boolean value) {
+ if (!value) {
+ this.lastName = null;
+ }
+ }
+
+ public String getFirstName() {
+ return this.firstName;
+ }
+
+ public writeImageRights_args setFirstName(String firstName) {
+ this.firstName = firstName;
+ return this;
+ }
+
+ public void unsetFirstName() {
+ this.firstName = null;
+ }
+
+ /** Returns true if field firstName is set (has been assigned a value) and false otherwise */
+ public boolean isSetFirstName() {
+ return this.firstName != null;
+ }
+
+ public void setFirstNameIsSet(boolean value) {
+ if (!value) {
+ this.firstName = null;
+ }
+ }
+
+ public String getMail() {
+ return this.mail;
+ }
+
+ public writeImageRights_args setMail(String mail) {
+ this.mail = mail;
+ return this;
+ }
+
+ public void unsetMail() {
+ this.mail = null;
+ }
+
+ /** Returns true if field mail is set (has been assigned a value) and false otherwise */
+ public boolean isSetMail() {
+ return this.mail != null;
+ }
+
+ public void setMailIsSet(boolean value) {
+ if (!value) {
+ this.mail = null;
+ }
+ }
+
+ public String getUniversity() {
+ return this.university;
+ }
+
+ public writeImageRights_args setUniversity(String university) {
+ this.university = university;
+ return this;
+ }
+
+ public void unsetUniversity() {
+ this.university = null;
+ }
+
+ /** Returns true if field university is set (has been assigned a value) and false otherwise */
+ public boolean isSetUniversity() {
+ return this.university != null;
+ }
+
+ public void setUniversityIsSet(boolean value) {
+ if (!value) {
+ this.university = null;
+ }
+ }
+
+ public String getRole() {
+ return this.role;
+ }
+
+ public writeImageRights_args setRole(String role) {
+ this.role = role;
+ return this;
+ }
+
+ public void unsetRole() {
+ this.role = null;
+ }
+
+ /** Returns true if field role is set (has been assigned a value) and false otherwise */
+ public boolean isSetRole() {
+ return this.role != null;
+ }
+
+ public void setRoleIsSet(boolean value) {
+ if (!value) {
+ this.role = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case IMAGENAME:
+ if (value == null) {
+ unsetImagename();
+ } else {
+ setImagename((String)value);
+ }
+ break;
+
+ case USERNAME:
+ if (value == null) {
+ unsetUsername();
+ } else {
+ setUsername((String)value);
+ }
+ break;
+
+ case LAST_NAME:
+ if (value == null) {
+ unsetLastName();
+ } else {
+ setLastName((String)value);
+ }
+ break;
+
+ case FIRST_NAME:
+ if (value == null) {
+ unsetFirstName();
+ } else {
+ setFirstName((String)value);
+ }
+ break;
+
+ case MAIL:
+ if (value == null) {
+ unsetMail();
+ } else {
+ setMail((String)value);
+ }
+ break;
+
+ case UNIVERSITY:
+ if (value == null) {
+ unsetUniversity();
+ } else {
+ setUniversity((String)value);
+ }
+ break;
+
+ case ROLE:
+ if (value == null) {
+ unsetRole();
+ } else {
+ setRole((String)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case IMAGENAME:
+ return getImagename();
+
+ case USERNAME:
+ return getUsername();
+
+ case LAST_NAME:
+ return getLastName();
+
+ case FIRST_NAME:
+ return getFirstName();
+
+ case MAIL:
+ return getMail();
+
+ case UNIVERSITY:
+ return getUniversity();
+
+ case ROLE:
+ return getRole();
+
+ }
+ throw new IllegalStateException();
+ }
+
+ /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+ public boolean isSet(_Fields field) {
+ if (field == null) {
+ throw new IllegalArgumentException();
+ }
+
+ switch (field) {
+ case IMAGENAME:
+ return isSetImagename();
+ case USERNAME:
+ return isSetUsername();
+ case LAST_NAME:
+ return isSetLastName();
+ case FIRST_NAME:
+ return isSetFirstName();
+ case MAIL:
+ return isSetMail();
+ case UNIVERSITY:
+ return isSetUniversity();
+ case ROLE:
+ return isSetRole();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof writeImageRights_args)
+ return this.equals((writeImageRights_args)that);
+ return false;
+ }
+
+ public boolean equals(writeImageRights_args that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_imagename = true && this.isSetImagename();
+ boolean that_present_imagename = true && that.isSetImagename();
+ if (this_present_imagename || that_present_imagename) {
+ if (!(this_present_imagename && that_present_imagename))
+ return false;
+ if (!this.imagename.equals(that.imagename))
+ return false;
+ }
+
+ boolean this_present_username = true && this.isSetUsername();
+ boolean that_present_username = true && that.isSetUsername();
+ if (this_present_username || that_present_username) {
+ if (!(this_present_username && that_present_username))
+ return false;
+ if (!this.username.equals(that.username))
+ return false;
+ }
+
+ boolean this_present_lastName = true && this.isSetLastName();
+ boolean that_present_lastName = true && that.isSetLastName();
+ if (this_present_lastName || that_present_lastName) {
+ if (!(this_present_lastName && that_present_lastName))
+ return false;
+ if (!this.lastName.equals(that.lastName))
+ return false;
+ }
+
+ boolean this_present_firstName = true && this.isSetFirstName();
+ boolean that_present_firstName = true && that.isSetFirstName();
+ if (this_present_firstName || that_present_firstName) {
+ if (!(this_present_firstName && that_present_firstName))
+ return false;
+ if (!this.firstName.equals(that.firstName))
+ return false;
+ }
+
+ boolean this_present_mail = true && this.isSetMail();
+ boolean that_present_mail = true && that.isSetMail();
+ if (this_present_mail || that_present_mail) {
+ if (!(this_present_mail && that_present_mail))
+ return false;
+ if (!this.mail.equals(that.mail))
+ return false;
+ }
+
+ boolean this_present_university = true && this.isSetUniversity();
+ boolean that_present_university = true && that.isSetUniversity();
+ if (this_present_university || that_present_university) {
+ if (!(this_present_university && that_present_university))
+ return false;
+ if (!this.university.equals(that.university))
+ return false;
+ }
+
+ boolean this_present_role = true && this.isSetRole();
+ boolean that_present_role = true && that.isSetRole();
+ if (this_present_role || that_present_role) {
+ if (!(this_present_role && that_present_role))
+ return false;
+ if (!this.role.equals(that.role))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ @Override
+ public int compareTo(writeImageRights_args other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ lastComparison = Boolean.valueOf(isSetImagename()).compareTo(other.isSetImagename());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetImagename()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.imagename, other.imagename);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetUsername()).compareTo(other.isSetUsername());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetUsername()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, other.username);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetLastName()).compareTo(other.isSetLastName());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetLastName()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lastName, other.lastName);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetFirstName()).compareTo(other.isSetFirstName());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetFirstName()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.firstName, other.firstName);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetMail()).compareTo(other.isSetMail());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetMail()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mail, other.mail);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetUniversity()).compareTo(other.isSetUniversity());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetUniversity()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.university, other.university);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetRole()).compareTo(other.isSetRole());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetRole()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.role, other.role);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ return 0;
+ }
+
+ public _Fields fieldForId(int fieldId) {
+ return _Fields.findByThriftId(fieldId);
+ }
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("writeImageRights_args(");
+ boolean first = true;
+
+ sb.append("imagename:");
+ if (this.imagename == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.imagename);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("username:");
+ if (this.username == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.username);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("lastName:");
+ if (this.lastName == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.lastName);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("firstName:");
+ if (this.firstName == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.firstName);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("mail:");
+ if (this.mail == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.mail);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("university:");
+ if (this.university == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.university);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("role:");
+ if (this.role == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.role);
+ }
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ // check for sub-struct validity
+ }
+
+ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+ try {
+ write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+ try {
+ read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private static class writeImageRights_argsStandardSchemeFactory implements SchemeFactory {
+ public writeImageRights_argsStandardScheme getScheme() {
+ return new writeImageRights_argsStandardScheme();
+ }
+ }
+
+ private static class writeImageRights_argsStandardScheme extends StandardScheme<writeImageRights_args> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, writeImageRights_args struct) throws org.apache.thrift.TException {
+ org.apache.thrift.protocol.TField schemeField;
+ iprot.readStructBegin();
+ while (true)
+ {
+ schemeField = iprot.readFieldBegin();
+ if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
+ break;
+ }
+ switch (schemeField.id) {
+ case -1: // IMAGENAME
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.imagename = iprot.readString();
+ struct.setImagenameIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case -2: // USERNAME
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.username = iprot.readString();
+ struct.setUsernameIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case -3: // LAST_NAME
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.lastName = iprot.readString();
+ struct.setLastNameIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case -4: // FIRST_NAME
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.firstName = iprot.readString();
+ struct.setFirstNameIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case -5: // MAIL
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.mail = iprot.readString();
+ struct.setMailIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case -6: // UNIVERSITY
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.university = iprot.readString();
+ struct.setUniversityIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case -7: // ROLE
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.role = iprot.readString();
+ struct.setRoleIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ default:
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ iprot.readFieldEnd();
+ }
+ iprot.readStructEnd();
+
+ // check for required fields of primitive type, which can't be checked in the validate method
+ struct.validate();
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot, writeImageRights_args struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.role != null) {
+ oprot.writeFieldBegin(ROLE_FIELD_DESC);
+ oprot.writeString(struct.role);
+ oprot.writeFieldEnd();
+ }
+ if (struct.university != null) {
+ oprot.writeFieldBegin(UNIVERSITY_FIELD_DESC);
+ oprot.writeString(struct.university);
+ oprot.writeFieldEnd();
+ }
+ if (struct.mail != null) {
+ oprot.writeFieldBegin(MAIL_FIELD_DESC);
+ oprot.writeString(struct.mail);
+ oprot.writeFieldEnd();
+ }
+ if (struct.firstName != null) {
+ oprot.writeFieldBegin(FIRST_NAME_FIELD_DESC);
+ oprot.writeString(struct.firstName);
+ oprot.writeFieldEnd();
+ }
+ if (struct.lastName != null) {
+ oprot.writeFieldBegin(LAST_NAME_FIELD_DESC);
+ oprot.writeString(struct.lastName);
+ oprot.writeFieldEnd();
+ }
+ if (struct.username != null) {
+ oprot.writeFieldBegin(USERNAME_FIELD_DESC);
+ oprot.writeString(struct.username);
+ oprot.writeFieldEnd();
+ }
+ if (struct.imagename != null) {
+ oprot.writeFieldBegin(IMAGENAME_FIELD_DESC);
+ oprot.writeString(struct.imagename);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class writeImageRights_argsTupleSchemeFactory implements SchemeFactory {
+ public writeImageRights_argsTupleScheme getScheme() {
+ return new writeImageRights_argsTupleScheme();
+ }
+ }
+
+ private static class writeImageRights_argsTupleScheme extends TupleScheme<writeImageRights_args> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, writeImageRights_args struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetImagename()) {
+ optionals.set(0);
+ }
+ if (struct.isSetUsername()) {
+ optionals.set(1);
+ }
+ if (struct.isSetLastName()) {
+ optionals.set(2);
+ }
+ if (struct.isSetFirstName()) {
+ optionals.set(3);
+ }
+ if (struct.isSetMail()) {
+ optionals.set(4);
+ }
+ if (struct.isSetUniversity()) {
+ optionals.set(5);
+ }
+ if (struct.isSetRole()) {
+ optionals.set(6);
+ }
+ oprot.writeBitSet(optionals, 7);
+ if (struct.isSetImagename()) {
+ oprot.writeString(struct.imagename);
+ }
+ if (struct.isSetUsername()) {
+ oprot.writeString(struct.username);
+ }
+ if (struct.isSetLastName()) {
+ oprot.writeString(struct.lastName);
+ }
+ if (struct.isSetFirstName()) {
+ oprot.writeString(struct.firstName);
+ }
+ if (struct.isSetMail()) {
+ oprot.writeString(struct.mail);
+ }
+ if (struct.isSetUniversity()) {
+ oprot.writeString(struct.university);
+ }
+ if (struct.isSetRole()) {
+ oprot.writeString(struct.role);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, writeImageRights_args struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(7);
+ if (incoming.get(0)) {
+ struct.imagename = iprot.readString();
+ struct.setImagenameIsSet(true);
+ }
+ if (incoming.get(1)) {
+ struct.username = iprot.readString();
+ struct.setUsernameIsSet(true);
+ }
+ if (incoming.get(2)) {
+ struct.lastName = iprot.readString();
+ struct.setLastNameIsSet(true);
+ }
+ if (incoming.get(3)) {
+ struct.firstName = iprot.readString();
+ struct.setFirstNameIsSet(true);
+ }
+ if (incoming.get(4)) {
+ struct.mail = iprot.readString();
+ struct.setMailIsSet(true);
+ }
+ if (incoming.get(5)) {
+ struct.university = iprot.readString();
+ struct.setUniversityIsSet(true);
+ }
+ if (incoming.get(6)) {
+ struct.role = iprot.readString();
+ struct.setRoleIsSet(true);
+ }
+ }
+ }
+
+ }
+
+ public static class writeImageRights_result implements org.apache.thrift.TBase<writeImageRights_result, writeImageRights_result._Fields>, java.io.Serializable, Cloneable, Comparable<writeImageRights_result> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("writeImageRights_result");
+
+ private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new writeImageRights_resultStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new writeImageRights_resultTupleSchemeFactory());
+ }
+
+ public boolean success; // required
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ SUCCESS((short)0, "success");
+
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+ static {
+ for (_Fields field : EnumSet.allOf(_Fields.class)) {
+ byName.put(field.getFieldName(), field);
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, or null if its not found.
+ */
+ public static _Fields findByThriftId(int fieldId) {
+ switch(fieldId) {
+ case 0: // SUCCESS
+ return SUCCESS;
+ default:
+ return null;
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, throwing an exception
+ * if it is not found.
+ */
+ public static _Fields findByThriftIdOrThrow(int fieldId) {
+ _Fields fields = findByThriftId(fieldId);
+ if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+ return fields;
+ }
+
+ /**
+ * Find the _Fields constant that matches name, or null if its not found.
+ */
+ public static _Fields findByName(String name) {
+ return byName.get(name);
+ }
+
+ private final short _thriftId;
+ private final String _fieldName;
+
+ _Fields(short thriftId, String fieldName) {
+ _thriftId = thriftId;
+ _fieldName = fieldName;
+ }
+
+ public short getThriftFieldId() {
+ return _thriftId;
+ }
+
+ public String getFieldName() {
+ return _fieldName;
+ }
+ }
+
+ // isset id assignments
+ private static final int __SUCCESS_ISSET_ID = 0;
+ private byte __isset_bitfield = 0;
+ public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+ static {
+ Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+ tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(writeImageRights_result.class, metaDataMap);
+ }
+
+ public writeImageRights_result() {
+ }
+
+ public writeImageRights_result(
+ boolean success)
+ {
+ this();
+ this.success = success;
+ setSuccessIsSet(true);
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public writeImageRights_result(writeImageRights_result other) {
+ __isset_bitfield = other.__isset_bitfield;
+ this.success = other.success;
+ }
+
+ public writeImageRights_result deepCopy() {
+ return new writeImageRights_result(this);
+ }
+
+ @Override
+ public void clear() {
+ setSuccessIsSet(false);
+ this.success = false;
+ }
+
+ public boolean isSuccess() {
+ return this.success;
+ }
+
+ public writeImageRights_result setSuccess(boolean success) {
+ this.success = success;
+ setSuccessIsSet(true);
+ return this;
+ }
+
+ public void unsetSuccess() {
+ __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID);
+ }
+
+ /** Returns true if field success is set (has been assigned a value) and false otherwise */
+ public boolean isSetSuccess() {
+ return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);
+ }
+
+ public void setSuccessIsSet(boolean value) {
+ __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value);
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case SUCCESS:
+ if (value == null) {
+ unsetSuccess();
+ } else {
+ setSuccess((Boolean)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case SUCCESS:
+ return Boolean.valueOf(isSuccess());
+
+ }
+ throw new IllegalStateException();
+ }
+
+ /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+ public boolean isSet(_Fields field) {
+ if (field == null) {
+ throw new IllegalArgumentException();
+ }
+
+ switch (field) {
+ case SUCCESS:
+ return isSetSuccess();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof writeImageRights_result)
+ return this.equals((writeImageRights_result)that);
+ return false;
+ }
+
+ public boolean equals(writeImageRights_result that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_success = true;
+ boolean that_present_success = true;
+ if (this_present_success || that_present_success) {
+ if (!(this_present_success && that_present_success))
+ return false;
+ if (this.success != that.success)
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ @Override
+ public int compareTo(writeImageRights_result other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetSuccess()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ return 0;
+ }
+
+ public _Fields fieldForId(int fieldId) {
+ return _Fields.findByThriftId(fieldId);
+ }
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("writeImageRights_result(");
+ boolean first = true;
+
+ sb.append("success:");
+ sb.append(this.success);
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ // check for sub-struct validity
+ }
+
+ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+ try {
+ write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+ try {
+ // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
+ __isset_bitfield = 0;
+ read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private static class writeImageRights_resultStandardSchemeFactory implements SchemeFactory {
+ public writeImageRights_resultStandardScheme getScheme() {
+ return new writeImageRights_resultStandardScheme();
+ }
+ }
+
+ private static class writeImageRights_resultStandardScheme extends StandardScheme<writeImageRights_result> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, writeImageRights_result struct) throws org.apache.thrift.TException {
+ org.apache.thrift.protocol.TField schemeField;
+ iprot.readStructBegin();
+ while (true)
+ {
+ schemeField = iprot.readFieldBegin();
+ if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
+ break;
+ }
+ switch (schemeField.id) {
+ case 0: // SUCCESS
+ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
+ struct.success = iprot.readBool();
+ struct.setSuccessIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ default:
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ iprot.readFieldEnd();
+ }
+ iprot.readStructEnd();
+
+ // check for required fields of primitive type, which can't be checked in the validate method
+ struct.validate();
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot, writeImageRights_result struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.isSetSuccess()) {
+ oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
+ oprot.writeBool(struct.success);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class writeImageRights_resultTupleSchemeFactory implements SchemeFactory {
+ public writeImageRights_resultTupleScheme getScheme() {
+ return new writeImageRights_resultTupleScheme();
+ }
+ }
+
+ private static class writeImageRights_resultTupleScheme extends TupleScheme<writeImageRights_result> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, writeImageRights_result struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetSuccess()) {
+ optionals.set(0);
+ }
+ oprot.writeBitSet(optionals, 1);
+ if (struct.isSetSuccess()) {
+ oprot.writeBool(struct.success);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, writeImageRights_result struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(1);
+ if (incoming.get(0)) {
+ struct.success = iprot.readBool();
+ struct.setSuccessIsSet(true);
+ }
+ }
+ }
+
+ }
+
+ public static class writeLectureRights_args implements org.apache.thrift.TBase<writeLectureRights_args, writeLectureRights_args._Fields>, java.io.Serializable, Cloneable, Comparable<writeLectureRights_args> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("writeLectureRights_args");
+
+ private static final org.apache.thrift.protocol.TField LECTURENAME_FIELD_DESC = new org.apache.thrift.protocol.TField("lecturename", org.apache.thrift.protocol.TType.STRING, (short)-1);
+ private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)-2);
+ private static final org.apache.thrift.protocol.TField LAST_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("lastName", org.apache.thrift.protocol.TType.STRING, (short)-3);
+ private static final org.apache.thrift.protocol.TField FIRST_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("firstName", org.apache.thrift.protocol.TType.STRING, (short)-4);
+ private static final org.apache.thrift.protocol.TField MAIL_FIELD_DESC = new org.apache.thrift.protocol.TField("mail", org.apache.thrift.protocol.TType.STRING, (short)-5);
+ private static final org.apache.thrift.protocol.TField UNIVERSITY_FIELD_DESC = new org.apache.thrift.protocol.TField("university", org.apache.thrift.protocol.TType.STRING, (short)-6);
+ private static final org.apache.thrift.protocol.TField ROLE_FIELD_DESC = new org.apache.thrift.protocol.TField("role", org.apache.thrift.protocol.TType.STRING, (short)-7);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new writeLectureRights_argsStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new writeLectureRights_argsTupleSchemeFactory());
+ }
+
+ public String lecturename; // required
+ public String username; // required
+ public String lastName; // required
+ public String firstName; // required
+ public String mail; // required
+ public String university; // required
+ public String role; // required
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ LECTURENAME((short)-1, "lecturename"),
+ USERNAME((short)-2, "username"),
+ LAST_NAME((short)-3, "lastName"),
+ FIRST_NAME((short)-4, "firstName"),
+ MAIL((short)-5, "mail"),
+ UNIVERSITY((short)-6, "university"),
+ ROLE((short)-7, "role");
+
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+ static {
+ for (_Fields field : EnumSet.allOf(_Fields.class)) {
+ byName.put(field.getFieldName(), field);
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, or null if its not found.
+ */
+ public static _Fields findByThriftId(int fieldId) {
+ switch(fieldId) {
+ case -1: // LECTURENAME
+ return LECTURENAME;
+ case -2: // USERNAME
+ return USERNAME;
+ case -3: // LAST_NAME
+ return LAST_NAME;
+ case -4: // FIRST_NAME
+ return FIRST_NAME;
+ case -5: // MAIL
+ return MAIL;
+ case -6: // UNIVERSITY
+ return UNIVERSITY;
+ case -7: // ROLE
+ return ROLE;
+ default:
+ return null;
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, throwing an exception
+ * if it is not found.
+ */
+ public static _Fields findByThriftIdOrThrow(int fieldId) {
+ _Fields fields = findByThriftId(fieldId);
+ if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+ return fields;
+ }
+
+ /**
+ * Find the _Fields constant that matches name, or null if its not found.
+ */
+ public static _Fields findByName(String name) {
+ return byName.get(name);
+ }
+
+ private final short _thriftId;
+ private final String _fieldName;
+
+ _Fields(short thriftId, String fieldName) {
+ _thriftId = thriftId;
+ _fieldName = fieldName;
+ }
+
+ public short getThriftFieldId() {
+ return _thriftId;
+ }
+
+ public String getFieldName() {
+ return _fieldName;
+ }
+ }
+
+ // isset id assignments
+ public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+ static {
+ Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+ tmpMap.put(_Fields.LECTURENAME, new org.apache.thrift.meta_data.FieldMetaData("lecturename", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.LAST_NAME, new org.apache.thrift.meta_data.FieldMetaData("lastName", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.FIRST_NAME, new org.apache.thrift.meta_data.FieldMetaData("firstName", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.MAIL, new org.apache.thrift.meta_data.FieldMetaData("mail", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.UNIVERSITY, new org.apache.thrift.meta_data.FieldMetaData("university", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.ROLE, new org.apache.thrift.meta_data.FieldMetaData("role", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(writeLectureRights_args.class, metaDataMap);
+ }
+
+ public writeLectureRights_args() {
+ }
+
+ public writeLectureRights_args(
+ String lecturename,
+ String username,
+ String lastName,
+ String firstName,
+ String mail,
+ String university,
+ String role)
+ {
+ this();
+ this.lecturename = lecturename;
+ this.username = username;
+ this.lastName = lastName;
+ this.firstName = firstName;
+ this.mail = mail;
+ this.university = university;
+ this.role = role;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public writeLectureRights_args(writeLectureRights_args other) {
+ if (other.isSetLecturename()) {
+ this.lecturename = other.lecturename;
+ }
+ if (other.isSetUsername()) {
+ this.username = other.username;
+ }
+ if (other.isSetLastName()) {
+ this.lastName = other.lastName;
+ }
+ if (other.isSetFirstName()) {
+ this.firstName = other.firstName;
+ }
+ if (other.isSetMail()) {
+ this.mail = other.mail;
+ }
+ if (other.isSetUniversity()) {
+ this.university = other.university;
+ }
+ if (other.isSetRole()) {
+ this.role = other.role;
+ }
+ }
+
+ public writeLectureRights_args deepCopy() {
+ return new writeLectureRights_args(this);
+ }
+
+ @Override
+ public void clear() {
+ this.lecturename = null;
+ this.username = null;
+ this.lastName = null;
+ this.firstName = null;
+ this.mail = null;
+ this.university = null;
+ this.role = null;
+ }
+
+ public String getLecturename() {
+ return this.lecturename;
+ }
+
+ public writeLectureRights_args setLecturename(String lecturename) {
+ this.lecturename = lecturename;
+ return this;
+ }
+
+ public void unsetLecturename() {
+ this.lecturename = null;
+ }
+
+ /** Returns true if field lecturename is set (has been assigned a value) and false otherwise */
+ public boolean isSetLecturename() {
+ return this.lecturename != null;
+ }
+
+ public void setLecturenameIsSet(boolean value) {
+ if (!value) {
+ this.lecturename = null;
+ }
+ }
+
+ public String getUsername() {
+ return this.username;
+ }
+
+ public writeLectureRights_args setUsername(String username) {
+ this.username = username;
+ return this;
+ }
+
+ public void unsetUsername() {
+ this.username = null;
+ }
+
+ /** Returns true if field username is set (has been assigned a value) and false otherwise */
+ public boolean isSetUsername() {
+ return this.username != null;
+ }
+
+ public void setUsernameIsSet(boolean value) {
+ if (!value) {
+ this.username = null;
+ }
+ }
+
+ public String getLastName() {
+ return this.lastName;
+ }
+
+ public writeLectureRights_args setLastName(String lastName) {
+ this.lastName = lastName;
+ return this;
+ }
+
+ public void unsetLastName() {
+ this.lastName = null;
+ }
+
+ /** Returns true if field lastName is set (has been assigned a value) and false otherwise */
+ public boolean isSetLastName() {
+ return this.lastName != null;
+ }
+
+ public void setLastNameIsSet(boolean value) {
+ if (!value) {
+ this.lastName = null;
+ }
+ }
+
+ public String getFirstName() {
+ return this.firstName;
+ }
+
+ public writeLectureRights_args setFirstName(String firstName) {
+ this.firstName = firstName;
+ return this;
+ }
+
+ public void unsetFirstName() {
+ this.firstName = null;
+ }
+
+ /** Returns true if field firstName is set (has been assigned a value) and false otherwise */
+ public boolean isSetFirstName() {
+ return this.firstName != null;
+ }
+
+ public void setFirstNameIsSet(boolean value) {
+ if (!value) {
+ this.firstName = null;
+ }
+ }
+
+ public String getMail() {
+ return this.mail;
+ }
+
+ public writeLectureRights_args setMail(String mail) {
+ this.mail = mail;
+ return this;
+ }
+
+ public void unsetMail() {
+ this.mail = null;
+ }
+
+ /** Returns true if field mail is set (has been assigned a value) and false otherwise */
+ public boolean isSetMail() {
+ return this.mail != null;
+ }
+
+ public void setMailIsSet(boolean value) {
+ if (!value) {
+ this.mail = null;
+ }
+ }
+
+ public String getUniversity() {
+ return this.university;
+ }
+
+ public writeLectureRights_args setUniversity(String university) {
+ this.university = university;
+ return this;
+ }
+
+ public void unsetUniversity() {
+ this.university = null;
+ }
+
+ /** Returns true if field university is set (has been assigned a value) and false otherwise */
+ public boolean isSetUniversity() {
+ return this.university != null;
+ }
+
+ public void setUniversityIsSet(boolean value) {
+ if (!value) {
+ this.university = null;
+ }
+ }
+
+ public String getRole() {
+ return this.role;
+ }
+
+ public writeLectureRights_args setRole(String role) {
+ this.role = role;
+ return this;
+ }
+
+ public void unsetRole() {
+ this.role = null;
+ }
+
+ /** Returns true if field role is set (has been assigned a value) and false otherwise */
+ public boolean isSetRole() {
+ return this.role != null;
+ }
+
+ public void setRoleIsSet(boolean value) {
+ if (!value) {
+ this.role = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case LECTURENAME:
+ if (value == null) {
+ unsetLecturename();
+ } else {
+ setLecturename((String)value);
+ }
+ break;
+
+ case USERNAME:
+ if (value == null) {
+ unsetUsername();
+ } else {
+ setUsername((String)value);
+ }
+ break;
+
+ case LAST_NAME:
+ if (value == null) {
+ unsetLastName();
+ } else {
+ setLastName((String)value);
+ }
+ break;
+
+ case FIRST_NAME:
+ if (value == null) {
+ unsetFirstName();
+ } else {
+ setFirstName((String)value);
+ }
+ break;
+
+ case MAIL:
+ if (value == null) {
+ unsetMail();
+ } else {
+ setMail((String)value);
+ }
+ break;
+
+ case UNIVERSITY:
+ if (value == null) {
+ unsetUniversity();
+ } else {
+ setUniversity((String)value);
+ }
+ break;
+
+ case ROLE:
+ if (value == null) {
+ unsetRole();
+ } else {
+ setRole((String)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case LECTURENAME:
+ return getLecturename();
+
+ case USERNAME:
+ return getUsername();
+
+ case LAST_NAME:
+ return getLastName();
+
+ case FIRST_NAME:
+ return getFirstName();
+
+ case MAIL:
+ return getMail();
+
+ case UNIVERSITY:
+ return getUniversity();
+
+ case ROLE:
+ return getRole();
+
+ }
+ throw new IllegalStateException();
+ }
+
+ /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+ public boolean isSet(_Fields field) {
+ if (field == null) {
+ throw new IllegalArgumentException();
+ }
+
+ switch (field) {
+ case LECTURENAME:
+ return isSetLecturename();
+ case USERNAME:
+ return isSetUsername();
+ case LAST_NAME:
+ return isSetLastName();
+ case FIRST_NAME:
+ return isSetFirstName();
+ case MAIL:
+ return isSetMail();
+ case UNIVERSITY:
+ return isSetUniversity();
+ case ROLE:
+ return isSetRole();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof writeLectureRights_args)
+ return this.equals((writeLectureRights_args)that);
+ return false;
+ }
+
+ public boolean equals(writeLectureRights_args that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_lecturename = true && this.isSetLecturename();
+ boolean that_present_lecturename = true && that.isSetLecturename();
+ if (this_present_lecturename || that_present_lecturename) {
+ if (!(this_present_lecturename && that_present_lecturename))
+ return false;
+ if (!this.lecturename.equals(that.lecturename))
+ return false;
+ }
+
+ boolean this_present_username = true && this.isSetUsername();
+ boolean that_present_username = true && that.isSetUsername();
+ if (this_present_username || that_present_username) {
+ if (!(this_present_username && that_present_username))
+ return false;
+ if (!this.username.equals(that.username))
+ return false;
+ }
+
+ boolean this_present_lastName = true && this.isSetLastName();
+ boolean that_present_lastName = true && that.isSetLastName();
+ if (this_present_lastName || that_present_lastName) {
+ if (!(this_present_lastName && that_present_lastName))
+ return false;
+ if (!this.lastName.equals(that.lastName))
+ return false;
+ }
+
+ boolean this_present_firstName = true && this.isSetFirstName();
+ boolean that_present_firstName = true && that.isSetFirstName();
+ if (this_present_firstName || that_present_firstName) {
+ if (!(this_present_firstName && that_present_firstName))
+ return false;
+ if (!this.firstName.equals(that.firstName))
+ return false;
+ }
+
+ boolean this_present_mail = true && this.isSetMail();
+ boolean that_present_mail = true && that.isSetMail();
+ if (this_present_mail || that_present_mail) {
+ if (!(this_present_mail && that_present_mail))
+ return false;
+ if (!this.mail.equals(that.mail))
+ return false;
+ }
+
+ boolean this_present_university = true && this.isSetUniversity();
+ boolean that_present_university = true && that.isSetUniversity();
+ if (this_present_university || that_present_university) {
+ if (!(this_present_university && that_present_university))
+ return false;
+ if (!this.university.equals(that.university))
+ return false;
+ }
+
+ boolean this_present_role = true && this.isSetRole();
+ boolean that_present_role = true && that.isSetRole();
+ if (this_present_role || that_present_role) {
+ if (!(this_present_role && that_present_role))
+ return false;
+ if (!this.role.equals(that.role))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ @Override
+ public int compareTo(writeLectureRights_args other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ lastComparison = Boolean.valueOf(isSetLecturename()).compareTo(other.isSetLecturename());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetLecturename()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lecturename, other.lecturename);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetUsername()).compareTo(other.isSetUsername());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetUsername()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, other.username);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetLastName()).compareTo(other.isSetLastName());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetLastName()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lastName, other.lastName);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetFirstName()).compareTo(other.isSetFirstName());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetFirstName()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.firstName, other.firstName);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetMail()).compareTo(other.isSetMail());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetMail()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mail, other.mail);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetUniversity()).compareTo(other.isSetUniversity());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetUniversity()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.university, other.university);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetRole()).compareTo(other.isSetRole());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetRole()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.role, other.role);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ return 0;
+ }
+
+ public _Fields fieldForId(int fieldId) {
+ return _Fields.findByThriftId(fieldId);
+ }
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("writeLectureRights_args(");
+ boolean first = true;
+
+ sb.append("lecturename:");
+ if (this.lecturename == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.lecturename);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("username:");
+ if (this.username == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.username);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("lastName:");
+ if (this.lastName == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.lastName);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("firstName:");
+ if (this.firstName == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.firstName);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("mail:");
+ if (this.mail == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.mail);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("university:");
+ if (this.university == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.university);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("role:");
+ if (this.role == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.role);
+ }
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ // check for sub-struct validity
+ }
+
+ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+ try {
+ write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+ try {
+ read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private static class writeLectureRights_argsStandardSchemeFactory implements SchemeFactory {
+ public writeLectureRights_argsStandardScheme getScheme() {
+ return new writeLectureRights_argsStandardScheme();
+ }
+ }
+
+ private static class writeLectureRights_argsStandardScheme extends StandardScheme<writeLectureRights_args> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, writeLectureRights_args struct) throws org.apache.thrift.TException {
+ org.apache.thrift.protocol.TField schemeField;
+ iprot.readStructBegin();
+ while (true)
+ {
+ schemeField = iprot.readFieldBegin();
+ if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
+ break;
+ }
+ switch (schemeField.id) {
+ case -1: // LECTURENAME
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.lecturename = iprot.readString();
+ struct.setLecturenameIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case -2: // USERNAME
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.username = iprot.readString();
+ struct.setUsernameIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case -3: // LAST_NAME
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.lastName = iprot.readString();
+ struct.setLastNameIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case -4: // FIRST_NAME
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.firstName = iprot.readString();
+ struct.setFirstNameIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case -5: // MAIL
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.mail = iprot.readString();
+ struct.setMailIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case -6: // UNIVERSITY
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.university = iprot.readString();
+ struct.setUniversityIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case -7: // ROLE
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.role = iprot.readString();
+ struct.setRoleIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ default:
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ iprot.readFieldEnd();
+ }
+ iprot.readStructEnd();
+
+ // check for required fields of primitive type, which can't be checked in the validate method
+ struct.validate();
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot, writeLectureRights_args struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.role != null) {
+ oprot.writeFieldBegin(ROLE_FIELD_DESC);
+ oprot.writeString(struct.role);
+ oprot.writeFieldEnd();
+ }
+ if (struct.university != null) {
+ oprot.writeFieldBegin(UNIVERSITY_FIELD_DESC);
+ oprot.writeString(struct.university);
+ oprot.writeFieldEnd();
+ }
+ if (struct.mail != null) {
+ oprot.writeFieldBegin(MAIL_FIELD_DESC);
+ oprot.writeString(struct.mail);
+ oprot.writeFieldEnd();
+ }
+ if (struct.firstName != null) {
+ oprot.writeFieldBegin(FIRST_NAME_FIELD_DESC);
+ oprot.writeString(struct.firstName);
+ oprot.writeFieldEnd();
+ }
+ if (struct.lastName != null) {
+ oprot.writeFieldBegin(LAST_NAME_FIELD_DESC);
+ oprot.writeString(struct.lastName);
+ oprot.writeFieldEnd();
+ }
+ if (struct.username != null) {
+ oprot.writeFieldBegin(USERNAME_FIELD_DESC);
+ oprot.writeString(struct.username);
+ oprot.writeFieldEnd();
+ }
+ if (struct.lecturename != null) {
+ oprot.writeFieldBegin(LECTURENAME_FIELD_DESC);
+ oprot.writeString(struct.lecturename);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class writeLectureRights_argsTupleSchemeFactory implements SchemeFactory {
+ public writeLectureRights_argsTupleScheme getScheme() {
+ return new writeLectureRights_argsTupleScheme();
+ }
+ }
+
+ private static class writeLectureRights_argsTupleScheme extends TupleScheme<writeLectureRights_args> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, writeLectureRights_args struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetLecturename()) {
+ optionals.set(0);
+ }
+ if (struct.isSetUsername()) {
+ optionals.set(1);
+ }
+ if (struct.isSetLastName()) {
+ optionals.set(2);
+ }
+ if (struct.isSetFirstName()) {
+ optionals.set(3);
+ }
+ if (struct.isSetMail()) {
+ optionals.set(4);
+ }
+ if (struct.isSetUniversity()) {
+ optionals.set(5);
+ }
+ if (struct.isSetRole()) {
+ optionals.set(6);
+ }
+ oprot.writeBitSet(optionals, 7);
+ if (struct.isSetLecturename()) {
+ oprot.writeString(struct.lecturename);
+ }
+ if (struct.isSetUsername()) {
+ oprot.writeString(struct.username);
+ }
+ if (struct.isSetLastName()) {
+ oprot.writeString(struct.lastName);
+ }
+ if (struct.isSetFirstName()) {
+ oprot.writeString(struct.firstName);
+ }
+ if (struct.isSetMail()) {
+ oprot.writeString(struct.mail);
+ }
+ if (struct.isSetUniversity()) {
+ oprot.writeString(struct.university);
+ }
+ if (struct.isSetRole()) {
+ oprot.writeString(struct.role);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, writeLectureRights_args struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(7);
+ if (incoming.get(0)) {
+ struct.lecturename = iprot.readString();
+ struct.setLecturenameIsSet(true);
+ }
+ if (incoming.get(1)) {
+ struct.username = iprot.readString();
+ struct.setUsernameIsSet(true);
+ }
+ if (incoming.get(2)) {
+ struct.lastName = iprot.readString();
+ struct.setLastNameIsSet(true);
+ }
+ if (incoming.get(3)) {
+ struct.firstName = iprot.readString();
+ struct.setFirstNameIsSet(true);
+ }
+ if (incoming.get(4)) {
+ struct.mail = iprot.readString();
+ struct.setMailIsSet(true);
+ }
+ if (incoming.get(5)) {
+ struct.university = iprot.readString();
+ struct.setUniversityIsSet(true);
+ }
+ if (incoming.get(6)) {
+ struct.role = iprot.readString();
+ struct.setRoleIsSet(true);
+ }
+ }
+ }
+
+ }
+
+ public static class writeLectureRights_result implements org.apache.thrift.TBase<writeLectureRights_result, writeLectureRights_result._Fields>, java.io.Serializable, Cloneable, Comparable<writeLectureRights_result> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("writeLectureRights_result");
+
+ private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new writeLectureRights_resultStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new writeLectureRights_resultTupleSchemeFactory());
+ }
+
+ public boolean success; // required
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ SUCCESS((short)0, "success");
+
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+ static {
+ for (_Fields field : EnumSet.allOf(_Fields.class)) {
+ byName.put(field.getFieldName(), field);
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, or null if its not found.
+ */
+ public static _Fields findByThriftId(int fieldId) {
+ switch(fieldId) {
+ case 0: // SUCCESS
+ return SUCCESS;
+ default:
+ return null;
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, throwing an exception
+ * if it is not found.
+ */
+ public static _Fields findByThriftIdOrThrow(int fieldId) {
+ _Fields fields = findByThriftId(fieldId);
+ if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+ return fields;
+ }
+
+ /**
+ * Find the _Fields constant that matches name, or null if its not found.
+ */
+ public static _Fields findByName(String name) {
+ return byName.get(name);
+ }
+
+ private final short _thriftId;
+ private final String _fieldName;
+
+ _Fields(short thriftId, String fieldName) {
+ _thriftId = thriftId;
+ _fieldName = fieldName;
+ }
+
+ public short getThriftFieldId() {
+ return _thriftId;
+ }
+
+ public String getFieldName() {
+ return _fieldName;
+ }
+ }
+
+ // isset id assignments
+ private static final int __SUCCESS_ISSET_ID = 0;
+ private byte __isset_bitfield = 0;
+ public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+ static {
+ Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+ tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(writeLectureRights_result.class, metaDataMap);
+ }
+
+ public writeLectureRights_result() {
+ }
+
+ public writeLectureRights_result(
+ boolean success)
+ {
+ this();
+ this.success = success;
+ setSuccessIsSet(true);
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public writeLectureRights_result(writeLectureRights_result other) {
+ __isset_bitfield = other.__isset_bitfield;
+ this.success = other.success;
+ }
+
+ public writeLectureRights_result deepCopy() {
+ return new writeLectureRights_result(this);
+ }
+
+ @Override
+ public void clear() {
+ setSuccessIsSet(false);
+ this.success = false;
+ }
+
+ public boolean isSuccess() {
+ return this.success;
+ }
+
+ public writeLectureRights_result setSuccess(boolean success) {
+ this.success = success;
+ setSuccessIsSet(true);
+ return this;
+ }
+
+ public void unsetSuccess() {
+ __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID);
+ }
+
+ /** Returns true if field success is set (has been assigned a value) and false otherwise */
+ public boolean isSetSuccess() {
+ return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);
+ }
+
+ public void setSuccessIsSet(boolean value) {
+ __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value);
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case SUCCESS:
+ if (value == null) {
+ unsetSuccess();
+ } else {
+ setSuccess((Boolean)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case SUCCESS:
+ return Boolean.valueOf(isSuccess());
+
+ }
+ throw new IllegalStateException();
+ }
+
+ /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+ public boolean isSet(_Fields field) {
+ if (field == null) {
+ throw new IllegalArgumentException();
+ }
+
+ switch (field) {
+ case SUCCESS:
+ return isSetSuccess();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof writeLectureRights_result)
+ return this.equals((writeLectureRights_result)that);
+ return false;
+ }
+
+ public boolean equals(writeLectureRights_result that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_success = true;
+ boolean that_present_success = true;
+ if (this_present_success || that_present_success) {
+ if (!(this_present_success && that_present_success))
+ return false;
+ if (this.success != that.success)
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ @Override
+ public int compareTo(writeLectureRights_result other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetSuccess()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ return 0;
+ }
+
+ public _Fields fieldForId(int fieldId) {
+ return _Fields.findByThriftId(fieldId);
+ }
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("writeLectureRights_result(");
+ boolean first = true;
+
+ sb.append("success:");
+ sb.append(this.success);
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ // check for sub-struct validity
+ }
+
+ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+ try {
+ write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+ try {
+ // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
+ __isset_bitfield = 0;
+ read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private static class writeLectureRights_resultStandardSchemeFactory implements SchemeFactory {
+ public writeLectureRights_resultStandardScheme getScheme() {
+ return new writeLectureRights_resultStandardScheme();
+ }
+ }
+
+ private static class writeLectureRights_resultStandardScheme extends StandardScheme<writeLectureRights_result> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, writeLectureRights_result struct) throws org.apache.thrift.TException {
+ org.apache.thrift.protocol.TField schemeField;
+ iprot.readStructBegin();
+ while (true)
+ {
+ schemeField = iprot.readFieldBegin();
+ if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
+ break;
+ }
+ switch (schemeField.id) {
+ case 0: // SUCCESS
+ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
+ struct.success = iprot.readBool();
+ struct.setSuccessIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ default:
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ iprot.readFieldEnd();
+ }
+ iprot.readStructEnd();
+
+ // check for required fields of primitive type, which can't be checked in the validate method
+ struct.validate();
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot, writeLectureRights_result struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.isSetSuccess()) {
+ oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
+ oprot.writeBool(struct.success);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class writeLectureRights_resultTupleSchemeFactory implements SchemeFactory {
+ public writeLectureRights_resultTupleScheme getScheme() {
+ return new writeLectureRights_resultTupleScheme();
+ }
+ }
+
+ private static class writeLectureRights_resultTupleScheme extends TupleScheme<writeLectureRights_result> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, writeLectureRights_result struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetSuccess()) {
+ optionals.set(0);
+ }
+ oprot.writeBitSet(optionals, 1);
+ if (struct.isSetSuccess()) {
+ oprot.writeBool(struct.success);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, writeLectureRights_result struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(1);
+ if (incoming.get(0)) {
+ struct.success = iprot.readBool();
+ struct.setSuccessIsSet(true);
+ }
+ }
+ }
+
+ }
+
}
diff --git a/Dozentenmodulserver/src/main/java/server/ServerHandler.java b/Dozentenmodulserver/src/main/java/server/ServerHandler.java
index 6534ca3d..35b9579a 100644
--- a/Dozentenmodulserver/src/main/java/server/ServerHandler.java
+++ b/Dozentenmodulserver/src/main/java/server/ServerHandler.java
@@ -20,6 +20,9 @@ import models.Configuration;
import org.apache.commons.io.FileUtils;
import org.apache.log4j.Logger;
import org.apache.thrift.TException;
+
+import com.mysql.jdbc.StringUtils;
+
import sql.SQL;
import util.XMLCreator;
@@ -156,11 +159,11 @@ public class ServerHandler implements Server.Iface {
}
@Override
- public boolean writeVLdata(String imagename, String login,
+ public boolean writeVLdata(String imagename, String desc ,String login,
String firstname, String lastname, String university, String Mail,
String Tel, String Fak, boolean license, boolean internet,
long ram, long cpu, String imagePath, boolean isTemplate,
- long filesize, long shareMode) throws TException {
+ long filesize, long shareMode, String os) throws TException {
String mode=null;
@@ -177,8 +180,12 @@ public class ServerHandler implements Server.Iface {
String pk_person = sql.setPerson(login, lastname, firstname, Mail,
new Date(), pk_institution);
- sql.setImageData(pk_person, license, internet, cpu, ram, imagename,
- imagePath, isTemplate, filesize,mode);
+ //OS impl Select and write
+ //ACHTUNG: Anzahl der Leerzeichen muss eingehalten werden: 'Windows 7 32 bit"
+ String pk_os=sql.getOSpk(os.substring(0, nthIndexOf(os, " ", 2)),os.substring(nthIndexOf(os," ", 2), os.lastIndexOf(" ")).replace(" ", ""));
+
+ sql.setImageData(pk_person, license, internet, cpu, ram, imagename,desc,
+ imagePath, isTemplate, filesize,mode,pk_os);
log.info(new Date() + " - written VLdata");
// TODO Auto-generated method stub
@@ -276,10 +283,10 @@ public class ServerHandler implements Server.Iface {
}
@Override
- public boolean updateImageData(String name, String newName,
+ public boolean updateImageData(String name, String newName,String desc,
String image_path, boolean license, boolean internet, long ram,
long cpu, String id, String version, boolean isTemplate,
- long filesize, long shareMode) throws TException {
+ long filesize, long shareMode, String os) throws TException {
String mode=null;
if(shareMode==0)
@@ -289,17 +296,14 @@ public class ServerHandler implements Server.Iface {
else{
mode="to_be_published";
}
- sql.UpdateImageData(name, newName, image_path, license, internet, cpu,
- ram, id, version, isTemplate, filesize,mode);
+ String pk_os=sql.getOSpk(os.substring(0, nthIndexOf(os, " ", 2)),os.substring(nthIndexOf(os," ", 2), os.lastIndexOf(" ")).replace(" ", ""));
+ sql.UpdateImageData(name, newName,desc ,image_path, license, internet, cpu,
+ ram, id, version, isTemplate, filesize,mode,pk_os);
return false;
}
- @Override
- public Map<String, String> getLectureData(String lecturename)
- throws TException {
- // TODO Auto-generated method stub
- return null;
- }
+
+
@Override
public List<Lecture> getLectureList() throws TException {
@@ -315,18 +319,26 @@ public class ServerHandler implements Server.Iface {
@Override
public boolean updateLecturedata(String name, String newName,
String shortdesc, String desc, String startDate, String endDate,
- boolean isActive, String imagename, String firstname,
+ boolean isActive, String imageid,String imageversion,String user ,String firstname,
String lastname, String university, String Mail, String Tel,
String Fak, String id) throws TException {
- String pk_image = "";
- int imageversion = 0;
- Map<String, String> image = sql.getImageIDandVersion(imagename);
-
- pk_image = image.get("GUID");
- imageversion = Integer.parseInt(image.get("version"));
- sql.updateLectureData(pk_image, imageversion, lastname, newName, desc,
+ Map<String, String> map = new HashMap<String, String>();
+ map = sql.getDeleteXMLData(id);
+ sql.updateLectureData(imageid, imageversion, lastname, newName, desc,
shortdesc, startDate, endDate, isActive, id);
+ String path = Configuration.config.getAbsolute_path()
+ + "prod/"
+ + map.get("date")
+ .substring(0, map.get("date").length() - 2) + "_"
+ + university + "_" + user + "_" + map.get("name") + ".xml";
+ File tmpFile=new File(path);
+ try {
+ FileUtils.forceDelete(tmpFile);
+ } catch (IOException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
XMLCreator xml = new XMLCreator(sql.getConnection(), newName);
try {
xml.create(newName);
@@ -336,8 +348,6 @@ public class ServerHandler implements Server.Iface {
e.printStackTrace();
}
- // sql.updateLectureData(con, pk_image, imageversion, lastname, newName,
- // desc, shortdesc, startDate, endDate, isActive, id);
return false;
}
@@ -384,7 +394,7 @@ public class ServerHandler implements Server.Iface {
try {
String path = Configuration.config.getAbsolute_path()
- + "temp/"
+ + "prod/"
+ map.get("date")
.substring(0, map.get("date").length() - 2) + "_"
+ hs + "_" + user + "_" + map.get("name") + ".xml";
@@ -403,5 +413,135 @@ public class ServerHandler implements Server.Iface {
return sql.getAllUniversities();
}
+
+ @Override
+ public Map<String, String> getLectureData(String lectureid)
+ throws TException {
+ log.info(new Date() + " - returning LectureData: "
+ + sql.getLectureData(lectureid).size() + "items.");
+ return sql.getLectureData(lectureid);
+ }
+
+
+
+
+ public static int nthIndexOf(final String string, final String token,
+ final int index)
+ {
+ int j = 0;
+
+ for (int i = 0; i < index; i++)
+ {
+ j = string.indexOf(token, j + 1);
+ if (j == -1) break;
+ }
+
+ return j;
+ }
+
+ @Override
+ public boolean checkUser(String username) throws TException {
+ return sql.checkUser(username);
+
+ }
+
+ @Override
+ public boolean createUser(String loginName, String lastName,
+ String firstName, String mail, String university) throws TException {
+ String pk_institution = sql.setInstitution(university);
+ String pk_person = sql.setPerson(loginName, lastName, firstName, mail,
+ new Date(), pk_institution);
+ return true;
+ }
+
+ @Override
+ public boolean writeImageRights(String imagename, String username, String lastName, String firstName, String mail, String university, String role)
+ throws TException {
+ String pk_image = null;
+ Map<String, String> map = new HashMap<String, String>();
+ int imageversion = 0;
+ String pk_institution = sql.setInstitution(university);
+ String pk_person = sql.setPerson(username, lastName, firstName, mail,
+ new Date(), pk_institution);
+ map = sql.getImageIDandVersion(imagename);
+ pk_image = map.get("GUID");
+ imageversion = Integer.parseInt(map.get("version"));
+
+ if(role.equals("Dozent")) {
+ int read=1;
+ int write=1;
+ int changePermission=0;
+ int admin=0;
+ int linkallowed=1;
+ int roleID=sql.getRoleID(role);
+
+ sql.setImageRights(pk_person, pk_image, roleID, read, write, changePermission, admin, linkallowed);
+
+ }else if(role.equals("Admin")){
+ int read=1;
+ int write=1;
+ int changePermission=1;
+ int admin=1;
+ int linkallowed=1;
+ int roleID=sql.getRoleID(role);
+
+ sql.setImageRights(pk_person, pk_image, roleID, read, write, changePermission, admin, linkallowed);
+ }
+ else{
+ int read=1;
+ int write=0;
+ int changePermission=0;
+ int admin=0;
+ int linkallowed=0;
+ int roleID=sql.getRoleID(role);
+
+ sql.setImageRights(pk_person, pk_image, roleID, read, write, changePermission, admin, linkallowed);
+ }
+
+ return true;
+ }
+
+ @Override
+ public boolean writeLectureRights(String lecturename, String username,
+ String lastName, String firstName, String mail, String university,
+ String role) throws TException {
+ String pk_lecture = null;
+
+ String pk_institution = sql.setInstitution(university);
+ String pk_person = sql.setPerson(username, lastName, firstName, mail,
+ new Date(), pk_institution);
+ pk_lecture=sql.getLectureID(lecturename);
+
+ if(role.equals("Dozent")) {
+ int read=1;
+ int write=1;
+ int changePermission=0;
+ int admin=0;
+ int roleID=sql.getRoleID(role);
+
+ sql.setLectureRights(pk_person, pk_lecture, roleID, read, write, changePermission, admin);
+
+ }else if(role.equals("Admin")){
+ int read=1;
+ int write=1;
+ int changePermission=1;
+ int admin=1;
+ int roleID=sql.getRoleID(role);
+
+ sql.setLectureRights(pk_person, pk_lecture, roleID, read, write, changePermission, admin);
+ }
+ else{
+ int read=0;
+ int write=0;
+ int changePermission=0;
+ int admin=0;
+ int roleID=sql.getRoleID(role);
+
+ sql.setLectureRights(pk_person, pk_lecture, roleID, read, write, changePermission, admin);
+ }
+
+ return true;
+ }
+
}
diff --git a/Dozentenmodulserver/src/main/java/server/StartServer.java b/Dozentenmodulserver/src/main/java/server/StartServer.java
index 4d5019e6..7280ee99 100644
--- a/Dozentenmodulserver/src/main/java/server/StartServer.java
+++ b/Dozentenmodulserver/src/main/java/server/StartServer.java
@@ -5,62 +5,44 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
-
import models.Configuration;
-
import org.apache.log4j.BasicConfigurator;
import org.apache.log4j.Logger;
import org.ini4j.InvalidFileFormatException;
import org.ini4j.Wini;
-
-
import server.BinaryListener;
-import org.apache.thrift.protocol.TProtocolFactory;
-import org.apache.thrift.server.TServer;
-import org.apache.thrift.server.TThreadPoolServer;
-import org.apache.thrift.transport.TServerSocket;
-import org.apache.thrift.transport.TServerTransport;
-import org.apache.thrift.transport.TTransportException;
-import org.apache.thrift.server.TThreadPoolServer.Args;
+
public class StartServer {
/**
* @param args
*/
-
- private static Logger log = Logger.getLogger( StartServer.class );
+
+ private static Logger log = Logger.getLogger(StartServer.class);
private static List<Thread> servers = new ArrayList<>();
-
-
+
public static void main(String[] args) {
-
-
- //final ImageServerHandler handler = new ImageServerHandler();
- //final ImageServer.Processor<ImageServerHandler> processor = new ImageServer.Processor<ImageServerHandler>(handler);
-
- /*
- try{
- TServerTransport serverTransport = new TServerSocket(9090);
- //TServer server = new TSimpleServer(new Args(serverTransport).processor(processor));
- TServer server = new TThreadPoolServer(new TThreadPoolServer.Args(serverTransport).processor(processor));
- server.serve();
- } catch (Exception e){
- e.printStackTrace();
- }
- */
-
- //deprecated
+ String version = "Version: 1.03";
+ String buildDate = "Build Date: 09.09.2014";
+
+ //get going and show basic information in logfile
+ BasicConfigurator.configure();
+ log.info("***** " + new Date() + " - starting Application *****");
+ log.info(new Date() + " - "+version+" , "+buildDate);
- //get Configuration
+ // get Configuration
try {
- Wini ini=new Wini(new File("Server_Config.ini"));
- Configuration.config.setAbsolute_path(ini.get("ftp", "path_absolute"));
- Configuration.config.setSql_connection(ini.get("sql", "connection"));
+ log.info(new Date() + " - Getting config from .ini-file");
+ Wini ini = new Wini(new File("Server_Config.ini"));
+ Configuration.config.setAbsolute_path(ini.get("ftp",
+ "path_absolute"));
+ Configuration.config
+ .setSql_connection(ini.get("sql", "connection"));
Configuration.config.setSql_pass(ini.get("sql", "pass"));
Configuration.config.setSql_user(ini.get("sql", "user"));
} catch (InvalidFileFormatException e1) {
@@ -70,32 +52,24 @@ public class StartServer {
// TODO Auto-generated catch block
e1.printStackTrace();
}
- //Start Server
-
- BasicConfigurator.configure();
- log.info("***** "+ new Date() + " - starting Application *****" );
+ // Start Server
Thread t;
t = new Thread(new BinaryListener());
servers.add(t);
t.start();
- //information
- //log.info( new Date()+" - new thread created. Now "+servers.size()+" thread(s).\n" );
- // Run more servers
- // ...
- // Wait for all servers to die
for (Thread wait : servers) {
boolean success = false;
while (!success) {
try {
wait.join();
success = true;
- } catch ( InterruptedException e ) {
+ } catch (InterruptedException e) {
// Do nothing...
}
}
}
- log.info( new Date()+" - all Servers shut down, exiting...\n" );
-
+ log.info(new Date() + " - all Servers shut down, exiting...\n");
+
}
}
diff --git a/Dozentenmodulserver/src/main/java/sql/SQL.java b/Dozentenmodulserver/src/main/java/sql/SQL.java
index ec768a40..9a115f09 100644
--- a/Dozentenmodulserver/src/main/java/sql/SQL.java
+++ b/Dozentenmodulserver/src/main/java/sql/SQL.java
@@ -3,8 +3,10 @@ package sql;
import java.sql.*;
import java.text.DateFormat;
+import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
+import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
@@ -230,8 +232,8 @@ public class SQL {
}
public boolean setImageData(String pk_person, boolean license,
- boolean internet, long cpu, long ram, String imagename,
- String imagePath, boolean isTemplate, long filesize, String shareMode) {
+ boolean internet, long cpu, long ram, String imagename,String desc,
+ String imagePath, boolean isTemplate, long filesize, String shareMode, String pk_os) {
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
@@ -249,10 +251,11 @@ public class SQL {
Statement stm = con.createStatement();
String uid = UUID.randomUUID().toString();
- stm.executeUpdate("INSERT INTO `bwLehrpool`.`m_VLData_imageInfo`(`GUID_imageID`,`imageVersion`,`image_name`,`image_path`,`image_lastCall`,`image_create_time`,`image_update_time`,`image_owner`,`image_change_by`,`rec_create_time`,`rec_change_time`,`rec_owner`,`rec_change_by`,`content_operatingSystem`,`status_isCompressed`,`status_isSecure`,`status_isOptimzed`,`status_isValid`,`status_isReady`,`status_isDeleted`,`status_isLastOfficialVersion`,`cond_hasLicenseRestriction`,`cond_hasInternetRestriction`,`cond_minRAM`,`cond_minCPUs`,`image_isTemplate`,`image_filesize`,`image_syncMode`)VALUES('"
+ stm.executeUpdate("INSERT INTO `bwLehrpool`.`m_VLData_imageInfo`(`GUID_imageID`,`imageVersion`,`image_name`,`image_description`,`image_path`,`image_lastCall`,`image_create_time`,`image_update_time`,`image_owner`,`image_change_by`,`rec_create_time`,`rec_change_time`,`rec_owner`,`rec_change_by`,`content_operatingSystem`,`status_isCompressed`,`status_isSecure`,`status_isOptimzed`,`status_isValid`,`status_isReady`,`status_isDeleted`,`status_isLastOfficialVersion`,`cond_hasLicenseRestriction`,`cond_hasInternetRestriction`,`cond_minRAM`,`cond_minCPUs`,`image_isTemplate`,`image_filesize`,`image_syncMode`)VALUES('"
+ uid // GUID_imageID
+ "',1,'" // imageVersion
+ imagename // image_name
+ + "','" +desc //image_description
+ "','" + imagePath // image_path
+ "','" + formatter.format(new Date()) // image_lastCall
+ "','" + formatter.format(new Date()) // image_create_time
@@ -263,8 +266,8 @@ public class SQL {
+ "','" + formatter.format(new Date()) // rec_change_time
+ "','" + pk_person // rec_owner
+ "','" + pk_person // rec_change_by
- + "',0" // content_operatingSystem
- + ",1" // status_isCompressed
+ + "','" + pk_os // content_operatingSystem
+ + "',1" // status_isCompressed
+ ",1" // status_isSecure
+ ",1" // status_isOptimzed
+ ",1" // status_isValid
@@ -296,22 +299,23 @@ public class SQL {
Statement stm;
List<Image> list = new ArrayList<Image>();
try {
+
stm = con.createStatement();
ResultSet res=stm
- .executeQuery("SELECT vl.GUID_imageID, vl.imageVersion,vl.image_name, vl.cond_hasLicenseRestriction, os.name, '' as lecture,vl.image_update_time, Concat(u.Nachname,' ',u.Vorname) as user FROM bwLehrpool.m_VLData_imageInfo vl, bwLehrpool.m_operatingSystem os, bwLehrpool.m_user u Where vl.content_operatingSystem=os.operatingSystemID and vl.image_owner=u.userID and vl.image_name not in (SELECT vl.image_name FROM bwLehrpool.m_VLData_imageInfo vl, bwLehrpool.m_operatingSystem os, bwLehrpool.m_VLData_lecture lect, bwLehrpool.m_user u Where vl.content_operatingSystem=os.operatingSystemID and lect.imageID=vl.GUID_imageID and vl.image_owner=u.userID) union SELECT vl.GUID_imageID, vl.imageVersion,vl.image_name, vl.cond_hasLicenseRestriction, os.name, lect.name as lecture, vl.image_update_time, Concat(u.Nachname,' ',u.Vorname) as user FROM bwLehrpool.m_VLData_imageInfo vl, bwLehrpool.m_operatingSystem os, bwLehrpool.m_VLData_lecture lect, bwLehrpool.m_user u Where vl.content_operatingSystem=os.operatingSystemID and lect.imageID=vl.GUID_imageID and vl.image_owner=u.userID;");
+ .executeQuery("SELECT vl.GUID_imageID, vl.imageVersion,vl.image_name, vl.cond_hasLicenseRestriction, os.name,os.architecture, '' as lecture,vl.image_update_time, Concat(u.Nachname,' ',u.Vorname) as user, vl.image_isTemplate FROM bwLehrpool.m_VLData_imageInfo vl, bwLehrpool.m_operatingSystem os, bwLehrpool.m_user u Where vl.content_operatingSystem=os.operatingSystemID and vl.image_owner=u.userID and vl.image_name not in (SELECT vl.image_name FROM bwLehrpool.m_VLData_imageInfo vl, bwLehrpool.m_operatingSystem os, bwLehrpool.m_VLData_lecture lect, bwLehrpool.m_user u Where vl.content_operatingSystem=os.operatingSystemID and lect.imageID=vl.GUID_imageID and vl.image_owner=u.userID) union SELECT vl.GUID_imageID, vl.imageVersion,vl.image_name, vl.cond_hasLicenseRestriction, os.name,os.architecture, lect.name as lecture, vl.image_update_time, Concat(u.Nachname,' ',u.Vorname) as user, vl.image_isTemplate FROM bwLehrpool.m_VLData_imageInfo vl, bwLehrpool.m_operatingSystem os, bwLehrpool.m_VLData_lecture lect, bwLehrpool.m_user u Where vl.content_operatingSystem=os.operatingSystemID and lect.imageID=vl.GUID_imageID and vl.image_owner=u.userID;");
+
-
-
while (res.next()) {
-
+
+
list.add(new Image(res.getString("GUID_imageID"), res
.getString("imageVersion"),
res.getString("image_name"), res
.getString("cond_hasLicenseRestriction"), res
- .getString("name"), res.getString("lecture"),
+ .getString("name")+" "+res.getString("architecture")+" bit", res.getString("lecture"),
res.getString("image_update_time"), res
- .getString("user")));
+ .getString("user"), res.getString("image_isTemplate")));
}
@@ -319,7 +323,7 @@ public class SQL {
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
- }
+ }
return list;
@@ -358,9 +362,9 @@ public class SQL {
Connection con=getConnection();
Statement stm = con.createStatement();
ResultSet rs=stm
- .executeQuery("SELECT name FROM bwLehrpool.m_operatingSystem;");
+ .executeQuery("SELECT name, architecture FROM bwLehrpool.m_operatingSystem;");
while (rs.next()) {
- list.add(rs.getString("name"));
+ list.add(rs.getString("name")+" "+rs.getString("architecture")+" bit");
}
return list;
@@ -487,8 +491,7 @@ public class SQL {
Connection con=getConnection();
Statement stm = con.createStatement();
ResultSet data=stm
- .executeQuery("SELECT image_name,cond_hasInternetRestriction,cond_hasLicenseRestriction, cond_minCPUs, cond_minRAM, image_syncMode,image_filesize,image_path, image_isTemplate FROM bwLehrpool.m_VLData_imageInfo where GUID_imageID = '"
- + id + "' and imageVersion = '" + version + "' ;");
+ .executeQuery("SELECT u.mail, i.GUID_imageID, i.imageVersion, i.image_name,i.image_description,i.image_update_time,i.cond_hasInternetRestriction,i.cond_hasLicenseRestriction, i.cond_minCPUs,i.cond_minRAM, i.image_syncMode,i.image_filesize,i.image_path, i.image_isTemplate,os.GuestOS, concat(u.Nachname,' ',u.Vorname) as Owner FROM bwLehrpool.m_VLData_imageInfo i,bwLehrpool.m_user u,bwLehrpool.m_operatingSystem os where i.image_owner=u.userID and i.content_operatingSystem=os.operatingSystemID and GUID_imageID = '" + id + "' and imageVersion = '" + version + "' ;");
while (data.next()) {
map.put("name", data.getString("image_name"));
map.put("internet",
@@ -500,6 +503,14 @@ public class SQL {
map.put("filesize", data.getString("image_filesize"));
map.put("path", data.getString("image_path"));
map.put("template", data.getString("image_isTemplate"));
+ map.put("os",data.getString("GuestOS"));
+ map.put("owner", data.getString("Owner"));
+ map.put("lastupdate", data.getString("image_update_time"));
+ map.put("desc", data.getString("image_description"));
+ map.put("id", data.getString("GUID_imageID"));
+ map.put("version", data.getString("imageVersion"));
+ map.put("mail", data.getString("mail"));
+
}
con.close();
return map;
@@ -511,9 +522,9 @@ public class SQL {
return null;
}
- public int UpdateImageData(String name, String newName,String image_path,
+ public int UpdateImageData(String name, String newName,String desc,String image_path,
boolean license, boolean internet, long cpu, long ram, String id,
- String version, boolean isTemplate, long filesize, String shareMode) {
+ String version, boolean isTemplate, long filesize, String shareMode,String ospk) {
try {
Connection con=getConnection();
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
@@ -534,6 +545,8 @@ public class SQL {
+ newVersion
+ "',`image_name` = '"
+ newName
+ + "',`image_description` = '"
+ + desc
+ "',`image_path` = '"
+ image_path
+ "',`image_update_time` = '"
@@ -550,6 +563,8 @@ public class SQL {
+ cpu
+ "',`image_isTemplate` = '"
+ isTemplate
+ + "',`content_operatingSystem` = '"
+ + ospk
+ "',`image_filesize` = '"
+ filesize
+ "',`image_syncMode` = '"
@@ -591,7 +606,7 @@ public class SQL {
}
public int updateLectureData(String pk_image,
- int imageversion, String name, String newName, String desc,
+ String imageversion, String name, String newName, String desc,
String shortdesc, String start, String end, boolean isactive,
String id) {
@@ -644,8 +659,9 @@ public class SQL {
ResultSet rs = stm.executeQuery("SELECT lectureID FROM "
+ "bwLehrpool.m_VLData_lecture WHERE imageID = '" + id
+ "' AND imageVersion = '" + version + "';");
+ boolean ret=rs.first();
con.close();
- return rs.first();
+ return ret;
} catch (SQLException e) {
// TODO Auto-generated catch block
@@ -746,7 +762,7 @@ public class SQL {
return 0;
} catch (SQLException e) {
// TODO Auto-generated catch block
- log.info(new Date() + " - Failed to UpdateImageData.");
+ log.info(new Date() + " - Failed to UpdateImagePath.");
e.printStackTrace();
}
return -1;
@@ -773,4 +789,225 @@ public class SQL {
return null;
}
+
+ public String getOSpk(String os,
+ String architecture) {
+ try {
+ Connection con=getConnection();
+ Statement stm = con.createStatement();
+ log.info(new Date() + " - Getting PrimaryKey for OS: "+os+" architecture: "+architecture);
+ ResultSet rs=stm
+ .executeQuery("SELECT operatingSystemID FROM bwLehrpool.m_operatingSystem where name like '"
+ + os
+ + "' and architecture like '"
+ + architecture
+ + "';");
+ rs.first();
+ String pkos=rs.getString("operatingSystemID");
+ log.info(new Date() + " - Key is "+pkos);
+ con.close();
+ return pkos;
+
+ } catch (SQLException e) {
+ // TODO Auto-generated catch block
+ log.info(new Date() + " - Failed to getOSpk.");
+ e.printStackTrace();
+ }
+
+ return null;
+ }
+
+ public String getOS(String pk) {
+ try {
+ Connection con=getConnection();
+ Statement stm = con.createStatement();
+ //log.info(new Date() + " - OS: "+os+" architecture: "+architecture);
+ ResultSet rs=stm
+ .executeQuery("SELECT name,architecture FROM bwLehrpool.m_operatingSystem where operatingSystemID = '"
+ + pk
+ + "';");
+ rs.first();
+ String os=rs.getString("name")+" "+rs.getString("architecture");
+ con.close();
+ return os;
+
+ } catch (SQLException e) {
+ // TODO Auto-generated catch block
+ log.info(new Date() + " - Failed to getOS.");
+ e.printStackTrace();
+ }
+
+ return null;
+ }
+
+ public Map<String,String> getLectureData(String id) {
+ Map<String, String> map = new HashMap<String, String>();
+ try {
+ Connection con=getConnection();
+ Statement stm = con.createStatement();
+ ResultSet data=stm
+ .executeQuery("select l.name, l.isActive, l.startTime, l.endTime, l.lastUsed, l.description, i.image_path, l.imageVersion, concat(u.Nachname,' ',u.Vorname) as owner from m_VLData_lecture l, m_user u, m_VLData_imageInfo i where l.admin_owner=u.userID and l.imageID=i.GUID_imageID and lectureID= '" + id + "' ;");
+ while (data.next()) {
+ map.put("name", data.getString("name"));
+ map.put("isActive",
+ data.getString("isActive"));
+ map.put("startTime", data.getString("startTime"));
+ map.put("endTime", data.getString("endTime"));
+ map.put("lastUsed", data.getString("lastUsed"));
+ map.put("desc", data.getString("description"));
+ map.put("imagepath", data.getString("image_path"));
+ map.put("imageversion", data.getString("imageVersion"));
+ map.put("owner", data.getString("Owner"));
+
+ }
+ con.close();
+ return map;
+ } catch (SQLException e) {
+ // TODO Auto-generated catch block
+ log.info(new Date() + " - Failed to getLectureData.");
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ public boolean checkUser(String username) {
+ Statement stm;
+ boolean ret=false;
+ try {
+ Connection con=getConnection();
+ stm = con.createStatement();
+ ResultSet rs=stm.executeQuery("Select * from m_user where loginName like '"+username+"'");
+ if(rs.next())
+ {
+ ret=true;
+ log.info(new Date() + " - User " + rs.getString("loginName") + " exist.");
+ }
+ else{
+ ret=false;
+ log.info(new Date() + " - User " + rs.getString("loginName") + " not exist.");
+ }
+ con.close();
+
+
+ } catch (SQLException e) {
+ // TODO Auto-generated catch block
+
+ e.printStackTrace();
+ }
+ return ret;
+ }
+
+ public int setImageRights(String pk_person, String pk_image,int role ,int read, int write, int changePermission, int admin,int linkallowed) {
+
+
+
+ try {
+ Connection con=getConnection();
+ Statement stm = con.createStatement();
+
+ String uid = UUID.randomUUID().toString();
+ stm.executeUpdate("INSERT INTO `bwLehrpool`.`pm_VLData_image`(`GUID`,`GUID_imageID`,`roleID`,`userID`,`image_read`,`image_write`,`image_admin`,`image_changePermission`,`link_allowed`)VALUES('"
+ + uid
+ + "','"
+ + pk_image
+ + "','"
+ + role
+ + "','"
+ + pk_person
+ + "','"
+ + read
+ + "','"
+ + write
+ + "','"
+ + admin
+ + "','"
+ + changePermission
+ + "','"
+ + linkallowed+ "');");
+ con.commit();
+ con.close();
+ } catch (SQLException e) {
+ // TODO Auto-generated catch block
+ log.info(new Date() + " - Failed to setImageRights.");
+ e.printStackTrace();
+ }
+ return 0;
+
+ }
+ public int getRoleID(String role) {
+
+
+ try {
+ Connection con=getConnection();
+ Statement stm = con.createStatement();
+
+ ResultSet rs=stm
+ .executeQuery("SELECT roleID FROM bwLehrpool.m_role where name like '"+ role+ "';");
+ rs.first();
+
+ return rs.getInt("roleID");
+
+ } catch (SQLException e) {
+ // TODO Auto-generated catch block
+ log.info(new Date() + " - Failed to getRoleID.");
+ e.printStackTrace();
+ }
+ return -1;
+ }
+ public int setLectureRights(String pk_person, String pk_lecture,int role ,int read, int write, int changePermission, int admin) {
+
+
+
+ try {
+ Connection con=getConnection();
+ Statement stm = con.createStatement();
+
+ String uid = UUID.randomUUID().toString();
+ stm.executeUpdate("INSERT INTO `bwLehrpool`.`pm_VLData_lecture`(`GUID`,`lectureID`,`roleID`,`userID`,`rec_read`,`rec_write`,`rec_admin`,`rec_changePermission`)VALUES('"
+ + uid
+ + "','"
+ + pk_lecture
+ + "','"
+ + role
+ + "','"
+ + pk_person
+ + "','"
+ + read
+ + "','"
+ + write
+ + "','"
+ + admin
+ + "','"
+ + changePermission+ "');");
+ con.commit();
+ con.close();
+ } catch (SQLException e) {
+ // TODO Auto-generated catch block
+ log.info(new Date() + " - Failed to setLectureRights.");
+ e.printStackTrace();
+ }
+ return 0;
+
+ }
+ public String getLectureID(String name) {
+ String id=null;
+ try {
+ Connection con=getConnection();
+ Statement stm = con.createStatement();
+ ResultSet lecture= stm
+ .executeQuery("SELECT lectureID FROM bwLehrpool.m_VLData_lecture where name like '"
+ + name + "';");
+ while (lecture.next()) {
+ id=lecture.getString("lectureID");
+
+ }
+ con.close();
+ return id;
+ } catch (SQLException e) {
+ // TODO Auto-generated catch block
+ log.info(new Date() + " - Failed to LectureID.");
+ e.printStackTrace();
+ }
+ return id;
+ }
}
diff --git a/Dozentenmodulserver/src/main/java/util/XMLCreator.java b/Dozentenmodulserver/src/main/java/util/XMLCreator.java
index 564543fa..46cdef5d 100644
--- a/Dozentenmodulserver/src/main/java/util/XMLCreator.java
+++ b/Dozentenmodulserver/src/main/java/util/XMLCreator.java
@@ -46,7 +46,7 @@ public class XMLCreator {
// phone param not existing
- private String query = "SELECT m_VLData_imageInfo.image_path ,vorname, nachname, mail, shortdescription, description, m_operatingSystem.name as os, m_VLData_lecture.admin_changeTime as time, m_VLData_lecture.name as lectureName, m_user.institution as userInstitution, m_user.loginName as loginName, m_institution.name as institutionName "
+ private String query = "SELECT m_VLData_imageInfo.image_path ,vorname, nachname, mail, shortdescription, description, m_operatingSystem.guestOS as os,m_VLData_lecture.admin_createTime as createtime ,m_VLData_lecture.admin_changeTime as time, m_VLData_lecture.name as lectureName, m_user.institution as userInstitution, m_user.loginName as loginName, m_VLData_lecture.isActive, m_institution.name as institutionName "
+ "FROM bwLehrpool.m_VLData_lecture, bwLehrpool.m_VLData_imageInfo, bwLehrpool.m_user, bwLehrpool.m_operatingSystem, bwLehrpool.m_institution "
+ "WHERE m_user.userID = m_VLData_lecture.admin_owner "
+ "AND m_VLData_imageInfo.GUID_imageID = m_VLData_lecture.imageID "
@@ -127,13 +127,13 @@ public class XMLCreator {
entry.appendChild(prio);
prio.setAttribute("param", "0");
- Comment fComment = doc.createComment("Diesen Abschnitt ergänzen");
+ Comment fComment = doc.createComment("Diesen Abschnitt erg�nzen");
entry.appendChild(fComment);
Element imgName = doc.createElement("image_name");
entry.appendChild(imgName);
imageName = rs.getString("image_path").substring(
- rs.getString("image_path").lastIndexOf("/")+1); //+1 um das führende "/" los zu werden
+ rs.getString("image_path").lastIndexOf("/")+1); //+1 um das f�hrende "/" los zu werden
imgName.setAttribute("param", imageName);
@@ -165,7 +165,7 @@ public class XMLCreator {
entry.appendChild(os);
os.setAttribute("param", rs.getString("os"));
- Comment sComment = doc.createComment("Diesen Abschnitt ergänzen");
+ Comment sComment = doc.createComment("Diesen Abschnitt erg�nzen");
entry.appendChild(sComment);
// static content following - second part of xml descriptor
@@ -189,7 +189,13 @@ public class XMLCreator {
Element active = doc.createElement("active");
entry.appendChild(active);
- active.setAttribute("param", "true");
+
+ //set activity
+ if(rs.getString("isActive").equals("1")){
+ active.setAttribute("param", "true");
+ } else if(rs.getString("isActive").equals("0")){
+ active.setAttribute("param", "false");
+ }
Element pools = doc.createElement("pools");
entry.appendChild(pools);
@@ -206,8 +212,7 @@ public class XMLCreator {
DOMSource source = new DOMSource(doc);
//Set XML-filename
- DateFormat formatter = new SimpleDateFormat("yyyMMddhhmmss");
- xmlName=formatter.format(new Date()) + "_" + rs.getString("institutionName") + "_" + rs.getString("loginName") + "_" + rs.getString("lectureName") + ".xml";
+ xmlName=rs.getString("createtime").substring(0, rs.getString("createtime").length() - 2).replace("-", "").replace(" ", "").replace(":", "") + "_" + rs.getString("institutionName") + "_" + rs.getString("loginName") + "_" + rs.getString("lectureName") + ".xml";
//Write file
StreamResult result = new StreamResult(new File(filePath+ xmlName)); // see filepath at top of class
diff --git a/Dozentenmodulserver/thrift/server.thrift b/Dozentenmodulserver/thrift/server.thrift
index 46b228ac..51bc1765 100644
--- a/Dozentenmodulserver/thrift/server.thrift
+++ b/Dozentenmodulserver/thrift/server.thrift
@@ -20,6 +20,7 @@ struct Image{
string lectureName,
string updateTime,
string userData,
+ string isTemplate,
}
struct Lecture{
string id,
@@ -31,12 +32,13 @@ struct Lecture{
string desc,
string imagename,
string username,
+
}
service Server{
User getFtpUser(),
int DeleteFtpUser(string user),
string getPathOfImage(string image_id,string version),
- bool writeVLdata(string imagename, string login ,string firstname, string lastname,string university, string Mail, string Tel, string Fak, bool license, bool internet, int ram, int cpu, string imagePath, bool isTemplate ,i64 filesize, int shareMode),
+ bool writeVLdata(string imagename, string desc ,string login ,string firstname, string lastname,string university, string Mail, string Tel, string Fak, bool license, bool internet, int ram, int cpu, string imagePath, bool isTemplate ,i64 filesize, int shareMode, string os),
list<Image> getImageList(),
list<Lecture> getLectureList(),
list<string> getAllOS(),
@@ -45,11 +47,15 @@ service Server{
bool writeLecturedata(string name, string shortdesc, string desc,string startDate, string endDate, bool isActive, string imagename,string login,string firstname,string lastname, string university, string Mail, string Tel,string Fak),
bool startFileCopy(string file),
map<string,string> getImageData(string imageid, string imageversion),
- bool updateImageData(string name, string newName,string image_path,bool license, bool internet, int ram,int cpu, string id, string version,bool isTemplate ,i64 filesize, int shareMode),
- map<string,string> getLectureData(string lecturename),
+ map<string,string> getLectureData(string lectureid),
+ bool updateImageData(string name, string newName,string desc,string image_path,bool license, bool internet, int ram,int cpu, string id, string version,bool isTemplate ,i64 filesize, int shareMode, string os),
bool deleteImageData(string id, string version),
- bool updateLecturedata(string name, string newName ,string shortdesc, string desc,string startDate, string endDate, bool isActive, string imagename,string firstname,string lastname, string university, string Mail, string Tel,string Fak, string id),
+ bool updateLecturedata(string name, string newName ,string shortdesc, string desc,string startDate, string endDate, bool isActive, string imageid, string imageversion,string user,string firstname,string lastname, string university, string Mail, string Tel,string Fak, string id),
bool deleteImageServer(string id, string version),
bool connectedToLecture(string id, string version),
bool deleteLecture(string id, string hs, string user),
+ bool checkUser(string username),
+ bool createUser(string loginName, string lastName, string firstName, string mail, string university),
+ bool writeImageRights(string imagename, string username, string lastName, string firstName, string mail, string university, string role),
+ bool writeLectureRights(string lecturename, string username, string lastName, string firstName, string mail, string university, string role),
} \ No newline at end of file