|
|
|
@ -14,17 +14,13 @@ import org.gcube.application.geoportalcommon.ConvertToDataViewModel;
|
|
|
|
|
import org.gcube.application.geoportalcommon.shared.products.ConcessioneDV;
|
|
|
|
|
import org.gcube.application.geoportalcommon.shared.products.model.ValidationReportDV;
|
|
|
|
|
import org.gcube.application.geoportalcommon.shared.products.model.ValidationReportDV.ValidationStatus;
|
|
|
|
|
import org.gcube.portlets.user.geoportaldataentry.client.ConstantsGeoPortalDataEntryApp.ACTION_ON_ITEM;
|
|
|
|
|
import org.gcube.portlets.user.geoportaldataentry.client.ConstantsGeoPortalDataEntryApp.RECORD_FIELD;
|
|
|
|
|
import org.gcube.portlets.user.geoportaldataentry.client.events.ActionOnItemEvent;
|
|
|
|
|
import org.gcube.portlets.user.geoportaldataentry.shared.SortFilter;
|
|
|
|
|
|
|
|
|
|
import com.github.gwtbootstrap.client.ui.ButtonCell;
|
|
|
|
|
import com.github.gwtbootstrap.client.ui.Pagination;
|
|
|
|
|
import com.github.gwtbootstrap.client.ui.constants.IconType;
|
|
|
|
|
import com.google.gwt.cell.client.Cell.Context;
|
|
|
|
|
import com.google.gwt.cell.client.DateCell;
|
|
|
|
|
import com.google.gwt.cell.client.FieldUpdater;
|
|
|
|
|
import com.google.gwt.core.shared.GWT;
|
|
|
|
|
import com.google.gwt.dom.client.Style.Unit;
|
|
|
|
|
import com.google.gwt.event.shared.HandlerManager;
|
|
|
|
@ -232,7 +228,7 @@ public class ItemsTable<T extends ConcessioneDV> extends AbstractItemsCellTable<
|
|
|
|
|
|
|
|
|
|
if (this.displayFields.contains(RECORD_FIELD.CREATED)) {
|
|
|
|
|
|
|
|
|
|
DateCell date = new DateCell(dtformat);
|
|
|
|
|
DateCell date = new DateCell(DateTimeFormat.getFormat(ConvertToDataViewModel.DATE_FORMAT+" "+ConvertToDataViewModel.TIME_FORMAT));
|
|
|
|
|
createdColumn = new Column<T, Date>(date) {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -301,7 +297,7 @@ public class ItemsTable<T extends ConcessioneDV> extends AbstractItemsCellTable<
|
|
|
|
|
sortedCellTable.setColumnWidth(insertedBy, 220, Unit.PX);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (this.displayFields.contains(RECORD_FIELD.PUBLISHING_STATUS)) {
|
|
|
|
|
if (this.displayFields.contains(RECORD_FIELD.RECORD_STATUS)) {
|
|
|
|
|
|
|
|
|
|
statusColumn = new TextColumn<T>() {
|
|
|
|
|
@Override
|
|
|
|
@ -335,69 +331,69 @@ public class ItemsTable<T extends ConcessioneDV> extends AbstractItemsCellTable<
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
sortedCellTable.addColumn(statusColumn, RECORD_FIELD.PUBLISHING_STATUS.getDisplayName(), false);
|
|
|
|
|
sortedCellTable.addColumn(statusColumn, RECORD_FIELD.RECORD_STATUS.getDisplayName(), false);
|
|
|
|
|
sortedCellTable.setColumnWidth(statusColumn, 120, Unit.PX);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ButtonCell showOnMapButton = new ButtonCell();
|
|
|
|
|
showOnMapButton.setIcon(IconType.MAP_MARKER);
|
|
|
|
|
|
|
|
|
|
MyToolTipColumn<T, String> showOnMapColumn = new MyToolTipColumn<T, String>(showOnMapButton, "Show on Map") {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String getValue(T object) {
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
showOnMapColumn.setFieldUpdater(new FieldUpdater<T, String>() {
|
|
|
|
|
@Override
|
|
|
|
|
public void update(int index, T object, String value) {
|
|
|
|
|
GWT.log("clicked show");
|
|
|
|
|
eventBus.fireEvent(new ActionOnItemEvent<T>(Arrays.asList(object), ACTION_ON_ITEM.SHOW_ON_MAP));
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
sortedCellTable.addColumn(showOnMapColumn);
|
|
|
|
|
sortedCellTable.setColumnWidth(showOnMapColumn, 50, Unit.PX);
|
|
|
|
|
|
|
|
|
|
ButtonCell showReportRecordButton = new ButtonCell();
|
|
|
|
|
showReportRecordButton.setIcon(IconType.FILE_TEXT_ALT);
|
|
|
|
|
MyToolTipColumn<T, String> showReportRecordColumn = new MyToolTipColumn<T, String>(showReportRecordButton,
|
|
|
|
|
"Show Publication Report") {
|
|
|
|
|
public String getValue(T object) {
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
showReportRecordColumn.setFieldUpdater(new FieldUpdater<T, String>() {
|
|
|
|
|
@Override
|
|
|
|
|
public void update(int index, T object, String value) {
|
|
|
|
|
|
|
|
|
|
eventBus.fireEvent(new ActionOnItemEvent<T>(Arrays.asList(object), ACTION_ON_ITEM.SHOW_REPORT));
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
sortedCellTable.addColumn(showReportRecordColumn);
|
|
|
|
|
sortedCellTable.setColumnWidth(showReportRecordColumn, 50, Unit.PX);
|
|
|
|
|
|
|
|
|
|
ButtonCell deleteRecordButton = new ButtonCell();
|
|
|
|
|
deleteRecordButton.setIcon(IconType.TRASH);
|
|
|
|
|
MyToolTipColumn<T, String> deleteRecordColumn = new MyToolTipColumn<T, String>(deleteRecordButton,
|
|
|
|
|
"Delete Project") {
|
|
|
|
|
public String getValue(T object) {
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
deleteRecordColumn.setFieldUpdater(new FieldUpdater<T, String>() {
|
|
|
|
|
@Override
|
|
|
|
|
public void update(int index, T object, String value) {
|
|
|
|
|
|
|
|
|
|
eventBus.fireEvent(new ActionOnItemEvent<T>(Arrays.asList(object), ACTION_ON_ITEM.REMOVE));
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
sortedCellTable.addColumn(deleteRecordColumn);
|
|
|
|
|
sortedCellTable.setColumnWidth(deleteRecordColumn, 50, Unit.PX);
|
|
|
|
|
// ButtonCell showOnMapButton = new ButtonCell();
|
|
|
|
|
// showOnMapButton.setIcon(IconType.MAP_MARKER);
|
|
|
|
|
//
|
|
|
|
|
// MyToolTipColumn<T, String> showOnMapColumn = new MyToolTipColumn<T, String>(showOnMapButton, "Show on Map") {
|
|
|
|
|
//
|
|
|
|
|
// @Override
|
|
|
|
|
// public String getValue(T object) {
|
|
|
|
|
// return "";
|
|
|
|
|
// }
|
|
|
|
|
// };
|
|
|
|
|
//
|
|
|
|
|
// showOnMapColumn.setFieldUpdater(new FieldUpdater<T, String>() {
|
|
|
|
|
// @Override
|
|
|
|
|
// public void update(int index, T object, String value) {
|
|
|
|
|
// GWT.log("clicked show");
|
|
|
|
|
// eventBus.fireEvent(new ActionOnItemEvent<T>(Arrays.asList(object), ACTION_ON_ITEM.SHOW_ON_MAP));
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
// sortedCellTable.addColumn(showOnMapColumn);
|
|
|
|
|
// sortedCellTable.setColumnWidth(showOnMapColumn, 50, Unit.PX);
|
|
|
|
|
//
|
|
|
|
|
// ButtonCell showReportRecordButton = new ButtonCell();
|
|
|
|
|
// showReportRecordButton.setIcon(IconType.FILE_TEXT_ALT);
|
|
|
|
|
// MyToolTipColumn<T, String> showReportRecordColumn = new MyToolTipColumn<T, String>(showReportRecordButton,
|
|
|
|
|
// "Show Publication Report") {
|
|
|
|
|
// public String getValue(T object) {
|
|
|
|
|
// return "";
|
|
|
|
|
// }
|
|
|
|
|
// };
|
|
|
|
|
//
|
|
|
|
|
// showReportRecordColumn.setFieldUpdater(new FieldUpdater<T, String>() {
|
|
|
|
|
// @Override
|
|
|
|
|
// public void update(int index, T object, String value) {
|
|
|
|
|
//
|
|
|
|
|
// eventBus.fireEvent(new ActionOnItemEvent<T>(Arrays.asList(object), ACTION_ON_ITEM.SHOW_REPORT));
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
// sortedCellTable.addColumn(showReportRecordColumn);
|
|
|
|
|
// sortedCellTable.setColumnWidth(showReportRecordColumn, 50, Unit.PX);
|
|
|
|
|
//
|
|
|
|
|
// ButtonCell deleteRecordButton = new ButtonCell();
|
|
|
|
|
// deleteRecordButton.setIcon(IconType.TRASH);
|
|
|
|
|
// MyToolTipColumn<T, String> deleteRecordColumn = new MyToolTipColumn<T, String>(deleteRecordButton,
|
|
|
|
|
// "Delete Project") {
|
|
|
|
|
// public String getValue(T object) {
|
|
|
|
|
// return "";
|
|
|
|
|
// }
|
|
|
|
|
// };
|
|
|
|
|
//
|
|
|
|
|
// deleteRecordColumn.setFieldUpdater(new FieldUpdater<T, String>() {
|
|
|
|
|
// @Override
|
|
|
|
|
// public void update(int index, T object, String value) {
|
|
|
|
|
//
|
|
|
|
|
// eventBus.fireEvent(new ActionOnItemEvent<T>(Arrays.asList(object), ACTION_ON_ITEM.DELETE_RECORD));
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
// sortedCellTable.addColumn(deleteRecordColumn);
|
|
|
|
|
// sortedCellTable.setColumnWidth(deleteRecordColumn, 50, Unit.PX);
|
|
|
|
|
|
|
|
|
|
GWT.log("currentSortFilter: " + currentSortFilter);
|
|
|
|
|
|
|
|
|
@ -423,6 +419,11 @@ public class ItemsTable<T extends ConcessioneDV> extends AbstractItemsCellTable<
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void enableWriteOperations() {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* To display authors.
|
|
|
|
|