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
Fields Modifier and Type Field Description protected BehaviourFilterbehaviourFilterprotected WorkflowServiceworkflowServiceWorkflowService-
Fields inherited from class org.alfresco.repo.forms.processor.node.ContentModelFormProcessor
associationNamePattern, contentService, dictionaryService, fileFolderService, namespaceService, nodeService, permissionService, propertyNamePattern, transientPropertyPattern
-
Fields inherited from class org.alfresco.repo.forms.processor.FilteredFormProcessor
fieldProcessorRegistry, filterRegistry
-
Fields inherited from class org.alfresco.repo.forms.processor.AbstractFormProcessor
active, DESTINATION, matchPattern, patternMatcher, processorRegistry
-
-
Constructor Summary
Constructors Constructor Description AbstractWorkflowFormProcessor()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected java.util.List<Field>generateDefaultFields(FormCreationData data, java.util.List<java.lang.String> fieldsToIgnore)Generates a list of default fields to add if no field names are specified.protected java.util.List<Field>generateSelectedFields(java.util.List<java.lang.String> fields, FormCreationData data)protected java.util.List<java.lang.String>getDefaultIgnoredFields()protected ItemTypegetTypedItem(Item item)Returns a typed Object representing the given item.protected abstract ItemTypegetTypedItemForDecodedId(java.lang.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, java.util.List<java.lang.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, setPermissionService
-
Methods inherited from class org.alfresco.repo.forms.processor.FilteredFormProcessor
generate, getItemType, getItemURI, getLogger, internalGenerate, persist, setFieldProcessorRegistry, setFilterRegistry, setIgnoredFields
-
Methods inherited from class org.alfresco.repo.forms.processor.AbstractFormProcessor
isActive, isApplicable, register, setActive, setFormItemType, setFormItemUrl, setMatchPattern, setProcessorRegistry, toString
-
-
-
-
Field Detail
-
workflowService
protected WorkflowService workflowService
WorkflowService
-
behaviourFilter
protected BehaviourFilter behaviourFilter
-
-
Method Detail
-
populateForm
protected void populateForm(Form form, java.util.List<java.lang.String> fields, FormCreationData data)
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
protected PersistType internalPersist(ItemType item, FormData data)
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
protected java.util.List<Field> generateDefaultFields(FormCreationData data, java.util.List<java.lang.String> fieldsToIgnore)
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
protected java.util.List<Field> generateSelectedFields(java.util.List<java.lang.String> fields, FormCreationData data)
- Overrides:
generateSelectedFieldsin classFilteredFormProcessor<ItemType,PersistType>
-
setWorkflowService
public void setWorkflowService(WorkflowService workflowService)
- Parameters:
workflowService- the workflowService to set
-
setBehaviourFilter
public void setBehaviourFilter(BehaviourFilter behaviourFilter)
- Parameters:
behaviourFilter- the behaviourFilter to set
-
setExtendedPropertyFieldProcessor
public void setExtendedPropertyFieldProcessor(ExtendedPropertyFieldProcessor extendedPropertyFieldProcessor)
- Parameters:
extendedPropertyFieldProcessor- the processor to set
-
getTypedItem
protected ItemType getTypedItem(Item item)
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
protected java.util.List<java.lang.String> 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
protected abstract ContentModelFormPersister<PersistType> makeFormPersister(ItemType item)
Returns an implementation ofContentModelFormPersisterwhich is used to accumulate all the changes specified in theFormand then persist them.- Parameters:
item- ItemType
-
getTypedItemForDecodedId
protected abstract ItemType getTypedItemForDecodedId(java.lang.String itemId)
Returns the typed item.- Parameters:
itemId- the decoded item Id.- Returns:
- ItemType
-
-