Class ClientFormTheme
java.lang.Object
de.xima.cmn.dao.model.AEntity<Long>
de.xima.fc.entities.AbstractEntity
de.xima.fc.entities.AbstractLockableEntity
de.xima.fc.entities.ALockableEntity
de.xima.fc.entities.ClientFormTheme
- All Implemented Interfaces:
de.xima.cmn.dao.interfaces.IEntity<Long>, de.xima.cmn.dao.interfaces.ILockableEntity<Long>, ICustomAttributeProviding, ICustomAttributesEntity, IDescriptionProviding, IFileListProviding<ClientFormThemeFile, ClientFormThemeFileData>, ILockingVersionProviding, IMandantDependent, INameHolding, INameProviding, ITransferable, ITransferableEntity, ITransferableLockableEntity, IUUIDEntity, Serializable, Comparable<de.xima.cmn.dao.interfaces.IEntity<Long>>
@Entity
public class ClientFormTheme
extends ALockableEntity
implements IMandantDependent, INameHolding, IDescriptionProviding, IUUIDEntity, ICustomAttributesEntity, IFileListProviding<ClientFormThemeFile, ClientFormThemeFileData>
Entity model for a form theme. A form theme is a collection of text and binary resources that are used to style a
form, such as JavaScript files, CSS flies, fonts, and images. Users can select a form theme in the form designer;
each form can have a different form theme. The form theme affects both the main web form and related pages such as
HTML templates.
- Since:
- 8.3.0
- Author:
- XIMA MEDIA GmbH
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringJPA attribute name for thegetClient()field.static final StringJPA attribute name for thegetFiles()field.static final StringDeprecated.static final StringThe prefix for the keys of thecustom attributesthat stores theparent form theme.Fields inherited from class AbstractLockableEntity
COL_LOCKINGVERSION, lockingVersionFields inherited from class AbstractEntity
COL_ID, idFields inherited from interface ICustomAttributesEntity
ATTR_CUSTOM_ATTRIBUTES, COL_CUSTOM_ATTRIBUTE_NAME, COL_CUSTOM_ATTRIBUTE_VALUEFields inherited from interface IDescriptionProviding
ATTR_BESCHREIBUNG, ATTR_DESCRIPTION, COL_DESCRIPTIONFields inherited from interface de.xima.cmn.dao.interfaces.IEntity
ATTR_IDFields inherited from interface de.xima.cmn.dao.interfaces.ILockableEntity
ATTR_LOCKINGVERSIONFields inherited from interface IMandantDependent
COL_CLIENT_IDFields inherited from interface INameProviding
ATTR_NAME, COL_NAMEFields inherited from interface ITransferableEntity
IMPORT_ID, INVALID_IDFields inherited from interface IUUIDEntity
ATTR_UUID, COL_UUID, INVALID_UUID, INVALID_UUID_OBJECT, NULL_SAFE_UUID_TYPE, NULLABLE_UUID_TYPE, TYPE_NAME_UUID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddOrReplaceFile(String resourceContext, String fileName, byte[] data, IUser user) Adds a file with the given context and file name to this theme.Creates a copy of this client form theme, with all basic field (i.e. without referenced entities) copied.Deprecated.UsegetDescription()instead.Gets the client scope to which this form theme belongs.Gets the custom attributes that may be used to store additional information.Gets the internal description of this form theme.Gets a file with the given file name from the given context, if such a file exists.byte[]getFileData(String resourceContext, String fileName) Gets the binary content of the given file.getFiles()Gets the list of files that are used by this form theme.Creates a new, modifiable map that represents a snapshot of the currentfiles.Creates a new, modifiable map that represents a snapshot of the currentfiles.getId()Gets the database ID of this form theme.Deprecated.UsegetClient()instead.getName()The name of this form theme.Gets the parent theme from which this theme inherits.getUUID()Gets the UUID of this entity as a string.Gets the UUID of this entity.booleanChecks whether a file with the given file name from the given context exists.voidremoveFile(String resourceContext, String fileName) Remove a file with the given file name from the given context, if such a file exists.voidThe client scope to which this form theme belongs.voidsetCustomAttributes(Map<String, String> customAttributes) Sets the custom attributes that may be used to store additional information.voidsetDescription(String description) Sets the internal description of this form theme.voidsetFiles(List<ClientFormThemeFile> files) Sets the list of files that are used by this form theme.voidSets the database ID of this form theme.voidsetMandant(Mandant client) Deprecated.UsesetClient(Mandant)instead.voidThe name of this form theme.voidsetParentFormTheme(FormThemeReference parentFormTheme) Sets the parent theme from which this theme inherits.voidSets the UUID of this entity.voidsetUUIDObject(UUID uuid) Sets the UUID of this entity.Methods inherited from class AbstractLockableEntity
entityHasChanged, getLockingVersion, setLockingVersion, toStringMethods inherited from class AbstractEntity
asIntValue, isPersisted, setIdMethods inherited from class de.xima.cmn.dao.model.AEntity
compareTo, equals, getDBTableName, hashCodeMethods inherited from interface Comparable
compareToMethods inherited from interface ICustomAttributeProviding
getCustomAttribute, getCustomAttributeAs, getCustomAttributeAs, getCustomAttributeBoolean, getCustomAttributeDouble, getCustomAttributeDouble, getCustomAttributeEnum, getCustomAttributeEnum, getCustomAttributeInt, getCustomAttributeInt, getCustomAttributeJsonArray, getCustomAttributeJsonObject, getCustomAttributeLong, getCustomAttributeLong, getCustomAttributeString, getCustomAttributeString, getCustomAttributeUuidMethods inherited from interface ICustomAttributesEntity
removeCustomAttribute, setCustomAttribute, setCustomAttributeBoolean, setCustomAttributeDouble, setCustomAttributeEnum, setCustomAttributeInt, setCustomAttributeJSONArray, setCustomAttributeJSONObject, setCustomAttributeLong, setCustomAttributeString, setCustomAttributeUuidMethods inherited from interface de.xima.cmn.dao.interfaces.IEntity
isPersistedMethods inherited from interface IFileListProviding
addFile, addFile, getFile, removeFile, setFile
-
Field Details
-
ATTR_CLIENT
-
ATTR_FILES
-
ATTR_MANDANT
-
CUSTOM_ATTR_PARENT_FORM_THEME_PREFIX
The prefix for the keys of thecustom attributesthat stores theparent form theme. SeeFormThemeReference#toAttributeMapandofAttributeMap.- See Also:
-
-
Constructor Details
-
ClientFormTheme
public ClientFormTheme()
-
-
Method Details
-
addOrReplaceFile
public ClientFormThemeFile addOrReplaceFile(String resourceContext, String fileName, byte[] data, IUser user) Adds a file with the given context and file name to this theme. When a file with the context and file name exists already, overrides the data of that file.- Parameters:
resourceContext- The resource context the file is used in, seeEFormThemeResourceContextfor well-known contexts. See alsogetResourceContext().fileName- The name of the file. The file name must be unique among all files with the same context.data- The data of the file.user- The user who adds the file. May be null for the anonymous user.- Returns:
- The file that was added or replaced.
-
cloneBasics
Creates a copy of this client form theme, with all basic field (i.e. without referenced entities) copied.- Returns:
- A copy of this client form theme.
-
getBeschreibung
Deprecated.UsegetDescription()instead.Gets the internal description of this form theme. The description is only visible in the backend when editing the theme.- Specified by:
getBeschreibungin interfaceIDescriptionProviding- Returns:
- The internal description of this form theme.
-
getClient
Gets the client scope to which this form theme belongs.- Returns:
- client This theme's client scope.
-
setClient
The client scope to which this form theme belongs.- Parameters:
client- This theme's client scope.
-
getCustomAttributes
Gets the custom attributes that may be used to store additional information.- Specified by:
getCustomAttributesin interfaceICustomAttributeProviding- Returns:
- The custom attributes.
-
setCustomAttributes
Sets the custom attributes that may be used to store additional information.- Specified by:
setCustomAttributesin interfaceICustomAttributesEntity- Parameters:
customAttributes- The custom attributes to set.
-
getDescription
Gets the internal description of this form theme. The description is only visible in the backend when editing the theme.- Specified by:
getDescriptionin interfaceIDescriptionProviding- Returns:
- The internal description of this form theme.
-
setDescription
Sets the internal description of this form theme. The description is only visible in the backend when editing the theme.- Parameters:
description- The internal description of this form theme.
-
getFile
Gets a file with the given file name from the given context, if such a file exists.- Parameters:
resourceContext- The resource context the file is used in, seeEFormThemeResourceContextfor well-known contexts. See alsogetResourceContext().fileName- The name of the file. The file name must be unique among all files with the same context.- Returns:
- The file with the given context and file name, or null if no such file exists.
-
getFileData
Gets the binary content of the given file. When the file does not exist, returns null.- Parameters:
resourceContext- The resource context the file is used in, seeEFormThemeResourceContextfor well-known contexts. See alsogetResourceContext().fileName- The name of the file. The file name must be unique among all files with the same context.- Returns:
- The binary content of the file, or null if the file does not exist.
-
getFiles
Gets the list of files that are used by this form theme. This includes plain text resources such as JavaScript and CSS files, as well as binary resources such as images and fonts. Unless the order is determined in some other way, resources such as CSS and JavaScript files are inserted in the order of their file name. The file name must be unique among all files in the same form theme.- Specified by:
getFilesin interfaceIFileListProviding<ClientFormThemeFile, ClientFormThemeFileData>- Returns:
- The list of files used by this form theme.
-
setFiles
Sets the list of files that are used by this form theme. This includes plain text resources such as JavaScript and CSS files, as well as binary resources such as images and fonts. Unless the order is determined in some other way, resources such as CSS and JavaScript files are inserted in the order of their file name. The file name must be unique among all files in the same form theme.- Specified by:
setFilesin interfaceIFileListProviding<ClientFormThemeFile, ClientFormThemeFileData>- Parameters:
files- The list of files used by this form theme.
-
getFilesMapFlat
Creates a new, modifiable map that represents a snapshot of the currentfiles. The map key is theIDof theClientFormThemeFile, the map value thefileitself.- Returns:
- A new map with all files.
-
getFilesMapNested
Creates a new, modifiable map that represents a snapshot of the currentfiles. The map key is theresource context, the map value another map with thefile pathas the key and thefileitself as the value.- Returns:
- A new map with all files.
-
getId
-
setId
Sets the database ID of this form theme. The database ID is unique within the system, across all clients. Note: Since the ID is generated by the database, this method should normally not be used.- Specified by:
setIdin interfacede.xima.cmn.dao.interfaces.IEntity<Long>- Overrides:
setIdin classAbstractEntity- Parameters:
id- The database ID of this form theme.
-
getMandant
Deprecated.UsegetClient()instead.Gets the client scope to which this form theme belongs.- Specified by:
getMandantin interfaceIMandantDependent- Returns:
- client This theme's client scope.
-
setMandant
Deprecated.UsesetClient(Mandant)instead.The client scope to which this form theme belongs.- Specified by:
setMandantin interfaceIMandantDependent- Parameters:
client- This theme's client scope.
-
getName
The name of this form theme. The name is displayed in the form designer and can be edited in the backend.- Specified by:
getNamein interfaceINameProviding- Returns:
- The new name of this form theme.
-
setName
The name of this form theme. The name is displayed in the form designer and can be edited in the backend.- Specified by:
setNamein interfaceINameHolding- Parameters:
name- The new name of this form theme.
-
getParentFormTheme
Gets the parent theme from which this theme inherits. If this theme has no parent, it is a top-level theme. Otherwise, the parent theme's CSS and JavaScript files are included first, before this theme. A parent may itself have a parent.- Returns:
- The parent theme from which this theme inherits. May be null.
-
setParentFormTheme
Sets the parent theme from which this theme inherits. If this theme has no parent, it is a top-level theme. Otherwise, the parent theme's CSS and JavaScript files are included first, before this theme. A parent may itself have a parent.- Parameters:
parentFormTheme- The parent theme from which this theme inherits. May be null.
-
getUUID
Gets the UUID of this entity as a string. The UUID is unique amongst all form themes belonging to the same client.- Specified by:
getUUIDin interfaceIUUIDEntity- Returns:
- uuid The UUID of the entity.
-
setUUID
Sets the UUID of this entity. The UUID is unique amongst all form themes belonging to the same client.- Specified by:
setUUIDin interfaceIUUIDEntity- Parameters:
uuid- The UUID of the entity. Must be a valid UUID-4 string.- Throws:
IllegalArgumentException- If the UUID is non-empty and not a valid UUID-4 string.
-
getUUIDObject
Gets the UUID of this entity. The UUID is unique amongst all form themes belonging to the same client.- Specified by:
getUUIDObjectin interfaceIUUIDEntity- Returns:
- uuid The UUID of the entity.
-
setUUIDObject
Sets the UUID of this entity. The UUID is unique amongst all form themes belonging to the same client.- Parameters:
uuid- The UUID of the entity. Must be a valid UUID-4 string.
-
hasFile
Checks whether a file with the given file name from the given context exists.- Parameters:
resourceContext- The resource context the file is used in, seeEFormThemeResourceContextfor well-known contexts. See alsogetResourceContext().fileName- The name of the file. The file name must be unique among all files with the same context.- Returns:
- True if a file with the given file name from the given context exists, false otherwise.
-
removeFile
Remove a file with the given file name from the given context, if such a file exists. Does nothing if no such file exists.- Parameters:
resourceContext- The resource context the file is used in, seeEFormThemeResourceContextfor well-known contexts. See alsogetResourceContext().fileName- The name of the file. The file name must be unique among all files with the same context.
-
ATTR_CLIENTinstead.