org.alfresco.repo.forms.processor.node
Class NodeFormProcessor

java.lang.Object
  extended by org.alfresco.repo.forms.processor.AbstractFormProcessor
      extended by org.alfresco.repo.forms.processor.FilteredFormProcessor
          extended by org.alfresco.repo.forms.processor.node.ContentModelFormProcessor
              extended by org.alfresco.repo.forms.processor.node.NodeFormProcessor
All Implemented Interfaces:
FormProcessor

public class NodeFormProcessor
extends ContentModelFormProcessor

FormProcessor implementation that can generate and persist Form objects for repository nodes.


Field Summary
 
Fields inherited from class org.alfresco.repo.forms.processor.node.ContentModelFormProcessor
ASSOC, ASSOC_DATA_ADDED_SUFFIX, ASSOC_DATA_PREFIX, ASSOC_DATA_REMOVED_SUFFIX, associationNamePattern, contentService, DATA_KEY_SEPARATOR, DEFAULT_CONTENT_MIMETYPE, dictionaryService, fileFolderService, MSG_ENCODING_DESC, MSG_ENCODING_LABEL, MSG_MIMETYPE_DESC, MSG_MIMETYPE_LABEL, MSG_SIZE_DESC, MSG_SIZE_LABEL, namespaceService, nodeService, ON, PROP, PROP_DATA_PREFIX, propertyNamePattern, TRANSIENT_ENCODING, TRANSIENT_MIMETYPE, TRANSIENT_SIZE, transientPropertyPattern
 
Fields inherited from class org.alfresco.repo.forms.processor.FilteredFormProcessor
filterRegistry
 
Fields inherited from class org.alfresco.repo.forms.processor.AbstractFormProcessor
active, matchPattern, patternMatcher, processorRegistry
 
Constructor Summary
NodeFormProcessor()
           
 
Method Summary
protected  void generateAllAssociationFields(NodeRef nodeRef, Form form)
          Sets up the field definitions for all the node's associations.
protected  void generateAllPropertyFields(NodeRef nodeRef, Form form)
          Sets up the field definitions for all the node's properties.
protected  void generateNode(NodeRef nodeRef, java.util.List fields, java.util.List forcedFields, Form form)
          Sets up the Form object for the given NodeRef
protected  void generateTransientFields(NodeRef nodeRef, Form form)
          Sets up the field definitions for any transient fields that may be useful, for example, 'mimetype', 'size' and 'encoding'.
protected  org.apache.commons.logging.Log getLogger()
          Retrieves a logger instance to log to.
protected  NodeRef getTypedItem(Item item)
          Returns a typed Object representing the given item.
protected  void internalGenerate(NodeRef item, java.util.List fields, java.util.List forcedFields, Form form, java.util.Map context)
          Generates the form.
protected  NodeRef internalPersist(NodeRef item, FormData data)
          Persists the form data.
 
Methods inherited from class org.alfresco.repo.forms.processor.node.ContentModelFormProcessor
determineDefaultMimetype, generateAssociationField, generateAssociationField, generateAssociationField, generateEncodingPropertyField, generateForcedField, generateMimetypePropertyField, generatePropertyField, generatePropertyField, generatePropertyField, generateSelectedFields, generateSizePropertyField, persistNode, processAssociationPersist, processContentPropertyPersist, processEncodingPropertyPersist, processMimetypePropertyPersist, processNamePropertyPersist, processPropertyPersist, processWorkingCopy, retrieveAssociationValues, setContentService, setDictionaryService, setFileFolderService, setNamespaceService, setNodeService
 
Methods inherited from class org.alfresco.repo.forms.processor.FilteredFormProcessor
generate, persist, setFilterRegistry
 
Methods inherited from class org.alfresco.repo.forms.processor.AbstractFormProcessor
isActive, isApplicable, register, setActive, setFormItemType, setFormItemUrl, setMatchPattern, setProcessorRegistry, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NodeFormProcessor

public NodeFormProcessor()
Method Detail

getLogger

protected org.apache.commons.logging.Log getLogger()
Description copied from class: ContentModelFormProcessor
Retrieves a logger instance to log to.

Specified by:
getLogger in class ContentModelFormProcessor
Returns:
Log instance to log to.

getTypedItem

protected NodeRef getTypedItem(Item item)
Description copied from class: FilteredFormProcessor
Returns 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:
getTypedItem in class FilteredFormProcessor
Parameters:
item - The item to get a typed object for
Returns:
The typed object

internalGenerate

protected void internalGenerate(NodeRef item,
                                java.util.List fields,
                                java.util.List forcedFields,
                                Form form,
                                java.util.Map context)
Description copied from class: FilteredFormProcessor
Generates the form.

Specified by:
internalGenerate in class FilteredFormProcessor
Parameters:
item - The object to generate a form for
fields - Restricted list of fields to include
forcedFields - List of fields to forcibly include
form - The form object being generated
context - Map representing optional context that can be used during retrieval of the form

generateNode

protected void generateNode(NodeRef nodeRef,
                            java.util.List fields,
                            java.util.List forcedFields,
                            Form form)
Sets up the Form object for the given NodeRef

Parameters:
nodeRef - The NodeRef to generate a Form for
fields - Restricted list of fields to include
forcedFields - List of fields to forcibly include
form - The Form instance to populate

generateAllPropertyFields

protected void generateAllPropertyFields(NodeRef nodeRef,
                                         Form form)
Sets up the field definitions for all the node's properties.

Parameters:
nodeRef - The NodeRef of the node being setup
form - The Form instance to populate

generateAllAssociationFields

protected void generateAllAssociationFields(NodeRef nodeRef,
                                            Form form)
Sets up the field definitions for all the node's associations.

Parameters:
nodeRef - The NodeRef of the node being setup
form - The Form instance to populate

generateTransientFields

protected void generateTransientFields(NodeRef nodeRef,
                                       Form form)
Sets up the field definitions for any transient fields that may be useful, for example, 'mimetype', 'size' and 'encoding'.

Parameters:
nodeRef - The NodeRef of the node being setup
form - The Form instance to populate

internalPersist

protected NodeRef internalPersist(NodeRef item,
                                  FormData data)
Description copied from class: FilteredFormProcessor
Persists the form data.

Specified by:
internalPersist in class FilteredFormProcessor
Parameters:
item - The object to persist the form for
data - The data to persist
Returns:
The object that got created or modified


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.