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.products.ConcessioneDV;
|
||||
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.ActionOnItemEventHandler;
|
||||
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.ui.GeonaMainTabPanel;
|
||||
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.edit.EditModeRecord;
|
||||
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.tree.NodeItem;
|
||||
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.HTML_TAG;
|
||||
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.GNADataEntryExtConfigProfile;
|
||||
import org.gcube.portlets.user.geoportaldataentry.shared.GeoNaFormDataObject;
|
||||
|
@ -228,6 +223,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
|||
|
||||
@Override
|
||||
public void onSuccess(GNADataEntryExtConfigProfile gNADataEntryConfig) {
|
||||
GWT.log(GNADataEntryExtConfigProfile.class.getSimpleName() + " loaded: "+gNADataEntryConfig);
|
||||
|
||||
try {
|
||||
RootPanel.get(DIV_PORTLET_ID).remove(loader);
|
||||
|
@ -337,6 +333,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
|||
|
||||
@Override
|
||||
public void onSuccess(List<UseCaseDescriptorDV> result) {
|
||||
GWT.log("UseCaseDescriptorDV loaded: "+result);
|
||||
listUCDescriptors = result;
|
||||
GWT.log("List<UseCaseDescriptorDV>: " + listUCDescriptors);
|
||||
listUCDescriptors = result;
|
||||
|
@ -887,6 +884,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
|||
return;
|
||||
}
|
||||
|
||||
// Resetting filtering parameters (e.g. search for, order by, etc.)
|
||||
if (getListOfRecordsEvent.isReloadFilteringParameters()) {
|
||||
|
||||
displayFields = new ArrayList<ItemFieldDV>();
|
||||
|
@ -899,9 +897,16 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
|||
case item_fields:
|
||||
List<ItemFieldDV> listItemFields = (List<ItemFieldDV>) configurationDV.getConfiguration();
|
||||
|
||||
// The projection
|
||||
Map<String, Object> projection = new HashMap<String, Object>();
|
||||
|
||||
for (ItemFieldDV itemField : listItemFields) {
|
||||
if (itemField.isDisplayAsResult()) {
|
||||
displayFields.add(itemField);
|
||||
// adding to projection for filtering
|
||||
for (String jsonField : itemField.getJsonFields()) {
|
||||
projection.put("_theDocument." + jsonField, 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (itemField.isSearchable()) {
|
||||
|
@ -913,7 +918,9 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
|||
}
|
||||
}
|
||||
|
||||
mainTabPanel.setFilteringParameters(displayFields, sortByFields, sortByFields, sortFilter);
|
||||
sortFilter.setProjection(projection);
|
||||
|
||||
mainTabPanel.setFilteringParameters(displayFields, sortByFields, searchByFields, sortFilter);
|
||||
|
||||
break;
|
||||
|
||||
|
@ -1007,11 +1014,8 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
|||
|
||||
if (item instanceof DocumentDV) {
|
||||
|
||||
|
||||
Window.alert("ACTION MUST BE REVISITED");
|
||||
|
||||
|
||||
|
||||
// final DocumentDV concessione = (DocumentDV) item;
|
||||
// GWT.log("onDoActionFired item: " + concessione);
|
||||
//
|
||||
|
@ -1188,9 +1192,6 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
|||
// }
|
||||
//
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -4,7 +4,6 @@ import java.util.List;
|
|||
|
||||
import org.gcube.application.geoportalcommon.shared.config.ACTION_ON_ITEM;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.DocumentDV;
|
||||
import org.gcube.application.geoportalcommon.shared.products.model.RecordDV;
|
||||
|
||||
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.config.GcubeProfileDV;
|
||||
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.GetListOfRecordsEvent;
|
||||
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
|
||||
*/
|
||||
public void setFilteringParameters(List<ItemFieldDV> displayFields, List<ItemFieldDV> sortByFields,
|
||||
List<ItemFieldDV> searchForFields, SearchingFilter initialSortFilter) {
|
||||
List<ItemFieldDV> searchForFields, SearchingFilter sortFilter) {
|
||||
this.displayFields = displayFields;
|
||||
this.sortByFields = sortByFields;
|
||||
this.currentSortFilter = initialSortFilter;
|
||||
this.searchForFields = searchForFields;
|
||||
this.currentSortFilter = sortFilter;
|
||||
|
||||
alertSearchFor.setText(searchForFields.get(0).getDisplayName());
|
||||
alertSortBy.setText(toLabelFilter((initialSortFilter.getOrderByFields().get(0)), initialSortFilter.getOrder()));
|
||||
alertSearchFor.clear();
|
||||
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))
|
||||
// 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()));
|
||||
*/
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
// 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() {
|
||||
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
package org.gcube.portlets.user.geoportaldataentry.client.ui;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.gcube.application.geoportalcommon.shared.ResultSetPaginatedData;
|
||||
import org.gcube.application.geoportalcommon.shared.SearchingFilter;
|
||||
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.portlets.user.geoportaldataentry.client.GeoPortalDataEntryApp;
|
||||
import org.gcube.portlets.user.geoportaldataentry.client.ui.table.ItemsTable;
|
||||
|
@ -38,7 +40,7 @@ import com.google.gwt.view.client.SingleSelectionModel;
|
|||
public class GeonaRecordsPaginatedView {
|
||||
|
||||
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 FlowPanel pagerPanel = new FlowPanel();
|
||||
private Boolean initClassFirstRangeChanged = false;
|
||||
|
@ -171,8 +173,7 @@ public class GeonaRecordsPaginatedView {
|
|||
getTableDataProvider().updateRowCount((int) result.getTotalItems(), true);
|
||||
|
||||
// TODO MUST USE PROJECT
|
||||
// getTableDataProvider().updateRowData(result.getClientStartIndex(),
|
||||
// result.getData());
|
||||
getTableDataProvider().updateRowData(result.getClientStartIndex(), toListDocumentDV(result.getData()));
|
||||
|
||||
if (result.getData().size() == 0) {
|
||||
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.
|
||||
*
|
||||
|
@ -246,6 +259,7 @@ public class GeonaRecordsPaginatedView {
|
|||
|
||||
/**
|
||||
* Gets the select items.
|
||||
*
|
||||
* @return
|
||||
*
|
||||
* @return the select items
|
||||
|
|
|
@ -385,6 +385,8 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
|
|||
|
||||
ProjectDVBuilder projectBuilder = ProjectDVBuilder.newBuilder().fullDocumentMap(true);
|
||||
|
||||
//TODO Must be completed. Waiting for https://support.d4science.org/issues/22487
|
||||
/*
|
||||
if (reloadFromService || listProjectDV == null) {
|
||||
List<Project> listProject = client.getListForProfileID(theProfileID);
|
||||
|
||||
|
@ -394,10 +396,15 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
|
|||
}
|
||||
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);
|
||||
|
||||
// public ResultSetPaginatedData queryOnMongo(String profileID, Integer totalItems, Integer offset, Integer limit,
|
||||
|
|
Loading…
Reference in New Issue