|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.alfresco.repo.forms.processor.AbstractFormProcessor
org.alfresco.repo.forms.processor.FilteredFormProcessor
public abstract class FilteredFormProcessor
Abstract base class for all FormProcessor implementations that wish to use the filter mechanism.
Field Summary | |
---|---|
protected FieldProcessorRegistry |
fieldProcessorRegistry
|
protected FilterRegistry |
filterRegistry
|
Fields inherited from class org.alfresco.repo.forms.processor.AbstractFormProcessor |
---|
active, DESTINATION, 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 java.util.List |
generateDefaultFields(FormCreationData data,
java.util.List fieldsToIgnore)
Generates a list of default fields to add if no field names are specified. |
protected java.util.List |
generateSelectedFields(java.util.List fields,
FormCreationData data)
|
protected abstract java.util.List |
getDefaultIgnoredFields()
When a Form is generated with no field names specifically set then a default Form is created. |
protected abstract java.lang.String |
getItemType(java.lang.Object item)
Returns a String describing the type fo the specified item. |
protected abstract java.lang.String |
getItemURI(java.lang.Object item)
Returns the URI location of the specified item. |
protected abstract org.apache.commons.logging.Log |
getLogger()
Retrieves a logger instance to log to. |
protected abstract java.lang.Object |
getTypedItem(Item item)
Returns a typed Object representing the given item. |
protected 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. |
protected abstract java.lang.Object |
makeItemData(java.lang.Object item)
Creates a data object used by the FormProcessor and FieldProcessors to create Fields |
java.lang.Object |
persist(Item item,
FormData data)
Persists the given form data for the given item, completed by calling each applicable registered handler |
protected void |
populateForm(Form form,
java.util.List fields,
FormCreationData data)
This method generates all the fields to be added and adds them to the Form, together with the associated field data. |
void |
setFieldProcessorRegistry(FieldProcessorRegistry fieldProcessorRegistry)
Sets the field processor registry. |
void |
setFilterRegistry(FilterRegistry filterRegistry)
Sets the filter registry |
void |
setIgnoredFields(java.util.List ignoredFields)
|
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 |
---|
protected FilterRegistry filterRegistry
protected FieldProcessorRegistry fieldProcessorRegistry
Constructor Detail |
---|
public FilteredFormProcessor()
Method Detail |
---|
public void setFilterRegistry(FilterRegistry filterRegistry)
filterRegistry
- The FilterRegistry instancepublic void setIgnoredFields(java.util.List ignoredFields)
ignoredFields
- the ignoredFields to setpublic Form generate(Item item, java.util.List fields, java.util.List forcedFields, java.util.Map context)
item
- The item to generate a Form object forfields
- Restricted list of fields to include, null
indicates all possible fields for the item
should be includedforcedFields
- 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 thiscontext
- Map representing optional context that
can be used during retrieval of the form
public java.lang.Object persist(Item item, FormData data)
item
- The item to save the form fordata
- The object representing the form data
FormProcessor.persist(org.alfresco.repo.forms.Item,
org.alfresco.repo.forms.FormData)
protected void internalGenerate(java.lang.Object item, java.util.List fields, java.util.List forcedFields, Form form, java.util.Map context)
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 formprotected void populateForm(Form form, java.util.List fields, FormCreationData data)
form
- The Form
to which the fields are added.fields
- The names of all the fields to be added.data
- FormCreationData
used to generate all the fields.protected java.util.List generateDefaultFields(FormCreationData data, java.util.List fieldsToIgnore)
data
- Used for field creation.ignoredFields
- TODO
List
of Fields
which may be empty.protected java.util.List generateSelectedFields(java.util.List fields, FormCreationData data)
public void setFieldProcessorRegistry(FieldProcessorRegistry fieldProcessorRegistry)
fieldProcessorRegistry
- The FieldProcessorRegistry
to use.protected abstract java.lang.Object makeItemData(java.lang.Object item)
FormProcessor
and FieldProcessors
to create Fields
protected abstract java.lang.Object getTypedItem(Item 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.
item
- The item to get a typed object for
protected abstract org.apache.commons.logging.Log getLogger()
protected abstract java.lang.String getItemType(java.lang.Object item)
String
describing the type fo the specified item.
item
-
protected abstract java.lang.String getItemURI(java.lang.Object item)
item
-
protected abstract java.lang.Object internalPersist(java.lang.Object item, FormData data)
item
- The object to persist the form fordata
- The data to persist
protected abstract java.util.List getDefaultIgnoredFields()
Form
is generated with no field names specifically set then a default Form
is created.
The default Form
contains all the properties and associations related to the Item
, excluding a
blacklist of ignored fields which defaults to the return value of this method.
The default ignored values can be overridden by setting the property ignoredFields
.
Form
if no defaultFields
property is explicitly set.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |