app/controllers/DestinationsController.java
@Security.Authenticated(SecureSession.class)
    public CompletionStage<Result> show(Http.Request request, boolean isPublic, Integer rowOffset) {
        destinationsList.clear();
        Integer userId = SessionController.getCurrentUserId(request);
        searchVal = "";
        return profileRepository.findById(userId).thenApplyAsync(profile -> {
            if (profile.isPresent()) {
                undoStackRepository.clearStackOnAllowed(profile.get());

                PaginationHelper paginationHelper = initialisePaginiation(rowOffset, userId, isPublic);

                if (isPublic) {
                    List<Destination> destListTemp = destinationRepository.getPublicDestinations(rowOffset);
                    try {
                        destinationsList = destListTemp;
                    } catch (NoSuchElementException e) {
                        destinationsList = new ArrayList<>();
                    }
                } else {
                    profileRepository.getDestinations(userId, rowOffset).ifPresent(dests -> destinationsList.addAll(dests));
                    int limit = abs(7 - destinationsList.size());
                    destinationRepository.getFollowedDestinations(userId, rowOffset, limit).ifPresent(follows -> destinationsList.addAll(follows));
                }
                destinationRepository.getFollowedDestinationIds(userId, rowOffset).ifPresent(ids -> followedDestinationIds = ids);
                destinationsList = loadCurrentUserDestinationPhotos(profile.get().getProfileId(), destinationsList);
                destinationsList = loadWorldDestPhotos(profile.get().getProfileId(), destinationsList);
                destinationsList = loadTravellerTypes(destinationsList);
                List<Photo> usersPhotos = getUsersPhotos(profile.get().getProfileId());
                return ok(destinations.render(destinationsList, profile.get(), isPublic, paginationHelper,
                        followedDestinationIds, usersPhotos, form,
                        new RoutedObject<Destination>(null, false, false), requestForm,
                        Country.getInstance().getAllCountries(), searchForm, searchVal, request, messagesApi.preferred(request)));
            } else {
                return redirect(destShowRoute);
            }
        });
    }
/**
     * Displays a page showing the destinations to the user
     *
     * @param request - HTTP Request
     * @param isPublic - Whether the target is public destinations
     * @param rowOffset - The row/page offset to use for getting results back
     * @return the list of destinations
     */
Displays a page showing the destinations to the user
@param request - HTTP Request
@param isPublic - Whether the target is public destinations
@param rowOffset - The row/page offset to use for getting results back
@return the list of destinations
Displays a page showing the destinations to the user @param request - HTTP Request @param isPublic - Whether the target is public destinations @param rowOffset - The row / page offset to use for getting results back @return the list of destinations
@Security.Authenticated(SecureSession.class)
    public CompletionStage<Result> show(Http.Request request, boolean isPublic, Integer rowOffset) {
        destinationsList.clear();
        Integer userId = SessionController.getCurrentUserId(request);
        searchVal = "";
        return profileRepository.findById(userId).thenApplyAsync(profile -> {
            if (profile.isPresent()) {
                undoStackRepository.clearStackOnAllowed(profile.get());
                PaginationHelper paginationHelper = initialisePaginiation(rowOffset, userId, isPublic);
                if (isPublic) {
                    List<Destination> destListTemp = destinationRepository.getPublicDestinations(rowOffset);
                    try {
                        destinationsList = destListTemp;
                    } catch (NoSuchElementException e) {
                        destinationsList = new ArrayList<>();
                    }
                } else {
                    profileRepository.getDestinations(userId, rowOffset).ifPresent(dests -> destinationsList.addAll(dests));
                    int limit = abs(7 - destinationsList.size());
                    destinationRepository.getFollowedDestinations(userId, rowOffset, limit).ifPresent(follows -> destinationsList.addAll(follows));
                }
                destinationRepository.getFollowedDestinationIds(userId, rowOffset).ifPresent(ids -> followedDestinationIds = ids);
                destinationsList = loadCurrentUserDestinationPhotos(profile.get().getProfileId(), destinationsList);
                destinationsList = loadWorldDestPhotos(profile.get().getProfileId(), destinationsList);
                destinationsList = loadTravellerTypes(destinationsList);
                List<Photo> usersPhotos = getUsersPhotos(profile.get().getProfileId());
                return ok(destinations.render(destinationsList, profile.get(), isPublic, paginationHelper,
                        followedDestinationIds, usersPhotos, form,
                        new RoutedObject<Destination>(null, false, false), requestForm,
                        Country.getInstance().getAllCountries(), searchForm, searchVal, request, messagesApi.preferred(request)));
            } else {
                return redirect(destShowRoute);
            }
        });
    }
@ Security . Authenticated ( SecureSession . class ) public CompletionStage < Result > show ( Http . Request request , boolean isPublic , Integer rowOffset ) { destinationsList . clear ( ) ; Integer userId = SessionController . getCurrentUserId ( request ) ; searchVal = "" ; return profileRepository . findById ( userId ) . thenApplyAsync ( profile -> { if ( profile . isPresent ( ) ) { undoStackRepository . clearStackOnAllowed ( profile . get ( ) ) ; PaginationHelper paginationHelper = initialisePaginiation ( rowOffset , userId , isPublic ) ; if ( isPublic ) { List < Destination > destListTemp = destinationRepository . getPublicDestinations ( rowOffset ) ; try { destinationsList = destListTemp ; } catch ( NoSuchElementException e ) { destinationsList = new ArrayList < > ( ) ; } } else { profileRepository . getDestinations ( userId , rowOffset ) . ifPresent ( dests -> destinationsList . addAll ( dests ) ) ; int limit = abs ( 7 - destinationsList . size ( ) ) ; destinationRepository . getFollowedDestinations ( userId , rowOffset , limit ) . ifPresent ( follows -> destinationsList . addAll ( follows ) ) ; } destinationRepository . getFollowedDestinationIds ( userId , rowOffset ) . ifPresent ( ids -> followedDestinationIds = ids ) ; destinationsList = loadCurrentUserDestinationPhotos ( profile . get ( ) . getProfileId ( ) , destinationsList ) ; destinationsList = loadWorldDestPhotos ( profile . get ( ) . getProfileId ( ) , destinationsList ) ; destinationsList = loadTravellerTypes ( destinationsList ) ; List < Photo > usersPhotos = getUsersPhotos ( profile . get ( ) . getProfileId ( ) ) ; return ok ( destinations . render ( destinationsList , profile . get ( ) , isPublic , paginationHelper , followedDestinationIds , usersPhotos , form , new RoutedObject < Destination > ( null , false , false ) , requestForm , Country . getInstance ( ) . getAllCountries ( ) , searchForm , searchVal , request , messagesApi . preferred ( request ) ) ) ; } else { return redirect ( destShowRoute ) ; } } ) ; }
Displays a page showing the destinations to the user
 @param request - HTTP Request
 @param isPublic - Whether the target is public destinations
 @param rowOffset - The row/page offset to use for getting results back
 @return the list of destinations
Displays a page showing the destinations to the user @param request - HTTP Request @param isPublic - Whether the target is public destinations @param rowOffset - The row / page offset to use for getting results back @return the list of destinations