info.magnolia.ui.framework.action
Class ExportAction
java.lang.Object
info.magnolia.ui.api.action.AbstractAction<D>
info.magnolia.ui.framework.action.AbstractMultiItemAction<D>
info.magnolia.ui.framework.action.AbstractCommandAction<ExportActionDefinition>
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
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ExportAction
@Inject
public ExportAction(ExportActionDefinition definition,
JcrItemAdapter item,
info.magnolia.commands.CommandsManager commandsManager,
UiContext uiContext,
info.magnolia.i18nsystem.SimpleTranslator i18n)
throws ActionExecutionException
- Throws:
ActionExecutionException
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.
- Context.ATTRIBUTE_REPOSITORY = current node's workspace name
- Context.ATTRIBUTE_UUID = current node's identifier
- Context.ATTRIBUTE_PATH = current node's path
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.