Skip to content

Commit

Permalink
Merge pull request #67 from blindsidenetworks/master
Browse files Browse the repository at this point in the history
Hot fixes for bugs in version 11.0
  • Loading branch information
jfederico authored Dec 1, 2016
2 parents 5a6f7ec + 643a369 commit b39788d
Show file tree
Hide file tree
Showing 11 changed files with 217 additions and 125 deletions.
104 changes: 46 additions & 58 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,51 +1,44 @@
BigBlueButton Sakai Meeting Tool
=================================================================
BigBlueButton is an open source web conferencing system that enables universities and colleges to deliver a high-quality learning experience to remote students.
# BigBlueButton Sakai Meeting Tool
BigBlueButton is an open source web conferencing system that enables universities and colleges to deliver a high-quality learning experience to remote students.

These instructions describe how to install the BigBlueButton Meeting Tool for Sakai 11.

With this plugin you can
- Control meetings - create/edit/update/delete BBB meetings from Sakai.
- Meeting access - define meeting access by selecting all users, groups, roles or individual users in site.
- Tool access - define who can do what on the Sakai tool.
- Scheduling - optionally, define meeting start dates and/or end dates and add it to site Calendar.
- Notification - optionally, send an email notification to meeting participants.
- Simplicity - the user interface is designed to be simple.
- Fast - the Ajax driven interface (Javascript + JSON + Trimpath templates) provides good end-user experience and low server load.
- RESTful - full RESTful support via EntityBroker.
- Statistics - the tool logs information automatically processed by the Site Stats tool.

Prerequisites
=============
#### *With this plugin you can*
- Control meetings - create/edit/update/delete BBB meetings from Sakai
- Meeting access - define meeting access by selective all users, groups, roles or individual users in site
- Tool access - define who can do what on the Sakai tool
- Scheduling - optionally, define meeting start dates and/or end dates and add it to site Calender
- Notification - optionally, send an email notification to meeting participants
- Simplicity - the user interface is designed to be simple
- Fast - the Ajax driven interface (Javascript + JSON + Trimpath templates) provides good end-user experience and low server load
- RESTful - full RESTful support via EntityBroker
- Statistics - the tool logs information automatically processed by the Site Stats tool

## Prerequisites
You need:

1. A server running Sakai 2.5+
2. A BigBlueButton 0.8 (or later) server running on a separate server (not on the same server as your Sakai site)
1. A server running Sakai 2.5+
2. A BigBlueButton 0.8 (or later) server running on a separate server (not on the same server as your Sakai site)

Blindside Networks provides you a test BigBlueButton server for testing this plugin. To use this test server, just accept the default settings when configuring the activity module. The default settings are

url: http://test-install.blindsidenetworks.com/bigbluebutton/

salt: 8cd8ef52e8e101574e400365b55e11a6

```
url: http://test-install.blindsidenetworks.com/bigbluebutton/
salt: 8cd8ef52e8e101574e400365b55e11a6
```
For information on how to setup your own BigBlueButton server see

http://bigbluebutton.org/
http://bigbluebutton.org/

Obtaining the source
====================
## Obtaining the source
This GitHub repostiory at

https://github.com/sakaicontrib/bbb-tool
https://github.com/sakaicontrib/bbb-tool

contains the latest source. If you want to use the latest packaged snapshot, you can download it from the corresponding branch.

https://github.com/sakaicontrib/bbb-tool/tree/11.x


Installation
============
https://github.com/sakaicontrib/bbb-tool/tree/11.x

## Installation
These instructions assume your Sakai server is installed at /opt/tomcat.

1. Meet requirements
Expand All @@ -60,44 +53,39 @@ These instructions assume your Sakai server is installed at /opt/tomcat.
2. Install BigBlueButton Sakai Meeting Tool

2.1. Download the tool source code

cd ~/YOUR-SAKAI-SRC
git clone git://github.com/sakaicontrib/bbb-tool.git

```
cd ~/YOUR-SAKAI-SRC
git clone git://github.com/sakaicontrib/bbb-tool.git
```

2.2. Compile & deploy to Tomcat

cd bbb-tool
mvn -Dmaven.tomcat.home={tomcat_folder} clean install sakai:deploy

```
cd bbb-tool
mvn -Dmaven.tomcat.home={tomcat_folder} clean install sakai:deploy
```

2.3. Add/review the following entries to the end of your sakai.properties file placed in the /opt/tomcat/sakai/ directory

bbb.url=http://<server>/bigbluebutton
bbb.salt=<salt>
To determine these values for your BigBlueButton, enter the command

bbb-conf --salt

```
bbb.url=http://<server>/bigbluebutton
bbb.salt=<salt>
```
To determine these values for your BigBlueButton server, enter the command
```
bbb-conf --salt
```
If you want to use the public test server for BigBlueButton, use the following settings

bbb.url=http://test-install.blindsidenetworks.com/bigbluebutton
bbb.salt=8cd8ef52e8e101574e400365b55e11a6
```
bbb.url=http://test-install.blindsidenetworks.com/bigbluebutton
bbb.salt=8cd8ef52e8e101574e400365b55e11a6
```

2.4. Create the database schema

Run the schema creation script that corresponds to your database (MySQL or Oracle)

or

Set up auto.ddl=true into sakai.properties and restart your server
Set up `auto.ddl=true` into sakai.properties and restart your server


At this point, you can activate the meeting tool to any site and start adding meetings.


15 changes: 13 additions & 2 deletions api/src/java/org/sakaiproject/bbb/api/BBBMeetingManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,15 @@ public interface BBBMeetingManager {
public static final String FN_DELETE_OWN = "bbb.delete.own";
public static final String FN_DELETE_ANY = "bbb.delete.any";
public static final String FN_PARTICIPATE = "bbb.participate";
public static final String FN_RECORDING_VIEW = "bbb.recording.view";
public static final String FN_RECORDING_EDIT_OWN = "bbb.recording.edit.own";
public static final String FN_RECORDING_EDIT_ANY = "bbb.recording.edit.any";
public static final String FN_RECORDING_DELETE_OWN = "bbb.recording.delete.own";
public static final String FN_RECORDING_DELETE_ANY = "bbb.recording.delete.any";
public static final String[] FUNCTIONS = new String[] { FN_CREATE,
FN_EDIT_OWN, FN_EDIT_ANY, FN_DELETE_OWN, FN_DELETE_ANY,
FN_PARTICIPATE };
FN_EDIT_OWN, FN_EDIT_ANY, FN_DELETE_OWN, FN_DELETE_ANY, FN_PARTICIPATE,
FN_RECORDING_VIEW, FN_RECORDING_EDIT_OWN, FN_RECORDING_EDIT_ANY,
FN_RECORDING_DELETE_OWN, FN_RECORDING_DELETE_ANY };
// Extra function used to enable admin interface in the client
public static final String FN_ADMIN = "bbb.admin";

Expand Down Expand Up @@ -240,6 +246,11 @@ public void checkJoinMeetingPreConditions(BBBMeeting meeting)
*/
public boolean getCanParticipate(String siteId);

/**
* Returns true if the current user can view recordings in the supplied site
*/
public boolean getCanView(String siteId);

/**
* Checks tool permissions in site, apply defaults if no perms set and
* defaults set on sakai.properties.
Expand Down
5 changes: 5 additions & 0 deletions bundle/src/resources/ToolMessages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ bbb_permissions_delete_own = Delete own
bbb_permissions_edit_any = Edit any
bbb_permissions_edit_own = Edit own
bbb_permissions_participate = Participate
bbb_permissions_recordings_view = View recordings
bbb_permissions_recordings_edit_own = Edit own recordings
bbb_permissions_recordings_edit_any = Edit any recordings
bbb_permissions_recordings_delete_own = Delete own recordings
bbb_permissions_recordings_delete_any = Delete any recordings


#####################################
Expand Down
5 changes: 5 additions & 0 deletions bundle/src/resources/ToolMessages_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ bbb_permissions_delete_own = Delete own
bbb_permissions_edit_any = Edit any
bbb_permissions_edit_own = Edit own
bbb_permissions_participate = Participate
bbb_permissions_recordings_view = View recordings
bbb_permissions_recordings_edit_own = Edit own recordings
bbb_permissions_recordings_edit_any = Edit any recordings
bbb_permissions_recordings_delete_own = Delete own recordings
bbb_permissions_recordings_delete_any = Delete any recordings


#####################################
Expand Down
5 changes: 5 additions & 0 deletions bundle/src/resources/ToolMessages_en_US.properties
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ bbb_permissions_delete_own = Delete own
bbb_permissions_edit_any = Edit any
bbb_permissions_edit_own = Edit own
bbb_permissions_participate = Participate
bbb_permissions_recordings_view = View recordings
bbb_permissions_recordings_edit_own = Edit own recordings
bbb_permissions_recordings_edit_any = Edit any recordings
bbb_permissions_recordings_delete_own = Delete own recordings
bbb_permissions_recordings_delete_any = Delete any recordings


#####################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,8 @@ public boolean endMeeting(String meetingId)
throws SecurityException, BBBException {
BBBMeeting meeting = storageManager.getMeeting(meetingId);

if (!getCanDelete(meeting.getSiteId(), meeting)) {
throw new SecurityException("You are not allow to end this meeting");
if (!getCanEdit(meeting.getSiteId(), meeting)) {
throw new SecurityException("You are not allowed to end this meeting");
}

// end meeting on server, if running
Expand Down Expand Up @@ -568,6 +568,10 @@ public boolean getCanParticipate(String siteId) {
return isUserAllowedInLocation(userDirectoryService.getCurrentUser().getId(), FN_PARTICIPATE, siteId);
}

public boolean getCanView(String siteId) {
return isUserAllowedInLocation(userDirectoryService.getCurrentUser().getId(), FN_RECORDING_VIEW, siteId);
}

public void checkPermissions(String siteId) {
try {
// get site roles & tool permisions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,16 @@ private List<String> getUserPermissionsInSite(String userId, String siteId) {
permissions.add(meetingManager.FN_DELETE_ANY);
if( meetingManager.isUserAllowedInLocation(userId, meetingManager.FN_PARTICIPATE, siteId) )
permissions.add(meetingManager.FN_PARTICIPATE);
if( meetingManager.isUserAllowedInLocation(userId, meetingManager.FN_RECORDING_VIEW, siteId) )
permissions.add(meetingManager.FN_RECORDING_VIEW);
if( meetingManager.isUserAllowedInLocation(userId, meetingManager.FN_RECORDING_EDIT_OWN, siteId) )
permissions.add(meetingManager.FN_RECORDING_EDIT_OWN);
if( meetingManager.isUserAllowedInLocation(userId, meetingManager.FN_RECORDING_EDIT_ANY, siteId) )
permissions.add(meetingManager.FN_RECORDING_EDIT_ANY);
if( meetingManager.isUserAllowedInLocation(userId, meetingManager.FN_RECORDING_DELETE_OWN, siteId) )
permissions.add(meetingManager.FN_RECORDING_DELETE_OWN);
if( meetingManager.isUserAllowedInLocation(userId, meetingManager.FN_RECORDING_DELETE_ANY, siteId) )
permissions.add(meetingManager.FN_RECORDING_DELETE_ANY);
if( meetingManager.isUserAllowedInLocation(userId, "calendar.new", siteId) )
permissions.add("calendar.new");
if( meetingManager.isUserAllowedInLocation(userId, "calendar.revise.own", siteId) )
Expand Down Expand Up @@ -638,6 +648,10 @@ public ActionReturn getSiteRecordings(Map<String, Object> params) {

String siteId = (String) params.get("siteId");

if(!meetingManager.getCanView(siteId)){
throw new SecurityException("You are not allowed to view recordings");
}

try {
Map<String, Object> recordingsResponse = meetingManager
.getSiteRecordings(siteId);
Expand Down Expand Up @@ -770,32 +784,30 @@ public String joinMeeting(OutputStream out, EntityView view, EntityReference ref
throw new EntityException("You are not allowed to join this meeting.", meeting.getReference(), 403);
}

try {
meetingManager.checkJoinMeetingPreConditions(meeting);
} catch (BBBException e) {
throw new EntityException(e.getPrettyMessage(), meeting.getReference(), 400);
}

// log meeting join event
meetingManager.logMeetingJoin(meetingId);

//Build the corresponding page for joining
String html;
//If the user is not a moderator and WaitForModerator is enabled, do not create the meeting
if( meeting.getWaitForModerator() ){
Participant p = meetingManager.getParticipantFromMeeting(meeting, userDirectoryService.getCurrentUser().getId());
if( Participant.MODERATOR.equals(p.getRole())) {
html = getHtmlForJoining(joinUrl, meetingId, NOTWAITFORMODERATOR);
} else {
if( !(Participant.MODERATOR).equals(p.getRole())) {
Map<String, Object> meetingInfo = meetingManager.getMeetingInfo(meetingId);
if( meetingInfo != null && Integer.parseInt((String)meetingInfo.get("moderatorCount")) > 0 ) {
html = getHtmlForJoining(joinUrl, meetingId, NOTWAITFORMODERATOR);
} else {
if( meetingInfo == null || meetingInfo.isEmpty() || Integer.parseInt((String)meetingInfo.get("moderatorCount")) <= 0 ) {
html = getHtmlForJoining(joinUrl, meetingId, WAITFORMODERATOR);
return html;
}
}
} else {
html = getHtmlForJoining(joinUrl, meetingId, NOTWAITFORMODERATOR);
}
//Else, if the user is a moderator / WaitForModerator is not enabled, create the meeting
try {
meetingManager.checkJoinMeetingPreConditions(meeting);
} catch (BBBException e) {
throw new EntityException(e.getPrettyMessage(), meeting.getReference(), 400);
}

html = getHtmlForJoining(joinUrl, meetingId, NOTWAITFORMODERATOR);
return html;

} catch (Exception e) {
Expand Down Expand Up @@ -842,6 +854,8 @@ private String getHtmlForJoining(String joinUrl, String meetingId, boolean waitf
" cache: false,\n" +
" success : function(data) {\n" +
" meetingInfo = data;\n" +
" if (JSON.stringify(meetingInfo) === JSON.stringify({}))\n" +
" meetingInfo.moderatorCount = 0;\n" +
" },\n" +
" error : function(xmlHttpRequest, status, error) {\n" +
" return null;\n" +
Expand All @@ -851,7 +865,7 @@ private String getHtmlForJoining(String joinUrl, String meetingId, boolean waitf
" setTimeout(worker, 5000);\n" +
" } else {\n" +
" if (typeof window.opener != 'undefined') {\n" +
" window.opener.waitForModeratorRefresh('" + meetingId + "');\n" +
" window.opener.setTimeout(\"meetings.utils.checkOneMeetingAvailability('" + meetingId + "', true)\", 15000 );\n" +
" }\n" +
" window.location.reload();\n" +
" }\n" +
Expand All @@ -870,7 +884,7 @@ private String getHtmlForJoining(String joinUrl, String meetingId, boolean waitf
} else {
return commonHtmlHeader +
" <script type='text/javascript' language='JavaScript'>\n" +
" window.opener.waitForModeratorRefresh('" + meetingId + "');\n" +
" window.opener.setTimeout(\"meetings.utils.checkOneMeetingAvailability('" + meetingId + "', true)\", 15000 );\n" +
" </script>\n" +
" <meta http-equiv='refresh' content='0; url=" + joinUrl + "' />\n" +
" </head>\n" +
Expand Down
Loading

0 comments on commit b39788d

Please sign in to comment.