Index: lams_central/src/java/org/lamsfoundation/lams/webservice/PresenceChatLoggerAction.java =================================================================== diff -u --- lams_central/src/java/org/lamsfoundation/lams/webservice/PresenceChatLoggerAction.java (revision 0) +++ lams_central/src/java/org/lamsfoundation/lams/webservice/PresenceChatLoggerAction.java (revision 61df3f3f473a3619f93c63ceb879ae36438020e8) @@ -0,0 +1,166 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +package org.lamsfoundation.lams.webservice; + +import java.io.IOException; +import java.util.Date; +import java.util.List; + +import javax.servlet.ServletContext; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.axis.MessageContext; +import org.apache.axis.transport.http.HTTPConstants; +import org.apache.log4j.Logger; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.lamsfoundation.lams.integration.service.IIntegrationService; +import org.lamsfoundation.lams.presence.model.PresenceChatMessage; +import org.lamsfoundation.lams.presence.service.IPresenceChatLoggerService; +import org.lamsfoundation.lams.usermanagement.service.IUserManagementService; +import org.lamsfoundation.lams.util.WebUtil; +import org.lamsfoundation.lams.web.action.LamsDispatchAction; +import org.lamsfoundation.lams.web.util.HttpSessionManager; +import org.springframework.web.context.WebApplicationContext; +import org.springframework.web.context.support.WebApplicationContextUtils; + +import com.thoughtworks.xstream.XStream; + +/** +* @author Paul Georges + +* ----------------XDoclet Tags-------------------- +* +* @struts:action path="/PresenceChatLogger" +* parameter="method" +* validate="false" +* +* ----------------XDoclet Tags-------------------- +*/ +public class PresenceChatLoggerAction extends LamsDispatchAction { + + private static Logger logger = Logger.getLogger(PresenceChatLoggerAction.class); + + public ActionForward getConversationHistory(ActionMapping mapping, + ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws IOException, ServletException { + try { + String roomName = WebUtil.readStrParam(request, "roomName"); + String from = WebUtil.readStrParam(request, "from"); + String to = WebUtil.readStrParam(request, "to"); + + WebApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(HttpSessionManager + .getInstance().getServletContext()); + IPresenceChatLoggerService presenceChatLoggerService = (IPresenceChatLoggerService) ctx.getBean("presenceChatLoggerService"); + + List messages = presenceChatLoggerService.getMessagesByConversation(from, to, roomName); + + writeAJAXResponse(response, buildConversationXML(to, messages)); + + } catch (Exception e) { + logger.error(e.getMessage()); + } + + return null; + } + + public ActionForward getGroupHistory(ActionMapping mapping, + ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws IOException, ServletException { + + try { + String roomName = WebUtil.readStrParam(request, "roomName"); + + WebApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(HttpSessionManager + .getInstance().getServletContext()); + IPresenceChatLoggerService presenceChatLoggerService = (IPresenceChatLoggerService) ctx.getBean("presenceChatLoggerService"); + + List messages = presenceChatLoggerService.getMessagesByRoomName(roomName); + + writeAJAXResponse(response, buildGroupHistoryXML(messages)); + } catch (Exception e) { + logger.error(e.getMessage()); + } + + return null; + } + + public ActionForward saveMessage(ActionMapping mapping, + ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws IOException, ServletException { + try { + String roomName = WebUtil.readStrParam(request, "roomName"); + String from = WebUtil.readStrParam(request, "from"); + String to = WebUtil.readStrParam(request, "to"); + String message = WebUtil.readStrParam(request, "message"); + + if(to.compareTo("null") == 0){ + to = null; + } + + WebApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(HttpSessionManager + .getInstance().getServletContext()); + IPresenceChatLoggerService presenceChatLoggerService = (IPresenceChatLoggerService) ctx.getBean("presenceChatLoggerService"); + + presenceChatLoggerService.createPresenceChatMessage(roomName, from, to, new Date(), message); + } catch (Exception e) { + logger.error(e.getMessage()); + } + + return null; + } + + private String buildConversationXML(String nick, List messages){ + String xmlOutput = "" + nick + ""; + + XStream xstream = new XStream(); + xstream.alias("clause", PresenceChatMessage.class); + + for(PresenceChatMessage message: messages){ + xmlOutput += xstream.toXML(message); + } + + xmlOutput += ""; + + return xmlOutput; + } + + private String buildGroupHistoryXML(List messages){ + String xmlOutput = ""; + + XStream xstream = new XStream(); + xstream.alias("clause", PresenceChatMessage.class); + + for(PresenceChatMessage message: messages){ + xmlOutput += xstream.toXML(message); + } + + xmlOutput += ""; + + return xmlOutput; + } +} Fisheye: Tag 61df3f3f473a3619f93c63ceb879ae36438020e8 refers to a dead (removed) revision in file `lams_central/src/java/org/lamsfoundation/lams/webservice/PresenceChatLoggerServlet.java'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_central/web/fckeditor/editor/plugins/videorecorder/VideoRecorderFCKEditor.swf =================================================================== diff -u -r01f1d853607cc14f73aa2429275084f4890f92b7 -r61df3f3f473a3619f93c63ceb879ae36438020e8 Binary files differ Index: lams_central/web/images/icons/user_offline.png =================================================================== diff -u Binary files differ Index: lams_central/web/images/icons/user_online.png =================================================================== diff -u Binary files differ Index: lams_central/web/includes/javascript/jquery-ui/themes/cupertino/ui.tabs.css =================================================================== diff -u -rec61f5d738bce3513b4e5204e011a68476a9c165 -r61df3f3f473a3619f93c63ceb879ae36438020e8 --- lams_central/web/includes/javascript/jquery-ui/themes/cupertino/ui.tabs.css (.../ui.tabs.css) (revision ec61f5d738bce3513b4e5204e011a68476a9c165) +++ lams_central/web/includes/javascript/jquery-ui/themes/cupertino/ui.tabs.css (.../ui.tabs.css) (revision 61df3f3f473a3619f93c63ceb879ae36438020e8) @@ -7,5 +7,4 @@ .ui-tabs .ui-tabs-nav li.ui-tabs-selected { padding-bottom: .1em; border-bottom: 0; } .ui-tabs .ui-tabs-panel { padding: 1em 1.4em; display: block; border: 0; background: none; } .ui-tabs .ui-tabs-hide { display: none !important; } -.ui-tabs .ui-tabs-wrapper { overflow: hidden } -.ui-tabs .ui-tabs-wrapped {} \ No newline at end of file +.ui-tabs .ui-tabs-wrapped { margin-left: 0px; margin-right: 0px;} \ No newline at end of file Index: lams_central/web/includes/javascript/jquery-ui/ui/ui.tabs.scrollable.js =================================================================== diff -u -rd9871f7048adee8daed6b190c22da18e78ec317c -r61df3f3f473a3619f93c63ceb879ae36438020e8 --- lams_central/web/includes/javascript/jquery-ui/ui/ui.tabs.scrollable.js (.../ui.tabs.scrollable.js) (revision d9871f7048adee8daed6b190c22da18e78ec317c) +++ lams_central/web/includes/javascript/jquery-ui/ui/ui.tabs.scrollable.js (.../ui.tabs.scrollable.js) (revision 61df3f3f473a3619f93c63ceb879ae36438020e8) @@ -10,10 +10,6 @@ * Depends: * ui.core.js */ - -function breakTabs(){ - var i = 0; -} (function($) { @@ -68,7 +64,6 @@ this.tabLabels = $(".ui-tabs-label"); this.imagesInTabs = $("img", this.list); this.$panels = $([]); - this.leftMostScroll = 25; } else{ this.list = this.element.is('div') ? this.element.children('ul:first, ol:first').eq(0) : this.element; @@ -81,9 +76,12 @@ this.$tabs.each(function(i, a) { var href = $(a).attr('href'); + // Fix tab IDs in IE6/7 + href = href.substring(href.indexOf("#")); + // inline tab if (fragmentId.test(href)) - self.$panels = self.$panels.add(self._sanitizeSelector(href)); + self.$panels = self.$panels.add(self._sanitizeSelector(href)); // remote tab else if (href != '#') { // prevent loading the page itself if href is just "#" @@ -117,12 +115,10 @@ if (this.element.is('div')) { this.element.addClass('ui-tabs ui-widget ui-widget-content ui-corner-all'); } - this.wrapper.addClass('ui-tabs-wrapper ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all'); + this.wrapper.addClass('ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all'); this.list.addClass('ui-tabs-wrapped'); this.$lis.addClass('ui-state-default ui-corner-top'); this.$panels.addClass('ui-tabs-panel ui-widget-content ui-corner-bottom'); - - //this.tabsHolder.animate( { scrollLeft: this.leftMostScroll}, this.scrollSpeed ) } else{ // attach necessary classes for styling @@ -362,45 +358,45 @@ }); if(o.scrollable){ - this.scrollableWidth = 0; + /* + var totalWidth = 0; - for(var i = 0; i < this.tabLabels.length; i++){ - this.scrollableWidth += this.tabLabels[i].innerHTML.length * o.characterWidth; - } + this.$lis.each(function(){ + totalWidth += this.offsetWidth; + }); - for(var i = 0; i < this.imagesInTabs.length; i++){ - this.scrollableWidth += this.imagesInTabs[i].width; - } + totalWidth += (this.$lis.length - 1) * 7 + 3; - this.scrollableWidth += o.margins; + this.scrollableWidth = totalWidth; + */ - $(".ui-tabs-wrapped").css("width", this.scrollableWidth + "px"); - - if(init){ - this.tabsHolder.animate( { scrollLeft: this.leftMostScroll }, this.scrollSpeed ) + if(this.$lis.length > 1){ + var lastElem = this.$lis[this.$lis.length - 1]; + var beforeLastElem = this.$lis[this.$lis.length - 2]; + + if(this.$lis[0].offsetLeft != 0){ + this.scrollableWidth = beforeLastElem.offsetLeft + beforeLastElem.offsetWidth + lastElem.offsetWidth; + }else{ + this.scrollableWidth = this.$lis[0].parentNode.parentNode.offsetLeft + beforeLastElem.offsetLeft + beforeLastElem.offsetWidth + lastElem.offsetWidth; + } } + else{ + var lastElem = this.$lis[this.$lis.length - 1]; + + if(this.$lis[0].offsetLeft != 0){ + this.scrollableWidth = lastElem.offsetLeft + lastElem.offsetWidth; + }else{ + this.scrollableWidth = this.$lis[0].parentNode.parentNode.offsetLeft + lastElem.offsetLeft + lastElem.offsetWidth; + } + + } + + $(".ui-tabs-wrapped").css("width", this.scrollableWidth + "px"); } // disable click if event is configured to something else if (o.event != 'click') this.$tabs.bind('click.tabs', function(){return false;}); }, - - _tabWidth: function(index) { - var self = this, o = this.options; - var tabWidth = 0; - if(o.scrollable){ - tabWidth += this.tabLabels[index].innerHTML.length * o.characterWidth; - - var imagesInTab = $("img", this.list[index]); - for(var i = 0; i < imagesInTab.length; i++){ - tabWidth+= imagesInTab[i].width; - } - - tabWidth += o.margins; - - return tabWidth; - } - }, scrollLeft: function() { var o = this.options; @@ -409,16 +405,24 @@ //var scrollOffset = _tabWidth(this.scrolledTab - 1); var scrollOffset = o.scrollOffset; if(this.tabsHolder[0].scrollLeft < scrollOffset){ - newScrollLeft = this.leftMostScroll; + newScrollLeft = 0; } else{ newScrollLeft = this.tabsHolder[0].scrollLeft - scrollOffset; } - this.tabsHolder.animate( { scrollLeft: newScrollLeft}, this.scrollSpeed ) + this.tabsHolder.animate( { scrollLeft: newScrollLeft}, this.scrollSpeed ); }, + scrollTo: function(position) { + if(this.$lis[0].offsetLeft != 0){ + this.tabsHolder.animate( { scrollLeft: position - this.$lis[0].offsetLeft}, this.scrollSpeed ); + }else{ + this.tabsHolder.animate( { scrollLeft: position}, this.scrollSpeed ); + } + }, + scrollRight: function() { var o = this.options; var newScrollRight; @@ -432,7 +436,7 @@ newScrollRight = this.tabsHolder[0].scrollLeft + scrollOffset; } - this.tabsHolder.animate( { scrollLeft: newScrollRight}, this.scrollSpeed ) + this.tabsHolder.animate( { scrollLeft: newScrollRight}, this.scrollSpeed ); }, destroy: function() { @@ -533,7 +537,6 @@ this._trigger('add', null, this._ui(this.$tabs[index], this.$panels[index])); }, - remove: function(index) { var o = this.options, $li = this.$lis.eq(index).remove(), $panel = this.$panels.eq(index).remove(); @@ -677,7 +680,7 @@ tabTemplate: '
  • #{label}
  • ', scrollable: false, characterWidth: 9, - margins: 5, + margins: 6, scrollSpeed: 150, scrollOffset: 100 } Index: lams_common/src/java/org/lamsfoundation/lams/presence/dao/IPresenceChatMessageDAO.java =================================================================== diff -u -rec61f5d738bce3513b4e5204e011a68476a9c165 -r61df3f3f473a3619f93c63ceb879ae36438020e8 --- lams_common/src/java/org/lamsfoundation/lams/presence/dao/IPresenceChatMessageDAO.java (.../IPresenceChatMessageDAO.java) (revision ec61f5d738bce3513b4e5204e011a68476a9c165) +++ lams_common/src/java/org/lamsfoundation/lams/presence/dao/IPresenceChatMessageDAO.java (.../IPresenceChatMessageDAO.java) (revision 61df3f3f473a3619f93c63ceb879ae36438020e8) @@ -37,6 +37,6 @@ List getMessagesByRoomName(String roomName); - List getMessagesByConversation(String from, String to); + List getMessagesByConversation(String from, String to, String roomName); } Index: lams_common/src/java/org/lamsfoundation/lams/presence/dao/hibernate/PresenceChatMessageDAO.java =================================================================== diff -u -rec61f5d738bce3513b4e5204e011a68476a9c165 -r61df3f3f473a3619f93c63ceb879ae36438020e8 --- lams_common/src/java/org/lamsfoundation/lams/presence/dao/hibernate/PresenceChatMessageDAO.java (.../PresenceChatMessageDAO.java) (revision ec61f5d738bce3513b4e5204e011a68476a9c165) +++ lams_common/src/java/org/lamsfoundation/lams/presence/dao/hibernate/PresenceChatMessageDAO.java (.../PresenceChatMessageDAO.java) (revision 61df3f3f473a3619f93c63ceb879ae36438020e8) @@ -34,14 +34,14 @@ public class PresenceChatMessageDAO extends BaseDAO implements IPresenceChatMessageDAO { - private static final String BY_MESSAGE_ID = "from " + PresenceChatMessage.class.getName() - + " where uid=? order by create_date desc"; + private static final String BY_MESSAGE_ID = "from " + PresenceChatMessage.class.getName() + " msg" + + " where msg.uid=? order by msg.dateSent desc"; - private static final String BY_CONVERSATION = "from " + PresenceChatMessage.class.getName() - + " where from_user=? and to_user=? order by create_date asc"; + private static final String BY_CONVERSATION = "from " + PresenceChatMessage.class.getName() + " msg" + + " where (msg.from=:from and msg.to=:to) or (msg.from=:to and msg.to=:from) and msg.roomName=:roomName order by msg.dateSent asc"; - private static final String BY_ROOM_NAME = "from " + NotebookEntry.class.getName() - + " where room_name=? order by create_date asc"; + private static final String BY_ROOM_NAME = "from " + PresenceChatMessage.class.getName() + " msg" + + " where msg.roomName=? and msg.to is null order by msg.dateSent asc"; public void saveOrUpdate(PresenceChatMessage presenceChatMessage) { this.getHibernateTemplate().saveOrUpdate(presenceChatMessage); @@ -57,9 +57,8 @@ else return null; } - public List getMessagesByConversation(String from, - String to) { - return (List)(getHibernateTemplate().find(BY_CONVERSATION, new Object[]{from, to})); + public List getMessagesByConversation(String from, String to, String roomName) { + return (List)(getHibernateTemplate().findByNamedParam(BY_CONVERSATION, new String[]{"from", "to", "roomName"}, new Object[]{from, to, roomName})); } public List getMessagesByRoomName(String roomName) { Index: lams_common/src/java/org/lamsfoundation/lams/presence/model/PresenceChatMessage.java =================================================================== diff -u -rec61f5d738bce3513b4e5204e011a68476a9c165 -r61df3f3f473a3619f93c63ceb879ae36438020e8 --- lams_common/src/java/org/lamsfoundation/lams/presence/model/PresenceChatMessage.java (.../PresenceChatMessage.java) (revision ec61f5d738bce3513b4e5204e011a68476a9c165) +++ lams_common/src/java/org/lamsfoundation/lams/presence/model/PresenceChatMessage.java (.../PresenceChatMessage.java) (revision 61df3f3f473a3619f93c63ceb879ae36438020e8) @@ -47,6 +47,10 @@ private String message; + public PresenceChatMessage() { + + } + public PresenceChatMessage(Long uid, String roomName, String from, String to, Date dateSent, String message) { super(); Index: lams_common/src/java/org/lamsfoundation/lams/presence/service/IPresenceChatLoggerService.java =================================================================== diff -u -rec61f5d738bce3513b4e5204e011a68476a9c165 -r61df3f3f473a3619f93c63ceb879ae36438020e8 --- lams_common/src/java/org/lamsfoundation/lams/presence/service/IPresenceChatLoggerService.java (.../IPresenceChatLoggerService.java) (revision ec61f5d738bce3513b4e5204e011a68476a9c165) +++ lams_common/src/java/org/lamsfoundation/lams/presence/service/IPresenceChatLoggerService.java (.../IPresenceChatLoggerService.java) (revision 61df3f3f473a3619f93c63ceb879ae36438020e8) @@ -39,8 +39,8 @@ PresenceChatMessage getMessageById(Long id); List getMessagesByRoomName(String roomName); - - List getMessagesByConversation(String from, String to); + + List getMessagesByConversation(String from, String to, String roomName); void saveOrUpdatePresenceChatMessage(PresenceChatMessage presenceChatMessage); Index: lams_common/src/java/org/lamsfoundation/lams/presence/service/PresenceChatLoggerService.java =================================================================== diff -u -rec61f5d738bce3513b4e5204e011a68476a9c165 -r61df3f3f473a3619f93c63ceb879ae36438020e8 --- lams_common/src/java/org/lamsfoundation/lams/presence/service/PresenceChatLoggerService.java (.../PresenceChatLoggerService.java) (revision ec61f5d738bce3513b4e5204e011a68476a9c165) +++ lams_common/src/java/org/lamsfoundation/lams/presence/service/PresenceChatLoggerService.java (.../PresenceChatLoggerService.java) (revision 61df3f3f473a3619f93c63ceb879ae36438020e8) @@ -58,8 +58,8 @@ return presenceChatMessageDAO.getMessagesByRoomName(roomName); } - public List getMessagesByConversation(String from, String to){ - return presenceChatMessageDAO.getMessagesByConversation(from, to); + public List getMessagesByConversation(String from, String to, String roomName){ + return presenceChatMessageDAO.getMessagesByConversation(from, to, roomName); } public void saveOrUpdatePresenceChatMessage(PresenceChatMessage presenceChatMessage){ Index: lams_common/src/java/org/lamsfoundation/lams/util/Base64StringToImageUtil.java =================================================================== diff -u --- lams_common/src/java/org/lamsfoundation/lams/util/Base64StringToImageUtil.java (revision 0) +++ lams_common/src/java/org/lamsfoundation/lams/util/Base64StringToImageUtil.java (revision 61df3f3f473a3619f93c63ceb879ae36438020e8) @@ -0,0 +1,50 @@ +package org.lamsfoundation.lams.util; + +import java.awt.image.BufferedImage; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.InputStream; + +import javax.imageio.ImageIO; + +import org.apache.log4j.Logger; + +import sun.misc.BASE64Decoder; + +public class Base64StringToImageUtil { + private static Logger log = Logger.getLogger(Base64StringToImageUtil.class); + + public static boolean create(String dir, String filename, String ext, String data){ + try { + BASE64Decoder decoder = new BASE64Decoder(); + + byte[] byteArray = decoder.decodeBuffer(data); + + InputStream in = new ByteArrayInputStream(byteArray); + BufferedImage image = javax.imageio.ImageIO.read(in); + + ByteArrayOutputStream os = new ByteArrayOutputStream(); + + try { + // put buffer data into byte output stream + ImageIO.write(image, ext, os); + byte[] imagebytes = os.toByteArray(); + + // write bytes into file + FileOutputStream fileos = new FileOutputStream(new File(dir + filename + "." + ext)); + fileos.write(imagebytes); + fileos.close(); + + return true; + }catch (Exception e) { + log.error(e); + } + }catch (Exception e) { + log.error(e); + } + + return false; + } +} Index: lams_flash/src/central/flex/VideoRecorder/src/AddCommentPopUp.mxml =================================================================== diff -u -r01f1d853607cc14f73aa2429275084f4890f92b7 -r61df3f3f473a3619f93c63ceb879ae36438020e8 --- lams_flash/src/central/flex/VideoRecorder/src/AddCommentPopUp.mxml (.../AddCommentPopUp.mxml) (revision 01f1d853607cc14f73aa2429275084f4890f92b7) +++ lams_flash/src/central/flex/VideoRecorder/src/AddCommentPopUp.mxml (.../AddCommentPopUp.mxml) (revision 61df3f3f473a3619f93c63ceb879ae36438020e8) @@ -1,34 +1,68 @@ - + + + + - + - + Index: lams_flash/src/central/flex/VideoRecorder/src/GetRecordingDetailsPopUp.mxml =================================================================== diff -u -r01f1d853607cc14f73aa2429275084f4890f92b7 -r61df3f3f473a3619f93c63ceb879ae36438020e8 --- lams_flash/src/central/flex/VideoRecorder/src/GetRecordingDetailsPopUp.mxml (.../GetRecordingDetailsPopUp.mxml) (revision 01f1d853607cc14f73aa2429275084f4890f92b7) +++ lams_flash/src/central/flex/VideoRecorder/src/GetRecordingDetailsPopUp.mxml (.../GetRecordingDetailsPopUp.mxml) (revision 61df3f3f473a3619f93c63ceb879ae36438020e8) @@ -1,24 +1,33 @@ - + + + + - - + + - + Index: lams_flash/src/central/flex/VideoRecorder/src/HTTPServices.as =================================================================== diff -u -r01f1d853607cc14f73aa2429275084f4890f92b7 -r61df3f3f473a3619f93c63ceb879ae36438020e8 --- lams_flash/src/central/flex/VideoRecorder/src/HTTPServices.as (.../HTTPServices.as) (revision 01f1d853607cc14f73aa2429275084f4890f92b7) +++ lams_flash/src/central/flex/VideoRecorder/src/HTTPServices.as (.../HTTPServices.as) (revision 61df3f3f473a3619f93c63ceb879ae36438020e8) @@ -5,7 +5,7 @@ // create and set the service var videoRecorderActions:HTTPService = new HTTPService(); - videoRecorderActions.url = serverUrl; + videoRecorderActions.url = servletUrl; videoRecorderActions.method = "POST"; videoRecorderActions.resultFormat = "e4x"; videoRecorderActions.request.method = "getRecordingsByToolSessionIdAndUserId"; @@ -51,7 +51,7 @@ private function saveRecordingToServer(userId:int, title:String, description:String, filename:String, rating:Number, toolSessionId:int, recordingId:int):void{ // create and set the service var videoRecorderActions:HTTPService = new HTTPService(); - videoRecorderActions.url = serverUrl; + videoRecorderActions.url = servletUrl; videoRecorderActions.method = "POST"; videoRecorderActions.resultFormat = "e4x"; videoRecorderActions.request.method = "saveRecording"; @@ -95,7 +95,7 @@ // create and set the service var videoRecorderActions:HTTPService = new HTTPService(); - videoRecorderActions.url = serverUrl; + videoRecorderActions.url = servletUrl; videoRecorderActions.method = "POST"; videoRecorderActions.resultFormat = "e4x"; videoRecorderActions.request.method = "saveComment"; @@ -142,7 +142,7 @@ // create and set the service var videoRecorderActions:HTTPService = new HTTPService(); - videoRecorderActions.url = serverUrl; + videoRecorderActions.url = servletUrl; videoRecorderActions.method = "POST"; videoRecorderActions.resultFormat = "e4x"; videoRecorderActions.request.method = "saveRating"; @@ -191,7 +191,7 @@ // creates an httpservice and saves a rating private function deleteRecordingFromServer(recordingId:int):void{ var videoRecorderActions:HTTPService = new HTTPService(); - videoRecorderActions.url = serverUrl; + videoRecorderActions.url = servletUrl; videoRecorderActions.method = "POST"; videoRecorderActions.resultFormat = "e4x"; videoRecorderActions.request.method = "deleteRecording"; @@ -217,14 +217,4 @@ // fault handler for detele recording private function deleteRecordingFaultHandler(e:FaultEvent):void { Alert.show(e.toString()); -} - -// handler for successful save preview image -private function savePreviewImageSuccessHandler(e:ResultEvent):void { - Alert.show(e.toString()); -} - -// fault handler for save preview image - private function savePreviewImageFaultHandler(e:FaultEvent):void { - Alert.show(e.toString()); } \ No newline at end of file Index: lams_flash/src/central/flex/VideoRecorder/src/VideoProfile.mxml =================================================================== diff -u -r01f1d853607cc14f73aa2429275084f4890f92b7 -r61df3f3f473a3619f93c63ceb879ae36438020e8 --- lams_flash/src/central/flex/VideoRecorder/src/VideoProfile.mxml (.../VideoProfile.mxml) (revision 01f1d853607cc14f73aa2429275084f4890f92b7) +++ lams_flash/src/central/flex/VideoRecorder/src/VideoProfile.mxml (.../VideoProfile.mxml) (revision 61df3f3f473a3619f93c63ceb879ae36438020e8) @@ -1,7 +1,10 @@ - + - + - + Index: lams_flash/src/central/flex/VideoRecorder/src/VideoRecorder.mxml =================================================================== diff -u -r01f1d853607cc14f73aa2429275084f4890f92b7 -r61df3f3f473a3619f93c63ceb879ae36438020e8 --- lams_flash/src/central/flex/VideoRecorder/src/VideoRecorder.mxml (.../VideoRecorder.mxml) (revision 01f1d853607cc14f73aa2429275084f4890f92b7) +++ lams_flash/src/central/flex/VideoRecorder/src/VideoRecorder.mxml (.../VideoRecorder.mxml) (revision 61df3f3f473a3619f93c63ceb879ae36438020e8) @@ -58,6 +58,7 @@ [Bindable] private var allowRatings:Boolean; [Bindable] private var red5ServerUrl:String; [Bindable] private var serverUrl:String; + [Bindable] private var servletUrl:String; [Bindable] private var languageXML:XML; [Bindable] private var mode:String; @@ -75,10 +76,8 @@ // ui stuff private var getDetailsPopUp:GetRecordingDetailsPopUp; - private var addCommentPopUp:AddCommentPopUp; - private var previewImage:BitmapData; + private var addCommentPopUp:AddCommentPopUp; - // icon embeds [Embed(source="../../../../../../lams_central/web/images/icons/control_play.png")] [Bindable] private var playIcon:Class; [Embed(source="../../../../../../lams_central/web/images/icons/control_pause.png")] [Bindable] private var pauseIcon:Class; @@ -111,8 +110,8 @@ if(toolSessionId == 0){ contentEditable = true; userId = 1; - toolSessionId = 7; - toolContentId = 8; + toolSessionId = 1; + toolContentId = 5; allowUseVoice = true; allowUseCamera = true; allowComments = true; @@ -163,8 +162,12 @@ red5ServerUrl += red5App; // add the servlet location to the server url to complete - serverUrl += servletLocation; + servletUrl = serverUrl + servletLocation; + // add server url and servlet url to video display + videoDisplay.serverUrl = serverUrl; + videoDisplay.servletUrl = servletUrl; + // if the cam is to be used, set that up if(allowUseCamera){ cam = VideoDisplayUtil.setupCamera(); @@ -206,6 +209,13 @@ enableVideoList(true); seekSlider.enable(false); + // if content is not editable + if(!contentEditable){ + // disable view and record buttons + viewCameraButton.enabled = false; + startRecButton.enabled = false; + } + // create the connection createConnection(); } @@ -282,7 +292,7 @@ private function addListeners():void{ videoInformation.ratingButton.addEventListener(RatingEvent.SELECTION_CHANGE, addRatingClick); videoInformation.addCommentButton.addEventListener(MouseEvent.CLICK, addCommentClick); - videoList.addEventListener(MouseEvent.CLICK, deleteClick); + videoList.addEventListener("recordingDeleted", confirmDeleteClick); sortButtonGroup.addEventListener(SortEvent.EVENT_TYPE, sortRecordingsHandler); playButton.addEventListener(MouseEvent.CLICK, playClick); startRecButton.addEventListener(MouseEvent.CLICK, startRecordingClick); @@ -413,7 +423,7 @@ var rating:Number = 0; // call the http service to save a recording - saveRecordingToServer(userId, title, description, filename + ".flv", rating, toolSessionId, recordingId); + saveRecordingToServer(userId, title, description, filename, rating, toolSessionId, recordingId); } // if the given popup is of type addCommentPopUp else if(event.target == addCommentPopUp){ @@ -459,7 +469,7 @@ private function startRecordingClick(event:MouseEvent):void{ if(!videoDisplay.isPublishing){ filename = VideoDisplayUtil.createFilename(toolSessionId, userId); - videoDisplay.startPublish(filename); + videoDisplay.startPublish(filename, true); } else if(videoDisplay.isPublishing) videoDisplay.stopPublish(); @@ -486,33 +496,30 @@ } // delete recording click handler - private function deleteClick(event:MouseEvent):void{ - if(event.target.hasOwnProperty("id") && event.target.id == "deleteButton"){ - Alert.show(dictionary.getLabel("videorecorder.message.sure.delete"), dictionary.getLabel("videorecorder.confirm"), 3, this, confirmDeleteClick); - } + private function confirmDeleteClick(event:Event):void{ + deleteRecordingFromServer(VideoProfile(event.target).data.recordingId); + videoInformation.resetInformation(); + videoDisplay.reset(); } - // confirm delete click handler - private function confirmDeleteClick(event:CloseEvent):void{ - if (event.detail==Alert.YES){ - var recordingId:int = itemClicked.recordingId; - deleteRecordingFromServer(recordingId); - videoInformation.resetInformation(); - videoDisplay.reset(); - } - } - // click handler for the videoDataGrid list private function videoListClick(event:ListEvent):void { - if(videoList.enabled){ + if(videoList.enabled && !event.currentTarget.isPrototypeOf(Button)){ // reset video information videoInformation.resetInformation(); // store last item clicked itemClicked = event.itemRenderer.data; - // enable video information buttons - videoInformation.enableVideoInformationButtons(true); + // if content is editable + if(contentEditable){ + // enable video information buttons + videoInformation.enableVideoInformationButtons(true); + } + else{ + videoInformation.enableVideoInformationButtons(false); + } + // scroll the video information box back up to top videoInformation.verticalScrollPosition = 0; @@ -552,8 +559,7 @@ makeReadytItemClicked(); } else{ - itemClicked = null; - videoList.selectedItem = null; + resetVideoList(); videoInformation.resetInformation(); } } @@ -598,7 +604,7 @@ // reset play buttons enablePlaybackButtons(false); seekSlider.enable(false); - seekSlider.stopTimerLabel(); + seekSlider.resetSeekSliderPositon(); // set panel status label videoRecorderPanel.status = dictionary.getLabel("videorecorder.waiting"); @@ -721,8 +727,7 @@ videoRecorderPanel.status = dictionary.getLabel("videorecorder.waiting"); // clear item clicked - videoList.selectedItem = null; - itemClicked = null; + resetVideoList(); // enable buttons enablePlaybackButtons(true); @@ -810,7 +815,14 @@ } } } - + + // resets video list + private function resetVideoList():void{ + // clear item clicked + videoList.selectedItem = null; + itemClicked = null; + } + // getters public function getUserId():int{ return userId; @@ -839,12 +851,6 @@ public function getMode():String{ return mode; } - - /* - private function showDebug():void{ - DebugPopUp.getInstance().visible = true; - } - */ ]]> @@ -855,12 +861,12 @@ - - + + - + Index: lams_flash/src/central/flex/VideoRecorderFCKEditor/src/GetRecordingDetailsPopUp.mxml =================================================================== diff -u -r01f1d853607cc14f73aa2429275084f4890f92b7 -r61df3f3f473a3619f93c63ceb879ae36438020e8 --- lams_flash/src/central/flex/VideoRecorderFCKEditor/src/GetRecordingDetailsPopUp.mxml (.../GetRecordingDetailsPopUp.mxml) (revision 01f1d853607cc14f73aa2429275084f4890f92b7) +++ lams_flash/src/central/flex/VideoRecorderFCKEditor/src/GetRecordingDetailsPopUp.mxml (.../GetRecordingDetailsPopUp.mxml) (revision 61df3f3f473a3619f93c63ceb879ae36438020e8) @@ -25,8 +25,8 @@ titleLabel.text = dictionary.getLabelAndConcatenate("videorecorder.title", [":"]); descriptionLabel.text = dictionary.getLabelAndConcatenate("videorecorder.description", [":"]); - titleInput.text = dictionary.getLabelAndReplace("videorecorder.enter.something.here", ["videorecorder.title"]); - descriptionInput.text = dictionary.getLabelAndReplace("videorecorder.enter.something.here", ["videorecorder.description"]); + titleInput.text = dictionary.getLabelAndReplace("videorecorder.enter.something.here", ["videorecorder.title"], true); + descriptionInput.text = dictionary.getLabelAndReplace("videorecorder.enter.something.here", ["videorecorder.description"], true); doneButton.label = dictionary.getLabel("button.save"); doneButton.toolTip = dictionary.getLabel("videorecorder.tooltip.save.recording"); } Index: lams_flash/src/central/flex/VideoRecorderFCKEditor/src/VideoRecorderFCKEditor.mxml =================================================================== diff -u -r01f1d853607cc14f73aa2429275084f4890f92b7 -r61df3f3f473a3619f93c63ceb879ae36438020e8 --- lams_flash/src/central/flex/VideoRecorderFCKEditor/src/VideoRecorderFCKEditor.mxml (.../VideoRecorderFCKEditor.mxml) (revision 01f1d853607cc14f73aa2429275084f4890f92b7) +++ lams_flash/src/central/flex/VideoRecorderFCKEditor/src/VideoRecorderFCKEditor.mxml (.../VideoRecorderFCKEditor.mxml) (revision 61df3f3f473a3619f93c63ceb879ae36438020e8) @@ -123,21 +123,10 @@ // add the save to lams servlet location saveToLamsServletUrl = serverUrl + saveToLamsServletLocation; - /* - Alert.show( - "filename: " + filename + - "\nred5ServerUrl: " + red5ServerUrl + - "\nserverUrl: " + serverUrl + - "\nlanguageXML: " + languageXML + - "\ntoolContentId: " + toolContentId + - "\ntoolServletUrl: " + toolServletUrl + - "\nsaveToLamsServletUrl: " + saveToLamsServletUrl + - "\nred5RecordingsUrl: " + red5RecordingsUrl + - "\nsaveToLamsDestUrl: " + saveToLamsDestUrl + - "\nlamsEarDir: " + lamsEarDir + - "\nmode: " + mode); - */ - + // add server url and servlet url to video display + videoDisplay.serverUrl = serverUrl; + videoDisplay.servletUrl = toolServletUrl; + // swtich on mode switch(mode){ case "playerModeOnline":{ @@ -406,7 +395,7 @@ var description:String = getDetailsPopUp.descriptionInput.text; // call the http service to save a recording - saveRecordingToServer(title, description, filename + ".flv", toolContentId); + saveRecordingToServer(title, description, filename, toolContentId); } if(event.target is TitleWindow){ @@ -417,12 +406,14 @@ // record button click handler private function recordClick(event:MouseEvent):void{ if(!videoDisplay.isPublishing){ - if(mode == "recorderModeFCK") + if(mode == "recorderModeFCK"){ filename = VideoDisplayUtil.createFilenameForFCK(userId); - else if(mode == "recorderModeAuthor") + videoDisplay.startPublish(filename, false); + } + else if(mode == "recorderModeAuthor"){ filename = VideoDisplayUtil.createFilenameForAuthor(toolContentId); - - videoDisplay.startPublish(filename); + videoDisplay.startPublish(filename, true); + } } else if(videoDisplay.isPublishing) videoDisplay.stopPublish(); Index: lams_flash/src/common/flex/org/lamsfoundation/lams/common/conn/ImageService.as =================================================================== diff -u -r251a00158d63f52d7482fa4aa2decb78d6322a8c -r61df3f3f473a3619f93c63ceb879ae36438020e8 --- lams_flash/src/common/flex/org/lamsfoundation/lams/common/conn/ImageService.as (.../ImageService.as) (revision 251a00158d63f52d7482fa4aa2decb78d6322a8c) +++ lams_flash/src/common/flex/org/lamsfoundation/lams/common/conn/ImageService.as (.../ImageService.as) (revision 61df3f3f473a3619f93c63ceb879ae36438020e8) @@ -6,34 +6,43 @@ import mx.graphics.codec.JPEGEncoder; import mx.graphics.codec.PNGEncoder; import mx.rpc.http.HTTPService; + import mx.utils.Base64Encoder; public class ImageService extends HTTPService { - public var PNG_EXT:String = ".png"; - public var JPG_EXT:String = ".jpg"; + public var PNG_EXT:String = "png"; + public var JPG_EXT:String = "jpg"; - public function ImageService(url:String, method:String) + public function ImageService(url:String, method:String = null) { this.url = url; this.method = "POST"; this.resultFormat = "e4x"; - this.request.method = method; + + if(method){ + this.request.method = method; + } } - public function sendImageToServer(image:BitmapData, ext:String, filename:String):void{ - var rawBytes:ByteArray; + public function sendImageToServer(dir:String, filename:String, ext:String, image:BitmapData):void{ + var rawBytes:ByteArray = new ByteArray(); if(ext == PNG_EXT){ var pngEncoder:PNGEncoder = new PNGEncoder(); rawBytes = pngEncoder.encode(image); } else if(ext == JPG_EXT){ var jpegEncoder:JPEGEncoder = new JPEGEncoder(); - rawBytes = jpegEncoder.encode(image); + rawBytes = jpegEncoder.encode(image); } + var encoder:Base64Encoder = new Base64Encoder(); + encoder.encodeBytes(rawBytes); + + this.request.dir = dir; + this.request.filename = filename; this.request.ext = ext; - this.request.filname = filename; - this.request.rawBytes = rawBytes; + this.request.data = encoder.flush(); + this.send(); } } Index: lams_flash/src/common/flex/org/lamsfoundation/lams/common/ui/components/SeekSlider.mxml =================================================================== diff -u -r01f1d853607cc14f73aa2429275084f4890f92b7 -r61df3f3f473a3619f93c63ceb879ae36438020e8 --- lams_flash/src/common/flex/org/lamsfoundation/lams/common/ui/components/SeekSlider.mxml (.../SeekSlider.mxml) (revision 01f1d853607cc14f73aa2429275084f4890f92b7) +++ lams_flash/src/common/flex/org/lamsfoundation/lams/common/ui/components/SeekSlider.mxml (.../SeekSlider.mxml) (revision 61df3f3f473a3619f93c63ceb879ae36438020e8) @@ -57,7 +57,7 @@ // if the video isn't actually playing yet if(_videoDisplay.playMode == _videoDisplay.INIT_MODE){ seekSliderBar.value = 0; - seekSliderTimerLabel.text = "0:0" + " / " + VideoDisplayUtil.secondsToString(String(_videoDisplay.duration)); + seekSliderTimerLabel.text = "0:00" + " / " + VideoDisplayUtil.secondsToString(String(_videoDisplay.duration)); /* seekSliderProgress.minimum = 0; @@ -115,7 +115,7 @@ // resets the timer public function resetTimerLabel():void{ - seekSliderTimerLabel.text = "0:0 / 0:0"; + seekSliderTimerLabel.text = "0:00 / 0:00"; } // starts the timer @@ -128,7 +128,9 @@ playTimer.stop(); } - + public function resetSeekSliderPositon():void{ + seekSliderBar.value = 0; + } ]]> Index: lams_flash/src/common/flex/org/lamsfoundation/lams/common/ui/components/VideoDisplay.mxml =================================================================== diff -u -r01f1d853607cc14f73aa2429275084f4890f92b7 -r61df3f3f473a3619f93c63ceb879ae36438020e8 --- lams_flash/src/common/flex/org/lamsfoundation/lams/common/ui/components/VideoDisplay.mxml (.../VideoDisplay.mxml) (revision 01f1d853607cc14f73aa2429275084f4890f92b7) +++ lams_flash/src/common/flex/org/lamsfoundation/lams/common/ui/components/VideoDisplay.mxml (.../VideoDisplay.mxml) (revision 61df3f3f473a3619f93c63ceb879ae36438020e8) @@ -3,40 +3,54 @@ @@ -649,6 +681,9 @@ + + + Index: lams_flash/src/common/flex/org/lamsfoundation/lams/common/util/NetStreamScreenShotter.as =================================================================== diff -u --- lams_flash/src/common/flex/org/lamsfoundation/lams/common/util/NetStreamScreenShotter.as (revision 0) +++ lams_flash/src/common/flex/org/lamsfoundation/lams/common/util/NetStreamScreenShotter.as (revision 61df3f3f473a3619f93c63ceb879ae36438020e8) @@ -0,0 +1,150 @@ +package org.lamsfoundation.lams.common.util +{ + import flash.display.Bitmap; + import flash.display.BitmapData; + import flash.events.NetStatusEvent; + import flash.events.TimerEvent; + import flash.geom.Rectangle; + import flash.media.SoundTransform; + import flash.media.Video; + import flash.net.NetConnection; + import flash.net.NetStream; + import flash.utils.ByteArray; + import flash.utils.Timer; + + import mx.core.Application; + import mx.core.UIComponent; + + public class NetStreamScreenShotter extends UIComponent + { + private var _nc:NetConnection; + private var _filename:String; + private var _bufferTime:int = 2; + + private var ssTimer:Timer; + private var screenshotNs:NetStream; + private var screenshotVideo:Video; + + public function NetStreamScreenShotter() + { + super(); + + this.visible = false; + this.width = 320; + this.height = 240; + + // create new video object + screenshotVideo = new Video(); + screenshotVideo.width = this.width; + screenshotVideo.height = this.height; + + // fix video player + this.addChild(screenshotVideo); + screenshotVideo.visible = true; + + // add the ui component to the application + Application.application.addChild(this); + } + + public function set nc(myNc:NetConnection):void{ + _nc = myNc; + } + + public function set bufferTime(myBufferTime:int):void{ + _bufferTime = myBufferTime; + } + + public function set filename(myFilename:String):void{ + _filename = myFilename; + } + + public function takeScreenshot():void{ + if(screenshotNs != null){ + screenshotNs.close(); + screenshotNs = null; + } + + // create the screenshot netstream + screenshotNs = createNetStreamForSS(); + + // attach the netstream to the video + screenshotVideo.attachNetStream(screenshotNs); + + // stream from the server + screenshotNs.play(_filename, -2); + } + + // creates a new netstream object for screenshotting + private function createNetStreamForSS():NetStream{ + // if nc is not null + if(_nc){ + // create a net stream object + var ns:NetStream = new NetStream(_nc); + ns.bufferTime = _bufferTime * 1000; + + // listeners and callback stuff for netstatus object + var client:Object = new Object(); + client.onMetaData = function():void{}; + client.onPlayStatus = function():void{}; + ns.client = client; + + // mute the net stream + ns.soundTransform = new SoundTransform(0); + + // connect the netstatus handler + ns.addEventListener(NetStatusEvent.NET_STATUS, nsStatusHandlerForSS); + + return ns; + } + else + return null; + } + + private function nsStatusHandlerForSS(event:NetStatusEvent):void { + // get the info object + var infoObject:Object = event.info; + + trace(VideoDisplayUtil.printInfoObject(infoObject)); + + switch(infoObject.code){ + case "NetStream.Play.Start":{ + if(ssTimer != null){ + ssTimer.stop(); + ssTimer = null; + } + + ssTimer = new Timer(_bufferTime * 1000, 1); + ssTimer.addEventListener(TimerEvent.TIMER_COMPLETE, returnScreenShot); + ssTimer.start(); + break; + } + } + } + + private function returnScreenShot(event:TimerEvent = null):void{ + // detach the netstream for security reasons + screenshotVideo.attachNetStream(null); + + // create a new preview image + var previewImage:BitmapData = new BitmapData(this.width, this.height) ; + + // draw the screenshoter frame + previewImage.draw(this); + + // make a bitmap + var bm:Bitmap = new Bitmap(previewImage); + + // get the raw data + var bytes:ByteArray = previewImage.getPixels(new Rectangle(0, 0, 320, 240)); + + screenshotNs.close(); + screenshotNs = null; + + var screenShotEvent:NetStreamScreenShotterEvent = new NetStreamScreenShotterEvent(NetStreamScreenShotterEvent.SCREENSHOTTAKEN); + screenShotEvent.previewImage = previewImage; + + dispatchEvent(screenShotEvent); + } + + } +} \ No newline at end of file Index: lams_flash/src/common/flex/org/lamsfoundation/lams/common/util/NetStreamScreenShotterEvent.as =================================================================== diff -u --- lams_flash/src/common/flex/org/lamsfoundation/lams/common/util/NetStreamScreenShotterEvent.as (revision 0) +++ lams_flash/src/common/flex/org/lamsfoundation/lams/common/util/NetStreamScreenShotterEvent.as (revision 61df3f3f473a3619f93c63ceb879ae36438020e8) @@ -0,0 +1,26 @@ +package org.lamsfoundation.lams.common.util +{ + import flash.display.BitmapData; + import flash.events.Event; + + public class NetStreamScreenShotterEvent extends Event + { + public static const SCREENSHOTTAKEN:String = "screenShotTaken"; + + private var _previewImage:BitmapData; + + public function NetStreamScreenShotterEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false) + { + super(type, bubbles, cancelable); + } + + public function set previewImage(myPreviewImage:BitmapData):void{ + _previewImage = myPreviewImage; + } + + public function get previewImage():BitmapData{ + return _previewImage; + } + + } +} \ No newline at end of file Index: lams_flash/src/common/flex/org/lamsfoundation/lams/common/util/VideoDisplayUtil.as =================================================================== diff -u -r9b0b6e0f74c421abb1221ef8a8b381f7b9e07278 -r61df3f3f473a3619f93c63ceb879ae36438020e8 --- lams_flash/src/common/flex/org/lamsfoundation/lams/common/util/VideoDisplayUtil.as (.../VideoDisplayUtil.as) (revision 9b0b6e0f74c421abb1221ef8a8b381f7b9e07278) +++ lams_flash/src/common/flex/org/lamsfoundation/lams/common/util/VideoDisplayUtil.as (.../VideoDisplayUtil.as) (revision 61df3f3f473a3619f93c63ceb879ae36438020e8) @@ -89,7 +89,14 @@ var minutes:int = valInt / 60; var seconds:int = valInt % 60; - return String(minutes) + ":" + String(seconds); + var result:String = ""; + result += String(minutes) + ":"; + + if(seconds < 10){ + result += "0"; + } + result += String(seconds); + return result; } } } \ No newline at end of file Index: lams_learning/src/java/org/lamsfoundation/lams/learning/export/web/action/ImageBundler.java =================================================================== diff -u -rd491dc4572776abce8cf15f9c495f17d17a046b3 -r61df3f3f473a3619f93c63ceb879ae36438020e8 --- lams_learning/src/java/org/lamsfoundation/lams/learning/export/web/action/ImageBundler.java (.../ImageBundler.java) (revision d491dc4572776abce8cf15f9c495f17d17a046b3) +++ lams_learning/src/java/org/lamsfoundation/lams/learning/export/web/action/ImageBundler.java (.../ImageBundler.java) (revision 61df3f3f473a3619f93c63ceb879ae36438020e8) @@ -109,6 +109,9 @@ // build up a list of the misc images to copy setupMiscImages(); + + // build up a list of things to add for vr to work + setupVideoRecorderExport(); } // now copy all those files @@ -161,4 +164,28 @@ } } } + + /** + * Adds VideoRecorder stuff to be exported + */ + private void setupVideoRecorderExport() { + String vrDirectory = lamsCentralPath + File.separatorChar + "fckeditor" + File.separatorChar + "editor" + + File.separatorChar + "plugins" + File.separatorChar + "videorecorder"; + + String outputVrDirectory = outputDirectory + File.separatorChar + "fckeditor" + File.separatorChar + + "editor" + File.separatorChar + "plugins" + File.separatorChar + "videorecorder"; + + directoriesRequired.add(outputVrDirectory); + + File dir = new File(vrDirectory); + if (!dir.canRead() || !dir.isDirectory()) { + log.debug("Unable to read vr directory " + dir.getAbsolutePath()); + } else { + File[] files = dir.listFiles(); + for (File file : files) { + if(!file.isDirectory()) + filesToCopy.put(outputVrDirectory + File.separatorChar + file.getName(), file); + } + } + } } Index: lams_learning/src/java/org/lamsfoundation/lams/learning/export/web/action/MainExportServlet.java =================================================================== diff -u -r8d9bd98b5bb4915fbd9fe44081993a4c1d26cc04 -r61df3f3f473a3619f93c63ceb879ae36438020e8 --- lams_learning/src/java/org/lamsfoundation/lams/learning/export/web/action/MainExportServlet.java (.../MainExportServlet.java) (revision 8d9bd98b5bb4915fbd9fe44081993a4c1d26cc04) +++ lams_learning/src/java/org/lamsfoundation/lams/learning/export/web/action/MainExportServlet.java (.../MainExportServlet.java) (revision 61df3f3f473a3619f93c63ceb879ae36438020e8) @@ -228,11 +228,15 @@ try { // String to find String fckeditorpath = "/" + lamsOrRams + "/www/secure/" + contentFolderID; + String fckeditorrecpath = "../" + contentFolderID + "/Recordings"; String fckeditorsmiley = "/" + lamsOrRams + "/fckeditor/editor/images/smiley"; + String fckeditorvr = "/" + lamsOrRams + "/fckeditor/editor/plugins/videorecorder"; // Replacing string String newfckeditorpath = "../" + contentFolderID; + String newfckeditorrecpath = "../../../../" + contentFolderID + "/Recordings"; String newfckeditorsmiley = "../fckeditor/editor/images/smiley"; + String newfckeditorvr = "../fckeditor/editor/plugins/videorecorder"; File fin = new File(filename); //Open and input stream @@ -244,8 +248,14 @@ Pattern p = Pattern.compile(fckeditorpath); Matcher m = p.matcher(""); - Pattern p2 = Pattern.compile(fckeditorsmiley); + Pattern p2 = Pattern.compile(fckeditorrecpath); Matcher m2 = p2.matcher(""); + + Pattern p3 = Pattern.compile(fckeditorsmiley); + Matcher m3 = p3.matcher(""); + + Pattern p4 = Pattern.compile(fckeditorvr); + Matcher m4 = p4.matcher(""); String aLine = null; String output = ""; @@ -256,10 +266,18 @@ // Replace the p matching pattern with the newfckeditorpath String firstpass = m.replaceAll(newfckeditorpath); - // Replace the p2 matching patterns with the newfckeditorsmiley + // Replace the p2 matching patterns with the newfckeditorrecpath m2.reset(firstpass); - String result = m2.replaceAll(newfckeditorsmiley); + String secondpass = m2.replaceAll(newfckeditorrecpath); + // Replace the p2 matching patterns with the newfckeditorsmiley + m3.reset(secondpass); + String thirdpass = m3.replaceAll(newfckeditorsmiley); + + // Replace the p3 matching patterns with the newfckeditorvr + m4.reset(thirdpass); + String result = m4.replaceAll(newfckeditorvr); + output = output + result + "\n"; } in.close(); Index: lams_learning/web/.cvsignore =================================================================== diff -u -rc47073639465a5a05b59d8e975d5274e881a908a -r61df3f3f473a3619f93c63ceb879ae36438020e8 --- lams_learning/web/.cvsignore (.../.cvsignore) (revision c47073639465a5a05b59d8e975d5274e881a908a) +++ lams_learning/web/.cvsignore (.../.cvsignore) (revision 61df3f3f473a3619f93c63ceb879ae36438020e8) @@ -1 +1,2 @@ javascript +*.swd Index: lams_learning/web/WEB-INF/lams.tld =================================================================== diff -u -rc5b655c3c11fa9d9b1d76e0ef602acf6363e45f9 -r61df3f3f473a3619f93c63ceb879ae36438020e8 --- lams_learning/web/WEB-INF/lams.tld (.../lams.tld) (revision c5b655c3c11fa9d9b1d76e0ef602acf6363e45f9) +++ lams_learning/web/WEB-INF/lams.tld (.../lams.tld) (revision 61df3f3f473a3619f93c63ceb879ae36438020e8) @@ -13,28 +13,36 @@ - Output the basic URL for the current webapp. e.g. http://server/lams/tool/nb11/ - Base URL for the current web app + Output the Server URL as defined in the lams.xml configuration file. + LAMS URL - WebAppURL - org.lamsfoundation.lams.web.tag.WebAppURLTag + LAMSURL + org.lamsfoundation.lams.web.tag.LAMSURLTag empty - Output a random number for the learner and passon flash movies to communicate directly. - generate unique ID + Converts text from \n or \r\n to <BR> before rendering + Converts text from \n or \r\n to <BR> before rendering - generateID - org.lamsfoundation.lams.web.tag.GenerateIDTag + out + org.lamsfoundation.lams.web.tag.MultiLinesOutputTag empty - Output a random number for the learner and passon flash movies to communicate directly. - id + Converts text from \n or \r\n to <BR> before rendering + value + true + + true + + + + Converts text from \n or \r\n to <BR> before rendering + escapeHtml false true @@ -44,6 +52,26 @@ + Render html tag with direction and language + Render html tag with direction and language + + + html + org.lamsfoundation.lams.web.tag.HtmlTag + JSP + + + Render html tag with direction and language + xhtml + false + + true + + + + + + Get the configuration value for the specified key Configuration value @@ -64,28 +92,17 @@ - Output the Server URL as defined in the lams.xml configuration file. - LAMS URL + Output a random number for the learner and passon flash movies to communicate directly. + generate unique ID - LAMSURL - org.lamsfoundation.lams.web.tag.LAMSURLTag + generateID + org.lamsfoundation.lams.web.tag.GenerateIDTag empty - - - - Render html tag with direction and language - Render html tag with direction and language - - - html - org.lamsfoundation.lams.web.tag.HtmlTag - JSP - - Render html tag with direction and language - xhtml + Output a random number for the learner and passon flash movies to communicate directly. + id false true @@ -95,26 +112,29 @@ - Converts text from \n or \r\n to <BR> before rendering - Converts text from \n or \r\n to <BR> before rendering + Output the basic URL for the current webapp. e.g. http://server/lams/tool/nb11/ + Base URL for the current web app - out - org.lamsfoundation.lams.web.tag.MultiLinesOutputTag + WebAppURL + org.lamsfoundation.lams.web.tag.WebAppURLTag empty - - Converts text from \n or \r\n to <BR> before rendering - value - true + + - true + Converts role name into form usable as message resources key + Converts role name into form usable as message resources key + + + role + org.lamsfoundation.lams.web.tag.RoleTag + empty - - Converts text from \n or \r\n to <BR> before rendering - escapeHtml - false + Converts role name into form usable as message resources key + role + true true @@ -167,17 +187,17 @@ - Converts role name into form usable as message resources key - Converts role name into form usable as message resources key + Output details from the shared session UserDTO object + user details - role - org.lamsfoundation.lams.web.tag.RoleTag + user + org.lamsfoundation.lams.web.tag.UserTag empty - Converts role name into form usable as message resources key - role + Output details from the shared session UserDTO object + property true true @@ -213,27 +233,7 @@ - - Output details from the shared session UserDTO object - user details - - - user - org.lamsfoundation.lams.web.tag.UserTag - empty - - - Output details from the shared session UserDTO object - property - true - - true - - - - - STRUTS-textarea org.lamsfoundation.lams.web.tag.MultiLinesTextareaTag @@ -289,11 +289,6 @@ true - index - false - true - - indexed false true @@ -466,6 +461,10 @@ ImgButtonWrapper /WEB-INF/tags/ImgButtonWrapper.tag + + + TextSearch + /WEB-INF/tags/TextSearch.tag textarea Index: lams_learning/web/WEB-INF/tags/AuthoringButton.tag =================================================================== diff -u -r481ce9bf906ef6523ad3ac1c677c9d9a0166cc88 -r61df3f3f473a3619f93c63ceb879ae36438020e8 --- lams_learning/web/WEB-INF/tags/AuthoringButton.tag (.../AuthoringButton.tag) (revision 481ce9bf906ef6523ad3ac1c677c9d9a0166cc88) +++ lams_learning/web/WEB-INF/tags/AuthoringButton.tag (.../AuthoringButton.tag) (revision 61df3f3f473a3619f93c63ceb879ae36438020e8) @@ -1,93 +1,93 @@ -<% -/**************************************************************** - * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) - * ============================================================= - * License Information: http://lamsfoundation.org/licensing/lams/2.0/ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2.0 - * as published by the Free Software Foundation. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 - * USA - * - * http://www.gnu.org/licenses/gpl.txt - * **************************************************************** - */ - - /** - * AuthoringButton.tag - * Author: Dapeng Ni - * Description: Creates the save/cancel button for authoring page - */ - - %> -<%@ tag body-content="scriptless" %> -<%@ taglib uri="tags-core" prefix="c" %> -<%@ taglib uri="tags-fmt" prefix="fmt" %> -<%@ taglib uri="tags-html" prefix="html" %> - -<%@ attribute name="formID" required="true" rtexprvalue="true" %> -<%@ attribute name="toolSignature" required="true" rtexprvalue="true" %> -<%@ attribute name="toolContentID" required="true" rtexprvalue="true" %> -<%@ attribute name="contentFolderID" required="true" rtexprvalue="true" %> -<%@ attribute name="clearSessionActionUrl" required="true" rtexprvalue="true" %> - -<%-- Optional attribute --%> -<%@ attribute name="accessMode" required="false" rtexprvalue="true" %> -<%@ attribute name="cancelButtonLabelKey" required="false" rtexprvalue="true" %> -<%@ attribute name="saveButtonLabelKey" required="false" rtexprvalue="true" %> -<%@ attribute name="cancelConfirmMsgKey" required="false" rtexprvalue="true" %> -<%@ attribute name="defineLater" required="false" rtexprvalue="true" %> -<%@ attribute name="customiseSessionID" required="false" rtexprvalue="true" %> - -<%-- Default value for message key --%> - - - - - - - - - - - - - - - -

    - - - - - - -

    +<% +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + + /** + * AuthoringButton.tag + * Author: Dapeng Ni + * Description: Creates the save/cancel button for authoring page + */ + + %> +<%@ tag body-content="scriptless" %> +<%@ taglib uri="tags-core" prefix="c" %> +<%@ taglib uri="tags-fmt" prefix="fmt" %> +<%@ taglib uri="tags-html" prefix="html" %> + +<%@ attribute name="formID" required="true" rtexprvalue="true" %> +<%@ attribute name="toolSignature" required="true" rtexprvalue="true" %> +<%@ attribute name="toolContentID" required="true" rtexprvalue="true" %> +<%@ attribute name="contentFolderID" required="true" rtexprvalue="true" %> +<%@ attribute name="clearSessionActionUrl" required="true" rtexprvalue="true" %> + +<%-- Optional attribute --%> +<%@ attribute name="accessMode" required="false" rtexprvalue="true" %> +<%@ attribute name="cancelButtonLabelKey" required="false" rtexprvalue="true" %> +<%@ attribute name="saveButtonLabelKey" required="false" rtexprvalue="true" %> +<%@ attribute name="cancelConfirmMsgKey" required="false" rtexprvalue="true" %> +<%@ attribute name="defineLater" required="false" rtexprvalue="true" %> +<%@ attribute name="customiseSessionID" required="false" rtexprvalue="true" %> + +<%-- Default value for message key --%> + + + + + + + + + + + + + + + +

    + + + + + + +

    \ No newline at end of file Index: lams_learning/web/WEB-INF/tags/ExportPortOutput.tag =================================================================== diff -u -r240f5a89847764532283243060c07572f88cc5cf -r61df3f3f473a3619f93c63ceb879ae36438020e8 --- lams_learning/web/WEB-INF/tags/ExportPortOutput.tag (.../ExportPortOutput.tag) (revision 240f5a89847764532283243060c07572f88cc5cf) +++ lams_learning/web/WEB-INF/tags/ExportPortOutput.tag (.../ExportPortOutput.tag) (revision 61df3f3f473a3619f93c63ceb879ae36438020e8) @@ -34,7 +34,6 @@ <%@ attribute name="actport" required="true" rtexprvalue="true" type="org.lamsfoundation.lams.learning.export.ActivityPortfolio" %> <%@ taglib uri="tags-core" prefix="c" %> <%@ taglib uri="tags-lams" prefix="lams" %> -<%@ taglib uri="tags-fmt" prefix="fmt" %>
  • @@ -55,14 +54,6 @@ - -
    -
      - -
    • ${competenceName}
    • -
      -
    -
  • Index: lams_learning/web/WEB-INF/tags/ProgressOutput.tag =================================================================== diff -u -re281eb1df5a9a5e146f7298389cb1e5a21aaa0ef -r61df3f3f473a3619f93c63ceb879ae36438020e8 --- lams_learning/web/WEB-INF/tags/ProgressOutput.tag (.../ProgressOutput.tag) (revision e281eb1df5a9a5e146f7298389cb1e5a21aaa0ef) +++ lams_learning/web/WEB-INF/tags/ProgressOutput.tag (.../ProgressOutput.tag) (revision 61df3f3f473a3619f93c63ceb879ae36438020e8) @@ -58,19 +58,7 @@ - - - - - - - - - - - - - + ${activity.title} Index: lams_learning/web/WEB-INF/tags/TextSearch.tag =================================================================== diff -u --- lams_learning/web/WEB-INF/tags/TextSearch.tag (revision 0) +++ lams_learning/web/WEB-INF/tags/TextSearch.tag (revision 61df3f3f473a3619f93c63ceb879ae36438020e8) @@ -0,0 +1,136 @@ +<% +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + + /** + * TextSearch.tag + * Author: Marcin Cieslak + * Description: Displays form for creating text search conditions. + */ + + %> +<%@ tag body-content="scriptless" %> +<%@ taglib uri="tags-core" prefix="c" %> +<%@ taglib uri="tags-fmt" prefix="fmt" %> +<%@ taglib uri="tags-html" prefix="html" %> +<%@ taglib uri="tags-lams" prefix="lams" %> + +<%-- Required attributes --%> +<%@ attribute name="sessionMapID" required="true" rtexprvalue="true" %> +<%@ attribute name="wrapInFormTag" required="true" rtexprvalue="true" %> + +<%-- Optional attributes --%> +<%@ attribute name="action" required="false" rtexprvalue="true" %> +<%@ attribute name="formID" required="false" rtexprvalue="true" %> +<%@ attribute name="headingLabelKey" required="false" rtexprvalue="true" %> +<%@ attribute name="allWordsLabelKey" required="false" rtexprvalue="true" %> +<%@ attribute name="phraseLabelKey" required="false" rtexprvalue="true" %> +<%@ attribute name="anyWordsLabelKey" required="false" rtexprvalue="true" %> +<%@ attribute name="excludedWordsLabelKey" required="false" rtexprvalue="true" %> +<%@ attribute name="saveButtonLabelKey" required="false" rtexprvalue="true" %> +<%@ attribute name="cancelButtonLabelKey" required="false" rtexprvalue="true" %> +<%@ attribute name="cancelAction" required="false" rtexprvalue="true" %> + +<%-- Default value for message key --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +

    + + + + + + + + + + + + + + + + + +
    + + + +
    + + + +
    + + + +
    + + + +
    + + + + + + + + + + \ No newline at end of file Index: lams_learning/web/WEB-INF/web.xml =================================================================== diff -u -rd6ceac060c9ba0f5c29ae663e85628720a383568 -r61df3f3f473a3619f93c63ceb879ae36438020e8 --- lams_learning/web/WEB-INF/web.xml (.../web.xml) (revision d6ceac060c9ba0f5c29ae663e85628720a383568) +++ lams_learning/web/WEB-INF/web.xml (.../web.xml) (revision 61df3f3f473a3619f93c63ceb879ae36438020e8) @@ -1,25 +1,39 @@ - - - javax.servlet.jsp.jstl.fmt.localizationContext - org.lamsfoundation.lams.learning.ApplicationResources + + + + javax.servlet.jsp.jstl.fmt.localizationContext + org.lamsfoundation.lams.learning.ApplicationResources + + messageSource + learningMessageSource + + + contextConfigLocation - - classpath:/org/lamsfoundation/lams/applicationContext.xml - classpath:/org/lamsfoundation/lams/lesson/lessonApplicationContext.xml - classpath:/org/lamsfoundation/lams/toolApplicationContext.xml - classpath:/org/lamsfoundation/lams/learning/learningApplicationContext.xml - classpath:/org/lamsfoundation/lams/contentrepository/applicationContext.xml - - + + + locatorFactorySelector + classpath*:/org/lamsfoundation/lams/**/beanRefContext.xml + + + parentContextKey + context.central + + org.springframework.web.context.ContextLoaderListener + + + org.lamsfoundation.lams.web.session.SetMaxTimeoutListener + + HibernateFilter @@ -129,7 +143,11 @@ groupingExportPortfolio /groupingExportPortfolio - + + + 120 + +