Import / Export
Import
Create an Import Command.
This import command will be triggered by a ImportSaveDialogAction linked to ImportFildeDialog. This Dialog should use the FileUpload Filed.
Sequence:
Import Workbench Action is clicked (Generic CreateDialogActionDefinition -->ui-admincentral:import). TODO: Class info.magnolia.ui.admincentral.dialog.action.CreateDialogActionDefinition is replaced by info.magnolia.ui.framework.action.OpenCreateDialogActionDefinition.
- Get the selected Item from the TreeTable
- Call the Action (Creation of a configured Dialog)
- Once a file is selected (uploaded), and ckick on the SaveImportDialogAction is performed
- Get the Input file as an InputStream
- Call the ImportCommand
- Event sending(call refresh of the TreeView) and closing Dialog is handled by the presenter.getCallback().onSuccess() call and implementation.
Export
Create an Export Command (ExportCommand).
This export command used a (ExportStreamer) class in order to create a Vaadin Resource based on the OutputStream containing the xml and trigger the Upload on the client side.
Sequence:
ExportAction is clicked (class ExportAction extends CommandActionBase<ExportActionDefinition>) TODO: Class info.magnolia.ui.framework.app.action.CommandActionBase is replaced by info.magnolia.ui.framework.action.AbstractActionBase.
- Fill paramMap used by the Command (path of the Node to export, extension...)
- Call the Export Command (create an XML representation of a selected Node, and Fill an OutputStream)
- On executePostCommand,
- get param back from the Command (OutputStream, File name, mimeType)
- Call the ExportStreamer.openFileInBlankWindow(... in order to trigger the Upload request from the client side.
Import/Export Action improvement:
1 Comment
Antti Hietala
To do: