@@ -132,7 +132,6 @@ public class ProjectMetadataImpl implements ProjectMetadata, Serializable {
132132 @ Setter
133133 private String lessonPlan ;
134134
135- @ Column (name = "standards" , length = 5120000 , columnDefinition = "mediumtext" )
136135 @ Getter
137136 @ Setter
138137 private String standards ;
@@ -204,6 +203,20 @@ public class ProjectMetadataImpl implements ProjectMetadata, Serializable {
204203 @ Setter
205204 private String researchProjects ;
206205
206+ @ Getter
207+ @ Setter
208+ private String disciplines ;
209+
210+ @ Getter
211+ @ Setter
212+ private String resources ;
213+
214+ private String standardsDefault = "{\" commonCore\" : [], \" ngss\" : [], \" learningForJustice\" : []}" ;
215+
216+ @ Getter
217+ @ Setter
218+ private String unitType ;
219+
207220 public ProjectMetadataImpl () {
208221 }
209222
@@ -246,6 +259,18 @@ public void populateFromJSON(JSONObject metadataJSON) {
246259 }
247260 setResearchProjects (researchProjects .toString ());
248261
262+ JSONArray disciplines = metadataJSON .optJSONArray ("disciplines" );
263+ if (disciplines == null ) {
264+ disciplines = new JSONArray ();
265+ }
266+ setDisciplines (disciplines .toString ());
267+
268+ JSONArray resources = metadataJSON .optJSONArray ("resources" );
269+ if (resources == null ) {
270+ resources = new JSONArray ();
271+ }
272+ setResources (resources .toString ());
273+
249274 JSONArray parentProjects = metadataJSON .optJSONArray ("parentProjects" );
250275 if (parentProjects == null ) {
251276 parentProjects = new JSONArray ();
@@ -318,10 +343,7 @@ public void populateFromJSON(JSONObject metadataJSON) {
318343 }
319344 setLessonPlan (lessonPlan );
320345
321- String standards = metadataJSON .optString ("standards" , "" );
322- if (standards .equals ("null" )) {
323- standards = "" ;
324- }
346+ String standards = metadataJSON .optString ("standards" , this .standardsDefault );
325347 setStandards (standards );
326348
327349 JSONObject standardsAddressed = metadataJSON .optJSONObject ("standardsAddressed" );
@@ -367,6 +389,8 @@ public void populateFromJSON(JSONObject metadataJSON) {
367389 postLevel = (long ) 5 ;
368390 }
369391 setPostLevel (postLevel );
392+
393+ setUnitType (metadataJSON .optString ("unitType" , "Platform" ));
370394 }
371395
372396 /**
@@ -455,12 +479,17 @@ public String toJSONString() {
455479 metadata .put ("tools" , new JSONObject ());
456480 }
457481
458- String standardsAddressedString = metadata .getString ("standardsAddressed" );
459- if (standardsAddressedString != null && standardsAddressedString != "null" ) {
460- JSONObject standardsAddressedJSON = new JSONObject (standardsAddressedString );
461- metadata .put ("standardsAddressed" , standardsAddressedJSON );
482+ String standardsString = metadata .getString ("standards" );
483+ if (standardsString != null && standardsString != "null" ) {
484+ JSONObject standardsJSON ;
485+ try {
486+ standardsJSON = new JSONObject (standardsString );
487+ } catch (JSONException e ) {
488+ standardsJSON = new JSONObject (standardsDefault );
489+ }
490+ metadata .put ("standards" , standardsJSON );
462491 } else {
463- metadata .put ("standardsAddressed " , new JSONObject ());
492+ metadata .put ("standards " , new JSONObject ());
464493 }
465494
466495 String parentProjectsString = metadata .getString ("parentProjects" );
@@ -479,6 +508,21 @@ public String toJSONString() {
479508 metadata .put ("researchProjects" , new JSONArray ());
480509 }
481510
511+ String disciplinesString = metadata .getString ("disciplines" );
512+ if (disciplinesString != null && disciplinesString != "null" ) {
513+ JSONArray disciplinesJSON = new JSONArray (disciplinesString );
514+ metadata .put ("disciplines" , disciplinesJSON );
515+ } else {
516+ metadata .put ("disciplines" , new JSONArray ());
517+ }
518+
519+ String resourcesString = metadata .getString ("resources" );
520+ if (resourcesString != null && resourcesString != "null" ) {
521+ JSONArray resourcesJSON = new JSONArray (resourcesString );
522+ metadata .put ("resources" , resourcesJSON );
523+ } else {
524+ metadata .put ("resources" , new JSONArray ());
525+ }
482526 } catch (JSONException e ) {
483527 e .printStackTrace ();
484528 }
0 commit comments