org.alfresco.repo.forms.processor
Class FilteredFormProcessor

java.lang.Object
  extended by org.alfresco.repo.forms.processor.AbstractFormProcessor
      extended by org.alfresco.repo.forms.processor.FilteredFormProcessor
All Implemented Interfaces:
FormProcessor
Direct Known Subclasses:
ContentModelFormProcessor

public abstract class FilteredFormProcessor
extends AbstractFormProcessor

Abstract base class for all FormProcessor implementations that wish to use the filter mechanism.


Field Summary
protected  FilterRegistry filterRegistry
           
 
Fields inherited from class org.alfresco.repo.forms.processor.AbstractFormProcessor
active, matchPattern, patternMatcher, processorRegistry
 
Constructor Summary
FilteredFormProcessor()
           
 
Method Summary
 Form generate(Item item, java.util.List fields, java.util.List forcedFields, java.util.Map context)
          Returns a Form representation for an item
protected abstract  java.lang.Object getTypedItem(Item item)
          Returns a typed Object representing the given item.
protected abstract  void internalGenerate(java.lang.Object item, java.util.List fields, java.util.List forcedFields, Form form, java.util.Map context)
          Generates the form.
protected abstract  java.lang.Object internalPersist(java.lang.Object item, FormData data)
          Persists the form data.
 java.lang.Object persist(Item item, FormData data)
          Persists the given form data for the given item, completed by calling each applicable registered handler
 void setFilterRegistry(FilterRegistry filterRegistry)
          Sets the filter registry
 
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
 

Field Detail

filterRegistry

protected FilterRegistry filterRegistry
Constructor Detail

FilteredFormProcessor

public FilteredFormProcessor()
Method Detail

setFilterRegistry

public void setFilterRegistry(FilterRegistry filterRegistry)
Sets the filter registry

Parameters:
filterRegistry - The FilterRegistry instance

generate

public Form generate(Item item,
                     java.util.List fields,
                     java.util.List forcedFields,
                     java.util.Map context)
Description copied from interface: FormProcessor
Returns a Form representation for an item

Parameters:
item - The item to generate a Form object for
fields - Restricted list of fields to include, null indicates all possible fields for the item should be included
forcedFields - List of field names from 'fields' list that should be forcibly included, it is up to the form processor implementation to determine how to enforce this
context - Map representing optional context that can be used during retrieval of the form
Returns:
The Form representation

persist

public java.lang.Object persist(Item item,
                                FormData data)
Persists the given form data for the given item, completed by calling each applicable registered handler

Parameters:
item - The item to save the form for
data - The object representing the form data
Returns:
The object persisted
See Also:
FormProcessor.persist(org.alfresco.repo.forms.Item, org.alfresco.repo.forms.FormData)

getTypedItem

protected abstract java.lang.Object getTypedItem(Item item)
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.

Parameters:
item - The item to get a typed object for
Returns:
The typed object

internalGenerate

protected abstract void internalGenerate(java.lang.Object item,
                                         java.util.List fields,
                                         java.util.List forcedFields,
                                         Form form,
                                         java.util.Map context)
Generates the form.

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 abstract java.lang.Object internalPersist(java.lang.Object item,
                                                    FormData data)
Persists the form data.

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.