summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Spitzer2014-08-25 12:20:59 +0200
committerTobias Spitzer2014-08-25 12:20:59 +0200
commit2d7eaa5882dfc25aa7b708295e0a0b4669dfc8aa (patch)
tree5b315ae6b0cb0f3ccc98f2fe8ee2a44c7ae418e7
parentMerge branch 'master' of git.openslx.org:openslx-ng/tutor-module (diff)
downloadtutor-module-2d7eaa5882dfc25aa7b708295e0a0b4669dfc8aa.tar.gz
tutor-module-2d7eaa5882dfc25aa7b708295e0a0b4669dfc8aa.tar.xz
tutor-module-2d7eaa5882dfc25aa7b708295e0a0b4669dfc8aa.zip
Initiale Rechte werden vergeben
-rw-r--r--Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI.classbin13210 -> 13445 bytes
-rw-r--r--Dozentenmodul/bin/gui/intro/Login_GUI.classbin10578 -> 10577 bytes
-rw-r--r--Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java2
-rw-r--r--Dozentenmodul/src/gui/intro/Login_GUI.java2
-rw-r--r--Dozentenmodulserver/bin/server/Server$getLectureData_args$getLectureData_argsTupleScheme.classbin2139 -> 2139 bytes
-rw-r--r--Dozentenmodulserver/bin/server/Server$getLectureData_result$_Fields.classbin3040 -> 3040 bytes
-rw-r--r--Dozentenmodulserver/bin/server/Server$getPersonData_args$_Fields.classbin3096 -> 3096 bytes
-rw-r--r--Dozentenmodulserver/bin/server/Server$getPersonData_result$_Fields.classbin3030 -> 3030 bytes
-rw-r--r--Dozentenmodulserver/bin/server/Server$startFileCopy_args$startFileCopy_argsTupleSchemeFactory.classbin1138 -> 1138 bytes
-rw-r--r--Dozentenmodulserver/bin/server/Server$startFileCopy_args.classbin9460 -> 9460 bytes
-rw-r--r--Dozentenmodulserver/bin/server/Server$startFileCopy_result$_Fields.classbin3030 -> 3030 bytes
-rw-r--r--Dozentenmodulserver/bin/server/Server$updateImageData_args.classbin25783 -> 25783 bytes
-rw-r--r--Dozentenmodulserver/bin/server/Server$updateImageData_result$_Fields.classbin3050 -> 3050 bytes
-rw-r--r--Dozentenmodulserver/bin/server/Server$updateImageData_result.classbin9798 -> 9798 bytes
-rw-r--r--Dozentenmodulserver/bin/server/Server$writeLecturedata_args$writeLecturedata_argsTupleSchemeFactory.classbin1186 -> 1186 bytes
-rw-r--r--Dozentenmodulserver/bin/server/Server$writeLecturedata_args.classbin25807 -> 25807 bytes
-rw-r--r--Dozentenmodulserver/bin/server/Server$writeLecturedata_result$_Fields.classbin3060 -> 3060 bytes
-rw-r--r--Dozentenmodulserver/bin/server/Server$writeVLdata_args.classbin30564 -> 30564 bytes
-rw-r--r--Dozentenmodulserver/bin/sql/SQL.classbin26628 -> 27862 bytes
-rw-r--r--Dozentenmodulserver/src/server/Server.java1466
-rw-r--r--Dozentenmodulserver/src/server/ServerHandler.java49
-rw-r--r--Dozentenmodulserver/src/sql/SQL.java58
-rw-r--r--Dozentenmodulserver/thrift/server.thrift1
23 files changed, 1577 insertions, 1 deletions
diff --git a/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI.class b/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI.class
index 315e2376..517ea4a2 100644
--- a/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI.class
+++ b/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI.class
Binary files differ
diff --git a/Dozentenmodul/bin/gui/intro/Login_GUI.class b/Dozentenmodul/bin/gui/intro/Login_GUI.class
index 82b274da..d2051f80 100644
--- a/Dozentenmodul/bin/gui/intro/Login_GUI.class
+++ b/Dozentenmodul/bin/gui/intro/Login_GUI.class
Binary files differ
diff --git a/Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java b/Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java
index 686ee63f..22fa16a4 100644
--- a/Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java
+++ b/Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java
@@ -532,7 +532,9 @@ public class FTPCreateUploader_GUI extends JFrame implements
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());
+
client.startFileCopy(Image.image.getNewName());
+ client.writeImageRights(Image.image.getImagename(), person.verantwortlicher.getUsername(),person.verantwortlicher.getName(), person.verantwortlicher.getVorname(),person.verantwortlicher.getEMail(), person.verantwortlicher.getHochschule(), person.verantwortlicher.getRole());
} catch (TException e) {
// TODO Auto-generated catch block
e.printStackTrace();
diff --git a/Dozentenmodul/src/gui/intro/Login_GUI.java b/Dozentenmodul/src/gui/intro/Login_GUI.java
index c916c440..8a6df475 100644
--- a/Dozentenmodul/src/gui/intro/Login_GUI.java
+++ b/Dozentenmodul/src/gui/intro/Login_GUI.java
@@ -296,7 +296,7 @@ public class Login_GUI extends JFrame {
person.verantwortlicher.setEMail(user.eMail);
person.verantwortlicher.setHochschule(hochschule);
//Später über result.getRole zum Beispiel die Rolle holen
- person.verantwortlicher.setRole("Student");
+ person.verantwortlicher.setRole("Dozent");
try {
// Lege config File an und entscheide welches Fenster
diff --git a/Dozentenmodulserver/bin/server/Server$getLectureData_args$getLectureData_argsTupleScheme.class b/Dozentenmodulserver/bin/server/Server$getLectureData_args$getLectureData_argsTupleScheme.class
index 848c2854..e0159be4 100644
--- a/Dozentenmodulserver/bin/server/Server$getLectureData_args$getLectureData_argsTupleScheme.class
+++ b/Dozentenmodulserver/bin/server/Server$getLectureData_args$getLectureData_argsTupleScheme.class
Binary files differ
diff --git a/Dozentenmodulserver/bin/server/Server$getLectureData_result$_Fields.class b/Dozentenmodulserver/bin/server/Server$getLectureData_result$_Fields.class
index 63dc96a7..572a6f2a 100644
--- a/Dozentenmodulserver/bin/server/Server$getLectureData_result$_Fields.class
+++ b/Dozentenmodulserver/bin/server/Server$getLectureData_result$_Fields.class
Binary files differ
diff --git a/Dozentenmodulserver/bin/server/Server$getPersonData_args$_Fields.class b/Dozentenmodulserver/bin/server/Server$getPersonData_args$_Fields.class
index 65b69661..f37c4dba 100644
--- a/Dozentenmodulserver/bin/server/Server$getPersonData_args$_Fields.class
+++ b/Dozentenmodulserver/bin/server/Server$getPersonData_args$_Fields.class
Binary files differ
diff --git a/Dozentenmodulserver/bin/server/Server$getPersonData_result$_Fields.class b/Dozentenmodulserver/bin/server/Server$getPersonData_result$_Fields.class
index 47fb72ce..10ff9ece 100644
--- a/Dozentenmodulserver/bin/server/Server$getPersonData_result$_Fields.class
+++ b/Dozentenmodulserver/bin/server/Server$getPersonData_result$_Fields.class
Binary files differ
diff --git a/Dozentenmodulserver/bin/server/Server$startFileCopy_args$startFileCopy_argsTupleSchemeFactory.class b/Dozentenmodulserver/bin/server/Server$startFileCopy_args$startFileCopy_argsTupleSchemeFactory.class
index 614387e8..87d418ed 100644
--- a/Dozentenmodulserver/bin/server/Server$startFileCopy_args$startFileCopy_argsTupleSchemeFactory.class
+++ b/Dozentenmodulserver/bin/server/Server$startFileCopy_args$startFileCopy_argsTupleSchemeFactory.class
Binary files differ
diff --git a/Dozentenmodulserver/bin/server/Server$startFileCopy_args.class b/Dozentenmodulserver/bin/server/Server$startFileCopy_args.class
index ac43783d..5e4150f6 100644
--- a/Dozentenmodulserver/bin/server/Server$startFileCopy_args.class
+++ b/Dozentenmodulserver/bin/server/Server$startFileCopy_args.class
Binary files differ
diff --git a/Dozentenmodulserver/bin/server/Server$startFileCopy_result$_Fields.class b/Dozentenmodulserver/bin/server/Server$startFileCopy_result$_Fields.class
index f8eaf3b0..13af1d47 100644
--- a/Dozentenmodulserver/bin/server/Server$startFileCopy_result$_Fields.class
+++ b/Dozentenmodulserver/bin/server/Server$startFileCopy_result$_Fields.class
Binary files differ
diff --git a/Dozentenmodulserver/bin/server/Server$updateImageData_args.class b/Dozentenmodulserver/bin/server/Server$updateImageData_args.class
index 31a6d9cb..a467c3fa 100644
--- a/Dozentenmodulserver/bin/server/Server$updateImageData_args.class
+++ b/Dozentenmodulserver/bin/server/Server$updateImageData_args.class
Binary files differ
diff --git a/Dozentenmodulserver/bin/server/Server$updateImageData_result$_Fields.class b/Dozentenmodulserver/bin/server/Server$updateImageData_result$_Fields.class
index 70f66bab..d13e0007 100644
--- a/Dozentenmodulserver/bin/server/Server$updateImageData_result$_Fields.class
+++ b/Dozentenmodulserver/bin/server/Server$updateImageData_result$_Fields.class
Binary files differ
diff --git a/Dozentenmodulserver/bin/server/Server$updateImageData_result.class b/Dozentenmodulserver/bin/server/Server$updateImageData_result.class
index 7ab99f6d..fff08300 100644
--- a/Dozentenmodulserver/bin/server/Server$updateImageData_result.class
+++ b/Dozentenmodulserver/bin/server/Server$updateImageData_result.class
Binary files differ
diff --git a/Dozentenmodulserver/bin/server/Server$writeLecturedata_args$writeLecturedata_argsTupleSchemeFactory.class b/Dozentenmodulserver/bin/server/Server$writeLecturedata_args$writeLecturedata_argsTupleSchemeFactory.class
index 585629ce..19368f3a 100644
--- a/Dozentenmodulserver/bin/server/Server$writeLecturedata_args$writeLecturedata_argsTupleSchemeFactory.class
+++ b/Dozentenmodulserver/bin/server/Server$writeLecturedata_args$writeLecturedata_argsTupleSchemeFactory.class
Binary files differ
diff --git a/Dozentenmodulserver/bin/server/Server$writeLecturedata_args.class b/Dozentenmodulserver/bin/server/Server$writeLecturedata_args.class
index 2a843390..f327658c 100644
--- a/Dozentenmodulserver/bin/server/Server$writeLecturedata_args.class
+++ b/Dozentenmodulserver/bin/server/Server$writeLecturedata_args.class
Binary files differ
diff --git a/Dozentenmodulserver/bin/server/Server$writeLecturedata_result$_Fields.class b/Dozentenmodulserver/bin/server/Server$writeLecturedata_result$_Fields.class
index c0d0b439..e903af67 100644
--- a/Dozentenmodulserver/bin/server/Server$writeLecturedata_result$_Fields.class
+++ b/Dozentenmodulserver/bin/server/Server$writeLecturedata_result$_Fields.class
Binary files differ
diff --git a/Dozentenmodulserver/bin/server/Server$writeVLdata_args.class b/Dozentenmodulserver/bin/server/Server$writeVLdata_args.class
index 8c394e63..84cd6875 100644
--- a/Dozentenmodulserver/bin/server/Server$writeVLdata_args.class
+++ b/Dozentenmodulserver/bin/server/Server$writeVLdata_args.class
Binary files differ
diff --git a/Dozentenmodulserver/bin/sql/SQL.class b/Dozentenmodulserver/bin/sql/SQL.class
index 899f8594..75626571 100644
--- a/Dozentenmodulserver/bin/sql/SQL.class
+++ b/Dozentenmodulserver/bin/sql/SQL.class
Binary files differ
diff --git a/Dozentenmodulserver/src/server/Server.java b/Dozentenmodulserver/src/server/Server.java
index e7c2f32a..11163fb2 100644
--- a/Dozentenmodulserver/src/server/Server.java
+++ b/Dozentenmodulserver/src/server/Server.java
@@ -78,6 +78,8 @@ public class Server {
public boolean createUser(String loginName, String lastName, String firstName, String mail, String university) throws org.apache.thrift.TException;
+ public boolean writeImageRights(String imagename, String username, String lastName, String firstName, String mail, String university, String role) throws org.apache.thrift.TException;
+
}
public interface AsyncIface {
@@ -124,6 +126,8 @@ public class Server {
public void createUser(String loginName, String lastName, String firstName, String mail, String university, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+ public void writeImageRights(String imagename, String username, String lastName, String firstName, String mail, String university, String role, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
}
public static class Client extends org.apache.thrift.TServiceClient implements Iface {
@@ -695,6 +699,35 @@ public class Server {
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "createUser failed: unknown result");
}
+ public boolean writeImageRights(String imagename, String username, String lastName, String firstName, String mail, String university, String role) throws org.apache.thrift.TException
+ {
+ send_writeImageRights(imagename, username, lastName, firstName, mail, university, role);
+ return recv_writeImageRights();
+ }
+
+ public void send_writeImageRights(String imagename, String username, String lastName, String firstName, String mail, String university, String role) throws org.apache.thrift.TException
+ {
+ writeImageRights_args args = new writeImageRights_args();
+ args.setImagename(imagename);
+ args.setUsername(username);
+ args.setLastName(lastName);
+ args.setFirstName(firstName);
+ args.setMail(mail);
+ args.setUniversity(university);
+ args.setRole(role);
+ sendBase("writeImageRights", args);
+ }
+
+ public boolean recv_writeImageRights() throws org.apache.thrift.TException
+ {
+ writeImageRights_result result = new writeImageRights_result();
+ receiveBase(result, "writeImageRights");
+ if (result.isSetSuccess()) {
+ return result.success;
+ }
+ throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "writeImageRights failed: unknown result");
+ }
+
}
public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface {
public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
@@ -1583,6 +1616,56 @@ public class Server {
}
}
+ public void writeImageRights(String imagename, String username, String lastName, String firstName, String mail, String university, String role, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+ checkReady();
+ writeImageRights_call method_call = new writeImageRights_call(imagename, username, lastName, firstName, mail, university, role, resultHandler, this, ___protocolFactory, ___transport);
+ this.___currentMethod = method_call;
+ ___manager.call(method_call);
+ }
+
+ public static class writeImageRights_call extends org.apache.thrift.async.TAsyncMethodCall {
+ private String imagename;
+ private String username;
+ private String lastName;
+ private String firstName;
+ private String mail;
+ private String university;
+ private String role;
+ public writeImageRights_call(String imagename, String username, String lastName, String firstName, String mail, String university, String role, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+ super(client, protocolFactory, transport, resultHandler, false);
+ this.imagename = imagename;
+ this.username = username;
+ this.lastName = lastName;
+ this.firstName = firstName;
+ this.mail = mail;
+ this.university = university;
+ this.role = role;
+ }
+
+ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+ prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("writeImageRights", org.apache.thrift.protocol.TMessageType.CALL, 0));
+ writeImageRights_args args = new writeImageRights_args();
+ args.setImagename(imagename);
+ args.setUsername(username);
+ args.setLastName(lastName);
+ args.setFirstName(firstName);
+ args.setMail(mail);
+ args.setUniversity(university);
+ args.setRole(role);
+ args.write(prot);
+ prot.writeMessageEnd();
+ }
+
+ public boolean getResult() throws org.apache.thrift.TException {
+ if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
+ throw new IllegalStateException("Method call not finished!");
+ }
+ org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
+ org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
+ return (new Client(prot)).recv_writeImageRights();
+ }
+ }
+
}
public static class Processor<I extends Iface> extends org.apache.thrift.TBaseProcessor<I> implements org.apache.thrift.TProcessor {
@@ -1617,6 +1700,7 @@ public class Server {
processMap.put("deleteLecture", new deleteLecture());
processMap.put("checkUser", new checkUser());
processMap.put("createUser", new createUser());
+ processMap.put("writeImageRights", new writeImageRights());
return processMap;
}
@@ -2052,6 +2136,27 @@ public class Server {
}
}
+ public static class writeImageRights<I extends Iface> extends org.apache.thrift.ProcessFunction<I, writeImageRights_args> {
+ public writeImageRights() {
+ super("writeImageRights");
+ }
+
+ public writeImageRights_args getEmptyArgsInstance() {
+ return new writeImageRights_args();
+ }
+
+ protected boolean isOneway() {
+ return false;
+ }
+
+ public writeImageRights_result getResult(I iface, writeImageRights_args args) throws org.apache.thrift.TException {
+ writeImageRights_result result = new writeImageRights_result();
+ result.success = iface.writeImageRights(args.imagename, args.username, args.lastName, args.firstName, args.mail, args.university, args.role);
+ result.setSuccessIsSet(true);
+ return result;
+ }
+ }
+
}
public static class AsyncProcessor<I extends AsyncIface> extends org.apache.thrift.TBaseAsyncProcessor<I> {
@@ -2086,6 +2191,7 @@ public class Server {
processMap.put("deleteLecture", new deleteLecture());
processMap.put("checkUser", new checkUser());
processMap.put("createUser", new createUser());
+ processMap.put("writeImageRights", new writeImageRights());
return processMap;
}
@@ -3172,6 +3278,58 @@ public class Server {
}
}
+ public static class writeImageRights<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, writeImageRights_args, Boolean> {
+ public writeImageRights() {
+ super("writeImageRights");
+ }
+
+ public writeImageRights_args getEmptyArgsInstance() {
+ return new writeImageRights_args();
+ }
+
+ public AsyncMethodCallback<Boolean> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+ final org.apache.thrift.AsyncProcessFunction fcall = this;
+ return new AsyncMethodCallback<Boolean>() {
+ public void onComplete(Boolean o) {
+ writeImageRights_result result = new writeImageRights_result();
+ result.success = o;
+ result.setSuccessIsSet(true);
+ try {
+ fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+ return;
+ } catch (Exception e) {
+ LOGGER.error("Exception writing to internal frame buffer", e);
+ }
+ fb.close();
+ }
+ public void onError(Exception e) {
+ byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+ org.apache.thrift.TBase msg;
+ writeImageRights_result result = new writeImageRights_result();
+ {
+ msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+ msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+ }
+ try {
+ fcall.sendResponse(fb,msg,msgType,seqid);
+ return;
+ } catch (Exception ex) {
+ LOGGER.error("Exception writing to internal frame buffer", ex);
+ }
+ fb.close();
+ }
+ };
+ }
+
+ protected boolean isOneway() {
+ return false;
+ }
+
+ public void start(I iface, writeImageRights_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws TException {
+ iface.writeImageRights(args.imagename, args.username, args.lastName, args.firstName, args.mail, args.university, args.role,resultHandler);
+ }
+ }
+
}
public static class getFtpUser_args implements org.apache.thrift.TBase<getFtpUser_args, getFtpUser_args._Fields>, java.io.Serializable, Cloneable, Comparable<getFtpUser_args> {
@@ -24889,4 +25047,1312 @@ public class Server {
}
+ public static class writeImageRights_args implements org.apache.thrift.TBase<writeImageRights_args, writeImageRights_args._Fields>, java.io.Serializable, Cloneable, Comparable<writeImageRights_args> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("writeImageRights_args");
+
+ private static final org.apache.thrift.protocol.TField IMAGENAME_FIELD_DESC = new org.apache.thrift.protocol.TField("imagename", org.apache.thrift.protocol.TType.STRING, (short)-1);
+ private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)-2);
+ private static final org.apache.thrift.protocol.TField LAST_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("lastName", org.apache.thrift.protocol.TType.STRING, (short)-3);
+ private static final org.apache.thrift.protocol.TField FIRST_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("firstName", org.apache.thrift.protocol.TType.STRING, (short)-4);
+ private static final org.apache.thrift.protocol.TField MAIL_FIELD_DESC = new org.apache.thrift.protocol.TField("mail", org.apache.thrift.protocol.TType.STRING, (short)-5);
+ private static final org.apache.thrift.protocol.TField UNIVERSITY_FIELD_DESC = new org.apache.thrift.protocol.TField("university", org.apache.thrift.protocol.TType.STRING, (short)-6);
+ private static final org.apache.thrift.protocol.TField ROLE_FIELD_DESC = new org.apache.thrift.protocol.TField("role", org.apache.thrift.protocol.TType.STRING, (short)-7);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new writeImageRights_argsStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new writeImageRights_argsTupleSchemeFactory());
+ }
+
+ public String imagename; // required
+ public String username; // required
+ public String lastName; // required
+ public String firstName; // required
+ public String mail; // required
+ public String university; // required
+ public String role; // required
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ IMAGENAME((short)-1, "imagename"),
+ USERNAME((short)-2, "username"),
+ LAST_NAME((short)-3, "lastName"),
+ FIRST_NAME((short)-4, "firstName"),
+ MAIL((short)-5, "mail"),
+ UNIVERSITY((short)-6, "university"),
+ ROLE((short)-7, "role");
+
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+ static {
+ for (_Fields field : EnumSet.allOf(_Fields.class)) {
+ byName.put(field.getFieldName(), field);
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, or null if its not found.
+ */
+ public static _Fields findByThriftId(int fieldId) {
+ switch(fieldId) {
+ case -1: // IMAGENAME
+ return IMAGENAME;
+ case -2: // USERNAME
+ return USERNAME;
+ case -3: // LAST_NAME
+ return LAST_NAME;
+ case -4: // FIRST_NAME
+ return FIRST_NAME;
+ case -5: // MAIL
+ return MAIL;
+ case -6: // UNIVERSITY
+ return UNIVERSITY;
+ case -7: // ROLE
+ return ROLE;
+ default:
+ return null;
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, throwing an exception
+ * if it is not found.
+ */
+ public static _Fields findByThriftIdOrThrow(int fieldId) {
+ _Fields fields = findByThriftId(fieldId);
+ if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+ return fields;
+ }
+
+ /**
+ * Find the _Fields constant that matches name, or null if its not found.
+ */
+ public static _Fields findByName(String name) {
+ return byName.get(name);
+ }
+
+ private final short _thriftId;
+ private final String _fieldName;
+
+ _Fields(short thriftId, String fieldName) {
+ _thriftId = thriftId;
+ _fieldName = fieldName;
+ }
+
+ public short getThriftFieldId() {
+ return _thriftId;
+ }
+
+ public String getFieldName() {
+ return _fieldName;
+ }
+ }
+
+ // isset id assignments
+ public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+ static {
+ Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+ tmpMap.put(_Fields.IMAGENAME, new org.apache.thrift.meta_data.FieldMetaData("imagename", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.LAST_NAME, new org.apache.thrift.meta_data.FieldMetaData("lastName", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.FIRST_NAME, new org.apache.thrift.meta_data.FieldMetaData("firstName", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.MAIL, new org.apache.thrift.meta_data.FieldMetaData("mail", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.UNIVERSITY, new org.apache.thrift.meta_data.FieldMetaData("university", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.ROLE, new org.apache.thrift.meta_data.FieldMetaData("role", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(writeImageRights_args.class, metaDataMap);
+ }
+
+ public writeImageRights_args() {
+ }
+
+ public writeImageRights_args(
+ String imagename,
+ String username,
+ String lastName,
+ String firstName,
+ String mail,
+ String university,
+ String role)
+ {
+ this();
+ this.imagename = imagename;
+ this.username = username;
+ this.lastName = lastName;
+ this.firstName = firstName;
+ this.mail = mail;
+ this.university = university;
+ this.role = role;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public writeImageRights_args(writeImageRights_args other) {
+ if (other.isSetImagename()) {
+ this.imagename = other.imagename;
+ }
+ if (other.isSetUsername()) {
+ this.username = other.username;
+ }
+ if (other.isSetLastName()) {
+ this.lastName = other.lastName;
+ }
+ if (other.isSetFirstName()) {
+ this.firstName = other.firstName;
+ }
+ if (other.isSetMail()) {
+ this.mail = other.mail;
+ }
+ if (other.isSetUniversity()) {
+ this.university = other.university;
+ }
+ if (other.isSetRole()) {
+ this.role = other.role;
+ }
+ }
+
+ public writeImageRights_args deepCopy() {
+ return new writeImageRights_args(this);
+ }
+
+ @Override
+ public void clear() {
+ this.imagename = null;
+ this.username = null;
+ this.lastName = null;
+ this.firstName = null;
+ this.mail = null;
+ this.university = null;
+ this.role = null;
+ }
+
+ public String getImagename() {
+ return this.imagename;
+ }
+
+ public writeImageRights_args setImagename(String imagename) {
+ this.imagename = imagename;
+ return this;
+ }
+
+ public void unsetImagename() {
+ this.imagename = null;
+ }
+
+ /** Returns true if field imagename is set (has been assigned a value) and false otherwise */
+ public boolean isSetImagename() {
+ return this.imagename != null;
+ }
+
+ public void setImagenameIsSet(boolean value) {
+ if (!value) {
+ this.imagename = null;
+ }
+ }
+
+ public String getUsername() {
+ return this.username;
+ }
+
+ public writeImageRights_args setUsername(String username) {
+ this.username = username;
+ return this;
+ }
+
+ public void unsetUsername() {
+ this.username = null;
+ }
+
+ /** Returns true if field username is set (has been assigned a value) and false otherwise */
+ public boolean isSetUsername() {
+ return this.username != null;
+ }
+
+ public void setUsernameIsSet(boolean value) {
+ if (!value) {
+ this.username = null;
+ }
+ }
+
+ public String getLastName() {
+ return this.lastName;
+ }
+
+ public writeImageRights_args setLastName(String lastName) {
+ this.lastName = lastName;
+ return this;
+ }
+
+ public void unsetLastName() {
+ this.lastName = null;
+ }
+
+ /** Returns true if field lastName is set (has been assigned a value) and false otherwise */
+ public boolean isSetLastName() {
+ return this.lastName != null;
+ }
+
+ public void setLastNameIsSet(boolean value) {
+ if (!value) {
+ this.lastName = null;
+ }
+ }
+
+ public String getFirstName() {
+ return this.firstName;
+ }
+
+ public writeImageRights_args setFirstName(String firstName) {
+ this.firstName = firstName;
+ return this;
+ }
+
+ public void unsetFirstName() {
+ this.firstName = null;
+ }
+
+ /** Returns true if field firstName is set (has been assigned a value) and false otherwise */
+ public boolean isSetFirstName() {
+ return this.firstName != null;
+ }
+
+ public void setFirstNameIsSet(boolean value) {
+ if (!value) {
+ this.firstName = null;
+ }
+ }
+
+ public String getMail() {
+ return this.mail;
+ }
+
+ public writeImageRights_args setMail(String mail) {
+ this.mail = mail;
+ return this;
+ }
+
+ public void unsetMail() {
+ this.mail = null;
+ }
+
+ /** Returns true if field mail is set (has been assigned a value) and false otherwise */
+ public boolean isSetMail() {
+ return this.mail != null;
+ }
+
+ public void setMailIsSet(boolean value) {
+ if (!value) {
+ this.mail = null;
+ }
+ }
+
+ public String getUniversity() {
+ return this.university;
+ }
+
+ public writeImageRights_args setUniversity(String university) {
+ this.university = university;
+ return this;
+ }
+
+ public void unsetUniversity() {
+ this.university = null;
+ }
+
+ /** Returns true if field university is set (has been assigned a value) and false otherwise */
+ public boolean isSetUniversity() {
+ return this.university != null;
+ }
+
+ public void setUniversityIsSet(boolean value) {
+ if (!value) {
+ this.university = null;
+ }
+ }
+
+ public String getRole() {
+ return this.role;
+ }
+
+ public writeImageRights_args setRole(String role) {
+ this.role = role;
+ return this;
+ }
+
+ public void unsetRole() {
+ this.role = null;
+ }
+
+ /** Returns true if field role is set (has been assigned a value) and false otherwise */
+ public boolean isSetRole() {
+ return this.role != null;
+ }
+
+ public void setRoleIsSet(boolean value) {
+ if (!value) {
+ this.role = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case IMAGENAME:
+ if (value == null) {
+ unsetImagename();
+ } else {
+ setImagename((String)value);
+ }
+ break;
+
+ case USERNAME:
+ if (value == null) {
+ unsetUsername();
+ } else {
+ setUsername((String)value);
+ }
+ break;
+
+ case LAST_NAME:
+ if (value == null) {
+ unsetLastName();
+ } else {
+ setLastName((String)value);
+ }
+ break;
+
+ case FIRST_NAME:
+ if (value == null) {
+ unsetFirstName();
+ } else {
+ setFirstName((String)value);
+ }
+ break;
+
+ case MAIL:
+ if (value == null) {
+ unsetMail();
+ } else {
+ setMail((String)value);
+ }
+ break;
+
+ case UNIVERSITY:
+ if (value == null) {
+ unsetUniversity();
+ } else {
+ setUniversity((String)value);
+ }
+ break;
+
+ case ROLE:
+ if (value == null) {
+ unsetRole();
+ } else {
+ setRole((String)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case IMAGENAME:
+ return getImagename();
+
+ case USERNAME:
+ return getUsername();
+
+ case LAST_NAME:
+ return getLastName();
+
+ case FIRST_NAME:
+ return getFirstName();
+
+ case MAIL:
+ return getMail();
+
+ case UNIVERSITY:
+ return getUniversity();
+
+ case ROLE:
+ return getRole();
+
+ }
+ throw new IllegalStateException();
+ }
+
+ /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+ public boolean isSet(_Fields field) {
+ if (field == null) {
+ throw new IllegalArgumentException();
+ }
+
+ switch (field) {
+ case IMAGENAME:
+ return isSetImagename();
+ case USERNAME:
+ return isSetUsername();
+ case LAST_NAME:
+ return isSetLastName();
+ case FIRST_NAME:
+ return isSetFirstName();
+ case MAIL:
+ return isSetMail();
+ case UNIVERSITY:
+ return isSetUniversity();
+ case ROLE:
+ return isSetRole();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof writeImageRights_args)
+ return this.equals((writeImageRights_args)that);
+ return false;
+ }
+
+ public boolean equals(writeImageRights_args that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_imagename = true && this.isSetImagename();
+ boolean that_present_imagename = true && that.isSetImagename();
+ if (this_present_imagename || that_present_imagename) {
+ if (!(this_present_imagename && that_present_imagename))
+ return false;
+ if (!this.imagename.equals(that.imagename))
+ return false;
+ }
+
+ boolean this_present_username = true && this.isSetUsername();
+ boolean that_present_username = true && that.isSetUsername();
+ if (this_present_username || that_present_username) {
+ if (!(this_present_username && that_present_username))
+ return false;
+ if (!this.username.equals(that.username))
+ return false;
+ }
+
+ boolean this_present_lastName = true && this.isSetLastName();
+ boolean that_present_lastName = true && that.isSetLastName();
+ if (this_present_lastName || that_present_lastName) {
+ if (!(this_present_lastName && that_present_lastName))
+ return false;
+ if (!this.lastName.equals(that.lastName))
+ return false;
+ }
+
+ boolean this_present_firstName = true && this.isSetFirstName();
+ boolean that_present_firstName = true && that.isSetFirstName();
+ if (this_present_firstName || that_present_firstName) {
+ if (!(this_present_firstName && that_present_firstName))
+ return false;
+ if (!this.firstName.equals(that.firstName))
+ return false;
+ }
+
+ boolean this_present_mail = true && this.isSetMail();
+ boolean that_present_mail = true && that.isSetMail();
+ if (this_present_mail || that_present_mail) {
+ if (!(this_present_mail && that_present_mail))
+ return false;
+ if (!this.mail.equals(that.mail))
+ return false;
+ }
+
+ boolean this_present_university = true && this.isSetUniversity();
+ boolean that_present_university = true && that.isSetUniversity();
+ if (this_present_university || that_present_university) {
+ if (!(this_present_university && that_present_university))
+ return false;
+ if (!this.university.equals(that.university))
+ return false;
+ }
+
+ boolean this_present_role = true && this.isSetRole();
+ boolean that_present_role = true && that.isSetRole();
+ if (this_present_role || that_present_role) {
+ if (!(this_present_role && that_present_role))
+ return false;
+ if (!this.role.equals(that.role))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ @Override
+ public int compareTo(writeImageRights_args other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ lastComparison = Boolean.valueOf(isSetImagename()).compareTo(other.isSetImagename());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetImagename()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.imagename, other.imagename);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetUsername()).compareTo(other.isSetUsername());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetUsername()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, other.username);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetLastName()).compareTo(other.isSetLastName());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetLastName()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lastName, other.lastName);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetFirstName()).compareTo(other.isSetFirstName());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetFirstName()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.firstName, other.firstName);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetMail()).compareTo(other.isSetMail());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetMail()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mail, other.mail);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetUniversity()).compareTo(other.isSetUniversity());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetUniversity()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.university, other.university);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetRole()).compareTo(other.isSetRole());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetRole()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.role, other.role);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ return 0;
+ }
+
+ public _Fields fieldForId(int fieldId) {
+ return _Fields.findByThriftId(fieldId);
+ }
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("writeImageRights_args(");
+ boolean first = true;
+
+ sb.append("imagename:");
+ if (this.imagename == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.imagename);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("username:");
+ if (this.username == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.username);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("lastName:");
+ if (this.lastName == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.lastName);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("firstName:");
+ if (this.firstName == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.firstName);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("mail:");
+ if (this.mail == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.mail);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("university:");
+ if (this.university == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.university);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("role:");
+ if (this.role == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.role);
+ }
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ // check for sub-struct validity
+ }
+
+ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+ try {
+ write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+ try {
+ read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private static class writeImageRights_argsStandardSchemeFactory implements SchemeFactory {
+ public writeImageRights_argsStandardScheme getScheme() {
+ return new writeImageRights_argsStandardScheme();
+ }
+ }
+
+ private static class writeImageRights_argsStandardScheme extends StandardScheme<writeImageRights_args> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, writeImageRights_args struct) throws org.apache.thrift.TException {
+ org.apache.thrift.protocol.TField schemeField;
+ iprot.readStructBegin();
+ while (true)
+ {
+ schemeField = iprot.readFieldBegin();
+ if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
+ break;
+ }
+ switch (schemeField.id) {
+ case -1: // IMAGENAME
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.imagename = iprot.readString();
+ struct.setImagenameIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case -2: // USERNAME
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.username = iprot.readString();
+ struct.setUsernameIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case -3: // LAST_NAME
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.lastName = iprot.readString();
+ struct.setLastNameIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case -4: // FIRST_NAME
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.firstName = iprot.readString();
+ struct.setFirstNameIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case -5: // MAIL
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.mail = iprot.readString();
+ struct.setMailIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case -6: // UNIVERSITY
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.university = iprot.readString();
+ struct.setUniversityIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case -7: // ROLE
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.role = iprot.readString();
+ struct.setRoleIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ default:
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ iprot.readFieldEnd();
+ }
+ iprot.readStructEnd();
+
+ // check for required fields of primitive type, which can't be checked in the validate method
+ struct.validate();
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot, writeImageRights_args struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.role != null) {
+ oprot.writeFieldBegin(ROLE_FIELD_DESC);
+ oprot.writeString(struct.role);
+ oprot.writeFieldEnd();
+ }
+ if (struct.university != null) {
+ oprot.writeFieldBegin(UNIVERSITY_FIELD_DESC);
+ oprot.writeString(struct.university);
+ oprot.writeFieldEnd();
+ }
+ if (struct.mail != null) {
+ oprot.writeFieldBegin(MAIL_FIELD_DESC);
+ oprot.writeString(struct.mail);
+ oprot.writeFieldEnd();
+ }
+ if (struct.firstName != null) {
+ oprot.writeFieldBegin(FIRST_NAME_FIELD_DESC);
+ oprot.writeString(struct.firstName);
+ oprot.writeFieldEnd();
+ }
+ if (struct.lastName != null) {
+ oprot.writeFieldBegin(LAST_NAME_FIELD_DESC);
+ oprot.writeString(struct.lastName);
+ oprot.writeFieldEnd();
+ }
+ if (struct.username != null) {
+ oprot.writeFieldBegin(USERNAME_FIELD_DESC);
+ oprot.writeString(struct.username);
+ oprot.writeFieldEnd();
+ }
+ if (struct.imagename != null) {
+ oprot.writeFieldBegin(IMAGENAME_FIELD_DESC);
+ oprot.writeString(struct.imagename);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class writeImageRights_argsTupleSchemeFactory implements SchemeFactory {
+ public writeImageRights_argsTupleScheme getScheme() {
+ return new writeImageRights_argsTupleScheme();
+ }
+ }
+
+ private static class writeImageRights_argsTupleScheme extends TupleScheme<writeImageRights_args> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, writeImageRights_args struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetImagename()) {
+ optionals.set(0);
+ }
+ if (struct.isSetUsername()) {
+ optionals.set(1);
+ }
+ if (struct.isSetLastName()) {
+ optionals.set(2);
+ }
+ if (struct.isSetFirstName()) {
+ optionals.set(3);
+ }
+ if (struct.isSetMail()) {
+ optionals.set(4);
+ }
+ if (struct.isSetUniversity()) {
+ optionals.set(5);
+ }
+ if (struct.isSetRole()) {
+ optionals.set(6);
+ }
+ oprot.writeBitSet(optionals, 7);
+ if (struct.isSetImagename()) {
+ oprot.writeString(struct.imagename);
+ }
+ if (struct.isSetUsername()) {
+ oprot.writeString(struct.username);
+ }
+ if (struct.isSetLastName()) {
+ oprot.writeString(struct.lastName);
+ }
+ if (struct.isSetFirstName()) {
+ oprot.writeString(struct.firstName);
+ }
+ if (struct.isSetMail()) {
+ oprot.writeString(struct.mail);
+ }
+ if (struct.isSetUniversity()) {
+ oprot.writeString(struct.university);
+ }
+ if (struct.isSetRole()) {
+ oprot.writeString(struct.role);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, writeImageRights_args struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(7);
+ if (incoming.get(0)) {
+ struct.imagename = iprot.readString();
+ struct.setImagenameIsSet(true);
+ }
+ if (incoming.get(1)) {
+ struct.username = iprot.readString();
+ struct.setUsernameIsSet(true);
+ }
+ if (incoming.get(2)) {
+ struct.lastName = iprot.readString();
+ struct.setLastNameIsSet(true);
+ }
+ if (incoming.get(3)) {
+ struct.firstName = iprot.readString();
+ struct.setFirstNameIsSet(true);
+ }
+ if (incoming.get(4)) {
+ struct.mail = iprot.readString();
+ struct.setMailIsSet(true);
+ }
+ if (incoming.get(5)) {
+ struct.university = iprot.readString();
+ struct.setUniversityIsSet(true);
+ }
+ if (incoming.get(6)) {
+ struct.role = iprot.readString();
+ struct.setRoleIsSet(true);
+ }
+ }
+ }
+
+ }
+
+ public static class writeImageRights_result implements org.apache.thrift.TBase<writeImageRights_result, writeImageRights_result._Fields>, java.io.Serializable, Cloneable, Comparable<writeImageRights_result> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("writeImageRights_result");
+
+ private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new writeImageRights_resultStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new writeImageRights_resultTupleSchemeFactory());
+ }
+
+ public boolean success; // required
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ SUCCESS((short)0, "success");
+
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+ static {
+ for (_Fields field : EnumSet.allOf(_Fields.class)) {
+ byName.put(field.getFieldName(), field);
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, or null if its not found.
+ */
+ public static _Fields findByThriftId(int fieldId) {
+ switch(fieldId) {
+ case 0: // SUCCESS
+ return SUCCESS;
+ default:
+ return null;
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, throwing an exception
+ * if it is not found.
+ */
+ public static _Fields findByThriftIdOrThrow(int fieldId) {
+ _Fields fields = findByThriftId(fieldId);
+ if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+ return fields;
+ }
+
+ /**
+ * Find the _Fields constant that matches name, or null if its not found.
+ */
+ public static _Fields findByName(String name) {
+ return byName.get(name);
+ }
+
+ private final short _thriftId;
+ private final String _fieldName;
+
+ _Fields(short thriftId, String fieldName) {
+ _thriftId = thriftId;
+ _fieldName = fieldName;
+ }
+
+ public short getThriftFieldId() {
+ return _thriftId;
+ }
+
+ public String getFieldName() {
+ return _fieldName;
+ }
+ }
+
+ // isset id assignments
+ private static final int __SUCCESS_ISSET_ID = 0;
+ private byte __isset_bitfield = 0;
+ public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+ static {
+ Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+ tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(writeImageRights_result.class, metaDataMap);
+ }
+
+ public writeImageRights_result() {
+ }
+
+ public writeImageRights_result(
+ boolean success)
+ {
+ this();
+ this.success = success;
+ setSuccessIsSet(true);
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public writeImageRights_result(writeImageRights_result other) {
+ __isset_bitfield = other.__isset_bitfield;
+ this.success = other.success;
+ }
+
+ public writeImageRights_result deepCopy() {
+ return new writeImageRights_result(this);
+ }
+
+ @Override
+ public void clear() {
+ setSuccessIsSet(false);
+ this.success = false;
+ }
+
+ public boolean isSuccess() {
+ return this.success;
+ }
+
+ public writeImageRights_result setSuccess(boolean success) {
+ this.success = success;
+ setSuccessIsSet(true);
+ return this;
+ }
+
+ public void unsetSuccess() {
+ __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID);
+ }
+
+ /** Returns true if field success is set (has been assigned a value) and false otherwise */
+ public boolean isSetSuccess() {
+ return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);
+ }
+
+ public void setSuccessIsSet(boolean value) {
+ __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value);
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case SUCCESS:
+ if (value == null) {
+ unsetSuccess();
+ } else {
+ setSuccess((Boolean)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case SUCCESS:
+ return Boolean.valueOf(isSuccess());
+
+ }
+ throw new IllegalStateException();
+ }
+
+ /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+ public boolean isSet(_Fields field) {
+ if (field == null) {
+ throw new IllegalArgumentException();
+ }
+
+ switch (field) {
+ case SUCCESS:
+ return isSetSuccess();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof writeImageRights_result)
+ return this.equals((writeImageRights_result)that);
+ return false;
+ }
+
+ public boolean equals(writeImageRights_result that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_success = true;
+ boolean that_present_success = true;
+ if (this_present_success || that_present_success) {
+ if (!(this_present_success && that_present_success))
+ return false;
+ if (this.success != that.success)
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ @Override
+ public int compareTo(writeImageRights_result other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetSuccess()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ return 0;
+ }
+
+ public _Fields fieldForId(int fieldId) {
+ return _Fields.findByThriftId(fieldId);
+ }
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("writeImageRights_result(");
+ boolean first = true;
+
+ sb.append("success:");
+ sb.append(this.success);
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ // check for sub-struct validity
+ }
+
+ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+ try {
+ write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+ try {
+ // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
+ __isset_bitfield = 0;
+ read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private static class writeImageRights_resultStandardSchemeFactory implements SchemeFactory {
+ public writeImageRights_resultStandardScheme getScheme() {
+ return new writeImageRights_resultStandardScheme();
+ }
+ }
+
+ private static class writeImageRights_resultStandardScheme extends StandardScheme<writeImageRights_result> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, writeImageRights_result struct) throws org.apache.thrift.TException {
+ org.apache.thrift.protocol.TField schemeField;
+ iprot.readStructBegin();
+ while (true)
+ {
+ schemeField = iprot.readFieldBegin();
+ if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
+ break;
+ }
+ switch (schemeField.id) {
+ case 0: // SUCCESS
+ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
+ struct.success = iprot.readBool();
+ struct.setSuccessIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ default:
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ iprot.readFieldEnd();
+ }
+ iprot.readStructEnd();
+
+ // check for required fields of primitive type, which can't be checked in the validate method
+ struct.validate();
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot, writeImageRights_result struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.isSetSuccess()) {
+ oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
+ oprot.writeBool(struct.success);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class writeImageRights_resultTupleSchemeFactory implements SchemeFactory {
+ public writeImageRights_resultTupleScheme getScheme() {
+ return new writeImageRights_resultTupleScheme();
+ }
+ }
+
+ private static class writeImageRights_resultTupleScheme extends TupleScheme<writeImageRights_result> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, writeImageRights_result struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetSuccess()) {
+ optionals.set(0);
+ }
+ oprot.writeBitSet(optionals, 1);
+ if (struct.isSetSuccess()) {
+ oprot.writeBool(struct.success);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, writeImageRights_result struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(1);
+ if (incoming.get(0)) {
+ struct.success = iprot.readBool();
+ struct.setSuccessIsSet(true);
+ }
+ }
+ }
+
+ }
+
}
diff --git a/Dozentenmodulserver/src/server/ServerHandler.java b/Dozentenmodulserver/src/server/ServerHandler.java
index 90ce457d..a48f7714 100644
--- a/Dozentenmodulserver/src/server/ServerHandler.java
+++ b/Dozentenmodulserver/src/server/ServerHandler.java
@@ -453,4 +453,53 @@ public class ServerHandler implements Server.Iface {
new Date(), pk_institution);
return true;
}
+
+ @Override
+ public boolean writeImageRights(String imagename, String username, String lastName, String firstName, String mail, String university, String role)
+ throws TException {
+ String pk_image = null;
+ Map<String, String> map = new HashMap<String, String>();
+ int imageversion = 0;
+ String pk_institution = sql.setInstitution(university);
+ String pk_person = sql.setPerson(username, lastName, firstName, mail,
+ new Date(), pk_institution);
+ map = sql.getImageIDandVersion(imagename);
+ pk_image = map.get("GUID");
+ imageversion = Integer.parseInt(map.get("version"));
+
+ if(role.equals("Dozent")) {
+ int read=1;
+ int write=1;
+ int changePermission=0;
+ int admin=0;
+ int linkallowed=1;
+ int roleID=sql.getRoleID(role);
+
+ sql.setImageRights(pk_person, pk_image, roleID, read, write, changePermission, admin, linkallowed);
+
+ }else if(role.equals("Admin")){
+ int read=1;
+ int write=1;
+ int changePermission=1;
+ int admin=1;
+ int linkallowed=1;
+ int roleID=sql.getRoleID(role);
+
+ sql.setImageRights(pk_person, pk_image, roleID, read, write, changePermission, admin, linkallowed);
+ }
+ else{
+ int read=1;
+ int write=0;
+ int changePermission=0;
+ int admin=0;
+ int linkallowed=0;
+ int roleID=sql.getRoleID(role);
+
+ sql.setImageRights(pk_person, pk_image, roleID, read, write, changePermission, admin, linkallowed);
+ }
+
+ return true;
+ }
+
+
}
diff --git a/Dozentenmodulserver/src/sql/SQL.java b/Dozentenmodulserver/src/sql/SQL.java
index 3ba59923..0f222249 100644
--- a/Dozentenmodulserver/src/sql/SQL.java
+++ b/Dozentenmodulserver/src/sql/SQL.java
@@ -894,4 +894,62 @@ public class SQL {
}
return ret;
}
+
+ public int setImageRights(String pk_person, String pk_image,int role ,int read, int write, int changePermission, int admin,int linkallowed) {
+
+
+
+ try {
+ Connection con=getConnection();
+ Statement stm = con.createStatement();
+
+ String uid = UUID.randomUUID().toString();
+ stm.executeUpdate("INSERT INTO `bwLehrpool`.`pm_VLData_image`(`GUID`,`GUID_imageID`,`roleID`,`userID`,`image_read`,`image_write`,`image_admin`,`image_changePermission`,`link_allowed`)VALUES('"
+ + uid
+ + "','"
+ + pk_image
+ + "','"
+ + role
+ + "','"
+ + pk_person
+ + "','"
+ + read
+ + "','"
+ + write
+ + "','"
+ + admin
+ + "','"
+ + changePermission
+ + "','"
+ + linkallowed+ "');");
+ con.commit();
+ con.close();
+ } catch (SQLException e) {
+ // TODO Auto-generated catch block
+ log.info(new Date() + " - Failed to setImageRights.");
+ e.printStackTrace();
+ }
+ return 0;
+
+ }
+ public int getRoleID(String role) {
+
+
+ try {
+ Connection con=getConnection();
+ Statement stm = con.createStatement();
+
+ ResultSet rs=stm
+ .executeQuery("SELECT roleID FROM bwLehrpool.m_role where name like '"+ role+ "';");
+ rs.first();
+
+ return rs.getInt("roleID");
+
+ } catch (SQLException e) {
+ // TODO Auto-generated catch block
+ log.info(new Date() + " - Failed to getRoleID.");
+ e.printStackTrace();
+ }
+ return -1;
+ }
}
diff --git a/Dozentenmodulserver/thrift/server.thrift b/Dozentenmodulserver/thrift/server.thrift
index 4bd5954f..5c4d6382 100644
--- a/Dozentenmodulserver/thrift/server.thrift
+++ b/Dozentenmodulserver/thrift/server.thrift
@@ -56,4 +56,5 @@ service Server{
bool deleteLecture(string id, string hs, string user),
bool checkUser(string username),
bool createUser(string loginName, string lastName, string firstName, string mail, string university),
+ bool writeImageRights(string imagename, string username, string lastName, string firstName, string mail, string university, string role),
} \ No newline at end of file