Package org.ametys.odf.workflow
Class ODFWorkflowHelper
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.odf.workflow.ODFWorkflowHelper
- All Implemented Interfaces:
LogEnabled
,Component
,Serviceable
Helper for ODF contents on their workflow
-
Field Summary
Modifier and TypeFieldDescriptionprotected ContentWorkflowHelper
The workflow helper for contentsprotected ODFHelper
The ODF helperprotected AmetysObjectResolver
The Ametys object resolverprotected WorkflowProvider
The workflow providerprotected static final String
Constant for storing the result map into the transient variables map.static final String
The component role.static final int
The action id of global validationprotected static final String
Constant for storing the result map into the transient variables map.static final int
The validate step id -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription_content2Json
(Content content) Get the JSON representation of the contentprotected boolean
_doValidateWorkflowAction
(WorkflowAwareContent content, int actionId) Validate a contentprotected void
_validateRecursively
(WorkflowAwareContent content, Map<String, Object> result) Validate the referenced contents recursivelyprotected void
_validateReferencedContents
(Collection<String> refContentIds, Map<String, Object> result) Validate the list of referenced contentscheckReferences
(List<String> contentIds) Check if the contents has referenced contents that are not already validated (children excluded)getGlobalValidationStatus
(String contentId) Get the global validation status of a contentGet the invalidated contents referenced by a ODF contentglobalValidate
(List<String> contentIds) Global validation on a contents.boolean
isInValidatedStep
(WorkflowAwareContent content) Determines if a content is already in validated stepvoid
service
(ServiceManager manager) Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
The component role. -
VALIDATED_STEP_ID
The validate step id- See Also:
-
VALIDATE_ACTION_ID
The action id of global validation- See Also:
-
CONTENTS_IN_ERROR_KEY
Constant for storing the result map into the transient variables map.- See Also:
-
VALIDATED_CONTENTS_KEY
Constant for storing the result map into the transient variables map.- See Also:
-
_resolver
The Ametys object resolver -
_workflowProvider
The workflow provider -
_odfHelper
The ODF helper -
_contentWorkflowHelper
The workflow helper for contents
-
-
Constructor Details
-
ODFWorkflowHelper
public ODFWorkflowHelper()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
checkReferences
Check if the contents has referenced contents that are not already validated (children excluded)- Parameters:
contentIds
- The id of contents to check- Returns:
- A map with success key to true if referenced contents are validated. A map with the invalidated contents otherwise.
-
getGlobalValidationStatus
Get the global validation status of a content- Parameters:
contentId
- the id of content- Returns:
- the result
-
getInvalidatedContents
Get the invalidated contents referenced by a ODF content- Parameters:
content
- the initial ODF content- Returns:
- the set of referenced invalidated contents
-
isInValidatedStep
Determines if a content is already in validated step- Parameters:
content
- The content to test- Returns:
- true if the content is already validated
-
globalValidate
Global validation on a contents. Validate the contents with their whole structure and the others referenced contacts and orgunits.- Parameters:
contentIds
- the id of contents to validation recursively- Returns:
- the result for each initial contents
-
_content2Json
Get the JSON representation of the content- Parameters:
content
- the content- Returns:
- the content properties
-
_validateRecursively
Validate the referenced contents recursively- Parameters:
content
- The validated contentresult
- the result object to fill during process
-
_validateReferencedContents
protected void _validateReferencedContents(Collection<String> refContentIds, Map<String, Object> result) Validate the list of referenced contents- Parameters:
refContentIds
- The id of contents to validateresult
- the result object to fill during process
-
_doValidateWorkflowAction
Validate a content- Parameters:
content
- The content to validateactionId
- The id of validate action- Returns:
- true if the validation success
-