info.magnolia.ui.framework.action
Class ExportAction

java.lang.Object
  extended by info.magnolia.ui.api.action.AbstractAction<D>
      extended by info.magnolia.ui.framework.action.AbstractMultiItemAction<D>
          extended by info.magnolia.ui.framework.action.AbstractCommandAction<ExportActionDefinition>
              extended by info.magnolia.ui.framework.action.ExportAction
All Implemented Interfaces:
Action

public class ExportAction
extends AbstractCommandAction<ExportActionDefinition>

Action for exporting a node to XML format. Uses the export command to perform the serialization to XML then sends the result to the client browser.

See Also:
ExportActionDefinition

Field Summary
 
Fields inherited from class info.magnolia.ui.framework.action.AbstractCommandAction
COMMAND_RESULT
 
Constructor Summary
ExportAction(ExportActionDefinition definition, JcrItemAdapter item, info.magnolia.commands.CommandsManager commandsManager, UiContext uiContext, info.magnolia.i18nsystem.SimpleTranslator i18n)
           
 
Method Summary
protected  Map<String,Object> buildParams(javax.jcr.Item jcrItem)
          Builds a map of parameters which will be passed to the current command for execution.
protected  void onPostExecute()
          After command execution we push the created XML to the client browser.
The created data is put in the temporary file 'fileOutput' linked to 'fileOutputStream' sent to the export command.
This temporary file is the used to create a DeleteOnCloseFileInputStream that ensure that this temporary file is removed once the
fileInputStream is closed by Vaadin resource component.
protected  void openFileInBlankWindow(String fileName, String mimeType)
           
 
Methods inherited from class info.magnolia.ui.framework.action.AbstractCommandAction
executeOnItem, getCommand, getCommandsManager, getFailureMessage, getParams, getSuccessMessage, onError, onPreExecute
 
Methods inherited from class info.magnolia.ui.framework.action.AbstractMultiItemAction
execute, getCurrentItem, getErrorNotification, getFailedItems, getItemComparator, getItems, getSortedItems, getUiContext, setCurrentItem
 
Methods inherited from class info.magnolia.ui.api.action.AbstractAction
getDefinition
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExportAction

@Inject
public ExportAction(ExportActionDefinition definition,
                           JcrItemAdapter item,
                           info.magnolia.commands.CommandsManager commandsManager,
                           UiContext uiContext,
                           info.magnolia.i18nsystem.SimpleTranslator i18n)
             throws ActionExecutionException
Throws:
ActionExecutionException
Method Detail

onPostExecute

protected void onPostExecute()
                      throws Exception
After command execution we push the created XML to the client browser.
The created data is put in the temporary file 'fileOutput' linked to 'fileOutputStream' sent to the export command.
This temporary file is the used to create a DeleteOnCloseFileInputStream that ensure that this temporary file is removed once the
fileInputStream is closed by Vaadin resource component.

Overrides:
onPostExecute in class AbstractCommandAction<ExportActionDefinition>
Throws:
Exception

buildParams

protected Map<String,Object> buildParams(javax.jcr.Item jcrItem)
Description copied from class: AbstractCommandAction
Builds a map of parameters which will be passed to the current command for execution. Called by AbstractCommandAction.onPreExecute(). Default implementation returns a map containing the parameters defined at CommandActionDefinition.getParams(). It also adds the following parameters with values retrieved from the passed node. Subclasses can override this method to add further parameters to the command execution. E.g.
 protected Map<String, Object> buildParams(final Node node) {
     Map<String, Object> params = super.buildParams(node);
     params.put(Context.ATTRIBUTE_RECURSIVE, getDefinition().isRecursive());
     return params;
 }
 

Overrides:
buildParams in class AbstractCommandAction<ExportActionDefinition>

openFileInBlankWindow

protected void openFileInBlankWindow(String fileName,
                                     String mimeType)


Copyright © 2013 Magnolia International Ltd.. All Rights Reserved.