|
|
|
@ -13,13 +13,16 @@ import java.util.Set;
|
|
|
|
|
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.google.gwt.cell.client.ButtonCell;
|
|
|
|
|
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;
|
|
|
|
@ -306,11 +309,30 @@ public class ItemsTable<T extends ConcessioneDV> extends AbstractItemsCellTable<
|
|
|
|
|
if (object == null)
|
|
|
|
|
return "";
|
|
|
|
|
|
|
|
|
|
ValidationReportDV vd = ((ConcessioneDV) object).getValidationReport();
|
|
|
|
|
if (vd != null)
|
|
|
|
|
return vd.getStatus().getLabel();
|
|
|
|
|
ValidationReportDV vr = ((ConcessioneDV) object).getValidationReport();
|
|
|
|
|
if (vr != null && vr.getStatus() != null)
|
|
|
|
|
return vr.getStatus().getLabel();
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void render(Context context, T object, SafeHtmlBuilder sb) {
|
|
|
|
|
// TODO Auto-generated method stub
|
|
|
|
|
|
|
|
|
|
String value = getValue(object);
|
|
|
|
|
String color = "#000";
|
|
|
|
|
if (value.compareTo(ValidationStatus.PASSED.getLabel()) == 0) {
|
|
|
|
|
color = "#32CD32";
|
|
|
|
|
} else if (value.compareTo(ValidationStatus.WARNING.getLabel()) == 0) {
|
|
|
|
|
color = "#FF8000";
|
|
|
|
|
} else if (value.compareTo(ValidationStatus.ERROR.getLabel()) == 0) {
|
|
|
|
|
color = "red";
|
|
|
|
|
}
|
|
|
|
|
sb.appendHtmlConstant("<span style=\"color:" + color + "\";>");
|
|
|
|
|
super.render(context, object, sb);
|
|
|
|
|
sb.appendHtmlConstant("</span>");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
sortedCellTable.addColumn(statusColumn, RECORD_FIELD.PUBLISHING_STATUS.getDisplayName(), false);
|
|
|
|
@ -319,9 +341,13 @@ public class ItemsTable<T extends ConcessioneDV> extends AbstractItemsCellTable<
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ButtonCell showOnMapButton = new ButtonCell();
|
|
|
|
|
Column<T, String> showOnMapColumn = new Column<T, String>(showOnMapButton) {
|
|
|
|
|
showOnMapButton.setIcon(IconType.MAP_MARKER);
|
|
|
|
|
|
|
|
|
|
MyToolTipColumn<T, String> showOnMapColumn = new MyToolTipColumn<T, String>(showOnMapButton, "Show on Map") {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String getValue(T object) {
|
|
|
|
|
return "Show on Map";
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -333,12 +359,14 @@ public class ItemsTable<T extends ConcessioneDV> extends AbstractItemsCellTable<
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
sortedCellTable.addColumn(showOnMapColumn);
|
|
|
|
|
sortedCellTable.setColumnWidth(showOnMapColumn, 110, Unit.PX);
|
|
|
|
|
sortedCellTable.setColumnWidth(showOnMapColumn, 50, Unit.PX);
|
|
|
|
|
|
|
|
|
|
ButtonCell showReportRecordButton = new ButtonCell();
|
|
|
|
|
Column<T, String> showReportRecordColumn = new Column<T, String>(showReportRecordButton) {
|
|
|
|
|
showReportRecordButton.setIcon(IconType.FILE_TEXT_ALT);
|
|
|
|
|
MyToolTipColumn<T, String> showReportRecordColumn = new MyToolTipColumn<T, String>(showReportRecordButton,
|
|
|
|
|
"Show Publication Report") {
|
|
|
|
|
public String getValue(T object) {
|
|
|
|
|
return "P. Report";
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -350,12 +378,14 @@ public class ItemsTable<T extends ConcessioneDV> extends AbstractItemsCellTable<
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
sortedCellTable.addColumn(showReportRecordColumn);
|
|
|
|
|
sortedCellTable.setColumnWidth(showReportRecordColumn, 80, Unit.PX);
|
|
|
|
|
sortedCellTable.setColumnWidth(showReportRecordColumn, 50, Unit.PX);
|
|
|
|
|
|
|
|
|
|
ButtonCell deleteRecordButton = new ButtonCell();
|
|
|
|
|
Column<T, String> deleteRecordColumn = new Column<T, String>(deleteRecordButton) {
|
|
|
|
|
deleteRecordButton.setIcon(IconType.TRASH);
|
|
|
|
|
MyToolTipColumn<T, String> deleteRecordColumn = new MyToolTipColumn<T, String>(deleteRecordButton,
|
|
|
|
|
"Delete Project") {
|
|
|
|
|
public String getValue(T object) {
|
|
|
|
|
return "Delete";
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -367,7 +397,7 @@ public class ItemsTable<T extends ConcessioneDV> extends AbstractItemsCellTable<
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
sortedCellTable.addColumn(deleteRecordColumn);
|
|
|
|
|
sortedCellTable.setColumnWidth(deleteRecordColumn, 80, Unit.PX);
|
|
|
|
|
sortedCellTable.setColumnWidth(deleteRecordColumn, 50, Unit.PX);
|
|
|
|
|
|
|
|
|
|
GWT.log("currentSortFilter: " + currentSortFilter);
|
|
|
|
|
|
|
|
|
|