@Override public void generateJson(String prefix, PrintWriter pw, VWorkspace vWorkspace, HistoryType historyType) { pw.println(prefix + "{"); String newPref = prefix + " "; generateCommandJSONAttributes(prefix, pw, vWorkspace, historyType); pw.println("," + newPref + JSONUtil.jsonLast(JsonKeys.worksheetId, getWorksheetId())); pw.println(prefix + "}"); } }
public void generateWorksheetListJson(String prefix, PrintWriter pw) { pw.println(prefix + "{"); String newPref = prefix + " "; pw.println(newPref + JSONUtil.json(WorksheetListUpdate.JsonKeys.worksheetId, this.getWorksheetId())); pw.println(newPref + JSONUtil.json(WorksheetListUpdate.JsonKeys.isUpToDate, upToDate)); pw.println(newPref + JSONUtil.json(WorksheetListUpdate.JsonKeys.isCollapsed, collapsed)); pw.println(newPref + JSONUtil.json(WorksheetListUpdate.JsonKeys.encoding, worksheet.getEncoding())); pw.println(newPref + JSONUtil.jsonLast(WorksheetListUpdate.JsonKeys.title, worksheet.getTitle())); pw.println(prefix + "}"); } }
protected void generateCommandJSONAttributes(String prefix, PrintWriter pw, VWorkspace vWorkspace, HistoryType historyType) { String newPref = prefix + " "; pw.println(newPref + JSONUtil.json(JsonKeys.commandId, getId())); pw.println(newPref + JSONUtil.json(JsonKeys.title, getTitle())); pw.println(newPref + JSONUtil.json(JsonKeys.description, getDescription())); pw.println(newPref + JSONUtil.json(JsonKeys.historyType, historyType.name())); pw.println(newPref + JSONUtil.jsonLast(JsonKeys.commandType, getCommandType() .name())); }
@Override public void generateJson(String prefix, PrintWriter pw, VWorkspace vWorkspace) { pw.println(prefix + "{"); String newPref = prefix + " "; pw.println(newPref + JSONUtil.json(GenericJsonKeys.updateType, getUpdateType())); pw.println(newPref + JSONUtil.json(JsonKeys.worksheet, worksheetId)); pw.println(newPref + JSONUtil.json(JsonKeys.nodeId, nodeId)); pw.println(newPref + JSONUtil.json(JsonKeys.newStatus, newStatus.getCodedStatus())); pw.println(newPref + JSONUtil.json(JsonKeys.expandedValue, newValue.asString())); String displayValueString = newValue.asString(); int maxValueLength = vWorkspace.getPreferences().getIntViewPreferenceValue( ViewPreference.maxCharactersInCell); if(displayValueString.length() > maxValueLength) { displayValueString = JSONUtil.truncateCellValue( displayValueString,maxValueLength); } pw.println(newPref + JSONUtil.jsonLast(JsonKeys.displayValue, displayValueString)); pw.println(prefix + "}"); }