}
/*
- * Most of the authority child classes will use this method. However, the Vocabulary service's item schema is
+ * Most of the authority child classes will/should use this implementation. However, the Vocabulary service's item schema is
* different enough that it will have to override this method in it's resource class.
*/
- protected String getQualifiedDisplayNameField() {
+ protected String getOrderByField() {
String result = null;
result = NuxeoUtils.getPrimaryElPathPropertyName(
return result;
}
+
+ protected String getPartialTermMatchField() {
+ String result = null;
+
+ result = NuxeoUtils.getMultiElPathPropertyName(
+ authorityItemCommonSchemaName, getItemTermInfoGroupXPathBase(),
+ AuthorityItemJAXBSchema.TERM_DISPLAY_NAME);
+
+ return result;
+ }
/**
* Gets the authorityItem list for the specified authority
String keywords = queryParams.getFirst(IQueryManager.SEARCH_TYPE_KEYWORDS_KW);
String advancedSearch = queryParams.getFirst(IQueryManager.SEARCH_TYPE_KEYWORDS_AS);
- String qualifiedDisplayNameField = getQualifiedDisplayNameField();
-
// Note that docType defaults to the ServiceName, so we're fine with that.
ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx = null;
// be on the displayName field
String sortBy = queryParams.getFirst(IClientQueryParams.SORT_BY_PARAM);
if (sortBy == null || sortBy.isEmpty()) {
- myFilter.setOrderByClause(qualifiedDisplayNameField);
+ String orderByField = getOrderByField();
+ myFilter.setOrderByClause(orderByField);
}
// If we are not wildcarding the parent, add a restriction
// NOTE: Partial terms searches are mutually exclusive to keyword and advanced-search, but
// the PT query param trumps the KW and AS query params.
if (partialTerm != null && !partialTerm.isEmpty()) {
+ String partialTermMatchField = getPartialTermMatchField();
String ptClause = QueryManager.createWhereClauseForPartialMatch(
- qualifiedDisplayNameField, partialTerm);
+ partialTermMatchField, partialTerm);
myFilter.appendWhereClause(ptClause, IQueryManager.SEARCH_QUALIFIER_AND);
} else if (keywords != null || advancedSearch != null) {
// String kwdClause = QueryManager.createWhereClauseFromKeywords(keywords);
ctx.addOutputPart(relationsPart);
}
+ @Override
public void fillAllParts(DocumentWrapper<DocumentModel> wrapDoc, Action action) throws Exception {
+ //
+ // We currently don't override this method with any AuthorityItemDocumentModelHandler specific functionality, so
+ // we could remove this method.
+ //
super.fillAllParts(wrapDoc, action);
- /*
- ServiceContext ctx = getServiceContext();
- PoxPayloadIn input = (PoxPayloadIn) ctx.getInput();
- DocumentModel documentModel = (wrapDoc.getWrappedObject());
- String itemCsid = documentModel.getName();
-
- //UPDATE and CREATE will call. Updates relations part
- RelationsCommonList relationsCommonList = updateRelations(itemCsid, input, wrapDoc);
-
- PayloadOutputPart payloadOutputPart = new PayloadOutputPart(RelationClient.SERVICE_COMMON_LIST_NAME, relationsCommonList);
- ctx.setProperty(RelationClient.SERVICE_COMMON_LIST_NAME, payloadOutputPart);
- */
}
+ @Override
public void completeCreate(DocumentWrapper<DocumentModel> wrapDoc) throws Exception {
super.completeCreate(wrapDoc);
handleRelationsPayload(wrapDoc, false);
}
+ @Override
public void completeUpdate(DocumentWrapper<DocumentModel> wrapDoc) throws Exception {
super.completeUpdate(wrapDoc);
handleRelationsPayload(wrapDoc, true);