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
associationNamePattern, contentService, dictionaryService, fileFolderService, namespaceService, nodeService, 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
NodeFormProcessor()
           
 
Method Summary
protected  java.util.Set getAspectNames(org.alfresco.service.cmr.repository.NodeRef nodeRef)
           
protected  java.util.Map getAssociationValues(org.alfresco.service.cmr.repository.NodeRef item)
           
protected  org.alfresco.service.cmr.dictionary.TypeDefinition getBaseType(org.alfresco.service.cmr.repository.NodeRef nodeRef)
           
protected  java.lang.String getItemType(org.alfresco.service.cmr.repository.NodeRef item)
          Returns a String describing the type fo the specified item.
protected  java.lang.String getItemURI(org.alfresco.service.cmr.repository.NodeRef item)
          Returns the URI location of the specified item.
protected  org.apache.commons.logging.Log getLogger()
          Retrieves a logger instance to log to.
protected  java.util.Map getPropertyValues(org.alfresco.service.cmr.repository.NodeRef nodeRef)
           
protected  java.util.Map getTransientValues(org.alfresco.service.cmr.repository.NodeRef item)
           
protected  org.alfresco.service.cmr.repository.NodeRef getTypedItem(Item item)
          Returns a typed Object representing the given item.
protected  void internalGenerate(org.alfresco.service.cmr.repository.NodeRef item, java.util.List fields, java.util.List forcedFields, Form form, java.util.Map context)
          Generates the form.
protected  org.alfresco.service.cmr.repository.NodeRef internalPersist(org.alfresco.service.cmr.repository.NodeRef item, FormData data)
          Persists the form data.
protected  void processWorkingCopy(org.alfresco.service.cmr.repository.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
 
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
 
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: FilteredFormProcessor
Retrieves a logger instance to log to.

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

getTypedItem

protected org.alfresco.service.cmr.repository.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

getItemType

protected java.lang.String getItemType(org.alfresco.service.cmr.repository.NodeRef item)
Description copied from class: FilteredFormProcessor
Returns a String describing the type fo the specified item.

Specified by:
getItemType in class FilteredFormProcessor
Returns:

getItemURI

protected java.lang.String getItemURI(org.alfresco.service.cmr.repository.NodeRef item)
Description copied from class: FilteredFormProcessor
Returns the URI location of the specified item.

Specified by:
getItemURI in class FilteredFormProcessor
Returns:

getPropertyValues

protected java.util.Map getPropertyValues(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Specified by:
getPropertyValues in class ContentModelFormProcessor

getAssociationValues

protected java.util.Map getAssociationValues(org.alfresco.service.cmr.repository.NodeRef item)
Specified by:
getAssociationValues in class ContentModelFormProcessor

getTransientValues

protected java.util.Map getTransientValues(org.alfresco.service.cmr.repository.NodeRef item)
Specified by:
getTransientValues in class ContentModelFormProcessor

getAspectNames

protected java.util.Set getAspectNames(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Overrides:
getAspectNames in class ContentModelFormProcessor

getBaseType

protected org.alfresco.service.cmr.dictionary.TypeDefinition getBaseType(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Specified by:
getBaseType in class ContentModelFormProcessor

processWorkingCopy

protected void processWorkingCopy(org.alfresco.service.cmr.repository.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 process
form - The generated form

internalGenerate

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

Overrides:
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

internalPersist

protected org.alfresco.service.cmr.repository.NodeRef internalPersist(org.alfresco.service.cmr.repository.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.