In progress on listing
This commit is contained in:
parent
9e8aede170
commit
19448bd349
|
@ -25,7 +25,6 @@ import org.gcube.application.geoportalcommon.shared.geoportal.config.GcubeProfil
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.config.ItemFieldDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.config.ItemFieldDV;
|
||||||
import org.gcube.application.geoportalcommon.shared.products.ConcessioneDV;
|
import org.gcube.application.geoportalcommon.shared.products.ConcessioneDV;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.ConstantsGeoPortalDataEntryApp.ACTION_PERFORMED_ON_ITEM;
|
import org.gcube.portlets.user.geoportaldataentry.client.ConstantsGeoPortalDataEntryApp.ACTION_PERFORMED_ON_ITEM;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.ConstantsGeoPortalDataEntryApp.RECORD_TYPE;
|
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.events.ActionOnItemEvent;
|
import org.gcube.portlets.user.geoportaldataentry.client.events.ActionOnItemEvent;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.events.ActionOnItemEventHandler;
|
import org.gcube.portlets.user.geoportaldataentry.client.events.ActionOnItemEventHandler;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.events.ActionPerformedOnItemEvent;
|
import org.gcube.portlets.user.geoportaldataentry.client.events.ActionPerformedOnItemEvent;
|
||||||
|
@ -41,11 +40,8 @@ import org.gcube.portlets.user.geoportaldataentry.client.events.TreeItemEventHan
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.resource.Images;
|
import org.gcube.portlets.user.geoportaldataentry.client.resource.Images;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.ui.GeonaMainTabPanel;
|
import org.gcube.portlets.user.geoportaldataentry.client.ui.GeonaMainTabPanel;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.ui.GeonaRecordsPaginatedView;
|
import org.gcube.portlets.user.geoportaldataentry.client.ui.GeonaRecordsPaginatedView;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.ui.ModalWindow;
|
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.ui.card.GeoNaFormCardModel;
|
import org.gcube.portlets.user.geoportaldataentry.client.ui.card.GeoNaFormCardModel;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.ui.edit.EditModeRecord;
|
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.ui.form.GeonaDataEntryMainForm;
|
import org.gcube.portlets.user.geoportaldataentry.client.ui.form.GeonaDataEntryMainForm;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.ui.report.BuildValidationReport;
|
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.ui.report.ReportTemplateToHTML;
|
import org.gcube.portlets.user.geoportaldataentry.client.ui.report.ReportTemplateToHTML;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.ui.tree.NodeItem;
|
import org.gcube.portlets.user.geoportaldataentry.client.ui.tree.NodeItem;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.ui.tree.TreeItemPanel;
|
import org.gcube.portlets.user.geoportaldataentry.client.ui.tree.TreeItemPanel;
|
||||||
|
@ -54,7 +50,6 @@ import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.DialogInform;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.HTMLUtil;
|
import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.HTMLUtil;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.HTMLUtil.HTML_TAG;
|
import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.HTMLUtil.HTML_TAG;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.LoaderIcon;
|
import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.LoaderIcon;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.NewBrowserWindow;
|
|
||||||
import org.gcube.portlets.user.geoportaldataentry.shared.CommitReport;
|
import org.gcube.portlets.user.geoportaldataentry.shared.CommitReport;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.shared.GNADataEntryExtConfigProfile;
|
import org.gcube.portlets.user.geoportaldataentry.shared.GNADataEntryExtConfigProfile;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.shared.GeoNaFormDataObject;
|
import org.gcube.portlets.user.geoportaldataentry.shared.GeoNaFormDataObject;
|
||||||
|
@ -228,6 +223,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(GNADataEntryExtConfigProfile gNADataEntryConfig) {
|
public void onSuccess(GNADataEntryExtConfigProfile gNADataEntryConfig) {
|
||||||
|
GWT.log(GNADataEntryExtConfigProfile.class.getSimpleName() + " loaded: "+gNADataEntryConfig);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
RootPanel.get(DIV_PORTLET_ID).remove(loader);
|
RootPanel.get(DIV_PORTLET_ID).remove(loader);
|
||||||
|
@ -337,6 +333,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(List<UseCaseDescriptorDV> result) {
|
public void onSuccess(List<UseCaseDescriptorDV> result) {
|
||||||
|
GWT.log("UseCaseDescriptorDV loaded: "+result);
|
||||||
listUCDescriptors = result;
|
listUCDescriptors = result;
|
||||||
GWT.log("List<UseCaseDescriptorDV>: " + listUCDescriptors);
|
GWT.log("List<UseCaseDescriptorDV>: " + listUCDescriptors);
|
||||||
listUCDescriptors = result;
|
listUCDescriptors = result;
|
||||||
|
@ -874,10 +871,10 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onGetList(GetListOfRecordsEvent getListOfRecordsEvent) {
|
public void onGetList(GetListOfRecordsEvent getListOfRecordsEvent) {
|
||||||
|
|
||||||
SearchingFilter sortFilter = getListOfRecordsEvent.getSortFilter();
|
SearchingFilter sortFilter = getListOfRecordsEvent.getSortFilter();
|
||||||
List<ItemFieldDV> displayFields = mainTabPanel.getDisplayFields();
|
List<ItemFieldDV> displayFields = mainTabPanel.getDisplayFields();
|
||||||
|
|
||||||
if (sortFilter == null) {
|
if (sortFilter == null) {
|
||||||
sortFilter = mainTabPanel.getCurrentSortFilter();
|
sortFilter = mainTabPanel.getCurrentSortFilter();
|
||||||
}
|
}
|
||||||
|
@ -887,21 +884,29 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Resetting filtering parameters (e.g. search for, order by, etc.)
|
||||||
if (getListOfRecordsEvent.isReloadFilteringParameters()) {
|
if (getListOfRecordsEvent.isReloadFilteringParameters()) {
|
||||||
|
|
||||||
displayFields = new ArrayList<ItemFieldDV>();
|
displayFields = new ArrayList<ItemFieldDV>();
|
||||||
List<ItemFieldDV> searchByFields = new ArrayList<ItemFieldDV>();
|
List<ItemFieldDV> searchByFields = new ArrayList<ItemFieldDV>();
|
||||||
List<ItemFieldDV> sortByFields = new ArrayList<ItemFieldDV>();
|
List<ItemFieldDV> sortByFields = new ArrayList<ItemFieldDV>();
|
||||||
List<ConfigurationDV<?>> config = mapHandlersForProfileId.get(getListOfRecordsEvent.getProfileID());
|
List<ConfigurationDV<?>> config = mapHandlersForProfileId.get(getListOfRecordsEvent.getProfileID());
|
||||||
|
|
||||||
for (ConfigurationDV<?> configurationDV : config) {
|
for (ConfigurationDV<?> configurationDV : config) {
|
||||||
switch (configurationDV.getConfigurationType()) {
|
switch (configurationDV.getConfigurationType()) {
|
||||||
case item_fields:
|
case item_fields:
|
||||||
List<ItemFieldDV> listItemFields = (List<ItemFieldDV>) configurationDV.getConfiguration();
|
List<ItemFieldDV> listItemFields = (List<ItemFieldDV>) configurationDV.getConfiguration();
|
||||||
|
|
||||||
|
// The projection
|
||||||
|
Map<String, Object> projection = new HashMap<String, Object>();
|
||||||
|
|
||||||
for (ItemFieldDV itemField : listItemFields) {
|
for (ItemFieldDV itemField : listItemFields) {
|
||||||
if (itemField.isDisplayAsResult()) {
|
if (itemField.isDisplayAsResult()) {
|
||||||
displayFields.add(itemField);
|
displayFields.add(itemField);
|
||||||
|
// adding to projection for filtering
|
||||||
|
for (String jsonField : itemField.getJsonFields()) {
|
||||||
|
projection.put("_theDocument." + jsonField, 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (itemField.isSearchable()) {
|
if (itemField.isSearchable()) {
|
||||||
|
@ -912,8 +917,10 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
||||||
sortByFields.add(itemField);
|
sortByFields.add(itemField);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mainTabPanel.setFilteringParameters(displayFields, sortByFields, sortByFields, sortFilter);
|
sortFilter.setProjection(projection);
|
||||||
|
|
||||||
|
mainTabPanel.setFilteringParameters(displayFields, sortByFields, searchByFields, sortFilter);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -921,12 +928,12 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
grpw = new GeonaRecordsPaginatedView(appManagerBus, profileID, displayFields, sortFilter);
|
grpw = new GeonaRecordsPaginatedView(appManagerBus, profileID, displayFields, sortFilter);
|
||||||
|
|
||||||
mainTabPanel.showListOfConcessioniView(grpw);
|
mainTabPanel.showListOfConcessioniView(grpw);
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1006,11 +1013,8 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (item instanceof DocumentDV) {
|
if (item instanceof DocumentDV) {
|
||||||
|
|
||||||
|
|
||||||
Window.alert("ACTION MUST BE REVISITED");
|
Window.alert("ACTION MUST BE REVISITED");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// final DocumentDV concessione = (DocumentDV) item;
|
// final DocumentDV concessione = (DocumentDV) item;
|
||||||
// GWT.log("onDoActionFired item: " + concessione);
|
// GWT.log("onDoActionFired item: " + concessione);
|
||||||
|
@ -1187,10 +1191,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
||||||
// break;
|
// break;
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,6 @@ import java.util.List;
|
||||||
|
|
||||||
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.geoportal.DocumentDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.DocumentDV;
|
||||||
import org.gcube.application.geoportalcommon.shared.products.model.RecordDV;
|
|
||||||
|
|
||||||
import com.google.gwt.event.shared.GwtEvent;
|
import com.google.gwt.event.shared.GwtEvent;
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,6 @@ import org.gcube.application.geoportalcommon.shared.geoportal.HandlerDeclaration
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.UseCaseDescriptorDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.UseCaseDescriptorDV;
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.config.GcubeProfileDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.config.GcubeProfileDV;
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.config.ItemFieldDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.config.ItemFieldDV;
|
||||||
import org.gcube.application.geoportalcommon.shared.products.ConcessioneDV;
|
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.events.CreateNewProjectEvent;
|
import org.gcube.portlets.user.geoportaldataentry.client.events.CreateNewProjectEvent;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.events.GetListOfRecordsEvent;
|
import org.gcube.portlets.user.geoportaldataentry.client.events.GetListOfRecordsEvent;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.ui.form.GeonaDataEntryMainForm;
|
import org.gcube.portlets.user.geoportaldataentry.client.ui.form.GeonaDataEntryMainForm;
|
||||||
|
@ -203,14 +202,79 @@ public class GeonaMainTabPanel extends Composite {
|
||||||
* @param initialSortFilter the initial sort filter
|
* @param initialSortFilter the initial sort filter
|
||||||
*/
|
*/
|
||||||
public void setFilteringParameters(List<ItemFieldDV> displayFields, List<ItemFieldDV> sortByFields,
|
public void setFilteringParameters(List<ItemFieldDV> displayFields, List<ItemFieldDV> sortByFields,
|
||||||
List<ItemFieldDV> searchForFields, SearchingFilter initialSortFilter) {
|
List<ItemFieldDV> searchForFields, SearchingFilter sortFilter) {
|
||||||
this.displayFields = displayFields;
|
this.displayFields = displayFields;
|
||||||
this.sortByFields = sortByFields;
|
this.sortByFields = sortByFields;
|
||||||
this.currentSortFilter = initialSortFilter;
|
|
||||||
this.searchForFields = searchForFields;
|
this.searchForFields = searchForFields;
|
||||||
|
this.currentSortFilter = sortFilter;
|
||||||
|
|
||||||
alertSearchFor.setText(searchForFields.get(0).getDisplayName());
|
alertSearchFor.clear();
|
||||||
alertSortBy.setText(toLabelFilter((initialSortFilter.getOrderByFields().get(0)), initialSortFilter.getOrder()));
|
dropdownSearchFor.clear();
|
||||||
|
//alertSearchFor.setText(searchForFields.get(0).getDisplayName());
|
||||||
|
alertSortBy.setText(toLabelFilter((sortFilter.getOrderByFields().get(0)), sortFilter.getOrder()));
|
||||||
|
|
||||||
|
for (ItemFieldDV record_FIELD : searchForFields) {
|
||||||
|
|
||||||
|
NavLink nav = new NavLink(record_FIELD.getDisplayName());
|
||||||
|
dropdownSearchFor.add(nav);
|
||||||
|
|
||||||
|
nav.addClickHandler(new ClickHandler() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(ClickEvent event) {
|
||||||
|
alertSearchFor.setText(record_FIELD.getDisplayName());
|
||||||
|
|
||||||
|
if (searchField.getText().length() >= MIN_LENGHT_SERCHING_STRING) {
|
||||||
|
doSearchEvent();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
dropdownSortBy.clear();
|
||||||
|
|
||||||
|
for (ItemFieldDV record_FIELD : sortByFields) {
|
||||||
|
|
||||||
|
// if (record_FIELD.equals(RECORD_FIELD.RECORD_STATUS))
|
||||||
|
// continue;
|
||||||
|
|
||||||
|
// ASC
|
||||||
|
String labelASC = toLabelFilter(record_FIELD, ORDER.ASC);
|
||||||
|
NavLink nav = new NavLink(labelASC);
|
||||||
|
dropdownSortBy.add(nav);
|
||||||
|
|
||||||
|
nav.addClickHandler(new ClickHandler() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(ClickEvent event) {
|
||||||
|
alertSortBy.setText(labelASC);
|
||||||
|
Window.alert("ASC MUST BE REVISITED");
|
||||||
|
/*
|
||||||
|
* appManagerBus.fireEvent(new GetListOfRecordsEvent(RECORD_TYPE.CONCESSIONE,
|
||||||
|
* getCurrentSortFilter()));
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// //DESC
|
||||||
|
String labelDESC = toLabelFilter(record_FIELD, ORDER.DESC);
|
||||||
|
NavLink nav2 = new NavLink(labelDESC);
|
||||||
|
dropdownSortBy.add(nav2);
|
||||||
|
|
||||||
|
nav2.addClickHandler(new ClickHandler() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(ClickEvent event) {
|
||||||
|
alertSortBy.setText(labelDESC);
|
||||||
|
Window.alert("DESC MUST BE REVISITED");
|
||||||
|
/*
|
||||||
|
* appManagerBus.fireEvent(new GetListOfRecordsEvent(RECORD_TYPE.CONCESSIONE,
|
||||||
|
* getCurrentSortFilter()));
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -259,66 +323,66 @@ public class GeonaMainTabPanel extends Composite {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
for (ItemFieldDV record_FIELD : sortByFields) {
|
// for (ItemFieldDV record_FIELD : sortByFields) {
|
||||||
|
//
|
||||||
|
//// if (record_FIELD.equals(RECORD_FIELD.RECORD_STATUS))
|
||||||
|
//// continue;
|
||||||
|
//
|
||||||
|
// // ASC
|
||||||
|
// String labelASC = toLabelFilter(record_FIELD, ORDER.ASC);
|
||||||
|
// NavLink nav = new NavLink(labelASC);
|
||||||
|
// dropdownSortBy.add(nav);
|
||||||
|
//
|
||||||
|
// nav.addClickHandler(new ClickHandler() {
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onClick(ClickEvent event) {
|
||||||
|
// alertSortBy.setText(labelASC);
|
||||||
|
// Window.alert("ASC MUST BE REVISITED");
|
||||||
|
// /*
|
||||||
|
// * appManagerBus.fireEvent(new GetListOfRecordsEvent(RECORD_TYPE.CONCESSIONE,
|
||||||
|
// * getCurrentSortFilter()));
|
||||||
|
// */
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
//
|
||||||
|
//// //DESC
|
||||||
|
// String labelDESC = toLabelFilter(record_FIELD, ORDER.DESC);
|
||||||
|
// NavLink nav2 = new NavLink(labelDESC);
|
||||||
|
// dropdownSortBy.add(nav2);
|
||||||
|
//
|
||||||
|
// nav2.addClickHandler(new ClickHandler() {
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onClick(ClickEvent event) {
|
||||||
|
// alertSortBy.setText(labelDESC);
|
||||||
|
// Window.alert("DESC MUST BE REVISITED");
|
||||||
|
// /*
|
||||||
|
// * appManagerBus.fireEvent(new GetListOfRecordsEvent(RECORD_TYPE.CONCESSIONE,
|
||||||
|
// * getCurrentSortFilter()));
|
||||||
|
// */
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
|
||||||
// if (record_FIELD.equals(RECORD_FIELD.RECORD_STATUS))
|
// for (ItemFieldDV record_FIELD : searchForFields) {
|
||||||
// continue;
|
//
|
||||||
|
// NavLink nav = new NavLink(record_FIELD.getDisplayName());
|
||||||
// ASC
|
// dropdownSearchFor.add(nav);
|
||||||
String labelASC = toLabelFilter(record_FIELD, ORDER.ASC);
|
//
|
||||||
NavLink nav = new NavLink(labelASC);
|
// nav.addClickHandler(new ClickHandler() {
|
||||||
dropdownSortBy.add(nav);
|
//
|
||||||
|
// @Override
|
||||||
nav.addClickHandler(new ClickHandler() {
|
// public void onClick(ClickEvent event) {
|
||||||
|
// alertSearchFor.setText(record_FIELD.getDisplayName());
|
||||||
@Override
|
//
|
||||||
public void onClick(ClickEvent event) {
|
// if (searchField.getText().length() >= MIN_LENGHT_SERCHING_STRING) {
|
||||||
alertSortBy.setText(labelASC);
|
// doSearchEvent();
|
||||||
Window.alert("ASC MUST BE REVISITED");
|
// }
|
||||||
/*
|
//
|
||||||
* appManagerBus.fireEvent(new GetListOfRecordsEvent(RECORD_TYPE.CONCESSIONE,
|
// }
|
||||||
* getCurrentSortFilter()));
|
// });
|
||||||
*/
|
// }
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// //DESC
|
|
||||||
String labelDESC = toLabelFilter(record_FIELD, ORDER.DESC);
|
|
||||||
NavLink nav2 = new NavLink(labelDESC);
|
|
||||||
dropdownSortBy.add(nav2);
|
|
||||||
|
|
||||||
nav2.addClickHandler(new ClickHandler() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onClick(ClickEvent event) {
|
|
||||||
alertSortBy.setText(labelDESC);
|
|
||||||
Window.alert("DESC MUST BE REVISITED");
|
|
||||||
/*
|
|
||||||
* appManagerBus.fireEvent(new GetListOfRecordsEvent(RECORD_TYPE.CONCESSIONE,
|
|
||||||
* getCurrentSortFilter()));
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
for (ItemFieldDV record_FIELD : searchForFields) {
|
|
||||||
|
|
||||||
NavLink nav = new NavLink(record_FIELD.getDisplayName());
|
|
||||||
dropdownSearchFor.add(nav);
|
|
||||||
|
|
||||||
nav.addClickHandler(new ClickHandler() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onClick(ClickEvent event) {
|
|
||||||
alertSearchFor.setText(record_FIELD.getDisplayName());
|
|
||||||
|
|
||||||
if (searchField.getText().length() >= MIN_LENGHT_SERCHING_STRING) {
|
|
||||||
doSearchEvent();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
navShowOnMap.addClickHandler(new ClickHandler() {
|
navShowOnMap.addClickHandler(new ClickHandler() {
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
package org.gcube.portlets.user.geoportaldataentry.client.ui;
|
package org.gcube.portlets.user.geoportaldataentry.client.ui;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.gcube.application.geoportalcommon.shared.ResultSetPaginatedData;
|
import org.gcube.application.geoportalcommon.shared.ResultSetPaginatedData;
|
||||||
import org.gcube.application.geoportalcommon.shared.SearchingFilter;
|
import org.gcube.application.geoportalcommon.shared.SearchingFilter;
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.DocumentDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.DocumentDV;
|
||||||
|
import org.gcube.application.geoportalcommon.shared.geoportal.ProjectDV;
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.config.ItemFieldDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.config.ItemFieldDV;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.GeoPortalDataEntryApp;
|
import org.gcube.portlets.user.geoportaldataentry.client.GeoPortalDataEntryApp;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.ui.table.ItemsTable;
|
import org.gcube.portlets.user.geoportaldataentry.client.ui.table.ItemsTable;
|
||||||
|
@ -38,7 +40,7 @@ import com.google.gwt.view.client.SingleSelectionModel;
|
||||||
public class GeonaRecordsPaginatedView {
|
public class GeonaRecordsPaginatedView {
|
||||||
|
|
||||||
private static final int ITEM_START_INDEX = 0;
|
private static final int ITEM_START_INDEX = 0;
|
||||||
private static final int ITEMS_PER_PAGE = 30;
|
private static final int ITEMS_PER_PAGE = 10;
|
||||||
private VerticalPanel vPanel = new VerticalPanel();
|
private VerticalPanel vPanel = new VerticalPanel();
|
||||||
private FlowPanel pagerPanel = new FlowPanel();
|
private FlowPanel pagerPanel = new FlowPanel();
|
||||||
private Boolean initClassFirstRangeChanged = false;
|
private Boolean initClassFirstRangeChanged = false;
|
||||||
|
@ -171,8 +173,7 @@ public class GeonaRecordsPaginatedView {
|
||||||
getTableDataProvider().updateRowCount((int) result.getTotalItems(), true);
|
getTableDataProvider().updateRowCount((int) result.getTotalItems(), true);
|
||||||
|
|
||||||
// TODO MUST USE PROJECT
|
// TODO MUST USE PROJECT
|
||||||
// getTableDataProvider().updateRowData(result.getClientStartIndex(),
|
getTableDataProvider().updateRowData(result.getClientStartIndex(), toListDocumentDV(result.getData()));
|
||||||
// result.getData());
|
|
||||||
|
|
||||||
if (result.getData().size() == 0) {
|
if (result.getData().size() == 0) {
|
||||||
getCellTable().setLoadingIndicator(new Label("No data"));
|
getCellTable().setLoadingIndicator(new Label("No data"));
|
||||||
|
@ -192,6 +193,18 @@ public class GeonaRecordsPaginatedView {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private List<DocumentDV> toListDocumentDV(List<ProjectDV> data) {
|
||||||
|
if (data == null)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
List<DocumentDV> listDocuments = new ArrayList<DocumentDV>(data.size());
|
||||||
|
for (ProjectDV projectDV : data) {
|
||||||
|
listDocuments.add(projectDV.getTheDocument());
|
||||||
|
}
|
||||||
|
|
||||||
|
return listDocuments;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load projects.
|
* Load projects.
|
||||||
*
|
*
|
||||||
|
@ -246,7 +259,8 @@ public class GeonaRecordsPaginatedView {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the select items.
|
* Gets the select items.
|
||||||
* @return
|
*
|
||||||
|
* @return
|
||||||
*
|
*
|
||||||
* @return the select items
|
* @return the select items
|
||||||
*/
|
*/
|
||||||
|
@ -329,7 +343,7 @@ public class GeonaRecordsPaginatedView {
|
||||||
public FlowPanel getPagerPanel() {
|
public FlowPanel getPagerPanel() {
|
||||||
return pagerPanel;
|
return pagerPanel;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getProfileID() {
|
public String getProfileID() {
|
||||||
return profileID;
|
return profileID;
|
||||||
}
|
}
|
||||||
|
|
|
@ -385,6 +385,8 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
|
||||||
|
|
||||||
ProjectDVBuilder projectBuilder = ProjectDVBuilder.newBuilder().fullDocumentMap(true);
|
ProjectDVBuilder projectBuilder = ProjectDVBuilder.newBuilder().fullDocumentMap(true);
|
||||||
|
|
||||||
|
//TODO Must be completed. Waiting for https://support.d4science.org/issues/22487
|
||||||
|
/*
|
||||||
if (reloadFromService || listProjectDV == null) {
|
if (reloadFromService || listProjectDV == null) {
|
||||||
List<Project> listProject = client.getListForProfileID(theProfileID);
|
List<Project> listProject = client.getListForProfileID(theProfileID);
|
||||||
|
|
||||||
|
@ -394,10 +396,15 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
|
||||||
}
|
}
|
||||||
SessionUtil.setListOfProjectsForProfileID(getThreadLocalRequest(), theProfileID, listProjectDV);
|
SessionUtil.setListOfProjectsForProfileID(getThreadLocalRequest(), theProfileID, listProjectDV);
|
||||||
}
|
}
|
||||||
|
int listProjectSize = listProjectDV.size();
|
||||||
|
*/
|
||||||
|
|
||||||
int listConcessioniSize = listProjectDV.size();
|
|
||||||
|
|
||||||
ResultSetPaginatedData searchedData = client.queryOnMongo(theProfileID, listConcessioniSize, start, limit,
|
int listProjectSize = 50;
|
||||||
|
LOG.info("WARN HARD_CODING COUNT: "+listProjectSize);
|
||||||
|
|
||||||
|
ResultSetPaginatedData searchedData = client.queryOnMongo(theProfileID, listProjectSize, start, limit,
|
||||||
filter, projectBuilder);
|
filter, projectBuilder);
|
||||||
|
|
||||||
// public ResultSetPaginatedData queryOnMongo(String profileID, Integer totalItems, Integer offset, Integer limit,
|
// public ResultSetPaginatedData queryOnMongo(String profileID, Integer totalItems, Integer offset, Integer limit,
|
||||||
|
|
Loading…
Reference in New Issue