From 4bfb3884b61963222cdaee323b9f6fa566c94975 Mon Sep 17 00:00:00 2001
From: "Fuentes Serna  Juan Mariano (ID SIS)" <juanf@bs-mbpr28.d.ethz.ch>
Date: Fri, 23 Feb 2018 14:12:15 +0100
Subject: [PATCH] SSDM-6196 : New V3 API Sort option
 sortBy().fetchedFieldsScore(), js implementation + some tweaks

---
 .../common/fetchoptions/EntityWithPropertiesSortOptions.js   | 4 +++-
 .../common/fetchoptions/EntityWithPropertiesSortOptions.java | 5 +++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/as/dto/common/fetchoptions/EntityWithPropertiesSortOptions.js b/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/as/dto/common/fetchoptions/EntityWithPropertiesSortOptions.js
index 40f6b93a124..e289ffceb3c 100644
--- a/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/as/dto/common/fetchoptions/EntityWithPropertiesSortOptions.js
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/as/dto/common/fetchoptions/EntityWithPropertiesSortOptions.js
@@ -23,7 +23,9 @@ define([ "require", "stjs", "as/dto/common/fetchoptions/EntitySortOptions", "as/
 			
 			return this.getOrCreateSortingWithParameters(fields.FETCHED_FIELDS_SCORE, parameters);
 		};
-		
+		prototype.getFetchedFieldsScore = function() {
+			return this.getSorting(fields.FETCHED_FIELDS_SCORE);
+		};
 		prototype.type = function() {
 			return this.getOrCreateSorting(fields.TYPE);
 		};
diff --git a/openbis_api/source/java/ch/ethz/sis/openbis/generic/asapi/v3/dto/common/fetchoptions/EntityWithPropertiesSortOptions.java b/openbis_api/source/java/ch/ethz/sis/openbis/generic/asapi/v3/dto/common/fetchoptions/EntityWithPropertiesSortOptions.java
index 2141fbeff3a..ba1a9d6fce9 100644
--- a/openbis_api/source/java/ch/ethz/sis/openbis/generic/asapi/v3/dto/common/fetchoptions/EntityWithPropertiesSortOptions.java
+++ b/openbis_api/source/java/ch/ethz/sis/openbis/generic/asapi/v3/dto/common/fetchoptions/EntityWithPropertiesSortOptions.java
@@ -57,6 +57,11 @@ public class EntityWithPropertiesSortOptions<OBJECT extends ICodeHolder & IPermI
 		return getOrCreateSortingWithParameters(FETCHED_FIELDS_SCORE, parameters);
     }
     
+    public SortOrder getFetchedFieldsScore()
+    {
+        return getSorting(FETCHED_FIELDS_SCORE);
+    }
+    
     public SortOrder type()
     {
         return getOrCreateSorting(TYPE);
-- 
GitLab