/*
* TODO extract only the currentUser's courses but is necessary modify business logic
* to annotate into course the provider's id.
*/
try {
InternalUser user = this.serviceLocator.getUserService().getUser(currentUser.getName());
// get mediator because, they are the unique users with a provider associated and internaluser
MediationService mediator = this.serviceLocator.getMediatorService().getMediationServiceByUser(user.getId(), locale);
PageManager<Course> paginator = new PageManager<Course>();
paginator.setUrlBase("/" + locale.getLanguage()+ "/provider/courses/");
paginator.setStart((page-1)*paginator.getOffset());
paginator.setSize(this.serviceLocator.getCourseService().countCoursesByProvider(mediator.getId()));
paginator.setCollection(this.serviceLocator.getCourseService().getCoursesByProvider(mediator.getId(), "title", locale,