/* * (non-Javadoc) * * @see com.pdt.cms.ui.content.SingleTableContentSegment#deleteItem(java.lang.Object) */ @Override protected void deleteItem(Object itemId) { if (itemId == null) { LOGGER.warn( "Try to DELETE a tour with NULL itemId. RETURN, no action", new IllegalStateException()); return; } Tour t = coreService.findById(Tour.class, (Long) itemId); PdtTourService tservice = ServiceResolver.findService(PdtTourService.class); tservice.removeTour(t); refresh(); }
/* * (non-Javadoc) * * @see com.pdt.cms.ui.content.SingleTableContentSegment#editItem(java.lang.Object) */ @Override protected void editItem(Object itemId) { if (itemId == null) { LOGGER.warn("Try to EDIT a tour with NULL itemId. RETURN, no action"); return; } Tour t = coreService.findById(Tour.class, (Long) itemId); if (t != null) { List<Image> images = ServiceResolver.findService(PdtTourService.class).getImagesByTour(t.getId()); TourImageDto dto = new TourImageDto(t, images); UI.getCurrent() .addWindow( new TourManagementDialog( TourImageDto.class, dto, "Edit tour information", new RefreshOnUpdate())); } }