mirror of https://github.com/MISP/misp-bump
string to array: restricted_to_domain, getter and setter
parent
5e95c53670
commit
592557176a
|
@ -289,7 +289,7 @@ public class ExchangeActivity extends AppCompatActivity {
|
||||||
final List<UploadInformation> uploadInformationList = preferenceManager.getUploadInformationList();
|
final List<UploadInformation> uploadInformationList = preferenceManager.getUploadInformationList();
|
||||||
|
|
||||||
for (final UploadInformation ui : uploadInformationList) {
|
for (final UploadInformation ui : uploadInformationList) {
|
||||||
if (ui.getRemote().organisation.uuid.equals(remoteSyncInfo.organisation.uuid)) {
|
if (ui.getRemote().organisation.getUuid().equals(remoteSyncInfo.organisation.getUuid())) {
|
||||||
DialogManager.syncAlreadyExistsDialog(ui.getRemote(), remoteSyncInfo, ExchangeActivity.this, new DialogManager.IDialogFeedback() {
|
DialogManager.syncAlreadyExistsDialog(ui.getRemote(), remoteSyncInfo, ExchangeActivity.this, new DialogManager.IDialogFeedback() {
|
||||||
@Override
|
@Override
|
||||||
public void positive() {
|
public void positive() {
|
||||||
|
|
|
@ -79,23 +79,23 @@ public class ProfileActivity extends AppCompatActivity {
|
||||||
Organisation organisation = preferenceManager.getUserOrganisation();
|
Organisation organisation = preferenceManager.getUserOrganisation();
|
||||||
|
|
||||||
TextView name = findViewById(R.id.orgName);
|
TextView name = findViewById(R.id.orgName);
|
||||||
name.setText(organisation.name);
|
name.setText(organisation.getName());
|
||||||
|
|
||||||
final MaterialPreferenceText uuid = findViewById(R.id.uuid);
|
final MaterialPreferenceText uuid = findViewById(R.id.uuid);
|
||||||
uuid.setSubtitle(organisation.uuid);
|
uuid.setSubtitle(organisation.getUuid());
|
||||||
|
|
||||||
MaterialPreferenceText nationality = findViewById(R.id.nationality);
|
MaterialPreferenceText nationality = findViewById(R.id.nationality);
|
||||||
nationality.setSubtitle(organisation.nationality);
|
nationality.setSubtitle(organisation.getNationality());
|
||||||
|
|
||||||
MaterialPreferenceText sector = findViewById(R.id.sector);
|
MaterialPreferenceText sector = findViewById(R.id.sector);
|
||||||
if (organisation.sector == null) {
|
if (organisation.getSector() == null) {
|
||||||
sector.setVisibility(View.GONE);
|
sector.setVisibility(View.GONE);
|
||||||
} else {
|
} else {
|
||||||
sector.setSubtitle(organisation.sector);
|
sector.setSubtitle(organisation.getSector());
|
||||||
}
|
}
|
||||||
|
|
||||||
MaterialPreferenceText description = findViewById(R.id.description);
|
MaterialPreferenceText description = findViewById(R.id.description);
|
||||||
description.setSubtitle(organisation.description);
|
description.setSubtitle(organisation.getDescription());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -212,7 +212,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||||
|
|
||||||
private User generateSyncUser(Organisation organisation) {
|
private User generateSyncUser(Organisation organisation) {
|
||||||
User syncUser = new User();
|
User syncUser = new User();
|
||||||
syncUser.org_id = organisation.id;
|
syncUser.org_id = organisation.getId();
|
||||||
syncUser.role_id = User.ROLE_SYNC_USER;
|
syncUser.role_id = User.ROLE_SYNC_USER;
|
||||||
syncUser.email = uploadInformation.getRemote().syncUserEmail;
|
syncUser.email = uploadInformation.getRemote().syncUserEmail;
|
||||||
syncUser.password = uploadInformation.getRemote().syncUserPassword;
|
syncUser.password = uploadInformation.getRemote().syncUserPassword;
|
||||||
|
@ -224,9 +224,9 @@ public class UploadActivity extends AppCompatActivity {
|
||||||
|
|
||||||
private Server generateSyncServer() {
|
private Server generateSyncServer() {
|
||||||
Server server = new Server();
|
Server server = new Server();
|
||||||
server.name = uploadInformation.getRemote().organisation.name + "'s Sync Server";
|
server.name = uploadInformation.getRemote().organisation.getName() + "'s Sync Server";
|
||||||
server.url = uploadInformation.getRemote().baseUrl;
|
server.url = uploadInformation.getRemote().baseUrl;
|
||||||
server.remote_org_id = uploadInformation.getRemote().organisation.id;
|
server.remote_org_id = uploadInformation.getRemote().organisation.getId();
|
||||||
server.authkey = uploadInformation.getLocal().syncUserAuthkey;
|
server.authkey = uploadInformation.getLocal().syncUserAuthkey;
|
||||||
server.pull = uploadInformation.isPull();
|
server.pull = uploadInformation.isPull();
|
||||||
server.push = uploadInformation.isPush();
|
server.push = uploadInformation.isPush();
|
||||||
|
@ -256,11 +256,11 @@ public class UploadActivity extends AppCompatActivity {
|
||||||
private void organisationAdded(Organisation organisation) {
|
private void organisationAdded(Organisation organisation) {
|
||||||
if (organisation != null) {
|
if (organisation != null) {
|
||||||
setUploadActionState(orgAction, UploadAction.UploadState.DONE, null);
|
setUploadActionState(orgAction, UploadAction.UploadState.DONE, null);
|
||||||
uploadInformation.getRemote().organisation.id = organisation.id;
|
uploadInformation.getRemote().organisation.setId(organisation.getId());
|
||||||
restClient.addUser(generateSyncUser(organisation), userCallback);
|
restClient.addUser(generateSyncUser(organisation), userCallback);
|
||||||
} else {
|
} else {
|
||||||
// search by UUID because the error does not give the actual ID
|
// search by UUID because the error does not give the actual ID
|
||||||
restClient.getOrganisation(uploadInformation.getRemote().organisation.uuid, new MispRestClient.OrganisationCallback() {
|
restClient.getOrganisation(uploadInformation.getRemote().organisation.getUuid(), new MispRestClient.OrganisationCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void success(Organisation organisation) {
|
public void success(Organisation organisation) {
|
||||||
organisationAdded(organisation);
|
organisationAdded(organisation);
|
||||||
|
|
|
@ -127,7 +127,7 @@ public class UploadInfoActivity extends AppCompatActivity {
|
||||||
assert ab != null;
|
assert ab != null;
|
||||||
|
|
||||||
TextView toolbarTitle = findViewById(R.id.toolbarTitle);
|
TextView toolbarTitle = findViewById(R.id.toolbarTitle);
|
||||||
toolbarTitle.setText(uploadInformation.getRemote().organisation.name);
|
toolbarTitle.setText(uploadInformation.getRemote().organisation.getName());
|
||||||
|
|
||||||
ab.setHomeAsUpIndicator(R.drawable.ic_close);
|
ab.setHomeAsUpIndicator(R.drawable.ic_close);
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ public class UploadInfoAdapter extends RecyclerView.Adapter<UploadInfoAdapter.Vi
|
||||||
final UploadInformation item = items.get(position);
|
final UploadInformation item = items.get(position);
|
||||||
|
|
||||||
holder.date.setText(item.getDateString());
|
holder.date.setText(item.getDateString());
|
||||||
holder.orgName.setText(item.getRemote().organisation.name);
|
holder.orgName.setText(item.getRemote().organisation.getName());
|
||||||
|
|
||||||
switch (item.getCurrentSyncStatus()) {
|
switch (item.getCurrentSyncStatus()) {
|
||||||
case COMPLETE:
|
case COMPLETE:
|
||||||
|
|
|
@ -26,10 +26,10 @@ public class DialogManager {
|
||||||
// this dialog needs definite user feedback
|
// this dialog needs definite user feedback
|
||||||
adb.setCancelable(false);
|
adb.setCancelable(false);
|
||||||
|
|
||||||
if (oldSync.organisation.name.equals(newSync.organisation.name)) {
|
if (oldSync.organisation.getName().equals(newSync.organisation.getName())) {
|
||||||
adb.setTitle("Already Synced with " + oldSync.organisation.name);
|
adb.setTitle("Already Synced with " + oldSync.organisation.getName());
|
||||||
} else {
|
} else {
|
||||||
adb.setTitle("Already Synced with " + oldSync.organisation.name + "(Now:" + newSync.organisation.name + ")");
|
adb.setTitle("Already Synced with " + oldSync.organisation.getName() + "(Now:" + newSync.organisation.getName() + ")");
|
||||||
}
|
}
|
||||||
|
|
||||||
adb.setMessage("");
|
adb.setMessage("");
|
||||||
|
@ -142,7 +142,7 @@ public class DialogManager {
|
||||||
final AlertDialog.Builder adb = new AlertDialog.Builder(context);
|
final AlertDialog.Builder adb = new AlertDialog.Builder(context);
|
||||||
|
|
||||||
adb.setTitle("Sync information received");
|
adb.setTitle("Sync information received");
|
||||||
adb.setMessage(syncInformation.organisation.name);
|
adb.setMessage(syncInformation.organisation.getName());
|
||||||
adb.setPositiveButton("Accept", new DialogInterface.OnClickListener() {
|
adb.setPositiveButton("Accept", new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
|
|
|
@ -355,7 +355,7 @@ public class MispRestClient {
|
||||||
@Override
|
@Override
|
||||||
public void success(Organisation[] organisations) {
|
public void success(Organisation[] organisations) {
|
||||||
for (Organisation organisation : organisations) {
|
for (Organisation organisation : organisations) {
|
||||||
if (organisation.uuid.equals(uuid)) {
|
if (organisation.getUuid().equals(uuid)) {
|
||||||
callback.success(organisation);
|
callback.success(organisation);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,20 +5,20 @@ package lu.circl.mispbump.models.restModels;
|
||||||
*/
|
*/
|
||||||
public class Organisation {
|
public class Organisation {
|
||||||
|
|
||||||
public Integer id;
|
private Integer id;
|
||||||
public String name;
|
private String name;
|
||||||
public String date_created;
|
private String date_created;
|
||||||
public String date_modified;
|
private String date_modified;
|
||||||
public String type;
|
private String type;
|
||||||
public String nationality;
|
private String nationality;
|
||||||
public String sector;
|
private String sector;
|
||||||
public String contacts;
|
private String contacts;
|
||||||
public String description;
|
private String description;
|
||||||
public Boolean local;
|
private Boolean local;
|
||||||
public String uuid;
|
private String uuid;
|
||||||
public String restricted_to_domain;
|
private String[] restricted_to_domain;
|
||||||
public String created_by;
|
private String created_by;
|
||||||
public Integer user_count;
|
private Integer user_count;
|
||||||
|
|
||||||
public Organisation() {
|
public Organisation() {
|
||||||
}
|
}
|
||||||
|
@ -46,6 +46,119 @@ public class Organisation {
|
||||||
return organisation;
|
return organisation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Integer getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(Integer id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDate_created() {
|
||||||
|
return date_created;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDate_created(String date_created) {
|
||||||
|
this.date_created = date_created;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDate_modified() {
|
||||||
|
return date_modified;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDate_modified(String date_modified) {
|
||||||
|
this.date_modified = date_modified;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setType(String type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNationality() {
|
||||||
|
return nationality;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNationality(String nationality) {
|
||||||
|
this.nationality = nationality;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSector() {
|
||||||
|
return sector;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSector(String sector) {
|
||||||
|
this.sector = sector;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getContacts() {
|
||||||
|
return contacts;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setContacts(String contacts) {
|
||||||
|
this.contacts = contacts;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescription(String description) {
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getLocal() {
|
||||||
|
return local;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLocal(Boolean local) {
|
||||||
|
this.local = local;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUuid() {
|
||||||
|
return uuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUuid(String uuid) {
|
||||||
|
this.uuid = uuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String[] getRestricted_to_domain() {
|
||||||
|
return restricted_to_domain;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRestricted_to_domain(String[] restricted_to_domain) {
|
||||||
|
this.restricted_to_domain = restricted_to_domain;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCreated_by() {
|
||||||
|
return created_by;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreated_by(String created_by) {
|
||||||
|
this.created_by = created_by;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getUser_count() {
|
||||||
|
return user_count;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUser_count(Integer user_count) {
|
||||||
|
this.user_count = user_count;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "Organisation{" +
|
return "Organisation{" +
|
||||||
|
|
Loading…
Reference in New Issue