"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/main/java/com/openkm/servlet/HtmlPreviewServlet.java" between
OpenKM-document-management-system-6.3.10.tar.gz and OpenKM-document-management-system-6.3.11.tar.gz

About: OpenKM (Knowledge Management) is a document management system that allows easy management of documents, users, roles and finding your enterprise documents and records. Community version (source code).

HtmlPreviewServlet.java  (OpenKM-document-management-system-6.3.10):HtmlPreviewServlet.java  (OpenKM-document-management-system-6.3.11)
skipping to change at line 25 skipping to change at line 25
* GNU General Public License for more details. * GNU General Public License for more details.
* <p> * <p>
* You should have received a copy of the GNU General Public License along * 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., * with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
package com.openkm.servlet; package com.openkm.servlet;
import com.openkm.api.OKMDocument; import com.openkm.api.OKMDocument;
import com.openkm.core.AccessDeniedException; import com.openkm.core.*;
import com.openkm.core.DatabaseException;
import com.openkm.core.PathNotFoundException;
import com.openkm.core.RepositoryException;
import com.openkm.servlet.admin.BaseServlet; import com.openkm.servlet.admin.BaseServlet;
import com.openkm.util.WebUtils; import com.openkm.util.WebUtils;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import javax.servlet.ServletContext; import javax.servlet.ServletContext;
import javax.servlet.ServletException; import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.StringWriter; import java.io.StringWriter;
/** /**
* Html Preview Servlet * Html Preview Servlet
* *
* Take a look at available brushes alias at http://alexgorbatchev.com/SyntaxHig hlighter/manual/brushes/ * Take a look at available brushes alias at http://alexgorbatchev.com/SyntaxHig hlighter/manual/brushes/
*/ */
public class HtmlPreviewServlet extends BaseServlet { public class HtmlPreviewServlet extends BaseServlet {
private static Logger log = LoggerFactory.getLogger(HtmlPreviewServlet.cl ass); private static final Logger log = LoggerFactory.getLogger(HtmlPreviewServ let.class);
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
* *
*/ */
public void doGet(HttpServletRequest request, HttpServletResponse respons e) throws IOException, ServletException { public void doGet(HttpServletRequest request, HttpServletResponse respons e) throws IOException, ServletException {
log.debug("doGet({}, {})", request, response); log.debug("doGet({}, {})", request, response);
String uuid = WebUtils.getString(request, "uuid"); String uuid = WebUtils.getString(request, "uuid");
String core = WebUtils.getString(request, "core"); String core = WebUtils.getString(request, "core");
String theme = WebUtils.getString(request, "theme"); String theme = WebUtils.getString(request, "theme");
skipping to change at line 74 skipping to change at line 71
StringWriter writer = new StringWriter(); StringWriter writer = new StringWriter();
IOUtils.copy(fis, writer, "UTF-8"); IOUtils.copy(fis, writer, "UTF-8");
String content = writer.getBuffer().toString(); String content = writer.getBuffer().toString();
content = content.replaceAll("jsOpenPathByUuid", "parent. jsOpenPathByUuid"); content = content.replaceAll("jsOpenPathByUuid", "parent. jsOpenPathByUuid");
ServletContext sc = getServletContext(); ServletContext sc = getServletContext();
sc.setAttribute("cssCore", core); sc.setAttribute("cssCore", core);
sc.setAttribute("cssTheme", theme); sc.setAttribute("cssTheme", theme);
sc.setAttribute("content", content); sc.setAttribute("content", content);
sc.getRequestDispatcher("/html_preview.jsp").forward(requ est, response); sc.getRequestDispatcher("/html_preview.jsp").forward(requ est, response);
} catch (PathNotFoundException e) { } catch (PathNotFoundException | AccessDeniedException | Reposito
sendErrorRedirect(request, response, e); ryException | DatabaseException | LockException e) {
} catch (AccessDeniedException e) {
sendErrorRedirect(request, response, e);
} catch (RepositoryException e) {
sendErrorRedirect(request, response, e);
} catch (DatabaseException e) {
sendErrorRedirect(request, response, e); sendErrorRedirect(request, response, e);
} finally { } finally {
IOUtils.closeQuietly(fis); IOUtils.closeQuietly(fis);
} }
} }
} }
 End of changes. 3 change blocks. 
12 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)