Ticket #871 (closed Defect: fixed)
dm4-import-export: upgrade to 4.7
Reported by: | Malte | Owned by: | Malte |
---|---|---|---|
Priority: | Major | Milestone: | Release 4.8 |
Component: | DeepaMehta Standard Distribution | Version: | 4.7 |
Keywords: | Cc: | jri, JuergeN | |
Complexity: | 1 | Area: | |
Module: |
Description
Let's remove the export import functionality via JSON for the upcoming release completely (from the GUI, since it is yet unfinished business) and just deliver the "Export Topicmap to SVG".
The SVG file export definitely needs to be adapted to the new file-repo service.
Source Code:
https://github.com/mukil/dm4-import-export
Change History
comment:2 Changed 9 years ago by Malte
Now, when per_workspace=true and utilizing the FilesServive?.getFile("/") (thanks to jri's hint #815), the SVG export works OK. Despite there is no "File Topic" created for the exported file in DM4, the SVG Document was written into the configured file repo.
SVG Export is (despite the missing file topic) working for both conditions (with per-workspace filerepos and with a global filrepo).
JSON Export works fine when the per-workspace setting turned OFF.
If per-workspace is on, the JSON Export document is written to the hard disk but the FilesPlugin? throws an Exception because of the impossibility of creating a workspace assignment when just doing:
String jsonFileName = "topicmap-" + topicmapId + ".txt"; return filesService.createFile(in, jsonFileName);
Here is the log:
g! Nov 11, 2015 12:54:06 PM net.abriraqui.dm4.importexport.ImportExportPlugin exportTopicmapToJSON INFORMATION: Exporting Topicmap ######### 2247 Nov 11, 2015 12:54:06 PM de.deepamehta.plugins.topicmaps.TopicmapsPlugin getTopicmap INFORMATION: Loading topicmap 2247 (includeChilds=true) Nov 11, 2015 12:54:06 PM de.deepamehta.plugins.files.FilesPlugin createFile INFORMATION: Creating file (from input stream) at repository path "topicmap-2247.txt" Nov 11, 2015 12:54:06 PM de.deepamehta.plugins.files.FilesPlugin checkPath INFORMATION: Checking path "/home/malted/Schreibtisch/filerepo-test/topicmap-2247.txt" dm4.filerepo.path="/home/malted/Schreibtisch/filerepo-test" => PATH OK Nov 11, 2015 12:54:06 PM de.deepamehta.plugins.files.FilesPlugin getFileTopic INFORMATION: Creating File topic for repository path "topicmap-2247.txt" Nov 11, 2015 12:54:06 PM de.deepamehta.plugins.files.FilesPlugin checkPath INFORMATION: Checking path "/home/malted/Schreibtisch/filerepo-test/topicmap-2247.txt" dm4.filerepo.path="/home/malted/Schreibtisch/filerepo-test" => PATH OK Nov 11, 2015 12:54:06 PM de.deepamehta.plugins.files.FilesPlugin checkExistence INFORMATION: Checking existence of "/home/malted/Schreibtisch/filerepo-test/topicmap-2247.txt" => EXISTS Nov 11, 2015 12:54:06 PM de.deepamehta.plugins.workspaces.WorkspacesPlugin workspaceAssignmentIsSuppressed INFORMATION: Standard workspace assignment for topic 12553 (typeUri="dm4.files.file_name", uri="") SUPPRESSED Nov 11, 2015 12:54:06 PM de.deepamehta.plugins.workspaces.WorkspacesPlugin workspaceAssignmentIsSuppressed INFORMATION: Standard workspace assignment for association 12554 (typeUri="dm4.core.composition") SUPPRESSED Nov 11, 2015 12:54:06 PM de.deepamehta.plugins.workspaces.WorkspacesPlugin workspaceAssignmentIsSuppressed INFORMATION: Standard workspace assignment for topic 12556 (typeUri="dm4.files.path", uri="") SUPPRESSED Nov 11, 2015 12:54:06 PM de.deepamehta.plugins.workspaces.WorkspacesPlugin workspaceAssignmentIsSuppressed INFORMATION: Standard workspace assignment for association 12799 (typeUri="dm4.core.composition") SUPPRESSED Nov 11, 2015 12:54:06 PM de.deepamehta.plugins.workspaces.WorkspacesPlugin workspaceAssignmentIsSuppressed INFORMATION: Standard workspace assignment for topic 12797 (typeUri="dm4.files.media_type", uri="") SUPPRESSED Nov 11, 2015 12:54:06 PM de.deepamehta.plugins.workspaces.WorkspacesPlugin workspaceAssignmentIsSuppressed INFORMATION: Standard workspace assignment for association 12794 (typeUri="dm4.core.composition") SUPPRESSED Nov 11, 2015 12:54:06 PM de.deepamehta.plugins.workspaces.WorkspacesPlugin workspaceAssignmentIsSuppressed INFORMATION: Standard workspace assignment for topic 12792 (typeUri="dm4.files.size", uri="") SUPPRESSED Nov 11, 2015 12:54:06 PM de.deepamehta.plugins.workspaces.WorkspacesPlugin workspaceAssignmentIsSuppressed INFORMATION: Standard workspace assignment for association 12789 (typeUri="dm4.core.composition") SUPPRESSED Nov 11, 2015 12:54:06 PM de.deepamehta.plugins.workspaces.WorkspacesPlugin workspaceAssignmentIsSuppressed INFORMATION: Standard workspace assignment for topic 12550 (typeUri="dm4.files.file", uri="") SUPPRESSED Nov 11, 2015 12:54:06 PM de.deepamehta.core.util.UniversalExceptionMapper logException SCHWERWIEGEND: Request "POST /import-export/export/json" failed. Responding with 500 (Internal Server Error). The original exception/error is: java.lang.RuntimeException: Export failed at net.abriraqui.dm4.importexport.ImportExportPlugin.exportTopicmapToJSON(ImportExportPlugin.java:55) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60) at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$TypeOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:185) at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75) at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302) at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) at com.sun.jersey.server.impl.uri.rules.ResourceObjectRule.accept(ResourceObjectRule.java:100) at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84) at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1480) at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1411) at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1360) at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1350) at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416) at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:538) at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:716) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.felix.http.base.internal.handler.ServletHandler.doHandle(ServletHandler.java:339) at org.apache.felix.http.base.internal.handler.ServletHandler.handle(ServletHandler.java:300) at org.apache.felix.http.base.internal.dispatch.ServletPipeline.handle(ServletPipeline.java:93) at org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFilterChain.java:50) at org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.java:31) at org.apache.felix.http.base.internal.dispatch.FilterPipeline.dispatch(FilterPipeline.java:76) at org.apache.felix.http.base.internal.dispatch.Dispatcher.dispatch(Dispatcher.java:49) at org.apache.felix.http.base.internal.DispatcherServlet.service(DispatcherServlet.java:67) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:501) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:229) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135) at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116) at org.eclipse.jetty.server.Server.handle(Server.java:370) at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494) at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:971) at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1033) at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644) at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235) at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82) at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:667) at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.RuntimeException: Creating file (from input stream) at repository path "topicmap-2247.txt" failed at de.deepamehta.plugins.files.FilesPlugin.createFile(FilesPlugin.java:229) at net.abriraqui.dm4.importexport.ImportExportPlugin.exportTopicmapToJSON(ImportExportPlugin.java:53) ... 51 more Caused by: java.lang.RuntimeException: Creating File topic for repository path "topicmap-2247.txt" failed at de.deepamehta.plugins.files.FilesPlugin.getFileTopic(FilesPlugin.java:124) at de.deepamehta.plugins.files.FilesPlugin.createFile(FilesPlugin.java:227) ... 52 more Caused by: java.lang.RuntimeException: Creating workspace assignment for File/Folder topic or folder association failed at de.deepamehta.plugins.files.FilesPlugin.createWorkspaceAssignment(FilesPlugin.java:623) at de.deepamehta.plugins.files.FilesPlugin.createFileOrFolderTopic(FilesPlugin.java:569) at de.deepamehta.plugins.files.FilesPlugin.createFileTopic(FilesPlugin.java:535) at de.deepamehta.plugins.files.FilesPlugin.getFileTopic(FilesPlugin.java:120) ... 53 more Caused by: java.lang.RuntimeException: No workspace recognized in repository path "/topicmap-2247.txt" at de.deepamehta.plugins.files.FilesPlugin.createWorkspaceAssignment(FilesPlugin.java:615) ... 56 more
comment:3 Changed 9 years ago by jri
See this posting for a discussion of this problem:
http://lists.deepamehta.de/pipermail/devel-lists.deepamehta.de/2015-November/000605.html
See #884 for the aimed solution.
comment:4 Changed 9 years ago by Malte
- Status changed from new to closed
- Resolution set to fixed
Yes, thanks also to your mailing list reply this was solved with a commit 10 days ago.
The 0.3 Release was yesterday:
http://download.deepamehta.de/nightly/dm47-import-export-0.3.jar
See "Version History" here (for more details on this release):
https://github.com/mukil/dm4-import-export
comment:5 Changed 9 years ago by jri
Let's remove the export import functionality via JSON for the upcoming release completely (from the GUI, since it is yet unfinished business)
To my knowledge this simple use case was functional already: JSON export/import a topicmap from one DM standard distro to another DM standard distro, that is when no custom types are used. I think this is still a useful function and it should be added again.
comment:6 Changed 9 years ago by jri
- Status changed from closed to reopened
- Resolution fixed deleted
comment:7 Changed 9 years ago by Malte
- Status changed from reopened to closed
- Resolution set to fixed
Of course, JSON import and export functionality comes back with a maintenance release of the plugin. You can download the new version from here:
http://download.deepamehta.de/dm47-import-export-0.3.1.jar
For details on changes see here:
https://github.com/mukil/dm4-import-export#version-history
To continue to work this plugin implementation needs to know the path (absolute path to a workspace file-repo), for a given request since it utilizes a "XMLStreamWriter" to assemble and write a SVG document into a file-repo.
See https://github.com/mukil/dm4-import-export/commit/3a44025cd5aa26de179e72123e63271221e5bd7f