public class EntityImportHelper extends Object
Modifier and Type | Method and Description |
---|---|
static void |
addValueToEntityField(de.xima.cmn.dao.interfaces.IEntity<Long> entity,
String fieldDescriptor,
Object value)
Adds/sets the given value to the field property of the entity
|
static boolean |
checkEntityNameExists(IEntityContext ec,
String name,
de.xima.cmn.dao.interfaces.IEntity<Long> entity,
de.xima.cmn.dao.interfaces.IEntity<Long> excludeEntity) |
static int |
compareByEntityClass(Object o1,
Object o2) |
static String |
getDisplayName(de.xima.cmn.dao.interfaces.IEntity<Long> entity)
Returns a String representation of the entity for displaying to the user
|
static de.xima.cmn.dao.interfaces.IEntity<Long> |
getEntity(UUID uuid,
Class<? extends de.xima.cmn.dao.interfaces.IEntity<Long>> entityClass,
List<IEntityImportConfig<?>> importConfigs)
Looks for entity with the given uuid and class in the list of import configs and returns it.
|
static Field |
getEntityField(Class<?> clazz,
String fieldName)
Gets the class field by name.
|
static <T extends de.xima.cmn.dao.interfaces.IEntity<Long>> |
getEntityName(UUID uuid,
Class<T> entityClass,
List<IEntityImportConfig<?>> importConfigs)
Looks for entity with the given uuid and class in the list of import configs and returns its name if there is any.
|
static ExportMetadata |
getExportMetaData(InputStream is) |
static <T extends INameProviding & de.xima.cmn.dao.interfaces.IEntity<Long>> |
getUniqueEntityName(IEntityContext ec,
T entity,
T excludeEntity)
Gets a unique entity name for the given entity
|
static String |
getUniqueProjectAlias(IEntityContext ec,
Projekt project,
boolean excludeSelf) |
static String |
getUniqueProjectTitle(IEntityContext ec,
Projekt project,
boolean excludeSelf)
Gets a unique project title for the given project
|
static List<BenutzerGruppe> |
getUserGroups(IEntityContext ec,
List<UUID> uuids,
Mandant client,
List<IEntityImportConfig<?>> importConfigs)
Gets a list of user groups in th given client with the given uuids
|
static boolean |
isEntityNameExists(IEntityContext ec,
String name,
de.xima.cmn.dao.interfaces.IEntity<Long> entity,
boolean excludeSelf)
Checks whether or not the name of the entity is used by any other entity in its context
|
static boolean |
isIdentical(de.xima.cmn.dao.interfaces.IEntity<Long> e1,
de.xima.cmn.dao.interfaces.IEntity<Long> e2)
Compares to entities and checks if they are "identical"
|
static boolean |
isProjectTitleExists(IEntityContext ec,
String title,
Projekt project,
boolean excludeSelf)
Checks whether or not the given title is used by any other project of this client
|
static void |
removeConfig(UUID uuid,
Class<? extends de.xima.cmn.dao.interfaces.IEntity<Long>> clazz,
List<IEntityImportConfig<?>> configs) |
static IEntityDependency |
removeDependency(IEntityImportConfig<?> config,
String fieldDescriptor)
Removes the first dependency from the given config with the given field descriptor
|
static void |
setEntityField(de.xima.cmn.dao.interfaces.IEntity<Long> entity,
String fieldDescriptor,
Object value)
Sets the field property of the entity with the given value
|
static void |
updateInboxRef(IInboxDependent proc,
Postfach inbox)
Sets the inbox reference in the given inbox dependent processing to the given inbox.
|
public static void addValueToEntityField(de.xima.cmn.dao.interfaces.IEntity<Long> entity, String fieldDescriptor, Object value) throws Exception
public static void setEntityField(de.xima.cmn.dao.interfaces.IEntity<Long> entity, String fieldDescriptor, Object value) throws Exception
public static final Field getEntityField(Class<?> clazz, String fieldName)
public static final String getUniqueProjectTitle(IEntityContext ec, Projekt project, boolean excludeSelf) throws LimitExceededException
ec
- IEntityContext
to be usedproject
- Projekt
to get unique title forexcludeSelf
- Boolean
whether to include this project's title (based on UUID)String
unique project titleLimitExceededException
public static final String getUniqueProjectAlias(IEntityContext ec, Projekt project, boolean excludeSelf) throws LimitExceededException
LimitExceededException
public static final <T extends INameProviding & de.xima.cmn.dao.interfaces.IEntity<Long>> String getUniqueEntityName(IEntityContext ec, T entity, T excludeEntity)
T
- type of entityec
- IEntityContext
to be usedentity
- excludeEntity
- String
unique entity namepublic static final boolean checkEntityNameExists(IEntityContext ec, String name, de.xima.cmn.dao.interfaces.IEntity<Long> entity, de.xima.cmn.dao.interfaces.IEntity<Long> excludeEntity)
public static final boolean isEntityNameExists(IEntityContext ec, String name, de.xima.cmn.dao.interfaces.IEntity<Long> entity, boolean excludeSelf)
ec
- IEntityContext
to be usedname
- String
to check forentity
- IEntity
to check forexcludeSelf
- Boolean
whether to include this entity's name (based on UUID if existing, otherwise
based on ID)true
if another entity has the given entity's name within its context. false
otherwisepublic static final boolean isProjectTitleExists(IEntityContext ec, String title, Projekt project, boolean excludeSelf)
ec
- IEntityContext
to be usedtitle
- String
to check forproject
- Projekt
to check forexcludeSelf
- Boolean
whether to include this project's title (based on UUID)true
if another entity has the given entity's name within its context. false
otherwisepublic static final ExportMetadata getExportMetaData(InputStream is) throws Exception
Exception
public static final String getDisplayName(de.xima.cmn.dao.interfaces.IEntity<Long> entity)
entity
- IEntity
to get a display name forString
name representing the entity for messagingpublic static final boolean isIdentical(de.xima.cmn.dao.interfaces.IEntity<Long> e1, de.xima.cmn.dao.interfaces.IEntity<Long> e2)
e1
- IEntity
e2
- IEntity
Boolean
public static final List<BenutzerGruppe> getUserGroups(IEntityContext ec, List<UUID> uuids, Mandant client, List<IEntityImportConfig<?>> importConfigs)
ec
- IEntityContext
to useuuids
- List
of UUID
s to look forclient
- Mandant
to look inimportConfigs
- List
of import configs used for getting the names of the user groupsList
of BenutzerGruppe
public static final IEntityDependency removeDependency(IEntityImportConfig<?> config, String fieldDescriptor)
config
- IEntityImportConfig
config to remove dependency fromfieldDescriptor
- String
describing the dependencyIEntityDependency
that has been removedpublic static final void removeConfig(UUID uuid, Class<? extends de.xima.cmn.dao.interfaces.IEntity<Long>> clazz, List<IEntityImportConfig<?>> configs)
public static final void updateInboxRef(IInboxDependent proc, Postfach inbox)
null
proc
- IInboxDependent
processing to set reference forinbox
- Postfach
to set reference topublic static final <T extends de.xima.cmn.dao.interfaces.IEntity<Long>> String getEntityName(UUID uuid, Class<T> entityClass, List<IEntityImportConfig<?>> importConfigs)
Copyright © 2021 XIMA MEDIA GmbH. All rights reserved.