Fix Printer ...
This commit is contained in:
@@ -52,6 +52,7 @@ public class ExportController extends BaseMultiActionController {
|
||||
private static final String MAP_SVG_PARAMETER = "mapSvg";
|
||||
private static final String EXPORT_FORMAT_PARAMETER = "exportFormat";
|
||||
private static final String IMG_SIZE_PARAMETER = "imgSize";
|
||||
private static final String MAP_XML_PARAM = "mapXml";
|
||||
|
||||
|
||||
public ModelAndView handleNoSuchRequestHandlingMethod(NoSuchRequestHandlingMethodException noSuchRequestHandlingMethodException, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
|
||||
@@ -70,9 +71,8 @@ public class ExportController extends BaseMultiActionController {
|
||||
|
||||
int mindmapId = Integer.parseInt(mapIdStr);
|
||||
|
||||
logger.debug("SVG Map to export:"+mapSvg);
|
||||
if(mapSvg==null || mapSvg.isEmpty())
|
||||
{
|
||||
logger.debug("SVG Map to export:" + mapSvg);
|
||||
if (mapSvg == null || mapSvg.isEmpty()) {
|
||||
throw new IllegalArgumentException("SVG map could not be null");
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ public class ExportController extends BaseMultiActionController {
|
||||
} catch (Throwable e) {
|
||||
logger.error("Unexpexted error during export process", e);
|
||||
response.setStatus(HttpServletResponse.SC_NOT_FOUND);
|
||||
logger.error("map: "+mapSvg);
|
||||
logger.error("map: " + mapSvg);
|
||||
}
|
||||
} else {
|
||||
logger.warn("mapIdStr is null.Image could not be imported. UserAgent:" + request.getHeaders(UserAgent.USER_AGENT_HEADER));
|
||||
@@ -138,7 +138,7 @@ public class ExportController extends BaseMultiActionController {
|
||||
baseUrl = "http://www.wisemapping.com/images";
|
||||
} else {
|
||||
final ServletContext servletContext = this.getServletContext();
|
||||
baseUrl = "file://" + servletContext.getRealPath("/icons/")+"/";
|
||||
baseUrl = "file://" + servletContext.getRealPath("/icons/") + "/";
|
||||
}
|
||||
properties.setBaseImagePath(baseUrl);
|
||||
}
|
||||
@@ -149,7 +149,7 @@ public class ExportController extends BaseMultiActionController {
|
||||
final String mapIdStr = request.getParameter(MAP_ID_PARAMETER);
|
||||
int mindmapId = Integer.parseInt(mapIdStr);
|
||||
final MindmapService service = getMindmapService();
|
||||
final MindMap mindMap = service.getMindmapById(mindmapId);
|
||||
final MindMap mindmap = service.getMindmapById(mindmapId);
|
||||
final String mapSvg = request.getParameter(MAP_SVG_PARAMETER);
|
||||
|
||||
final ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||
@@ -157,16 +157,19 @@ public class ExportController extends BaseMultiActionController {
|
||||
exportImage(response, mapSvg, bos, false);
|
||||
} catch (Throwable e) {
|
||||
logger.error("Unexpexted error generating the image", e);
|
||||
logger.error("map: "+mapSvg);
|
||||
logger.error("map: " + mapSvg);
|
||||
}
|
||||
|
||||
BASE64Encoder encoder = new BASE64Encoder();
|
||||
String content = encoder.encode(bos.toByteArray());
|
||||
final String exportContent = "data:image/png;base64,"+content;
|
||||
final String exportContent = "data:image/png;base64," + content;
|
||||
bos.close();
|
||||
|
||||
ModelAndView view = new ModelAndView("mindmapPrint", "mindmap", mindMap);
|
||||
ModelAndView view = new ModelAndView("mindmapPrint", "mindmap", new MindMapBean(mindmap));
|
||||
final String xmlMap = mindmap.getNativeXmlAsJsLiteral();
|
||||
view.addObject(MAP_XML_PARAM, xmlMap);
|
||||
view.addObject(MAP_SVG_PARAMETER, exportContent);
|
||||
|
||||
return view;
|
||||
|
||||
}
|
||||
@@ -184,7 +187,7 @@ public class ExportController extends BaseMultiActionController {
|
||||
|
||||
} catch (Throwable e) {
|
||||
logger.error("Unexpexted error generating the image", e);
|
||||
logger.error("map: "+mapSvg);
|
||||
logger.error("map: " + mapSvg);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -202,7 +205,7 @@ public class ExportController extends BaseMultiActionController {
|
||||
setBaseBaseImgUrl(imageFormat, imageProperties);
|
||||
|
||||
// Set format content type...
|
||||
if(setOutput)
|
||||
if (setOutput)
|
||||
response.setContentType(imageFormat.getContentType());
|
||||
|
||||
// Write content ...
|
||||
|
@@ -1,17 +1,17 @@
|
||||
# MySQL 5.X configuration properties
|
||||
|
||||
#database.url=jdbc:mysql://localhost/wisemapping
|
||||
#database.driver=com.mysql.jdbc.Driver
|
||||
#database.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
|
||||
#database.username=wisemapping
|
||||
#database.password=password
|
||||
database.url=jdbc:mysql://localhost/wisemapping
|
||||
database.driver=com.mysql.jdbc.Driver
|
||||
database.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
|
||||
database.username=wisemapping
|
||||
database.password=password
|
||||
|
||||
# HSQL Configuration properties
|
||||
database.url=jdbc:hsqldb:file:target/db/wisemapping
|
||||
database.driver=org.hsqldb.jdbcDriver
|
||||
database.hibernate.dialect=org.hibernate.dialect.HSQLDialect
|
||||
database.username=sa
|
||||
database.password=
|
||||
#database.url=jdbc:hsqldb:file:target/db/wisemapping
|
||||
#database.driver=org.hsqldb.jdbcDriver
|
||||
#database.hibernate.dialect=org.hibernate.dialect.HSQLDialect
|
||||
#database.username=sa
|
||||
#database.password=
|
||||
|
||||
|
||||
# Enable/Disable user confirmation by e-mail. If it's enabled, mail must be configured.
|
||||
|
@@ -237,11 +237,6 @@ div#headerTitle {
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
div#printHeader {
|
||||
background-color: black;
|
||||
height: 55px;
|
||||
color: white;
|
||||
}
|
||||
|
||||
span#headerSubTitle {
|
||||
font-weight: lighter;
|
||||
@@ -330,20 +325,6 @@ div#editorHeader div#headerActions a:hover, div#headerActions a:active, div#head
|
||||
float: left;
|
||||
}
|
||||
|
||||
div#printFooter {
|
||||
height: 60px;
|
||||
width: 100%;
|
||||
background: #E5E5E5;
|
||||
border-top: 1px solid #bbb4d6;
|
||||
}
|
||||
|
||||
div#printLogo {
|
||||
height: 80px;
|
||||
width: 170px;
|
||||
float: right;
|
||||
margin: 1px;
|
||||
background: url(../nicons/logo-medium.png) no-repeat right top;
|
||||
}
|
||||
|
||||
div#paypal {
|
||||
float: left;
|
||||
|
@@ -762,7 +762,7 @@ div#small_error_icon {
|
||||
height: 300px;
|
||||
}
|
||||
|
||||
.exportItModalDialog .content {
|
||||
.exportModalDialog .content {
|
||||
height: 280px;
|
||||
}
|
||||
|
||||
|
24
wise-webapp/src/main/webapp/css/print.css
Normal file
24
wise-webapp/src/main/webapp/css/print.css
Normal file
@@ -0,0 +1,24 @@
|
||||
@import "../css/widget/lightbox.css";
|
||||
@import "../css/common.css";
|
||||
|
||||
div#printHeader {
|
||||
background-color: black;
|
||||
height: 55px;
|
||||
color: white;
|
||||
}
|
||||
|
||||
div#printFooter {
|
||||
height: 60px;
|
||||
width: 100%;
|
||||
background: #E5E5E5;
|
||||
border-top: 1px solid #bbb4d6;
|
||||
}
|
||||
|
||||
div#printLogo {
|
||||
height: 80px;
|
||||
width: 170px;
|
||||
float: right;
|
||||
margin: 1px;
|
||||
background: url(../nicons/logo-medium.png) no-repeat right top;
|
||||
}
|
||||
|
@@ -1,12 +1,12 @@
|
||||
<!DOCTYPE HTML>
|
||||
|
||||
<%@ include file="/jsp/init.jsp" %>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<body>
|
||||
<h1>Embedding a map in a Page</h1>
|
||||
<iframe style="width:600px;height:400px;border: 1px solid black"
|
||||
src="http://localhost:8080/wise-webapp/c/embeddedView.htm?mapId=1">
|
||||
</iframe>
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 1.1 KiB |
@@ -25,12 +25,12 @@ Asset.javascript('../js/mindplot-min.js', {
|
||||
var designer = null;
|
||||
/* JavaScript tabs changer */
|
||||
|
||||
function setUpToolbar(designer, isTryMode) {
|
||||
function setUpToolbar(designer, readOnly) {
|
||||
|
||||
var menu = new mindplot.widget.Menu(designer, 'toolbar', mapId);
|
||||
|
||||
// Autosave ...
|
||||
if (!isTryMode) {
|
||||
if (!readOnly) {
|
||||
(function() {
|
||||
|
||||
if (designer.needsSave()) {
|
||||
@@ -56,13 +56,8 @@ function setUpToolbar(designer, isTryMode) {
|
||||
|
||||
}
|
||||
|
||||
function buildDesigner(editorProperties, isTryMode) {
|
||||
$assert(editorProperties, "editorProperties can not be null");
|
||||
|
||||
// Initialize message logger ...
|
||||
//@Todo: Fix.
|
||||
// var monitor = new core.Monitor($('msgLoggerContainer'), $('msgLogger'));
|
||||
// core.Monitor.setInstance(monitor);
|
||||
function buildDesigner(properties) {
|
||||
$assert(properties, "properties can not be null");
|
||||
|
||||
var container = $('mindplot');
|
||||
container.setStyles({
|
||||
@@ -70,14 +65,15 @@ function buildDesigner(editorProperties, isTryMode) {
|
||||
width: parseInt(screen.width)
|
||||
});
|
||||
|
||||
designer = new mindplot.Designer(editorProperties, container);
|
||||
designer = new mindplot.Designer(properties, container);
|
||||
designer.setViewPort({
|
||||
height: parseInt(window.innerHeight - 151), // Footer and Header
|
||||
width: parseInt(window.innerWidth)
|
||||
});
|
||||
|
||||
// Toolbar is only loaded if it was defined ...
|
||||
if ($('toolbar')) {
|
||||
setUpToolbar(designer, isTryMode);
|
||||
setUpToolbar(designer, properties.readOnly);
|
||||
}
|
||||
return designer;
|
||||
}
|
||||
|
@@ -4,7 +4,7 @@
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<!--[if lt IE 9]>
|
||||
<!--[if lt IE 9]>
|
||||
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||
<![endif]-->
|
||||
<title><spring:message code="SITE.TITLE"/> - ${mindmap.title} </title>
|
||||
@@ -12,8 +12,7 @@
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="../css/embedded.css"/>
|
||||
|
||||
<script type='text/javascript'
|
||||
src='https://ajax.googleapis.com/ajax/libs/mootools/1.3.2/mootools-yui-compressed.js'></script>
|
||||
<script type='text/javascript' src='../js/libraries/mootools/mootools-core-1.3.2-full-compress.js'></script>
|
||||
<script type='text/javascript' src='../js/libraries/mootools/mootools-more-1.3.2.1-yui.js'></script>
|
||||
<script type='text/javascript' src='../js/core.js'></script>
|
||||
|
||||
@@ -26,10 +25,8 @@
|
||||
mindReady = resource == 'mind' ? true : mindReady;
|
||||
if (mindReady) {
|
||||
|
||||
var editorProperties = {zoom:${zoom},saveOnLoad:true,collab:'standalone'};
|
||||
|
||||
var isTryMode = false;
|
||||
designer = buildDesigner(editorProperties, true);
|
||||
var editorProperties = {zoom:${zoom},saveOnLoad:true,collab:'standalone',readOnly:true};
|
||||
designer = buildDesigner(editorProperties);
|
||||
|
||||
var domDocument = core.Utils.createDocumentFromText(mapXml);
|
||||
var serializer = mindplot.XMLMindmapSerializerFactory.getSerializerFromDocument(domDocument);
|
||||
|
@@ -15,13 +15,11 @@
|
||||
<![endif]-->
|
||||
<title><spring:message code="SITE.TITLE"/> - ${mindmap.title} </title>
|
||||
<meta http-equiv="Content-type" content="text/html; charset=UTF-8"/>
|
||||
|
||||
<link rel="icon" href="../images/favicon.ico" type="image/x-icon">
|
||||
<link rel="shortcut icon" href="../images/favicon.ico" type="image/x-icon">
|
||||
<link rel="stylesheet/less" type="text/css" href="../css/editor2.css"/>
|
||||
|
||||
<script type='text/javascript'
|
||||
src='https://ajax.googleapis.com/ajax/libs/mootools/1.3.2/mootools-yui-compressed.js'></script>
|
||||
<script type='text/javascript' src='../js/libraries/mootools/mootools-core-1.3.2-full-compress.js'></script>
|
||||
<script type='text/javascript' src='../js/libraries/mootools/mootools-more-1.3.2.1-yui.js'></script>
|
||||
|
||||
<script type="text/javascript" src="../dwr/engine.js"></script>
|
||||
@@ -42,9 +40,8 @@
|
||||
|
||||
var editorProperties = ${mindmap.properties};
|
||||
editorProperties.collab = 'standalone';
|
||||
|
||||
var isTryMode = ${editorTryMode};
|
||||
designer = buildDesigner(editorProperties, isTryMode);
|
||||
editorProperties.readOnly = false;
|
||||
designer = buildDesigner(editorProperties);
|
||||
|
||||
var domDocument = core.Utils.createDocumentFromText(mapXml);
|
||||
var serializer = mindplot.XMLMindmapSerializerFactory.getSerializerFromDocument(domDocument);
|
||||
@@ -121,7 +118,7 @@
|
||||
|
||||
<spring:message code="WELCOME"/>, ${principal.firstname}|<span><a
|
||||
href="${pageContext.request.contextPath}/c/mymaps.htm"><spring:message code="MY_WISEMAPS"/></a></span> |
|
||||
<span><a href="${pageContext.request.contextPath}/c/settings.htm" rel="moodalbox 400px 250px wizard"
|
||||
<span><a id="settings" href="${pageContext.request.contextPath}/c/settings.htm"
|
||||
title="<spring:message code="SETTINGS_DETAIL"/>"><spring:message code="SETTINGS"/></a></span>
|
||||
| <span><a href="${pageContext.request.contextPath}/c/logout.htm" title="<spring:message code="LOGOUT"/>">
|
||||
<spring:message code="LOGOUT"/>
|
||||
@@ -201,7 +198,7 @@
|
||||
<img src="../nicons/font-size.png"/>
|
||||
</div>
|
||||
<div id="fontBold" class="buttonOn" title="Bold Style">
|
||||
<img src="../nicons/topic-border.png"/>
|
||||
<img src="../nicons/font-bold.png"/>
|
||||
</div>
|
||||
<div id="fontItalic" class="buttonOn" title="Italic Style">
|
||||
<img src="../nicons/font-italic.png"/>
|
||||
|
@@ -64,7 +64,7 @@
|
||||
<tr>
|
||||
<td style="text-align:center;margin-top:10px;">
|
||||
<input type="button" id="ok" value="<spring:message code="OK"/>" class="btn-primary">
|
||||
<input type="button" value="<spring:message code="CANCEL"/>" class="btn-secondary"
|
||||
<input type="button" id="cancel" value="<spring:message code="CANCEL"/>" class="btn-secondary"
|
||||
onclick="">
|
||||
</td>
|
||||
</tr>
|
||||
@@ -89,6 +89,10 @@
|
||||
MooDialog.Request.active.close();
|
||||
});
|
||||
|
||||
$('cancel').addEvent('click', function(event) {
|
||||
MooDialog.Request.active.close();
|
||||
});
|
||||
|
||||
document.exportForm.mapSvg.value = $("workspaceContainer").innerHTML;
|
||||
|
||||
</script>
|
@@ -14,8 +14,7 @@
|
||||
<link rel="stylesheet" type="text/css" href="../css/mymaps.css"/>
|
||||
<link rel="icon" href="${pageContext.request.contextPath}/images/favicon.ico" type="image/x-icon"/>
|
||||
<link rel="shortcut icon" href="${pageContext.request.contextPath}/images/favicon.ico" type="image/x-icon"/>
|
||||
<script type='text/javascript'
|
||||
src='https://ajax.googleapis.com/ajax/libs/mootools/1.3.2/mootools-yui-compressed.js'></script>
|
||||
<script type='text/javascript' src='../js/libraries/mootools/mootools-core-1.3.2-full-compress.js'></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="content">
|
||||
|
@@ -1,28 +1,91 @@
|
||||
<%@ page import="java.text.DateFormat" %>
|
||||
<%@ page import="java.text.SimpleDateFormat" %>
|
||||
<%@ page import="java.util.Calendar" %>
|
||||
|
||||
<%@ include file="/jsp/init.jsp" %>
|
||||
|
||||
<%
|
||||
Calendar calendar = Calendar.getInstance(request.getLocale());
|
||||
calendar.setTimeInMillis(System.currentTimeMillis());
|
||||
DateFormat dateFormat = SimpleDateFormat.getDateTimeInstance(DateFormat.DEFAULT, DateFormat.DEFAULT, request.getLocale());
|
||||
String todayString = dateFormat.format(calendar.getTime());
|
||||
%>
|
||||
<!DOCTYPE HTML PUBLIC>
|
||||
<%@ include file="/jsp/init.jsp" %>
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>
|
||||
<spring:message code="PRINT"/>
|
||||
- ${mindmap.title}</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/common.css">
|
||||
<!--[if lt IE 9]>
|
||||
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||
<![endif]-->
|
||||
<title><spring:message code="SITE.TITLE"/> - ${mindmap.title} </title>
|
||||
<meta http-equiv="Content-type" content="text/html; charset=UTF-8"/>
|
||||
<meta http-equiv="Content-type" content="text/html; charset=UTF-8"/>
|
||||
<link rel="icon" href="../images/favicon.ico" type="image/x-icon">
|
||||
<link rel="shortcut icon" href="../images/favicon.ico" type="image/x-icon">
|
||||
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="../css/print.css"/>
|
||||
|
||||
<script type='text/javascript' src='../js/libraries/mootools/mootools-core-1.3.2-full-compress.js'></script>
|
||||
<script type='text/javascript' src='../js/libraries/mootools/mootools-more-1.3.2.1-yui.js'></script>
|
||||
<script type='text/javascript' src='../js/core.js'></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var mapId = '${mindmap.id}';
|
||||
var mapXml = '${mapXml}';
|
||||
var mindReady = false;
|
||||
$(document).addEvent('loadcomplete', function(resource) {
|
||||
mindReady = resource == 'mind' ? true : mindReady;
|
||||
if (mindReady) {
|
||||
|
||||
var editorProperties = {zoom:0.85,saveOnLoad:true,collab:'standalone',readOnly:true};
|
||||
designer = buildDesigner(editorProperties);
|
||||
|
||||
var domDocument = core.Utils.createDocumentFromText(mapXml);
|
||||
var serializer = mindplot.XMLMindmapSerializerFactory.getSerializerFromDocument(domDocument);
|
||||
var mindmap = serializer.loadFromDom(domDocument, mapId);
|
||||
|
||||
// Now, load the map ...
|
||||
designer.loadMap(mindmap);
|
||||
|
||||
$('zoomIn').addEvent('click', function() {
|
||||
designer.zoomIn();
|
||||
});
|
||||
|
||||
$('zoomOut').addEvent('click', function() {
|
||||
designer.zoomOut();
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body onload="setTimeout('print()', 5)">
|
||||
<div id="printHeader">
|
||||
<div id="printLogo"></div>
|
||||
<div id="headerTitle">${mindmap.title}<span id="headerSubTitle"> (<%=todayString%>)</span></div>
|
||||
|
||||
<div id="waitDialog" style="display:none">
|
||||
<div id="waitingContainer">
|
||||
<div class="loadingIcon"></div>
|
||||
<div class="loadingText">
|
||||
Loading ...
|
||||
</div>
|
||||
</div>
|
||||
<center>
|
||||
<img src="${mapSvg}" alt="${mindmap.title}"/>
|
||||
</center>
|
||||
</div>
|
||||
|
||||
<div id="errorDialog" style="display:none">
|
||||
<div id="errorContainer">
|
||||
<div class="loadingIcon"></div>
|
||||
<div class="loadingText">
|
||||
Unexpected error loading your map :(
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="printHeader">
|
||||
<div id="printLogo"></div>
|
||||
<div id="headerTitle">${mindmap.title}<span id="headerSubTitle"> (<%=todayString%>)</span></div>
|
||||
</div>
|
||||
<center>
|
||||
<div id="mindplot"></div>
|
||||
</center>
|
||||
<script type="text/javascript" src="../js/editor.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
BIN
wise-webapp/src/main/webapp/nicons/favicon.ico
Normal file
BIN
wise-webapp/src/main/webapp/nicons/favicon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Reference in New Issue
Block a user