2009-07-01 02:45:42 +08:00
|
|
|
/*
|
|
|
|
* BigBlueButton - http://www.bigbluebutton.org
|
|
|
|
*
|
|
|
|
* Copyright (c) 2008-2009 by respective authors (see below). All rights reserved.
|
|
|
|
*
|
|
|
|
* BigBlueButton 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 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, If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
* $Id: $
|
|
|
|
*/
|
2009-04-02 00:53:45 +08:00
|
|
|
import org.jsecurity.crypto.hash.Sha1Hash
|
2009-04-30 03:38:46 +08:00
|
|
|
import org.bigbluebutton.web.domain.Role
|
|
|
|
import org.bigbluebutton.web.domain.User
|
|
|
|
import org.bigbluebutton.web.domain.UserRoleRel
|
2009-05-28 23:21:40 +08:00
|
|
|
import org.bigbluebutton.web.domain.ScheduledSession
|
|
|
|
import org.bigbluebutton.web.domain.Conference
|
|
|
|
import java.util.UUID
|
2009-04-02 00:53:45 +08:00
|
|
|
|
|
|
|
class BootStrap {
|
|
|
|
def jmsContainer
|
|
|
|
|
|
|
|
def init = { servletContext ->
|
2009-05-08 23:13:14 +08:00
|
|
|
log.debug "Bootstrapping bbb-web"
|
2009-04-02 00:53:45 +08:00
|
|
|
// Administrator user and role.
|
2009-05-28 23:21:40 +08:00
|
|
|
log.debug "Creating administrator"
|
2009-06-01 23:18:03 +08:00
|
|
|
def adminRole = new Role(name: "Administrator").save()
|
2009-04-30 03:38:46 +08:00
|
|
|
def adminUser = new User(username: "admin@test.com", passwordHash: new Sha1Hash("admin").toHex(),
|
2009-05-30 05:18:49 +08:00
|
|
|
fullName: "Admin")
|
2009-06-01 23:18:03 +08:00
|
|
|
adminUser.save(flush:true)
|
|
|
|
new UserRoleRel(user: adminUser, role: adminRole).save(flush:true)
|
2009-04-02 00:53:45 +08:00
|
|
|
|
2009-06-12 03:38:02 +08:00
|
|
|
def userRole = new Role(name: "User").save()
|
|
|
|
|
2009-05-29 08:35:41 +08:00
|
|
|
String createdBy = adminUser.fullName
|
|
|
|
String modifiedBy = adminUser.fullName
|
2009-05-28 23:21:40 +08:00
|
|
|
|
|
|
|
log.debug "Creating default conference"
|
|
|
|
def defaultConference = new Conference(
|
|
|
|
name:"Default Conference", conferenceNumber:new Integer(85115),
|
2009-06-02 23:54:16 +08:00
|
|
|
user:adminUser, createdBy:createdBy, updatedBy:modifiedBy).save()
|
|
|
|
// defaultConference.save()
|
2009-05-28 23:21:40 +08:00
|
|
|
|
|
|
|
log.debug "Creating a Default session for the Default Conference"
|
|
|
|
|
|
|
|
String name = "Default Conference Session"
|
2009-06-12 23:31:43 +08:00
|
|
|
String description = "Default session -- use password (no quotes): 'mp' for Moderator, 'ap' for Attendee."
|
2009-05-28 23:21:40 +08:00
|
|
|
String sessionId = UUID.randomUUID()
|
|
|
|
String tokenId = UUID.randomUUID()
|
|
|
|
Integer numberOfAttendees = new Integer(3)
|
|
|
|
Boolean timeLimited = true
|
|
|
|
Date startDateTime = new Date()
|
|
|
|
|
|
|
|
// Set the endDate for this session to Dec. 31, 2010
|
|
|
|
java.util.Calendar calendar = java.util.Calendar.getInstance();
|
|
|
|
calendar.set(java.util.Calendar.MONTH, java.util.Calendar.DECEMBER);
|
|
|
|
calendar.set(java.util.Calendar.DAY_OF_MONTH, 31);
|
|
|
|
calendar.set(java.util.Calendar.YEAR, 2010)
|
|
|
|
|
|
|
|
Date endDateTime = calendar.getTime()
|
|
|
|
|
|
|
|
Boolean record = false
|
|
|
|
Boolean passwordProtect = true
|
|
|
|
String hostPassword = 'hp'
|
|
|
|
String moderatorPassword = 'mp'
|
|
|
|
String attendeePassword = 'ap'
|
|
|
|
String voiceConferenceBridge = '85115'
|
|
|
|
|
2009-06-02 23:54:16 +08:00
|
|
|
def defaultConfSession = new ScheduledSession(
|
2009-05-28 23:21:40 +08:00
|
|
|
name:name, description:description,
|
|
|
|
createdBy:createdBy, modifiedBy:modifiedBy, sessionId:sessionId, tokenId:tokenId,
|
|
|
|
numberOfAttendees:numberOfAttendees, timeLimited:timeLimited, startDateTime:startDateTime,
|
|
|
|
endDateTime:endDateTime, record:record, passwordProtect:passwordProtect, hostPassword:hostPassword,
|
|
|
|
moderatorPassword:moderatorPassword, attendeePassword:attendeePassword,
|
|
|
|
voiceConferenceBridge:voiceConferenceBridge, conference:defaultConference
|
2009-06-02 23:54:16 +08:00
|
|
|
).save()
|
|
|
|
// defaultConfSession.save()
|
2009-04-02 00:53:45 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
def destroy = {
|
|
|
|
}
|
2009-05-29 08:35:41 +08:00
|
|
|
}
|