Class DataPackageAttachmentMetadata
java.lang.Object
eu.dzhw.fdz.metadatamanagement.common.domain.AbstractRdcDomainObject
eu.dzhw.fdz.metadatamanagement.common.domain.AbstractShadowableRdcDomainObject
eu.dzhw.fdz.metadatamanagement.datapackagemanagement.domain.DataPackageAttachmentMetadata
- All Implemented Interfaces:
Serializable
public class DataPackageAttachmentMetadata extends AbstractShadowableRdcDomainObject
Metadata which will be stored with each attachment of a
DataPackage
.- See Also:
- Serialized Form
-
Field Summary
Fields Modifier and Type Field Description private @Valid MethodReportCitationDetails
citationDetails
Additional details required to generate a citation hint for Method Reports.private @NotEmpty(message="data-package-management.error.data-package-attachment-metadata.project-id.not-empty") String
dataAcquisitionProjectId
The id of theDataAcquisitionProject
to which theDataPackage
of this attachment belongs.private @NotEmpty(message="data-package-management.error.data-package-attachment-metadata.data-package-id.not-empty") String
dataPackageId
The id of theDataPackage
to which this attachment belongs.private @NotNull(message="data-package-management.error.data-package-attachment-metadata.description.not-null") @I18nStringSize(max=512,message="data-package-management.error.data-package-attachment-metadata.description.i18n-string-size") I18nString
description
A description for this attachment.private @Size(max=512,message="attachment.error.doi.size") @Pattern(message="attachment.error.doi.pattern",regexp="^https:\\/\\/doi.org\\/([_A-Za-z0-9\u00e4\u00f6\u00fc\u00c4\u00d6\u00dc\u00df\\-\\/\\:.]{1,}$)") String
doi
The doi of the attachment.private @NotEmpty(message="data-package-management.error.data-package-attachment-metadata.filename.not-empty") @Pattern(message="data-package-management.error.data-package-attachment-metadata.filename.not-valid",regexp="^[_A-Za-z0-9\u00e4\u00f6\u00fc\u00c4\u00d6\u00dc\u00df\\-\\.]*$") String
fileName
The filename of the attachment.private String
id
The id of the attachment.private @NotNull(message="data-package-management.error.data-package-attachment-metadata.index-in-data-package.not-null") Integer
indexInDataPackage
The index in theDataPackage
of this attachment.private @NotNull(message="data-package-management.error.data-package-attachment-metadata.language.not-null") @ValidIsoLanguage(message="data-package-management.error.data-package-attachment-metadata.language.not-supported") String
language
The language of the attachments content.private String
masterId
The master id of the dataPackage attachment.private static long
serialVersionUID
private @NotEmpty(message="data-package-management.error.data-package-attachment-metadata.title.not-null") @Size(max=2048,message="data-package-management.error.data-package-attachment-metadata.title.string-size") String
title
An optional title of this attachment in the attachments' language.private @NotNull(message="data-package-management.error.data-package-attachment-metadata.type.not-null") @I18nStringSize(min=1,max=32,message="data-package-management.error.data-package-attachment-metadata.type.i18n-string-size") I18nString
type
The type of the attachment. -
Constructor Summary
Constructors Constructor Description DataPackageAttachmentMetadata()
-
Method Summary
Modifier and Type Method Description void
generateId()
Generate the id of this attachment from the dataPackageId and the fileName.String
getMasterId()
Returns the master id of the dataPackage attachment.protected void
setIdInternal(String id)
Set id on implementation ofAbstractShadowableRdcDomainObject
.protected void
setMasterIdInternal(String masterId)
Set masterId on implementations ofAbstractShadowableRdcDomainObject
.Methods inherited from class eu.dzhw.fdz.metadatamanagement.common.domain.AbstractShadowableRdcDomainObject
setId, setMasterId
Methods inherited from class eu.dzhw.fdz.metadatamanagement.common.domain.AbstractRdcDomainObject
getId
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
- Constant Field Values
-
id
The id of the attachment. Holds the complete path which can be used to download the file. -
masterId
The master id of the dataPackage attachment. -
dataPackageId
@NotEmpty(message="data-package-management.error.data-package-attachment-metadata.data-package-id.not-empty") private @NotEmpty(message="data-package-management.error.data-package-attachment-metadata.data-package-id.not-empty") String dataPackageIdThe id of theDataPackage
to which this attachment belongs. Must not be empty. -
dataAcquisitionProjectId
@NotEmpty(message="data-package-management.error.data-package-attachment-metadata.project-id.not-empty") private @NotEmpty(message="data-package-management.error.data-package-attachment-metadata.project-id.not-empty") String dataAcquisitionProjectIdThe id of theDataAcquisitionProject
to which theDataPackage
of this attachment belongs. Must not be empty. -
indexInDataPackage
@NotNull(message="data-package-management.error.data-package-attachment-metadata.index-in-data-package.not-null") private @NotNull(message="data-package-management.error.data-package-attachment-metadata.index-in-data-package.not-null") Integer indexInDataPackageThe index in theDataPackage
of this attachment. Used for sorting the attachments of thisDataPackage
. Must not be empty. -
title
@NotEmpty(message="data-package-management.error.data-package-attachment-metadata.title.not-null") @Size(max=2048, message="data-package-management.error.data-package-attachment-metadata.title.string-size") private @NotEmpty(message="data-package-management.error.data-package-attachment-metadata.title.not-null") @Size(max=2048,message="data-package-management.error.data-package-attachment-metadata.title.string-size") String titleAn optional title of this attachment in the attachments' language. Must not be empty and it must not contain more than 2048 characters. -
description
@NotNull(message="data-package-management.error.data-package-attachment-metadata.description.not-null") @I18nStringSize(max=512, message="data-package-management.error.data-package-attachment-metadata.description.i18n-string-size") @I18nStringNotEmpty(message="data-package-management.error.data-package-attachment-metadata.description.i18n-string-not-empty") private @NotNull(message="data-package-management.error.data-package-attachment-metadata.description.not-null") @I18nStringSize(max=512,message="data-package-management.error.data-package-attachment-metadata.description.i18n-string-size") I18nString descriptionA description for this attachment. It must be specified in at least one language and it must not contain more than 512 characters. -
citationDetails
Additional details required to generate a citation hint for Method Reports. Can be null for other attachment types than method reports. Can also be null for legacy method reports. -
type
@NotNull(message="data-package-management.error.data-package-attachment-metadata.type.not-null") @I18nStringSize(min=1, max=32, message="data-package-management.error.data-package-attachment-metadata.type.i18n-string-size") @ValidDataPackageAttachmentType(message="data-package-management.error.data-package-attachment-metadata.type.valid-type") private @NotNull(message="data-package-management.error.data-package-attachment-metadata.type.not-null") @I18nStringSize(min=1,max=32,message="data-package-management.error.data-package-attachment-metadata.type.i18n-string-size") I18nString typeThe type of the attachment. Must be one ofDataPackageAttachmentTypes
and must not be empty. -
fileName
@NotEmpty(message="data-package-management.error.data-package-attachment-metadata.filename.not-empty") @Pattern(message="data-package-management.error.data-package-attachment-metadata.filename.not-valid", regexp="^[_A-Za-z0-9\u00e4\u00f6\u00fc\u00c4\u00d6\u00dc\u00df\\-\\.]*$") private @NotEmpty(message="data-package-management.error.data-package-attachment-metadata.filename.not-empty") @Pattern(message="data-package-management.error.data-package-attachment-metadata.filename.not-valid",regexp="^[_A-Za-z0-9\u00e4\u00f6\u00fc\u00c4\u00d6\u00dc\u00df\\-\\.]*$") String fileNameThe filename of the attachment. Must not be empty and must contain only (german) alphanumeric characters and "_" and "-" and ".". -
language
@NotNull(message="data-package-management.error.data-package-attachment-metadata.language.not-null") @ValidIsoLanguage(message="data-package-management.error.data-package-attachment-metadata.language.not-supported") private @NotNull(message="data-package-management.error.data-package-attachment-metadata.language.not-null") @ValidIsoLanguage(message="data-package-management.error.data-package-attachment-metadata.language.not-supported") String languageThe language of the attachments content. Must not be empty and must be specified as ISO 639 language code. -
doi
@Size(max=512, message="attachment.error.doi.size") @Pattern(message="attachment.error.doi.pattern", regexp="^https:\\/\\/doi.org\\/([_A-Za-z0-9\u00e4\u00f6\u00fc\u00c4\u00d6\u00dc\u00df\\-\\/\\:.]{1,}$)") private @Size(max=512,message="attachment.error.doi.size") @Pattern(message="attachment.error.doi.pattern",regexp="^https:\\/\\/doi.org\\/([_A-Za-z0-9\u00e4\u00f6\u00fc\u00c4\u00d6\u00dc\u00df\\-\\/\\:.]{1,}$)") String doiThe doi of the attachment. Must not contain more than 512 characters. Must match the pattern of a doi-url https://doi.org/{id}
-
-
Constructor Details
-
DataPackageAttachmentMetadata
public DataPackageAttachmentMetadata()
-
-
Method Details
-
generateId
public void generateId()Generate the id of this attachment from the dataPackageId and the fileName. -
setMasterIdInternal
Description copied from class:AbstractShadowableRdcDomainObject
Set masterId on implementations ofAbstractShadowableRdcDomainObject
.- Specified by:
setMasterIdInternal
in classAbstractShadowableRdcDomainObject
- Parameters:
masterId
- Master Id
-
getMasterId
Returns the master id of the dataPackage attachment.- Specified by:
getMasterId
in classAbstractShadowableRdcDomainObject
- Returns:
- Master Id
-
setIdInternal
Description copied from class:AbstractShadowableRdcDomainObject
Set id on implementation ofAbstractShadowableRdcDomainObject
.- Specified by:
setIdInternal
in classAbstractShadowableRdcDomainObject
- Parameters:
id
- Id
-