forked from bigbluebutton/bigbluebutton
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disallow converting PDF files that have at least one big weighted page.
- Loading branch information
1 parent
bcbb527
commit ba10953
Showing
17 changed files
with
257 additions
and
5 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
.../org/bigbluebutton/core/apps/presentationpod/PdfConversionInvalidErrorSysPubMsgHdlr.scala
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,36 @@ | ||
package org.bigbluebutton.core.apps.presentationpod | ||
|
||
import org.bigbluebutton.common2.msgs._ | ||
import org.bigbluebutton.core.bus.MessageBus | ||
import org.bigbluebutton.core.domain.MeetingState2x | ||
import org.bigbluebutton.core.running.LiveMeeting | ||
|
||
trait PdfConversionInvalidErrorSysPubMsgHdlr { | ||
this: PresentationPodHdlrs => | ||
|
||
def handle( | ||
msg: PdfConversionInvalidErrorSysPubMsg, state: MeetingState2x, | ||
liveMeeting: LiveMeeting, bus: MessageBus | ||
): MeetingState2x = { | ||
|
||
def broadcastEvent(msg: PdfConversionInvalidErrorSysPubMsg): Unit = { | ||
val routing = Routing.addMsgToClientRouting( | ||
MessageTypes.BROADCAST_TO_MEETING, | ||
liveMeeting.props.meetingProp.intId, msg.header.userId | ||
) | ||
val envelope = BbbCoreEnvelope(PdfConversionInvalidErrorSysPubMsg.NAME, routing) | ||
val header = BbbClientMsgHeader( | ||
PdfConversionInvalidErrorSysPubMsg.NAME, | ||
liveMeeting.props.meetingProp.intId, msg.header.userId | ||
) | ||
|
||
val body = PdfConversionInvalidErrorSysPubMsgBody(msg.body.podId, msg.body.messageKey, msg.body.code, msg.body.presentationId, msg.body.bigPageNumber, msg.body.bigPageSize, msg.body.presName) | ||
val event = PdfConversionInvalidErrorSysPubMsg(header, body) | ||
val msgEvent = BbbCommonEnvCoreMsg(envelope, event) | ||
bus.outGW.send(msgEvent) | ||
} | ||
|
||
broadcastEvent(msg) | ||
state | ||
} | ||
} |
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
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
50 changes: 50 additions & 0 deletions
50
bbb-common-web/src/main/java/org/bigbluebutton/presentation/imp/BigPdfException.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,50 @@ | ||
/** | ||
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ | ||
* | ||
* Copyright (c) 2019 BigBlueButton Inc. and by respective authors (see below). | ||
* | ||
* This program is free software; you can redistribute it and/or modify it under the | ||
* terms of the GNU Lesser General Public License as published by the Free Software | ||
* Foundation; either version 3.0 of the License, or (at your option) any later | ||
* version. | ||
* | ||
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY | ||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A | ||
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License along | ||
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>. | ||
* | ||
*/ | ||
package org.bigbluebutton.presentation.imp; | ||
|
||
@SuppressWarnings("serial") | ||
public class BigPdfException extends Exception { | ||
|
||
private final int bigPageNumber; | ||
private final long bigPageSize; | ||
private final ExceptionType exceptionType; | ||
|
||
public BigPdfException(BigPdfException.ExceptionType type, int bigPageNumber, long bigPageSize) { | ||
super("Exception while converting PDF that has at least one big page."); | ||
this.bigPageNumber = bigPageNumber; | ||
this.bigPageSize = bigPageSize; | ||
exceptionType = type; | ||
} | ||
|
||
public int getBigPageNumber() { | ||
return bigPageNumber; | ||
} | ||
|
||
public BigPdfException.ExceptionType getExceptionType() { | ||
return exceptionType; | ||
} | ||
|
||
public long getBigPageSize() { | ||
return bigPageSize; | ||
} | ||
|
||
public enum ExceptionType { | ||
PDF_HAS_BIG_PAGE | ||
} | ||
} |
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
31 changes: 31 additions & 0 deletions
31
...ommon-web/src/main/java/org/bigbluebutton/presentation/messages/PdfConversionInvalid.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,31 @@ | ||
package org.bigbluebutton.presentation.messages; | ||
|
||
public class PdfConversionInvalid implements IDocConversionMsg { | ||
public final String podId; | ||
public final String meetingId; | ||
public final String presId; | ||
public final String presInstance; | ||
public final String filename; | ||
public final String uploaderId; | ||
public final String authzToken; | ||
public final Boolean downloadable; | ||
public final String key; | ||
public final Integer bigPageNumber; | ||
public final Integer bigPageSize; | ||
|
||
public PdfConversionInvalid(String podId, String meetingId, String presId, String presInstance, | ||
String filename, String uploaderId, String authzToken, | ||
Boolean downloadable, Integer bigPageNumber, Integer bigPageSize, String key) { | ||
this.podId = podId; | ||
this.meetingId = meetingId; | ||
this.presId = presId; | ||
this.presInstance = presInstance; | ||
this.filename = filename; | ||
this.uploaderId = uploaderId; | ||
this.authzToken = authzToken; | ||
this.downloadable = downloadable; | ||
this.bigPageNumber = bigPageNumber; | ||
this.bigPageSize = bigPageSize; | ||
this.key = key; | ||
} | ||
} |
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
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.