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 Details

    • 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
  • Constructor Details

    • AbstractUidValidationTask

      public AbstractUidValidationTask()
  • Method Details

    • validate

      public void validate() throws ValidationException
      Description copied from interface: ValidationTask
      Execute the validation task.
      Specified by:
      validate in interface ValidationTask
      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)
    • getUidArtifacts

      protected List<String> getUidArtifacts()
    • 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_REGEX and if it contains a json file matching exactly the directory name.

      For example the directory fooBar must contain the json file fooBar.json to be identified as a UID artifacts.

      Parameters:
      directory - path of the directory to check
      Returns:
      true if the directory matches criteria described above
      Throws:
      ValidationErrorException - if an error occurred when parsing the given directory