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:

 

  1. 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. Unable to locate Jira server for this macro. It may be due to Application Link configuration.

    1. Get the selected Item from the TreeTable
    2. Call the Action (Creation of a configured Dialog)
  2. Once a file is selected (uploaded), and ckick on the SaveImportDialogAction is performed
    1. Get the Input file as an InputStream
    2. Call the ImportCommand
    3. 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:

 

  1. 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. Unable to locate Jira server for this macro. It may be due to Application Link configuration.

    1. Fill paramMap used by the Command (path of the Node to export, extension...)
    2. Call the Export Command (create an XML representation of a selected Node, and Fill an OutputStream)
    3. On executePostCommand,
      1. get param back from the Command (OutputStream, File name, mimeType)
      2. Call the ExportStreamer.openFileInBlankWindow(... in order to trigger the Upload request from the client side.

 

Import/Export Action improvement:

Unable to locate Jira server for this macro. It may be due to Application Link configuration.

1 Comment

  1. To do:

    • The import and export action examples should go to an advanced section of documentation about Dialog action definition
    • Use Philipp's Amplify presentation slide 91 to explain the relationship between actions and commands. http://www.slideshare.net/pbaerfuss/magnolia-m5-under-the-hood
    • Explain the concept of reusable, extensible UI actions that can launch typical commands (start workflow, export, activate, version etc.)
    • Write a tutorial how to add an action to a basic ContentApp. It builds upon the My first content app tutorial.