Skip to content

Commit

Permalink
Mag 212 (#388)
Browse files Browse the repository at this point in the history
* refactor(notify): migrate notification templates and configurations to view-src

* feat(slide): add SlideController, SlideService, and DefaultSlideService classes

* feat(export): add ExportController and DefaultExportService for PPTX export functionality

* fix(export): update magnet number handling based on layout type in DefaultExportService

* feat(slide): implement Slide classes and update slide object handling in DefaultExportService

* feat(slide): enhance slide model with new SlideDescription and SlideTitle classes; update SlideText and SlideMedia constructors

* feat(export): enhance export functionality by incorporating user information and refactoring slide creation logic

* feat(export): update export functionality to return XMLSlideShow and improve slide creation logic

* feat(slide): update SlideHelper and SlideText no double text and no corrupt

* feat(slide): simplify SlideText createApacheSlide method by removing unnecessary comments and improving HTML parsing

* feat(slide): add createImage method to SlideHelper and extend SlideProperties with file extension

* feat(slide): refactor image stable

* feat(export): add caption to resource data in DefaultExportService

* feat(slide): update SlideMedia to include caption and version bump to 2.2-SNAPSHOT

* feat(notify): remove notify_board.json configuration file

* feat(slide) : #MAG-543 add first slide (#390)

---------

Co-authored-by: Florent Mariotti <[email protected]>

* feat(slideMedia): #MAG-548 slide media integration (#391)

* feat(media): add audio icon SVG and enhance SlideMedia with media type detection

feat(export): enhance media handling by copying media parts and relationships during slide export

media audio stable

media based on content-type

feat(slide): refactor media icon creation and positioning for improved layout

video stable

* feat(export): add CONTENTTYPE constant and refactor DefaultExportService to use it

* feat(export): refactor DefaultExportService to use constants for document fields

* feat(slideshow): add standard icon and video dimensions as constants

* refactor(export): remove debug print statements from ExportController

* refactor(export): remove unused imports from ExportController

* feat(slideshow) : #MAG-545 add sections slides (#392)

---------

Co-authored-by: Florent Mariotti <[email protected]>

* feat(slideshow) : #MAG-544 add description slide (#393)

Co-authored-by: Florent Mariotti <[email protected]>

* fix(slide) : #MAG-545 fix description and title flow (#394)

---------

Co-authored-by: Florent Mariotti <[email protected]>

* feat(slides) : #MAG-547 add board slides (#395)

---------

Co-authored-by: Thomas Sevagen <[email protected]>
Co-authored-by: Florent Mariotti <[email protected]>

* feat(slides) : #MAG-546 add link slides (#396)

Co-authored-by: Florent Mariotti <[email protected]>

* feat(slides) : #MAG-551 add file slides (#397)

---------

Co-authored-by: Florent Mariotti <[email protected]>

* feat(slides) : add notes to link, board and media slides

* feat(slides) : #MAG-554 add archive with slideshow and its documents (#398)

Co-authored-by: Florent Mariotti <[email protected]>

* feat(slides) : #MAG-555 add front modal and button for export (#399)

* feat(slides) : #MAG-555 add front modal and button for export

---------

Co-authored-by: Florent Mariotti <[email protected]>

* Mag 212fixes (#400)

---------

Co-authored-by: Florent Mariotti <[email protected]>

---------

Co-authored-by: Florent Mariotti <[email protected]>
Co-authored-by: Florent Mariotti <[email protected]>
  • Loading branch information
3 people authored Mar 5, 2025
1 parent 3767804 commit 17c1f6e
Show file tree
Hide file tree
Showing 50 changed files with 3,953 additions and 9 deletions.
31 changes: 30 additions & 1 deletion backend/pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
Expand Down Expand Up @@ -37,6 +38,9 @@
<entCoreVersion>6.4.0</entCoreVersion>
<reflectionsVersion>0.10.2</reflectionsVersion>
<gatlingHighchartsVersion>2.2.2</gatlingHighchartsVersion>
<apachePoiVersion>5.2.3</apachePoiVersion>
<jsoupVersion>1.18.3</jsoupVersion>
<thumbnailatorVersion>0.4.20</thumbnailatorVersion>
</properties>
<dependencies>
<dependency>
Expand Down Expand Up @@ -117,5 +121,30 @@
<version>${toolsVersion}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>${apachePoiVersion}</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>${apachePoiVersion}</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-full</artifactId>
<version>${apachePoiVersion}</version>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>${jsoupVersion}</version>
</dependency>
<dependency>
<groupId>net.coobird</groupId>
<artifactId>thumbnailator</artifactId>
<version>${thumbnailatorVersion}</version>
</dependency>
</dependencies>
</project>
1 change: 1 addition & 0 deletions backend/src/main/java/fr/cgi/magneto/Magneto.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public void start(Promise<Void> startPromise) throws Exception {
addController(new CommentController(serviceFactory));
addController(new BoardAccessController(serviceFactory));
addController(new WorkspaceController(serviceFactory));
addController(new ExportController(serviceFactory));

final EventBus eb = getEventBus(vertx);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package fr.cgi.magneto.controller;

import fr.cgi.magneto.core.constants.Field;
import fr.cgi.magneto.helper.I18nHelper;
import fr.cgi.magneto.service.ExportService;
import fr.cgi.magneto.service.ServiceFactory;
import fr.wseduc.rs.ApiDoc;
import fr.wseduc.rs.Get;
import fr.wseduc.webutils.I18n;
import io.vertx.core.buffer.Buffer;
import io.vertx.core.http.HttpServerRequest;
import org.entcore.common.controller.ControllerHelper;
import org.entcore.common.user.UserUtils;

public class ExportController extends ControllerHelper {
private final ExportService exportService;

public ExportController(ServiceFactory serviceFactory) {
this.exportService = serviceFactory.exportService();
}

@Get("/export/slide/:boardId")
@ApiDoc("Export board to PPTX")
public void exportBoardToPPTX(HttpServerRequest request) {
String boardId = request.getParam(Field.BOARDID);
UserUtils.getUserInfos(eb, request, user -> {
I18nHelper i18nHelper = new I18nHelper(getHost(request), I18n.acceptLanguage(request));
exportService.exportBoardToArchive(boardId, user, i18nHelper)
.onFailure(err -> renderError(request))
.onSuccess(zip -> {
request.response()
.putHeader("Content-Type", "application/zip")
.putHeader("Content-Disposition", "attachment; filename=\"board.zip\"");

request.response().end(Buffer.buffer(zip.toByteArray()));
});
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ public class CollectionsConstant {
public static final String CARD_COLLECTION = "magneto.cards";
public static final String SECTION_COLLECTION = "magneto.sections";
public static final String BOARD_VIEW_COLLECTION = "magneto.boards.access";
public static final String I18N_SLIDESHOW_OWNER = "magneto.slideshow.owner";
public static final String I18N_SLIDESHOW_UPDATED = "magneto.slideshow.updated.the";
public static final String I18N_SLIDESHOW_MAGNETS = "magneto.slideshow.magnets";
public static final String I18N_SLIDESHOW_SHARED = "magneto.slideshow.shared";
public static final String I18N_SLIDESHOW_PLATFORM = "magneto.slideshow.platform";
public static final String I18N_SLIDESHOW_FILENAME = "magneto.slideshow.filename";

public static final String WORKSPACE_DOCUMENTS = "documents";
}
16 changes: 11 additions & 5 deletions backend/src/main/java/fr/cgi/magneto/core/constants/Field.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ public class Field {
public static final String CURSOR = "cursor";
public static final String FIRSTBATCH = "firstBatch";


// CARD FIELD

public static final String BOARDID = "boardId";
Expand All @@ -102,6 +101,7 @@ public class Field {
public static final String RESOURCE_MAGNET = "magnet";
public static final String RESOURCE_SECTION = "section";
public static final String RESOURCEURL = "resourceUrl";
public static final String MAGNET_NUMBER = "magnetNumber";
public static final String LASTMODIFIERID = "lastModifierId";
public static final String LASTMODIFIERNAME = "lastModifierName";
public static final String LASTCOMMENT = "lastComment";
Expand All @@ -124,7 +124,6 @@ public class Field {

public static final String NUMBER = "number";


// METADATA FIELD

public static final String NAME = "name";
Expand All @@ -134,6 +133,7 @@ public class Field {
public static final String CHARSET = "charset";
public static final String SIZE = "size";
public static final String METADATA = "metadata";
public static final String CONTENTTYPE = "contentType";
public static final String INDEX = "index";

public static final String PROFILURI = "profilUri";
Expand Down Expand Up @@ -187,7 +187,7 @@ public class Field {

public static final String BOARDURL = "boardUrl";

//Import Export
// Import Export
public static final String RAPPORT = "rapport";

public static final String RESSOURCE_NUMBER = "resourcesNumber";
Expand All @@ -210,7 +210,7 @@ public class Field {
public static final String USER_2 = "User";
public static final String USERIDS = "userIds";

//FAVORITE
// FAVORITE
public static final String FAVORITE = "favorite";
public static final String FAVORITE_LIST = "favoriteList";
public static final String ISFAVORITE = "isFavorite";
Expand All @@ -230,8 +230,14 @@ public class Field {
public static final String GROUP_TYPE = "groupType";
public static final String GROUP = "Group";
public static final String MEMBERS = "members";
//notification Folder
// notification Folder
public static final String FOLDERTITLE = "folderTitle";
public static final String FOLDERURL = "folderUrl";
public static final String BOARDNAME = "boardName";

// EXPORT SLIDE
public static final String SLIDE_OBJECTS = "slideObjects";
public static final String BOARD_IMAGE_ID = "boardImageId";
public static final String BUFFER = "buffer";
public static final String FILE = "file";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package fr.cgi.magneto.core.constants;

public class MagnetoPaths {
public static final String MAGNETO_BOARD = "magneto#/board/";
public static final String VIEW = "/view";
}
Loading

0 comments on commit 17c1f6e

Please sign in to comment.