Package org.ametys.plugins.forms
Class FormManager
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.ametys.plugins.forms.FormManager
-
- All Implemented Interfaces:
Component
,Contextualizable
,LogEnabled
,Serviceable
public class FormManager extends AbstractLogEnabled implements Component, Serviceable, Contextualizable
Class to handle forms in contents
-
-
Field Summary
Fields Modifier and Type Field Description private static String
__FORM_TYPE_CMS
private Context
_context
private FormParser
_formParser
private FormPropertiesManager
_formPropertiesManager
private FormTableManager
_formTableManager
private JdbcWorkflowStore
_jdbcWorkflowStore
private ServiceManager
_manager
private DOMParser
_parser
private WorkflowHelper
_workflowHelper
private WorkflowProvider
_workflowProvider
static String
ENTRY_WORKFLOW_REINITIALIZATION
Constant for entry workflow reinitializationstatic String
ROLE
Avalon Role
-
Constructor Summary
Constructors Constructor Description FormManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Set<RichText>
_getRichTexts(ModelAwareDataHolder dataHolder)
Get the rich textsprivate void
_processForm(Content content, String contentName, String siteName, List<Form> forms, Node formNode)
private void
_removeUnusedForms(Content content, String contentName, List<Form> forms)
Remove the unused formsprivate void
_resetWorkflowTables(Content content, Form form, boolean dropColumn, boolean addColumn)
Remove the workflow tables and the workflow id column if neededvoid
contextualize(Context context)
private FormPropertiesManager
getFormPropertiesManager()
private FormTableManager
getFormTableManager()
private JdbcWorkflowStore
getJdbcWorkflowStore()
private WorkflowHelper
getWorkflowHelper()
private WorkflowProvider
getWorkflowProvider()
void
processContentForms(Content content)
Find all the forms the content contains and process them.void
service(ServiceManager smanager)
-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Field Detail
-
ENTRY_WORKFLOW_REINITIALIZATION
public static final String ENTRY_WORKFLOW_REINITIALIZATION
Constant for entry workflow reinitialization- See Also:
- Constant Field Values
-
__FORM_TYPE_CMS
private static final String __FORM_TYPE_CMS
- See Also:
- Constant Field Values
-
_manager
private ServiceManager _manager
-
_formPropertiesManager
private FormPropertiesManager _formPropertiesManager
-
_formParser
private FormParser _formParser
-
_formTableManager
private FormTableManager _formTableManager
-
_workflowProvider
private WorkflowProvider _workflowProvider
-
_jdbcWorkflowStore
private JdbcWorkflowStore _jdbcWorkflowStore
-
_workflowHelper
private WorkflowHelper _workflowHelper
-
-
Constructor Detail
-
FormManager
public FormManager()
-
-
Method Detail
-
service
public void service(ServiceManager smanager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
contextualize
public void contextualize(Context context) throws ContextException
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
getFormPropertiesManager
private FormPropertiesManager getFormPropertiesManager()
-
getFormTableManager
private FormTableManager getFormTableManager()
-
getWorkflowProvider
private WorkflowProvider getWorkflowProvider()
-
getWorkflowHelper
private WorkflowHelper getWorkflowHelper()
-
getJdbcWorkflowStore
private JdbcWorkflowStore getJdbcWorkflowStore()
-
processContentForms
public void processContentForms(Content content) throws SAXException, IOException, com.opensymphony.workflow.WorkflowException
Find all the forms the content contains and process them.- Parameters:
content
- the content.- Throws:
SAXException
- if a SAX exception occurs during content parsing.IOException
- if an I/O exception occurs during content parsing.com.opensymphony.workflow.WorkflowException
- if an exception occurs while handling the form's workflow
-
_processForm
private void _processForm(Content content, String contentName, String siteName, List<Form> forms, Node formNode) throws com.opensymphony.workflow.WorkflowException
- Throws:
com.opensymphony.workflow.WorkflowException
-
_resetWorkflowTables
private void _resetWorkflowTables(Content content, Form form, boolean dropColumn, boolean addColumn) throws FormsException, com.opensymphony.workflow.WorkflowException, SQLException
Remove the workflow tables and the workflow id column if needed- Parameters:
content
- The content holding the formform
- the formdropColumn
- true to drop the workflow id columnaddColumn
- true to add the workflow id column- Throws:
FormsException
- if an error occurs while retrieving the workflow instances idscom.opensymphony.workflow.WorkflowException
- if an error occurs during the reset of the workflow of the form entriesSQLException
- if an error occurs during the SQL queries
-
_removeUnusedForms
private void _removeUnusedForms(Content content, String contentName, List<Form> forms)
Remove the unused forms- Parameters:
content
- The contentcontentName
- The name of the contentforms
- The forms submitted
-
_getRichTexts
protected Set<RichText> _getRichTexts(ModelAwareDataHolder dataHolder)
Get the rich texts- Parameters:
dataHolder
- the data holder- Returns:
- the rich texts in a Set
-
-