Class CclicenseValidator
java.lang.Object
org.dspace.app.rest.submit.step.validation.AbstractValidation
org.dspace.app.rest.submit.step.validation.CclicenseValidator
- All Implemented Interfaces:
Validation
This class validates that the Creative Commons License has been granted for the
in-progress submission.
- Author:
- Mattia Vianelli (Mattia.Vianelli@4science.com)
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCclicenseValidator(ConfigurationService configurationService) Construct a Creative Commons License configuration. -
Method Summary
Modifier and TypeMethodDescriptiongetName()An unique name to identify the validation implementationCheck if at least one Creative Commons License is required when submitting a new Item.voidsetItemService(ItemService itemService) voidvalidate(SubmissionService submissionService, InProgressSubmission obj, SubmissionStepConfig config) Perform validation on the item and config(ccLicense).Methods inherited from class org.dspace.app.rest.submit.step.validation.AbstractValidation
addError
-
Field Details
-
ERROR_VALIDATION_CCLICENSEREQUIRED
- See Also:
-
-
Constructor Details
-
CclicenseValidator
Construct a Creative Commons License configuration.- Parameters:
configurationService- DSpace configuration provided by the DI container.
-
-
Method Details
-
getItemService
-
setItemService
-
isRequired
Check if at least one Creative Commons License is required when submitting a new Item.- Returns:
- true if a Creative Commons License is required setting true for the property cc.license.required.
-
getName
Description copied from class:AbstractValidationAn unique name to identify the validation implementation- Specified by:
getNamein interfaceValidation- Overrides:
getNamein classAbstractValidation
-
validate
public List<? extends ErrorRest> validate(SubmissionService submissionService, InProgressSubmission obj, SubmissionStepConfig config) throws DCInputsReaderException, SQLException Perform validation on the item and config(ccLicense).- Parameters:
obj- The submission to be validated.config- The configuration for the submission step for cclicense.- Returns:
- A list of validation errors.
- Throws:
SQLException- If there is a problem accessing the database.DCInputsReaderException
-
setName
- Overrides:
setNamein classAbstractValidation
-