/*
  * (non-Javadoc)
  *
  * @see
  * org.sentilo.web.catalog.controller.CrudController#doAfterViewResource(org.springframework.ui
  * .Model)
  */
 protected void doAfterViewResource(final Model model) {
   // If application belongs to a third organization then its token must be hidden to user.
   final Application resource = (Application) model.asMap().get(getEntityModelKey());
   if (!TenantUtils.isCurrentTenantResource(resource)) {
     resource.setToken("**************");
   }
 }
 private void throwExceptionIfAlarmFound(final Collection<Application> applications) {
   for (final Application application : applications) {
     final SearchFilter filter = new SearchFilter();
     filter.addParam("type", Alert.Type.EXTERNAL.toString());
     filter.addAndParam("applicationId", application.getId());
     final boolean alertFound = alertService.search(filter).getContent().size() > 0;
     if (alertFound) {
       throw new BusinessValidationException("application.error.existing.alerts");
     }
   }
 }
 @Override
 protected List<String> toRow(final Application application) {
   final List<String> row = new ArrayList<String>();
   row.add(application.getId()); // checkbox
   row.add(application.getId());
   row.add(application.getName());
   row.add(application.getDescription());
   row.add(
       getLocalDateFormat()
           .printAsLocalTime(application.getCreatedAt(), Constants.DATETIME_FORMAT));
   return row;
 }