+ return;
+ }
+ String soneId = request.getHttpRequest().getParam("sone", null);
+ if (soneId != null) {
+ Optional<Sone> sone = webInterface.getCore().getSone(soneId);
+ templateContext.set("soneRequested", true);
+ templateContext.set("sone", sone.orNull());
+ return;
+ }
+ String mode = request.getHttpRequest().getParam("mode", null);
+ if ("gallery".equals(mode)) {
+ templateContext.set("galleryRequested", true);
+ List<Album> albums = new ArrayList<Album>();
+ for (Sone sone : webInterface.getCore().getSones()) {
+ albums.addAll(from(sone.getRootAlbum().getAlbums()).transformAndConcat(FLATTENER).filter(NOT_EMPTY).toList());
+ }
+ Collections.sort(albums, TITLE_COMPARATOR);
+ Pagination<Album> albumPagination = new Pagination<Album>(albums, 12).setPage(parseInt(request.getHttpRequest().getParam("page"), 0));
+ templateContext.set("albumPagination", albumPagination);
+ templateContext.set("albums", albumPagination.getItems());
+ return;