Class AbstractWorkflowFormProcessor<ItemType,PersistType>
java.lang.Object
org.alfresco.repo.forms.processor.AbstractFormProcessor
org.alfresco.repo.forms.processor.FilteredFormProcessor<ItemType,PersistType>
org.alfresco.repo.forms.processor.node.ContentModelFormProcessor<ItemType,PersistType>
org.alfresco.repo.forms.processor.workflow.AbstractWorkflowFormProcessor<ItemType,PersistType>
- Type Parameters:
ItemType-PersistType-
- All Implemented Interfaces:
FormProcessor
- Direct Known Subclasses:
TaskFormProcessor,WorkflowFormProcessor
public abstract class AbstractWorkflowFormProcessor<ItemType,PersistType>
extends ContentModelFormProcessor<ItemType,PersistType>
Abstract base class for workflow based form processors.
- Since:
- 3.4
- Author:
- Nick Smith
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BehaviourFilterprotected WorkflowServiceWorkflowServiceFields inherited from class org.alfresco.repo.forms.processor.node.ContentModelFormProcessor
associationNamePattern, contentService, dictionaryService, fileFolderService, namespaceService, nodeService, permissionService, propertyNamePattern, transientPropertyPatternFields inherited from class org.alfresco.repo.forms.processor.FilteredFormProcessor
fieldProcessorRegistry, filterRegistryFields inherited from class org.alfresco.repo.forms.processor.AbstractFormProcessor
active, DESTINATION, matchPattern, patternMatcher, processorRegistry -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongenerateDefaultFields(FormCreationData data, List<String> fieldsToIgnore) Generates a list of default fields to add if no field names are specified.generateSelectedFields(List<String> fields, FormCreationData data) protected ItemTypegetTypedItem(Item item) Returns a typed Object representing the given item.protected abstract ItemTypegetTypedItemForDecodedId(String itemId) Returns the typed item.protected PersistTypeinternalPersist(ItemType item, FormData data) Persists the form data.protected abstract ContentModelFormPersister<PersistType>makeFormPersister(ItemType item) Returns an implementation ofContentModelFormPersisterwhich is used to accumulate all the changes specified in theFormand then persist them.protected voidpopulateForm(Form form, List<String> fields, FormCreationData data) This method generates all the fields to be added and adds them to the Form, together with the associated field data.voidsetBehaviourFilter(BehaviourFilter behaviourFilter) voidsetExtendedPropertyFieldProcessor(ExtendedPropertyFieldProcessor extendedPropertyFieldProcessor) voidsetWorkflowService(WorkflowService workflowService) Methods inherited from class org.alfresco.repo.forms.processor.node.ContentModelFormProcessor
addPropertyDataIfRequired, determineDefaultMimetype, getAspectNames, getAssociationValues, getBaseType, getPropertyValues, getTransientValues, makeItemData, persistNode, processAssociationPersist, processContentPropertyPersist, processEncodingPropertyPersist, processMimetypePropertyPersist, processNamePropertyPersist, processPropertyPersist, setContentService, setDictionaryService, setFileFolderService, setNamespaceService, setNodeService, setPermissionServiceMethods inherited from class org.alfresco.repo.forms.processor.FilteredFormProcessor
generate, getItemType, getItemURI, getLogger, internalGenerate, persist, setFieldProcessorRegistry, setFilterRegistry, setIgnoredFieldsMethods inherited from class org.alfresco.repo.forms.processor.AbstractFormProcessor
isActive, isApplicable, register, setActive, setFormItemType, setFormItemUrl, setMatchPattern, setProcessorRegistry, toString
-
Field Details
-
workflowService
WorkflowService -
behaviourFilter
-
-
Constructor Details
-
AbstractWorkflowFormProcessor
public AbstractWorkflowFormProcessor()
-
-
Method Details
-
populateForm
Description copied from class:FilteredFormProcessorThis method generates all the fields to be added and adds them to the Form, together with the associated field data.- Overrides:
populateFormin classFilteredFormProcessor<ItemType,PersistType> - Parameters:
form- TheFormto which the fields are added.fields- The names of all the fields to be added.data-FormCreationDataused to generate all the fields.
-
internalPersist
Description copied from class:FilteredFormProcessorPersists the form data.- Specified by:
internalPersistin classFilteredFormProcessor<ItemType,PersistType> - Parameters:
item- The object to persist the form fordata- The data to persist- Returns:
- The object that got created or modified
-
generateDefaultFields
Description copied from class:FilteredFormProcessorGenerates a list of default fields to add if no field names are specified.- Overrides:
generateDefaultFieldsin classContentModelFormProcessor<ItemType,PersistType> - Parameters:
data- Used for field creation.fieldsToIgnore- TODO- Returns:
- a
ListofFieldswhich may be empty.
-
generateSelectedFields
- Overrides:
generateSelectedFieldsin classFilteredFormProcessor<ItemType,PersistType>
-
setWorkflowService
- Parameters:
workflowService- the workflowService to set
-
setBehaviourFilter
- Parameters:
behaviourFilter- the behaviourFilter to set
-
setExtendedPropertyFieldProcessor
public void setExtendedPropertyFieldProcessor(ExtendedPropertyFieldProcessor extendedPropertyFieldProcessor) - Parameters:
extendedPropertyFieldProcessor- the processor to set
-
getTypedItem
Description copied from class:FilteredFormProcessorReturns a typed Object representing the given item.Subclasses that represent a form type will return a typed object that is then passed to each of it's handlers, the handlers can therefore safely cast the Object to the type they expect.
- Specified by:
getTypedItemin classFilteredFormProcessor<ItemType,PersistType> - Parameters:
item- The item to get a typed object for- Returns:
- The typed object
-
getDefaultIgnoredFields
Description copied from class:FilteredFormProcessorWhen aFormis generated with no field names specifically set then a defaultFormis created. The defaultFormcontains all the properties and associations related to theItem, excluding a blacklist of ignored fields which defaults to the return value of this method. The default ignored values can be overridden by setting the propertyignoredFields.- Overrides:
getDefaultIgnoredFieldsin classContentModelFormProcessor<ItemType,PersistType> - Returns:
- the names of all the fields to be excluded from the default
Formif nodefaultFieldsproperty is explicitly set.
-
makeFormPersister
Returns an implementation ofContentModelFormPersisterwhich is used to accumulate all the changes specified in theFormand then persist them.- Parameters:
item- ItemType
-
getTypedItemForDecodedId
Returns the typed item.- Parameters:
itemId- the decoded item Id.- Returns:
- ItemType
-