Class CmsValidationContext

java.lang.Object
org.opencms.acacia.client.CmsValidationContext

public class CmsValidationContext extends Object
The validation context. Keeps track of valid and invalid entity id's as well as of entity ids with warnings attached.

  • Constructor Details

    • CmsValidationContext

      Constructor.

    • CmsValidationContext

      public CmsValidationContext(org.opencms.acacia.shared.CmsValidationResult validationResult, Set<String> synchronizedPaths)
      Constructor, starting with an initial validation result.
      Parameters:
      validationResult - the validation result to initialize the context with.
      synchronizedPaths - paths that should be synchronized.
  • Method Details

    • clearWarningEntity

      public void clearWarningEntity(String entityId)
      Clears a warning entity id.

      Parameters:
      entityId - the entity id
    • getInvalidEntityIds

      Returns the invalid entity id's.

      Returns:
      the invalid entity id's
    • getValidEntityIds

      Returns the valid entity id's.

      Returns:
      the valid entity id's
    • getWarningEntityIds

      Returns the warning entity id's.

      Returns:
      the warning entity id's
    • hasValidationErrors

      public boolean hasValidationErrors()
      Returns if there are any invalid entities.

      Returns:
      true if there are any invalid entities
    • hasValidationWarnings

      public boolean hasValidationWarnings()
      Returns if there are any warning entities.

      Returns:
      true if there are any warning entities
    • removeEntityId

      public void removeEntityId(String entityId)
      Removes the given entity id, use when validating the entity is no longer required.

      Parameters:
      entityId - the entity id
    • setInvalidEntity

      public void setInvalidEntity(String entityId, Map<String[],org.opencms.util.CmsPair<String,String>> errors)
      Sets an entity as invalid and adds the error paths.

      Parameters:
      entityId - the entity id
      errors - the errors for the entity
    • setValidEntity

      public void setValidEntity(String entityId)
      Sets an entity as valid.

      Parameters:
      entityId - the entity id
    • setWarningEntity

      public void setWarningEntity(String entityId, Map<String[],org.opencms.util.CmsPair<String,String>> warnings)
      Sets warnings for an entity id.

      Parameters:
      entityId - the entity id
      warnings - the warnings for the entity