-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(slide): add constants for slideshow paths and update SlideMedia …
…handling
- Loading branch information
1 parent
0ef51d9
commit 3e2633a
Showing
16 changed files
with
356 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
backend/src/main/java/fr/cgi/magneto/core/constants/MagnetoPaths.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 31 additions & 5 deletions
36
backend/src/main/java/fr/cgi/magneto/model/slides/SlideBoard.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,53 @@ | ||
package fr.cgi.magneto.model.slides; | ||
|
||
import org.apache.poi.sl.usermodel.TextParagraph; | ||
import org.apache.poi.xslf.usermodel.XSLFSlide; | ||
|
||
import fr.cgi.magneto.core.constants.Slideshow; | ||
import fr.cgi.magneto.helper.SlideHelper; | ||
import io.vertx.core.json.JsonObject; | ||
|
||
public class SlideBoard extends Slide { | ||
private final String ownerName; | ||
private final String link; | ||
private final String modificationDate; | ||
private final int magnetNumber; | ||
private final int resourceNumber; | ||
private final boolean isShare; | ||
private final boolean isPublic; | ||
private final String caption; | ||
private final String fileContentType; | ||
private byte[] resourceData; | ||
private JsonObject i18ns; | ||
|
||
public SlideBoard(String title, String description, String ownerName, String modificationDate, int magnetNumber, | ||
boolean isShare, boolean isPublic) { | ||
public SlideBoard(String title, String description, String ownerName, String modificationDate, int resourceNumber, | ||
boolean isShare, boolean isPublic, String caption, String link, String contentType, | ||
byte[] resourceData, JsonObject i18ns) { | ||
this.title = title; | ||
this.description = description; | ||
this.ownerName = ownerName; | ||
this.modificationDate = modificationDate; | ||
this.magnetNumber = magnetNumber; | ||
this.resourceNumber = resourceNumber; | ||
this.caption = caption; | ||
this.isShare = isShare; | ||
this.isPublic = isPublic; | ||
this.link = link; | ||
this.fileContentType = contentType; | ||
this.resourceData = resourceData; | ||
this.i18ns = i18ns; | ||
|
||
} | ||
|
||
@Override | ||
public Object createApacheSlide(XSLFSlide newSlide) { | ||
return null; | ||
SlideHelper.createTitle(newSlide, title, Slideshow.TITLE_HEIGHT, Slideshow.TITLE_FONT_SIZE, | ||
TextParagraph.TextAlign.LEFT); | ||
SlideHelper.createLink(newSlide, link); | ||
SlideHelper.createImage(newSlide, resourceData, fileContentType, Slideshow.MAIN_CONTENT_MARGIN_TOP, | ||
Slideshow.BOARD_IMAGE_CONTENT_HEIGHT, true); | ||
SlideHelper.createBoardInfoList(newSlide, ownerName, modificationDate, resourceNumber, isShare, isPublic, | ||
i18ns); | ||
SlideHelper.createLegend(newSlide, caption); | ||
|
||
return newSlide; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.