From 6087485e7fc8072f73e5bdc72e752f138ea262d7 Mon Sep 17 00:00:00 2001 From: Michael Wilson Date: Mon, 24 Nov 2014 13:38:04 +0100 Subject: • corrected typo --- .../src/main/java/gui/lecture/PermissionCreateLecture_GUI.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'dozentenmodul/src/main/java') diff --git a/dozentenmodul/src/main/java/gui/lecture/PermissionCreateLecture_GUI.java b/dozentenmodul/src/main/java/gui/lecture/PermissionCreateLecture_GUI.java index 2fb0cc7a..1b7f8077 100644 --- a/dozentenmodul/src/main/java/gui/lecture/PermissionCreateLecture_GUI.java +++ b/dozentenmodul/src/main/java/gui/lecture/PermissionCreateLecture_GUI.java @@ -324,7 +324,7 @@ public class PermissionCreateLecture_GUI extends JFrame { panel.add(label_5); JLabel label_7 = new JLabel( - "Veranstaltung ist in bwLehrpool Suite und VMchooser für sichtbar.."); + "Veranstaltung ist in bwLehrpool Suite und VMchooser sichtbar.."); label_7.setBounds(128, 18, 380, 20); panel.add(label_7); -- cgit v1.2.3-55-g7522 From 825db01db2f2016d9458dcde4a79a9e664b46d54 Mon Sep 17 00:00:00 2001 From: Michael Wilson Date: Mon, 24 Nov 2014 16:32:22 +0100 Subject: • role admin can now always call the permission page --- dozentenmodul/src/main/java/gui/image/EditImageTechnisch_GUI.java | 2 +- dozentenmodul/src/main/java/gui/image/FTPEditUploader_GUI.java | 2 +- dozentenmodul/src/main/java/gui/lecture/EditLectureAllgemein_GUI.java | 2 +- dozentenmodul/src/main/java/gui/lecture/EditLectureLink_GUI.java | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'dozentenmodul/src/main/java') diff --git a/dozentenmodul/src/main/java/gui/image/EditImageTechnisch_GUI.java b/dozentenmodul/src/main/java/gui/image/EditImageTechnisch_GUI.java index f9701a0c..5ecda8d7 100644 --- a/dozentenmodul/src/main/java/gui/image/EditImageTechnisch_GUI.java +++ b/dozentenmodul/src/main/java/gui/image/EditImageTechnisch_GUI.java @@ -355,7 +355,7 @@ public class EditImageTechnisch_GUI extends JFrame { try { //check if user may change permissions and choose window - if(client.userIsImageAdmin(person.verantwortlicher.getUserID(),Image.image.getImageId()) == true){ + if( (client.userIsImageAdmin(person.verantwortlicher.getUserID(),Image.image.getImageId()) == true) || (person.verantwortlicher.getRole().equals("Admin")) ){ //user has permission, go to permission GUI PermissionEditImage_GUI ea=new PermissionEditImage_GUI(c); ea.setVisible(true); diff --git a/dozentenmodul/src/main/java/gui/image/FTPEditUploader_GUI.java b/dozentenmodul/src/main/java/gui/image/FTPEditUploader_GUI.java index 415e3dee..937479a9 100644 --- a/dozentenmodul/src/main/java/gui/image/FTPEditUploader_GUI.java +++ b/dozentenmodul/src/main/java/gui/image/FTPEditUploader_GUI.java @@ -455,7 +455,7 @@ public class FTPEditUploader_GUI extends JFrame implements // not loading files, go back one page try { - if(client.userIsImageAdmin(person.verantwortlicher.getUserID(), Image.image.getImageId()) == true){ + if( (client.userIsImageAdmin(person.verantwortlicher.getUserID(), Image.image.getImageId()) == true) || person.verantwortlicher.getRole().equals("Admin") ){ //user is admin and may change permissions PermissionEditImage_GUI ei = new PermissionEditImage_GUI(c); ei.setVisible(true); diff --git a/dozentenmodul/src/main/java/gui/lecture/EditLectureAllgemein_GUI.java b/dozentenmodul/src/main/java/gui/lecture/EditLectureAllgemein_GUI.java index 1d144c89..2168cfdc 100644 --- a/dozentenmodul/src/main/java/gui/lecture/EditLectureAllgemein_GUI.java +++ b/dozentenmodul/src/main/java/gui/lecture/EditLectureAllgemein_GUI.java @@ -498,7 +498,7 @@ public class EditLectureAllgemein_GUI extends JFrame { //check which GUI to open try { - if(client.userIsLectureAdmin(person.verantwortlicher.getUserID(), Lecture.lecture.getid())){ + if( (client.userIsLectureAdmin(person.verantwortlicher.getUserID(), Lecture.lecture.getid()) ==true) || (person.verantwortlicher.getRole().equals("Admin")) ){ //user is admin of the lecture PermissionEditLecture_GUI ev = new PermissionEditLecture_GUI(c); ev.setVisible(true); diff --git a/dozentenmodul/src/main/java/gui/lecture/EditLectureLink_GUI.java b/dozentenmodul/src/main/java/gui/lecture/EditLectureLink_GUI.java index d1fe57e3..090773c6 100644 --- a/dozentenmodul/src/main/java/gui/lecture/EditLectureLink_GUI.java +++ b/dozentenmodul/src/main/java/gui/lecture/EditLectureLink_GUI.java @@ -630,7 +630,7 @@ public class EditLectureLink_GUI extends JFrame { //check which GUI to open try { - if(client.userIsLectureAdmin(person.verantwortlicher.getUserID(), Lecture.lecture.getid())){ + if( (client.userIsLectureAdmin(person.verantwortlicher.getUserID(), Lecture.lecture.getid())==true) || (person.verantwortlicher.getRole().equals("Admin")) ){ //user is admin of the lecture PermissionEditLecture_GUI ev = new PermissionEditLecture_GUI(c); ev.setVisible(true); -- cgit v1.2.3-55-g7522 From 1f395abfa84be8f2b4bde117e513fffe9f06f6d3 Mon Sep 17 00:00:00 2001 From: Michael Wilson Date: Mon, 24 Nov 2014 16:51:07 +0100 Subject: • Table cells setEditable false --- dozentenmodul/src/main/java/gui/lecture/DeleteLecture_GUI.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'dozentenmodul/src/main/java') diff --git a/dozentenmodul/src/main/java/gui/lecture/DeleteLecture_GUI.java b/dozentenmodul/src/main/java/gui/lecture/DeleteLecture_GUI.java index 58fadc72..e6b178a6 100644 --- a/dozentenmodul/src/main/java/gui/lecture/DeleteLecture_GUI.java +++ b/dozentenmodul/src/main/java/gui/lecture/DeleteLecture_GUI.java @@ -91,7 +91,14 @@ public class DeleteLecture_GUI extends JFrame { ThriftConnection con = new ThriftConnection(); Client client = models.Client.clientcon.getClient(); - final DefaultTableModel modelMyLectures = new DefaultTableModel(titles, 0); + final DefaultTableModel modelMyLectures = new DefaultTableModel(titles, 0){ + public boolean isCellEditable(int rowIndex, int mColIndex) { + return false; + } + }; + + + final TableRowSorter rowSorterMyLectures = new TableRowSorter( modelMyLectures); -- cgit v1.2.3-55-g7522 From f12647d7d95d675fefbf1e488d055cad54783235 Mon Sep 17 00:00:00 2001 From: Michael Wilson Date: Mon, 24 Nov 2014 17:22:43 +0100 Subject: • All Fonts checked and corrected --- .../main/java/gui/image/FTPCreateUploader_GUI.java | 220 +++++++++++---------- .../main/java/gui/image/FTPEditDownloader_GUI.java | 56 +++--- .../main/java/gui/image/FTPEditUploader_GUI.java | 10 + .../java/gui/lecture/CreateLectureLink_GUI.java | 1 + .../main/java/gui/lecture/EditLectureLink_GUI.java | 1 + 5 files changed, 160 insertions(+), 128 deletions(-) (limited to 'dozentenmodul/src/main/java') diff --git a/dozentenmodul/src/main/java/gui/image/FTPCreateUploader_GUI.java b/dozentenmodul/src/main/java/gui/image/FTPCreateUploader_GUI.java index 80c88c98..61e97b57 100644 --- a/dozentenmodul/src/main/java/gui/image/FTPCreateUploader_GUI.java +++ b/dozentenmodul/src/main/java/gui/image/FTPCreateUploader_GUI.java @@ -63,8 +63,8 @@ public class FTPCreateUploader_GUI extends JFrame implements /** * Logger instance for this class. */ - private final static Logger LOGGER = Logger.getLogger(FTPCreateUploader_GUI.class); - + private final static Logger LOGGER = Logger + .getLogger(FTPCreateUploader_GUI.class); @SuppressWarnings("unused") private JPanel contentPane; @@ -99,18 +99,15 @@ public class FTPCreateUploader_GUI extends JFrame implements private boolean isCurrentlyLoading = false; // currently up or downloading // file Component c = null; - private boolean isAborted = false; //down- or upload was manually aborted + private boolean isAborted = false; // down- or upload was manually aborted private String uuid; - - private static final String HELP_MESSAGE = "
" + - "Laden Sie hier Ihre .vmdk-Datei hoch, die dann als virtuelles Labor geladen werden kann.
" + - "Wichtig ist, dass Sie zum Schluss auf \"Fertigstellen\" klicken, damit die Daten übernommen werden.
" + - "Wenn Sie die Datei hochgeladen haben, dann aber auf \"zurück\" klicken, oder die Anwendung beenden,
" + - "werden die Daten NICHT übernommen und auch die .vmdk-Datei wird nicht aktiv geschaltet." + - "
"; - - + private static final String HELP_MESSAGE = "
" + + "Laden Sie hier Ihre .vmdk-Datei hoch, die dann als virtuelles Labor geladen werden kann.
" + + "Wichtig ist, dass Sie zum Schluss auf \"Fertigstellen\" klicken, damit die Daten übernommen werden.
" + + "Wenn Sie die Datei hochgeladen haben, dann aber auf \"zurück\" klicken, oder die Anwendung beenden,
" + + "werden die Daten NICHT übernommen und auch die .vmdk-Datei wird nicht aktiv geschaltet." + + "
"; /** * Create the frame. @@ -118,13 +115,12 @@ public class FTPCreateUploader_GUI extends JFrame implements public FTPCreateUploader_GUI(Component formerGUI) { final Object[] options = { "Beenden", "Abbrechen" }; - - try - { + + try { client.setTokenForSession(SessionData.session.getAuthToken()); - uuid = client.createRandomUUID(); + uuid = client.createRandomUUID(); } catch (TException e1) { - // TODO Auto-generated catch block + e1.printStackTrace(); } @@ -148,7 +144,7 @@ public class FTPCreateUploader_GUI extends JFrame implements try { client.DeleteFtpUser(user.userName); } catch (TException e1) { - // TODO Auto-generated catch block + e1.printStackTrace(); } task.cancel(true); @@ -162,12 +158,12 @@ public class FTPCreateUploader_GUI extends JFrame implements }// end window closing }); setResizable(false); - + try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e) { - // TODO Auto-generated catch block + e.printStackTrace(); JOptionPane.showMessageDialog(c, e.getCause() + "\n" + e.getStackTrace(), "Debug-Message", @@ -182,7 +178,6 @@ public class FTPCreateUploader_GUI extends JFrame implements setBounds(0, 0, 603, 722); setLocationRelativeTo(formerGUI); - getContentPane().setLayout(new BorderLayout()); contentPanel.setBackground(SystemColor.menu); @@ -389,7 +384,7 @@ public class FTPCreateUploader_GUI extends JFrame implements client.DeleteFtpUser(user.userName); LOGGER.info("Deleted FTP user."); } catch (TException e1) { - // TODO Auto-generated catch block + e1.printStackTrace(); } task.cancel(true); @@ -412,19 +407,28 @@ public class FTPCreateUploader_GUI extends JFrame implements btnFinish.setEnabled(false); btnFinish.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { - - //save data + + // save data boolean success = writeData(); - if(success==true){ - LOGGER.info("Neues Image '"+Image.image.getImagename()+"' erfolgreich gespeichert."); - JOptionPane.showMessageDialog(c, - "Die Daten wurden erfolgreich gespeichert.", "Daten gespeichert", - JOptionPane.INFORMATION_MESSAGE); + if (success == true) { + LOGGER.info("Neues Image '" + + Image.image.getImagename() + + "' erfolgreich gespeichert."); + JOptionPane + .showMessageDialog( + c, + "Die Daten wurden erfolgreich gespeichert.", + "Daten gespeichert", + JOptionPane.INFORMATION_MESSAGE); } else { - LOGGER.info("Neues Image '"+Image.image.getImagename()+"' konnte nicht gespeichert werden."); - JOptionPane.showMessageDialog(c, - "Die Daten konnten nicht gespeichert werden.", "Fehler", - JOptionPane.ERROR_MESSAGE); + LOGGER.info("Neues Image '" + + Image.image.getImagename() + + "' konnte nicht gespeichert werden."); + JOptionPane + .showMessageDialog( + c, + "Die Daten konnten nicht gespeichert werden.", + "Fehler", JOptionPane.ERROR_MESSAGE); } File f = new File(lblPath.getText().trim()); @@ -436,24 +440,22 @@ public class FTPCreateUploader_GUI extends JFrame implements Config.setLastUploadPath(f.getParentFile() .toString()); } - + // save configuration Config.store(); dispose(); MainMenue_GUI m = new MainMenue_GUI(c); m.setVisible(true); - + if (taskrun == true) { try { client.DeleteFtpUser(user.userName); } catch (TException e1) { - // TODO Auto-generated catch block + e1.printStackTrace(); - JOptionPane.showMessageDialog( - c, - e1.getCause() + "\n" - + e1.getStackTrace(), + JOptionPane.showMessageDialog(c, e1.getCause() + + "\n" + e1.getStackTrace(), "Debug-Message", JOptionPane.ERROR_MESSAGE); } @@ -480,18 +482,18 @@ public class FTPCreateUploader_GUI extends JFrame implements 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(c); - //m.setVisible(true); + PermissionCreateImage_GUI m = new PermissionCreateImage_GUI( + c); + // m.setVisible(true); }// end if choice } else { - int selectedOption = JOptionPane .showConfirmDialog( @@ -500,17 +502,17 @@ public class FTPCreateUploader_GUI extends JFrame implements "Abbrechen und zurück", JOptionPane.YES_NO_OPTION); if (selectedOption == JOptionPane.YES_OPTION) { - //System.out.println("CreateUploader X:"+formerGUI.getLocation().getX()); - //System.out.println("CreateUploader X:"+formerGUI.getLocation().getY()); - PermissionCreateImage_GUI m = new PermissionCreateImage_GUI(c); - //m.setLocationRelativeTo(formerGUI); + // System.out.println("CreateUploader X:"+formerGUI.getLocation().getX()); + // System.out.println("CreateUploader X:"+formerGUI.getLocation().getY()); + PermissionCreateImage_GUI m = new PermissionCreateImage_GUI( + c); + // m.setLocationRelativeTo(formerGUI); m.setVisible(true); dispose(); - + } else { // for actions if "no" is selected. tbd. } - }// end else }// end action @@ -538,7 +540,7 @@ public class FTPCreateUploader_GUI extends JFrame implements windows = new URI(Links.getFAQ()); OpenLinks.openWebpage(windows); } catch (URISyntaxException e) { - // TODO Auto-generated catch block + e.printStackTrace(); } } @@ -556,7 +558,7 @@ public class FTPCreateUploader_GUI extends JFrame implements windows = new URI(Links.getOTRS()); open.openWebpage(windows); } catch (URISyntaxException e) { - // TODO Auto-generated catch block + e.printStackTrace(); } } @@ -572,16 +574,18 @@ public class FTPCreateUploader_GUI extends JFrame implements }); menu.add(mntmAbout); setVisible(true); - + JMenu mnNewMenu_Info = new JMenu("Info"); mnNewMenu_Info.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent arg0) { - JOptionPane.showMessageDialog(c, HELP_MESSAGE, "Hilfe zu dieser Oberfläche", JOptionPane.INFORMATION_MESSAGE); + JOptionPane.showMessageDialog(c, HELP_MESSAGE, + "Hilfe zu dieser Oberfläche", + JOptionPane.INFORMATION_MESSAGE); } }); menuBar.add(mnNewMenu_Info); - + c = this; } @@ -596,11 +600,11 @@ public class FTPCreateUploader_GUI extends JFrame implements LOGGER.info("Getting FTP User..."); user = client.getFtpUser(); LOGGER.info("Received FTP user."); - //LOGGER.debug("FTP name: " + user.userName); - //LOGGER.debug("FTP path: " + user.path); - //LOGGER.debug("FTP pass: " + user.password); + // LOGGER.debug("FTP name: " + user.userName); + // LOGGER.debug("FTP path: " + user.path); + // LOGGER.debug("FTP pass: " + user.password); } catch (TException e) { - // TODO Auto-generated catch block + LOGGER.error("Konnte vom Satellit keinen FTP-User erhalten!"); e.printStackTrace(); JOptionPane.showMessageDialog(c, @@ -609,10 +613,10 @@ public class FTPCreateUploader_GUI extends JFrame implements } DateFormat formatter = new SimpleDateFormat("yyyMMddHHmmss"); - //LOGGER.info("Setting new name: " + formatter.format(new Date()) + "_" - // + person.verantwortlicher.getHochschule() + "_" - // + person.verantwortlicher.getUsername() + "_" - // + Image.image.getImagename() + ".vmdk"); + // LOGGER.info("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() + "_" @@ -640,9 +644,10 @@ public class FTPCreateUploader_GUI extends JFrame implements // Fertigstellen erlauben wenn upload abgeschlossen und abbrechen // erlauben wenn kein load aktiv ist - if (isCurrentlyLoading() == false || progressBar.getPercentComplete() == 1.0) { + if (isCurrentlyLoading() == false + || progressBar.getPercentComplete() == 1.0) { // no upload - //LOGGER.info("finished uploading file"); + // LOGGER.info("finished uploading file"); btnUploadStoppen.setEnabled(false); btnFinish.setEnabled(true); } else { @@ -655,8 +660,7 @@ public class FTPCreateUploader_GUI extends JFrame implements speed = (double) arg0.getNewValue(); // if(speed<=1){ - lblUpSpeed.setText(String.format("%.2f", speed) - + " MB/s"); + lblUpSpeed.setText(String.format("%.2f", speed) + " MB/s"); } if ("bytesread" == arg0.getPropertyName()) { @@ -688,7 +692,7 @@ public class FTPCreateUploader_GUI extends JFrame implements public boolean writeData() { try { - + client.writeVLdata(Image.image.getImagename(), Image.image.getDesc(), person.verantwortlicher.getUsername(), @@ -698,16 +702,11 @@ public class FTPCreateUploader_GUI extends JFrame implements person.verantwortlicher.getEMail(), 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.getOS(), - uuid); + 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.getOS(), uuid); client.startFileCopy(Image.image.getNewName()); @@ -717,36 +716,45 @@ public class FTPCreateUploader_GUI extends JFrame implements person.verantwortlicher.getVorname(), person.verantwortlicher.getEMail(), person.verantwortlicher.getHochschule(), - person.verantwortlicher.getRole() - ); - - for(int i=0; i< RightsManagement.rightsManagement.getPermittedUserList().size(); i++) - { - //System.out.println("Writing additional rights for user "+RightsManagement.rightsManagement.getPermittedUserList().get(i).getUserID()+", User "+i+"/"+RightsManagement.rightsManagement.getPermittedUserList().size()); - client.writeAdditionalImageRights( - uuid, - RightsManagement.rightsManagement.getPermittedUserList().get(i).getUserID(), - RightsManagement.rightsManagement.getPermittedUserList().get(i).isImageRead(), - RightsManagement.rightsManagement.getPermittedUserList().get(i).isImageWrite(), - RightsManagement.rightsManagement.getPermittedUserList().get(i).isImageLinkAllowed(), - RightsManagement.rightsManagement.getPermittedUserList().get(i).isImageAdmin() - ); + person.verantwortlicher.getRole()); + + for (int i = 0; i < RightsManagement.rightsManagement + .getPermittedUserList().size(); i++) { + // System.out.println("Writing additional rights for user "+RightsManagement.rightsManagement.getPermittedUserList().get(i).getUserID()+", User "+i+"/"+RightsManagement.rightsManagement.getPermittedUserList().size()); + client.writeAdditionalImageRights(uuid, + RightsManagement.rightsManagement + .getPermittedUserList().get(i).getUserID(), + RightsManagement.rightsManagement + .getPermittedUserList().get(i).isImageRead(), + RightsManagement.rightsManagement + .getPermittedUserList().get(i).isImageWrite(), + RightsManagement.rightsManagement + .getPermittedUserList().get(i) + .isImageLinkAllowed(), + RightsManagement.rightsManagement + .getPermittedUserList().get(i).isImageAdmin()); /* - LOGGER.info( - "Name: "+Image.image.getImagename() - +"\tUserID: "+RightsManagement.rightsManagement.getPermittedUserList().get(i).getUserID() - +"\tisImageRead: "+RightsManagement.rightsManagement.getPermittedUserList().get(i).isImageRead() - +"\tisImageWrite: "+RightsManagement.rightsManagement.getPermittedUserList().get(i).isImageWrite() - +"\tisImageLInkAllowed: "+RightsManagement.rightsManagement.getPermittedUserList().get(i).isImageLinkAllowed() - +"\tisImageAdmin: "+RightsManagement.rightsManagement.getPermittedUserList().get(i).isImageAdmin() - ); - */ - - }//end for - - + * LOGGER.info( "Name: "+Image.image.getImagename() + * +"\tUserID: " + * +RightsManagement.rightsManagement.getPermittedUserList + * ().get(i).getUserID() + * +"\tisImageRead: "+RightsManagement.rightsManagement + * .getPermittedUserList().get(i).isImageRead() + * +"\tisImageWrite: " + * +RightsManagement.rightsManagement.getPermittedUserList + * ().get(i).isImageWrite() + * +"\tisImageLInkAllowed: "+RightsManagement + * .rightsManagement.getPermittedUserList + * ().get(i).isImageLinkAllowed() + * +"\tisImageAdmin: "+RightsManagement + * .rightsManagement.getPermittedUserList + * ().get(i).isImageAdmin() ); + */ + + }// end for + } catch (TException e) { - // TODO Auto-generated catch block + e.printStackTrace(); JOptionPane.showMessageDialog(c, e.getCause() + "\n" + e.getStackTrace(), "Debug-Message", diff --git a/dozentenmodul/src/main/java/gui/image/FTPEditDownloader_GUI.java b/dozentenmodul/src/main/java/gui/image/FTPEditDownloader_GUI.java index a3e4c6cf..a9bd4880 100644 --- a/dozentenmodul/src/main/java/gui/image/FTPEditDownloader_GUI.java +++ b/dozentenmodul/src/main/java/gui/image/FTPEditDownloader_GUI.java @@ -98,20 +98,20 @@ public class FTPEditDownloader_GUI extends JFrame implements private boolean isCurrentlyLoading = false; // currently up or downloading // file private boolean isAborted = false; // down- or upload was manually aborted - private static final String HELP_MESSAGE = "
" + - "Hier können Sie Images herunterladen.
" + - "Klicken Sie anschließend auf \"Zurück\", um zu Ihrer vorherigen Auswahl zurückzugelangen.
" + - "
"; + private static final String HELP_MESSAGE = "
" + + "Hier können Sie Images herunterladen.
" + + "Klicken Sie anschließend auf \"Zurück\", um zu Ihrer vorherigen Auswahl zurückzugelangen.
" + + "
"; /** * Create the frame. */ public FTPEditDownloader_GUI(Component formerGUI) { - + try { client.setTokenForSession(SessionData.session.getAuthToken()); } catch (TException e1) { - // TODO Auto-generated catch block + e1.printStackTrace(); } @@ -136,7 +136,7 @@ public class FTPEditDownloader_GUI extends JFrame implements client.DeleteFtpUser(user.userName); con.closeThriftConnection(); } catch (TException e1) { - // TODO Auto-generated catch block + e1.printStackTrace(); } task.cancel(true); @@ -153,7 +153,7 @@ public class FTPEditDownloader_GUI extends JFrame implements UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e) { - // TODO Auto-generated catch block + e.printStackTrace(); } @@ -304,6 +304,15 @@ public class FTPEditDownloader_GUI extends JFrame implements label_1.setForeground(Color.BLUE); label_1.setBounds(20, 92, 61, 20); contentPanel.add(label_1); + label_1.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent arg0) { + // oeffnet das Hauptmenue + dispose(); + MainMenue_GUI main = new MainMenue_GUI(c); + main.setVisible(true); + } + }); JLabel label_2 = new JLabel(">"); label_2.setBounds(80, 95, 14, 14); @@ -338,8 +347,7 @@ public class FTPEditDownloader_GUI extends JFrame implements lblSchritt_3.setBounds(20, 423, 57, 14); contentPanel.add(lblSchritt_3); - JLabel lblKlickenSieAuf = new JLabel( - "Klicken Sie auf \"Zurück\"."); + JLabel lblKlickenSieAuf = new JLabel("Klicken Sie auf \"Zurück\"."); lblKlickenSieAuf.setBounds(102, 423, 241, 14); contentPanel.add(lblKlickenSieAuf); @@ -360,7 +368,7 @@ public class FTPEditDownloader_GUI extends JFrame implements windows = new URI(Links.getFAQ()); open.openWebpage(windows); } catch (URISyntaxException e) { - // TODO Auto-generated catch block + e.printStackTrace(); } } @@ -378,7 +386,7 @@ public class FTPEditDownloader_GUI extends JFrame implements windows = new URI(Links.getOTRS()); open.openWebpage(windows); } catch (URISyntaxException e) { - // TODO Auto-generated catch block + e.printStackTrace(); } } @@ -408,7 +416,7 @@ public class FTPEditDownloader_GUI extends JFrame implements anleitung = new URI(Links.getAnleitungVMDK()); open.openWebpage(anleitung); } catch (URISyntaxException e) { - // TODO Auto-generated catch block + e.printStackTrace(); } } @@ -423,7 +431,7 @@ public class FTPEditDownloader_GUI extends JFrame implements client.DeleteFtpUser(user.userName); LOGGER.info("FTP user deleted."); } catch (TException e1) { - // TODO Auto-generated catch block + e1.printStackTrace(); } task.cancel(true); @@ -461,12 +469,13 @@ public class FTPEditDownloader_GUI extends JFrame implements try { client.DeleteFtpUser(user.userName); } catch (TException e1) { - // TODO Auto-generated catch block + e1.printStackTrace(); } // go back one page - SearchEditImage_GUI se = new SearchEditImage_GUI(c); + SearchEditImage_GUI se = new SearchEditImage_GUI( + c); se.setVisible(true); dispose(); }// end choice @@ -496,16 +505,18 @@ public class FTPEditDownloader_GUI extends JFrame implements } } setVisible(true); - + JMenu mnNewMenu_Info = new JMenu("Info"); mnNewMenu_Info.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent arg0) { - JOptionPane.showMessageDialog(c, HELP_MESSAGE, "Hilfe zu dieser Oberfläche", JOptionPane.INFORMATION_MESSAGE); + JOptionPane.showMessageDialog(c, HELP_MESSAGE, + "Hilfe zu dieser Oberfläche", + JOptionPane.INFORMATION_MESSAGE); } }); menuBar.add(mnNewMenu_Info); - + c = this; } @@ -526,7 +537,7 @@ public class FTPEditDownloader_GUI extends JFrame implements Image.image.getVersion()); } catch (TException e) { - // TODO Auto-generated catch block + e.printStackTrace(); JOptionPane.showMessageDialog(c, e.getCause() + "\n" + e.getStackTrace(), "Debug-Message", @@ -559,9 +570,10 @@ public class FTPEditDownloader_GUI extends JFrame implements } // Button zum Fertigstellen freischalten, wenn 100% erreicht sind - if (isCurrentlyLoading() == false || progressBar.getPercentComplete() == 1.0) { + if (isCurrentlyLoading() == false + || progressBar.getPercentComplete() == 1.0) { // no download - //LOGGER.info("finished downloading file"); + // LOGGER.info("finished downloading file"); btnDownloadStoppen.setEnabled(false); } else { // currently uploading, don't let user interact diff --git a/dozentenmodul/src/main/java/gui/image/FTPEditUploader_GUI.java b/dozentenmodul/src/main/java/gui/image/FTPEditUploader_GUI.java index 937479a9..4619e680 100644 --- a/dozentenmodul/src/main/java/gui/image/FTPEditUploader_GUI.java +++ b/dozentenmodul/src/main/java/gui/image/FTPEditUploader_GUI.java @@ -309,6 +309,16 @@ public class FTPEditUploader_GUI extends JFrame implements lblNewLabel_1.setForeground(Color.BLUE); lblNewLabel_1.setBounds(20, 88, 61, 20); contentPanel.add(lblNewLabel_1); + lblNewLabel_1.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent arg0) { + // oeffnet das Hauptmenue + dispose(); + MainMenue_GUI main = new MainMenue_GUI(c); + main.setVisible(true); + } + }); + JLabel label_3 = new JLabel(">"); label_3.setBounds(80, 91, 14, 14); diff --git a/dozentenmodul/src/main/java/gui/lecture/CreateLectureLink_GUI.java b/dozentenmodul/src/main/java/gui/lecture/CreateLectureLink_GUI.java index 8559c68a..8497bc93 100644 --- a/dozentenmodul/src/main/java/gui/lecture/CreateLectureLink_GUI.java +++ b/dozentenmodul/src/main/java/gui/lecture/CreateLectureLink_GUI.java @@ -671,6 +671,7 @@ public class CreateLectureLink_GUI extends JFrame { textAreadesc = new JTextArea(); textAreadesc.setLineWrap(true); textAreadesc.setBackground(SystemColor.menu); + textAreadesc.setFont(new Font("Tahoma", Font.PLAIN, 11)); scrollPane.setViewportView(textAreadesc); JMenuBar menuBar = new JMenuBar(); diff --git a/dozentenmodul/src/main/java/gui/lecture/EditLectureLink_GUI.java b/dozentenmodul/src/main/java/gui/lecture/EditLectureLink_GUI.java index 090773c6..4a0f010a 100644 --- a/dozentenmodul/src/main/java/gui/lecture/EditLectureLink_GUI.java +++ b/dozentenmodul/src/main/java/gui/lecture/EditLectureLink_GUI.java @@ -1137,6 +1137,7 @@ public class EditLectureLink_GUI extends JFrame { textAreadesc = new JTextArea(); textAreadesc.setLineWrap(true); textAreadesc.setBackground(SystemColor.menu); + textAreadesc.setFont(new Font("Tahoma", Font.PLAIN, 11)); scrollPane.setViewportView(textAreadesc); JMenuBar menuBar = new JMenuBar(); -- cgit v1.2.3-55-g7522 From 11d3a27284eb3a27e72edc850a2e68e4238c19d5 Mon Sep 17 00:00:00 2001 From: Michael Wilson Date: Wed, 26 Nov 2014 11:18:31 +0100 Subject: • Prozess "Erstellen eines Image" kann nun direkt weiterleiten zu "Erstellen einer Veranstalung" --- .../main/java/gui/image/FTPCreateUploader_GUI.java | 31 +++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) (limited to 'dozentenmodul/src/main/java') diff --git a/dozentenmodul/src/main/java/gui/image/FTPCreateUploader_GUI.java b/dozentenmodul/src/main/java/gui/image/FTPCreateUploader_GUI.java index 61e97b57..dcc0bfc7 100644 --- a/dozentenmodul/src/main/java/gui/image/FTPCreateUploader_GUI.java +++ b/dozentenmodul/src/main/java/gui/image/FTPCreateUploader_GUI.java @@ -55,6 +55,7 @@ import config.Config; import ftp.UploadTask; import gui.intro.About_GUI; import gui.intro.MainMenue_GUI; +import gui.lecture.CreateLectureAllgemein_GUI; @SuppressWarnings("serial") public class FTPCreateUploader_GUI extends JFrame implements @@ -443,9 +444,9 @@ public class FTPCreateUploader_GUI extends JFrame implements // save configuration Config.store(); - dispose(); - MainMenue_GUI m = new MainMenue_GUI(c); - m.setVisible(true); + // dispose(); + // MainMenue_GUI m = new MainMenue_GUI(c); + // m.setVisible(true); if (taskrun == true) { try { @@ -462,6 +463,30 @@ public class FTPCreateUploader_GUI extends JFrame implements task.cancel(true); } + + // Erstellung Array vom Datentyp Object, Hinzufügen der + // Optionen + Object[] options = { "Neue Veranstaltung erstellen", + "Zum Hauptmenü zurückkehren" }; + + int choice = JOptionPane.showOptionDialog(null, + "Möchten Sie eine neue Veranstaltung zu diesem Image erstellen oder in das Hauptmenü zurückkehren?", "Alternativen", + JOptionPane.DEFAULT_OPTION, + JOptionPane.INFORMATION_MESSAGE, null, options, + options[0]); + + // 0=New Lecture, 1=Main Menu + if (choice == 0) { + dispose(); + CreateLectureAllgemein_GUI cl = new CreateLectureAllgemein_GUI( + c); + cl.setVisible(true); + } else { + dispose(); + MainMenue_GUI m = new MainMenue_GUI(c); + m.setVisible(true); + } + } }); -- cgit v1.2.3-55-g7522 From 03a8d5c38261e0663327d2c6fe454956126d8136 Mon Sep 17 00:00:00 2001 From: Michael Wilson Date: Wed, 26 Nov 2014 15:12:06 +0100 Subject: • Image update now removes old file and avoids zombies --- .../main/java/gui/image/FTPCreateUploader_GUI.java | 2 +- .../src/main/java/gui/intro/MainMenue_GUI.java | 14 +- .../src/main/java/server/ServerHandler.java | 674 +++++------ .../src/main/java/server/generated/Server.java | 1272 ++++++++++++++++---- dozentenmodulserver/thrift/server.thrift | 1 + 5 files changed, 1370 insertions(+), 593 deletions(-) (limited to 'dozentenmodul/src/main/java') diff --git a/dozentenmodul/src/main/java/gui/image/FTPCreateUploader_GUI.java b/dozentenmodul/src/main/java/gui/image/FTPCreateUploader_GUI.java index dcc0bfc7..24df52be 100644 --- a/dozentenmodul/src/main/java/gui/image/FTPCreateUploader_GUI.java +++ b/dozentenmodul/src/main/java/gui/image/FTPCreateUploader_GUI.java @@ -469,7 +469,7 @@ public class FTPCreateUploader_GUI extends JFrame implements Object[] options = { "Neue Veranstaltung erstellen", "Zum Hauptmenü zurückkehren" }; - int choice = JOptionPane.showOptionDialog(null, + int choice = JOptionPane.showOptionDialog(c, "Möchten Sie eine neue Veranstaltung zu diesem Image erstellen oder in das Hauptmenü zurückkehren?", "Alternativen", JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE, null, options, diff --git a/dozentenmodul/src/main/java/gui/intro/MainMenue_GUI.java b/dozentenmodul/src/main/java/gui/intro/MainMenue_GUI.java index bd69571e..228cf831 100644 --- a/dozentenmodul/src/main/java/gui/intro/MainMenue_GUI.java +++ b/dozentenmodul/src/main/java/gui/intro/MainMenue_GUI.java @@ -458,19 +458,7 @@ public class MainMenue_GUI extends JFrame { JMenu mnNewMenu_1 = new JMenu("Hilfe"); menuBar.add(mnNewMenu_1); - - //Template for Help-Buttons - /* - JMenu mnNewMenu_Info = new JMenu("Info"); - mnNewMenu_Info.addMouseListener(new MouseAdapter() { - @Override - public void mouseClicked(MouseEvent arg0) { - JOptionPane.showMessageDialog(null, HELP_MESSAGE, "Hilfe zu dieser Oberfläche", JOptionPane.INFORMATION_MESSAGE); - } - }); - menuBar.add(mnNewMenu_Info); - * - */ + JMenuItem mntmFaq = new JMenuItem("FAQ"); diff --git a/dozentenmodulserver/src/main/java/server/ServerHandler.java b/dozentenmodulserver/src/main/java/server/ServerHandler.java index 820169d7..11f7d3ab 100644 --- a/dozentenmodulserver/src/main/java/server/ServerHandler.java +++ b/dozentenmodulserver/src/main/java/server/ServerHandler.java @@ -32,31 +32,25 @@ import thrift.MasterThriftConnection; import thrift.SessionData; import sql.SQL; + //import util.XMLCreator; -public class ServerHandler implements Server.Iface -{ - +public class ServerHandler implements Server.Iface { + private static Logger log = Logger.getLogger(ServerHandler.class); static SQL sql = new SQL(); Client client = null; - - public void setTokenForSession(String token) - { + public void setTokenForSession(String token) { SessionData.session.setAuthToken(token); } - - - - public boolean authenticated() throws InvalidTokenException - { + + public boolean authenticated() throws InvalidTokenException { MasterThriftConnection thrift = new MasterThriftConnection(); client = thrift.getMasterThriftConnection(); try { - if(client.getUserFromToken(SessionData.session.getAuthToken()) != null) - { - return true; + if (client.getUserFromToken(SessionData.session.getAuthToken()) != null) { + return true; } } catch (TException e) { // TODO Auto-generated catch block @@ -66,14 +60,9 @@ public class ServerHandler implements Server.Iface return false; } - - - @Override - public User getFtpUser() throws TException - { - if(authenticated()) - { + public User getFtpUser() throws TException { + if (authenticated()) { log.info("returning FTPUser..."); User user = new User(); user.setUserName(UUID.randomUUID().toString().substring(0, 8)); @@ -84,7 +73,7 @@ public class ServerHandler implements Server.Iface } else { user.setPath(Configuration.config.getAbsolute_path() + "/"); } - + // check if folder temp and folder prod exist if (folderTempExists() == true && folderProdExists() == true) { sql.writeFTPUser(user.getUserName(), user.getPassword()); @@ -95,12 +84,10 @@ public class ServerHandler implements Server.Iface } } return null; - + } - - public boolean folderTempExists() - { + public boolean folderTempExists() { // check if folder temp exists, otherwise create it Path path = null; if (Configuration.config.getAbsolute_path().endsWith("/")) { @@ -110,15 +97,14 @@ public class ServerHandler implements Server.Iface } if (Files.exists(path) == true) { - log.info("folder '" + path + "' exists, no further action"); + log.info("folder '" + path + "' exists, no further action"); return true; } else { // create directory and set permissions boolean success = (new File(path + "")).mkdirs(); if (!success) { - log.info("failed to create folder '" + path - + "'"); + log.info("failed to create folder '" + path + "'"); return false; } else { // set permissions @@ -127,13 +113,12 @@ public class ServerHandler implements Server.Iface } catch (IOException e) { e.printStackTrace(); } - log.info("folder '" + path + "' successfully created"); + log.info("folder '" + path + "' successfully created"); return true; } } }// end folderTempExists() - public boolean folderProdExists() { // check if folder temp exists, otherwise create it @@ -145,15 +130,14 @@ public class ServerHandler implements Server.Iface } if (Files.exists(path) == true) { - log.info("folder '" + path + "' exists, no further action"); + log.info("folder '" + path + "' exists, no further action"); return true; } else { // create directory and set permissions boolean success = (new File(path + "")).mkdirs(); if (!success) { - log.info("failed to create folder '" + path - + "'"); + log.info("failed to create folder '" + path + "'"); return false; } else { // set permissions @@ -162,15 +146,13 @@ public class ServerHandler implements Server.Iface } catch (IOException e) { e.printStackTrace(); } - log.info("folder '" + path - + "' successfully created"); + log.info("folder '" + path + "' successfully created"); return true; } } }// end folderProdExists() - public String getEncodedSha1Sum(String key) { try { MessageDigest md = MessageDigest.getInstance("SHA1"); @@ -184,33 +166,29 @@ public class ServerHandler implements Server.Iface } @Override - public long DeleteFtpUser(String user) throws TException - { - if(authenticated()) - { + public long DeleteFtpUser(String user) throws TException { + if (authenticated()) { return sql.DeleteUser(user); } return -1; } @Override - public String getPathOfImage(String image_id, String version) throws TException - { - if(authenticated()) - { - log.info("successfully returned PathOfImage: " + sql.getPathOfImage(image_id, version)); + public String getPathOfImage(String image_id, String version) + throws TException { + if (authenticated()) { + log.info("successfully returned PathOfImage: " + + sql.getPathOfImage(image_id, version)); return sql.getPathOfImage(image_id, version); } return null; } - @Override - public String setInstitution(String university) throws InvalidTokenException - { - if(authenticated()) - { - return sql.setInstitution(university); + public String setInstitution(String university) + throws InvalidTokenException { + if (authenticated()) { + return sql.setInstitution(university); } return null; } @@ -220,176 +198,158 @@ public class ServerHandler implements Server.Iface 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, String uid) throws TException - { - - if(authenticated()) - { + long filesize, long shareMode, String os, String uid) + throws TException { + + if (authenticated()) { String mode = null; - + if (shareMode == 0) { mode = "only_local"; } else { mode = "to_be_published"; } - + // String pk_institution = sql.setInstitution(university); - // String pk_person = sql.setPerson(login, lastname, firstname, Mail, + // String pk_person = sql.setPerson(login, lastname, firstname, + // Mail, // new Date(), pk_institution); - + // OS impl Select and write - // ACHTUNG: Anzahl der Leerzeichen muss eingehalten werden: 'Windows 7 + // 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(" ", "")); - + 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, filesize,mode,pk_os); - - sql.setImageData(login, license, internet, cpu, ram, imagename, desc, - imagePath, filesize, mode, pk_os, uid); - + + sql.setImageData(login, license, internet, cpu, ram, imagename, + desc, imagePath, filesize, mode, pk_os, uid); + log.info("written VLdata"); return true; } return false; } - @Override - public List getImageListPermissionWrite(String userID) throws TException - { - if(authenticated()) - { + public List getImageListPermissionWrite(String userID) + throws TException { + if (authenticated()) { return sql.getImageListPermissionWrite(userID); } return null; } - @Override - public List getImageListPermissionRead(String userID) throws TException - { - if(authenticated()) - { + public List getImageListPermissionRead(String userID) + throws TException { + if (authenticated()) { return sql.getImageListPermissionRead(userID); } return null; } - @Override - public List getImageListPermissionLink(String userID) throws TException - { - if(authenticated()) - { + public List getImageListPermissionLink(String userID) + throws TException { + if (authenticated()) { return sql.getImageListPermissionLink(userID); } return null; } - - + @Override - public List getImageListPermissionAdmin(String userID) throws TException - { - if(authenticated()) - { + public List getImageListPermissionAdmin(String userID) + throws TException { + if (authenticated()) { return sql.getImageListPermissionAdmin(userID); } return null; } - + @Override - public List getImageListAllTemplates() throws TException - { - if(authenticated()) - { + public List getImageListAllTemplates() throws TException { + if (authenticated()) { return sql.getImageListAllTemplates(); } return null; } - @Override - public List getAllOS() throws TException - { - if(authenticated()) - { + public List getAllOS() throws TException { + if (authenticated()) { return sql.getAllOS(); } return null; } @Override - public Map getPersonData(String Vorname, String Nachname) throws TException - { - if(authenticated()) - { + public Map getPersonData(String Vorname, String Nachname) + throws TException { + if (authenticated()) { return sql.getPersonData(Vorname, Nachname); } return null; } - public void setPerson(String login, String lastname, String firstname,String mail, String Institution) throws InvalidTokenException - { - if(authenticated()) - { - sql.setPerson(login, lastname, firstname, mail, new Date(), Institution); + public void setPerson(String login, String lastname, String firstname, + String mail, String Institution) throws InvalidTokenException { + if (authenticated()) { + sql.setPerson(login, lastname, firstname, mail, new Date(), + Institution); } } @Override public boolean writeLecturedata(String name, String shortdesc, String desc, - String startDate, String endDate, boolean isActive, - String imageID, String login, String firstname, String lastname, - String university, String Mail, String Tel, String Fak, String lectureID) - throws TException - { - if(authenticated()) - { - - //String pk_image = imageID; + String startDate, String endDate, boolean isActive, String imageID, + String login, String firstname, String lastname, String university, + String Mail, String Tel, String Fak, String lectureID) + throws TException { + if (authenticated()) { + + // String pk_image = imageID; Map map = new HashMap(); int imageversion = 0; String pk_institution = sql.setInstitution(university); String pk_person = sql.setPerson(login, lastname, firstname, Mail, new Date(), pk_institution); - + map = sql.getImageIDandVersion(imageID); - - //pk_image = map.get("GUID"); + + // pk_image = map.get("GUID"); imageversion = Integer.parseInt(map.get("version")); - + sql.setLectureData(pk_person, imageID, imageversion, name, desc, shortdesc, startDate, endDate, isActive, lectureID); } - return false; - + return false; + } - @Override - public boolean startFileCopy(String filename) throws TException - { - if(authenticated()) - { + public boolean startFileCopy(String filename) throws TException { + if (authenticated()) { // copy file from folder temp to folder prod String file = Configuration.config.getAbsolute_path() + "temp/" + filename; File tmpFile = new File(file); - + log.info("Trying to move file to '/srv/openslx/nfs/prod/" + tmpFile.getName() + "'"); try { FileUtils.moveFile(tmpFile, - new File(Configuration.config.getAbsolute_path() + "prod/" - + filename)); + new File(Configuration.config.getAbsolute_path() + + "prod/" + filename)); // int ret = sql.UpdateImagePath(filename); if (sql.UpdateImagePath(filename) == 0) { log.info("file moved and database updated."); } - + } catch (IOException e) { log.info("Failed to move file."); e.printStackTrace(); @@ -399,11 +359,11 @@ public class ServerHandler implements Server.Iface } @Override - public Map getImageData(String imageid, String imageversion) throws TException - { - if(authenticated()) - { - //log.info("returning ImageData: "+ sql.getImageData(imageid, imageversion).size() + "items."); + public Map getImageData(String imageid, String imageversion) + throws TException { + if (authenticated()) { + // log.info("returning ImageData: "+ sql.getImageData(imageid, + // imageversion).size() + "items."); return sql.getImageData(imageid, imageversion); } return null; @@ -413,90 +373,97 @@ public class ServerHandler implements Server.Iface 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 TException - { - if(authenticated()) - { + long filesize, long shareMode, String os) throws TException { + + if (authenticated()) { + + //get old_image_path + String old_image_path = sql.getFile(id, version); String mode = null; - + if (shareMode == 0) { mode = "only_local"; } else { mode = "to_be_published"; } - 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); + String pk_os = sql.getOSpk(os.substring(0, nthIndexOf(os, " ", 2)), + os.substring(nthIndexOf(os, " ", 2), os.lastIndexOf(" ")) + .replace(" ", "")); + + // do database update - if successful then delete old file from + // drive + int val = sql.UpdateImageData(name, newName, desc, image_path, + license, internet, cpu, ram, id, version, isTemplate, + filesize, mode, pk_os); + + if (val == 0) { + // update was successful - delete old file + deleteImageByPath(old_image_path); + } else { + // update was not successful - delete new file + // TODO not yet implemented + + } } return false; } @Override - public List getLectureList() throws TException - { - if(authenticated()) - { - //log.info("returning LectureList"); + public List getLectureList() throws TException { + if (authenticated()) { + // log.info("returning LectureList"); return sql.getLectureList(); } return null; } @Override - public List getLectureListPermissionRead(String userID) throws InvalidTokenException - { - if(authenticated()) - { - //log.info("returning LectureListRead"); + public List getLectureListPermissionRead(String userID) + throws InvalidTokenException { + if (authenticated()) { + // log.info("returning LectureListRead"); return sql.getLectureListPermissionRead(userID); } return null; }// end getLectureListPermissionRead - @Override - public List getLectureListPermissionWrite(String userID) throws InvalidTokenException - { - if(authenticated()) - { - //log.info("returning LectureListWrite"); + public List getLectureListPermissionWrite(String userID) + throws InvalidTokenException { + if (authenticated()) { + // log.info("returning LectureListWrite"); return sql.getLectureListPermissionWrite(userID); } return null; }// end getLectureListPermissionRead @Override - public List getLectureListPermissionAdmin(String userID) throws InvalidTokenException - { - if(authenticated()) - { - //log.info("returning LectureListAdmin"); + public List getLectureListPermissionAdmin(String userID) + throws InvalidTokenException { + if (authenticated()) { + // log.info("returning LectureListAdmin"); return sql.getLectureListPermissionAdmin(userID); } return null; }// end getLectureListPermissionRead - @Override 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 TException - { - if(authenticated()) - { + String Tel, String Fak, String id) throws TException { + if (authenticated()) { Map map = new HashMap(); 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"; + 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); @@ -507,119 +474,133 @@ public class ServerHandler implements Server.Iface return false; } - @Override - public boolean deleteImageServer(String imageid, String imageversion) throws TException - { - if(authenticated()) - { + public boolean deleteImageServer(String imageid, String imageversion) + throws TException { + if (authenticated()) { String stringFile = sql.getFile(imageid, imageversion); log.info("File to Delete: " + stringFile); - + File tmpFile = new File(Configuration.config.getAbsolute_path() + stringFile); - + try { // File wird von Server gelöscht FileUtils.forceDelete(tmpFile); return true; - + } catch (IOException e) { log.info("Failed to execute deleteImageServer."); e.printStackTrace(); - + } } return false; } - @Override - public boolean deleteImageData(String id, String version) throws TException - { - boolean success=false; + public boolean deleteImageByPath(String image_path){ + + try { + if (authenticated()) { + //String stringFile = sql.getFile(imageid, imageversion); + log.info("File to Delete: " + image_path); + + File tmpFile = new File(Configuration.config.getAbsolute_path() + + image_path); + + try { + // File wird von Server gelöscht + FileUtils.forceDelete(tmpFile); + return true; + + } catch (IOException e) { + log.info("Failed to execute deleteImageServer."); + e.printStackTrace(); + + } + } + } catch (InvalidTokenException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return false; - if(authenticated()) - { - if(sql.deleteImage(id, version)==true) - { - success=true; - log.info("Image '"+id+"' and permissions successfully deleted."); + } + + + @Override + public boolean deleteImageData(String id, String version) throws TException { + boolean success = false; + + if (authenticated()) { + if (sql.deleteImage(id, version) == true) { + success = true; + log.info("Image '" + id + + "' and permissions successfully deleted."); } } return success; } @Override - public boolean connectedToLecture(String id, String version) throws TException - { - if(authenticated()) - { + public boolean connectedToLecture(String id, String version) + throws TException { + if (authenticated()) { return sql.connectedToLecture(id, version); } return true; } - public boolean deleteLecture(String id, String hs, String user) throws InvalidTokenException - { + public boolean deleteLecture(String id, String hs, String user) + throws InvalidTokenException { boolean success = false; - - - if(authenticated()) - { + + if (authenticated()) { /* - Map map = new HashMap(); - map = sql.getDeleteXMLData(id); - try { - - String path = Configuration.config.getAbsolute_path() - + "prod/" - + map.get("date") - .substring(0, map.get("date").length() - 2) + "_" - + hs + "_" + user + "_" + map.get("name") + ".xml"; - File xmlFile = new File(path); - FileUtils.forceDelete(xmlFile); - } catch (IOException e) { - log.info("Failed to execute deleteLecture."); - e.printStackTrace(); - } - */ - if(sql.deleteLecture(id) == true){ + * Map map = new HashMap(); map = + * sql.getDeleteXMLData(id); try { + * + * String path = Configuration.config.getAbsolute_path() + "prod/" + + * map.get("date") .substring(0, map.get("date").length() - 2) + "_" + * + hs + "_" + user + "_" + map.get("name") + ".xml"; File xmlFile + * = new File(path); FileUtils.forceDelete(xmlFile); } catch + * (IOException e) { log.info("Failed to execute deleteLecture."); + * e.printStackTrace(); } + */ + if (sql.deleteLecture(id) == true) { success = true; - log.info("Lecture '"+id+"' and permissions successfully deleted."); + log.info("Lecture '" + id + + "' and permissions successfully deleted."); } } return success; - + } @Override - public List getAllUniversities() throws TException - { - if(authenticated()) - { + public List getAllUniversities() throws TException { + if (authenticated()) { return sql.getAllUniversities(); } return null; } @Override - public Map getLectureData(String lectureid) throws TException - { - if(authenticated()) - { - //log.info("returning LectureData"); + public Map getLectureData(String lectureid) + throws TException { + if (authenticated()) { + // log.info("returning LectureData"); return sql.getLectureData(lectureid); } return null; } - public static int nthIndexOf(final String string, final String token,final int index) - { + public static int nthIndexOf(final String string, final String token, + final int index) { int j = 0; - for (int i = 0; i < index; i++) - { + for (int i = 0; i < index; i++) { j = string.indexOf(token, j + 1); if (j == -1) break; @@ -629,10 +610,8 @@ public class ServerHandler implements Server.Iface } @Override - public boolean checkUser(String username) throws TException - { - if(authenticated()) - { + public boolean checkUser(String username) throws TException { + if (authenticated()) { return sql.checkUser(username); } return false; @@ -640,12 +619,12 @@ public class ServerHandler implements Server.Iface } @Override - public boolean createUser(String loginName, String lastName,String firstName, String mail, String university) throws TException - { - if(authenticated()) - { + public boolean createUser(String loginName, String lastName, + String firstName, String mail, String university) throws TException { + if (authenticated()) { String pk_institution = sql.setInstitution(university); - String pk_person = sql.setPerson(loginName, lastName, firstName, mail, new Date(), pk_institution); + String pk_person = sql.setPerson(loginName, lastName, firstName, + mail, new Date(), pk_institution); return true; } return false; @@ -654,23 +633,20 @@ public class ServerHandler implements Server.Iface @Override public boolean writeImageRights(String imageID, String username, String lastName, String firstName, String mail, String university, - String role) throws TException - { - if(authenticated()) - { + String role) throws TException { + if (authenticated()) { String pk_image = null; Map map = new HashMap(); int imageversion = 0; String pk_institution = sql.setInstitution(university); - String pk_person = sql.setPerson(username, lastName, firstName, mail, - new Date(), pk_institution); - + String pk_person = sql.setPerson(username, lastName, firstName, + mail, new Date(), pk_institution); + map = sql.getImageIDandVersion(imageID); - - + pk_image = map.get("GUID"); imageversion = Integer.parseInt(map.get("version")); - + if (role.equals("Dozent")) { int read = 1; int write = 1; @@ -678,10 +654,10 @@ public class ServerHandler implements Server.Iface int admin = 1; int linkallowed = 1; int roleID = sql.getRoleID(role); - - sql.setImageRights(pk_person, pk_image, roleID, read, write, admin, - linkallowed); - + + sql.setImageRights(pk_person, pk_image, roleID, read, write, + admin, linkallowed); + } else if (role.equals("Admin")) { int read = 1; int write = 1; @@ -689,9 +665,9 @@ public class ServerHandler implements Server.Iface int admin = 1; int linkallowed = 1; int roleID = sql.getRoleID(role); - - sql.setImageRights(pk_person, pk_image, roleID, read, write, admin, - linkallowed); + + sql.setImageRights(pk_person, pk_image, roleID, read, write, + admin, linkallowed); } else { int read = 1; int write = 0; @@ -699,11 +675,11 @@ public class ServerHandler implements Server.Iface int admin = 0; int linkallowed = 0; int roleID = sql.getRoleID(role); - - sql.setImageRights(pk_person, pk_image, roleID, read, write, admin, - linkallowed); + + sql.setImageRights(pk_person, pk_image, roleID, read, write, + admin, linkallowed); } - + log.info("Written image rights"); return true; } @@ -713,34 +689,32 @@ public class ServerHandler implements Server.Iface @Override public boolean writeLectureRights(String lectureID, String username, String lastName, String firstName, String mail, String university, - String role) throws TException - { - if(authenticated()) - { - //String pk_lecture = null; - + String role) throws TException { + if (authenticated()) { + // 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(lectureID); - + String pk_person = sql.setPerson(username, lastName, firstName, + mail, new Date(), pk_institution); + // pk_lecture = sql.getLectureID(lectureID); + if (role.equals("Dozent")) { int read = 1; int write = 1; // int changePermission=0; int admin = 1; int roleID = sql.getRoleID(role); - + sql.setLectureRights(pk_person, lectureID, roleID, read, write, 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, lectureID, roleID, read, write, admin); } else { @@ -749,60 +723,55 @@ public class ServerHandler implements Server.Iface // int changePermission=0; int admin = 0; int roleID = sql.getRoleID(role); - + sql.setLectureRights(pk_person, lectureID, roleID, read, write, admin); } - + return true; } return false; } @Override - public List getAllOtherSatelliteUsers(List userID) throws TException - { - if(authenticated()) - { + public List getAllOtherSatelliteUsers(List userID) + throws TException { + if (authenticated()) { return sql.getAllOtherSatelliteUsers(userID); // return null; } return null; } - //set permissions for users which are !=userID + // set permissions for users which are !=userID public boolean writeAdditionalImageRights(String imageID, String userID, boolean isRead, boolean isWrite, boolean isLinkAllowed, - boolean isAdmin) throws InvalidTokenException - { + boolean isAdmin) throws InvalidTokenException { boolean success = false; - if(authenticated()) - { + if (authenticated()) { Map map = new HashMap(); map = sql.getImageIDandVersion(imageID); - //String imageID = map.get("GUID"); - + // String imageID = map.get("GUID"); + sql.writeAdditionalImageRights(imageID, userID, isRead, isWrite, isLinkAllowed, isAdmin); - log.info("Written additional image rights for " + userID); + log.info("Written additional image rights for " + userID); } return success; } - public boolean writeAdditionalLectureRights(String lectureID, - String userID, boolean isRead, boolean isWrite, boolean isAdmin) throws InvalidTokenException - { - if(authenticated()) - { + String userID, boolean isRead, boolean isWrite, boolean isAdmin) + throws InvalidTokenException { + if (authenticated()) { Map map = new HashMap(); - //String lectureID = sql.getLectureID(lectureID); - - sql.writeAdditionalLectureRights(lectureID, userID, isRead, isWrite, - isAdmin); - log.info("Written additional lecture rights for "+ userID); - + // String lectureID = sql.getLectureID(lectureID); + + sql.writeAdditionalLectureRights(lectureID, userID, isRead, + isWrite, isAdmin); + log.info("Written additional lecture rights for " + userID); + return true; } return false; @@ -810,122 +779,99 @@ public class ServerHandler implements Server.Iface @Override public List getPermissionForUserAndImage(String userID, - String imageID) throws TException - { - if(authenticated()) - { + String imageID) throws TException { + if (authenticated()) { return sql.getPermissionForUserAndImage(userID, imageID); } return null; } - public List getPermissionForUserAndLecture(String userID,String lectureID) throws InvalidTokenException - { - if(authenticated()) - { + public List getPermissionForUserAndLecture(String userID, + String lectureID) throws InvalidTokenException { + if (authenticated()) { return sql.getPermissionForUserAndLecture(userID, lectureID); } return null; } @Override - public void deleteAllAdditionalImagePermissions(String imageID,String userID) throws TException - { - if(authenticated()) - { + public void deleteAllAdditionalImagePermissions(String imageID, + String userID) throws TException { + if (authenticated()) { sql.deleteAllAdditionalImagePermissions(imageID, userID); } return; } @Override - public void deleteAllAdditionalLecturePermissions(String lectureID,String userID) throws TException - { - if(authenticated()) - { + public void deleteAllAdditionalLecturePermissions(String lectureID, + String userID) throws TException { + if (authenticated()) { sql.deleteAllAdditionalLecturePermissions(lectureID, userID); } - + return; } - @Override - public List getImageList(String userID) throws TException - { - if(authenticated()) - { + @Override + public List getImageList(String userID) throws TException { + if (authenticated()) { return sql.getImageList(userID); } return null; } @Override - public List getAdditionalImageContacts(String imageID) throws TException - { - if(authenticated()) - { + public List getAdditionalImageContacts(String imageID) + throws TException { + if (authenticated()) { return sql.getAdditionalImageContacts(imageID); } return null; } @Override - public String getOsNameForGuestOs(String guestOS) throws TException - { - if(authenticated()) - { + public String getOsNameForGuestOs(String guestOS) throws TException { + if (authenticated()) { return sql.getOsNameForGuestOs(guestOS); } return null; } @Override - - public String createRandomUUID() throws TException - { - if(authenticated()) - { + public String createRandomUUID() throws TException { + if (authenticated()) { return sql.createRandomUUID(); } return null; } - public Map getItemOwner(String itemID) throws TException - { - if(authenticated()) - { + public Map getItemOwner(String itemID) throws TException { + if (authenticated()) { return sql.getItemOwner(itemID); } return null; } - - @Override public boolean userIsImageAdmin(String userID, String imageID) throws TException { - - if(authenticated()) - { - return sql.userIsImageAdmin(userID,imageID); + + if (authenticated()) { + return sql.userIsImageAdmin(userID, imageID); } return false; - - } - + } @Override public boolean userIsLectureAdmin(String userID, String lectureID) throws TException { - if(authenticated()) - { - return sql.userIsLectureAdmin(userID,lectureID); + if (authenticated()) { + return sql.userIsLectureAdmin(userID, lectureID); } return false; } - - }// end class diff --git a/dozentenmodulserver/src/main/java/server/generated/Server.java b/dozentenmodulserver/src/main/java/server/generated/Server.java index 0b6092ad..b0c2d57f 100644 --- a/dozentenmodulserver/src/main/java/server/generated/Server.java +++ b/dozentenmodulserver/src/main/java/server/generated/Server.java @@ -94,6 +94,8 @@ public class Server { public boolean deleteImageServer(String id, String version) throws org.apache.thrift.TException; + public boolean deleteImageByPath(String image_path) throws org.apache.thrift.TException; + public boolean connectedToLecture(String id, String version) throws org.apache.thrift.TException; public boolean deleteLecture(String id, String hs, String user) throws org.apache.thrift.TException; @@ -192,6 +194,8 @@ public class Server { public void deleteImageServer(String id, String version, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void deleteImageByPath(String image_path, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void connectedToLecture(String id, String version, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void deleteLecture(String id, String hs, String user, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; @@ -976,6 +980,29 @@ public class Server { throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "deleteImageServer failed: unknown result"); } + public boolean deleteImageByPath(String image_path) throws org.apache.thrift.TException + { + send_deleteImageByPath(image_path); + return recv_deleteImageByPath(); + } + + public void send_deleteImageByPath(String image_path) throws org.apache.thrift.TException + { + deleteImageByPath_args args = new deleteImageByPath_args(); + args.setImage_path(image_path); + sendBase("deleteImageByPath", args); + } + + public boolean recv_deleteImageByPath() throws org.apache.thrift.TException + { + deleteImageByPath_result result = new deleteImageByPath_result(); + receiveBase(result, "deleteImageByPath"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "deleteImageByPath failed: unknown result"); + } + public boolean connectedToLecture(String id, String version) throws org.apache.thrift.TException { send_connectedToLecture(id, version); @@ -2558,6 +2585,38 @@ public class Server { } } + public void deleteImageByPath(String image_path, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + deleteImageByPath_call method_call = new deleteImageByPath_call(image_path, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class deleteImageByPath_call extends org.apache.thrift.async.TAsyncMethodCall { + private String image_path; + public deleteImageByPath_call(String image_path, 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.image_path = image_path; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("deleteImageByPath", org.apache.thrift.protocol.TMessageType.CALL, 0)); + deleteImageByPath_args args = new deleteImageByPath_args(); + args.setImage_path(image_path); + 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_deleteImageByPath(); + } + } + public void connectedToLecture(String id, String version, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); connectedToLecture_call method_call = new connectedToLecture_call(id, version, resultHandler, this, ___protocolFactory, ___transport); @@ -3275,6 +3334,7 @@ public class Server { processMap.put("deleteImageData", new deleteImageData()); processMap.put("updateLecturedata", new updateLecturedata()); processMap.put("deleteImageServer", new deleteImageServer()); + processMap.put("deleteImageByPath", new deleteImageByPath()); processMap.put("connectedToLecture", new connectedToLecture()); processMap.put("deleteLecture", new deleteLecture()); processMap.put("checkUser", new checkUser()); @@ -3884,6 +3944,27 @@ public class Server { } } + public static class deleteImageByPath extends org.apache.thrift.ProcessFunction { + public deleteImageByPath() { + super("deleteImageByPath"); + } + + public deleteImageByPath_args getEmptyArgsInstance() { + return new deleteImageByPath_args(); + } + + protected boolean isOneway() { + return false; + } + + public deleteImageByPath_result getResult(I iface, deleteImageByPath_args args) throws org.apache.thrift.TException { + deleteImageByPath_result result = new deleteImageByPath_result(); + result.success = iface.deleteImageByPath(args.image_path); + result.setSuccessIsSet(true); + return result; + } + } + public static class connectedToLecture extends org.apache.thrift.ProcessFunction { public connectedToLecture() { super("connectedToLecture"); @@ -4296,6 +4377,7 @@ public class Server { processMap.put("deleteImageData", new deleteImageData()); processMap.put("updateLecturedata", new updateLecturedata()); processMap.put("deleteImageServer", new deleteImageServer()); + processMap.put("deleteImageByPath", new deleteImageByPath()); processMap.put("connectedToLecture", new connectedToLecture()); processMap.put("deleteLecture", new deleteLecture()); processMap.put("checkUser", new checkUser()); @@ -5802,6 +5884,58 @@ public class Server { } } + public static class deleteImageByPath extends org.apache.thrift.AsyncProcessFunction { + public deleteImageByPath() { + super("deleteImageByPath"); + } + + public deleteImageByPath_args getEmptyArgsInstance() { + return new deleteImageByPath_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Boolean o) { + deleteImageByPath_result result = new deleteImageByPath_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; + deleteImageByPath_result result = new deleteImageByPath_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, deleteImageByPath_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.deleteImageByPath(args.image_path,resultHandler); + } + } + public static class connectedToLecture extends org.apache.thrift.AsyncProcessFunction { public connectedToLecture() { super("connectedToLecture"); @@ -33420,7 +33554,815 @@ public class Server { struct.validate(); } - public void write(org.apache.thrift.protocol.TProtocol oprot, updateLecturedata_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, updateLecturedata_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 updateLecturedata_resultTupleSchemeFactory implements SchemeFactory { + public updateLecturedata_resultTupleScheme getScheme() { + return new updateLecturedata_resultTupleScheme(); + } + } + + private static class updateLecturedata_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, updateLecturedata_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, updateLecturedata_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 deleteImageServer_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteImageServer_args"); + + 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)1); + 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)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new deleteImageServer_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new deleteImageServer_argsTupleSchemeFactory()); + } + + public String id; // required + public String version; // 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 { + ID((short)1, "id"), + VERSION((short)2, "version"); + + private static final Map byName = new HashMap(); + + 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: // ID + return ID; + case 2: // VERSION + return VERSION; + 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.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.VERSION, new org.apache.thrift.meta_data.FieldMetaData("version", 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(deleteImageServer_args.class, metaDataMap); + } + + public deleteImageServer_args() { + } + + public deleteImageServer_args( + String id, + String version) + { + this(); + this.id = id; + this.version = version; + } + + /** + * Performs a deep copy on other. + */ + public deleteImageServer_args(deleteImageServer_args other) { + if (other.isSetId()) { + this.id = other.id; + } + if (other.isSetVersion()) { + this.version = other.version; + } + } + + public deleteImageServer_args deepCopy() { + return new deleteImageServer_args(this); + } + + @Override + public void clear() { + this.id = null; + this.version = null; + } + + public String getId() { + return this.id; + } + + public deleteImageServer_args setId(String id) { + this.id = id; + return this; + } + + public void unsetId() { + this.id = null; + } + + /** Returns true if field id is set (has been assigned a value) and false otherwise */ + public boolean isSetId() { + return this.id != null; + } + + public void setIdIsSet(boolean value) { + if (!value) { + this.id = null; + } + } + + public String getVersion() { + return this.version; + } + + public deleteImageServer_args setVersion(String version) { + this.version = version; + return this; + } + + public void unsetVersion() { + this.version = null; + } + + /** Returns true if field version is set (has been assigned a value) and false otherwise */ + public boolean isSetVersion() { + return this.version != null; + } + + public void setVersionIsSet(boolean value) { + if (!value) { + this.version = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case ID: + if (value == null) { + unsetId(); + } else { + setId((String)value); + } + break; + + case VERSION: + if (value == null) { + unsetVersion(); + } else { + setVersion((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case ID: + return getId(); + + case VERSION: + return getVersion(); + + } + 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 ID: + return isSetId(); + case VERSION: + return isSetVersion(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof deleteImageServer_args) + return this.equals((deleteImageServer_args)that); + return false; + } + + public boolean equals(deleteImageServer_args that) { + if (that == null) + return false; + + boolean this_present_id = true && this.isSetId(); + boolean that_present_id = true && that.isSetId(); + if (this_present_id || that_present_id) { + if (!(this_present_id && that_present_id)) + return false; + if (!this.id.equals(that.id)) + return false; + } + + boolean this_present_version = true && this.isSetVersion(); + boolean that_present_version = true && that.isSetVersion(); + if (this_present_version || that_present_version) { + if (!(this_present_version && that_present_version)) + return false; + if (!this.version.equals(that.version)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(deleteImageServer_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetVersion()).compareTo(other.isSetVersion()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetVersion()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.version, other.version); + 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("deleteImageServer_args("); + boolean first = true; + + sb.append("id:"); + if (this.id == null) { + sb.append("null"); + } else { + sb.append(this.id); + } + first = false; + if (!first) sb.append(", "); + sb.append("version:"); + if (this.version == null) { + sb.append("null"); + } else { + sb.append(this.version); + } + 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 deleteImageServer_argsStandardSchemeFactory implements SchemeFactory { + public deleteImageServer_argsStandardScheme getScheme() { + return new deleteImageServer_argsStandardScheme(); + } + } + + private static class deleteImageServer_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, deleteImageServer_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: // ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.id = iprot.readString(); + struct.setIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // VERSION + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.version = iprot.readString(); + struct.setVersionIsSet(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, deleteImageServer_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.id != null) { + oprot.writeFieldBegin(ID_FIELD_DESC); + oprot.writeString(struct.id); + oprot.writeFieldEnd(); + } + if (struct.version != null) { + oprot.writeFieldBegin(VERSION_FIELD_DESC); + oprot.writeString(struct.version); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class deleteImageServer_argsTupleSchemeFactory implements SchemeFactory { + public deleteImageServer_argsTupleScheme getScheme() { + return new deleteImageServer_argsTupleScheme(); + } + } + + private static class deleteImageServer_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, deleteImageServer_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetId()) { + optionals.set(0); + } + if (struct.isSetVersion()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetId()) { + oprot.writeString(struct.id); + } + if (struct.isSetVersion()) { + oprot.writeString(struct.version); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, deleteImageServer_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.id = iprot.readString(); + struct.setIdIsSet(true); + } + if (incoming.get(1)) { + struct.version = iprot.readString(); + struct.setVersionIsSet(true); + } + } + } + + } + + public static class deleteImageServer_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteImageServer_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, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new deleteImageServer_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new deleteImageServer_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 byName = new HashMap(); + + 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(deleteImageServer_result.class, metaDataMap); + } + + public deleteImageServer_result() { + } + + public deleteImageServer_result( + boolean success) + { + this(); + this.success = success; + setSuccessIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public deleteImageServer_result(deleteImageServer_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; + } + + public deleteImageServer_result deepCopy() { + return new deleteImageServer_result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = false; + } + + public boolean isSuccess() { + return this.success; + } + + public deleteImageServer_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 deleteImageServer_result) + return this.equals((deleteImageServer_result)that); + return false; + } + + public boolean equals(deleteImageServer_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(deleteImageServer_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("deleteImageServer_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 deleteImageServer_resultStandardSchemeFactory implements SchemeFactory { + public deleteImageServer_resultStandardScheme getScheme() { + return new deleteImageServer_resultStandardScheme(); + } + } + + private static class deleteImageServer_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, deleteImageServer_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, deleteImageServer_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); @@ -33435,16 +34377,16 @@ public class Server { } - private static class updateLecturedata_resultTupleSchemeFactory implements SchemeFactory { - public updateLecturedata_resultTupleScheme getScheme() { - return new updateLecturedata_resultTupleScheme(); + private static class deleteImageServer_resultTupleSchemeFactory implements SchemeFactory { + public deleteImageServer_resultTupleScheme getScheme() { + return new deleteImageServer_resultTupleScheme(); } } - private static class updateLecturedata_resultTupleScheme extends TupleScheme { + private static class deleteImageServer_resultTupleScheme extends TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, updateLecturedata_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, deleteImageServer_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { @@ -33457,7 +34399,7 @@ public class Server { } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, updateLecturedata_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, deleteImageServer_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { @@ -33469,25 +34411,22 @@ public class Server { } - public static class deleteImageServer_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteImageServer_args"); + public static class deleteImageByPath_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteImageByPath_args"); - 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)1); - 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)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)1); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { - schemes.put(StandardScheme.class, new deleteImageServer_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new deleteImageServer_argsTupleSchemeFactory()); + schemes.put(StandardScheme.class, new deleteImageByPath_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new deleteImageByPath_argsTupleSchemeFactory()); } - public String id; // required - public String version; // required + public String image_path; // 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 { - ID((short)1, "id"), - VERSION((short)2, "version"); + IMAGE_PATH((short)1, "image_path"); private static final Map byName = new HashMap(); @@ -33502,10 +34441,8 @@ public class Server { */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { - case 1: // ID - return ID; - case 2: // VERSION - return VERSION; + case 1: // IMAGE_PATH + return IMAGE_PATH; default: return null; } @@ -33549,111 +34486,71 @@ public class Server { 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.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.VERSION, new org.apache.thrift.meta_data.FieldMetaData("version", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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))); metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteImageServer_args.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteImageByPath_args.class, metaDataMap); } - public deleteImageServer_args() { + public deleteImageByPath_args() { } - public deleteImageServer_args( - String id, - String version) + public deleteImageByPath_args( + String image_path) { this(); - this.id = id; - this.version = version; + this.image_path = image_path; } /** * Performs a deep copy on other. */ - public deleteImageServer_args(deleteImageServer_args other) { - if (other.isSetId()) { - this.id = other.id; - } - if (other.isSetVersion()) { - this.version = other.version; + public deleteImageByPath_args(deleteImageByPath_args other) { + if (other.isSetImage_path()) { + this.image_path = other.image_path; } } - public deleteImageServer_args deepCopy() { - return new deleteImageServer_args(this); + public deleteImageByPath_args deepCopy() { + return new deleteImageByPath_args(this); } @Override public void clear() { - this.id = null; - this.version = null; - } - - public String getId() { - return this.id; - } - - public deleteImageServer_args setId(String id) { - this.id = id; - return this; - } - - public void unsetId() { - this.id = null; - } - - /** Returns true if field id is set (has been assigned a value) and false otherwise */ - public boolean isSetId() { - return this.id != null; - } - - public void setIdIsSet(boolean value) { - if (!value) { - this.id = null; - } + this.image_path = null; } - public String getVersion() { - return this.version; + public String getImage_path() { + return this.image_path; } - public deleteImageServer_args setVersion(String version) { - this.version = version; + public deleteImageByPath_args setImage_path(String image_path) { + this.image_path = image_path; return this; } - public void unsetVersion() { - this.version = null; + public void unsetImage_path() { + this.image_path = null; } - /** Returns true if field version is set (has been assigned a value) and false otherwise */ - public boolean isSetVersion() { - return this.version != null; + /** Returns true if field image_path is set (has been assigned a value) and false otherwise */ + public boolean isSetImage_path() { + return this.image_path != null; } - public void setVersionIsSet(boolean value) { + public void setImage_pathIsSet(boolean value) { if (!value) { - this.version = null; + this.image_path = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { - case ID: - if (value == null) { - unsetId(); - } else { - setId((String)value); - } - break; - - case VERSION: + case IMAGE_PATH: if (value == null) { - unsetVersion(); + unsetImage_path(); } else { - setVersion((String)value); + setImage_path((String)value); } break; @@ -33662,11 +34559,8 @@ public class Server { public Object getFieldValue(_Fields field) { switch (field) { - case ID: - return getId(); - - case VERSION: - return getVersion(); + case IMAGE_PATH: + return getImage_path(); } throw new IllegalStateException(); @@ -33679,10 +34573,8 @@ public class Server { } switch (field) { - case ID: - return isSetId(); - case VERSION: - return isSetVersion(); + case IMAGE_PATH: + return isSetImage_path(); } throw new IllegalStateException(); } @@ -33691,30 +34583,21 @@ public class Server { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof deleteImageServer_args) - return this.equals((deleteImageServer_args)that); + if (that instanceof deleteImageByPath_args) + return this.equals((deleteImageByPath_args)that); return false; } - public boolean equals(deleteImageServer_args that) { + public boolean equals(deleteImageByPath_args that) { if (that == null) return false; - boolean this_present_id = true && this.isSetId(); - boolean that_present_id = true && that.isSetId(); - if (this_present_id || that_present_id) { - if (!(this_present_id && that_present_id)) - return false; - if (!this.id.equals(that.id)) - return false; - } - - boolean this_present_version = true && this.isSetVersion(); - boolean that_present_version = true && that.isSetVersion(); - if (this_present_version || that_present_version) { - if (!(this_present_version && that_present_version)) + 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) { + if (!(this_present_image_path && that_present_image_path)) return false; - if (!this.version.equals(that.version)) + if (!this.image_path.equals(that.image_path)) return false; } @@ -33727,29 +34610,19 @@ public class Server { } @Override - public int compareTo(deleteImageServer_args other) { + public int compareTo(deleteImageByPath_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetId()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetVersion()).compareTo(other.isSetVersion()); + lastComparison = Boolean.valueOf(isSetImage_path()).compareTo(other.isSetImage_path()); if (lastComparison != 0) { return lastComparison; } - if (isSetVersion()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.version, other.version); + if (isSetImage_path()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.image_path, other.image_path); if (lastComparison != 0) { return lastComparison; } @@ -33771,22 +34644,14 @@ public class Server { @Override public String toString() { - StringBuilder sb = new StringBuilder("deleteImageServer_args("); + StringBuilder sb = new StringBuilder("deleteImageByPath_args("); boolean first = true; - sb.append("id:"); - if (this.id == null) { - sb.append("null"); - } else { - sb.append(this.id); - } - first = false; - if (!first) sb.append(", "); - sb.append("version:"); - if (this.version == null) { + sb.append("image_path:"); + if (this.image_path == null) { sb.append("null"); } else { - sb.append(this.version); + sb.append(this.image_path); } first = false; sb.append(")"); @@ -33814,15 +34679,15 @@ public class Server { } } - private static class deleteImageServer_argsStandardSchemeFactory implements SchemeFactory { - public deleteImageServer_argsStandardScheme getScheme() { - return new deleteImageServer_argsStandardScheme(); + private static class deleteImageByPath_argsStandardSchemeFactory implements SchemeFactory { + public deleteImageByPath_argsStandardScheme getScheme() { + return new deleteImageByPath_argsStandardScheme(); } } - private static class deleteImageServer_argsStandardScheme extends StandardScheme { + private static class deleteImageByPath_argsStandardScheme extends StandardScheme { - public void read(org.apache.thrift.protocol.TProtocol iprot, deleteImageServer_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, deleteImageByPath_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -33832,18 +34697,10 @@ public class Server { break; } switch (schemeField.id) { - case 1: // ID - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.id = iprot.readString(); - struct.setIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // VERSION + case 1: // IMAGE_PATH if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.version = iprot.readString(); - struct.setVersionIsSet(true); + struct.image_path = iprot.readString(); + struct.setImage_pathIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -33859,18 +34716,13 @@ public class Server { struct.validate(); } - public void write(org.apache.thrift.protocol.TProtocol oprot, deleteImageServer_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, deleteImageByPath_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); - if (struct.id != null) { - oprot.writeFieldBegin(ID_FIELD_DESC); - oprot.writeString(struct.id); - oprot.writeFieldEnd(); - } - if (struct.version != null) { - oprot.writeFieldBegin(VERSION_FIELD_DESC); - oprot.writeString(struct.version); + if (struct.image_path != null) { + oprot.writeFieldBegin(IMAGE_PATH_FIELD_DESC); + oprot.writeString(struct.image_path); oprot.writeFieldEnd(); } oprot.writeFieldStop(); @@ -33879,59 +34731,49 @@ public class Server { } - private static class deleteImageServer_argsTupleSchemeFactory implements SchemeFactory { - public deleteImageServer_argsTupleScheme getScheme() { - return new deleteImageServer_argsTupleScheme(); + private static class deleteImageByPath_argsTupleSchemeFactory implements SchemeFactory { + public deleteImageByPath_argsTupleScheme getScheme() { + return new deleteImageByPath_argsTupleScheme(); } } - private static class deleteImageServer_argsTupleScheme extends TupleScheme { + private static class deleteImageByPath_argsTupleScheme extends TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, deleteImageServer_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, deleteImageByPath_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); - if (struct.isSetId()) { + if (struct.isSetImage_path()) { optionals.set(0); } - if (struct.isSetVersion()) { - optionals.set(1); - } - oprot.writeBitSet(optionals, 2); - if (struct.isSetId()) { - oprot.writeString(struct.id); - } - if (struct.isSetVersion()) { - oprot.writeString(struct.version); + oprot.writeBitSet(optionals, 1); + if (struct.isSetImage_path()) { + oprot.writeString(struct.image_path); } } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, deleteImageServer_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, deleteImageByPath_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(2); + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { - struct.id = iprot.readString(); - struct.setIdIsSet(true); - } - if (incoming.get(1)) { - struct.version = iprot.readString(); - struct.setVersionIsSet(true); + struct.image_path = iprot.readString(); + struct.setImage_pathIsSet(true); } } } } - public static class deleteImageServer_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteImageServer_result"); + public static class deleteImageByPath_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteImageByPath_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, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { - schemes.put(StandardScheme.class, new deleteImageServer_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new deleteImageServer_resultTupleSchemeFactory()); + schemes.put(StandardScheme.class, new deleteImageByPath_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new deleteImageByPath_resultTupleSchemeFactory()); } public boolean success; // required @@ -34003,13 +34845,13 @@ public class Server { 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(deleteImageServer_result.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteImageByPath_result.class, metaDataMap); } - public deleteImageServer_result() { + public deleteImageByPath_result() { } - public deleteImageServer_result( + public deleteImageByPath_result( boolean success) { this(); @@ -34020,13 +34862,13 @@ public class Server { /** * Performs a deep copy on other. */ - public deleteImageServer_result(deleteImageServer_result other) { + public deleteImageByPath_result(deleteImageByPath_result other) { __isset_bitfield = other.__isset_bitfield; this.success = other.success; } - public deleteImageServer_result deepCopy() { - return new deleteImageServer_result(this); + public deleteImageByPath_result deepCopy() { + return new deleteImageByPath_result(this); } @Override @@ -34039,7 +34881,7 @@ public class Server { return this.success; } - public deleteImageServer_result setSuccess(boolean success) { + public deleteImageByPath_result setSuccess(boolean success) { this.success = success; setSuccessIsSet(true); return this; @@ -34097,12 +34939,12 @@ public class Server { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof deleteImageServer_result) - return this.equals((deleteImageServer_result)that); + if (that instanceof deleteImageByPath_result) + return this.equals((deleteImageByPath_result)that); return false; } - public boolean equals(deleteImageServer_result that) { + public boolean equals(deleteImageByPath_result that) { if (that == null) return false; @@ -34124,7 +34966,7 @@ public class Server { } @Override - public int compareTo(deleteImageServer_result other) { + public int compareTo(deleteImageByPath_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } @@ -34158,7 +35000,7 @@ public class Server { @Override public String toString() { - StringBuilder sb = new StringBuilder("deleteImageServer_result("); + StringBuilder sb = new StringBuilder("deleteImageByPath_result("); boolean first = true; sb.append("success:"); @@ -34191,15 +35033,15 @@ public class Server { } } - private static class deleteImageServer_resultStandardSchemeFactory implements SchemeFactory { - public deleteImageServer_resultStandardScheme getScheme() { - return new deleteImageServer_resultStandardScheme(); + private static class deleteImageByPath_resultStandardSchemeFactory implements SchemeFactory { + public deleteImageByPath_resultStandardScheme getScheme() { + return new deleteImageByPath_resultStandardScheme(); } } - private static class deleteImageServer_resultStandardScheme extends StandardScheme { + private static class deleteImageByPath_resultStandardScheme extends StandardScheme { - public void read(org.apache.thrift.protocol.TProtocol iprot, deleteImageServer_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, deleteImageByPath_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -34228,7 +35070,7 @@ public class Server { struct.validate(); } - public void write(org.apache.thrift.protocol.TProtocol oprot, deleteImageServer_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, deleteImageByPath_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); @@ -34243,16 +35085,16 @@ public class Server { } - private static class deleteImageServer_resultTupleSchemeFactory implements SchemeFactory { - public deleteImageServer_resultTupleScheme getScheme() { - return new deleteImageServer_resultTupleScheme(); + private static class deleteImageByPath_resultTupleSchemeFactory implements SchemeFactory { + public deleteImageByPath_resultTupleScheme getScheme() { + return new deleteImageByPath_resultTupleScheme(); } } - private static class deleteImageServer_resultTupleScheme extends TupleScheme { + private static class deleteImageByPath_resultTupleScheme extends TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, deleteImageServer_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, deleteImageByPath_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { @@ -34265,7 +35107,7 @@ public class Server { } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, deleteImageServer_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, deleteImageByPath_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { diff --git a/dozentenmodulserver/thrift/server.thrift b/dozentenmodulserver/thrift/server.thrift index defa0a2e..cf9b3aa9 100644 --- a/dozentenmodulserver/thrift/server.thrift +++ b/dozentenmodulserver/thrift/server.thrift @@ -78,6 +78,7 @@ service Server{ bool deleteImageData(1: string id, 2: string version), bool updateLecturedata(1: string name, 2: string newName, 3: string shortdesc, 4: string desc, 5: string startDate, 6: string endDate, 7: bool isActive, 8: string imageid, 9: string imageversion, 10: string user, 11: string firstname, 12: string lastname, 13: string university, 14: string Mail, 15: string Tel, 16: string Fak, 17: string id), bool deleteImageServer(1: string id, 2: string version), + bool deleteImageByPath(1: string image_path), bool connectedToLecture(1: string id, 2: string version), bool deleteLecture(1: string id, 2: string hs, 3: string user), bool checkUser(1: string username), -- cgit v1.2.3-55-g7522 From a928aad7addd38a8293a4515bcd69171ae2e4aa4 Mon Sep 17 00:00:00 2001 From: Michael Wilson Date: Fri, 28 Nov 2014 10:26:34 +0100 Subject: litte bugs removed --- .../src/main/java/gui/image/CreateImageAllgemein_GUI.java | 2 +- .../src/main/java/gui/image/CreateImageTechnisch_GUI.java | 1 + .../src/main/java/gui/image/EditImageAllgemein_GUI.java | 2 +- .../src/main/java/gui/image/EditImageTechnisch_GUI.java | 1 + .../src/main/java/gui/image/PermissionCreateImage_GUI.java | 4 ++-- .../src/main/java/gui/image/PermissionEditImage_GUI.java | 4 ++-- .../main/java/gui/lecture/PermissionCreateLecture_GUI.java | 12 ++++++------ .../src/main/java/gui/lecture/PermissionEditLecture_GUI.java | 10 +++++----- 8 files changed, 19 insertions(+), 17 deletions(-) (limited to 'dozentenmodul/src/main/java') diff --git a/dozentenmodul/src/main/java/gui/image/CreateImageAllgemein_GUI.java b/dozentenmodul/src/main/java/gui/image/CreateImageAllgemein_GUI.java index 5d72fc36..3b692257 100644 --- a/dozentenmodul/src/main/java/gui/image/CreateImageAllgemein_GUI.java +++ b/dozentenmodul/src/main/java/gui/image/CreateImageAllgemein_GUI.java @@ -137,7 +137,7 @@ public class CreateImageAllgemein_GUI extends JFrame { JPanel panel_1 = new JPanel(); panel_1.setBackground(SystemColor.menu); - panel_1.setBorder(new TitledBorder(null, "Informationen zum Besitzer", + panel_1.setBorder(new TitledBorder(null, "Informationen zum Image", TitledBorder.LEADING, TitledBorder.TOP, null, null)); panel_1.setBounds(10, 66, 557, 369); contentPanel.add(panel_1); diff --git a/dozentenmodul/src/main/java/gui/image/CreateImageTechnisch_GUI.java b/dozentenmodul/src/main/java/gui/image/CreateImageTechnisch_GUI.java index b77f93ea..e011615c 100644 --- a/dozentenmodul/src/main/java/gui/image/CreateImageTechnisch_GUI.java +++ b/dozentenmodul/src/main/java/gui/image/CreateImageTechnisch_GUI.java @@ -163,6 +163,7 @@ public class CreateImageTechnisch_GUI extends JFrame { chckbxIsInternetBlocked = new JCheckBox(""); chckbxIsInternetBlocked.setSelected(Image.image.isInternet()); chckbxIsInternetBlocked.setBounds(266, 80, 97, 23); + chckbxIsInternetBlocked.setEnabled(false); panel_1.add(chckbxIsInternetBlocked); JLabel lblLizenzserverEintragen = new JLabel("Lizenzserver eintragen:"); diff --git a/dozentenmodul/src/main/java/gui/image/EditImageAllgemein_GUI.java b/dozentenmodul/src/main/java/gui/image/EditImageAllgemein_GUI.java index a848c805..51c34392 100644 --- a/dozentenmodul/src/main/java/gui/image/EditImageAllgemein_GUI.java +++ b/dozentenmodul/src/main/java/gui/image/EditImageAllgemein_GUI.java @@ -144,7 +144,7 @@ public class EditImageAllgemein_GUI extends JFrame { JPanel panel_1 = new JPanel(); panel_1.setBackground(SystemColor.menu); - panel_1.setBorder(new TitledBorder(null, "Informationen zum Besitzer", + panel_1.setBorder(new TitledBorder(null, "Informationen zum Image", TitledBorder.LEADING, TitledBorder.TOP, null, null)); panel_1.setBounds(10, 66, 557, 369); contentPanel.add(panel_1); diff --git a/dozentenmodul/src/main/java/gui/image/EditImageTechnisch_GUI.java b/dozentenmodul/src/main/java/gui/image/EditImageTechnisch_GUI.java index 5ecda8d7..6447c776 100644 --- a/dozentenmodul/src/main/java/gui/image/EditImageTechnisch_GUI.java +++ b/dozentenmodul/src/main/java/gui/image/EditImageTechnisch_GUI.java @@ -151,6 +151,7 @@ public class EditImageTechnisch_GUI extends JFrame { chckbxIsInternetBlocked = new JCheckBox(""); chckbxIsInternetBlocked.setBounds(266, 85, 97, 23); + chckbxIsInternetBlocked.setEnabled(false); panel_1.add(chckbxIsInternetBlocked); JLabel lblInternetIstInnerhalb = new JLabel( diff --git a/dozentenmodul/src/main/java/gui/image/PermissionCreateImage_GUI.java b/dozentenmodul/src/main/java/gui/image/PermissionCreateImage_GUI.java index e1696ac4..be28b259 100644 --- a/dozentenmodul/src/main/java/gui/image/PermissionCreateImage_GUI.java +++ b/dozentenmodul/src/main/java/gui/image/PermissionCreateImage_GUI.java @@ -430,12 +430,12 @@ public class PermissionCreateImage_GUI extends JFrame { panel_2.add(lblLinkallowed); lblReadDesc = new JLabel( - "Image ist in bwLehrpool Suite und VMchooser sichtbar."); + "Benutzer kann Image in bwLehrpool Suite sehen."); lblReadDesc.setBounds(128, 18, 380, 20); panel_2.add(lblReadDesc); lblWriteDesc = new JLabel( - "Image anpassen und überschreiben, jedoch nicht löschen."); + "Image sehen, anpassen und überschreiben, jedoch nicht löschen."); lblWriteDesc.setBounds(128, 38, 380, 20); panel_2.add(lblWriteDesc); diff --git a/dozentenmodul/src/main/java/gui/image/PermissionEditImage_GUI.java b/dozentenmodul/src/main/java/gui/image/PermissionEditImage_GUI.java index f0eeeb11..53bd6689 100644 --- a/dozentenmodul/src/main/java/gui/image/PermissionEditImage_GUI.java +++ b/dozentenmodul/src/main/java/gui/image/PermissionEditImage_GUI.java @@ -411,12 +411,12 @@ public class PermissionEditImage_GUI extends JFrame { panel.add(label_3); JLabel lblImageLesenUnd = new JLabel( - "Image ist in bwLehrpool Suite und VMchooser sichtbar."); + "Benutzer kann Image in bwLehrpool Suite sehen."); lblImageLesenUnd.setBounds(128, 18, 380, 20); panel.add(lblImageLesenUnd); JLabel lblImageAnpassenUnd = new JLabel( - "Image anpassen und überschreiben, jedoch nicht löschen."); + "Image sehen, anpassen und überschreiben, jedoch nicht löschen."); lblImageAnpassenUnd.setBounds(128, 38, 380, 20); panel.add(lblImageAnpassenUnd); diff --git a/dozentenmodul/src/main/java/gui/lecture/PermissionCreateLecture_GUI.java b/dozentenmodul/src/main/java/gui/lecture/PermissionCreateLecture_GUI.java index 1b7f8077..e062f2d0 100644 --- a/dozentenmodul/src/main/java/gui/lecture/PermissionCreateLecture_GUI.java +++ b/dozentenmodul/src/main/java/gui/lecture/PermissionCreateLecture_GUI.java @@ -320,22 +320,22 @@ public class PermissionCreateLecture_GUI extends JFrame { panel.add(label_3); JLabel label_5 = new JLabel("Admin"); - label_5.setBounds(28, 78, 90, 20); + label_5.setBounds(28, 58, 90, 20); panel.add(label_5); JLabel label_7 = new JLabel( - "Veranstaltung ist in bwLehrpool Suite und VMchooser sichtbar.."); - label_7.setBounds(128, 18, 380, 20); + "Veranstaltung ist in bwLehrpool Suite und VMchooser sichtbar."); + label_7.setBounds(128, 18, 419, 20); panel.add(label_7); JLabel lblimageDarfAngepasst = new JLabel( - "Image darf angepasst und überschrieben, jedoch nicht gelöscht werden. Berechtigungen für andere Benutzer festlegen"); - lblimageDarfAngepasst.setBounds(128, 38, 380, 45); + "Veranstaltung darf angepasst und überschrieben, jedoch nicht gelöscht werden."); + lblimageDarfAngepasst.setBounds(128, 38, 419, 20); panel.add(lblimageDarfAngepasst); JLabel lblvolleRechteRead = new JLabel( "Volle Rechte: read, write, löschen und Berechtigungen für andere Benutzer festlegen."); - lblvolleRechteRead.setBounds(128, 78, 380, 40); + lblvolleRechteRead.setBounds(128, 58, 419, 20); panel.add(lblvolleRechteRead); JPanel panel_1 = new JPanel(); diff --git a/dozentenmodul/src/main/java/gui/lecture/PermissionEditLecture_GUI.java b/dozentenmodul/src/main/java/gui/lecture/PermissionEditLecture_GUI.java index db947b27..0a1f06d3 100644 --- a/dozentenmodul/src/main/java/gui/lecture/PermissionEditLecture_GUI.java +++ b/dozentenmodul/src/main/java/gui/lecture/PermissionEditLecture_GUI.java @@ -176,7 +176,7 @@ public class PermissionEditLecture_GUI extends JFrame { JLabel lblVeranstaltungIstIn = new JLabel( "Veranstaltung ist in bwLehrpool Suite und VMchooser für sichtbar."); - lblVeranstaltungIstIn.setBounds(128, 18, 380, 20); + lblVeranstaltungIstIn.setBounds(128, 18, 419, 20); panel.add(lblVeranstaltungIstIn); JLabel label_4 = new JLabel("Write"); @@ -184,17 +184,17 @@ public class PermissionEditLecture_GUI extends JFrame { panel.add(label_4); JLabel label_5 = new JLabel( - "Veranstaltung darf angepasst und überschrieben, jedoch nicht gelöscht werden. Berechtigungen für andere Benutzer festlegen"); - label_5.setBounds(128, 38, 380, 45); + "Veranstaltung darf angepasst und überschrieben, jedoch nicht gelöscht werden."); + label_5.setBounds(128, 38, 419, 20); panel.add(label_5); JLabel label_6 = new JLabel("Admin"); - label_6.setBounds(28, 78, 90, 20); + label_6.setBounds(28, 58, 90, 20); panel.add(label_6); JLabel label_7 = new JLabel( "Volle Rechte: read, write, löschen und Berechtigungen für andere Benutzer festlegen."); - label_7.setBounds(128, 78, 380, 40); + label_7.setBounds(128, 58, 419, 20); panel.add(label_7); JPanel panel_1 = new JPanel(); -- cgit v1.2.3-55-g7522 From cfbb9343346cd4b14bc728b3f416be42a92a8a9a Mon Sep 17 00:00:00 2001 From: Michael Wilson Date: Fri, 28 Nov 2014 13:31:04 +0100 Subject: • Vielzahl Textänderungen --- .../java/gui/image/CreateImageAllgemein_GUI.java | 2 +- .../java/gui/image/CreateImageTechnisch_GUI.java | 3 ++- .../src/main/java/gui/image/DeleteImage_GUI.java | 2 +- .../java/gui/image/EditImageAllgemein_GUI.java | 2 +- .../java/gui/image/EditImageTechnisch_GUI.java | 2 +- .../main/java/gui/image/FTPCreateUploader_GUI.java | 2 +- .../main/java/gui/image/FTPEditDownloader_GUI.java | 3 ++- .../main/java/gui/image/FTPEditUploader_GUI.java | 2 +- .../java/gui/image/FTPSearchDownloader_GUI.java | 3 ++- .../java/gui/image/PermissionCreateImage_GUI.java | 12 +++++------ .../java/gui/image/PermissionEditImage_GUI.java | 12 +++++------ .../main/java/gui/image/SearchEditImage_GUI.java | 2 +- .../src/main/java/gui/image/SearchImage_GUI.java | 2 +- .../src/main/java/gui/intro/MainMenue_GUI.java | 16 +++++++-------- .../gui/lecture/CreateLectureAllgemein_GUI.java | 2 +- .../java/gui/lecture/CreateLectureLink_GUI.java | 2 +- .../main/java/gui/lecture/DeleteLecture_GUI.java | 2 +- .../java/gui/lecture/EditLectureAllgemein_GUI.java | 2 +- .../main/java/gui/lecture/EditLectureLink_GUI.java | 2 +- .../java/gui/lecture/EditLectureSearch_GUI.java | 2 +- .../gui/lecture/PermissionCreateLecture_GUI.java | 12 +++++------ .../gui/lecture/PermissionEditLecture_GUI.java | 24 +++++++++++----------- .../main/java/gui/lecture/SearchLecture_GUI.java | 2 +- 23 files changed, 59 insertions(+), 56 deletions(-) (limited to 'dozentenmodul/src/main/java') diff --git a/dozentenmodul/src/main/java/gui/image/CreateImageAllgemein_GUI.java b/dozentenmodul/src/main/java/gui/image/CreateImageAllgemein_GUI.java index 3b692257..853fa582 100644 --- a/dozentenmodul/src/main/java/gui/image/CreateImageAllgemein_GUI.java +++ b/dozentenmodul/src/main/java/gui/image/CreateImageAllgemein_GUI.java @@ -102,7 +102,7 @@ public class CreateImageAllgemein_GUI extends JFrame { JOptionPane.ERROR_MESSAGE); } // Setzt den Titel - setTitle("bwLehrpool Suite - Image erzeugen"); + setTitle("bwLehrpool Suite - Image erzeugen - "+person.verantwortlicher.getUserID()); // Zentriert das Fenster setBounds(0, 0, 603, 722); setLocationRelativeTo(formerGUI); diff --git a/dozentenmodul/src/main/java/gui/image/CreateImageTechnisch_GUI.java b/dozentenmodul/src/main/java/gui/image/CreateImageTechnisch_GUI.java index e011615c..8e9a9b1f 100644 --- a/dozentenmodul/src/main/java/gui/image/CreateImageTechnisch_GUI.java +++ b/dozentenmodul/src/main/java/gui/image/CreateImageTechnisch_GUI.java @@ -43,6 +43,7 @@ import javax.swing.border.TitledBorder; import models.Image; import models.Links; +import models.person; import server.generated.Server.Client; import thrift.ThriftConnection; import util.GuiOrganizer; @@ -101,7 +102,7 @@ public class CreateImageTechnisch_GUI extends JFrame { // TODO Auto-generated catch block e.printStackTrace(); } - setTitle("bwLehrpool Suite - Image erzeugen"); + setTitle("bwLehrpool Suite - Image erzeugen - "+person.verantwortlicher.getUserID()); setBounds(0, 0, 603, 722); setLocationRelativeTo(formerGUI); diff --git a/dozentenmodul/src/main/java/gui/image/DeleteImage_GUI.java b/dozentenmodul/src/main/java/gui/image/DeleteImage_GUI.java index fe956f8f..660fccc9 100644 --- a/dozentenmodul/src/main/java/gui/image/DeleteImage_GUI.java +++ b/dozentenmodul/src/main/java/gui/image/DeleteImage_GUI.java @@ -229,7 +229,7 @@ public class DeleteImage_GUI extends JFrame { e.printStackTrace(); } // Setzt den Fenstertitel - setTitle("bwLehrpool Suite - Image löschen"); + setTitle("bwLehrpool Suite - Image löschen - "+person.verantwortlicher.getUserID()); // Zentriert das Fenster in die Bildmitte setBounds(0, 0, 918, 722); setLocationRelativeTo(formerGUI); diff --git a/dozentenmodul/src/main/java/gui/image/EditImageAllgemein_GUI.java b/dozentenmodul/src/main/java/gui/image/EditImageAllgemein_GUI.java index 51c34392..3bac78e8 100644 --- a/dozentenmodul/src/main/java/gui/image/EditImageAllgemein_GUI.java +++ b/dozentenmodul/src/main/java/gui/image/EditImageAllgemein_GUI.java @@ -108,7 +108,7 @@ public class EditImageAllgemein_GUI extends JFrame { e.printStackTrace(); } // Setzt den Fenstertitel - setTitle("bwLehrpool Suite - Image bearbeiten"); + setTitle("bwLehrpool Suite - Image bearbeiten - "+person.verantwortlicher.getUserID()); // Zentriert das Fenster in der Bildmitte setBounds(0, 0, 603, 722); diff --git a/dozentenmodul/src/main/java/gui/image/EditImageTechnisch_GUI.java b/dozentenmodul/src/main/java/gui/image/EditImageTechnisch_GUI.java index 6447c776..9f03d4d5 100644 --- a/dozentenmodul/src/main/java/gui/image/EditImageTechnisch_GUI.java +++ b/dozentenmodul/src/main/java/gui/image/EditImageTechnisch_GUI.java @@ -99,7 +99,7 @@ public class EditImageTechnisch_GUI extends JFrame { e.printStackTrace(); } // Setzt den Titel des Fensters - setTitle("bwLehrpool Suite - Image bearbeiten"); + setTitle("bwLehrpool Suite - Image bearbeiten - "+person.verantwortlicher.getUserID()); // Zentriert das Fenster setBounds(0, 0, 603, 722); setLocationRelativeTo(formerGUI); diff --git a/dozentenmodul/src/main/java/gui/image/FTPCreateUploader_GUI.java b/dozentenmodul/src/main/java/gui/image/FTPCreateUploader_GUI.java index 24df52be..3f1d7ab9 100644 --- a/dozentenmodul/src/main/java/gui/image/FTPCreateUploader_GUI.java +++ b/dozentenmodul/src/main/java/gui/image/FTPCreateUploader_GUI.java @@ -173,7 +173,7 @@ public class FTPCreateUploader_GUI extends JFrame implements // filename=name; setBackground(Color.WHITE); - setTitle("Dozentenmodul - Image erzeugen"); + setTitle("Dozentenmodul - Image erzeugen - "+person.verantwortlicher.getUserID()); // Aktion die beim Schliessen durchgefuehrt werden soll setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); diff --git a/dozentenmodul/src/main/java/gui/image/FTPEditDownloader_GUI.java b/dozentenmodul/src/main/java/gui/image/FTPEditDownloader_GUI.java index a9bd4880..1dd873b7 100644 --- a/dozentenmodul/src/main/java/gui/image/FTPEditDownloader_GUI.java +++ b/dozentenmodul/src/main/java/gui/image/FTPEditDownloader_GUI.java @@ -40,6 +40,7 @@ import javax.swing.border.EmptyBorder; import models.Image; import models.Links; import models.SessionData; +import models.person; import org.apache.log4j.Logger; import org.apache.thrift.TException; @@ -158,7 +159,7 @@ public class FTPEditDownloader_GUI extends JFrame implements } setBackground(Color.WHITE); - setTitle("Dozentenmodul - Image herunterladen"); + setTitle("Dozentenmodul - Image herunterladen - "+person.verantwortlicher.getUserID()); // Aktion die beim Schliessen durchgefuehrt werden soll setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); diff --git a/dozentenmodul/src/main/java/gui/image/FTPEditUploader_GUI.java b/dozentenmodul/src/main/java/gui/image/FTPEditUploader_GUI.java index 4619e680..e1c426bf 100644 --- a/dozentenmodul/src/main/java/gui/image/FTPEditUploader_GUI.java +++ b/dozentenmodul/src/main/java/gui/image/FTPEditUploader_GUI.java @@ -166,7 +166,7 @@ public class FTPEditUploader_GUI extends JFrame implements // filename=name; setBackground(Color.WHITE); - setTitle("Dozentenmodul - Image bearbeiten"); + setTitle("Dozentenmodul - Image bearbeiten - "+person.verantwortlicher.getUserID()); setBounds(0, 0, 603, 722); setLocationRelativeTo(formerGUI); diff --git a/dozentenmodul/src/main/java/gui/image/FTPSearchDownloader_GUI.java b/dozentenmodul/src/main/java/gui/image/FTPSearchDownloader_GUI.java index 1810f0b1..ba45fc79 100644 --- a/dozentenmodul/src/main/java/gui/image/FTPSearchDownloader_GUI.java +++ b/dozentenmodul/src/main/java/gui/image/FTPSearchDownloader_GUI.java @@ -39,6 +39,7 @@ import javax.swing.border.EmptyBorder; import models.Image; import models.Links; import models.SessionData; +import models.person; import org.apache.log4j.Logger; import org.apache.thrift.TException; @@ -158,7 +159,7 @@ public class FTPSearchDownloader_GUI extends JFrame implements } setBackground(Color.WHITE); - setTitle("Dozentenmodul - Image herunterladen"); + setTitle("Dozentenmodul - Image herunterladen - "+person.verantwortlicher.getUserID()); // Aktion die beim Schliessen durchgefuehrt werden soll setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); setBounds(0, 0, 603, 722); diff --git a/dozentenmodul/src/main/java/gui/image/PermissionCreateImage_GUI.java b/dozentenmodul/src/main/java/gui/image/PermissionCreateImage_GUI.java index be28b259..b51cdead 100644 --- a/dozentenmodul/src/main/java/gui/image/PermissionCreateImage_GUI.java +++ b/dozentenmodul/src/main/java/gui/image/PermissionCreateImage_GUI.java @@ -76,7 +76,7 @@ public class PermissionCreateImage_GUI extends JFrame { String[] result; private JTable table = null; private Class[] classes; - Object[] titles = { "Name", "Read", "Write", "Link", "Admin", "userID" }; + Object[] titles = { "Name", "Lesen", "Schreiben", "Link", "Admin", "userID" }; private List map = null; // List of people who have rights Component c = null; @@ -111,7 +111,7 @@ public class PermissionCreateImage_GUI extends JFrame { private JLabel lblLinkallowedDesc; private static final String HELP_MESSAGE = "
" + "Legen Sie fest, welche Personen welche Rechte an Ihrem Image haben.
" - + "Sie können die Rechte read, write, link und admin vergeben.
" + + "Sie können die Rechte Lesen, Schreiben, Link und Admin vergeben.
" + "Link bedeutet, dass diese Person Veranstaltungen auf Ihr Image verlinken darf und dieses somit
" + "implizit freigeben darf. Eine Person mit Adminrechten darf zusätzlich das Image löschen und Berechtigungen
" + "für andere Benutzer festlegen und ist somit wie der Besitzer zu betrachten." @@ -145,7 +145,7 @@ public class PermissionCreateImage_GUI extends JFrame { // TODO Auto-generated catch block e.printStackTrace(); } - setTitle("bwLehrpool Suite - Image bearbeiten"); + setTitle("bwLehrpool Suite - Image bearbeiten - "+person.verantwortlicher.getUserID()); setBounds(0, 0, 603, 722); setLocationRelativeTo(formerGUI); @@ -413,11 +413,11 @@ public class PermissionCreateImage_GUI extends JFrame { contentPanel.add(panel_2); panel_2.setLayout(null); - lblRead = new JLabel("Read"); + lblRead = new JLabel("Lesen"); lblRead.setBounds(28, 18, 90, 20); panel_2.add(lblRead); - lblWrite = new JLabel("Write"); + lblWrite = new JLabel("Schreiben"); lblWrite.setBounds(28, 38, 90, 20); panel_2.add(lblWrite); @@ -440,7 +440,7 @@ public class PermissionCreateImage_GUI extends JFrame { panel_2.add(lblWriteDesc); lblAdminDesc = new JLabel( - "Volle Rechte: read, write, löschen, Link und
Berechtigungen für andere Benutzer festlegen."); + "Volle Rechte: Lesen, Schreiben, Löschen, Link und
Berechtigungen für andere Benutzer festlegen."); lblAdminDesc.setBounds(128, 78, 380, 40); panel_2.add(lblAdminDesc); diff --git a/dozentenmodul/src/main/java/gui/image/PermissionEditImage_GUI.java b/dozentenmodul/src/main/java/gui/image/PermissionEditImage_GUI.java index 53bd6689..4dd6cf8f 100644 --- a/dozentenmodul/src/main/java/gui/image/PermissionEditImage_GUI.java +++ b/dozentenmodul/src/main/java/gui/image/PermissionEditImage_GUI.java @@ -71,7 +71,7 @@ public class PermissionEditImage_GUI extends JFrame { String[] result; private JTable table; private Class[] classes; - Object[] titles = { "Name", "Read", "Write", "Link", "Admin", "userID" }; + Object[] titles = { "Name", "Lesen", "Schreiben", "Link", "Admin", "userID" }; private List map = null; // List of people who have rights Component c = null; @@ -101,7 +101,7 @@ public class PermissionEditImage_GUI extends JFrame { private JLabel lblvolleRechteRead; private static final String HELP_MESSAGE = "
" + "Verändern Sie die Berechtigungen für Ihr Image.
" - + "Sie können die Rechte read, write, link und admin vergeben.
" + + "Sie können die Rechte Lesen, Schreiben, Link und Admin vergeben.
" + "Link bedeutet, dass diese Person Veranstaltungen auf Ihr Image verlinken darf und dieses somit
" + "implizit freigeben darf. Eine Person mit Adminrechten darf zusätzlich das Image löschen und Berechtigungen
" + "für andere Benutzer festlegen und ist somit wie der Besitzer zu betrachten." @@ -132,7 +132,7 @@ public class PermissionEditImage_GUI extends JFrame { // TODO Auto-generated catch block e.printStackTrace(); } - setTitle("bwLehrpool Suite - Image bearbeiten"); + setTitle("bwLehrpool Suite - Image bearbeiten - "+person.verantwortlicher.getUserID()); setBounds(0, 0, 603, 722); setLocationRelativeTo(formerGUI); @@ -402,11 +402,11 @@ public class PermissionEditImage_GUI extends JFrame { TitledBorder.LEADING, TitledBorder.TOP, null, null)); panel.setBackground(SystemColor.menu); - JLabel label = new JLabel("Read"); + JLabel label = new JLabel("Lesen"); label.setBounds(28, 18, 90, 20); panel.add(label); - JLabel label_3 = new JLabel("Write"); + JLabel label_3 = new JLabel("Schreiben"); label_3.setBounds(28, 38, 90, 20); panel.add(label_3); @@ -434,7 +434,7 @@ public class PermissionEditImage_GUI extends JFrame { panel.add(label_6); lblvolleRechteRead = new JLabel( - "Volle Rechte: read, write, löschen, Link und
Berechtigungen für andere Benutzer festlegen."); + "Volle Rechte: Lesen, Schreiben, Löschen, Link und
Berechtigungen für andere Benutzer festlegen."); lblvolleRechteRead.setBounds(128, 78, 380, 40); panel.add(lblvolleRechteRead); { diff --git a/dozentenmodul/src/main/java/gui/image/SearchEditImage_GUI.java b/dozentenmodul/src/main/java/gui/image/SearchEditImage_GUI.java index 7b8578c6..dbfbcdce 100644 --- a/dozentenmodul/src/main/java/gui/image/SearchEditImage_GUI.java +++ b/dozentenmodul/src/main/java/gui/image/SearchEditImage_GUI.java @@ -213,7 +213,7 @@ public class SearchEditImage_GUI extends JFrame { e.printStackTrace(); } // Setzt den Fenstertitel - setTitle("bwLehrpool Suite - Image bearbeiten"); + setTitle("bwLehrpool Suite - Image bearbeiten - "+person.verantwortlicher.getUserID()); // Zentriert das Fenster in die Bildmitte setBounds(0, 0, 918, 722); setLocationRelativeTo(formerGUI); diff --git a/dozentenmodul/src/main/java/gui/image/SearchImage_GUI.java b/dozentenmodul/src/main/java/gui/image/SearchImage_GUI.java index a0d36c5a..68827f42 100644 --- a/dozentenmodul/src/main/java/gui/image/SearchImage_GUI.java +++ b/dozentenmodul/src/main/java/gui/image/SearchImage_GUI.java @@ -305,7 +305,7 @@ public class SearchImage_GUI extends JFrame { e.printStackTrace(); } // Setzt den Fenstertitel - setTitle("bwLehrpool Suite - Image suchen"); + setTitle("bwLehrpool Suite - Image suchen - "+person.verantwortlicher.getUserID()); // Zentriert das Fenster in die Bildmitte setBounds(0, 0, 918, 722); setLocationRelativeTo(formerGUI); diff --git a/dozentenmodul/src/main/java/gui/intro/MainMenue_GUI.java b/dozentenmodul/src/main/java/gui/intro/MainMenue_GUI.java index 228cf831..eff62ba1 100644 --- a/dozentenmodul/src/main/java/gui/intro/MainMenue_GUI.java +++ b/dozentenmodul/src/main/java/gui/intro/MainMenue_GUI.java @@ -170,7 +170,7 @@ public class MainMenue_GUI extends JFrame { rdbtnImageNew = new JRadioButton("Neu"); rdbtnImageNew .setToolTipText("Hier können Sie ein neues Image anlegen und im Anschluss eine Veranstaltung darauf verlinken"); - rdbtnImageNew.setBounds(20, 22, 159, 23); + rdbtnImageNew.setBounds(20, 22, 244, 23); panelImage.add(rdbtnImageNew); buttonGroup.add(rdbtnImageNew); rdbtnImageNew.setBackground(SystemColor.menu); @@ -178,7 +178,7 @@ public class MainMenue_GUI extends JFrame { rdbtnImageEdit = new JRadioButton("Bearbeiten"); rdbtnImageEdit .setToolTipText("Hier können Sie ein bereits angelegtes Image bearbeiten"); - rdbtnImageEdit.setBounds(20, 48, 185, 23); + rdbtnImageEdit.setBounds(20, 48, 244, 23); panelImage.add(rdbtnImageEdit); buttonGroup.add(rdbtnImageEdit); rdbtnImageEdit.setHorizontalAlignment(SwingConstants.LEFT); @@ -191,16 +191,16 @@ public class MainMenue_GUI extends JFrame { .setToolTipText("Löschen Sie hier Images, die Sie nicht mehr benötigen"); rdbtnImageDelete.setHorizontalAlignment(SwingConstants.LEFT); rdbtnImageDelete.setBackground(SystemColor.menu); - rdbtnImageDelete.setBounds(20, 74, 185, 23); + rdbtnImageDelete.setBounds(20, 74, 244, 23); panelImage.add(rdbtnImageDelete); - rdbtnImageSearchDownload = new JRadioButton("Suche und Download"); + rdbtnImageSearchDownload = new JRadioButton("Suche und Download (inkl. Vorlagen)"); buttonGroup.add(rdbtnImageSearchDownload); rdbtnImageSearchDownload .setToolTipText("Hier können Sie ein bestehendes Labor zum verändern downloaden"); rdbtnImageSearchDownload.setHorizontalAlignment(SwingConstants.LEFT); rdbtnImageSearchDownload.setBackground(SystemColor.menu); - rdbtnImageSearchDownload.setBounds(20, 100, 185, 23); + rdbtnImageSearchDownload.setBounds(20, 100, 244, 23); panelImage.add(rdbtnImageSearchDownload); JPanel panelDesc = new JPanel(); @@ -239,7 +239,7 @@ public class MainMenue_GUI extends JFrame { buttonGroup.add(rdbtnLectureNew); rdbtnLectureNew .setToolTipText("Erzeugen Sie Veranstaltungen, die dann im VMChooser erscheinen und mit denen Ihre Studierenden arbeiten können - hierzu benötigen Sie ein Image"); - rdbtnLectureNew.setBounds(20, 24, 185, 23); + rdbtnLectureNew.setBounds(20, 24, 230, 23); panelVeranstaltung.add(rdbtnLectureNew); rdbtnLectureNew.setBackground(SystemColor.menu); @@ -254,7 +254,7 @@ public class MainMenue_GUI extends JFrame { rdbtnLectureDelete = new JRadioButton("Löschen"); rdbtnLectureDelete .setToolTipText("Löschen Sie nicht mehr benötigte Veranstaltungen"); - rdbtnLectureDelete.setBounds(20, 76, 175, 23); + rdbtnLectureDelete.setBounds(20, 76, 230, 23); panelVeranstaltung.add(rdbtnLectureDelete); buttonGroup.add(rdbtnLectureDelete); rdbtnLectureDelete.setBackground(SystemColor.menu); @@ -264,7 +264,7 @@ public class MainMenue_GUI extends JFrame { rdbtnLectureSearch .setToolTipText("Hier können Sie wahlweise nach Ihren eigenen, aber auch nach allen verfügbaren Veranstaltungen suchen"); rdbtnLectureSearch.setBackground(SystemColor.menu); - rdbtnLectureSearch.setBounds(20, 102, 175, 23); + rdbtnLectureSearch.setBounds(20, 102, 230, 23); panelVeranstaltung.add(rdbtnLectureSearch); JPanel panelNews = new JPanel(); diff --git a/dozentenmodul/src/main/java/gui/lecture/CreateLectureAllgemein_GUI.java b/dozentenmodul/src/main/java/gui/lecture/CreateLectureAllgemein_GUI.java index 9f2c56d1..5d6efe40 100644 --- a/dozentenmodul/src/main/java/gui/lecture/CreateLectureAllgemein_GUI.java +++ b/dozentenmodul/src/main/java/gui/lecture/CreateLectureAllgemein_GUI.java @@ -107,7 +107,7 @@ public class CreateLectureAllgemein_GUI extends JFrame { e.printStackTrace(); } - setTitle("bwLehrpool Suite - Veranstaltung erzeugen"); + setTitle("bwLehrpool Suite - Veranstaltung erzeugen - "+person.verantwortlicher.getUserID()); setBounds(0, 0, 603, 722); setLocationRelativeTo(formerGUI); diff --git a/dozentenmodul/src/main/java/gui/lecture/CreateLectureLink_GUI.java b/dozentenmodul/src/main/java/gui/lecture/CreateLectureLink_GUI.java index 8497bc93..040544a2 100644 --- a/dozentenmodul/src/main/java/gui/lecture/CreateLectureLink_GUI.java +++ b/dozentenmodul/src/main/java/gui/lecture/CreateLectureLink_GUI.java @@ -215,7 +215,7 @@ public class CreateLectureLink_GUI extends JFrame { e.printStackTrace(); } - setTitle("bwLehrpool Suite - Veranstaltung erzeugen"); + setTitle("bwLehrpool Suite - Veranstaltung erzeugen - "+person.verantwortlicher.getUserID()); setBounds(0, 0, 918, 722); setLocationRelativeTo(formerGUI); diff --git a/dozentenmodul/src/main/java/gui/lecture/DeleteLecture_GUI.java b/dozentenmodul/src/main/java/gui/lecture/DeleteLecture_GUI.java index e6b178a6..e816d240 100644 --- a/dozentenmodul/src/main/java/gui/lecture/DeleteLecture_GUI.java +++ b/dozentenmodul/src/main/java/gui/lecture/DeleteLecture_GUI.java @@ -204,7 +204,7 @@ public class DeleteLecture_GUI extends JFrame { e.printStackTrace(); } // Setzt den Fenstertitel - setTitle("bwLehrpool Suite - Veranstaltung löschen"); + setTitle("bwLehrpool Suite - Veranstaltung löschen - "+person.verantwortlicher.getUserID()); // Zentriert das Fenster in die Bildmitte setBounds(0, 0, 842, 722); setLocationRelativeTo(formerGUI); diff --git a/dozentenmodul/src/main/java/gui/lecture/EditLectureAllgemein_GUI.java b/dozentenmodul/src/main/java/gui/lecture/EditLectureAllgemein_GUI.java index 2168cfdc..636dc416 100644 --- a/dozentenmodul/src/main/java/gui/lecture/EditLectureAllgemein_GUI.java +++ b/dozentenmodul/src/main/java/gui/lecture/EditLectureAllgemein_GUI.java @@ -111,7 +111,7 @@ public class EditLectureAllgemein_GUI extends JFrame { e.printStackTrace(); } - setTitle("bwLehrpool Suite - Veranstaltung bearbeiten"); + setTitle("bwLehrpool Suite - Veranstaltung bearbeiten - "+person.verantwortlicher.getUserID()); ; setBounds(0, 0, 603, 722); setLocationRelativeTo(formerGUI); diff --git a/dozentenmodul/src/main/java/gui/lecture/EditLectureLink_GUI.java b/dozentenmodul/src/main/java/gui/lecture/EditLectureLink_GUI.java index 4a0f010a..a7953dec 100644 --- a/dozentenmodul/src/main/java/gui/lecture/EditLectureLink_GUI.java +++ b/dozentenmodul/src/main/java/gui/lecture/EditLectureLink_GUI.java @@ -292,7 +292,7 @@ public class EditLectureLink_GUI extends JFrame { e.printStackTrace(); } - setTitle("bwLehrpool Suite - Veranstaltung bearbeiten"); + setTitle("bwLehrpool Suite - Veranstaltung bearbeiten - "+person.verantwortlicher.getUserID()); setBounds(0, 0, 918, 722); setLocationRelativeTo(formerGUI); diff --git a/dozentenmodul/src/main/java/gui/lecture/EditLectureSearch_GUI.java b/dozentenmodul/src/main/java/gui/lecture/EditLectureSearch_GUI.java index 6131350c..c6f1ada6 100644 --- a/dozentenmodul/src/main/java/gui/lecture/EditLectureSearch_GUI.java +++ b/dozentenmodul/src/main/java/gui/lecture/EditLectureSearch_GUI.java @@ -196,7 +196,7 @@ public class EditLectureSearch_GUI extends JFrame { e.printStackTrace(); } // Setzt den Fenstertitel - setTitle("bwLehrpool Suite - Veranstaltung bearbeiten"); + setTitle("bwLehrpool Suite - Veranstaltung bearbeiten - "+person.verantwortlicher.getUserID()); // Zentriert das Fenster in die Bildmitte setBounds(0, 0, 842, 722); setLocationRelativeTo(formerGUI); diff --git a/dozentenmodul/src/main/java/gui/lecture/PermissionCreateLecture_GUI.java b/dozentenmodul/src/main/java/gui/lecture/PermissionCreateLecture_GUI.java index e062f2d0..58afb5b6 100644 --- a/dozentenmodul/src/main/java/gui/lecture/PermissionCreateLecture_GUI.java +++ b/dozentenmodul/src/main/java/gui/lecture/PermissionCreateLecture_GUI.java @@ -80,7 +80,7 @@ public class PermissionCreateLecture_GUI extends JFrame { // private JTable table = null; private JTable tablePermittedUsers = null; private final ButtonGroup buttonGroup = new ButtonGroup(); - Object[] titles = { "Name", "Read", "Write", "Admin", "userID" }; + Object[] titles = { "Name", "Lesen", "Schreiben", "Admin", "userID" }; // Object[] titles = { "Name", "Read", "Write", "Link", "Admin", "userID" }; Component c = null; private static final String HELP_MESSAGE = "
" @@ -144,7 +144,7 @@ public class PermissionCreateLecture_GUI extends JFrame { | IllegalAccessException | UnsupportedLookAndFeelException e) { e.printStackTrace(); } - setTitle("bwLehrpool Suite - Berechtigungen"); + setTitle("bwLehrpool Suite - Berechtigungen - "+person.verantwortlicher.getUserID()); setBounds(0, 0, 603, 722); setLocationRelativeTo(formerGUI); @@ -311,11 +311,11 @@ public class PermissionCreateLecture_GUI extends JFrame { TitledBorder.LEADING, TitledBorder.TOP, null, null)); panel.setBackground(SystemColor.menu); - JLabel label = new JLabel("Read"); + JLabel label = new JLabel("Lesen"); label.setBounds(28, 18, 90, 20); panel.add(label); - JLabel label_3 = new JLabel("Write"); + JLabel label_3 = new JLabel("Schreiben"); label_3.setBounds(28, 38, 90, 20); panel.add(label_3); @@ -334,8 +334,8 @@ public class PermissionCreateLecture_GUI extends JFrame { panel.add(lblimageDarfAngepasst); JLabel lblvolleRechteRead = new JLabel( - "Volle Rechte: read, write, löschen und Berechtigungen für andere Benutzer festlegen."); - lblvolleRechteRead.setBounds(128, 58, 419, 20); + "Volle Rechte: Lesen, Schreiben, Löschen und Berechtigungen für andere Benutzer festlegen."); + lblvolleRechteRead.setBounds(128, 58, 419, 35); panel.add(lblvolleRechteRead); JPanel panel_1 = new JPanel(); diff --git a/dozentenmodul/src/main/java/gui/lecture/PermissionEditLecture_GUI.java b/dozentenmodul/src/main/java/gui/lecture/PermissionEditLecture_GUI.java index 0a1f06d3..22b5ebee 100644 --- a/dozentenmodul/src/main/java/gui/lecture/PermissionEditLecture_GUI.java +++ b/dozentenmodul/src/main/java/gui/lecture/PermissionEditLecture_GUI.java @@ -75,7 +75,7 @@ public class PermissionEditLecture_GUI extends JFrame { String[] result; private JTable table; private Class[] classes; - Object[] titles = { "Name", "Read", "Write", "Admin", "userID" }; + Object[] titles = { "Name", "Lesen", "Schreiben", "Admin", "userID" }; private List map = null; // List of people who have rights Component c = null; private static final String HELP_MESSAGE = "
" @@ -128,7 +128,7 @@ public class PermissionEditLecture_GUI extends JFrame { e.printStackTrace(); } - setTitle("bwLehrpool Suite - Berechtigungen"); + setTitle("bwLehrpool Suite - Berechtigungen - "+person.verantwortlicher.getUserID()); setBounds(0, 0, 603, 722); setLocationRelativeTo(formerGUI); @@ -170,18 +170,18 @@ public class PermissionEditLecture_GUI extends JFrame { panel.setBounds(10, 35, 557, 130); contentPanel.add(panel); - JLabel label = new JLabel("Read"); - label.setBounds(28, 18, 90, 20); - panel.add(label); + JLabel lblLesen = new JLabel("Lesen"); + lblLesen.setBounds(28, 18, 90, 20); + panel.add(lblLesen); JLabel lblVeranstaltungIstIn = new JLabel( "Veranstaltung ist in bwLehrpool Suite und VMchooser für sichtbar."); lblVeranstaltungIstIn.setBounds(128, 18, 419, 20); panel.add(lblVeranstaltungIstIn); - JLabel label_4 = new JLabel("Write"); - label_4.setBounds(28, 38, 90, 20); - panel.add(label_4); + JLabel lblSchreiben = new JLabel("Schreiben"); + lblSchreiben.setBounds(28, 38, 90, 20); + panel.add(lblSchreiben); JLabel label_5 = new JLabel( "Veranstaltung darf angepasst und überschrieben, jedoch nicht gelöscht werden."); @@ -192,10 +192,10 @@ public class PermissionEditLecture_GUI extends JFrame { label_6.setBounds(28, 58, 90, 20); panel.add(label_6); - JLabel label_7 = new JLabel( - "Volle Rechte: read, write, löschen und Berechtigungen für andere Benutzer festlegen."); - label_7.setBounds(128, 58, 419, 20); - panel.add(label_7); + JLabel lblvolleRechteLesen = new JLabel( + "Volle Rechte: Lesen, Schreiben, Löschen und Berechtigungen für andere Benutzer festlegen."); + lblvolleRechteLesen.setBounds(128, 58, 419, 35); + panel.add(lblvolleRechteLesen); JPanel panel_1 = new JPanel(); panel_1.setBackground(SystemColor.menu); diff --git a/dozentenmodul/src/main/java/gui/lecture/SearchLecture_GUI.java b/dozentenmodul/src/main/java/gui/lecture/SearchLecture_GUI.java index 7401dc1c..d44f2908 100644 --- a/dozentenmodul/src/main/java/gui/lecture/SearchLecture_GUI.java +++ b/dozentenmodul/src/main/java/gui/lecture/SearchLecture_GUI.java @@ -223,7 +223,7 @@ public class SearchLecture_GUI extends JFrame { e.printStackTrace(); } // Setzt den Fenstertitel - setTitle("bwLehrpool Suite - Veranstaltung suchen"); + setTitle("bwLehrpool Suite - Veranstaltung suchen - "+person.verantwortlicher.getUserID()); // Zentriert das Fenster in die Bildmitte 2; setBounds(0, 0, 842, 722); setLocationRelativeTo(formerGUI); -- cgit v1.2.3-55-g7522 From 67cf2e894abf4c499545507c43b3f4692ceb6320 Mon Sep 17 00:00:00 2001 From: Michael Wilson Date: Fri, 28 Nov 2014 14:25:35 +0100 Subject: Tabs have show number of rows contained --- .../src/main/java/gui/image/SearchImage_GUI.java | 35 +++++---------- .../main/java/gui/lecture/EditLectureLink_GUI.java | 51 +++++++++++++++++++++- .../main/java/gui/lecture/SearchLecture_GUI.java | 4 ++ 3 files changed, 63 insertions(+), 27 deletions(-) (limited to 'dozentenmodul/src/main/java') diff --git a/dozentenmodul/src/main/java/gui/image/SearchImage_GUI.java b/dozentenmodul/src/main/java/gui/image/SearchImage_GUI.java index 68827f42..40434153 100644 --- a/dozentenmodul/src/main/java/gui/image/SearchImage_GUI.java +++ b/dozentenmodul/src/main/java/gui/image/SearchImage_GUI.java @@ -172,7 +172,6 @@ public class SearchImage_GUI extends JFrame { try { client.setTokenForSession(SessionData.session.getAuthToken()); } catch (TException e1) { - // TODO Auto-generated catch block e1.printStackTrace(); } @@ -506,29 +505,6 @@ public class SearchImage_GUI extends JFrame { tabbedPane = new JTabbedPane(JTabbedPane.TOP); - //not needed anymore, as the filters are set by the full text search completely - /* - 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)); //--> caused bug: no initial list in public images - } - else if (tabbedPane.getSelectedIndex() == 2 && activeSearch == false) - { - //rowSorterAll.setRowFilter(null); - } - - } - }); - */ tabbedPane.setBounds(10, 158, 557, 339); contentPanel.add(tabbedPane); @@ -788,6 +764,8 @@ public class SearchImage_GUI extends JFrame { }); btnDownload.setBounds(449, 508, 118, 23); contentPanel.add(btnDownload); + + { JPanel buttonPane = new JPanel(); buttonPane.setBounds(0, 640, 902, 33); @@ -1009,7 +987,7 @@ public class SearchImage_GUI extends JFrame { } }); menuBar.add(mnNewMenu_Info); - + c = this; } @@ -1053,6 +1031,9 @@ public class SearchImage_GUI extends JFrame { i.next(); } + + //show number of rows in GUI + tabbedPane.setTitleAt(0, tabbedPane.getTitleAt(0)+" ("+model.getRowCount()+") "); return model; } catch (TException | ParseException e1) { @@ -1099,6 +1080,8 @@ public class SearchImage_GUI extends JFrame { i.next(); } + //show number of rows in GUI + tabbedPane.setTitleAt(2, tabbedPane.getTitleAt(2)+" ("+model.getRowCount()+") "); return model; } catch (TException | ParseException e1) { @@ -1144,6 +1127,8 @@ public class SearchImage_GUI extends JFrame { i.next(); } + //show number of rows in GUI + tabbedPane.setTitleAt(1, tabbedPane.getTitleAt(1)+" ("+model.getRowCount()+") "); return model; } catch (TException | ParseException e1) { diff --git a/dozentenmodul/src/main/java/gui/lecture/EditLectureLink_GUI.java b/dozentenmodul/src/main/java/gui/lecture/EditLectureLink_GUI.java index a7953dec..1633cb15 100644 --- a/dozentenmodul/src/main/java/gui/lecture/EditLectureLink_GUI.java +++ b/dozentenmodul/src/main/java/gui/lecture/EditLectureLink_GUI.java @@ -167,9 +167,8 @@ public class EditLectureLink_GUI extends JFrame { @Override public void windowOpened(WindowEvent arg0) { try { - initTableModel(modelAll); + initTableModelAll(modelAll); initTableModel(modelMyImages); - //initTableModel(modelPublicVorlagen); initTableModelTemplates(modelPublicVorlagen); } catch (TException e) { @@ -1248,6 +1247,52 @@ public class EditLectureLink_GUI extends JFrame { x++; i.next(); } + + //show number of rows in GUI + tabbedPane.setTitleAt(0, tabbedPane.getTitleAt(0)+" ("+model.getRowCount()+") "); + + return model; + + } + + + public DefaultTableModel initTableModelAll(DefaultTableModel model) + throws TException, ParseException { + List images; + + // Hole eine Liste der Images + if(person.verantwortlicher.getRole()=="Admin"){ + //get complete list + images = client.getImageList(person.verantwortlicher.getUserID()); + } else { + //get permitted list + images = client.getImageListPermissionLink(person.verantwortlicher + .getUserID()); + } + + Iterator 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(), + images.get(x).getDescription()}; + // Fuege diese Objekte der Tabelle hinzu + model.addRow(obj); + x++; + i.next(); + } + + //show number of rows in GUI + tabbedPane.setTitleAt(2, tabbedPane.getTitleAt(2)+" ("+model.getRowCount()+") "); return model; @@ -1284,6 +1329,8 @@ public class EditLectureLink_GUI extends JFrame { i.next(); } + //show number of rows in GUI + tabbedPane.setTitleAt(1, tabbedPane.getTitleAt(1)+" ("+model.getRowCount()+") "); return model; diff --git a/dozentenmodul/src/main/java/gui/lecture/SearchLecture_GUI.java b/dozentenmodul/src/main/java/gui/lecture/SearchLecture_GUI.java index d44f2908..7180650e 100644 --- a/dozentenmodul/src/main/java/gui/lecture/SearchLecture_GUI.java +++ b/dozentenmodul/src/main/java/gui/lecture/SearchLecture_GUI.java @@ -660,6 +660,8 @@ public class SearchLecture_GUI extends JFrame { i.next(); } + //show number of rows in GUI + tabbedPane.setTitleAt(0, tabbedPane.getTitleAt(0)+" ("+model.getRowCount()+") "); return model; } catch (TException e1) { @@ -697,6 +699,8 @@ public class SearchLecture_GUI extends JFrame { i.next(); } + //show number of rows in GUI + tabbedPane.setTitleAt(1, tabbedPane.getTitleAt(1)+" ("+model.getRowCount()+") "); return model; } catch (TException e1) { -- cgit v1.2.3-55-g7522 From 799431320f7f7c5574501b5e97815bc594c6f411 Mon Sep 17 00:00:00 2001 From: Michael Wilson Date: Fri, 28 Nov 2014 15:01:56 +0100 Subject: • Added number of listed slements --- dozentenmodul/src/main/java/gui/image/DeleteImage_GUI.java | 11 +++++++++-- .../src/main/java/gui/image/SearchEditImage_GUI.java | 8 +++++++- .../src/main/java/gui/lecture/CreateLectureLink_GUI.java | 7 +++++++ .../src/main/java/gui/lecture/DeleteLecture_GUI.java | 9 ++++++++- .../src/main/java/gui/lecture/EditLectureSearch_GUI.java | 9 +++++++++ 5 files changed, 40 insertions(+), 4 deletions(-) (limited to 'dozentenmodul/src/main/java') diff --git a/dozentenmodul/src/main/java/gui/image/DeleteImage_GUI.java b/dozentenmodul/src/main/java/gui/image/DeleteImage_GUI.java index 660fccc9..2a394205 100644 --- a/dozentenmodul/src/main/java/gui/image/DeleteImage_GUI.java +++ b/dozentenmodul/src/main/java/gui/image/DeleteImage_GUI.java @@ -95,6 +95,7 @@ public class DeleteImage_GUI extends JFrame { JComboBox comboBox; JTable tablemyImages; private JTextField textFieldName; + private JLabel lblTotalResults = new JLabel("Anzahl:"); boolean activeSearch = false; Component c = null; String[] titles = { "Name", "Lizenzpflichtig", "OS", "Veranstaltung", @@ -182,9 +183,8 @@ public class DeleteImage_GUI extends JFrame { @Override public void windowOpened(WindowEvent arg0) { - //initTableModel(modelAll); + initTableModel(modelMyImages); - //initTableModel(modelPublicVorlagen); // auszublendende Angaben // 1=Lizenzpflichtig @@ -544,6 +544,10 @@ public class DeleteImage_GUI extends JFrame { tablemyImages.setRowSorter(rowSorterMyImages); scrollPaneMyImage.setViewportView(tablemyImages); + + + lblTotalResults.setBounds(10, 512, 131, 20); + contentPanel.add(lblTotalResults); { JPanel buttonPane = new JPanel(); buttonPane.setBounds(0, 640, 902, 33); @@ -820,6 +824,9 @@ public class DeleteImage_GUI extends JFrame { if(x==0){ System.out.println("Damn... nothing to do here.."); } + + //show number if rows in GUI + lblTotalResults.setText(lblTotalResults.getText()+" "+model.getRowCount()); return model; } catch (TException | ParseException e1) { diff --git a/dozentenmodul/src/main/java/gui/image/SearchEditImage_GUI.java b/dozentenmodul/src/main/java/gui/image/SearchEditImage_GUI.java index dbfbcdce..290bd1e0 100644 --- a/dozentenmodul/src/main/java/gui/image/SearchEditImage_GUI.java +++ b/dozentenmodul/src/main/java/gui/image/SearchEditImage_GUI.java @@ -140,6 +140,7 @@ public class SearchEditImage_GUI extends JFrame { RowFilter rf = null; List> filters = new ArrayList>(2); + private JLabel lblTotalResults; /** @@ -483,6 +484,10 @@ public class SearchEditImage_GUI extends JFrame { scrollPaneMyImage.setViewportView(tablemyImages); + + lblTotalResults = new JLabel("Anzahl:"); + lblTotalResults.setBounds(10, 512, 131, 20); + contentPanel.add(lblTotalResults); { JPanel buttonPane = new JPanel(); buttonPane.setBounds(0, 640, 902, 33); @@ -795,7 +800,8 @@ public class SearchEditImage_GUI extends JFrame { x++; i.next(); } - //LOGGER.info("Finished counting crap, mo"+model.getRowCount()); + //show number if rows in GUI + lblTotalResults.setText(lblTotalResults.getText()+" "+model.getRowCount()); return model; } catch (TException | ParseException e1) { diff --git a/dozentenmodul/src/main/java/gui/lecture/CreateLectureLink_GUI.java b/dozentenmodul/src/main/java/gui/lecture/CreateLectureLink_GUI.java index 040544a2..a8634e3d 100644 --- a/dozentenmodul/src/main/java/gui/lecture/CreateLectureLink_GUI.java +++ b/dozentenmodul/src/main/java/gui/lecture/CreateLectureLink_GUI.java @@ -100,6 +100,7 @@ public class CreateLectureLink_GUI extends JFrame { boolean activeSearch = false; Component c = null; private JTextField textFieldName; + private JLabel lblTotalResults; private String uuid = null; String[] titles = { "Image-Name", "Lizenzpflichtig", "OS", "Veranstaltung", "Verantwortlicher", "Letztes Update", "ID", "Version", "Template", "Beschreibung" }; @@ -415,6 +416,10 @@ public class CreateLectureLink_GUI extends JFrame { tablemyImages.setRowSorter(rowSorterMyImages); scrollPaneMyImage.setViewportView(tablemyImages); + + lblTotalResults = new JLabel("Anzahl:"); + lblTotalResults.setBounds(10, 512, 131, 20); + contentPanel.add(lblTotalResults); { JPanel buttonPane = new JPanel(); @@ -792,6 +797,8 @@ public class CreateLectureLink_GUI extends JFrame { i.next(); } + //show number if rows in GUI + lblTotalResults.setText(lblTotalResults.getText()+" "+model.getRowCount()); return model; diff --git a/dozentenmodul/src/main/java/gui/lecture/DeleteLecture_GUI.java b/dozentenmodul/src/main/java/gui/lecture/DeleteLecture_GUI.java index e816d240..9449dcd7 100644 --- a/dozentenmodul/src/main/java/gui/lecture/DeleteLecture_GUI.java +++ b/dozentenmodul/src/main/java/gui/lecture/DeleteLecture_GUI.java @@ -83,6 +83,7 @@ public class DeleteLecture_GUI extends JFrame { JLabel labelVerantwortlicher; JTable tablemyLectures; private JTextField textFieldName; + private JLabel lblTotalResults; boolean activeSearch = false; String[] titles = { "Veranstaltungsname", "Beschreibung", "Gültigkeitsdatum", "Aktiv", "Letzte Benutzung", @@ -145,7 +146,6 @@ public class DeleteLecture_GUI extends JFrame { textFieldName.requestFocusInWindow(); try { initTableModel(modelMyLectures); - // initTableModel(modelAll); } catch (ParseException e) { @@ -318,6 +318,10 @@ public class DeleteLecture_GUI extends JFrame { JLabel label_2 = new JLabel(">"); label_2.setBounds(152, 11, 13, 14); contentPanel.add(label_2); + + lblTotalResults = new JLabel("Anzahl:"); + lblTotalResults.setBounds(10, 500, 131, 20); + contentPanel.add(lblTotalResults); JLabel lblNewLabel_1 = new JLabel("Löschen"); lblNewLabel_1.setBounds(166, 11, 155, 14); @@ -656,6 +660,9 @@ public class DeleteLecture_GUI extends JFrame { } + //show number if rows in GUI + lblTotalResults.setText(lblTotalResults.getText()+" "+model.getRowCount()); + return model; } catch (TException e1) { diff --git a/dozentenmodul/src/main/java/gui/lecture/EditLectureSearch_GUI.java b/dozentenmodul/src/main/java/gui/lecture/EditLectureSearch_GUI.java index c6f1ada6..1b7ca406 100644 --- a/dozentenmodul/src/main/java/gui/lecture/EditLectureSearch_GUI.java +++ b/dozentenmodul/src/main/java/gui/lecture/EditLectureSearch_GUI.java @@ -84,6 +84,7 @@ public class EditLectureSearch_GUI extends JFrame { JLabel labelVerantwortlicher; JTable tablemyLectures; private JTextField textFieldName; + private JLabel lblTotalResults; boolean activeSearch = false; Component c = null; String[] titles = { "Veranstaltungsname", "Beschreibung", @@ -362,6 +363,11 @@ public class EditLectureSearch_GUI extends JFrame { tablemyLectures.setRowSorter(rowSorterMyLectures); scrollPaneMyImage.setViewportView(tablemyLectures); + + lblTotalResults = new JLabel("Anzahl:"); + lblTotalResults.setBounds(10, 512, 131, 20); + contentPanel.add(lblTotalResults); + { JPanel buttonPane = new JPanel(); buttonPane.setBounds(0, 640, 826, 33); @@ -695,6 +701,9 @@ public class EditLectureSearch_GUI extends JFrame { i.next(); } + + //show number if rows in GUI + lblTotalResults.setText(lblTotalResults.getText()+" "+model.getRowCount()); return model; } catch (TException e1) { -- cgit v1.2.3-55-g7522 From f036aaa4276c629328ddd3af49e724fb35295886 Mon Sep 17 00:00:00 2001 From: Michael Wilson Date: Fri, 28 Nov 2014 15:30:06 +0100 Subject: If OS=windows, then isLicensed always true --- .../java/gui/image/CreateImageTechnisch_GUI.java | 16 +++++++++++++ .../java/gui/image/EditImageTechnisch_GUI.java | 26 ++++++++++++++++++++++ 2 files changed, 42 insertions(+) (limited to 'dozentenmodul/src/main/java') diff --git a/dozentenmodul/src/main/java/gui/image/CreateImageTechnisch_GUI.java b/dozentenmodul/src/main/java/gui/image/CreateImageTechnisch_GUI.java index 8e9a9b1f..0fb31a66 100644 --- a/dozentenmodul/src/main/java/gui/image/CreateImageTechnisch_GUI.java +++ b/dozentenmodul/src/main/java/gui/image/CreateImageTechnisch_GUI.java @@ -157,6 +157,14 @@ public class CreateImageTechnisch_GUI extends JFrame { panel_1.add(lblNewLabel_2); chckbxIsLicensed = new JCheckBox(""); + chckbxIsLicensed.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + //if windows is selected, always set isLicensed()=true + if(comboBox.getSelectedItem().toString().startsWith("Windows")){ + chckbxIsLicensed.setSelected(true); + } + } + }); chckbxIsLicensed.setSelected(true); chckbxIsLicensed.setBounds(266, 52, 97, 23); panel_1.add(chckbxIsLicensed); @@ -184,6 +192,14 @@ public class CreateImageTechnisch_GUI extends JFrame { // populate comboBox with list of supported OS we get // from the server ... comboBox = new JComboBox(); + comboBox.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + //if windows is selected, always set isLicensed()=true + if(comboBox.getSelectedItem().toString().startsWith("Windows")){ + chckbxIsLicensed.setSelected(true); + } + } + }); List os = null; try { os = client.getAllOS(); diff --git a/dozentenmodul/src/main/java/gui/image/EditImageTechnisch_GUI.java b/dozentenmodul/src/main/java/gui/image/EditImageTechnisch_GUI.java index 9f03d4d5..98367420 100644 --- a/dozentenmodul/src/main/java/gui/image/EditImageTechnisch_GUI.java +++ b/dozentenmodul/src/main/java/gui/image/EditImageTechnisch_GUI.java @@ -49,6 +49,12 @@ import org.apache.log4j.Logger; import org.apache.thrift.TException; import javax.swing.JCheckBox; +import java.beans.PropertyChangeListener; +import java.beans.PropertyChangeEvent; +import java.awt.event.ItemListener; +import java.awt.event.ItemEvent; +import java.awt.event.FocusAdapter; +import java.awt.event.FocusEvent; @SuppressWarnings("serial") public class EditImageTechnisch_GUI extends JFrame { @@ -146,6 +152,14 @@ public class EditImageTechnisch_GUI extends JFrame { panel_1.add(lblNewLabel_2); chckbxIsLicensed = new JCheckBox(""); + chckbxIsLicensed.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + //if windows is selected, always set isLicensed()=true + if(comboBox.getSelectedItem().toString().startsWith("Windows")){ + chckbxIsLicensed.setSelected(true); + } + } + }); chckbxIsLicensed.setBounds(266, 57, 97, 23); panel_1.add(chckbxIsLicensed); @@ -173,6 +187,18 @@ public class EditImageTechnisch_GUI extends JFrame { panel_1.add(lblBetriebssystem); comboBox = new JComboBox(); + comboBox.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + + //if windows is selected, always set isLicensed()=true + if(comboBox.getSelectedItem().toString().startsWith("Windows")){ + chckbxIsLicensed.setSelected(true); + } + } + }); + + + List os = null; try { os=client.getAllOS(); -- cgit v1.2.3-55-g7522 From 164829ca54ab7b64bc27c777ef6fd48da0a0dce9 Mon Sep 17 00:00:00 2001 From: Michael Wilson Date: Fri, 28 Nov 2014 15:51:23 +0100 Subject: • Admin can download any image --- dozentenmodul/src/main/java/gui/image/SearchImage_GUI.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'dozentenmodul/src/main/java') diff --git a/dozentenmodul/src/main/java/gui/image/SearchImage_GUI.java b/dozentenmodul/src/main/java/gui/image/SearchImage_GUI.java index 40434153..fd6a6647 100644 --- a/dozentenmodul/src/main/java/gui/image/SearchImage_GUI.java +++ b/dozentenmodul/src/main/java/gui/image/SearchImage_GUI.java @@ -718,7 +718,7 @@ public class SearchImage_GUI extends JFrame { tableAllImages .convertRowIndexToModel(tableAllImages .getSelectedRow()), - 8).equals("true") == true) { + 8).equals("true") == true || person.verantwortlicher.getRole().equals("Admin")) { String imageid = modelAll .getValueAt( tableAllImages -- cgit v1.2.3-55-g7522