info.magnolia.module.data.importer
Class SimpleImportHandler
java.lang.Object
info.magnolia.module.data.importer.ImportHandler
info.magnolia.module.data.importer.SimpleImportHandler
public abstract class SimpleImportHandler
- extends ImportHandler
Import handler implementation capable of importing content in xml format from external url including importin the zip file with content.
- Version:
- $Id$
Fields inherited from class info.magnolia.module.data.importer.ImportHandler |
activateImport, automatedExecution, backup, backupFile, deleteOldData, lockDuringImport, MILLI_2_HOUR, name, NODE_DATA_IMPORT_STATE, NODE_DATA_IMPORT_STATE_NEW, NODE_DATA_IMPORT_STATE_OLD, NODE_DATA_USED_IMPORTER_TARGET, repository, running, targets |
Methods inherited from class info.magnolia.module.data.importer.ImportHandler |
addTarget, backup, checkPreConditions, collectOldContent, destroy, doPostImport, execute, executeImport, getAutomatedExecution, getName, getParent, getRepository, getTargets, isActivateImport, isBackup, isDeleteOldData, isLockDuringImport, lock, restore, setActivateImport, setAutomatedExecution, setBackup, setDeleteOldData, setImportState, setLockDuringImport, setName, setRepository, setTargets, unlock |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SimpleImportHandler
public SimpleImportHandler()
doImport
protected Set<String> doImport(ImportTarget traget,
info.magnolia.cms.core.Content parent,
Set<String> uuids)
throws ImportException
- Imports.
- Specified by:
doImport
in class ImportHandler
- Parameters:
traget
- the import target to useparent
- the node to import belowuuids
- ordered set containing the uuids
- Returns:
- uuids of the imported nodes
- Throws:
ImportException
getURL
protected URL getURL(String url)
throws MalformedURLException
- Returns a URL for the given string.
- Parameters:
url
- The URL string representation
- Returns:
- a URL for the given string
- Throws:
MalformedURLException
getInputStream
protected InputStream getInputStream(SimpleImportTarget target)
throws ImportException
- Throws:
ImportException
getAdditonalFilesZip
protected ZipFile getAdditonalFilesZip(SimpleImportTarget target,
File tempFile)
throws IOException
- Streams the images and saves them into a temporary zip file. Returns the
file.
- Parameters:
target
- the import targettempFile
- the temporary file for saving the images
- Returns:
- a temporary file including the images
- Throws:
IOException
onDoImport
protected abstract void onDoImport(info.magnolia.cms.core.Content parent,
SimpleImportTarget target,
Set<String> createdNodesUuids,
ZipFile additionalFilesZip,
InputStream stream)
throws Exception
- Throws:
Exception
Copyright © 2012 Magnolia International Ltd.. All Rights Reserved.