/**
  * Adds a comment and shows the success feedback.
  *
  * @param text The text of the comment
  */
 private void createComment(String text) {
   User user = userService.getById(((MySession) Session.get()).getuId());
   if (album == null) {
     commentService.create(user, file, text);
   } else {
     commentService.create(user, album, text);
   }
   info(new StringResourceModel("comments.add.created", this, null).getString());
 }
 /**
  * Constructor for SharedAlbums.
  *
  * @param parameters The parameters necessaries for load the page.
  */
 public SharedAlbums(final PageParameters parameters) {
   super(parameters);
   if (parameters.getNamedKeys().contains("user")) {
     final String email = parameters.get("user").toString();
     User user = new User();
     user.setEmail(email);
     if (userService.getUser(user) == null) {
       throw new RestartResponseException(ErrorPage404.class);
     }
     this.user = user;
     add(new AjaxDataView("dataContainer", "navigator", createShareDataView()));
   } else {
     throw new RestartResponseException(ErrorPage404.class);
   }
 }