/*========================================== Builds and exports the JSON for Shelves info Note: JSON var names have been condensed to 2-letter strings. See comments for readable names. ==========================================*/ void makeShelfJSON(EntryClass[] fullTopics) { // ArrayList for building the JSON ArrayList stringList = new ArrayList(); // Open var array stringList.add("var stackData = ["); // Step through table rows for (TableRow outerRow : table.rows()) { // Open individual shelf JSON stringList.add("{"); // Creates a location string and adds it to the JSON // name: LOCATION String locString = generateLocString(outerRow); stringList.add(ind(1) + JSONPair("Lc", locString, true, false)); // Open tag for entry JSON array // name: ENTRIES stringList.add(ind(1) + "\"Es\": ["); // Creates an array with topics and titles. String shelfTopicsAndTitles = outerRow.getString("Stack Topics") + ", " + outerRow.getString("Titles"); String[] shelfEntryTopics = shelfTopicsAndTitles.split(", "); shelfEntryTopics = sort(shelfEntryTopics); // Loops through topics array for (int i=0; i