Package org.ametys.cms.workflow
Class ValidateMetadataCondition
- java.lang.Object
-
- org.ametys.plugins.workflow.AbstractWorkflowComponent
-
- org.ametys.cms.workflow.AbstractContentWorkflowComponent
-
- org.ametys.cms.workflow.ValidateMetadataCondition
-
- All Implemented Interfaces:
com.opensymphony.workflow.Condition
,Initializable
,LogEnabled
,Serviceable
- Direct Known Subclasses:
ValidateMetadataSynchronizeCondition
public class ValidateMetadataCondition extends AbstractContentWorkflowComponent implements com.opensymphony.workflow.Condition, Initializable
OSWorkflow condition to check all content metadata are valid
-
-
Field Summary
Fields Modifier and Type Field Description private ContentTypeExtensionPoint
_cTypeEP
-
Fields inherited from class org.ametys.cms.workflow.AbstractContentWorkflowComponent
_contentHelper, CONTENT_KEY
-
Fields inherited from class org.ametys.plugins.workflow.AbstractWorkflowComponent
_logger, _manager, CONTEXT_PARAMETERS_KEY, FAIL_CONDITIONS_KEY, RESULT_MAP_KEY, WORKFLOW_ERRORS_KEY, WORKFLOW_WARNS_KEY
-
-
Constructor Summary
Constructors Constructor Description ValidateMetadataCondition()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private boolean
_validateCompositeMetadata(CompositeMetadata parentMetadata, MetadataDefinition metadataDef, String metadataName, Errors errors)
private boolean
_validateOtherMetadata(CompositeMetadata parentMetadata, MetadataDefinition metadataDef, String metadataName, Errors errors)
private boolean
_validateRepeaterMetadata(CompositeMetadata parentMetadata, MetadataDefinition metadataDef, String metadataName, Errors errors)
protected Object
getValue(CompositeMetadata metadata, MetadataDefinition metadataDef, String metadataName)
Get the metadata valuevoid
initialize()
boolean
passesCondition(Map transientVars, Map args, com.opensymphony.module.propertyset.PropertySet ps)
protected boolean
validateMetadata(CompositeMetadata parentMetadata, MetadataDefinition metadataDef, String metadataName, Errors errors)
Validate a metadata-
Methods inherited from class org.ametys.cms.workflow.AbstractContentWorkflowComponent
getContent, service
-
Methods inherited from class org.ametys.plugins.workflow.AbstractWorkflowComponent
addWorkflowError, addWorkflowWarning, enableLogging, getConditionFailures, getContextParameters, getResultsMap, getUser
-
-
-
-
Field Detail
-
_cTypeEP
private ContentTypeExtensionPoint _cTypeEP
-
-
Constructor Detail
-
ValidateMetadataCondition
public ValidateMetadataCondition()
-
-
Method Detail
-
initialize
public void initialize() throws Exception
- Specified by:
initialize
in interfaceInitializable
- Throws:
Exception
-
passesCondition
public boolean passesCondition(Map transientVars, Map args, com.opensymphony.module.propertyset.PropertySet ps) throws com.opensymphony.workflow.WorkflowException
- Specified by:
passesCondition
in interfacecom.opensymphony.workflow.Condition
- Throws:
com.opensymphony.workflow.WorkflowException
-
validateMetadata
protected boolean validateMetadata(CompositeMetadata parentMetadata, MetadataDefinition metadataDef, String metadataName, Errors errors)
Validate a metadata- Parameters:
parentMetadata
- The parent metadatametadataDef
- The metadata definitionmetadataName
- The metadata nameerrors
- The errors- Returns:
true
if metadata is valid
-
_validateOtherMetadata
private boolean _validateOtherMetadata(CompositeMetadata parentMetadata, MetadataDefinition metadataDef, String metadataName, Errors errors)
-
_validateCompositeMetadata
private boolean _validateCompositeMetadata(CompositeMetadata parentMetadata, MetadataDefinition metadataDef, String metadataName, Errors errors)
-
_validateRepeaterMetadata
private boolean _validateRepeaterMetadata(CompositeMetadata parentMetadata, MetadataDefinition metadataDef, String metadataName, Errors errors)
-
getValue
protected Object getValue(CompositeMetadata metadata, MetadataDefinition metadataDef, String metadataName)
Get the metadata value- Parameters:
metadata
- The metadatametadataDef
- The metadata definitionmetadataName
- The metadata name- Returns:
- The metadata value
-
-