From d43c4faddf93e49e0ef82faa1b5e6edeede21daa Mon Sep 17 00:00:00 2001 From: Tobias Spitzer Date: Fri, 22 Aug 2014 11:30:40 +0200 Subject: Aus dem Reiter alle könen nun auch Vorlagen heruntergeladen werden. --- Dozentenmodul/bin/gui/image/DeleteImage_GUI.class | Bin 16836 -> 16839 bytes .../bin/gui/image/SearchEditImage_GUI.class | Bin 16981 -> 16984 bytes Dozentenmodul/bin/gui/image/SearchImage_GUI.class | Bin 16757 -> 16760 bytes .../src/gui/image/SearchEditImage_GUI.java | 36 +++- Dozentenmodul/src/gui/image/SearchImage_GUI.java | 4 +- .../src/gui/lecture/EditLectureLink_GUI.java | 4 +- ...eData_args$getLectureData_argsTupleScheme.class | Bin 2139 -> 2139 bytes .../Server$getLectureData_result$_Fields.class | Bin 3040 -> 3040 bytes .../server/Server$getPersonData_args$_Fields.class | Bin 3096 -> 3096 bytes .../Server$getPersonData_result$_Fields.class | Bin 3030 -> 3030 bytes ...args$startFileCopy_argsTupleSchemeFactory.class | Bin 1138 -> 1138 bytes .../bin/server/Server$startFileCopy_args.class | Bin 9460 -> 9460 bytes .../Server$startFileCopy_result$_Fields.class | Bin 3030 -> 3030 bytes .../bin/server/Server$updateImageData_args.class | Bin 25783 -> 25783 bytes .../Server$updateImageData_result$_Fields.class | Bin 3050 -> 3050 bytes .../bin/server/Server$updateImageData_result.class | Bin 9798 -> 9798 bytes ...s$writeLecturedata_argsTupleSchemeFactory.class | Bin 1186 -> 1186 bytes .../bin/server/Server$writeLecturedata_args.class | Bin 25807 -> 25807 bytes .../Server$writeLecturedata_result$_Fields.class | Bin 3060 -> 3060 bytes .../bin/server/Server$writeVLdata_args.class | Bin 30564 -> 30564 bytes Dozentenmodulserver/src/server/Server.java | 210 +++++++++++++++------ Dozentenmodulserver/src/server/ServerHandler.java | 19 +- Dozentenmodulserver/thrift/server.thrift | 2 +- 23 files changed, 211 insertions(+), 64 deletions(-) diff --git a/Dozentenmodul/bin/gui/image/DeleteImage_GUI.class b/Dozentenmodul/bin/gui/image/DeleteImage_GUI.class index a15ca0fe..18b00f77 100644 Binary files a/Dozentenmodul/bin/gui/image/DeleteImage_GUI.class and b/Dozentenmodul/bin/gui/image/DeleteImage_GUI.class differ diff --git a/Dozentenmodul/bin/gui/image/SearchEditImage_GUI.class b/Dozentenmodul/bin/gui/image/SearchEditImage_GUI.class index d3ed0286..8051fcb8 100644 Binary files a/Dozentenmodul/bin/gui/image/SearchEditImage_GUI.class and b/Dozentenmodul/bin/gui/image/SearchEditImage_GUI.class differ diff --git a/Dozentenmodul/bin/gui/image/SearchImage_GUI.class b/Dozentenmodul/bin/gui/image/SearchImage_GUI.class index 15598b45..8173d4ba 100644 Binary files a/Dozentenmodul/bin/gui/image/SearchImage_GUI.class and b/Dozentenmodul/bin/gui/image/SearchImage_GUI.class differ diff --git a/Dozentenmodul/src/gui/image/SearchEditImage_GUI.java b/Dozentenmodul/src/gui/image/SearchEditImage_GUI.java index 3f9d357a..9ebeb791 100644 --- a/Dozentenmodul/src/gui/image/SearchEditImage_GUI.java +++ b/Dozentenmodul/src/gui/image/SearchEditImage_GUI.java @@ -531,7 +531,14 @@ public class SearchEditImage_GUI extends JFrame { } }else if(tabbedPane.getSelectedIndex()==1) { - if (tablePublicVorlagen.getSelectedRow() != -1 && modelPublicVorlagen.getValueAt(tablePublicVorlagen.convertRowIndexToModel(tablePublicVorlagen.getSelectedRow()), 4).equals(username)==true) { + if (tablePublicVorlagen.getSelectedRow() != -1) { + if (modelPublicVorlagen.getValueAt( + tablePublicVorlagen + .convertRowIndexToModel(tablePublicVorlagen + .getSelectedRow()), 4).equals( + username) == true ||modelPublicVorlagen.getValueAt(tablePublicVorlagen.convertRowIndexToModel(tablePublicVorlagen + .getSelectedRow()), 8).equals( + "true") == true ) { String imageid = modelPublicVorlagen .getValueAt( tablePublicVorlagen @@ -552,9 +559,23 @@ public class SearchEditImage_GUI extends JFrame { FTPEditDownloader_GUI ea = new FTPEditDownloader_GUI(); ea.setVisible(true); dispose(); - }}else if(tabbedPane.getSelectedIndex()==2) + }else { + JOptionPane + .showMessageDialog( + null, + "Sie haben keine Berechtigung fremde Images herunterzuladen.", + "Message", + JOptionPane.INFORMATION_MESSAGE); + }}}else if(tabbedPane.getSelectedIndex()==2) { - if (tableAllImages.getSelectedRow() != -1 && modelAll.getValueAt(tableAllImages.convertRowIndexToModel(tableAllImages.getSelectedRow()), 4).equals(username)==true) { + if (tableAllImages.getSelectedRow() != -1 ) { + if (modelAll.getValueAt( + tableAllImages + .convertRowIndexToModel(tableAllImages + .getSelectedRow()), 4).equals( + username) == true ||modelAll.getValueAt(tableAllImages.convertRowIndexToModel(tableAllImages + .getSelectedRow()), 8).equals( + "true") == true ) { String imageid = modelAll .getValueAt( tableAllImages @@ -575,7 +596,14 @@ public class SearchEditImage_GUI extends JFrame { FTPEditDownloader_GUI ea = new FTPEditDownloader_GUI(); ea.setVisible(true); dispose(); - }} else { + }else { + JOptionPane + .showMessageDialog( + null, + "Sie haben keine Berechtigung fremde Images herunterzuladen.", + "Message", + JOptionPane.INFORMATION_MESSAGE); + }}} else { JOptionPane.showMessageDialog(null, "Bitte w\u00e4hlen Sie ein Image f\u00fcr den Download aus", "Message", JOptionPane.INFORMATION_MESSAGE); diff --git a/Dozentenmodul/src/gui/image/SearchImage_GUI.java b/Dozentenmodul/src/gui/image/SearchImage_GUI.java index a2ccfc41..83d18576 100644 --- a/Dozentenmodul/src/gui/image/SearchImage_GUI.java +++ b/Dozentenmodul/src/gui/image/SearchImage_GUI.java @@ -580,7 +580,9 @@ public class SearchImage_GUI extends JFrame { tableAllImages .convertRowIndexToModel(tableAllImages .getSelectedRow()), 4).equals( - username) == true) { + username) == true ||modelAll.getValueAt(tableAllImages.convertRowIndexToModel(tableAllImages + .getSelectedRow()), 8).equals( + "true") == true ) { String imageid = modelAll .getValueAt( tableAllImages diff --git a/Dozentenmodul/src/gui/lecture/EditLectureLink_GUI.java b/Dozentenmodul/src/gui/lecture/EditLectureLink_GUI.java index 5ca11b98..c0f896c0 100644 --- a/Dozentenmodul/src/gui/lecture/EditLectureLink_GUI.java +++ b/Dozentenmodul/src/gui/lecture/EditLectureLink_GUI.java @@ -550,6 +550,7 @@ public class EditLectureLink_GUI extends JFrame { .convertRowIndexToModel(tablemyImages .getSelectedRow()), 7) .toString(), + person.verantwortlicher.getUsername(), person.verantwortlicher.getVorname(), person.verantwortlicher.getName(), person.verantwortlicher.getHochschule(), @@ -613,6 +614,7 @@ public class EditLectureLink_GUI extends JFrame { tablePublicVorlagen .convertRowIndexToModel(tablePublicVorlagen .getSelectedRow()), 7).toString(), + person.verantwortlicher.getUsername(), person.verantwortlicher.getVorname(), person.verantwortlicher.getName(), person.verantwortlicher.getHochschule(), @@ -678,7 +680,7 @@ public class EditLectureLink_GUI extends JFrame { .convertRowIndexToModel(tableAllImages .getSelectedRow()), 7) .toString(), - + person.verantwortlicher.getUsername(), person.verantwortlicher.getVorname(), person.verantwortlicher.getName(), person.verantwortlicher.getHochschule(), diff --git a/Dozentenmodulserver/bin/server/Server$getLectureData_args$getLectureData_argsTupleScheme.class b/Dozentenmodulserver/bin/server/Server$getLectureData_args$getLectureData_argsTupleScheme.class index 3261808f..60544e6a 100644 Binary files a/Dozentenmodulserver/bin/server/Server$getLectureData_args$getLectureData_argsTupleScheme.class and b/Dozentenmodulserver/bin/server/Server$getLectureData_args$getLectureData_argsTupleScheme.class differ diff --git a/Dozentenmodulserver/bin/server/Server$getLectureData_result$_Fields.class b/Dozentenmodulserver/bin/server/Server$getLectureData_result$_Fields.class index 2f574090..0f177c60 100644 Binary files a/Dozentenmodulserver/bin/server/Server$getLectureData_result$_Fields.class and b/Dozentenmodulserver/bin/server/Server$getLectureData_result$_Fields.class differ diff --git a/Dozentenmodulserver/bin/server/Server$getPersonData_args$_Fields.class b/Dozentenmodulserver/bin/server/Server$getPersonData_args$_Fields.class index 2d3d703d..dde9b3e7 100644 Binary files a/Dozentenmodulserver/bin/server/Server$getPersonData_args$_Fields.class and b/Dozentenmodulserver/bin/server/Server$getPersonData_args$_Fields.class differ diff --git a/Dozentenmodulserver/bin/server/Server$getPersonData_result$_Fields.class b/Dozentenmodulserver/bin/server/Server$getPersonData_result$_Fields.class index 91624182..82f49d2e 100644 Binary files a/Dozentenmodulserver/bin/server/Server$getPersonData_result$_Fields.class and b/Dozentenmodulserver/bin/server/Server$getPersonData_result$_Fields.class differ diff --git a/Dozentenmodulserver/bin/server/Server$startFileCopy_args$startFileCopy_argsTupleSchemeFactory.class b/Dozentenmodulserver/bin/server/Server$startFileCopy_args$startFileCopy_argsTupleSchemeFactory.class index a4b34646..a0412d98 100644 Binary files a/Dozentenmodulserver/bin/server/Server$startFileCopy_args$startFileCopy_argsTupleSchemeFactory.class and b/Dozentenmodulserver/bin/server/Server$startFileCopy_args$startFileCopy_argsTupleSchemeFactory.class differ diff --git a/Dozentenmodulserver/bin/server/Server$startFileCopy_args.class b/Dozentenmodulserver/bin/server/Server$startFileCopy_args.class index 853d2099..3a31e4b6 100644 Binary files a/Dozentenmodulserver/bin/server/Server$startFileCopy_args.class and b/Dozentenmodulserver/bin/server/Server$startFileCopy_args.class differ diff --git a/Dozentenmodulserver/bin/server/Server$startFileCopy_result$_Fields.class b/Dozentenmodulserver/bin/server/Server$startFileCopy_result$_Fields.class index f2ed7cfe..99e6378f 100644 Binary files a/Dozentenmodulserver/bin/server/Server$startFileCopy_result$_Fields.class and b/Dozentenmodulserver/bin/server/Server$startFileCopy_result$_Fields.class differ diff --git a/Dozentenmodulserver/bin/server/Server$updateImageData_args.class b/Dozentenmodulserver/bin/server/Server$updateImageData_args.class index 17baed51..916c3f40 100644 Binary files a/Dozentenmodulserver/bin/server/Server$updateImageData_args.class and b/Dozentenmodulserver/bin/server/Server$updateImageData_args.class differ diff --git a/Dozentenmodulserver/bin/server/Server$updateImageData_result$_Fields.class b/Dozentenmodulserver/bin/server/Server$updateImageData_result$_Fields.class index 5e5cf714..05bc2843 100644 Binary files a/Dozentenmodulserver/bin/server/Server$updateImageData_result$_Fields.class and b/Dozentenmodulserver/bin/server/Server$updateImageData_result$_Fields.class differ diff --git a/Dozentenmodulserver/bin/server/Server$updateImageData_result.class b/Dozentenmodulserver/bin/server/Server$updateImageData_result.class index 0d47dbff..dbc041c3 100644 Binary files a/Dozentenmodulserver/bin/server/Server$updateImageData_result.class and b/Dozentenmodulserver/bin/server/Server$updateImageData_result.class differ diff --git a/Dozentenmodulserver/bin/server/Server$writeLecturedata_args$writeLecturedata_argsTupleSchemeFactory.class b/Dozentenmodulserver/bin/server/Server$writeLecturedata_args$writeLecturedata_argsTupleSchemeFactory.class index 43b8e28f..4278abfb 100644 Binary files a/Dozentenmodulserver/bin/server/Server$writeLecturedata_args$writeLecturedata_argsTupleSchemeFactory.class and b/Dozentenmodulserver/bin/server/Server$writeLecturedata_args$writeLecturedata_argsTupleSchemeFactory.class differ diff --git a/Dozentenmodulserver/bin/server/Server$writeLecturedata_args.class b/Dozentenmodulserver/bin/server/Server$writeLecturedata_args.class index 815473a7..df8469a4 100644 Binary files a/Dozentenmodulserver/bin/server/Server$writeLecturedata_args.class and b/Dozentenmodulserver/bin/server/Server$writeLecturedata_args.class differ diff --git a/Dozentenmodulserver/bin/server/Server$writeLecturedata_result$_Fields.class b/Dozentenmodulserver/bin/server/Server$writeLecturedata_result$_Fields.class index 39ac7076..55cbb3c0 100644 Binary files a/Dozentenmodulserver/bin/server/Server$writeLecturedata_result$_Fields.class and b/Dozentenmodulserver/bin/server/Server$writeLecturedata_result$_Fields.class differ diff --git a/Dozentenmodulserver/bin/server/Server$writeVLdata_args.class b/Dozentenmodulserver/bin/server/Server$writeVLdata_args.class index 8e955829..714b534b 100644 Binary files a/Dozentenmodulserver/bin/server/Server$writeVLdata_args.class and b/Dozentenmodulserver/bin/server/Server$writeVLdata_args.class differ diff --git a/Dozentenmodulserver/src/server/Server.java b/Dozentenmodulserver/src/server/Server.java index 9ea479eb..d61101e8 100644 --- a/Dozentenmodulserver/src/server/Server.java +++ b/Dozentenmodulserver/src/server/Server.java @@ -66,7 +66,7 @@ public class Server { public boolean deleteImageData(String id, String version) throws org.apache.thrift.TException; - public boolean updateLecturedata(String name, String newName, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imageid, String imageversion, String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id) throws org.apache.thrift.TException; + public boolean updateLecturedata(String name, String newName, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imageid, String imageversion, String user, String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id) throws org.apache.thrift.TException; public boolean deleteImageServer(String id, String version) throws org.apache.thrift.TException; @@ -108,7 +108,7 @@ public class Server { public void deleteImageData(String id, String version, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void updateLecturedata(String name, String newName, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imageid, String imageversion, String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void updateLecturedata(String name, String newName, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imageid, String imageversion, String user, String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void deleteImageServer(String id, String version, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; @@ -525,13 +525,13 @@ public class Server { throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "deleteImageData failed: unknown result"); } - public boolean updateLecturedata(String name, String newName, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imageid, String imageversion, String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id) throws org.apache.thrift.TException + public boolean updateLecturedata(String name, String newName, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imageid, String imageversion, String user, String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id) throws org.apache.thrift.TException { - send_updateLecturedata(name, newName, shortdesc, desc, startDate, endDate, isActive, imageid, imageversion, firstname, lastname, university, Mail, Tel, Fak, id); + send_updateLecturedata(name, newName, shortdesc, desc, startDate, endDate, isActive, imageid, imageversion, user, firstname, lastname, university, Mail, Tel, Fak, id); return recv_updateLecturedata(); } - public void send_updateLecturedata(String name, String newName, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imageid, String imageversion, String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id) throws org.apache.thrift.TException + public void send_updateLecturedata(String name, String newName, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imageid, String imageversion, String user, String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id) throws org.apache.thrift.TException { updateLecturedata_args args = new updateLecturedata_args(); args.setName(name); @@ -543,6 +543,7 @@ public class Server { args.setIsActive(isActive); args.setImageid(imageid); args.setImageversion(imageversion); + args.setUser(user); args.setFirstname(firstname); args.setLastname(lastname); args.setUniversity(university); @@ -1260,9 +1261,9 @@ public class Server { } } - public void updateLecturedata(String name, String newName, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imageid, String imageversion, String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void updateLecturedata(String name, String newName, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imageid, String imageversion, String user, String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); - updateLecturedata_call method_call = new updateLecturedata_call(name, newName, shortdesc, desc, startDate, endDate, isActive, imageid, imageversion, firstname, lastname, university, Mail, Tel, Fak, id, resultHandler, this, ___protocolFactory, ___transport); + updateLecturedata_call method_call = new updateLecturedata_call(name, newName, shortdesc, desc, startDate, endDate, isActive, imageid, imageversion, user, firstname, lastname, university, Mail, Tel, Fak, id, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } @@ -1277,6 +1278,7 @@ public class Server { private boolean isActive; private String imageid; private String imageversion; + private String user; private String firstname; private String lastname; private String university; @@ -1284,7 +1286,7 @@ public class Server { private String Tel; private String Fak; private String id; - public updateLecturedata_call(String name, String newName, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imageid, String imageversion, String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + public updateLecturedata_call(String name, String newName, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imageid, String imageversion, String user, String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.name = name; this.newName = newName; @@ -1295,6 +1297,7 @@ public class Server { this.isActive = isActive; this.imageid = imageid; this.imageversion = imageversion; + this.user = user; this.firstname = firstname; this.lastname = lastname; this.university = university; @@ -1316,6 +1319,7 @@ public class Server { args.setIsActive(isActive); args.setImageid(imageid); args.setImageversion(imageversion); + args.setUser(user); args.setFirstname(firstname); args.setLastname(lastname); args.setUniversity(university); @@ -1801,7 +1805,7 @@ public class Server { public updateLecturedata_result getResult(I iface, updateLecturedata_args args) throws org.apache.thrift.TException { updateLecturedata_result result = new updateLecturedata_result(); - result.success = iface.updateLecturedata(args.name, args.newName, args.shortdesc, args.desc, args.startDate, args.endDate, args.isActive, args.imageid, args.imageversion, args.firstname, args.lastname, args.university, args.Mail, args.Tel, args.Fak, args.id); + result.success = iface.updateLecturedata(args.name, args.newName, args.shortdesc, args.desc, args.startDate, args.endDate, args.isActive, args.imageid, args.imageversion, args.user, args.firstname, args.lastname, args.university, args.Mail, args.Tel, args.Fak, args.id); result.setSuccessIsSet(true); return result; } @@ -2724,7 +2728,7 @@ public class Server { } public void start(I iface, updateLecturedata_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.updateLecturedata(args.name, args.newName, args.shortdesc, args.desc, args.startDate, args.endDate, args.isActive, args.imageid, args.imageversion, args.firstname, args.lastname, args.university, args.Mail, args.Tel, args.Fak, args.id,resultHandler); + iface.updateLecturedata(args.name, args.newName, args.shortdesc, args.desc, args.startDate, args.endDate, args.isActive, args.imageid, args.imageversion, args.user, args.firstname, args.lastname, args.university, args.Mail, args.Tel, args.Fak, args.id,resultHandler); } } @@ -17967,13 +17971,14 @@ public class Server { private static final org.apache.thrift.protocol.TField IS_ACTIVE_FIELD_DESC = new org.apache.thrift.protocol.TField("isActive", org.apache.thrift.protocol.TType.BOOL, (short)-7); private static final org.apache.thrift.protocol.TField IMAGEID_FIELD_DESC = new org.apache.thrift.protocol.TField("imageid", org.apache.thrift.protocol.TType.STRING, (short)-8); private static final org.apache.thrift.protocol.TField IMAGEVERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("imageversion", org.apache.thrift.protocol.TType.STRING, (short)-9); - private static final org.apache.thrift.protocol.TField FIRSTNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("firstname", org.apache.thrift.protocol.TType.STRING, (short)-10); - private static final org.apache.thrift.protocol.TField LASTNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("lastname", org.apache.thrift.protocol.TType.STRING, (short)-11); - private static final org.apache.thrift.protocol.TField UNIVERSITY_FIELD_DESC = new org.apache.thrift.protocol.TField("university", org.apache.thrift.protocol.TType.STRING, (short)-12); - private static final org.apache.thrift.protocol.TField MAIL_FIELD_DESC = new org.apache.thrift.protocol.TField("Mail", org.apache.thrift.protocol.TType.STRING, (short)-13); - private static final org.apache.thrift.protocol.TField TEL_FIELD_DESC = new org.apache.thrift.protocol.TField("Tel", org.apache.thrift.protocol.TType.STRING, (short)-14); - private static final org.apache.thrift.protocol.TField FAK_FIELD_DESC = new org.apache.thrift.protocol.TField("Fak", org.apache.thrift.protocol.TType.STRING, (short)-15); - 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)-16); + private static final org.apache.thrift.protocol.TField USER_FIELD_DESC = new org.apache.thrift.protocol.TField("user", org.apache.thrift.protocol.TType.STRING, (short)-10); + private static final org.apache.thrift.protocol.TField FIRSTNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("firstname", org.apache.thrift.protocol.TType.STRING, (short)-11); + private static final org.apache.thrift.protocol.TField LASTNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("lastname", org.apache.thrift.protocol.TType.STRING, (short)-12); + private static final org.apache.thrift.protocol.TField UNIVERSITY_FIELD_DESC = new org.apache.thrift.protocol.TField("university", org.apache.thrift.protocol.TType.STRING, (short)-13); + private static final org.apache.thrift.protocol.TField MAIL_FIELD_DESC = new org.apache.thrift.protocol.TField("Mail", org.apache.thrift.protocol.TType.STRING, (short)-14); + private static final org.apache.thrift.protocol.TField TEL_FIELD_DESC = new org.apache.thrift.protocol.TField("Tel", org.apache.thrift.protocol.TType.STRING, (short)-15); + private static final org.apache.thrift.protocol.TField FAK_FIELD_DESC = new org.apache.thrift.protocol.TField("Fak", org.apache.thrift.protocol.TType.STRING, (short)-16); + private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)-17); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { @@ -17990,6 +17995,7 @@ public class Server { public boolean isActive; // required public String imageid; // required public String imageversion; // required + public String user; // required public String firstname; // required public String lastname; // required public String university; // required @@ -18009,13 +18015,14 @@ public class Server { IS_ACTIVE((short)-7, "isActive"), IMAGEID((short)-8, "imageid"), IMAGEVERSION((short)-9, "imageversion"), - FIRSTNAME((short)-10, "firstname"), - LASTNAME((short)-11, "lastname"), - UNIVERSITY((short)-12, "university"), - MAIL((short)-13, "Mail"), - TEL((short)-14, "Tel"), - FAK((short)-15, "Fak"), - ID((short)-16, "id"); + USER((short)-10, "user"), + FIRSTNAME((short)-11, "firstname"), + LASTNAME((short)-12, "lastname"), + UNIVERSITY((short)-13, "university"), + MAIL((short)-14, "Mail"), + TEL((short)-15, "Tel"), + FAK((short)-16, "Fak"), + ID((short)-17, "id"); private static final Map byName = new HashMap(); @@ -18048,19 +18055,21 @@ public class Server { return IMAGEID; case -9: // IMAGEVERSION return IMAGEVERSION; - case -10: // FIRSTNAME + case -10: // USER + return USER; + case -11: // FIRSTNAME return FIRSTNAME; - case -11: // LASTNAME + case -12: // LASTNAME return LASTNAME; - case -12: // UNIVERSITY + case -13: // UNIVERSITY return UNIVERSITY; - case -13: // MAIL + case -14: // MAIL return MAIL; - case -14: // TEL + case -15: // TEL return TEL; - case -15: // FAK + case -16: // FAK return FAK; - case -16: // ID + case -17: // ID return ID; default: return null; @@ -18125,6 +18134,8 @@ public class Server { new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.IMAGEVERSION, new org.apache.thrift.meta_data.FieldMetaData("imageversion", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.USER, new org.apache.thrift.meta_data.FieldMetaData("user", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.FIRSTNAME, new org.apache.thrift.meta_data.FieldMetaData("firstname", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.LASTNAME, new org.apache.thrift.meta_data.FieldMetaData("lastname", org.apache.thrift.TFieldRequirementType.DEFAULT, @@ -18156,6 +18167,7 @@ public class Server { boolean isActive, String imageid, String imageversion, + String user, String firstname, String lastname, String university, @@ -18175,6 +18187,7 @@ public class Server { setIsActiveIsSet(true); this.imageid = imageid; this.imageversion = imageversion; + this.user = user; this.firstname = firstname; this.lastname = lastname; this.university = university; @@ -18214,6 +18227,9 @@ public class Server { if (other.isSetImageversion()) { this.imageversion = other.imageversion; } + if (other.isSetUser()) { + this.user = other.user; + } if (other.isSetFirstname()) { this.firstname = other.firstname; } @@ -18253,6 +18269,7 @@ public class Server { this.isActive = false; this.imageid = null; this.imageversion = null; + this.user = null; this.firstname = null; this.lastname = null; this.university = null; @@ -18477,6 +18494,30 @@ public class Server { } } + public String getUser() { + return this.user; + } + + public updateLecturedata_args setUser(String user) { + this.user = user; + return this; + } + + public void unsetUser() { + this.user = null; + } + + /** Returns true if field user is set (has been assigned a value) and false otherwise */ + public boolean isSetUser() { + return this.user != null; + } + + public void setUserIsSet(boolean value) { + if (!value) { + this.user = null; + } + } + public String getFirstname() { return this.firstname; } @@ -18719,6 +18760,14 @@ public class Server { } break; + case USER: + if (value == null) { + unsetUser(); + } else { + setUser((String)value); + } + break; + case FIRSTNAME: if (value == null) { unsetFirstname(); @@ -18807,6 +18856,9 @@ public class Server { case IMAGEVERSION: return getImageversion(); + case USER: + return getUser(); + case FIRSTNAME: return getFirstname(); @@ -18857,6 +18909,8 @@ public class Server { return isSetImageid(); case IMAGEVERSION: return isSetImageversion(); + case USER: + return isSetUser(); case FIRSTNAME: return isSetFirstname(); case LASTNAME: @@ -18969,6 +19023,15 @@ public class Server { return false; } + boolean this_present_user = true && this.isSetUser(); + boolean that_present_user = true && that.isSetUser(); + if (this_present_user || that_present_user) { + if (!(this_present_user && that_present_user)) + return false; + if (!this.user.equals(that.user)) + return false; + } + boolean this_present_firstname = true && this.isSetFirstname(); boolean that_present_firstname = true && that.isSetFirstname(); if (this_present_firstname || that_present_firstname) { @@ -19138,6 +19201,16 @@ public class Server { return lastComparison; } } + lastComparison = Boolean.valueOf(isSetUser()).compareTo(other.isSetUser()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetUser()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.user, other.user); + if (lastComparison != 0) { + return lastComparison; + } + } lastComparison = Boolean.valueOf(isSetFirstname()).compareTo(other.isSetFirstname()); if (lastComparison != 0) { return lastComparison; @@ -19296,6 +19369,14 @@ public class Server { } first = false; if (!first) sb.append(", "); + sb.append("user:"); + if (this.user == null) { + sb.append("null"); + } else { + sb.append(this.user); + } + first = false; + if (!first) sb.append(", "); sb.append("firstname:"); if (this.firstname == null) { sb.append("null"); @@ -19468,7 +19549,15 @@ public class Server { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case -10: // FIRSTNAME + case -10: // USER + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.user = iprot.readString(); + struct.setUserIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -11: // FIRSTNAME if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.firstname = iprot.readString(); struct.setFirstnameIsSet(true); @@ -19476,7 +19565,7 @@ public class Server { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case -11: // LASTNAME + case -12: // LASTNAME if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.lastname = iprot.readString(); struct.setLastnameIsSet(true); @@ -19484,7 +19573,7 @@ public class Server { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case -12: // UNIVERSITY + case -13: // UNIVERSITY if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.university = iprot.readString(); struct.setUniversityIsSet(true); @@ -19492,7 +19581,7 @@ public class Server { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case -13: // MAIL + case -14: // MAIL if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.Mail = iprot.readString(); struct.setMailIsSet(true); @@ -19500,7 +19589,7 @@ public class Server { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case -14: // TEL + case -15: // TEL if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.Tel = iprot.readString(); struct.setTelIsSet(true); @@ -19508,7 +19597,7 @@ public class Server { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case -15: // FAK + case -16: // FAK if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.Fak = iprot.readString(); struct.setFakIsSet(true); @@ -19516,7 +19605,7 @@ public class Server { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case -16: // ID + case -17: // ID if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.id = iprot.readString(); struct.setIdIsSet(true); @@ -19574,6 +19663,11 @@ public class Server { oprot.writeString(struct.firstname); oprot.writeFieldEnd(); } + if (struct.user != null) { + oprot.writeFieldBegin(USER_FIELD_DESC); + oprot.writeString(struct.user); + oprot.writeFieldEnd(); + } if (struct.imageversion != null) { oprot.writeFieldBegin(IMAGEVERSION_FIELD_DESC); oprot.writeString(struct.imageversion); @@ -19662,28 +19756,31 @@ public class Server { if (struct.isSetImageversion()) { optionals.set(8); } - if (struct.isSetFirstname()) { + if (struct.isSetUser()) { optionals.set(9); } - if (struct.isSetLastname()) { + if (struct.isSetFirstname()) { optionals.set(10); } - if (struct.isSetUniversity()) { + if (struct.isSetLastname()) { optionals.set(11); } - if (struct.isSetMail()) { + if (struct.isSetUniversity()) { optionals.set(12); } - if (struct.isSetTel()) { + if (struct.isSetMail()) { optionals.set(13); } - if (struct.isSetFak()) { + if (struct.isSetTel()) { optionals.set(14); } - if (struct.isSetId()) { + if (struct.isSetFak()) { optionals.set(15); } - oprot.writeBitSet(optionals, 16); + if (struct.isSetId()) { + optionals.set(16); + } + oprot.writeBitSet(optionals, 17); if (struct.isSetName()) { oprot.writeString(struct.name); } @@ -19711,6 +19808,9 @@ public class Server { if (struct.isSetImageversion()) { oprot.writeString(struct.imageversion); } + if (struct.isSetUser()) { + oprot.writeString(struct.user); + } if (struct.isSetFirstname()) { oprot.writeString(struct.firstname); } @@ -19737,7 +19837,7 @@ public class Server { @Override public void read(org.apache.thrift.protocol.TProtocol prot, updateLecturedata_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(16); + BitSet incoming = iprot.readBitSet(17); if (incoming.get(0)) { struct.name = iprot.readString(); struct.setNameIsSet(true); @@ -19775,30 +19875,34 @@ public class Server { struct.setImageversionIsSet(true); } if (incoming.get(9)) { + struct.user = iprot.readString(); + struct.setUserIsSet(true); + } + if (incoming.get(10)) { struct.firstname = iprot.readString(); struct.setFirstnameIsSet(true); } - if (incoming.get(10)) { + if (incoming.get(11)) { struct.lastname = iprot.readString(); struct.setLastnameIsSet(true); } - if (incoming.get(11)) { + if (incoming.get(12)) { struct.university = iprot.readString(); struct.setUniversityIsSet(true); } - if (incoming.get(12)) { + if (incoming.get(13)) { struct.Mail = iprot.readString(); struct.setMailIsSet(true); } - if (incoming.get(13)) { + if (incoming.get(14)) { struct.Tel = iprot.readString(); struct.setTelIsSet(true); } - if (incoming.get(14)) { + if (incoming.get(15)) { struct.Fak = iprot.readString(); struct.setFakIsSet(true); } - if (incoming.get(15)) { + if (incoming.get(16)) { struct.id = iprot.readString(); struct.setIdIsSet(true); } diff --git a/Dozentenmodulserver/src/server/ServerHandler.java b/Dozentenmodulserver/src/server/ServerHandler.java index 276ee619..c1ba8254 100644 --- a/Dozentenmodulserver/src/server/ServerHandler.java +++ b/Dozentenmodulserver/src/server/ServerHandler.java @@ -319,13 +319,26 @@ public class ServerHandler implements Server.Iface { @Override public boolean updateLecturedata(String name, String newName, String shortdesc, String desc, String startDate, String endDate, - boolean isActive, String imageid,String imageversion, String firstname, + boolean isActive, String imageid,String imageversion,String user ,String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id) throws TException { - + 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"; + File tmpFile=new File(path); + try { + FileUtils.forceDelete(tmpFile); + } catch (IOException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } XMLCreator xml = new XMLCreator(sql.getConnection(), newName); try { xml.create(newName); @@ -335,8 +348,6 @@ public class ServerHandler implements Server.Iface { e.printStackTrace(); } - // sql.updateLectureData(con, pk_image, imageversion, lastname, newName, - // desc, shortdesc, startDate, endDate, isActive, id); return false; } diff --git a/Dozentenmodulserver/thrift/server.thrift b/Dozentenmodulserver/thrift/server.thrift index 9f24bfea..dfd2b2d1 100644 --- a/Dozentenmodulserver/thrift/server.thrift +++ b/Dozentenmodulserver/thrift/server.thrift @@ -50,7 +50,7 @@ service Server{ map getLectureData(string lectureid), bool updateImageData(string name, string newName,string desc,string image_path,bool license, bool internet, int ram,int cpu, string id, string version,bool isTemplate ,i64 filesize, int shareMode, string os), bool deleteImageData(string id, string version), - bool updateLecturedata(string name, string newName ,string shortdesc, string desc,string startDate, string endDate, bool isActive, string imageid, string imageversion,string firstname,string lastname, string university, string Mail, string Tel,string Fak, string id), + bool updateLecturedata(string name, string newName ,string shortdesc, string desc,string startDate, string endDate, bool isActive, string imageid, string imageversion,string user,string firstname,string lastname, string university, string Mail, string Tel,string Fak, string id), bool deleteImageServer(string id, string version), bool connectedToLecture(string id, string version), bool deleteLecture(string id, string hs, string user), -- cgit v1.2.3-55-g7522