Package de.xima.fc.importer.interfaces
Interface IEntityImportConfig<T extends de.xima.cmn.dao.interfaces.IEntity<Long>>
-
- All Superinterfaces:
Comparable<IEntityImportConfig<?>>
,Serializable
- All Known Implementing Classes:
ActionImportConfig
,AEntityImportConfig
,AppointmentTemplateImportConfig
,ClientCounterImportConfig
,ClientResourceImportConfig
,DataSourceImportConfig
,EntityImportConfig
,FormVersionImportConfig
,InboxImportConfig
,ProjectDoiDataImportConfig
,ProjectIdentityCheckDataImportConfig
,ProjectImportConfig
,ProjectInviteDataImportConfig
,ProjectPortalDataImportConfig
,ProjectResourceImportConfig
,StateImportConfig
,TemplateImportConfig
,UserGroupImportConfig
public interface IEntityImportConfig<T extends de.xima.cmn.dao.interfaces.IEntity<Long>> extends Serializable, Comparable<IEntityImportConfig<?>>
Interface for entity import configurations- Author:
- XIMA MEDIA GmbH
-
-
Method Summary
-
-
-
Method Detail
-
getEntity
T getEntity()
- Returns:
- The entity that should be imported
-
setEntity
void setEntity(T entity)
- Parameters:
entity
- The entity that should be imported
-
getPersisted
T getPersisted()
- Returns:
- The persisted entity that may be overridden
-
setPersisted
void setPersisted(T entity)
- Parameters:
entity
- The persisted entity that may be overridden
-
getEntityClass
Class<?> getEntityClass()
- Returns:
- the class of the entity
-
getUnresolvedDependencies
Map<de.xima.cmn.dao.interfaces.IEntity<Long>,List<IEntityDependency>> getUnresolvedDependencies()
- Returns:
- a map of all the entities of this import config that have unresolved dependencies. This includes not only entity dependencies of this import configs entity but also dependencies of its children, e.g.: a ProjectImportConfig might have unresolved dependencies for one of its WorkflowStates.
-
getConflictResolveAction
EEntityConflictResolveAction getConflictResolveAction()
- Returns:
EEntityConflictResolveAction
specifying what to do if the entity already exists
-
setConflictResolveAction
void setConflictResolveAction(EEntityConflictResolveAction conflictResolveAction)
- Parameters:
conflictResolveAction
-EEntityConflictResolveAction
specifying what to do if the entity already exists
-
isEntityExists
boolean isEntityExists()
- Returns:
true
if the given entity already exists (based on UUID and its context)
-
isImported
boolean isImported()
- Returns:
- whether or not the entity has been imported yet
-
getOriginalID
Long getOriginalID()
- Returns:
- original ID of the entity
-
getOriginalUUID
UUID getOriginalUUID()
- Returns:
- original UUID of the entity or
null
if the entity is noIUUIDEntity
-
getOriginalExportId
Long getOriginalExportId()
- Returns:
- The original ID of the entity from the export file. Note that
getOriginalID()
may benull
when the IDs are not preserved, this will always be set to the original ID from the export file.
-
getOriginalName
String getOriginalName()
- Returns:
- original name of the entity before import (and possible name change)
-
getChildren
List<IEntityImportConfig<?>> getChildren()
- Returns:
- all child importConfigs
-
getAllChildrenFlat
List<IEntityImportConfig<?>> getAllChildrenFlat()
- Returns:
- all child importConfigs. Including the children of children
-
updatePersisted
void updatePersisted(IEntityContext ec)
Updates the persisted entity if existing based on the entity represented by this config- Parameters:
ec
-IEntityContext
to be used for updating the persisted entity
-
setAlternativeId
void setAlternativeId(Long alternativeId)
- Parameters:
alternativeId
- of an existing entity of typeT
that should be used instead
-
loadAlternative
T loadAlternative(IEntityContext ec)
- Parameters:
ec
-IEntityContext
to use- Returns:
- Entity that should be used instead
-
stage
void stage(IEntityContext ec) throws Exception
Stages the import for execution based on the given configuration- Parameters:
ec
-IEntityContext
to be used- Throws:
Exception
- When the entity could not be staged.
-
finalize
List<DependencyDescriptor> finalize(IEntityContext ec, String fcVersion, String exportVersion) throws Exception
Finish the import. Should be called after every import config has been staged for import and deprecated fields have been handled.- Parameters:
ec
-IEntityContext
to be usedfcVersion
- The current formcycle version where the entity is imported.exportVersion
- The formcycle version that was used to create the export file with the entity.- Returns:
List
ofDependencyDescriptor
s of missing dependencies- Throws:
Exception
- When the entity import could not be finalized.
-
compareTo
default int compareTo(IEntityImportConfig<?> o)
- Specified by:
compareTo
in interfaceComparable<T extends de.xima.cmn.dao.interfaces.IEntity<Long>>
-
getDependencies
@Deprecated default List<IEntityDependency> getDependencies()
Deprecated.UsegetUnresolvedDependencies()
instead.- Returns:
List
of all the dependencies to this entity
-
resolveDependencies
@Deprecated void resolveDependencies(IEntityContext ec)
Deprecated.Resolves the dependencies of this entity- Parameters:
ec
-IEntityContext
to be used
-
getEntityToOverride
@Deprecated de.xima.cmn.dao.interfaces.IEntity<Long> getEntityToOverride()
Deprecated.- Returns:
IEntity
that should be overridden instead of the persisted
-
setEntityToOverride
@Deprecated void setEntityToOverride(de.xima.cmn.dao.interfaces.IEntity<Long> entityToOverride)
Deprecated.- Parameters:
entityToOverride
-IEntity
that should be overridden instead of the persisted
-
setImported
@Deprecated void setImported(boolean imported)
Deprecated.Set totrue
if the entity has been imported
-
getImportJson
@Deprecated String getImportJson()
Deprecated.- Returns:
- the original JSON String of the import entity
-
-