Class AbstractUidValidationTask
- java.lang.Object
-
- org.bonitasoft.plugin.validation.uid.AbstractUidValidationTask
-
- All Implemented Interfaces:
ValidationTask
- Direct Known Subclasses:
FragmentUidValidationTask,PageUidValidationTask,WidgetUidValidationTask
public abstract class AbstractUidValidationTask extends Object implements ValidationTask
Abstract class used to check that UID artifacts located in a directory are valid.
-
-
Field Summary
Fields Modifier and Type Field Description protected org.bonitasoft.web.designer.ArtifactBuilderartifactBuilderArtifact builder required to check if a UID artifact is validprotected PathartifactsSourceDirDirectory where UID artifacts should be stored
-
Constructor Summary
Constructors Constructor Description AbstractUidValidationTask()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract org.bonitasoft.web.designer.model.ArtifactStatusReportgetArtifactStatus(String artifactId)protected abstract StringgetTaskName()protected List<String>getUidArtifacts()protected static booleanisUidArtifact(Path directory)Check if the given directory represents a UID artifact.voidvalidate()Execute the validation task.
-
-
-
Field Detail
-
artifactBuilder
protected final org.bonitasoft.web.designer.ArtifactBuilder artifactBuilder
Artifact builder required to check if a UID artifact is valid
-
artifactsSourceDir
protected final Path artifactsSourceDir
Directory where UID artifacts should be stored
-
-
Method Detail
-
validate
public void validate() throws ValidationExceptionDescription copied from interface:ValidationTaskExecute the validation task.- Specified by:
validatein interfaceValidationTask- Throws:
ValidationException- if validation criteria are not met
-
getTaskName
protected abstract String getTaskName()
-
getArtifactStatus
protected abstract org.bonitasoft.web.designer.model.ArtifactStatusReport getArtifactStatus(String artifactId)
-
isUidArtifact
protected static boolean isUidArtifact(Path directory) throws ValidationErrorException
Check if the given directory represents a UID artifact.The directory is a UID artifact if its name does not match the regex
UID_DIRECTORY_EXCLUDE_REGEXand if it contains a json file matching exactly the directory name.For example the directory
fooBarmust contain the json filefooBar.jsonto be identified as a UID artifacts.- Parameters:
directory- path of the directory to check- Returns:
trueif the directory matches criteria described above- Throws:
ValidationErrorException- if an error occurred when parsing the given directory
-
-