Skip to content
Snippets Groups Projects
Commit 59953df8 authored by Moritzjenny's avatar Moritzjenny
Browse files

Merge remote-tracking branch 'origin/OpenOLAT_15.1'

parents 9fafaace 80c85957
No related branches found
No related tags found
No related merge requests found
......@@ -55,6 +55,7 @@ import org.springframework.stereotype.Service;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.swagger.v3.oas.annotations.Hidden;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
......@@ -66,6 +67,7 @@ import io.swagger.v3.oas.annotations.responses.ApiResponse;
* @author uhensler, urs.hensler@frentix.com, http://www.frentix.com
*
*/
@Hidden
@Service
@Path("/collabora/wopi/files/{fileId}")
public class CollaboraWebService {
......
......@@ -55,6 +55,7 @@ import org.springframework.stereotype.Service;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.swagger.v3.oas.annotations.Hidden;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
......@@ -69,6 +70,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
* @author uhensler, urs.hensler@frentix.com, http://www.frentix.com
*
*/
@Hidden
@Tag(name = "Office365")
@Service
@Path("/office365/wopi/files/{fileId}")
......
......@@ -52,6 +52,7 @@ import org.olat.core.util.vfs.lock.LockResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import io.swagger.v3.oas.annotations.Hidden;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
......@@ -63,6 +64,7 @@ import io.swagger.v3.oas.annotations.responses.ApiResponse;
* @author uhensler, urs.hensler@frentix.com, http://www.frentix.com
*
*/
@Hidden
@Service
@Path("/onlyoffice/files/{fileId}")
public class OnlyOfficeWebService {
......
......@@ -333,6 +333,18 @@ public class CurriculumsWebService {
@GET
@Path("elements")
@Operation(summary = "Get the elements of all curriculums",
description = "Get all the elements of all curriculums")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "The elements",
content = {
@Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = CurriculumElementVO.class))),
@Content(mediaType = "application/xml", array = @ArraySchema(schema = @Schema(implementation = CurriculumElementVO.class)))
}
),
@ApiResponse(responseCode = "401", description = "The roles of the authenticated user are not sufficient"),
@ApiResponse(responseCode = "406", description = "application/xml, application/json")}
)
public Response searchCurriculumElement(@QueryParam("externalId") String externalId, @QueryParam("identifier") String identifier,
@QueryParam("key") Long key, @Context HttpServletRequest httpRequest) {
Roles roles = getRoles(httpRequest);
......
......@@ -40,6 +40,7 @@ import org.olat.user.DisplayPortraitManager;
import org.olat.user.UserManager;
import org.springframework.stereotype.Component;
import io.swagger.v3.oas.annotations.Hidden;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
......@@ -49,6 +50,7 @@ import io.swagger.v3.oas.annotations.responses.ApiResponse;
* @author srosse, stephane.rosse@frentix.com, http://www.frentix.com
*
*/
@Hidden
@Component
@Path("openmeetings")
public class OpenMeetingsWebService {
......
......@@ -60,6 +60,10 @@ public class ThreadsWebService implements Sampler {
}
@GET
@Operation(summary = "Retrieve threads info", description = "Retrieve information about threads count and number of deamons")
@ApiResponses({
@ApiResponse(responseCode = "200", description = "The infos", content = {
@Content(mediaType = "text") }) })
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
public Response getThreadsXml() {
ThreadMXBean bean = ManagementFactory.getThreadMXBean();
......
......@@ -30,6 +30,13 @@ import org.olat.core.commons.services.vfs.manager.VFSRevisionDAO;
import org.olat.restapi.system.vo.VFSStatsVO;
import org.springframework.beans.factory.annotation.Autowired;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
/**
*
* <h3>Description:</h3>
......@@ -49,6 +56,11 @@ public class VFSStatsWebService {
}
@GET
@Operation(summary = "Retrieve threads info", description = "Retrieve information about threads count and number of deamons")
@ApiResponses({
@ApiResponse(responseCode = "200", description = "The infos", content = {
@Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = VFSStatsVO.class))),
@Content(mediaType = "application/xml", array = @ArraySchema(schema = @Schema(implementation = VFSStatsVO.class))) }) })
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
public Response getRevisionSizeXML() {
long size = vfsRevisionDAO.calculateRevisionsSize();
......
/**
* <a href="http://www.openolat.org">
* OpenOLAT - Online Learning and Training</a><br>
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at the
* <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache homepage</a>
* <p>
* Unless required by applicable law or agreed to in writing,<br>
* software distributed under the License is distributed on an "AS IS" BASIS, <br>
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
* See the License for the specific language governing permissions and <br>
* limitations under the License.
* <p>
* Initial code contributed and copyrighted by<br>
* frentix GmbH, http://www.frentix.com
* <p>
*/
package org.olat.restapi;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.UriBuilder;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.junit.Assert;
import org.junit.Test;
import org.olat.restapi.system.vo.BigBlueButtonStatisticsVO;
import org.olat.test.OlatRestTestCase;
/**
*
* Initial date: 13 jul. 2020<br>
* @author mjenny, moritz.jenny@frentix.com, http://www.frentix.com
*
*/
public class BigBlueButtonStatsWebServiceTest extends OlatRestTestCase {
@Test
public void bigbluebuttonStatistics()
throws IOException, URISyntaxException {
RestConnection conn = new RestConnection();
Assert.assertTrue(conn.login("administrator", "openolat"));
URI request = UriBuilder.fromUri(getContextURI()).path("system").path("monitoring").path("bigbluebutton").build();
HttpGet method = conn.createGet(request, MediaType.APPLICATION_JSON, true);
HttpResponse response = conn.execute(method);
Assert.assertEquals(200, response.getStatusLine().getStatusCode());
BigBlueButtonStatisticsVO bigBlueButtonStatisticsVO = conn.parse(response, BigBlueButtonStatisticsVO.class);
Assert.assertEquals(0, bigBlueButtonStatisticsVO.getAttendeesCount());
Assert.assertEquals(0, bigBlueButtonStatisticsVO.getCapacity());
Assert.assertEquals(0, bigBlueButtonStatisticsVO.getMeetingsCount());
Assert.assertEquals(0, bigBlueButtonStatisticsVO.getRecordingCount());
Assert.assertEquals(0, bigBlueButtonStatisticsVO.getVideoCount());
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment