public abstract class ContentModelFormProcessor<ItemType,PersistType> extends FilteredFormProcessor<ItemType,PersistType>
Modifier and Type | Field and Description |
---|---|
protected Pattern |
associationNamePattern
A regular expression which can be used to match association names.
|
protected ContentService |
contentService |
protected org.alfresco.service.cmr.dictionary.DictionaryService |
dictionaryService |
protected FileFolderService |
fileFolderService |
protected org.alfresco.service.namespace.NamespaceService |
namespaceService |
protected org.alfresco.service.cmr.repository.NodeService |
nodeService
Services
|
protected org.alfresco.service.cmr.security.PermissionService |
permissionService |
protected Pattern |
propertyNamePattern
A regular expression which can be used to match property names.
|
protected Pattern |
transientPropertyPattern
A regular expression which can be used to match tranisent property names.
|
fieldProcessorRegistry, filterRegistry
active, DESTINATION, matchPattern, patternMatcher, processorRegistry
Constructor and Description |
---|
ContentModelFormProcessor() |
Modifier and Type | Method and Description |
---|---|
protected void |
addPropertyDataIfRequired(org.alfresco.service.namespace.QName propName,
Form form,
ContentModelItemData<?> itemData) |
protected String |
determineDefaultMimetype(FormData data)
Looks through the form data for the 'mimetype' transient field
and returns it's value if found, otherwise the default 'text/plain'
is returned
|
protected List<Field> |
generateDefaultFields(FormCreationData data,
List<String> fieldsToIgnore)
Generates a list of default fields to add if no field names are specified.
|
protected Set<org.alfresco.service.namespace.QName> |
getAspectNames(ItemType item) |
protected abstract Map<org.alfresco.service.namespace.QName,Serializable> |
getAssociationValues(ItemType item) |
protected abstract org.alfresco.service.cmr.dictionary.TypeDefinition |
getBaseType(ItemType item) |
protected List<String> |
getDefaultIgnoredFields()
|
protected abstract Map<org.alfresco.service.namespace.QName,Serializable> |
getPropertyValues(ItemType item) |
protected abstract Map<String,Object> |
getTransientValues(ItemType item) |
protected ContentModelItemData<ItemType> |
makeItemData(ItemType item)
|
protected void |
persistNode(org.alfresco.service.cmr.repository.NodeRef nodeRef,
FormData data)
Persists the given FormData on the given NodeRef
|
protected void |
processAssociationPersist(org.alfresco.service.cmr.repository.NodeRef nodeRef,
Map<org.alfresco.service.namespace.QName,org.alfresco.service.cmr.dictionary.AssociationDefinition> assocDefs,
Map<org.alfresco.service.namespace.QName,org.alfresco.service.cmr.dictionary.ChildAssociationDefinition> childAssocDefs,
FormData.FieldData fieldData,
List<org.alfresco.repo.forms.processor.node.AbstractAssocCommand> assocCommands)
Processes the given field data for persistence as an association.
|
protected void |
processContentPropertyPersist(org.alfresco.service.cmr.repository.NodeRef nodeRef,
FormData.FieldData fieldData,
Map<org.alfresco.service.namespace.QName,Serializable> propsToPersist,
FormData data)
Persists the given field data as the content
|
protected void |
processEncodingPropertyPersist(org.alfresco.service.cmr.repository.NodeRef nodeRef,
FormData.FieldData fieldData,
Map<org.alfresco.service.namespace.QName,Serializable> propsToPersist)
Persists the given field data as the encoding property
|
protected void |
processMimetypePropertyPersist(org.alfresco.service.cmr.repository.NodeRef nodeRef,
FormData.FieldData fieldData,
Map<org.alfresco.service.namespace.QName,Serializable> propsToPersist)
Persists the given field data as the mimetype property
|
protected void |
processNamePropertyPersist(org.alfresco.service.cmr.repository.NodeRef nodeRef,
FormData.FieldData fieldData,
Map<org.alfresco.service.namespace.QName,Serializable> propsToPersist)
Persists the given field data as the name property
|
protected void |
processPropertyPersist(org.alfresco.service.cmr.repository.NodeRef nodeRef,
Map<org.alfresco.service.namespace.QName,org.alfresco.service.cmr.dictionary.PropertyDefinition> propDefs,
FormData.FieldData fieldData,
Map<org.alfresco.service.namespace.QName,Serializable> propsToPersist,
FormData data)
Processes the given field data for persistence as a property.
|
void |
setContentService(ContentService contentService)
Sets the content service
|
void |
setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
Sets the data dictionary service
|
void |
setFileFolderService(FileFolderService fileFolderService)
Sets the file folder service
|
void |
setNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService)
Sets the namespace service
|
void |
setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
Sets the node service
|
void |
setPermissionService(org.alfresco.service.cmr.security.PermissionService permissionService)
Sets the content service
|
generate, generateSelectedFields, getItemType, getItemURI, getLogger, getTypedItem, internalGenerate, internalPersist, persist, populateForm, setFieldProcessorRegistry, setFilterRegistry, setIgnoredFields
isActive, isApplicable, register, setActive, setFormItemType, setFormItemUrl, setMatchPattern, setProcessorRegistry, toString
protected org.alfresco.service.cmr.repository.NodeService nodeService
protected FileFolderService fileFolderService
protected org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService
protected org.alfresco.service.namespace.NamespaceService namespaceService
protected ContentService contentService
protected org.alfresco.service.cmr.security.PermissionService permissionService
protected Pattern propertyNamePattern
"prop_cm_name"
. The pattern can also be
used to extract the "cm" and the "name" parts.protected Pattern transientPropertyPattern
"prop_name"
. The pattern can also
be used to extract the "name" part.protected Pattern associationNamePattern
"assoc_cm_references_added"
. The
pattern can also be used to extract the "cm", the "name" and the suffix
parts.public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
nodeService
- The NodeService instancepublic void setFileFolderService(FileFolderService fileFolderService)
fileFolderService
- The FileFolderService instancepublic void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
dictionaryService
- The DictionaryService instancepublic void setNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService)
namespaceService
- The NamespaceService instancepublic void setContentService(ContentService contentService)
contentService
- The ContentService instancepublic void setPermissionService(org.alfresco.service.cmr.security.PermissionService permissionService)
permissionService
- The PermissionService instanceprotected void addPropertyDataIfRequired(org.alfresco.service.namespace.QName propName, Form form, ContentModelItemData<?> itemData)
protected List<Field> generateDefaultFields(FormCreationData data, List<String> fieldsToIgnore)
FilteredFormProcessor
generateDefaultFields
in class FilteredFormProcessor<ItemType,PersistType>
data
- Used for field creation.fieldsToIgnore
- TODOList
of Fields
which may be empty.protected ContentModelItemData<ItemType> makeItemData(ItemType item)
FilteredFormProcessor
makeItemData
in class FilteredFormProcessor<ItemType,PersistType>
protected List<String> getDefaultIgnoredFields()
FilteredFormProcessor
Form
is generated with no field names specifically set then a default Form
is created.
The default Form
contains all the properties and associations related to the Item
, 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 property ignoredFields
.getDefaultIgnoredFields
in class FilteredFormProcessor<ItemType,PersistType>
Form
if no defaultFields
property is explicitly set.protected abstract Map<org.alfresco.service.namespace.QName,Serializable> getAssociationValues(ItemType item)
protected abstract Map<org.alfresco.service.namespace.QName,Serializable> getPropertyValues(ItemType item)
protected abstract org.alfresco.service.cmr.dictionary.TypeDefinition getBaseType(ItemType item)
protected void persistNode(org.alfresco.service.cmr.repository.NodeRef nodeRef, FormData data)
nodeRef
- The NodeRef to persist the form data ondata
- The FormData to persistprotected void processPropertyPersist(org.alfresco.service.cmr.repository.NodeRef nodeRef, Map<org.alfresco.service.namespace.QName,org.alfresco.service.cmr.dictionary.PropertyDefinition> propDefs, FormData.FieldData fieldData, Map<org.alfresco.service.namespace.QName,Serializable> propsToPersist, FormData data)
nodeRef
- The NodeRef to persist the properties onpropDefs
- Map of PropertyDefinition's for the node being persistedfieldData
- Data to persist for the propertypropsToPersist
- Map of properties to be persisteddata
- The FormData to persistprotected void processAssociationPersist(org.alfresco.service.cmr.repository.NodeRef nodeRef, Map<org.alfresco.service.namespace.QName,org.alfresco.service.cmr.dictionary.AssociationDefinition> assocDefs, Map<org.alfresco.service.namespace.QName,org.alfresco.service.cmr.dictionary.ChildAssociationDefinition> childAssocDefs, FormData.FieldData fieldData, List<org.alfresco.repo.forms.processor.node.AbstractAssocCommand> assocCommands)
nodeRef
- The NodeRef to persist the associations onfieldData
- Data to persist for the associationsassocCommands
- List of associations to be persistedprotected void processNamePropertyPersist(org.alfresco.service.cmr.repository.NodeRef nodeRef, FormData.FieldData fieldData, Map<org.alfresco.service.namespace.QName,Serializable> propsToPersist)
nodeRef
- The NodeRef to update the name forfieldData
- The data representing the new name valuepropsToPersist
- Map of properties to be persistedprotected void processMimetypePropertyPersist(org.alfresco.service.cmr.repository.NodeRef nodeRef, FormData.FieldData fieldData, Map<org.alfresco.service.namespace.QName,Serializable> propsToPersist)
nodeRef
- The NodeRef to update the mimetype forfieldData
- The data representing the new mimetype valuepropsToPersist
- Map of properties to be persistedprotected void processEncodingPropertyPersist(org.alfresco.service.cmr.repository.NodeRef nodeRef, FormData.FieldData fieldData, Map<org.alfresco.service.namespace.QName,Serializable> propsToPersist)
nodeRef
- The NodeRef to update the encoding forfieldData
- The data representing the new encoding valuepropsToPersist
- Map of properties to be persistedprotected void processContentPropertyPersist(org.alfresco.service.cmr.repository.NodeRef nodeRef, FormData.FieldData fieldData, Map<org.alfresco.service.namespace.QName,Serializable> propsToPersist, FormData data)
nodeRef
- The NodeRef to update the content forfieldData
- The data representing the new contentpropsToPersist
- Map of properties to be persisteddata
- The form data being persistedCopyright © 2005–2017 Alfresco Software. All rights reserved.