|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object info.magnolia.module.data.importer.ImportHandler
public abstract class ImportHandler
This abstract class represents the basic configuration for an importer. It manages the single import targets and the optional automatic execution. Extend this class to provide your own importer.
Field Summary | |
---|---|
protected boolean |
activateImport
|
protected info.magnolia.module.scheduler.AutomatedExecutionConfig |
automatedExecution
|
protected boolean |
backup
|
protected File |
backupFile
|
protected boolean |
deleteOldData
|
protected boolean |
lockDuringImport
|
static int |
MILLI_2_HOUR
Deprecated. since 1.3.1 |
protected String |
name
|
static String |
NODE_DATA_IMPORT_STATE
|
static String |
NODE_DATA_IMPORT_STATE_NEW
|
static String |
NODE_DATA_IMPORT_STATE_OLD
|
static String |
NODE_DATA_USED_IMPORTER_TARGET
|
protected String |
repository
|
protected boolean |
running
|
protected List<ImportTarget> |
targets
|
Constructor Summary | |
---|---|
ImportHandler()
|
Method Summary | |
---|---|
void |
addTarget(ImportTarget target)
|
protected void |
backup(ImportTarget target)
|
protected void |
checkPreConditions()
|
protected Set<String> |
collectOldContent(ImportTarget target,
info.magnolia.cms.core.Content parent,
Set<String> uuids)
Searches for all content that have been imported (and tagged during import) with the target of given name. |
void |
destroy()
Destroys this importer and the optional timer. |
protected abstract Set<String> |
doImport(ImportTarget target,
info.magnolia.cms.core.Content parent,
Set<String> uuids)
Implement this method to do the import job. |
protected void |
doPostImport(ImportTarget target,
Collection<String> oldContent,
Collection<String> newContent)
|
void |
execute()
Public accessible method for manual import execution. |
protected void |
executeImport()
Executes all import targets for this importer. |
info.magnolia.module.scheduler.AutomatedExecutionConfig |
getAutomatedExecution()
|
String |
getName()
|
protected info.magnolia.cms.core.Content |
getParent(info.magnolia.cms.core.HierarchyManager hm,
ImportTarget target)
|
String |
getRepository()
|
List<ImportTarget> |
getTargets()
|
boolean |
isActivateImport()
|
boolean |
isBackup()
|
boolean |
isDeleteOldData()
|
boolean |
isLockDuringImport()
|
protected void |
lock(info.magnolia.cms.core.HierarchyManager hm,
ImportTarget target)
|
protected void |
restore(ImportTarget target)
|
void |
setActivateImport(boolean activateImport)
|
void |
setAutomatedExecution(info.magnolia.module.scheduler.AutomatedExecutionConfig automaticExecution)
|
void |
setBackup(boolean backup)
|
void |
setDeleteOldData(boolean deleteOldData)
|
protected void |
setImportState(Set<String> uuids,
String state,
ImportTarget target,
info.magnolia.cms.core.HierarchyManager hm)
Sets the given import state for the given imported content. |
void |
setLockDuringImport(boolean locking)
|
void |
setName(String name)
|
void |
setRepository(String repository)
|
void |
setTargets(List<ImportTarget> targets)
|
protected void |
unlock(info.magnolia.cms.core.HierarchyManager hm,
ImportTarget target)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
@Deprecated public static final int MILLI_2_HOUR
protected List<ImportTarget> targets
protected boolean running
protected String name
protected String repository
protected boolean activateImport
protected boolean deleteOldData
protected boolean lockDuringImport
protected info.magnolia.module.scheduler.AutomatedExecutionConfig automatedExecution
protected boolean backup
public static final String NODE_DATA_USED_IMPORTER_TARGET
public static final String NODE_DATA_IMPORT_STATE
public static final String NODE_DATA_IMPORT_STATE_OLD
public static final String NODE_DATA_IMPORT_STATE_NEW
protected File backupFile
Constructor Detail |
---|
public ImportHandler()
Method Detail |
---|
public String getName()
public void setName(String name)
public info.magnolia.module.scheduler.AutomatedExecutionConfig getAutomatedExecution()
public void setAutomatedExecution(info.magnolia.module.scheduler.AutomatedExecutionConfig automaticExecution)
public boolean isLockDuringImport()
public void setLockDuringImport(boolean locking)
public String getRepository()
public void setRepository(String repository)
public boolean isDeleteOldData()
public void setDeleteOldData(boolean deleteOldData)
public boolean isActivateImport()
public void setActivateImport(boolean activateImport)
public List<ImportTarget> getTargets()
public void setTargets(List<ImportTarget> targets)
public void addTarget(ImportTarget target)
protected void executeImport() throws ImportException
info.magnolia.cms.security.AccessDeniedException
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException
info.magnolia.cms.exchange.ExchangeException
ImportException
protected void unlock(info.magnolia.cms.core.HierarchyManager hm, ImportTarget target) throws ImportException
ImportException
protected void lock(info.magnolia.cms.core.HierarchyManager hm, ImportTarget target) throws ImportException
ImportException
protected info.magnolia.cms.core.Content getParent(info.magnolia.cms.core.HierarchyManager hm, ImportTarget target) throws ImportException
ImportException
protected void checkPreConditions() throws ImportException
ImportException
protected void restore(ImportTarget target) throws ImportException
ImportException
protected void backup(ImportTarget target) throws ImportException
ImportException
protected Set<String> collectOldContent(ImportTarget target, info.magnolia.cms.core.Content parent, Set<String> uuids)
target
- Target used to import the original contentparent
- Parent path into which the content was importeduuids
- Set into which the UUIDs of the content should be collected.
protected void doPostImport(ImportTarget target, Collection<String> oldContent, Collection<String> newContent) throws ImportException
ImportException
protected void setImportState(Set<String> uuids, String state, ImportTarget target, info.magnolia.cms.core.HierarchyManager hm) throws info.magnolia.cms.security.AccessDeniedException, javax.jcr.PathNotFoundException, javax.jcr.RepositoryException
uuids
- the uuids of the nodes we like to set the status onstate
- the state to settarget
- the target used for the import
info.magnolia.cms.security.AccessDeniedException
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException
protected abstract Set<String> doImport(ImportTarget target, info.magnolia.cms.core.Content parent, Set<String> uuids) throws ImportException
target
- the import target to useparent
- the node to import belowuuids
- ordered set containing the uuids
ImportException
public void destroy()
public void execute() throws ImportException
ImportException
public boolean isBackup()
public void setBackup(boolean backup)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |