I'm trying to build a custom search and I followed the sample from redbook. However, instead of creating a new feature, I'm just modifying the current search behavior by modifying the query that gets executed on FileNet database. Based on the sample, only few default properties are being set and displayed. I'm struggling to set the other document properties.
private static void buildResultStructure(JSONResultSetResponse jsonResultSet, MessageResources resources, Locale clientLocale) {
String[] states = new String[1];
states[0] = "isLocked";
jsonResultSet.addColumn(new JSONResultSetColumn(" ", "multiStateIcon", false, states));
jsonResultSet.addColumn(new JSONResultSetColumn(" ", "17px", "mimeTypeIcon", null, false));
jsonResultSet.addColumn(new JSONResultSetColumn(resources.getMessage(clientLocale, "search.results.header.id"), "200px", "ID", null, false));
jsonResultSet.addColumn(new JSONResultSetColumn("Class Name", "125px", "className", null, false));
jsonResultSet.addColumn(new JSONResultSetColumn(resources.getMessage(clientLocale, "search.results.header.lastModifiedByUser"), "125px", "ModifiedBy", null, false));
jsonResultSet.addColumn(new JSONResultSetColumn(resources.getMessage(clientLocale, "search.results.header.lastModifiedTimestamp"), "175px", "LastModified", null, false));
jsonResultSet.addColumn(new JSONResultSetColumn(resources.getMessage(clientLocale, "search.results.header.version"), "50px", "Version", null, false));
jsonResultSet.addMagazineColumn(new JSONResultSetColumn("thumbnail", "60px", "thumbnail", null, null));
com.ibm.json.java.JSONArray fieldsToDisplay = new com.ibm.json.java.JSONArray();
com.ibm.json.java.JSONObject jsonObj = new com.ibm.json.java.JSONObject();
jsonObj.put("field", "className");
jsonObj.put("displayName", "Class");
fieldsToDisplay.add(jsonObj);
jsonObj =new com.ibm.json.java.JSONObject();
jsonObj.put("field", "ModifiedBy");
jsonObj.put("displayName", resources.getMessage(clientLocale, "search.results.header.lastModifiedByUser"));
fieldsToDisplay.add(jsonObj);
jsonObj = new com.ibm.json.java.JSONObject();
jsonObj.put("field", "LastModified");
jsonObj.put("displayName", resources.getMessage(clientLocale, "search.results.header.lastModifiedTimestamp"));
fieldsToDisplay.add(jsonObj);
jsonObj = new com.ibm.json.java.JSONObject();
jsonObj.put("field", "Version");
jsonObj.put("displayName", resources.getMessage(clientLocale, "search.results.header.version"));
fieldsToDisplay.add(jsonObj);
jsonResultSet.addMagazineColumn(new JSONResultSetColumn("content", "100%", "content", fieldsToDisplay, null));
}