working on PCB v1.3

parent 5dc50182
......@@ -41,9 +41,9 @@ public class StudentTalk implements Emitter.Listener {
String pic=msg.getString("pic");
String lang=msg.getString("lang");
String attributes=msg.getString("attributes");
//JSONObject license= msg.getJSONObject("license");
Log.e("STUDENT","change...remove license in hard when lincense is not null");
JSONObject license=new JSONObject().put("isValid",true);
JSONObject license= msg.getJSONObject("license");
Log.e("STUDENT","change...remove license in hard when lincense is not null:"+license.toString());
//JSONObject license=new JSONObject().put("isValid",true);
User user=PCBcontext.getPcbdb().getCurrentUser();
User updatedUser=new User(id, username, user.get_pwd_stu(), name, surname, id_active_scene, pic, gender, lang, attributes,
user.get_id_sup(), user.get_email_sup(), user.get_pwd_sup(), user.get_name_sup(), user.get_surname_sup(), user.get_url_img_sup(), user.get_gender_sup(),
......
......@@ -139,13 +139,13 @@ public class StudentFragmentGrid extends Fragment {
//What ever you want to do with the value
String license = edittext.getText().toString().replaceAll("[^a-zA-Z0-9]", "").toUpperCase();
RestapiWrapper wrapper = PCBcontext.getRestapiWrapper();
String operation = "stu/license/sup/" + sup_id;
final String operation = "stu/license/sup/" + sup_id;
Hashtable<String, String> params = new Hashtable<String, String>(1);
params.put("license", license);
wrapper.ask(operation, params, "post", new RestapiWrapper.iRestapiListener() {
@Override
public void error(RestapiWrapper.HTTPException e) {
Log.e(this.getClass().getName(), " Server restapi error: " + e.getLocalizedMessage());
Log.e(this.getClass().getName(), " Server restapi error. Operation: "+operation +". Message:"+ e.getLocalizedMessage());
String err = e.getLocalizedMessage();
if (err.indexOf("nvalid license") > 0)
GUITools.show_alert(getActivity(), R.string.loginNoLicenseMsg);
......@@ -335,11 +335,11 @@ public class StudentFragmentGrid extends Fragment {
RestapiWrapper wrapper = PCBcontext.getRestapiWrapper();
wrapper.setToken(token);
String operation = "stu/" + stu_id + "/supervisors";
final String operation = "stu/" + stu_id + "/supervisors";
wrapper.ask(operation, new RestapiWrapper.iRestapiListener() {
@Override
public void error(RestapiWrapper.HTTPException e) {
Log.e(this.getClass().getName(), " Server restapi error: " + e.getLocalizedMessage());
Log.e(this.getClass().getName(), " Server restapi error. Operation: "+operation +". Message:"+ e.getLocalizedMessage());
GUITools.show_alert(getActivity(), R.string.loginErrorTxt, getString(R.string.serverError), new GUITools.iOKListener() {
@Override
public void ok() {
......@@ -407,12 +407,12 @@ public class StudentFragmentGrid extends Fragment {
String token = getActivity().getIntent().getExtras().getString("token");
RestapiWrapper wrapper = PCBcontext.getRestapiWrapper();
wrapper.setToken(token);
String operation = "sup/" + sup_id + "/students";
final String operation = "sup/" + sup_id + "/students";
wrapper.ask(operation, new RestapiWrapper.iRestapiListener() {
@Override
public void error(RestapiWrapper.HTTPException e) {
Log.e(this.getClass().getName(), " Server restapi error: " + e.getLocalizedMessage());
Log.e(this.getClass().getName(), " Server restapi error. Operation: "+operation +". Message:"+ e.getLocalizedMessage());
GUITools.show_alert(getActivity(), R.string.loginErrorTxt, getString(R.string.serverError), new GUITools.iOKListener() {
@Override
public void ok() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment