Index: lams_build/conf/j2ee/lams.application.xml =================================================================== RCS file: /usr/local/cvsroot/lams_build/conf/j2ee/lams.application.xml,v diff -u -r1.4 -r1.5 --- lams_build/conf/j2ee/lams.application.xml 19 Sep 2008 06:26:44 -0000 1.4 +++ lams_build/conf/j2ee/lams.application.xml 24 Sep 2008 00:43:01 -0000 1.5 @@ -228,7 +228,13 @@ xstream-1.1.jar + + + transform.jar + + translate.jar + Index: lams_build/lib/flagstone/transform.jar =================================================================== RCS file: /usr/local/cvsroot/lams_build/lib/flagstone/transform.jar,v diff -u Binary files differ Index: lams_build/lib/flagstone/translate.jar =================================================================== RCS file: /usr/local/cvsroot/lams_build/lib/flagstone/translate.jar,v diff -u Binary files differ Index: lams_central/src/java/org/lamsfoundation/lams/webservice/WhiteboardToJpgServlet.java =================================================================== RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/webservice/WhiteboardToJpgServlet.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_central/src/java/org/lamsfoundation/lams/webservice/WhiteboardToJpgServlet.java 24 Sep 2008 00:38:37 -0000 1.1 @@ -0,0 +1,109 @@ +/**************************************************************** + * 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 + * **************************************************************** + */ + +/* $Id: WhiteboardToJpgServlet.java,v 1.1 2008/09/24 00:38:37 paulg Exp $ */ +package org.lamsfoundation.lams.webservice; + +import java.awt.image.BufferedImage; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.PrintWriter; + +import javax.imageio.ImageIO; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.log4j.Logger; + +/** + * @author jliew + * + * @web:servlet name="BogoPogoServlet" + * @web:servlet-mapping url-pattern="/BogoPogo" + */ +public class WhiteboardToJpgServlet extends HttpServlet { + + private static Logger log = Logger.getLogger(WhiteboardToJpgServlet.class); + + public void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException { + + PrintWriter out = null; + String ext = "jpg"; + String dir = System.getProperty("java.io.tmpdir"); + + try { + out = response.getWriter(); + + String d = request.getParameter("data"); + String w = request.getParameter("width"); + String h = request.getParameter("height"); + + log.debug("got parameters data="+d+", width="+w+", height="+h); + out.write("got parameters data="+d+", width="+w+", height="+h); + + String[] darray = d.split(","); + int[] pixels = new int[darray.length]; + for (int i=0; i