Add wisemapping support for import.
This commit is contained in:
@@ -231,11 +231,9 @@ UNEXPECTED_ERROR_SERVER_ERROR=We're sorry, an error has occurred and we can't pr
|
||||
NO_ENOUGH_PERMISSIONS=Outch!!. This map is not available anymore.
|
||||
NO_ENOUGH_PERMISSIONS_DETAILS=You do not have enough right access to see this map. This map has been changed to private or deleted.
|
||||
SHARING=Sharing
|
||||
IMPORT_MINDMAP=Import map
|
||||
IMPORT_MINDMAP_DETAILS=Do you already have maps created with FreeMind?.No problem, Import them!.
|
||||
IMPORT_MINDMAP_INFO=You can import FreeMind 0.9 version maps to WiseMapping. Please, select the FreeMind map that want to import. <br/>Fields marked with an asterisk <span class="fieldRequired">*</span> are required.
|
||||
IMPORT_MINDMAP_INFO=You can import FreeMind 0.9 maps and WiseMapping maps to your list of maps. Select the file you want to import.
|
||||
PRINT=Print
|
||||
FREE_MIND_FILE=FreeMind File
|
||||
MIND_FILE=File
|
||||
IMPORT_MAP_ERROR=FreeMind file could not be imported. {0}
|
||||
MAP_TITLE_ALREADY_EXISTS=A map already exists with this name.
|
||||
EMBEDDED_VIEWER=Embed a map viewer in your own web site, blog or post!
|
||||
|
@@ -215,9 +215,8 @@ NO_ENOUGH_PERMISSIONS_DETAILS=No tiene suficiente permisos de acceso para ver es
|
||||
SHARING=Colaboración
|
||||
IMPORT_MINDMAP=Importar mapa
|
||||
IMPORT_MINDMAP_DETAILS=Tiene mapas creados con FreeMind?. Ningun problema, los puede importar!.
|
||||
IMPORT_MINDMAP_INFO=Ahora puedes importar mapas de FreeMind a WiseMapping. Por favor, seleccione el mapa FreeMind que desea importar. <br/>Los campos marcados con un asterisco <span class="fieldRequired">*</span> son requeridos.
|
||||
PRINT=Imprimir
|
||||
FREE_MIND_FILE=Archivo FreeMind
|
||||
FREE_MIND_FILE=Archivo de mapa mentaa
|
||||
IMPORT_MAP_ERROR=El archivo importado no parece ser un archivo FreeMind válido
|
||||
MAP_TITLE_ALREADY_EXISTS=Nombre de mapa ya existente.
|
||||
EMBEDDED_VIEWER=Incluya un visor de mapa en su sitio web, blog o post.
|
||||
|
@@ -230,9 +230,7 @@ NO_ENOUGH_PERMISSIONS_DETAILS = Vous ne pouvez pas acc\u00e9der \u00e0 cette car
|
||||
SHARING = Partager
|
||||
IMPORT_MINDMAP = Importer une carte
|
||||
IMPORT_MINDMAP_DETAILS = Vous avez d\u00e9j\u00e0 cr\u00e9\u00e9 des cartes sur FreeMind ou FreePlane? Pas de probl\u00e9me, importez-les!
|
||||
IMPORT_MINDMAP_INFO=Vous pouvez importer les cartes FreeMind dans WiseMapping. Choisissez la carte que vous souhaiez importer. <br/>Les champs avec une ast\u00e9risque sont requis.
|
||||
PRINT = Imprimer
|
||||
FREE_MIND_FILE = Fichier FreeMind
|
||||
IMPORT_MAP_ERROR = Le fichier import\u00e9 ne semble pas \u00eatre un fichier FreeMind valide.
|
||||
MAP_TITLE_ALREADY_EXISTS = Le titre de la carte existe d\u00e9j\u00e0.
|
||||
EMBEDDED_VIEWER = Int\u00e9grer un visualiseur de carte dans votre propre site internet, blog ou billet.
|
||||
|
@@ -164,9 +164,7 @@
|
||||
<put name="body" value="/jsp/keyboard.jsp"/>
|
||||
</definition>
|
||||
|
||||
<definition name="mindmapImport" extends="pageTemplate">
|
||||
<put name="title" value="IMPORT_MINDMAP"/>
|
||||
<put name="details" value="IMPORT_MINDMAP_INFO"/>
|
||||
<definition name="mindmapImport" extends="dialogTemplate">
|
||||
<put name="body" value="/jsp/mindmapImport.jsp"/>
|
||||
</definition>
|
||||
|
||||
|
@@ -27,12 +27,6 @@
|
||||
</bean>
|
||||
|
||||
|
||||
<bean id="cookerController" class="com.wisemapping.controller.MindmapCooker">
|
||||
<property name="methodNameResolver" ref="paramResolverByAction"/>
|
||||
<property name="mindmapService" ref="mindmapService"/>
|
||||
<property name="userService" ref="userService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="loginController" class="com.wisemapping.controller.LoginController">
|
||||
<property name="methodNameResolver" ref="paramResolverByAction"/>
|
||||
<property name="mindmapService" ref="mindmapService"/>
|
||||
@@ -131,11 +125,6 @@
|
||||
<property name="userService" ref="userService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="publicView" class="com.wisemapping.controller.PublicViewController">
|
||||
<property name="methodNameResolver" ref="paramResolverByAction"/>
|
||||
<property name="mindmapService" ref="mindmapService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
|
||||
<property name="interceptors">
|
||||
<list>
|
||||
@@ -145,9 +134,6 @@
|
||||
</property>
|
||||
<property name="mappings">
|
||||
<props>
|
||||
<!-- Review -->
|
||||
<prop key="publicView">publicView</prop>
|
||||
|
||||
<!-- Forms based -->
|
||||
<prop key="userRegistration">userController</prop>
|
||||
<prop key="sharing">sharingController</prop>
|
||||
@@ -155,7 +141,6 @@
|
||||
<prop key="forgotPassword">forgotPasswordController</prop>
|
||||
<prop key="activation">activationController</prop>
|
||||
<prop key="changePassword">changePasswordController</prop>
|
||||
<prop key="cooker">cookerController</prop>
|
||||
<prop key="settings">settingsController</prop>
|
||||
<prop key="editProfile">editProfileController</prop>
|
||||
<prop key="history">historyController</prop>
|
||||
|
@@ -161,6 +161,8 @@ jQuery.fn.dialogForm = function(options) {
|
||||
dialogElem.modal('hide');
|
||||
$('#messagesPanel div').text(errorThrown).parent().show();
|
||||
}
|
||||
var acceptBtn = $('#' + containerId + ' .btn-accept');
|
||||
acceptBtn.button('reset');
|
||||
|
||||
}
|
||||
});
|
||||
@@ -348,10 +350,6 @@ $(function() {
|
||||
});
|
||||
});
|
||||
|
||||
$("#importBtn").click(function() {
|
||||
window.location = 'c/maps/import';
|
||||
});
|
||||
|
||||
$("#duplicateBtn").click(function() {
|
||||
// Map to be cloned ...
|
||||
var tableElem = $('#mindmapListTable');
|
||||
@@ -433,40 +431,36 @@ $(function() {
|
||||
});
|
||||
|
||||
$("#infoBtn").click(function() {
|
||||
var mapIds = $('#mindmapListTable').dataTableExt.getSelectedMapsIds();
|
||||
if (mapIds.length > 0) {
|
||||
$('#info-dialog-modal .modal-body').load("c/maps/" + mapIds[0] + "/details", function() {
|
||||
$('#info-dialog-modal').modal();
|
||||
});
|
||||
|
||||
}
|
||||
showEmbeddedDialog("c/maps/{mapId}/details", 'info-dialog-modal');
|
||||
});
|
||||
|
||||
$("#publishBtn").click(function() {
|
||||
var mapIds = $('#mindmapListTable').dataTableExt.getSelectedMapsIds();
|
||||
if (mapIds.length > 0) {
|
||||
$('#publish-dialog-modal .modal-body').load("c/maps/" + mapIds[0] + "/publish",
|
||||
function() {
|
||||
$('#publish-dialog-modal .btn-accept').click(function() {
|
||||
submitDialogForm();
|
||||
});
|
||||
$('#publish-dialog-modal').modal();
|
||||
});
|
||||
}
|
||||
showEmbeddedDialog("c/maps/{mapId}/publish", "publish-dialog-modal");
|
||||
});
|
||||
|
||||
$("#exportBtn").click(function() {
|
||||
var mapIds = $('#mindmapListTable').dataTableExt.getSelectedMapsIds();
|
||||
if (mapIds.length > 0) {
|
||||
$('#export-dialog-modal .modal-body').load("c/maps/" + mapIds[0] + "/export",
|
||||
function() {
|
||||
$('#export-dialog-modal .btn-accept').click(function() {
|
||||
submitDialogForm();
|
||||
});
|
||||
$('#export-dialog-modal').modal();
|
||||
showEmbeddedDialog("c/maps/{mapId}/export", 'export-dialog-modal');
|
||||
});
|
||||
|
||||
$("#importBtn").click(function() {
|
||||
showEmbeddedDialog("c/maps/import", 'import-dialog-modal', true);
|
||||
});
|
||||
|
||||
|
||||
var showEmbeddedDialog = function(urlTemplate, dialogElemId, ignore) {
|
||||
var mapIds = $('#mindmapListTable').dataTableExt.getSelectedMapsIds();
|
||||
if (mapIds.length > 0 || ignore) {
|
||||
var mapId = mapIds[0];
|
||||
$('#' + dialogElemId + ' .modal-body').load(urlTemplate.replace("{mapId}", mapId),
|
||||
function() {
|
||||
$('#' + dialogElemId + ' .btn-accept').click(function() {
|
||||
submitDialogForm();
|
||||
});
|
||||
}
|
||||
});
|
||||
$('#' + dialogElemId).modal();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
$("#actionButtons .shareMap").click(function() {
|
||||
});
|
||||
|
@@ -2,6 +2,15 @@
|
||||
|
||||
<%@ include file="/jsp/init.jsp" %>
|
||||
|
||||
|
||||
<script type="text/javascript" language="javascript">
|
||||
$(function() {
|
||||
$('.btn-primary').click(function() {
|
||||
$(this).button("loading");
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<div id="loginContent">
|
||||
<div class="loginNews">
|
||||
<h1>What is New: </h1>
|
||||
@@ -38,8 +47,9 @@
|
||||
</c:if>
|
||||
|
||||
<div class="form-inline">
|
||||
<input type="submit" class="btn btn-primary" value="<spring:message code="SIGN_IN"/>"
|
||||
data-toggle="button">
|
||||
<button class="btn btn-primary" data-loading-text="<spring:message code="SIGN_IN"/> ...">
|
||||
<spring:message code="SIGN_IN"/></button>
|
||||
|
||||
<input type="checkbox" id="rememberme" name="_spring_security_remember_me"/>
|
||||
<label for="rememberme"><spring:message code="REMEMBER_ME"/></label>
|
||||
</div>
|
||||
|
@@ -1,68 +1,98 @@
|
||||
<%@ include file="/jsp/init.jsp" %>
|
||||
|
||||
<div class="fform">
|
||||
<h1>
|
||||
<spring:message code="${requestScope.title}"/>
|
||||
</h1>
|
||||
<div id="messagePanel" class="alert alert-error">
|
||||
|
||||
<p><spring:message code="${requestScope.details}"/></p>
|
||||
</div>
|
||||
|
||||
<form method="post" enctype="multipart/form-data" action="#">
|
||||
<div>
|
||||
|
||||
<p class="well"><spring:message code="IMPORT_MINDMAP_INFO"/></p>
|
||||
|
||||
<form method="POST" enctype="multipart/form-data" action="#" id="dialogMainForm" class="form-horizontal">
|
||||
<fieldset>
|
||||
<label for="title"><spring:message code="NAME"/></label>
|
||||
<input type="text" id="title" required="required"/>
|
||||
<div class="control-group">
|
||||
<label for="mapFile" class="control-label"><spring:message code="MIND_FILE"/>: </label>
|
||||
<input type="file" name="mapFile" id="mapFile" required="required" class="control"/>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label for="title" class="control-label"><spring:message code="NAME"/>: </label>
|
||||
<input type="text" id="title" required="required" placeholder="Name of the new map to create"
|
||||
class="control"/>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
|
||||
<label for="description"><spring:message code="DESCRIPTION"/></label>
|
||||
<input type="text" name="description" id="description"/>
|
||||
<label for="description" class="control-label"><spring:message code="DESCRIPTION"/>: </label>
|
||||
<textarea type="text" name="description" id="description"
|
||||
placeholder="Some description for your map" class="control"></textarea>
|
||||
</div>
|
||||
|
||||
<label><spring:message code="DESCRIPTION"/> </label>
|
||||
<input type="radio" name="type" value="mm"/> Freemind (0.9)
|
||||
<input type="radio" name="type" value="wxml"/> WiseMapping
|
||||
|
||||
<label for="mapFile"><spring:message code="FREE_MIND_FILE"/></label>
|
||||
<input type="file" name="mapFile" id="mapFile"/>
|
||||
</fieldset>
|
||||
|
||||
<input type="button" id="acceptButton" value="<spring:message code="IMPORT"/>" class="btn btn-primary"/>
|
||||
<input type="button" id="cancelButton" value="<spring:message code="CANCEL"/>" class="btn">
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
// @Todo: Pending: report errors, manage corrupted mapsmanage case,escape url parameters, import with same title tries to save in post XML, explanation.
|
||||
|
||||
$('#messagePanel').hide();
|
||||
|
||||
// Save status on click ...
|
||||
var contentType = null;
|
||||
var fileContent = null;
|
||||
|
||||
$('#cancelButton').click(function() {
|
||||
window.location = '/c/maps/';
|
||||
});
|
||||
|
||||
$('#dialogMainForm').submit(function(event) {
|
||||
// Load form parameters ...
|
||||
var title = $('#dialogMainForm #title').attr('value');
|
||||
title = title == undefined ? "" : title;
|
||||
|
||||
$('#acceptButton').click(function(event) {
|
||||
var description = $('#dialogMainForm #description').attr('value');
|
||||
description = description == undefined ? "" : description;
|
||||
|
||||
// http://www.html5rocks.com/en/tutorials/file/dndfiles/
|
||||
var content;
|
||||
if (window.FileReader) {
|
||||
reader = new FileReader();
|
||||
reader.onloadend = function (e) {
|
||||
content = e.target.result;
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
}
|
||||
// Save status on click ...
|
||||
jQuery.ajax("service/maps?title=" + encodeURI(title) + "&description=" + encodeURI(description),
|
||||
{
|
||||
async:false,
|
||||
data: fileContent,
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
contentType:contentType,
|
||||
success : function(data, textStatus, jqXHR) {
|
||||
var resourceId = jqXHR.getResponseHeader("ResourceId");
|
||||
window.location = "c/maps/" + resourceId + "/edit";
|
||||
},
|
||||
error: function(jqXHR, textStatus, errorThrown) {
|
||||
$('#messagePanel').text(textStatus);
|
||||
}
|
||||
});
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
jQuery.ajax("service/maps", {
|
||||
async:false,
|
||||
dataType: 'application/freemind',
|
||||
data: "",
|
||||
type: 'PUT',
|
||||
contentType:"text/plain",
|
||||
success : function(data, textStatus, jqXHR) {
|
||||
},
|
||||
error: function(jqXHR, textStatus, errorThrown) {
|
||||
}
|
||||
$('#dialogMainForm #mapFile').change(function(event) {
|
||||
var file = event.target.files[0];
|
||||
var reader = new FileReader();
|
||||
|
||||
var title = file.name;
|
||||
title = title.substring(0, title.lastIndexOf("."));
|
||||
$('#dialogMainForm #title').attr('value', jQuery.camelCase(title));
|
||||
|
||||
// Closure to capture the file information.
|
||||
reader.onload = (function(event) {
|
||||
fileContent = event.target.result;
|
||||
contentType = file.name.lastIndexOf(".wxml") != -1 ? "application/xml" : "application/freemind";
|
||||
});
|
||||
|
||||
// Read in the image file as a data URL.
|
||||
reader.readAsBinaryString(file);
|
||||
});
|
||||
|
||||
// Hook for interaction with the main parent window ...
|
||||
var submitDialogForm = function() {
|
||||
$('#dialogMainForm').submit();
|
||||
}
|
||||
|
||||
</script>
|
@@ -40,6 +40,7 @@
|
||||
<div id="mindmapListContainer">
|
||||
<div id="messagesPanel" class="alert alert-error alert-block fade in hide" style="margin-top: 10px">
|
||||
<strong><spring:message code="UNEXPECTED_ERROR"/></strong>
|
||||
|
||||
<p><spring:message code="UNEXPECTED_ERROR_SERVER_ERROR"/></p>
|
||||
|
||||
<div></div>
|
||||
@@ -264,6 +265,20 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Export Dialog Config -->
|
||||
<div id="import-dialog-modal" class="modal fade" style="display: none">
|
||||
<div class="modal-header">
|
||||
<button class="close" data-dismiss="modal">x</button>
|
||||
<h3>Import</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-primary btn-accept" data-loading-text="Importing...">Import</button>
|
||||
<button class="btn btn-cancel" data-dismiss="modal">Cancel</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
@@ -28,7 +28,7 @@
|
||||
|
||||
<script type="text/javascript" language="javascript" src="js/jquery-1.7.2.min.js"></script>
|
||||
<script type="text/javascript" language="javascript" src="bootstrap/js/bootstrap.js"></script>
|
||||
|
||||
<script src="js/less.js" type="text/javascript"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
Reference in New Issue
Block a user