From 32a2790209fb150b61ceb53f000a8903aab5e07f Mon Sep 17 00:00:00 2001 From: Yassine Souissi Date: Thu, 11 Jul 2024 13:03:09 +0200 Subject: [PATCH 1/2] Add links to citations --- .../service/connectors/pyris/PyrisWebhookService.java | 5 +++-- .../lectureingestionwebhook/PyrisLectureUnitWebhookDTO.java | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/de/tum/in/www1/artemis/service/connectors/pyris/PyrisWebhookService.java b/src/main/java/de/tum/in/www1/artemis/service/connectors/pyris/PyrisWebhookService.java index 6d8d18b3ae20..cd6dfefd2612 100644 --- a/src/main/java/de/tum/in/www1/artemis/service/connectors/pyris/PyrisWebhookService.java +++ b/src/main/java/de/tum/in/www1/artemis/service/connectors/pyris/PyrisWebhookService.java @@ -75,16 +75,17 @@ private PyrisLectureUnitWebhookDTO processAttachmentForUpdate(AttachmentUnit att Long courseId = attachmentUnit.getLecture().getCourse().getId(); String courseTitle = attachmentUnit.getLecture().getCourse().getTitle(); String courseDescription = attachmentUnit.getLecture().getCourse().getDescription() == null ? "" : attachmentUnit.getLecture().getCourse().getDescription(); + String lectureUnitLink = artemisBaseUrl + attachmentUnit.getAttachment().getLink(); String base64EncodedPdf = attachmentToBase64(attachmentUnit); return new PyrisLectureUnitWebhookDTO(true, artemisBaseUrl, base64EncodedPdf, lectureUnitId, lectureUnitName, lectureId, lectureTitle, courseId, courseTitle, - courseDescription); + courseDescription, lectureUnitLink); } private PyrisLectureUnitWebhookDTO processAttachmentForDeletion(AttachmentUnit attachmentUnit) { Long lectureUnitId = attachmentUnit.getId(); Long lectureId = attachmentUnit.getLecture().getId(); Long courseId = attachmentUnit.getLecture().getCourse().getId(); - return new PyrisLectureUnitWebhookDTO(false, artemisBaseUrl, "", lectureUnitId, "", lectureId, "", courseId, "", ""); + return new PyrisLectureUnitWebhookDTO(false, artemisBaseUrl, "", lectureUnitId, "", lectureId, "", courseId, "", "", ""); } /** diff --git a/src/main/java/de/tum/in/www1/artemis/service/connectors/pyris/dto/lectureingestionwebhook/PyrisLectureUnitWebhookDTO.java b/src/main/java/de/tum/in/www1/artemis/service/connectors/pyris/dto/lectureingestionwebhook/PyrisLectureUnitWebhookDTO.java index b5a956c2463a..e64256a22841 100644 --- a/src/main/java/de/tum/in/www1/artemis/service/connectors/pyris/dto/lectureingestionwebhook/PyrisLectureUnitWebhookDTO.java +++ b/src/main/java/de/tum/in/www1/artemis/service/connectors/pyris/dto/lectureingestionwebhook/PyrisLectureUnitWebhookDTO.java @@ -9,5 +9,5 @@ */ @JsonInclude(JsonInclude.Include.NON_EMPTY) public record PyrisLectureUnitWebhookDTO(Boolean toUpdate, String artemisBaseUrl, String pdfFile, Long lectureUnitId, String lectureUnitName, Long lectureId, String lectureName, - Long courseId, String courseName, String courseDescription) { + Long courseId, String courseName, String courseDescription, String lectureUnitLink) { } From 19742e807e95f368ab738d0b170f86969570a05a Mon Sep 17 00:00:00 2001 From: Patrick Bassner Date: Tue, 10 Dec 2024 15:45:08 +0100 Subject: [PATCH 2/2] fix test compile --- .../de/tum/cit/aet/artemis/iris/PyrisConnectorServiceTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/de/tum/cit/aet/artemis/iris/PyrisConnectorServiceTest.java b/src/test/java/de/tum/cit/aet/artemis/iris/PyrisConnectorServiceTest.java index a2a6c28aa6c3..34c44a7b5433 100644 --- a/src/test/java/de/tum/cit/aet/artemis/iris/PyrisConnectorServiceTest.java +++ b/src/test/java/de/tum/cit/aet/artemis/iris/PyrisConnectorServiceTest.java @@ -51,7 +51,7 @@ void testExceptionV2(int httpStatus, Class exceptionClass) { void testExceptionIngestionV2(int httpStatus, Class exceptionClass) { irisRequestMockProvider.mockIngestionWebhookRunError(httpStatus); PyrisLectureUnitWebhookDTO pyrisLectureUnitWebhookDTO = new PyrisLectureUnitWebhookDTO("example.pdf", 123L, "Lecture Unit Name", 456L, "Lecture Name", 789L, "Course Name", - "Course Description"); + "Course Description", "/example/test.pdf"); PyrisWebhookLectureIngestionExecutionDTO executionDTO = new PyrisWebhookLectureIngestionExecutionDTO(pyrisLectureUnitWebhookDTO, null, List.of()); assertThatThrownBy(() -> pyrisConnectorService.executeLectureAddtionWebhook("fullIngestion", executionDTO)).isInstanceOf(exceptionClass); }