From: Patrick Schmitz Date: Thu, 6 Oct 2011 23:52:12 +0000 (+0000) Subject: CSPACE-4448 - Made default listing of vocabularies in an authority sort by displayNam... X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=7a35606fef5423210384d585978053717a6b5b83;p=tmp%2Fjakarta-migration.git CSPACE-4448 - Made default listing of vocabularies in an authority sort by displayName, rather than updatedAt. --- diff --git a/services/authority/src/main/java/org/collectionspace/services/common/vocabulary/AuthorityResource.java b/services/authority/src/main/java/org/collectionspace/services/common/vocabulary/AuthorityResource.java index 029fef8a4..0b3c219e0 100644 --- a/services/authority/src/main/java/org/collectionspace/services/common/vocabulary/AuthorityResource.java +++ b/services/authority/src/main/java/org/collectionspace/services/common/vocabulary/AuthorityResource.java @@ -379,6 +379,14 @@ public abstract class AuthorityResource ServiceContext ctx = createServiceContext(queryParams); DocumentHandler handler = createDocumentHandler(ctx); DocumentFilter myFilter = handler.getDocumentFilter(); + // Need to make the default sort order for authority items + // be on the displayName field + String sortBy = queryParams.getFirst(IClientQueryParams.SORT_BY_PARAM); + if (sortBy == null || sortBy.isEmpty()) { + String qualifiedDisplayNameField = authorityCommonSchemaName + ":" + + AuthorityItemJAXBSchema.DISPLAY_NAME; + myFilter.setOrderByClause(qualifiedDisplayNameField); + } String nameQ = queryParams.getFirst("refName"); if (nameQ != null) { myFilter.setWhereClause(authorityCommonSchemaName + ":refName='" + nameQ + "'");