public class ExportServiceImpl extends java.lang.Object implements ExportService
Constructor and Description |
---|
ExportServiceImpl(ExImportHelperService eiHelper,
ExportSupervisorFactory exportSupervisorFactory,
HookHandlerService hookHandler) |
Modifier and Type | Method and Description |
---|---|
java.util.Optional<ExportConfig> |
configureExport(AbstractNode<?> node,
boolean includeVariants,
boolean flatten)
Gets the
ExportConfig for the given node. |
java.lang.String |
export(ExportConfig config)
Exports the given
ExportConfig as XML and returns its content as a
String |
void |
exportAsStream(ExportConfig config,
java.io.OutputStream os)
Exports the given
ExportConfig as XML and writes the result to the
supplied output stream. |
java.lang.String |
exportIndent(ExportConfig config)
Exports the given
ExportConfig as XML and returns its content as a
String properly indendent. |
Exporter |
getExporterFor(java.lang.Class<? extends Exporter> exporterType)
Returns the
Exporter for the given exporter type |
Exporter |
getExporterFor(java.lang.Object object)
Returns the correct exporter for the given object or null if none was found.
|
java.util.Collection<java.lang.String> |
getExporterIds(java.util.Collection<java.lang.Class<? extends Exporter>> exporterTypes)
Returns a
Collection of String s holding the IDs of the given
exporters |
public ExportServiceImpl(ExImportHelperService eiHelper, ExportSupervisorFactory exportSupervisorFactory, HookHandlerService hookHandler)
public java.lang.String export(ExportConfig config)
ExportService
ExportConfig
as XML and returns its content as a
String
export
in interface ExportService
config
- The ExportConfig
String
containing the XML data of the exported
ExportConfig
public java.lang.String exportIndent(ExportConfig config)
ExportService
ExportConfig
as XML and returns its content as a
String
properly indendent.exportIndent
in interface ExportService
config
- The ExportConfig
String
containing the XML data of the exported
ExportConfig
OutputKeys.INDENT
public void exportAsStream(ExportConfig config, java.io.OutputStream os) throws javax.xml.stream.XMLStreamException
ExportService
ExportConfig
as XML and writes the result to the
supplied output stream.exportAsStream
in interface ExportService
config
- The configurationos
- The output streamjavax.xml.stream.XMLStreamException
public java.util.Collection<java.lang.String> getExporterIds(java.util.Collection<java.lang.Class<? extends Exporter>> exporterTypes)
ExportService
Collection
of String
s holding the IDs of the given
exportersgetExporterIds
in interface ExportService
exporterTypes
- A Collection
of Class
es holding the
exportersCollection
containing the exporters IDspublic Exporter getExporterFor(java.lang.Class<? extends Exporter> exporterType)
ExportService
Exporter
for the given exporter typegetExporterFor
in interface ExportService
exporterType
- The Class
of the exporter typeExporter
for the given typepublic Exporter getExporterFor(java.lang.Object object)
ExportService
getExporterFor
in interface ExportService
object
- The object to be exportedpublic java.util.Optional<ExportConfig> configureExport(AbstractNode<?> node, boolean includeVariants, boolean flatten)
ExportService
ExportConfig
for the given node. If the given node is a
report, the includeVariants parameter is taken into account. If not, it is
ignored.configureExport
in interface ExportService
node
- the node to exportincludeVariants
- if the node to export is a report and includeVariants
is true, the report variants are exported as well.flatten
- if the tree should be flattened, i.e. all folders
should be stripped away.