Working on a "REST" version of import.

This commit is contained in:
Paulo Gustavo Veiga
2012-06-03 19:19:48 -03:00
parent b914bbb8a8
commit 3907e04ff6
12 changed files with 82 additions and 222 deletions

View File

@@ -1,6 +1,6 @@
NEW_MINDMAP=Create a new map
NAME=Name
DESCRIPTION=Description
FILE_FORMAT=File Format
OK=Ok
WISEMAPPING=WiseMapping
ADD=Add
@@ -245,7 +245,6 @@ FREEMIND_EXPORT_IMPORT_MESSAGE=You can now easily import and export mind maps fr
EDITOR_TOOLBAR_IMPROVED=Usability Improvement: The editor toolbar has been redesign
EDITOR_TOOLBAR_IMPROVED_MESSAGE= The toolbar has been redesign to improve its usability.
COLLABORATE=Collaborate
IMPORT-EXPORT_ISSUES_FIXED=Usability Improvement: Import-Export issues have been solved.
GO_TO= Go to my Wisemaps
NEWS_AND_ARTICLES=News & Articles

View File

@@ -1,4 +1,3 @@
NEW_MINDMAP=Crear un nuevo mapa
NAME=Nombre
DESCRIPTION=Descripción
OK=Ok

View File

@@ -1,4 +1,3 @@
NEW_MINDMAP = Cr\u00e9er une nouvelle carte mentale
NAME = Nom
DESCRIPTION = Description
OK = Ok
@@ -246,13 +245,6 @@ COLLABORATE = Contribuer
PRINT_FEATURE_IMPLEMENTED = Imprimer la carte maintenant.
PRINT_FEATURE_IMPLEMENTED_MESSAGE = Vous pouvez maintenant imprimer vos cartes \u00e0 partir de l\'\u00e9diteur et de la liste de cartes!
EMBEDDED_MAP_SIZE=* Note
USABILITY_EDITING_IMPROVED= Usability Improvement =
USABILITY_EDITING_IMPROVED_ESC= Usability Improvement =
USABILITY_EDITING_IMPROVED_TEXT=Now you have 3 different ways of editing a node text.</br><ul><li><b>Typing</b> Start typing to replace the focused node text.</li><li><b>F2</b> Pressing F2 key, will let you edit the node text</li><li><b>Double click
USABILITY_EDITING_IMPROVED_TEXT_ESC =
IMPORT-EXPORT_ISSUES_FIXED=Usability Improvement
USABILITY_EDITOR_IMPROVED= Usability Improvement
USABILITY_EDITOR_IMPROVED_SHRINK= Usability Improvement
EDITOR_LINKS=Mind Map feature
NEWS_ADD_ICON=Mind Map feature
EXPORT_FORMAT_RESTRICTIONS=Important: Exporting to Image, PDF or SVG is available only in the editor toolbar only.\

View File

@@ -166,7 +166,7 @@
<put name="body" value="/jsp/keyboard.jsp"/>
</definition>
<definition name="importMap" extends="pageTemplate">
<definition name="mindmapImport" extends="pageTemplate">
<put name="title" value="IMPORT_MINDMAP"/>
<put name="details" value="IMPORT_MINDMAP_INFO"/>
<put name="body" value="/jsp/mindmapImport.jsp"/>

View File

@@ -114,28 +114,12 @@
<property name="userService" ref="userService"/>
</bean>
<bean id="importMapValidator" class="com.wisemapping.validator.ImportMapValidator">
<property name="mindmapService" ref="mindmapService"/>
</bean>
<bean id="historyController" class="com.wisemapping.controller.HistoryController">
<property name="methodNameResolver" ref="paramResolverByAction"/>
<property name="mindmapService" ref="mindmapService"/>
<property name="userService" ref="userService"/>
</bean>
<bean id="importMapController" class="com.wisemapping.controller.ImportController">
<property name="sessionForm" value="false"/>
<property name="commandName" value="importMap"/>
<property name="commandClass" value="com.wisemapping.view.ImportMapBean"/>
<property name="validator" ref="importMapValidator"/>
<property name="formView" value="importMap"/>
<property name="errorView" value="importMap"/>
<property name="mindmapService" ref="mindmapService"/>
<property name="userService" ref="userService"/>
</bean>
<bean id="multipartResolver"
class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
@@ -166,8 +150,6 @@
</property>
<property name="mappings">
<props>
<prop key="maps/import">importMapController</prop>
<!-- Review -->
<prop key="publicView">publicView</prop>
<prop key="embeddedView">embeddedView</prop>

View File

@@ -260,7 +260,7 @@ function callbackOnTableInit() {
$(function() {
$('#mindmapListTable').dataTable({
bProcessing : true,
sAjaxSource : "../service/maps",
sAjaxSource : "../service/maps/",
sAjaxDataProp: 'mindmapsInfo',
fnInitComplete: function() {
$('#mindmapListTable tbody').change(updateStatusToolbar);
@@ -349,7 +349,7 @@ $(function() {
});
$("#importBtn").click(function() {
window.open('c/maps/import');
window.location = 'c/maps/import';
});
$("#duplicateBtn").click(function() {
@@ -483,7 +483,7 @@ $(function() {
$('#foldersContainer .active i').addClass('icon-white');
// Reload the table data ...
dataTable.fnReloadAjax("../service/maps?q=" + $(this).attr('data-filter'), callbackOnTableInit, true);
dataTable.fnReloadAjax("../service/maps/?q=" + $(this).attr('data-filter'), callbackOnTableInit, true);
event.preventDefault();
});
});

View File

@@ -6,24 +6,63 @@
</h1>
<p><spring:message code="${requestScope.details}"/></p>
<form:form method="post" commandName="importMap" enctype="multipart/form-data">
<form method="post" enctype="multipart/form-data" action="#">
<fieldset>
<label for="title"><spring:message code="NAME"/></label>
<form:input path="title" id="title" tabindex="1" required="required"/>
<form:errors path="title" cssClass="errorMsg"/>
<input type="text" id="title" required="required"/>
<label for="title"><spring:message code="DESCRIPTION"/></label>
<form:input path="description" id="description" tabindex="2"/>
<form:errors path="description" cssClass="errorMsg"/>
<label for="description"><spring:message code="DESCRIPTION"/></label>
<input type="text" name="description" id="description"/>
<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"/>
<form:errors path="mapFile" cssClass="errorMsg"/>
</fieldset>
<input type="submit" value="<spring:message code="IMPORT"/>" class="btn btn-primary"/>
<input type="button" value="<spring:message code="CANCEL"/>" class="btn"
onclick="window.location='/c/maps/'">
</form:form>
<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">
// Save status on click ...
$('#cancelButton').click(function() {
window.location = '/c/maps/';
});
$('#acceptButton').click(function(event) {
// 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);
}
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) {
}
});
});
// Hook for interaction with the main parent window ...
var submitDialogForm = function() {
$('#dialogMainForm').submit();
}
</script>