Skip to content

Commit

Permalink
Merge pull request #13 from openkm/6.3-DEV
Browse files Browse the repository at this point in the history
OpenKM 6.3.4 released
  • Loading branch information
monkiki authored May 3, 2017
2 parents 77e4e1a + 27d7f90 commit 47204ef
Show file tree
Hide file tree
Showing 18 changed files with 339 additions and 71 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ You can install OpenKM binaries from [SourceForge](https://sourceforge.net/proje
* **OKMInstaller.jar**: The OpenKM installer assistant. Usage information at [using the installer](https://docs.openkm.com/kcenter/view/okm-6.3-com/using-the-installer.html).
* **OpenKM-${Version}.zip**: Which just contains the OpenKM.war application without Tomcat and configuration
files needed to get it running.

## Installation wizard videos
### Linux
This video shows step by step the installation process of OpenKM Community version in Linux.
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>com.openkm</groupId>
<artifactId>openkm</artifactId>
<packaging>war</packaging>
<version>6.3.3</version>
<version>6.3.4</version>
<name>OpenKM Web Application</name>
<url>http://www.openkm.com</url>
<description>OpenKM is a powerful scalable Document Management System (DMS). OpenKM uses Tomcat + GWT + Hibernate open
Expand Down
47 changes: 32 additions & 15 deletions src/main/java/com/openkm/core/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,20 @@

package com.openkm.core;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.InetAddress;
import java.util.*;
import java.util.Map.Entry;

import javax.servlet.ServletContext;

import org.apache.lucene.util.Version;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.openkm.bean.ConfigStoredFile;
import com.openkm.dao.ConfigDAO;
import com.openkm.dao.SearchDAO;
Expand All @@ -32,21 +46,6 @@
import com.openkm.util.FormatUtil;
import com.openkm.validator.password.NoPasswordValidator;
import com.openkm.vernum.MajorMinorVersionNumerationAdapter;
import org.apache.lucene.util.Version;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.servlet.ServletContext;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.InetAddress;
import java.util.ArrayList;
import java.util.List;
import java.util.Map.Entry;
import java.util.Properties;
import java.util.TreeMap;

public class Config {
private static Logger log = LoggerFactory.getLogger(Config.class);
Expand Down Expand Up @@ -344,6 +343,12 @@ public class Config {
public static final String PROPERTY_UNIT_TESTING_PASSWORD = "unit.testing.password";
public static final String PROPERTY_UNIT_TESTING_FOLDER = "unit.testing.folder";

// Rss news
public static String PROPERTY_RSS_NEWS = "rss.news";
public static String PROPERTY_RSS_NEWS_BOX_WIDTH = "rss.news.box.width";
public static String PROPERTY_RSS_NEWS_MAX_SIZE = "rss.news.max.size";
public static String PROPERTY_RSS_NEWS_VISIBLE = "rss.news.visible";

/**
* Default values
*/
Expand Down Expand Up @@ -630,6 +635,12 @@ public class Config {
public static String UNIT_TESTING_PASSWORD = "admin";
public static String UNIT_TESTING_FOLDER = "/okm:root/okmTesting";

// OpenKM RSS news
public static boolean RSS_NEWS = true;
public static int RSS_NEWS_BOX_WIDTH = 300;
public static int RSS_NEWS_MAX_SIZE = 10;
public static int RSS_NEWS_VISIBLE = 1;

// Misc
public static int SESSION_EXPIRATION = 1800; // 30 mins (session.getMaxInactiveInterval())
public static String LIST_SEPARATOR = ";";
Expand Down Expand Up @@ -1172,6 +1183,12 @@ public static void reload(ServletContext sc, Properties cfg) {
SECURITY_EXTENDED_MASK = ConfigDAO.getInteger(PROPERTY_SECURITY_EXTENDED_MASK, Integer.valueOf(cfg.getProperty(PROPERTY_SECURITY_EXTENDED_MASK, String.valueOf(SECURITY_EXTENDED_MASK))));
values.put(PROPERTY_SECURITY_EXTENDED_MASK, Integer.toString(SECURITY_EXTENDED_MASK));

// RSS news
RSS_NEWS = ConfigDAO.getBoolean(PROPERTY_RSS_NEWS, RSS_NEWS);
RSS_NEWS_BOX_WIDTH = ConfigDAO.getInteger(PROPERTY_RSS_NEWS_BOX_WIDTH, RSS_NEWS_BOX_WIDTH);
RSS_NEWS_MAX_SIZE = ConfigDAO.getInteger(PROPERTY_RSS_NEWS_MAX_SIZE, RSS_NEWS_MAX_SIZE);
RSS_NEWS_VISIBLE = ConfigDAO.getInteger(PROPERTY_RSS_NEWS_VISIBLE, RSS_NEWS_VISIBLE);

for (Entry<String, String> entry : values.entrySet()) {
log.info("RELOAD - {}={}", entry.getKey(), entry.getValue());
}
Expand Down
80 changes: 36 additions & 44 deletions src/main/java/com/openkm/frontend/client/util/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@

package com.openkm.frontend.client.util;

import java.util.List;
import java.util.Map;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.KeyUpEvent;
import com.google.gwt.http.client.URL;
Expand All @@ -33,9 +36,6 @@
import com.openkm.frontend.client.service.OKMGeneralService;
import com.openkm.frontend.client.service.OKMGeneralServiceAsync;

import java.util.List;
import java.util.Map;

/**
* Util
*
Expand Down Expand Up @@ -567,47 +567,39 @@ public static native void resizeSwfViewer(String width, String height) /*-{
obj.height = height;
}-*/;

public static native void createPDFViewerFlexPaper(String pdfUrl, String width, String height, String printEnabled) /*-{
if (printEnabled == 'true') {
fpViewer = "../js/flexpaper/FlexPaperViewer.swf";
} else {
fpViewer = "../js/flexpaper/FlexPaperViewerRO.swf";
}
pdfUrl = encodeURIComponent(pdfUrl);
$wnd.swfobject.embedSWF(fpViewer, "pdfviewercontainer", width, height, "10.0.0", "playerProductInstall.swf",
{
SwfFile: pdfUrl,
Scale: 0.6,
ZoomTransition: "easeOut",
ZoomTime: 0.5,
ZoomInterval: 0.1,
FitPageOnLoad: false,
FitWidthOnLoad: true,
PrintEnabled: printEnabled,
FullScreenAsMaxWindow: false,
ProgressiveLoading: true,
// PrintToolsVisible : printEnabled,
ViewModeToolsVisible: true,
ZoomToolsVisible: true,
FullScreenVisible: true,
NavToolsVisible: true,
CursorToolsVisible: true,
SearchToolsVisible: true,
localeChain: "en_US"
},
{
quality: "high",
bgcolor: "#ffffff",
allowscriptaccess: "sameDomain",
allowfullscreen: "true"
},
{
id: "FlexPaperViewer",
name: "FlexPaperViewer"
});
}-*/;
public static native void createPDFViewerFlexPaper(String pdfUrl, String width, String height) /*-{
fpViewer = "../js/flexpaper/FlexPaperViewer.swf";
pdfUrl = encodeURIComponent(pdfUrl);
$wnd.swfobject.embedSWF(fpViewer, "pdfviewercontainer", width, height, "10.0.0", "playerProductInstall.swf",
{
SwfFile : pdfUrl,
Scale : 0.6,
ZoomTransition : "easeOut",
ZoomTime : 0.5,
ZoomInterval : 0.1,
FitPageOnLoad : false,
FitWidthOnLoad : true,
FullScreenAsMaxWindow : false,
ProgressiveLoading : true,
ViewModeToolsVisible : true,
ZoomToolsVisible : true,
FullScreenVisible : true,
NavToolsVisible : true,
CursorToolsVisible : true,
SearchToolsVisible : true,
localeChain: "en_US"
},
{
quality : "high",
bgcolor : "#ffffff",
allowscriptaccess : "sameDomain",
allowfullscreen : "true"
},
{
id : "FlexPaperViewer",
name : "FlexPaperViewer"
});
}-*/;

public static native void resizePDFViewerFlexPaper(String width, String height) /*-{
obj = $wnd.swfobject.getObjectById('FlexPaperViewer');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@

package com.openkm.frontend.client.widget.properties;

import java.util.ArrayList;
import java.util.List;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.http.client.URL;
Expand All @@ -31,9 +34,6 @@
import com.openkm.frontend.client.extension.widget.preview.PreviewExtension;
import com.openkm.frontend.client.util.Util;

import java.util.ArrayList;
import java.util.List;

/**
* Notes
*
Expand Down Expand Up @@ -171,9 +171,9 @@ public void showEmbedSWF(String uuid) {

if (Main.get().workspaceUserProperties.getWorkspace().getPreviewer().equals("flexpaper")) {
if (Main.get().workspaceUserProperties.getWorkspace().isPrintPreview()) {
Util.createPDFViewerFlexPaper(url, "" + width, "" + height, "true");
Util.createPDFViewerFlexPaper(url, "" + width, "" + height);
} else {
Util.createPDFViewerFlexPaper(url, "" + width, "" + height, "false");
Util.createPDFViewerFlexPaper(url, "" + width, "" + height);
}
}

Expand Down
80 changes: 80 additions & 0 deletions src/main/java/com/openkm/servlet/RssServlet.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/**
* OpenKM, Open Document Management System (http://www.openkm.com)
* Copyright (c) 2006-2017 Paco Avila & Josep Llort
* <p>
* No bytes were intentionally harmed during the development of this application.
* <p>
* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later
* version.
* <p>
* 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.
* <p>
* 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.
*/

package com.openkm.servlet;

import com.ibm.icu.util.Calendar;
import com.openkm.core.Config;
import org.apache.commons.io.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.net.URL;
import java.nio.charset.StandardCharsets;

/**
* Rss Servlet
*/
@WebServlet("/Rss")
public class RssServlet extends HttpServlet {
private static Logger log = LoggerFactory.getLogger(RssServlet.class);
private static final long serialVersionUID = 1L;
private static String date = "";
private static String rssData = "";

@Override
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
request.setCharacterEncoding("UTF-8");
InputStream rss = null;
InputStream is = null;

try {
// Only refresh RSS one time per day
Calendar cal = Calendar.getInstance();
String today = String.valueOf(cal.get(Calendar.YEAR)) + String.valueOf(cal.get(Calendar.MONTH) + 1) + String.valueOf(cal.get(Calendar.DATE));

if (date.isEmpty() || !date.equals(today)) {
date = today;
rss = new URL("https://www.openkm.com/news.rss?ver=com&limit=" + Config.RSS_NEWS_MAX_SIZE).openStream();
rssData = IOUtils.toString(rss);
log.debug("Remote RSS News\n" + rssData);
}

is = new ByteArrayInputStream(rssData.getBytes(StandardCharsets.UTF_8));
response.setContentType("text/xml; charset=UTF-8");
response.setHeader("Content-type", "application/xhtml+xml");
PrintWriter out = response.getWriter();
IOUtils.copy(is, out);
out.close();
} catch (Exception e) {
log.warn(e.getMessage(), e);
response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.getMessage());
} finally {
IOUtils.closeQuietly(rss);
IOUtils.closeQuietly(is);
}
}
}
4 changes: 2 additions & 2 deletions src/main/webapp/WEB-INF/web.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<display-name>OpenKM</display-name>

<!-- Tomcat resources -->
Expand Down
61 changes: 61 additions & 0 deletions src/main/webapp/css/login.css
Original file line number Diff line number Diff line change
Expand Up @@ -3171,4 +3171,65 @@ only screen and (-o-min-device-pixel-ratio: 3/2),
only screen and (min-device-pixel-ratio: 1.5) {
/* If you used a CSS img background, you can put your high resolution here */

}

/*
=================================================================
OpenKM RSS
=================================================================
*/
.openkm-news {
width:200px;
position:fixed;
top:0px;
left:0px;
z-index:1;
}

.openkm-version {
padding: 5px 20px;
color: #404040;
font-weight: bold;
background:#fed400;
}

.openkm-sticker {
position:absolute;
top: 5px;
right: 5px;
z-index:2;
}

.openkm-sticker img {
padding: 0px 5px;
}

.vticket-border-right {
border-right: 1px solid #394263;
}

.vticker {
border-left: 1px solid #394263;
border-right: 1px solid #394263;
border-bottom: 1px solid #394263;
background: white;
position: relative;
top: 0px;
left: 0px;
border-bottom-right-radius: 10px;
}

.vticker ul{
padding: 0;
}

.vticker li{
list-style: none;
border-bottom: 1px solid green;
padding: 10px;
}

.vticker h4 {
color: #0885bd;
font-weight: bold;
}
Binary file added src/main/webapp/img/backward.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/main/webapp/img/eye-disabled.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/main/webapp/img/eye.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/main/webapp/img/forward.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/main/webapp/img/pause.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/main/webapp/img/stop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/main/webapp/js/flexpaper/FlexPaperViewer.swf
Binary file not shown.
Binary file removed src/main/webapp/js/flexpaper/FlexPaperViewerRO.swf
Binary file not shown.
2 changes: 2 additions & 0 deletions src/main/webapp/js/jquery.easy-ticker.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 47204ef

Please sign in to comment.