diff options
45 files changed, 1337 insertions, 128 deletions
diff --git a/Dozentenmodul/.classpath b/Dozentenmodul/.classpath index 1e2dfca0..21c796b6 100644 --- a/Dozentenmodul/.classpath +++ b/Dozentenmodul/.classpath @@ -19,5 +19,6 @@ <classpathentry kind="lib" path="lib/libthrift-0.9.1.jar"/>
<classpathentry kind="lib" path="/bwLehrpoolSuite_Server/lib/slf4j-api-1.7.5.jar"/>
<classpathentry kind="lib" path="lib/slf4j-simple-1.7.6.jar"/>
+ <classpathentry kind="lib" path="forms-1.3.0.jar" sourcepath="forms-1.3.0-src.zip"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/Dozentenmodul/bin/gui/image/CreateImageTechnisch_GUI.class b/Dozentenmodul/bin/gui/image/CreateImageTechnisch_GUI.class Binary files differindex d03e7bba..eb306c34 100644 --- a/Dozentenmodul/bin/gui/image/CreateImageTechnisch_GUI.class +++ b/Dozentenmodul/bin/gui/image/CreateImageTechnisch_GUI.class diff --git a/Dozentenmodul/bin/gui/image/EditImageAllgemein_GUI.class b/Dozentenmodul/bin/gui/image/EditImageAllgemein_GUI.class Binary files differindex bb3de645..93fefcfd 100644 --- a/Dozentenmodul/bin/gui/image/EditImageAllgemein_GUI.class +++ b/Dozentenmodul/bin/gui/image/EditImageAllgemein_GUI.class diff --git a/Dozentenmodul/bin/gui/image/EditImageTechnisch_GUI.class b/Dozentenmodul/bin/gui/image/EditImageTechnisch_GUI.class Binary files differindex 45e33268..55b0d8cb 100644 --- a/Dozentenmodul/bin/gui/image/EditImageTechnisch_GUI.class +++ b/Dozentenmodul/bin/gui/image/EditImageTechnisch_GUI.class diff --git a/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI.class b/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI.class Binary files differindex f37a90df..a5c6cda4 100644 --- a/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI.class +++ b/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI.class diff --git a/Dozentenmodul/bin/gui/image/FTPEditUploader_GUI.class b/Dozentenmodul/bin/gui/image/FTPEditUploader_GUI.class Binary files differindex 5f5bd3c0..ff17cc79 100644 --- a/Dozentenmodul/bin/gui/image/FTPEditUploader_GUI.class +++ b/Dozentenmodul/bin/gui/image/FTPEditUploader_GUI.class diff --git a/Dozentenmodul/bin/gui/intro/Login_GUI.class b/Dozentenmodul/bin/gui/intro/Login_GUI.class Binary files differindex aaa9ada0..fac3e243 100644 --- a/Dozentenmodul/bin/gui/intro/Login_GUI.class +++ b/Dozentenmodul/bin/gui/intro/Login_GUI.class diff --git a/Dozentenmodul/bin/gui/lecture/ExtendedSearchForImages_GUI$1.class b/Dozentenmodul/bin/gui/lecture/ExtendedSearchForImages_GUI$1.class Binary files differdeleted file mode 100644 index 962df75f..00000000 --- a/Dozentenmodul/bin/gui/lecture/ExtendedSearchForImages_GUI$1.class +++ /dev/null diff --git a/Dozentenmodul/bin/gui/lecture/ExtendedSearchForImages_GUI$2.class b/Dozentenmodul/bin/gui/lecture/ExtendedSearchForImages_GUI$2.class Binary files differdeleted file mode 100644 index 07e7e8cf..00000000 --- a/Dozentenmodul/bin/gui/lecture/ExtendedSearchForImages_GUI$2.class +++ /dev/null diff --git a/Dozentenmodul/bin/gui/lecture/ExtendedSearchForImages_GUI$3.class b/Dozentenmodul/bin/gui/lecture/ExtendedSearchForImages_GUI$3.class Binary files differdeleted file mode 100644 index 173ab342..00000000 --- a/Dozentenmodul/bin/gui/lecture/ExtendedSearchForImages_GUI$3.class +++ /dev/null diff --git a/Dozentenmodul/bin/gui/lecture/ExtendedSearchForImages_GUI.class b/Dozentenmodul/bin/gui/lecture/ExtendedSearchForImages_GUI.class Binary files differdeleted file mode 100644 index ed5b0b25..00000000 --- a/Dozentenmodul/bin/gui/lecture/ExtendedSearchForImages_GUI.class +++ /dev/null diff --git a/Dozentenmodul/forms-1.3.0-src.zip b/Dozentenmodul/forms-1.3.0-src.zip Binary files differnew file mode 100644 index 00000000..b7673afc --- /dev/null +++ b/Dozentenmodul/forms-1.3.0-src.zip diff --git a/Dozentenmodul/forms-1.3.0.jar b/Dozentenmodul/forms-1.3.0.jar Binary files differnew file mode 100644 index 00000000..3e705ffe --- /dev/null +++ b/Dozentenmodul/forms-1.3.0.jar diff --git a/Dozentenmodul/src/gui/image/CreateImageTechnisch_GUI.java b/Dozentenmodul/src/gui/image/CreateImageTechnisch_GUI.java index 34594f3d..f861901f 100644 --- a/Dozentenmodul/src/gui/image/CreateImageTechnisch_GUI.java +++ b/Dozentenmodul/src/gui/image/CreateImageTechnisch_GUI.java @@ -52,8 +52,11 @@ public class CreateImageTechnisch_GUI extends JFrame { JRadioButton rdbtnlicenseNein; JRadioButton rdbtnInternetJa; JRadioButton rdbtnInternetNein; + JRadioButton radioButtonVorlageJa; + JRadioButton radioButtonVorlageNein; private final ButtonGroup buttonGrouplicense = new ButtonGroup(); private final ButtonGroup buttonGroupInternet = new ButtonGroup(); + private final ButtonGroup buttonGroupVorlage = new ButtonGroup(); /** @@ -110,55 +113,70 @@ 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, 66, 557, 124); + panel_1.setBounds(10, 52, 557, 138); contentPanel.add(panel_1); panel_1.setLayout(null); rdbtnlicenseNein = new JRadioButton("Nein"); buttonGrouplicense.add(rdbtnlicenseNein); - rdbtnlicenseNein.setBounds(377, 29, 46, 23); + rdbtnlicenseNein.setBounds(377, 49, 46, 23); panel_1.add(rdbtnlicenseNein); rdbtnInternetNein = new JRadioButton("Nein"); rdbtnInternetNein.setSelected(true); buttonGroupInternet.add(rdbtnInternetNein); - rdbtnInternetNein.setBounds(377, 57, 46, 23); + rdbtnInternetNein.setBounds(377, 77, 46, 23); panel_1.add(rdbtnInternetNein); JLabel lblInternetIstInnerhalb = new JLabel("Internet ist f\u00FCr dieses Image gesperrt:"); - lblInternetIstInnerhalb.setBounds(10, 58, 250, 20); + lblInternetIstInnerhalb.setBounds(10, 78, 250, 20); panel_1.add(lblInternetIstInnerhalb); JButton btnInternetSettings = new JButton("Einstellungen..."); btnInternetSettings.setEnabled(false); - btnInternetSettings.setBounds(439, 57, 108, 23); + btnInternetSettings.setBounds(439, 77, 108, 23); panel_1.add(btnInternetSettings); rdbtnInternetJa = new JRadioButton("Ja"); buttonGroupInternet.add(rdbtnInternetJa); - rdbtnInternetJa.setBounds(266, 57, 41, 23); + rdbtnInternetJa.setBounds(266, 77, 41, 23); panel_1.add(rdbtnInternetJa); rdbtnlicenseJa = new JRadioButton("Ja"); rdbtnlicenseJa.setSelected(true); buttonGrouplicense.add(rdbtnlicenseJa); - rdbtnlicenseJa.setBounds(266, 29, 41, 23); + rdbtnlicenseJa.setBounds(266, 49, 41, 23); panel_1.add(rdbtnlicenseJa); JLabel lblNewLabel_2 = new JLabel("Image enth\u00E4lt lizenzpflichtige Software:"); - lblNewLabel_2.setBounds(10, 30, 250, 20); + lblNewLabel_2.setBounds(10, 50, 250, 20); panel_1.add(lblNewLabel_2); JLabel lblLizenzserverEintragen = new JLabel("Lizenzserver eintragen:"); - lblLizenzserverEintragen.setBounds(10, 85, 250, 20); + lblLizenzserverEintragen.setBounds(10, 105, 250, 20); panel_1.add(lblLizenzserverEintragen); JButton btnLicenseServer = new JButton("Server-Adresse..."); btnLicenseServer.setEnabled(false); - btnLicenseServer.setBounds(266, 84, 157, 23); + btnLicenseServer.setBounds(266, 104, 157, 23); panel_1.add(btnLicenseServer); + JLabel lblImageIstEine = new JLabel("Image ist eine Vorlage:"); + lblImageIstEine.setBounds(10, 24, 250, 20); + panel_1.add(lblImageIstEine); + + radioButtonVorlageJa = new JRadioButton("Ja"); + buttonGroupVorlage.add(radioButtonVorlageJa); + radioButtonVorlageJa.setSelected(true); + radioButtonVorlageJa.setBounds(266, 23, 41, 23); + panel_1.add(radioButtonVorlageJa); + + radioButtonVorlageNein = new JRadioButton("Nein"); + buttonGroupVorlage.add(radioButtonVorlageNein); + radioButtonVorlageNein.setBounds(377, 23, 46, 23); + panel_1.add(radioButtonVorlageNein); + 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)); @@ -314,6 +332,14 @@ public class CreateImageTechnisch_GUI extends JFrame { { Image.image.setLicensed(false); } + if(radioButtonVorlageJa.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()); CreateImageFreigabe_GUI ea=new CreateImageFreigabe_GUI(); diff --git a/Dozentenmodul/src/gui/image/EditImageAllgemein_GUI.java b/Dozentenmodul/src/gui/image/EditImageAllgemein_GUI.java index 47837c22..59483fde 100644 --- a/Dozentenmodul/src/gui/image/EditImageAllgemein_GUI.java +++ b/Dozentenmodul/src/gui/image/EditImageAllgemein_GUI.java @@ -398,6 +398,12 @@ public class EditImageAllgemein_GUI extends JFrame { } else { Image.image.setLicensed(true); } + System.out.println(map.get("template")); + if (map.get("template").equals("false")) { + Image.image.setVorlage(false); + } else { + Image.image.setVorlage(true); + } Image.image.setImagename(map.get("name")); Image.image.setRam(Integer.parseInt(map.get("ram"))); Image.image.setCpu(Integer.parseInt(map.get("cpu"))); diff --git a/Dozentenmodul/src/gui/image/EditImageTechnisch_GUI.java b/Dozentenmodul/src/gui/image/EditImageTechnisch_GUI.java index 825292c2..6573b802 100644 --- a/Dozentenmodul/src/gui/image/EditImageTechnisch_GUI.java +++ b/Dozentenmodul/src/gui/image/EditImageTechnisch_GUI.java @@ -53,8 +53,11 @@ public class EditImageTechnisch_GUI extends JFrame { JRadioButton rdbtnlicenseNein; JRadioButton rdbtnInternetJa; JRadioButton rdbtnInternetNein; + JRadioButton radioButtonVorlageJa; + JRadioButton radioButtonVorlageNein; private final ButtonGroup buttonGrouplicense = new ButtonGroup(); private final ButtonGroup buttonGroupInternet = new ButtonGroup(); + private final ButtonGroup buttonGroupVorlage = new ButtonGroup(); /** * Create the dialog. @@ -118,24 +121,24 @@ 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, 66, 557, 95); + panel_1.setBounds(10, 25, 557, 136); contentPanel.add(panel_1); panel_1.setLayout(null); JLabel lblNewLabel_2 = new JLabel( "Image enth\u00E4lt lizenzpflichtige Software:"); - lblNewLabel_2.setBounds(10, 30, 250, 20); + lblNewLabel_2.setBounds(10, 46, 250, 20); panel_1.add(lblNewLabel_2); rdbtnlicenseJa = new JRadioButton("Ja"); rdbtnlicenseJa.setSelected(true); buttonGrouplicense.add(rdbtnlicenseJa); - rdbtnlicenseJa.setBounds(266, 29, 109, 23); + rdbtnlicenseJa.setBounds(266, 45, 109, 23); panel_1.add(rdbtnlicenseJa); rdbtnlicenseNein = new JRadioButton("Nein"); buttonGrouplicense.add(rdbtnlicenseNein); - rdbtnlicenseNein.setBounds(377, 29, 109, 23); + rdbtnlicenseNein.setBounds(377, 45, 109, 23); panel_1.add(rdbtnlicenseNein); if (Image.image.isLicensed() == true) { rdbtnlicenseJa.setSelected(true); @@ -145,23 +148,47 @@ public class EditImageTechnisch_GUI extends JFrame { JLabel lblInternetIstInnerhalb = new JLabel( "Internet ist innerhalb des Image gesperrt:"); - lblInternetIstInnerhalb.setBounds(10, 58, 250, 20); + lblInternetIstInnerhalb.setBounds(10, 74, 250, 20); panel_1.add(lblInternetIstInnerhalb); rdbtnInternetJa = new JRadioButton("Ja"); buttonGroupInternet.add(rdbtnInternetJa); - rdbtnInternetJa.setBounds(266, 57, 109, 23); + rdbtnInternetJa.setBounds(266, 73, 109, 23); panel_1.add(rdbtnInternetJa); rdbtnInternetNein = new JRadioButton("Nein"); rdbtnInternetNein.setSelected(true); buttonGroupInternet.add(rdbtnInternetNein); - rdbtnInternetNein.setBounds(377, 57, 109, 23); + rdbtnInternetNein.setBounds(377, 73, 109, 23); panel_1.add(rdbtnInternetNein); - if (Image.image.isInternet() == true) { - rdbtnInternetJa.setSelected(true); + + JLabel label = new JLabel("Lizenzserver eintragen:"); + label.setBounds(10, 103, 250, 20); + panel_1.add(label); + + JButton button = new JButton("Server-Adresse..."); + button.setEnabled(false); + button.setBounds(266, 102, 157, 23); + panel_1.add(button); + + JLabel label_4 = new JLabel("Image ist eine Vorlage:"); + label_4.setBounds(10, 20, 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); + + 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); } else { - rdbtnInternetNein.setSelected(true); + radioButtonVorlageNein.setSelected(true); } JLabel lblHauptmen = new JLabel("Hauptmen\u00FC"); lblHauptmen.addMouseListener(new MouseAdapter() { @@ -175,24 +202,24 @@ public class EditImageTechnisch_GUI extends JFrame { } }); lblHauptmen.setForeground(Color.BLUE); - lblHauptmen.setBounds(10, 11, 61, 14); + lblHauptmen.setBounds(10, 0, 61, 14); contentPanel.add(lblHauptmen); JLabel label_1 = new JLabel(">"); - label_1.setBounds(69, 11, 13, 14); + label_1.setBounds(69, 0, 13, 14); contentPanel.add(label_1); JLabel lblVlimage = new JLabel("VL-Image"); lblVlimage.setForeground(Color.BLUE); - lblVlimage.setBounds(81, 11, 45, 14); + lblVlimage.setBounds(81, 0, 45, 14); contentPanel.add(lblVlimage); JLabel label_2 = new JLabel(">"); - label_2.setBounds(133, 11, 13, 14); + label_2.setBounds(133, 0, 13, 14); contentPanel.add(label_2); JLabel lblNewLabel_1 = new JLabel("Neu"); - lblNewLabel_1.setBounds(146, 11, 46, 14); + lblNewLabel_1.setBounds(146, 0, 46, 14); contentPanel.add(lblNewLabel_1); JPanel panel_2 = new JPanel(); @@ -320,6 +347,11 @@ public class EditImageTechnisch_GUI extends JFrame { } else { Image.image.setLicensed(false); } + if (radioButtonVorlageJa.isSelected() == true) { + Image.image.setVorlage(true); + } else { + Image.image.setVorlage(false); + } // oeffnet das naechste Fenster EditImageFreigabe_GUI ea=new EditImageFreigabe_GUI(); ea.setVisible(true); diff --git a/Dozentenmodul/src/gui/lecture/ExtendedSearchForImages_GUI.java b/Dozentenmodul/src/gui/image/ExtendedSearchForImages_GUI.java index 579ea3bd..872e8f8d 100644 --- a/Dozentenmodul/src/gui/lecture/ExtendedSearchForImages_GUI.java +++ b/Dozentenmodul/src/gui/image/ExtendedSearchForImages_GUI.java @@ -1,4 +1,4 @@ -package gui.lecture; +package gui.image; import gui.image.CreateImageAllgemein_GUI; @@ -14,6 +14,7 @@ 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; @@ -32,7 +33,12 @@ 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; @@ -43,7 +49,12 @@ public class ExtendedSearchForImages_GUI extends JFrame { 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. @@ -101,13 +112,13 @@ public class ExtendedSearchForImages_GUI extends JFrame { lblNewLabel_2.setBounds(10, 39, 176, 20); panel_1.add(lblNewLabel_2); - JCheckBox chckbxBestehendesImage = new JCheckBox("Bestehendes Image"); - chckbxBestehendesImage.setSelected(true); + chckbxBestehendesImage = new JCheckBox("Bestehendes Image"); + chckbxBestehendesImage.setSelected(search.isExistingImage()); chckbxBestehendesImage.setBounds(192, 38, 138, 23); panel_1.add(chckbxBestehendesImage); - JCheckBox chckbxRohling = new JCheckBox("Rohling"); - chckbxRohling.setSelected(true); + chckbxRohling = new JCheckBox("Rohling"); + chckbxRohling.setSelected(search.isRohling()); chckbxRohling.setBounds(332, 38, 97, 23); panel_1.add(chckbxRohling); @@ -124,6 +135,7 @@ public class ExtendedSearchForImages_GUI extends JFrame { textField = new JTextField(); textField.setBounds(196, 39, 351, 20); + textField.setText(search.getSoftware()); panel.add(textField); textField.setColumns(10); @@ -145,13 +157,24 @@ public class ExtendedSearchForImages_GUI extends JFrame { 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); - JComboBox<String> comboBox = new JComboBox<String>(); + 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); { @@ -161,30 +184,16 @@ public class ExtendedSearchForImages_GUI extends JFrame { 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); + 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"); diff --git a/Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java b/Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java index b850ccb2..88457e5a 100644 --- a/Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java +++ b/Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java @@ -531,7 +531,7 @@ public class FTPCreateUploader_GUI extends JFrame implements person.verantwortlicher.getFakultaet(), Image.image.isLicensed(), Image.image.isInternet(), Image.image.getRam(), Image.image.getCpu(), - "temp/" + Image.image.getNewName(),false,Image.image.getFilesize(),Image.image.getShareMode()); + "temp/" + Image.image.getNewName(),Image.image.isVorlage(),Image.image.getFilesize(),Image.image.getShareMode()); client.startFileCopy(Image.image.getNewName()); } catch (TException e) { // TODO Auto-generated catch block diff --git a/Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java b/Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java index a2123712..9e21aba3 100644 --- a/Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java +++ b/Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java @@ -511,7 +511,7 @@ public class FTPEditUploader_GUI extends JFrame implements Image.image.getImagename(),Image.image.getImagepath(), Image.image.isLicensed(), Image.image.isInternet(), Image.image.getRam(), Image.image.getCpu(), Image.image.getImageId(), - Image.image.getVersion(), false,Image.image.getFilesize(),Image.image.getShareMode()); + Image.image.getVersion(), Image.image.isVorlage(),Image.image.getFilesize(),Image.image.getShareMode()); client.startFileCopy(Image.image.getNewName()); } else{ @@ -521,7 +521,7 @@ public class FTPEditUploader_GUI extends JFrame implements 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(), false,Image.image.getFilesize(),Image.image.getShareMode()); + Image.image.getVersion(), Image.image.isVorlage(),Image.image.getFilesize(),Image.image.getShareMode()); client.startFileCopy(Image.image.getNewName()); } } catch (TException e) { diff --git a/Dozentenmodul/src/gui/image/SearchImage_GUI.java b/Dozentenmodul/src/gui/image/SearchImage_GUI.java index ef8b75bb..c20ecc99 100644 --- a/Dozentenmodul/src/gui/image/SearchImage_GUI.java +++ b/Dozentenmodul/src/gui/image/SearchImage_GUI.java @@ -201,8 +201,8 @@ public class SearchImage_GUI extends JFrame { public void mouseClicked(MouseEvent arg0) { // oeffnet das Fenster Extended GUI - //ExtendedSearchForImages_GUI es = new ExtendedSearchForImages_GUI(); - //es.setVisible(true); + ExtendedSearchForImages_GUI es = new ExtendedSearchForImages_GUI(); + es.setVisible(true); } }); lblErweiterteSuche.setForeground(Color.BLUE); diff --git a/Dozentenmodul/src/gui/intro/Login_GUI.java b/Dozentenmodul/src/gui/intro/Login_GUI.java index 06a87307..86c88fe4 100644 --- a/Dozentenmodul/src/gui/intro/Login_GUI.java +++ b/Dozentenmodul/src/gui/intro/Login_GUI.java @@ -204,16 +204,18 @@ public class Login_GUI extends JFrame { // null package if (checkClientPackage() == true) { // package has information + System.out.println("Auth"); result = client.authenticate(lblusername.getText(), passText); + System.out.println("Succes Auth"); SessionData.session.setAuthToken(result.authToken); SessionData.session.setSessionID(result.sessionId); SessionData.session.setServerAdress(result.serverAddress); - + System.out.println("Master"); // set connection to bwLehrpoolSuiteServer ThriftConnection bwthrift = new ThriftConnection(); server.Server.Client bwClient = bwthrift.getThriftConnection(); models.Client.clientcon.setClient(bwClient); - + System.out.println("Client"); System.out.println("Session-ID: " + result.sessionId + "\nToken: " + result.authToken); diff --git a/Dozentenmodul/src/gui/lecture/CreateLectureLink_GUI.java b/Dozentenmodul/src/gui/lecture/CreateLectureLink_GUI.java index 0a00e781..0f30aa15 100644 --- a/Dozentenmodul/src/gui/lecture/CreateLectureLink_GUI.java +++ b/Dozentenmodul/src/gui/lecture/CreateLectureLink_GUI.java @@ -184,7 +184,7 @@ public class CreateLectureLink_GUI extends JFrame { lblErweiterteSuche.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent arg0) { - ExtendedSearchForImages_GUI es = new ExtendedSearchForImages_GUI(); + ExtendedSearchForLectures_GUI es = new ExtendedSearchForLectures_GUI(); es.setVisible(true); } }); diff --git a/Dozentenmodul/src/gui/lecture/ExtendedSearchForLectures_GUI.java b/Dozentenmodul/src/gui/lecture/ExtendedSearchForLectures_GUI.java new file mode 100644 index 00000000..9afb1790 --- /dev/null +++ b/Dozentenmodul/src/gui/lecture/ExtendedSearchForLectures_GUI.java @@ -0,0 +1,269 @@ +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/models/Image.java b/Dozentenmodul/src/models/Image.java index 86bc1e48..a18ae8fe 100644 --- a/Dozentenmodul/src/models/Image.java +++ b/Dozentenmodul/src/models/Image.java @@ -19,6 +19,8 @@ public class Image { private boolean licensed; private boolean internet; + + private boolean vorlage; private int ram; @@ -166,6 +168,15 @@ public class Image { } + public boolean isVorlage() { + return vorlage; + } + + public void setVorlage(boolean vorlage) { + this.vorlage = vorlage; + } + + } diff --git a/Dozentenmodul/src/models/Search.java b/Dozentenmodul/src/models/Search.java new file mode 100644 index 00000000..59a28b21 --- /dev/null +++ b/Dozentenmodul/src/models/Search.java @@ -0,0 +1,46 @@ +package models; + +public class Search { + + + private String Software; + private String Hochschule; + private String Creator; + private boolean ExistingImage; + private boolean Rohling; + public static Search search =new Search(); + + public String getSoftware() { + return Software; + } + public void setSoftware(String software) { + Software = software; + } + public String getHochschule() { + return Hochschule; + } + public void setHochschule(String hochschule) { + Hochschule = hochschule; + } + public String getCreator() { + return Creator; + } + public void setCreator(String creator) { + Creator = creator; + } + public boolean isExistingImage() { + return ExistingImage; + } + public void setExistingImage(boolean existingImage) { + ExistingImage = existingImage; + } + public boolean isRohling() { + return Rohling; + } + public void setRohling(boolean rohling) { + Rohling = rohling; + } + + + +} diff --git a/Dozentenmodulserver/bin/server/Server$getLectureData_args$getLectureData_argsTupleScheme.class b/Dozentenmodulserver/bin/server/Server$getLectureData_args$getLectureData_argsTupleScheme.class Binary files differindex 4c38d18d..cdbf5bc8 100644 --- a/Dozentenmodulserver/bin/server/Server$getLectureData_args$getLectureData_argsTupleScheme.class +++ b/Dozentenmodulserver/bin/server/Server$getLectureData_args$getLectureData_argsTupleScheme.class diff --git a/Dozentenmodulserver/bin/server/Server$getLectureData_result$_Fields.class b/Dozentenmodulserver/bin/server/Server$getLectureData_result$_Fields.class Binary files differindex 4125b7ed..06fd07bb 100644 --- a/Dozentenmodulserver/bin/server/Server$getLectureData_result$_Fields.class +++ b/Dozentenmodulserver/bin/server/Server$getLectureData_result$_Fields.class diff --git a/Dozentenmodulserver/bin/server/Server$getPersonData_args$_Fields.class b/Dozentenmodulserver/bin/server/Server$getPersonData_args$_Fields.class Binary files differindex 23fdf07e..d79e8629 100644 --- a/Dozentenmodulserver/bin/server/Server$getPersonData_args$_Fields.class +++ b/Dozentenmodulserver/bin/server/Server$getPersonData_args$_Fields.class diff --git a/Dozentenmodulserver/bin/server/Server$getPersonData_result$_Fields.class b/Dozentenmodulserver/bin/server/Server$getPersonData_result$_Fields.class Binary files differindex a0551a3c..f325c0d1 100644 --- a/Dozentenmodulserver/bin/server/Server$getPersonData_result$_Fields.class +++ b/Dozentenmodulserver/bin/server/Server$getPersonData_result$_Fields.class diff --git a/Dozentenmodulserver/bin/server/Server$startFileCopy_args$startFileCopy_argsTupleSchemeFactory.class b/Dozentenmodulserver/bin/server/Server$startFileCopy_args$startFileCopy_argsTupleSchemeFactory.class Binary files differindex e8adfd24..5948ba60 100644 --- a/Dozentenmodulserver/bin/server/Server$startFileCopy_args$startFileCopy_argsTupleSchemeFactory.class +++ b/Dozentenmodulserver/bin/server/Server$startFileCopy_args$startFileCopy_argsTupleSchemeFactory.class diff --git a/Dozentenmodulserver/bin/server/Server$startFileCopy_args.class b/Dozentenmodulserver/bin/server/Server$startFileCopy_args.class Binary files differindex c6b7ce8d..ff980efd 100644 --- a/Dozentenmodulserver/bin/server/Server$startFileCopy_args.class +++ b/Dozentenmodulserver/bin/server/Server$startFileCopy_args.class diff --git a/Dozentenmodulserver/bin/server/Server$startFileCopy_result$_Fields.class b/Dozentenmodulserver/bin/server/Server$startFileCopy_result$_Fields.class Binary files differindex 0fd71044..6cc09ffc 100644 --- a/Dozentenmodulserver/bin/server/Server$startFileCopy_result$_Fields.class +++ b/Dozentenmodulserver/bin/server/Server$startFileCopy_result$_Fields.class diff --git a/Dozentenmodulserver/bin/server/Server$updateImageData_args.class b/Dozentenmodulserver/bin/server/Server$updateImageData_args.class Binary files differindex cbbf2577..69b3366b 100644 --- a/Dozentenmodulserver/bin/server/Server$updateImageData_args.class +++ b/Dozentenmodulserver/bin/server/Server$updateImageData_args.class diff --git a/Dozentenmodulserver/bin/server/Server$updateImageData_result$_Fields.class b/Dozentenmodulserver/bin/server/Server$updateImageData_result$_Fields.class Binary files differindex e15b535c..8116ac1a 100644 --- a/Dozentenmodulserver/bin/server/Server$updateImageData_result$_Fields.class +++ b/Dozentenmodulserver/bin/server/Server$updateImageData_result$_Fields.class diff --git a/Dozentenmodulserver/bin/server/Server$updateImageData_result.class b/Dozentenmodulserver/bin/server/Server$updateImageData_result.class Binary files differindex 244244ab..bf0a8dfc 100644 --- a/Dozentenmodulserver/bin/server/Server$updateImageData_result.class +++ b/Dozentenmodulserver/bin/server/Server$updateImageData_result.class diff --git a/Dozentenmodulserver/bin/server/Server$writeLecturedata_args$writeLecturedata_argsTupleSchemeFactory.class b/Dozentenmodulserver/bin/server/Server$writeLecturedata_args$writeLecturedata_argsTupleSchemeFactory.class Binary files differindex d3767956..db21709d 100644 --- a/Dozentenmodulserver/bin/server/Server$writeLecturedata_args$writeLecturedata_argsTupleSchemeFactory.class +++ b/Dozentenmodulserver/bin/server/Server$writeLecturedata_args$writeLecturedata_argsTupleSchemeFactory.class diff --git a/Dozentenmodulserver/bin/server/Server$writeLecturedata_args.class b/Dozentenmodulserver/bin/server/Server$writeLecturedata_args.class Binary files differindex 20d475b0..0662b200 100644 --- a/Dozentenmodulserver/bin/server/Server$writeLecturedata_args.class +++ b/Dozentenmodulserver/bin/server/Server$writeLecturedata_args.class diff --git a/Dozentenmodulserver/bin/server/Server$writeLecturedata_result$_Fields.class b/Dozentenmodulserver/bin/server/Server$writeLecturedata_result$_Fields.class Binary files differindex 96d62007..07ae176e 100644 --- a/Dozentenmodulserver/bin/server/Server$writeLecturedata_result$_Fields.class +++ b/Dozentenmodulserver/bin/server/Server$writeLecturedata_result$_Fields.class diff --git a/Dozentenmodulserver/bin/server/Server$writeVLdata_args.class b/Dozentenmodulserver/bin/server/Server$writeVLdata_args.class Binary files differindex c55a82b1..d8b7742c 100644 --- a/Dozentenmodulserver/bin/server/Server$writeVLdata_args.class +++ b/Dozentenmodulserver/bin/server/Server$writeVLdata_args.class diff --git a/Dozentenmodulserver/bin/sql/SQL.class b/Dozentenmodulserver/bin/sql/SQL.class Binary files differindex f12de705..75e259bb 100644 --- a/Dozentenmodulserver/bin/sql/SQL.class +++ b/Dozentenmodulserver/bin/sql/SQL.class diff --git a/Dozentenmodulserver/src/server/Server.java b/Dozentenmodulserver/src/server/Server.java index b652bf7a..8e36bd49 100644 --- a/Dozentenmodulserver/src/server/Server.java +++ b/Dozentenmodulserver/src/server/Server.java @@ -50,6 +50,8 @@ public class Server { public List<String> getAllOS() throws org.apache.thrift.TException; + public List<String> getAllUniversities() throws org.apache.thrift.TException; + public Map<String,String> getPersonData(String Vorname, String Nachname) throws org.apache.thrift.TException; public boolean writeLecturedata(String name, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imagename, String login, String firstname, String lastname, String university, String Mail, String Tel, String Fak) throws org.apache.thrift.TException; @@ -90,6 +92,8 @@ public class Server { public void getAllOS(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void getAllUniversities(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void getPersonData(String Vorname, String Nachname, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void writeLecturedata(String name, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imagename, String login, String firstname, String lastname, String university, String Mail, String Tel, String Fak, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; @@ -307,6 +311,28 @@ public class Server { throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllOS failed: unknown result"); } + public List<String> getAllUniversities() throws org.apache.thrift.TException + { + send_getAllUniversities(); + return recv_getAllUniversities(); + } + + public void send_getAllUniversities() throws org.apache.thrift.TException + { + getAllUniversities_args args = new getAllUniversities_args(); + sendBase("getAllUniversities", args); + } + + public List<String> recv_getAllUniversities() throws org.apache.thrift.TException + { + getAllUniversities_result result = new getAllUniversities_result(); + receiveBase(result, "getAllUniversities"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllUniversities failed: unknown result"); + } + public Map<String,String> getPersonData(String Vorname, String Nachname) throws org.apache.thrift.TException { send_getPersonData(Vorname, Nachname); @@ -883,6 +909,35 @@ public class Server { } } + public void getAllUniversities(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getAllUniversities_call method_call = new getAllUniversities_call(resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getAllUniversities_call extends org.apache.thrift.async.TAsyncMethodCall { + public getAllUniversities_call(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); + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllUniversities", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getAllUniversities_args args = new getAllUniversities_args(); + args.write(prot); + prot.writeMessageEnd(); + } + + public List<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_getAllUniversities(); + } + } + public void getPersonData(String Vorname, String Nachname, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); getPersonData_call method_call = new getPersonData_call(Vorname, Nachname, resultHandler, this, ___protocolFactory, ___transport); @@ -1390,6 +1445,7 @@ public class Server { processMap.put("getImageList", new getImageList()); processMap.put("getLectureList", new getLectureList()); processMap.put("getAllOS", new getAllOS()); + processMap.put("getAllUniversities", new getAllUniversities()); processMap.put("getPersonData", new getPersonData()); processMap.put("writeLecturedata", new writeLecturedata()); processMap.put("startFileCopy", new startFileCopy()); @@ -1546,6 +1602,26 @@ public class Server { } } + public static class getAllUniversities<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAllUniversities_args> { + public getAllUniversities() { + super("getAllUniversities"); + } + + public getAllUniversities_args getEmptyArgsInstance() { + return new getAllUniversities_args(); + } + + protected boolean isOneway() { + return false; + } + + public getAllUniversities_result getResult(I iface, getAllUniversities_args args) throws org.apache.thrift.TException { + getAllUniversities_result result = new getAllUniversities_result(); + result.success = iface.getAllUniversities(); + return result; + } + } + public static class getPersonData<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getPersonData_args> { public getPersonData() { super("getPersonData"); @@ -1794,6 +1870,7 @@ public class Server { processMap.put("getImageList", new getImageList()); processMap.put("getLectureList", new getLectureList()); processMap.put("getAllOS", new getAllOS()); + processMap.put("getAllUniversities", new getAllUniversities()); processMap.put("getPersonData", new getPersonData()); processMap.put("writeLecturedata", new writeLecturedata()); processMap.put("startFileCopy", new startFileCopy()); @@ -2167,6 +2244,57 @@ public class Server { } } + public static class getAllUniversities<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getAllUniversities_args, List<String>> { + public getAllUniversities() { + super("getAllUniversities"); + } + + public getAllUniversities_args getEmptyArgsInstance() { + return new getAllUniversities_args(); + } + + public AsyncMethodCallback<List<String>> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback<List<String>>() { + public void onComplete(List<String> o) { + getAllUniversities_result result = new getAllUniversities_result(); + result.success = o; + 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; + getAllUniversities_result result = new getAllUniversities_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, getAllUniversities_args args, org.apache.thrift.async.AsyncMethodCallback<List<String>> resultHandler) throws TException { + iface.getAllUniversities(resultHandler); + } + } + public static class getPersonData<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getPersonData_args, Map<String,String>> { public getPersonData() { super("getPersonData"); @@ -8986,6 +9114,655 @@ public class Server { } + public static class getAllUniversities_args implements org.apache.thrift.TBase<getAllUniversities_args, getAllUniversities_args._Fields>, java.io.Serializable, Cloneable, Comparable<getAllUniversities_args> { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllUniversities_args"); + + + private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getAllUniversities_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getAllUniversities_argsTupleSchemeFactory()); + } + + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { +; + + 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) { + 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; + } + } + 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); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllUniversities_args.class, metaDataMap); + } + + public getAllUniversities_args() { + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public getAllUniversities_args(getAllUniversities_args other) { + } + + public getAllUniversities_args deepCopy() { + return new getAllUniversities_args(this); + } + + @Override + public void clear() { + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + } + 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) { + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getAllUniversities_args) + return this.equals((getAllUniversities_args)that); + return false; + } + + public boolean equals(getAllUniversities_args that) { + if (that == null) + return false; + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(getAllUniversities_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + 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("getAllUniversities_args("); + boolean first = true; + + 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 getAllUniversities_argsStandardSchemeFactory implements SchemeFactory { + public getAllUniversities_argsStandardScheme getScheme() { + return new getAllUniversities_argsStandardScheme(); + } + } + + private static class getAllUniversities_argsStandardScheme extends StandardScheme<getAllUniversities_args> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getAllUniversities_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) { + 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, getAllUniversities_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getAllUniversities_argsTupleSchemeFactory implements SchemeFactory { + public getAllUniversities_argsTupleScheme getScheme() { + return new getAllUniversities_argsTupleScheme(); + } + } + + private static class getAllUniversities_argsTupleScheme extends TupleScheme<getAllUniversities_args> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getAllUniversities_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getAllUniversities_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + } + } + + } + + public static class getAllUniversities_result implements org.apache.thrift.TBase<getAllUniversities_result, getAllUniversities_result._Fields>, java.io.Serializable, Cloneable, Comparable<getAllUniversities_result> { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllUniversities_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); + + private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getAllUniversities_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getAllUniversities_resultTupleSchemeFactory()); + } + + public List<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.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllUniversities_result.class, metaDataMap); + } + + public getAllUniversities_result() { + } + + public getAllUniversities_result( + List<String> success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public getAllUniversities_result(getAllUniversities_result other) { + if (other.isSetSuccess()) { + List<String> __this__success = new ArrayList<String>(other.success); + this.success = __this__success; + } + } + + public getAllUniversities_result deepCopy() { + return new getAllUniversities_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public java.util.Iterator<String> getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(String elem) { + if (this.success == null) { + this.success = new ArrayList<String>(); + } + this.success.add(elem); + } + + public List<String> getSuccess() { + return this.success; + } + + public getAllUniversities_result setSuccess(List<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((List<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 getAllUniversities_result) + return this.equals((getAllUniversities_result)that); + return false; + } + + public boolean equals(getAllUniversities_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(getAllUniversities_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("getAllUniversities_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 getAllUniversities_resultStandardSchemeFactory implements SchemeFactory { + public getAllUniversities_resultStandardScheme getScheme() { + return new getAllUniversities_resultStandardScheme(); + } + } + + private static class getAllUniversities_resultStandardScheme extends StandardScheme<getAllUniversities_result> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getAllUniversities_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.LIST) { + { + org.apache.thrift.protocol.TList _list24 = iprot.readListBegin(); + struct.success = new ArrayList<String>(_list24.size); + for (int _i25 = 0; _i25 < _list24.size; ++_i25) + { + String _elem26; + _elem26 = iprot.readString(); + struct.success.add(_elem26); + } + iprot.readListEnd(); + } + 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, getAllUniversities_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.success.size())); + for (String _iter27 : struct.success) + { + oprot.writeString(_iter27); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getAllUniversities_resultTupleSchemeFactory implements SchemeFactory { + public getAllUniversities_resultTupleScheme getScheme() { + return new getAllUniversities_resultTupleScheme(); + } + } + + private static class getAllUniversities_resultTupleScheme extends TupleScheme<getAllUniversities_result> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getAllUniversities_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 (String _iter28 : struct.success) + { + oprot.writeString(_iter28); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getAllUniversities_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list29 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.success = new ArrayList<String>(_list29.size); + for (int _i30 = 0; _i30 < _list29.size; ++_i30) + { + String _elem31; + _elem31 = iprot.readString(); + struct.success.add(_elem31); + } + } + struct.setSuccessIsSet(true); + } + } + } + + } + public static class getPersonData_args implements org.apache.thrift.TBase<getPersonData_args, getPersonData_args._Fields>, java.io.Serializable, Cloneable, Comparable<getPersonData_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPersonData_args"); @@ -9743,15 +10520,15 @@ public class Server { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { - org.apache.thrift.protocol.TMap _map24 = iprot.readMapBegin(); - struct.success = new HashMap<String,String>(2*_map24.size); - for (int _i25 = 0; _i25 < _map24.size; ++_i25) + org.apache.thrift.protocol.TMap _map32 = iprot.readMapBegin(); + struct.success = new HashMap<String,String>(2*_map32.size); + for (int _i33 = 0; _i33 < _map32.size; ++_i33) { - String _key26; - String _val27; - _key26 = iprot.readString(); - _val27 = iprot.readString(); - struct.success.put(_key26, _val27); + String _key34; + String _val35; + _key34 = iprot.readString(); + _val35 = iprot.readString(); + struct.success.put(_key34, _val35); } iprot.readMapEnd(); } @@ -9779,10 +10556,10 @@ public class Server { 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> _iter28 : struct.success.entrySet()) + for (Map.Entry<String, String> _iter36 : struct.success.entrySet()) { - oprot.writeString(_iter28.getKey()); - oprot.writeString(_iter28.getValue()); + oprot.writeString(_iter36.getKey()); + oprot.writeString(_iter36.getValue()); } oprot.writeMapEnd(); } @@ -9813,10 +10590,10 @@ public class Server { if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); - for (Map.Entry<String, String> _iter29 : struct.success.entrySet()) + for (Map.Entry<String, String> _iter37 : struct.success.entrySet()) { - oprot.writeString(_iter29.getKey()); - oprot.writeString(_iter29.getValue()); + oprot.writeString(_iter37.getKey()); + oprot.writeString(_iter37.getValue()); } } } @@ -9828,15 +10605,15 @@ public class Server { BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { { - org.apache.thrift.protocol.TMap _map30 = 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*_map30.size); - for (int _i31 = 0; _i31 < _map30.size; ++_i31) + org.apache.thrift.protocol.TMap _map38 = 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*_map38.size); + for (int _i39 = 0; _i39 < _map38.size; ++_i39) { - String _key32; - String _val33; - _key32 = iprot.readString(); - _val33 = iprot.readString(); - struct.success.put(_key32, _val33); + String _key40; + String _val41; + _key40 = iprot.readString(); + _val41 = iprot.readString(); + struct.success.put(_key40, _val41); } } struct.setSuccessIsSet(true); @@ -13317,15 +14094,15 @@ public class Server { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { - org.apache.thrift.protocol.TMap _map34 = iprot.readMapBegin(); - struct.success = new HashMap<String,String>(2*_map34.size); - for (int _i35 = 0; _i35 < _map34.size; ++_i35) + org.apache.thrift.protocol.TMap _map42 = iprot.readMapBegin(); + struct.success = new HashMap<String,String>(2*_map42.size); + for (int _i43 = 0; _i43 < _map42.size; ++_i43) { - String _key36; - String _val37; - _key36 = iprot.readString(); - _val37 = iprot.readString(); - struct.success.put(_key36, _val37); + String _key44; + String _val45; + _key44 = iprot.readString(); + _val45 = iprot.readString(); + struct.success.put(_key44, _val45); } iprot.readMapEnd(); } @@ -13353,10 +14130,10 @@ public class Server { 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> _iter38 : struct.success.entrySet()) + for (Map.Entry<String, String> _iter46 : struct.success.entrySet()) { - oprot.writeString(_iter38.getKey()); - oprot.writeString(_iter38.getValue()); + oprot.writeString(_iter46.getKey()); + oprot.writeString(_iter46.getValue()); } oprot.writeMapEnd(); } @@ -13387,10 +14164,10 @@ public class Server { if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); - for (Map.Entry<String, String> _iter39 : struct.success.entrySet()) + for (Map.Entry<String, String> _iter47 : struct.success.entrySet()) { - oprot.writeString(_iter39.getKey()); - oprot.writeString(_iter39.getValue()); + oprot.writeString(_iter47.getKey()); + oprot.writeString(_iter47.getValue()); } } } @@ -13402,15 +14179,15 @@ public class Server { BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { { - org.apache.thrift.protocol.TMap _map40 = 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*_map40.size); - for (int _i41 = 0; _i41 < _map40.size; ++_i41) + org.apache.thrift.protocol.TMap _map48 = 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*_map48.size); + for (int _i49 = 0; _i49 < _map48.size; ++_i49) { - String _key42; - String _val43; - _key42 = iprot.readString(); - _val43 = iprot.readString(); - struct.success.put(_key42, _val43); + String _key50; + String _val51; + _key50 = iprot.readString(); + _val51 = iprot.readString(); + struct.success.put(_key50, _val51); } } struct.setSuccessIsSet(true); @@ -15847,15 +16624,15 @@ public class Server { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { - org.apache.thrift.protocol.TMap _map44 = iprot.readMapBegin(); - struct.success = new HashMap<String,String>(2*_map44.size); - for (int _i45 = 0; _i45 < _map44.size; ++_i45) + 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 _key46; - String _val47; - _key46 = iprot.readString(); - _val47 = iprot.readString(); - struct.success.put(_key46, _val47); + String _key54; + String _val55; + _key54 = iprot.readString(); + _val55 = iprot.readString(); + struct.success.put(_key54, _val55); } iprot.readMapEnd(); } @@ -15883,10 +16660,10 @@ public class Server { 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> _iter48 : struct.success.entrySet()) + for (Map.Entry<String, String> _iter56 : struct.success.entrySet()) { - oprot.writeString(_iter48.getKey()); - oprot.writeString(_iter48.getValue()); + oprot.writeString(_iter56.getKey()); + oprot.writeString(_iter56.getValue()); } oprot.writeMapEnd(); } @@ -15917,10 +16694,10 @@ public class Server { if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); - for (Map.Entry<String, String> _iter49 : struct.success.entrySet()) + for (Map.Entry<String, String> _iter57 : struct.success.entrySet()) { - oprot.writeString(_iter49.getKey()); - oprot.writeString(_iter49.getValue()); + oprot.writeString(_iter57.getKey()); + oprot.writeString(_iter57.getValue()); } } } @@ -15932,15 +16709,15 @@ public class Server { BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { { - org.apache.thrift.protocol.TMap _map50 = 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*_map50.size); - for (int _i51 = 0; _i51 < _map50.size; ++_i51) + 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 _key52; - String _val53; - _key52 = iprot.readString(); - _val53 = iprot.readString(); - struct.success.put(_key52, _val53); + String _key60; + String _val61; + _key60 = iprot.readString(); + _val61 = iprot.readString(); + struct.success.put(_key60, _val61); } } struct.setSuccessIsSet(true); diff --git a/Dozentenmodulserver/src/server/ServerHandler.java b/Dozentenmodulserver/src/server/ServerHandler.java index b6a50952..6534ca3d 100644 --- a/Dozentenmodulserver/src/server/ServerHandler.java +++ b/Dozentenmodulserver/src/server/ServerHandler.java @@ -397,5 +397,11 @@ public class ServerHandler implements Server.Iface { return sql.deleteLecture(id); } + + @Override + public List<String> getAllUniversities() throws TException { + return sql.getAllUniversities(); + + } } diff --git a/Dozentenmodulserver/src/sql/SQL.java b/Dozentenmodulserver/src/sql/SQL.java index 98fc8ef7..ec768a40 100644 --- a/Dozentenmodulserver/src/sql/SQL.java +++ b/Dozentenmodulserver/src/sql/SQL.java @@ -487,7 +487,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 FROM bwLehrpool.m_VLData_imageInfo where GUID_imageID = '"
+ .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 + "' ;");
while (data.next()) {
map.put("name", data.getString("image_name"));
@@ -499,6 +499,7 @@ public class SQL { map.put("shareMode", data.getString("image_syncMode"));
map.put("filesize", data.getString("image_filesize"));
map.put("path", data.getString("image_path"));
+ map.put("template", data.getString("image_isTemplate"));
}
con.close();
return map;
@@ -750,4 +751,26 @@ public class SQL { }
return -1;
}
+
+ public List<String> getAllUniversities() {
+ List<String> list = new ArrayList<>();
+ try {
+ Connection con=getConnection();
+ Statement stm = con.createStatement();
+ ResultSet rs=stm
+ .executeQuery("SELECT name FROM bwLehrpool.m_institution;");
+ while (rs.next()) {
+ list.add(rs.getString("name"));
+ }
+ return list;
+
+ } catch (SQLException e) {
+ // TODO Auto-generated catch block
+ log.info(new Date() + " - Failed to getAllUniversities.");
+ e.printStackTrace();
+ }
+
+ return null;
+
+ }
}
diff --git a/Dozentenmodulserver/thrift/server.thrift b/Dozentenmodulserver/thrift/server.thrift index 84cd3fc2..46b228ac 100644 --- a/Dozentenmodulserver/thrift/server.thrift +++ b/Dozentenmodulserver/thrift/server.thrift @@ -40,6 +40,7 @@ service Server{ list<Image> getImageList(), list<Lecture> getLectureList(), list<string> getAllOS(), + list<string> getAllUniversities(), map<string,string> getPersonData(string Vorname, string Nachname), 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), diff --git a/bwLehrpool_ServerMaintenance/src/sql/sql.java b/bwLehrpool_ServerMaintenance/src/sql/sql.java index dd8f9a39..b3b20a89 100644 --- a/bwLehrpool_ServerMaintenance/src/sql/sql.java +++ b/bwLehrpool_ServerMaintenance/src/sql/sql.java @@ -15,7 +15,7 @@ import org.ini4j.Wini; public class sql { public Connection getConnection() { - try { + try { Class.forName("com.mysql.jdbc.Driver").newInstance(); } catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) { |
