Package de.xima.fc.importer.interfaces
Interface IEntityImportConfig<T extends de.xima.cmn.dao.interfaces.IEntity<Long>>
- 
- Type Parameters:
 T- Type of entity to import.
- All Superinterfaces:
 Comparable<IEntityImportConfig<?>>,Serializable
- All Known Implementing Classes:
 ActionImportConfig,AEntityImportConfig,AppointmentTemplateImportConfig,ClientCounterImportConfig,ClientFormThemeImportConfig,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
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default intcompareTo(IEntityImportConfig<?> o)List<DependencyDescriptor>finalize(IEntityContext ec, String fcVersion, String exportVersion)Finish the import.List<IEntityImportConfig<?>>getAllChildrenFlat()List<IEntityImportConfig<?>>getChildren()EEntityConflictResolveActiongetConflictResolveAction()default List<IEntityDependency>getDependencies()Deprecated.UsegetUnresolvedDependencies()instead.TgetEntity()Class<?>getEntityClass()de.xima.cmn.dao.interfaces.IEntity<Long>getEntityToOverride()Deprecated.StringgetImportJson()Deprecated.ObjectgetOriginal()Gets the reference to the original object referenced in the import file.LonggetOriginalExportId()LonggetOriginalID()StringgetOriginalName()UUIDgetOriginalUUID()TgetPersisted()Map<de.xima.cmn.dao.interfaces.IEntity<Long>,List<IEntityDependency>>getUnresolvedDependencies()booleanisEntityExists()booleanisImported()default booleanisRelevantForImport()Whether importing this entity is actually relevant.ObjectloadAlternative(IEntityContext ec)Loads the alternative that should be used instead of the entity represented by this import config.voidresolveDependencies(IEntityContext ec)Deprecated.voidsetAlternative(Object alternative)Sets a reference to the alternative that should be used instead of the entity represented by this import config.default voidsetAlternativeId(Long alternativeId)Deprecated.UsesetAlternative(Object)instead.voidsetConflictResolveAction(EEntityConflictResolveAction conflictResolveAction)voidsetEntity(T entity)voidsetEntityToOverride(de.xima.cmn.dao.interfaces.IEntity<Long> entityToOverride)Deprecated.voidsetImported(boolean imported)Deprecated.voidsetOriginal(Object original)voidsetPersisted(T entity)voidstage(IEntityContext ec)Stages the import for execution based on the given configurationvoidupdatePersisted(IEntityContext ec)Updates the persisted entity if existing based on the entity represented by this config 
 - 
 
- 
- 
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 config entity but also dependencies of its children, e.g.: a ProjectImportConfig might have unresolved dependencies for one of its WorkflowStates.
 
 
- 
getConflictResolveAction
EEntityConflictResolveAction getConflictResolveAction()
- Returns:
 EEntityConflictResolveActionspecifying what to do if the entity already exists
 
- 
setConflictResolveAction
void setConflictResolveAction(EEntityConflictResolveAction conflictResolveAction)
- Parameters:
 conflictResolveAction-EEntityConflictResolveActionspecifying what to do if the entity already exists
 
- 
isEntityExists
boolean isEntityExists()
- Returns:
 trueif the given entity already exists (based on UUID and its context)
 
- 
isImported
boolean isImported()
- Returns:
 - Whether 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 
nullif the entity is noIUUIDEntity 
 
- 
getOriginalExportId
Long getOriginalExportId()
- Returns:
 - The original ID of the entity from the export file. Note that 
getOriginalID()may benullwhen 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)
 
 
- 
getOriginal
Object getOriginal()
Gets the reference to the original object referenced in the import file. The exact type of the object depends on the type of import config. For example, for client form theme import configs, this might be theFormThemeReferenceof a plugin form theme.- Returns:
 - original A reference to the original object referenced in the import file.
 
 
- 
setOriginal
void setOriginal(Object original)
- Parameters:
 original- A reference to the original object referenced in the import file.
 
- 
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-IEntityContextto be used for updating the persisted entity
 
- 
setAlternative
void setAlternative(Object alternative)
Sets a reference to the alternative that should be used instead of the entity represented by this import config. The type of object depends on the entity type of this import config.loadAlternative(IEntityContext)must be able to use this object to load the alternative. Often, this will be aLong, representing theIDof an existing entity to use instead.- Parameters:
 alternative- An object referencing the alternative to use.
 
- 
loadAlternative
Object loadAlternative(IEntityContext ec)
Loads the alternative that should be used instead of the entity represented by this import config. The alternative must have been set viasetAlternative(Object)before. If it was not set, this method should return null.- Parameters:
 ec- The entity context to use for accessing the database.- Returns:
 - Alternative that should be used instead. Often, this will be an 
IEntitywith the same type as the entity represented by this import config. 
 
- 
stage
void stage(IEntityContext ec) throws Exception
Stages the import for execution based on the given configuration- Parameters:
 ec-IEntityContextto 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-IEntityContextto 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:
 ListofDependencyDescriptors of missing dependencies- Throws:
 Exception- When the entity import could not be finalized.
 
- 
isRelevantForImport
default boolean isRelevantForImport()
Whether importing this entity is actually relevant. When false, this entity should not be suggested to the user and should be skipped. Note that entities may become relevant depending on whether other entities are imported or not.- Returns:
 - Whether the entity wrapped by this import config is relevant for the import.
 
 
- 
compareTo
default int compareTo(IEntityImportConfig<?> o)
- Specified by:
 compareToin interfaceComparable<T extends de.xima.cmn.dao.interfaces.IEntity<Long>>
 
- 
getDependencies
@Deprecated default List<IEntityDependency> getDependencies()
Deprecated.UsegetUnresolvedDependencies()instead.- Returns:
 Listof all the dependencies to this entity
 
- 
resolveDependencies
@Deprecated void resolveDependencies(IEntityContext ec)
Deprecated.Resolves the dependencies of this entity- Parameters:
 ec-IEntityContextto be used
 
- 
getEntityToOverride
@Deprecated de.xima.cmn.dao.interfaces.IEntity<Long> getEntityToOverride()
Deprecated.- Returns:
 IEntitythat should be overridden instead of the persisted
 
- 
setEntityToOverride
@Deprecated void setEntityToOverride(de.xima.cmn.dao.interfaces.IEntity<Long> entityToOverride)
Deprecated.- Parameters:
 entityToOverride-IEntitythat should be overridden instead of the persisted
 
- 
setImported
@Deprecated void setImported(boolean imported)
Deprecated.Sets whether the entity has been imported.- Parameters:
 imported- Whether the entity has been imported.
 
- 
getImportJson
@Deprecated String getImportJson()
Deprecated.- Returns:
 - the original JSON String of the import entity
 
 
- 
setAlternativeId
@Deprecated default void setAlternativeId(Long alternativeId)
Deprecated.UsesetAlternative(Object)instead.- Parameters:
 alternativeId- of an existing entity of typeTthat should be used instead
 
 - 
 
 -