use of org.olat.restapi.system.vo.RepositoryStatisticsVO in project OpenOLAT by OpenOLAT.
the class SystemTest method testSystemRepositoryStatistics.
@Test
public void testSystemRepositoryStatistics() throws IOException, URISyntaxException {
RestConnection conn = new RestConnection();
assertTrue(conn.login("administrator", "openolat"));
URI systemUri = conn.getContextURI().path("system").path("monitoring").path("openolat").path("repository").build();
RepositoryStatisticsVO repoStats = conn.get(systemUri, RepositoryStatisticsVO.class);
assertNotNull(repoStats);
assertTrue(repoStats.getCoursesCount() >= 0);
assertTrue(repoStats.getPublishedCoursesCount() >= 0);
conn.shutdown();
}
use of org.olat.restapi.system.vo.RepositoryStatisticsVO in project OpenOLAT by OpenOLAT.
the class OpenOLATStatisticsWebService method getRepositoryStatisticsVO.
private RepositoryStatisticsVO getRepositoryStatisticsVO() {
RepositoryStatisticsVO stats = new RepositoryStatisticsVO();
RepositoryManager repoMgr = CoreSpringFactory.getImpl(RepositoryManager.class);
int allCourses = repoMgr.countByTypeLimitAccess(CourseModule.ORES_TYPE_COURSE, RepositoryEntry.ACC_OWNERS);
int publishedCourses = repoMgr.countByTypeLimitAccess(CourseModule.ORES_TYPE_COURSE, RepositoryEntry.ACC_USERS);
stats.setCoursesCount(allCourses);
stats.setPublishedCoursesCount(publishedCourses);
return stats;
}
use of org.olat.restapi.system.vo.RepositoryStatisticsVO in project openolat by klemens.
the class OpenOLATStatisticsWebService method getRepositoryStatisticsVO.
private RepositoryStatisticsVO getRepositoryStatisticsVO() {
RepositoryStatisticsVO stats = new RepositoryStatisticsVO();
RepositoryManager repoMgr = CoreSpringFactory.getImpl(RepositoryManager.class);
int allCourses = repoMgr.countByTypeLimitAccess(CourseModule.ORES_TYPE_COURSE, RepositoryEntry.ACC_OWNERS);
int publishedCourses = repoMgr.countByTypeLimitAccess(CourseModule.ORES_TYPE_COURSE, RepositoryEntry.ACC_USERS);
stats.setCoursesCount(allCourses);
stats.setPublishedCoursesCount(publishedCourses);
return stats;
}
use of org.olat.restapi.system.vo.RepositoryStatisticsVO in project openolat by klemens.
the class SystemTest method testSystemRepositoryStatistics.
@Test
public void testSystemRepositoryStatistics() throws IOException, URISyntaxException {
RestConnection conn = new RestConnection();
assertTrue(conn.login("administrator", "openolat"));
URI systemUri = conn.getContextURI().path("system").path("monitoring").path("openolat").path("repository").build();
RepositoryStatisticsVO repoStats = conn.get(systemUri, RepositoryStatisticsVO.class);
assertNotNull(repoStats);
assertTrue(repoStats.getCoursesCount() >= 0);
assertTrue(repoStats.getPublishedCoursesCount() >= 0);
conn.shutdown();
}
Aggregations