use of com.hortonworks.streamline.registries.dashboard.entites.Widget in project streamline by hortonworks.
the class DashboardCatalogResource method getWidget.
@GET
@Path("/{dashboardId}/widgets/{widgetId}")
@Timed
public Response getWidget(@PathParam("dashboardId") Long dashboardId, @PathParam("widgetId") Long widgetId) {
Widget widget = dashboardCatalogService.getWidget(dashboardId, widgetId);
if (widget != null) {
WidgetDto dto = WidgetDto.fromWidget(widget);
dto.setDatasourceIds(dashboardCatalogService.getWidgetDatasourceMapping(widget));
return WSUtils.respondEntity(dto, OK);
}
throw EntityNotFoundException.byId(getCompositeId(dashboardId, widgetId));
}
use of com.hortonworks.streamline.registries.dashboard.entites.Widget in project streamline by hortonworks.
the class DashboardCatalogService method getWidget.
public Widget getWidget(Long dashboardId, Long widgetId) {
Widget widget = new Widget();
widget.setDashboardId(dashboardId);
widget.setId(widgetId);
ensureDashboardExists(dashboardId);
return dao.get(new StorableKey(WIDGET_NAMESPACE, widget.getPrimaryKey()));
}
Aggregations