integrated with WhereClause

This commit is contained in:
Francesco Mangiacrapa 2021-12-15 15:43:36 +01:00
parent b028fcd4b4
commit 03779582ad
3 changed files with 8 additions and 7 deletions

View File

@ -7,7 +7,9 @@ import java.util.Map;
import org.gcube.application.geoportalcommon.shared.ItemField; import org.gcube.application.geoportalcommon.shared.ItemField;
import org.gcube.application.geoportalcommon.shared.SearchingFilter; import org.gcube.application.geoportalcommon.shared.SearchingFilter;
import org.gcube.application.geoportalcommon.shared.SearchingFilter.LOGICAL_OP;
import org.gcube.application.geoportalcommon.shared.SearchingFilter.ORDER; import org.gcube.application.geoportalcommon.shared.SearchingFilter.ORDER;
import org.gcube.application.geoportalcommon.shared.WhereClause;
import org.gcube.application.geoportalcommon.shared.config.ACTION_ON_ITEM; import org.gcube.application.geoportalcommon.shared.config.ACTION_ON_ITEM;
import org.gcube.application.geoportalcommon.shared.products.ConcessioneDV; import org.gcube.application.geoportalcommon.shared.products.ConcessioneDV;
import org.gcube.portlets.user.geoportaldataentry.client.ConstantsGeoPortalDataEntryApp.RECORD_TYPE; import org.gcube.portlets.user.geoportaldataentry.client.ConstantsGeoPortalDataEntryApp.RECORD_TYPE;
@ -438,7 +440,10 @@ public class GeonaMainTabPanel extends Composite {
} }
} }
searchInto.put(searchForField, searchText); searchInto.put(searchForField, searchText);
searchingFilter.setSearchInto(searchInto); WhereClause where = new WhereClause();
where.setSearchInto(searchInto);
where.setOperator(LOGICAL_OP.OR);
searchingFilter.setConditions(Arrays.asList(where));
} }
return searchingFilter; return searchingFilter;
} }

View File

@ -426,8 +426,6 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
SessionUtil.getCurrentContext(getThreadLocalRequest(), true); SessionUtil.getCurrentContext(getThreadLocalRequest(), true);
MongoServiceCommon serviceCommon = new MongoServiceCommon(); MongoServiceCommon serviceCommon = new MongoServiceCommon();
// MongoServiceUtil serviceUtil = new MongoServiceUtil();
// MongoConcessioni clientMongo = serviceUtil.getInstanceMongoConcessioni();
// TODO MUST BE REPLACED BY COUNT // TODO MUST BE REPLACED BY COUNT
List<Concessione> listOfConcessioni = SessionUtil.getListOfConcessioni(getThreadLocalRequest(), List<Concessione> listOfConcessioni = SessionUtil.getListOfConcessioni(getThreadLocalRequest(),

View File

@ -16,10 +16,8 @@ import org.gcube.application.geoportal.common.model.rest.QueryRequest.OrderedReq
import org.gcube.application.geoportal.common.model.rest.QueryRequest.OrderedRequest.Direction; import org.gcube.application.geoportal.common.model.rest.QueryRequest.OrderedRequest.Direction;
import org.gcube.application.geoportal.common.model.rest.QueryRequest.PagedRequest; import org.gcube.application.geoportal.common.model.rest.QueryRequest.PagedRequest;
import org.gcube.application.geoportal.common.rest.MongoConcessioni; import org.gcube.application.geoportal.common.rest.MongoConcessioni;
import org.gcube.application.geoportalcommon.config.GNADataConfigProfileReader;
import org.gcube.common.authorization.library.provider.SecurityTokenProvider; import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
import org.gcube.common.scope.api.ScopeProvider; import org.gcube.common.scope.api.ScopeProvider;
import org.junit.Before;
import com.mongodb.BasicDBList; import com.mongodb.BasicDBList;
import com.mongodb.BasicDBObject; import com.mongodb.BasicDBObject;
@ -31,7 +29,7 @@ public class TestClass {
private static String CONTEXT = "/gcube/devsec/devVRE"; private static String CONTEXT = "/gcube/devsec/devVRE";
private static String USERNAME = "francesco.mangiacrapa"; private static String USERNAME = "francesco.mangiacrapa";
@Before //@Before
public void init() { public void init() {
ScopeProvider.instance.set(CONTEXT); ScopeProvider.instance.set(CONTEXT);
SecurityTokenProvider.instance.set(TOKEN); SecurityTokenProvider.instance.set(TOKEN);
@ -55,7 +53,7 @@ public class TestClass {
} }
} }
// @Test //@Test
public void queryConcessioniTest() throws Exception { public void queryConcessioniTest() throws Exception {
try { try {
MongoConcessioni clientMongo = mongoConcessioni().build(); MongoConcessioni clientMongo = mongoConcessioni().build();