Class NodeFormProcessor
- java.lang.Object
-
- org.alfresco.repo.forms.processor.AbstractFormProcessor
-
- org.alfresco.repo.forms.processor.FilteredFormProcessor<ItemType,PersistType>
-
- org.alfresco.repo.forms.processor.node.ContentModelFormProcessor<NodeRef,NodeRef>
-
- org.alfresco.repo.forms.processor.node.NodeFormProcessor
-
- All Implemented Interfaces:
FormProcessor
public class NodeFormProcessor extends ContentModelFormProcessor<NodeRef,NodeRef>
FormProcessor implementation that can generate and persist Form objects for repository nodes.- Author:
- Gavin Cornwell, Nick Smith
-
-
Field Summary
-
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 NodeFormProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Set<QName>getAspectNames(NodeRef nodeRef)protected Map<QName,Serializable>getAssociationValues(NodeRef item)protected TypeDefinitiongetBaseType(NodeRef nodeRef)protected StringgetItemType(NodeRef item)Returns aStringdescribing the type fo the specified item.protected StringgetItemURI(NodeRef item)Returns the URI location of the specified item.protected org.apache.commons.logging.LoggetLogger()Retrieves a logger instance to log to.protected Map<QName,Serializable>getPropertyValues(NodeRef nodeRef)protected Map<String,Object>getTransientValues(NodeRef item)protected NodeRefgetTypedItem(Item item)Returns a typed Object representing the given item.protected voidinternalGenerate(NodeRef item, List<String> fields, List<String> forcedFields, Form form, Map<String,Object> context)Generates the form.protected NodeRefinternalPersist(NodeRef item, FormData data)Persists the form data.protected voidprocessWorkingCopy(NodeRef nodeRef, Form form)Determines whether the given node represents a working copy, if it does the name field is searched for and set to protected as the name field should not be edited for a working copy.-
Methods inherited from class org.alfresco.repo.forms.processor.node.ContentModelFormProcessor
addPropertyDataIfRequired, determineDefaultMimetype, generateDefaultFields, 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, persist, populateForm, setFieldProcessorRegistry, setFilterRegistry, setIgnoredFields
-
Methods inherited from class org.alfresco.repo.forms.processor.AbstractFormProcessor
isActive, isApplicable, register, setActive, setFormItemType, setFormItemUrl, setMatchPattern, setProcessorRegistry, toString
-
-
-
-
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<NodeRef,NodeRef>- Returns:
- Log instance to log to.
-
getTypedItem
protected NodeRef 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<NodeRef,NodeRef>- Parameters:
item- The item to get a typed object for- Returns:
- The typed object
-
getItemType
protected String getItemType(NodeRef item)
Description copied from class:FilteredFormProcessorReturns aStringdescribing the type fo the specified item.- Specified by:
getItemTypein classFilteredFormProcessor<NodeRef,NodeRef>- Parameters:
item- ItemType- Returns:
- String
-
getItemURI
protected String getItemURI(NodeRef item)
Description copied from class:FilteredFormProcessorReturns the URI location of the specified item.- Specified by:
getItemURIin classFilteredFormProcessor<NodeRef,NodeRef>- Parameters:
item- ItemType- Returns:
- String
-
getPropertyValues
protected Map<QName,Serializable> getPropertyValues(NodeRef nodeRef)
- Specified by:
getPropertyValuesin classContentModelFormProcessor<NodeRef,NodeRef>
-
getAssociationValues
protected Map<QName,Serializable> getAssociationValues(NodeRef item)
- Specified by:
getAssociationValuesin classContentModelFormProcessor<NodeRef,NodeRef>
-
getTransientValues
protected Map<String,Object> getTransientValues(NodeRef item)
- Specified by:
getTransientValuesin classContentModelFormProcessor<NodeRef,NodeRef>
-
getAspectNames
protected Set<QName> getAspectNames(NodeRef nodeRef)
- Overrides:
getAspectNamesin classContentModelFormProcessor<NodeRef,NodeRef>
-
getBaseType
protected TypeDefinition getBaseType(NodeRef nodeRef)
- Specified by:
getBaseTypein classContentModelFormProcessor<NodeRef,NodeRef>
-
processWorkingCopy
protected void processWorkingCopy(NodeRef nodeRef, Form form)
Determines whether the given node represents a working copy, if it does the name field is searched for and set to protected as the name field should not be edited for a working copy. If the node is not a working copy this method has no effect.- Parameters:
nodeRef- NodeRef of node to check and potentially processform- The generated form
-
internalGenerate
protected void internalGenerate(NodeRef item, List<String> fields, List<String> forcedFields, Form form, Map<String,Object> context)
Description copied from class:FilteredFormProcessorGenerates the form.- Overrides:
internalGeneratein classFilteredFormProcessor<NodeRef,NodeRef>- Parameters:
item- The object to generate a form forfields- Restricted list of fields to includeforcedFields- List of fields to forcibly includeform- The form object being generatedcontext- Map representing optional context that can be used during retrieval of the form
-
internalPersist
protected NodeRef internalPersist(NodeRef item, FormData data)
Description copied from class:FilteredFormProcessorPersists the form data.- Specified by:
internalPersistin classFilteredFormProcessor<NodeRef,NodeRef>- Parameters:
item- The object to persist the form fordata- The data to persist- Returns:
- The object that got created or modified
-
-