return tokenService.getEncryptedSecurityToken(item.getId(), item.getWidgetUrl(), item.getOwnerId());
}
protected void validate(Widget widget) {
if(widget == null) {
throw new ResourceNotFoundException("The requested gadget does not exist in the gadget store.");
} else if(widget.getWidgetStatus().equals(WidgetStatus.PREVIEW)) {
throw new IllegalStateException("The requested gadget exists in the gadget store but is not published.");
}
}