问题描述
我正在尝试建立自定义搜索,并且遵循了红皮书中的示例。但是,我没有创建新功能,而是通过修改在FileNet数据库上执行的查询来修改当前的搜索行为。根据示例,仅设置和显示了几个默认属性。我正在努力设置其他文档属性。
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",false));
jsonResultSet.addColumn(new JSONResultSetColumn("Class Name","125px","className","search.results.header.lastModifiedByUser"),"ModifiedBy","search.results.header.lastModifiedTimestamp"),"175px","LastModified","search.results.header.version"),"50px","Version",false));
jsonResultSet.addMagazineColumn(new JSONResultSetColumn("thumbnail","60px","thumbnail",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","search.results.header.lastModifiedTimestamp"));
fieldsToDisplay.add(jsonObj);
jsonObj = new com.ibm.json.java.JSONObject();
jsonObj.put("field","Version");
jsonObj.put("displayName","search.results.header.version"));
fieldsToDisplay.add(jsonObj);
jsonResultSet.addMagazineColumn(new JSONResultSetColumn("content","100%","content",fieldsToDisplay,null));
}
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)