feature_22286 #6

Merged
francesco.mangiacrapa merged 16 commits from feature_22286 into master 2022-01-13 17:02:39 +01:00
5 changed files with 49 additions and 18 deletions
Showing only changes of commit 62f41a960d - Show all commits

View File

@ -188,8 +188,8 @@ public class GeonaMainTabPanel extends Composite {
for (RECORD_FIELD record_FIELD : sortByFields) { for (RECORD_FIELD record_FIELD : sortByFields) {
if (record_FIELD.equals(RECORD_FIELD.RECORD_STATUS)) // if (record_FIELD.equals(RECORD_FIELD.RECORD_STATUS))
continue; // continue;
// ASC // ASC
String labelASC = toLabelFilter(record_FIELD, ORDER.ASC); String labelASC = toLabelFilter(record_FIELD, ORDER.ASC);

View File

@ -51,7 +51,7 @@
</ui:style> </ui:style>
<g:HTMLPanel> <g:HTMLPanel>
<b:PageHeader subtext="data entry facility" <b:PageHeader subtext="data entry facility"
styleName="{style.custom-page-header}">GeoNa</b:PageHeader> styleName="{style.custom-page-header}">GNA</b:PageHeader>
<b:TabPanel tabPosition="above" ui:field="tabPanel"> <b:TabPanel tabPosition="above" ui:field="tabPanel">
<b:Tab icon="FILE_TEXT" heading="New Project" active="true" <b:Tab icon="FILE_TEXT" heading="New Project" active="true"
ui:field="tabNewProject"> ui:field="tabNewProject">

View File

@ -211,9 +211,28 @@ public class ItemsTable<T extends ConcessioneDV> extends AbstractItemsCellTable<
if (object == null) if (object == null)
return ""; return "";
Date dS = (((ConcessioneDV) object).getDataInizioProgetto()); Date dS = null;
Date dE = (((ConcessioneDV) object).getDataFineProgetto()); Date dE = null;
return dtformat.format(dS) + " / " + dtformat.format(dE); if(object.getDataInizioProgetto()!=null) {
dS = (((ConcessioneDV) object).getDataInizioProgetto());
}
if(object.getDataFineProgetto()!=null) {
dE = (((ConcessioneDV) object).getDataFineProgetto());
}
String dateFormat = "";
if(dS!=null) {
dateFormat+=dtformat.format(dS);
}
dateFormat+=" / ";
if(dE!=null) {
dateFormat+=dtformat.format(dE);
}
return dateFormat;
} }
}; };

View File

@ -62,6 +62,7 @@ import org.slf4j.LoggerFactory;
import com.google.gwt.user.server.rpc.RemoteServiceServlet; import com.google.gwt.user.server.rpc.RemoteServiceServlet;
import com.mongodb.BasicDBObject; import com.mongodb.BasicDBObject;
import com.mongodb.BasicDBObjectBuilder;
/** /**
* The server side implementation of the RPC service. * The server side implementation of the RPC service.
@ -501,7 +502,7 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
fields.add("dataFineProgetto"); fields.add("dataFineProgetto");
break; break;
case RECORD_STATUS: case RECORD_STATUS:
fields.add("report:status"); fields.add("report.status");
// statusComparator = new ConcessioneValidationReportStatusComparator(); // statusComparator = new ConcessioneValidationReportStatusComparator();
default: default:
break; break;
@ -518,17 +519,27 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
ordering.setFields(fields); ordering.setFields(fields);
request.setOrdering(ordering); request.setOrdering(ordering);
Document query = null;
if(filter.getSearchInto()!=null) { if(filter.getSearchInto()!=null) {
Map<String, Object> searchFields = filter.getSearchInto(); Map<String, Object> searchFields = filter.getSearchInto();
//List<BasicDBObject> list = new ArrayList<BasicDBObject>(); //List<BasicDBObject> list = new ArrayList<BasicDBObject>();
//Map map = new HashMap<BasicDBObject, BasicDBObject>(); //Map map = new HashMap<BasicDBObject, BasicDBObject>();
Document query = new Document();
BasicDBObjectBuilder builder = BasicDBObjectBuilder.start();
for (String key : searchFields.keySet()) { for (String key : searchFields.keySet()) {
query.put(key, searchFields.get(key)); // query.put(key, searchFields.get(key));
query.put(key, new BasicDBObject("$eq", searchFields.get(key))); // query.put(key, new BasicDBObject("$eq", searchFields.get(key)));
}
BasicDBObject bs = new BasicDBObject();
bs.append("$regex", searchFields.get(key));
bs.append("$options", "i");
builder.append(key, bs);
}
query = new Document(builder.get().toMap());
// BasicDBList list = new BasicDBList();
// list.add(builder.get().toMap());
// query.put("$and", list);
//or(query);
request.setFilter(query); request.setFilter(query);
} }
@ -536,6 +547,9 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
LOG.info("Direction: " + sDirection); LOG.info("Direction: " + sDirection);
LOG.info("Order by Fields: " + fields); LOG.info("Order by Fields: " + fields);
LOG.info("Search for: " + filter.getSearchInto()); LOG.info("Search for: " + filter.getSearchInto());
if(query!=null) {
LOG.info("Search query to JSON: " + query.toJson());
}
Iterator<Concessione> concessioni = clientMongo.query(request); Iterator<Concessione> concessioni = clientMongo.query(request);
while (concessioni.hasNext()) { while (concessioni.hasNext()) {
@ -545,6 +559,9 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
} }
searchedData.setData(toReturnList); searchedData.setData(toReturnList);
if(filter.getSearchInto()!=null){
searchedData.setTotalItems(toReturnList.size());
}
if (listConcessioniSize == limit || listConcessioniSize == 0) { if (listConcessioniSize == limit || listConcessioniSize == 0) {
LOG.debug("Page completed returning " + listConcessioniSize + " items"); LOG.debug("Page completed returning " + listConcessioniSize + " items");
@ -904,7 +921,7 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
// DEV MODE // DEV MODE
if (!SessionUtil.isIntoPortal()) { if (!SessionUtil.isIntoPortal()) {
LOG.warn("OUT OF PORTAL - DEV MODE detected"); LOG.warn("OUT OF PORTAL - DEV MODE detected");
GcubeUserRole myRole = GcubeUserRole.DATA_MEMBER; GcubeUserRole myRole = GcubeUserRole.DATA_MANAGER;
for (RoleRights roleRight : listUserRightsForRole) { for (RoleRights roleRight : listUserRightsForRole) {
if (roleRight.getUserRole().equals(myRole)) { if (roleRight.getUserRole().equals(myRole)) {

View File

@ -1,5 +0,0 @@
package org.gcube.portlets.user.geoportaldataentry.shared;
public class ActionOnItemType {
}