- upgrade to grails 2.3.6

This commit is contained in:
Richard Alam 2014-02-25 01:45:53 +00:00
parent 1722db573a
commit 944f7a15c4
10 changed files with 85 additions and 35 deletions

22
services/bbb-web-api/.classpath Normal file → Executable file
View File

@ -15,5 +15,27 @@
<classpathentry kind="src" path="test/unit"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.grails.ide.eclipse.core.CLASSPATH_CONTAINER"/>
<classpathentry kind="lib" path="lib/commons-cli-1.2.jar"/>
<classpathentry kind="lib" path="lib/commons-codec-1.3.jar"/>
<classpathentry kind="lib" path="lib/commons-httpclient.jar"/>
<classpathentry kind="lib" path="lib/commons-io-1.4.jar"/>
<classpathentry kind="lib" path="lib/commons-lang-2.5.jar"/>
<classpathentry kind="lib" path="lib/commons-pool-1.5.6.jar"/>
<classpathentry kind="lib" path="lib/geronimo-j2ee-management_1.0_spec-1.0.jar"/>
<classpathentry kind="lib" path="lib/gson-1.7.1.jar"/>
<classpathentry kind="lib" path="lib/jedis-2.0.0.jar"/>
<classpathentry kind="lib" path="lib/jodconverter-2.2.2.jar"/>
<classpathentry kind="lib" path="lib/juh-3.0.1.jar"/>
<classpathentry kind="lib" path="lib/junit-4.8.2.jar"/>
<classpathentry kind="lib" path="lib/jurt-3.0.1.jar"/>
<classpathentry kind="lib" path="lib/ridl-3.0.1.jar"/>
<classpathentry kind="lib" path="lib/unoil-3.0.1.jar"/>
<classpathentry kind="lib" path="lib/xstream-1.3.1.jar"/>
<classpathentry kind="lib" path="lib/jcl-over-slf4j-1.7.2.jar"/>
<classpathentry kind="lib" path="lib/jul-to-slf4j-1.7.2.jar"/>
<classpathentry kind="lib" path="lib/log4j-over-slf4j-1.7.2.jar"/>
<classpathentry kind="lib" path="lib/logback-classic-1.0.9.jar"/>
<classpathentry kind="lib" path="lib/logback-core-1.0.9.jar"/>
<classpathentry kind="lib" path="lib/slf4j-api-1.7.2.jar"/>
<classpathentry kind="output" path="target/eclipseclasses"/>
</classpath>

View File

@ -43,6 +43,14 @@ dependencies {
compile 'commons-lang:commons-lang:2.5'
compile 'com.google.code.gson:gson:1.7.1'
// Logging
// compile 'ch.qos.logback:logback-core:1.0.9@jar'
// compile 'ch.qos.logback:logback-classic:1.0.9@jar'
// compile 'org.slf4j:log4j-over-slf4j:1.7.2@jar'
// compile 'org.slf4j:jcl-over-slf4j:1.7.2@jar'
// compile 'org.slf4j:jul-to-slf4j:1.7.2@jar'
// compile 'org.slf4j:slf4j-api:1.7.2@jar'
//junit
compile 'junit:junit:4.8.2'
}

View File

@ -41,7 +41,7 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.ArrayList;
import java.text.DateFormat;
import org.bigbluebutton.api.Util;
class ApiController {
private static final Integer SESSION_TIMEOUT = 14400 // 4 hours
@ -1716,8 +1716,8 @@ class ApiController {
}
def cleanFilename(filename) {
String fname = URLDecoder.decode(filename).trim()
def notValidCharsRegExp = /[^0-9a-zA-Z_\.]/
return fname.replaceAll(notValidCharsRegExp, '-')
return Util.cleanPresentationFilename(fname)
}
def processDocumentFromRawBytes(bytes, filename, conf) {

View File

@ -21,6 +21,7 @@ package org.bigbluebutton.web.controllers
import grails.converters.*
import org.bigbluebutton.web.services.PresentationService
import org.bigbluebutton.presentation.UploadedPresentation
import org.bigbluebutton.api.Util;
class PresentationController {
PresentationService presentationService
@ -67,14 +68,13 @@ class PresentationController {
def file = request.getFile('fileUpload')
if(file && !file.empty) {
flash.message = 'Your file has been uploaded'
// Replace any character other than a (A-Z, a-z, 0-9, _ or .) with a - (dash).
def notValidCharsRegExp = /[^0-9a-zA-Z_\.]/
log.debug "Uploaded presentation name : $params.presentation_name"
def presentationName = params.presentation_name.replaceAll(notValidCharsRegExp, '-')
def presentationName = Util.cleanPresentationFilename(params.presentation_name)
log.debug "Uploaded presentation name : $presentationName"
File uploadDir = presentationService.uploadedPresentationDirectory(params.conference, params.room, presentationName)
def newFilename = file.getOriginalFilename().replaceAll(notValidCharsRegExp, '-')
def newFilename = Util.cleanPresentationFilename(file.getOriginalFilename())
def pres = new File( uploadDir.absolutePath + File.separatorChar + newFilename )
file.transferTo(pres)

View File

@ -64,6 +64,7 @@ public class RecordingServiceHelperImp implements RecordingServiceHelper {
builder.playback {
builder.format(info.getPlaybackFormat())
builder.link(info.getPlaybackLink())
builder.duration(info.getPlaybackDuration())
}
Map<String,String> metainfo = info.getMetadata();
builder.meta{
@ -97,6 +98,7 @@ public class RecordingServiceHelperImp implements RecordingServiceHelper {
r.setEndTime(rec.end_time.text());
r.setPlaybackFormat(rec.playback.format.text());
r.setPlaybackLink(rec.playback.link.text());
r.setPlaybackDuration(rec.playback.duration.text());
Map<String, String> meta = new HashMap<String, String>();
rec.meta.children().each { anode ->

View File

@ -177,23 +177,27 @@ public class MeetingService {
ArrayList<Playback> plays=new ArrayList<Playback>();
plays.add(new Playback(r.getPlaybackFormat(), r.getPlaybackLink(), getDurationRecording(r.getEndTime(), r.getStartTime())));
plays.add(new Playback(r.getPlaybackFormat(), r.getPlaybackLink(), getDurationRecording(r.getPlaybackDuration(), r.getEndTime(), r.getStartTime())));
r.setPlaybacks(plays);
map.put(r.getId(), r);
}
else{
Recording rec=map.get(r.getId());
rec.getPlaybacks().add(new Playback(r.getPlaybackFormat(), r.getPlaybackLink(), getDurationRecording(r.getEndTime(), r.getStartTime())));
rec.getPlaybacks().add(new Playback(r.getPlaybackFormat(), r.getPlaybackLink(), getDurationRecording(r.getPlaybackDuration(), r.getEndTime(), r.getStartTime())));
}
}
return map;
}
private int getDurationRecording(String end, String start){
private int getDurationRecording(String playbackDuration, String end, String start) {
int duration;
try{
if (!playbackDuration.equals("")) {
duration = (int)Math.ceil((Long.parseLong(playbackDuration))/60000.0);
} else {
duration = (int)Math.ceil((Long.parseLong(end) - Long.parseLong(start))/60000.0);
}
}catch(Exception e){
log.debug(e.getMessage());
duration = 0;

View File

@ -29,12 +29,12 @@ import java.util.concurrent.ConcurrentMap;
import org.apache.commons.lang.RandomStringUtils;
public class Meeting {
private static final int MILLIS_IN_A_MINUTE = 60000;
private static final long MILLIS_IN_A_MINUTE = 60000;
private String name;
private String extMeetingId;
private String intMeetingId;
private int duration = 0;
private long duration = 0;
private long createdTime = 0;
private long startTime = 0;
private long endTime = 0;

View File

@ -40,6 +40,7 @@ public class Recording {
private String state;
private String playbackLink;
private String playbackFormat;
private String playbackDuration;
public String getId() {
@ -98,6 +99,14 @@ public class Recording {
this.playbackFormat = playbackFormat;
}
public String getPlaybackDuration() {
return playbackDuration;
}
public void setPlaybackDuration(String playbackDuration) {
this.playbackDuration = playbackDuration;
}
public Map<String, String> getMetadata() {
return metadata;
}

View File

@ -101,6 +101,7 @@ public class RedisMessagingService implements MessagingService {
public void send(String channel, String message) {
Jedis jedis = redisPool.getResource();
try {
log.debug("Sending to channel[" + channel + "] message[" + message + "]");
jedis.publish(channel, message);
} catch(Exception e){
log.warn("Cannot publish the message to redis",e);

View File

@ -44,7 +44,7 @@ public class SwfSlidesGenerationProgressNotifier {
private void notifyProgressListener(Map<String, Object> msg) {
if(messagingService != null){
Gson gson= new Gson();
String updateMsg=gson.toJson(msg);
String updateMsg = gson.toJson(msg);
log.debug("SENDING: " + updateMsg);
messagingService.send(MessagingConstants.PRESENTATION_CHANNEL, updateMsg);
log.debug("SENT: " + updateMsg);
@ -78,10 +78,14 @@ public class SwfSlidesGenerationProgressNotifier {
}
String xml = generatedSlidesInfoHelper.generateUploadedPresentationInfo(pres);
String escape_xml = StringEscapeUtils.escapeXml(xml);
MessageBuilder builder = new ConversionUpdateMessage.MessageBuilder(pres);
builder.messageKey(ConversionMessageConstants.CONVERSION_COMPLETED_KEY);
builder.slidesInfo(escape_xml);
builder.numberOfPages(pres.getNumberOfPages());
notifyProgressListener(builder.build().getMessage());
}