Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,14 @@ public class ProjectMetadataImpl implements ProjectMetadata, Serializable {
@Setter
private String researchProjects;

@Getter
@Setter
private String resources;

@Getter
@Setter
private String unitType;

public ProjectMetadataImpl() {
}

Expand Down Expand Up @@ -246,6 +254,12 @@ public void populateFromJSON(JSONObject metadataJSON) {
}
setResearchProjects(researchProjects.toString());

JSONArray resources = metadataJSON.optJSONArray("resources");
if (resources == null) {
resources = new JSONArray();
}
setResources(resources.toString());

JSONArray parentProjects = metadataJSON.optJSONArray("parentProjects");
if (parentProjects == null) {
parentProjects = new JSONArray();
Expand Down Expand Up @@ -367,6 +381,8 @@ public void populateFromJSON(JSONObject metadataJSON) {
postLevel = (long) 5;
}
setPostLevel(postLevel);

setUnitType(metadataJSON.optString("unitType", "Platform"));
}

/**
Expand Down Expand Up @@ -479,6 +495,13 @@ public String toJSONString() {
metadata.put("researchProjects", new JSONArray());
}

String resourcesString = metadata.getString("resources");
if (resourcesString != null && resourcesString != "null") {
JSONArray resourcesJSON = new JSONArray(resourcesString);
metadata.put("resources", resourcesJSON);
} else {
metadata.put("resources", new JSONArray());
}
} catch (JSONException e) {
e.printStackTrace();
}
Expand Down