Class TypeFormProcessor
- java.lang.Object
-
- org.alfresco.repo.forms.processor.AbstractFormProcessor
-
- org.alfresco.repo.forms.processor.FilteredFormProcessor<ItemType,PersistType>
-
- org.alfresco.repo.forms.processor.node.ContentModelFormProcessor<org.alfresco.service.cmr.dictionary.TypeDefinition,org.alfresco.service.cmr.repository.NodeRef>
-
- org.alfresco.repo.forms.processor.node.TypeFormProcessor
-
- All Implemented Interfaces:
FormProcessor
public class TypeFormProcessor extends ContentModelFormProcessor<org.alfresco.service.cmr.dictionary.TypeDefinition,org.alfresco.service.cmr.repository.NodeRef>
FormProcessor implementation that can generate and persist Form objects for types in the Alfresco content model.- Author:
- Gavin Cornwell, Nick Smith, 3.4
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.StringNAME_PROP_DATA-
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 TypeFormProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.alfresco.service.cmr.repository.NodeRefcreateNode(org.alfresco.service.cmr.dictionary.TypeDefinition typeDef, FormData data)Creates a new instance of the given type.protected java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable>getAssociationValues(org.alfresco.service.cmr.dictionary.TypeDefinition item)protected org.alfresco.service.cmr.dictionary.TypeDefinitiongetBaseType(org.alfresco.service.cmr.dictionary.TypeDefinition type)protected java.lang.StringgetItemType(org.alfresco.service.cmr.dictionary.TypeDefinition item)Returns aStringdescribing the type fo the specified item.protected java.lang.StringgetItemURI(org.alfresco.service.cmr.dictionary.TypeDefinition item)Returns the URI location of the specified item.protected org.apache.commons.logging.LoggetLogger()Retrieves a logger instance to log to.protected java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable>getPropertyValues(org.alfresco.service.cmr.dictionary.TypeDefinition item)protected java.util.Map<java.lang.String,java.lang.Object>getTransientValues(org.alfresco.service.cmr.dictionary.TypeDefinition item)protected org.alfresco.service.cmr.dictionary.TypeDefinitiongetTypedItem(Item item)Returns a typed Object representing the given item.protected org.alfresco.service.cmr.repository.NodeRefinternalPersist(org.alfresco.service.cmr.dictionary.TypeDefinition item, FormData data)Persists the form data.-
Methods inherited from class org.alfresco.repo.forms.processor.node.ContentModelFormProcessor
addPropertyDataIfRequired, determineDefaultMimetype, generateDefaultFields, getAspectNames, getDefaultIgnoredFields, 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, generateSelectedFields, internalGenerate, persist, populateForm, setFieldProcessorRegistry, setFilterRegistry, setIgnoredFields
-
Methods inherited from class org.alfresco.repo.forms.processor.AbstractFormProcessor
isActive, isApplicable, register, setActive, setFormItemType, setFormItemUrl, setMatchPattern, setProcessorRegistry, toString
-
-
-
-
Field Detail
-
NAME_PROP_DATA
protected static final java.lang.String NAME_PROP_DATA
- See Also:
- Constant Field Values
-
-
Method Detail
-
getLogger
protected org.apache.commons.logging.Log getLogger()
Description copied from class:FilteredFormProcessorRetrieves a logger instance to log to.- Specified by:
getLoggerin classFilteredFormProcessor<org.alfresco.service.cmr.dictionary.TypeDefinition,org.alfresco.service.cmr.repository.NodeRef>- Returns:
- Log instance to log to.
-
getTypedItem
protected org.alfresco.service.cmr.dictionary.TypeDefinition 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<org.alfresco.service.cmr.dictionary.TypeDefinition,org.alfresco.service.cmr.repository.NodeRef>- Parameters:
item- The item to get a typed object for- Returns:
- The typed object
-
internalPersist
protected org.alfresco.service.cmr.repository.NodeRef internalPersist(org.alfresco.service.cmr.dictionary.TypeDefinition item, FormData data)Description copied from class:FilteredFormProcessorPersists the form data.- Specified by:
internalPersistin classFilteredFormProcessor<org.alfresco.service.cmr.dictionary.TypeDefinition,org.alfresco.service.cmr.repository.NodeRef>- Parameters:
item- The object to persist the form fordata- The data to persist- Returns:
- The object that got created or modified
-
createNode
protected org.alfresco.service.cmr.repository.NodeRef createNode(org.alfresco.service.cmr.dictionary.TypeDefinition typeDef, FormData data)Creates a new instance of the given type.If the form data has the name property present it is used as the name of the node.
The new node is placed in the location defined by the "destination" data item in the form data (this will usually be a hidden field), this will also be the NodeRef representation of the parent for the new node.
- Parameters:
typeDef- The type defintion of the type to createdata- The form data- Returns:
- NodeRef representing the newly created node
-
getItemType
protected java.lang.String getItemType(org.alfresco.service.cmr.dictionary.TypeDefinition item)
Description copied from class:FilteredFormProcessorReturns aStringdescribing the type fo the specified item.- Specified by:
getItemTypein classFilteredFormProcessor<org.alfresco.service.cmr.dictionary.TypeDefinition,org.alfresco.service.cmr.repository.NodeRef>- Parameters:
item- ItemType- Returns:
- String
-
getItemURI
protected java.lang.String getItemURI(org.alfresco.service.cmr.dictionary.TypeDefinition item)
Description copied from class:FilteredFormProcessorReturns the URI location of the specified item.- Specified by:
getItemURIin classFilteredFormProcessor<org.alfresco.service.cmr.dictionary.TypeDefinition,org.alfresco.service.cmr.repository.NodeRef>- Parameters:
item- ItemType- Returns:
- String
-
getBaseType
protected org.alfresco.service.cmr.dictionary.TypeDefinition getBaseType(org.alfresco.service.cmr.dictionary.TypeDefinition type)
- Specified by:
getBaseTypein classContentModelFormProcessor<org.alfresco.service.cmr.dictionary.TypeDefinition,org.alfresco.service.cmr.repository.NodeRef>
-
getAssociationValues
protected java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable> getAssociationValues(org.alfresco.service.cmr.dictionary.TypeDefinition item)
- Specified by:
getAssociationValuesin classContentModelFormProcessor<org.alfresco.service.cmr.dictionary.TypeDefinition,org.alfresco.service.cmr.repository.NodeRef>
-
getPropertyValues
protected java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable> getPropertyValues(org.alfresco.service.cmr.dictionary.TypeDefinition item)
- Specified by:
getPropertyValuesin classContentModelFormProcessor<org.alfresco.service.cmr.dictionary.TypeDefinition,org.alfresco.service.cmr.repository.NodeRef>
-
getTransientValues
protected java.util.Map<java.lang.String,java.lang.Object> getTransientValues(org.alfresco.service.cmr.dictionary.TypeDefinition item)
- Specified by:
getTransientValuesin classContentModelFormProcessor<org.alfresco.service.cmr.dictionary.TypeDefinition,org.alfresco.service.cmr.repository.NodeRef>
-
-