morePages = false;\r
}\r
\r
- int nRefsFoundThisPage = processRefObjsDocList(docList, ctx.getTenantId(), oldRefName, queriedServiceBindings, authRefFieldsByService,\r
+ int nRefsFoundThisPage = processRefObjsDocList(docList, ctx.getTenantId(), oldRefName, queriedServiceBindings, authRefFieldsByService, // Perform the refName updates on the list of document models\r
null, newRefName);\r
if (nRefsFoundThisPage > 0) {\r
- ((RepositoryJavaClientImpl) repoClient).saveDocListWithoutHandlerProcessing(ctx, repoSession, docList, true);\r
+ ((RepositoryJavaClientImpl) repoClient).saveDocListWithoutHandlerProcessing(ctx, repoSession, docList, true); // Flush the document model list out to Nuxeo storage\r
nRefsFound += nRefsFoundThisPage;\r
}\r
\r
* Runs through the list of found docs, processing them. If list is\r
* non-null, then processing means gather the info for items. If list is\r
* null, and newRefName is non-null, then processing means replacing and\r
- * updating. If processing/updating, this must be called in teh context of\r
+ * updating. If processing/updating, this must be called in the context of\r
* an open session, and caller must release Session after calling this.\r
*\r
*/\r
DocumentModel docModel = iter.next();\r
String id = NuxeoUtils.getCsid(docModel);\r
item.put(STANDARD_LIST_CSID_FIELD, id);\r
- if(markRtSbj!=null) {\r
- String relationClause = RelationsUtils.buildWhereClause(markRtSbj, null, null, id, null);\r
- String whereClause = relationClause + IQueryManager.SEARCH_QUALIFIER_AND + \r
- NuxeoUtils.buildWorkflowNotDeletedWhereClause();\r
- QueryContext queryContext = new QueryContext(sc, whereClause);\r
- queryContext.setDocType(IRelationsManager.DOC_TYPE);\r
- String query = NuxeoUtils.buildNXQLQuery(sc, queryContext);\r
- // Search for 1 relation that matches. 1 is enough to fail the filter\r
- DocumentModelList docList = repoSession.query(query, null, 1, 0, false);\r
- item.put(STANDARD_LIST_MARK_RT_FIELD, docList.isEmpty()?"false":"true");\r
- }\r
+ if (markRtSbj != null) {\r
+ String relationClause = RelationsUtils.buildWhereClause(\r
+ markRtSbj, null, null, id, null);\r
+ String whereClause = relationClause\r
+ + IQueryManager.SEARCH_QUALIFIER_AND\r
+ + NuxeoUtils.buildWorkflowNotDeletedWhereClause();\r
+ QueryContext queryContext = new QueryContext(sc,\r
+ whereClause);\r
+ queryContext.setDocType(IRelationsManager.DOC_TYPE);\r
+ String query = NuxeoUtils.buildNXQLQuery(sc, queryContext);\r
+ // Search for 1 relation that matches. 1 is enough to fail\r
+ // the filter\r
+ DocumentModelList docList = repoSession.query(query, null,\r
+ 1, 0, false);\r
+ item.put(STANDARD_LIST_MARK_RT_FIELD,\r
+ docList.isEmpty() ? "false" : "true");\r
+ }\r
String uri = getUri(docModel);\r
item.put(STANDARD_LIST_URI_FIELD, uri);\r
item.put(STANDARD_LIST_REFNAME_FIELD, getRefname(docModel));\r
getUpdatedAtAsString(docModel));\r
item.put(STANDARD_LIST_WORKFLOW_FIELD,\r
docModel.getCurrentLifeCycleState());\r
- \r
+\r
for (ListResultField field : resultsFields) {\r
String schema = field.getSchema();\r
if (schema == null || schema.trim().isEmpty()) {\r
schema = commonSchema;\r
}\r
- Object value = getStringValue(docModel, schema, field);\r
+ Object value = getListResultValue(docModel, schema, field);\r
+ if (value != null && value instanceof String) { // If it is String that is either null or empty, we set our value to null\r
+ String strValue = (String) value;\r
+ if (strValue.trim().isEmpty() == true) {\r
+ value = null; // We found an "empty" string value, so just set the value to null so we don't return anything.\r
+ }\r
+ }\r
if (value != null) {\r
item.put(field.getElement(), value);\r
}\r