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_CMSprivate Context_contextprivate FormParser_formParserprivate FormPropertiesManager_formPropertiesManagerprivate FormTableManager_formTableManagerprivate JdbcWorkflowStore_jdbcWorkflowStoreprivate ServiceManager_managerprivate DOMParser_parserprivate WorkflowHelper_workflowHelperprivate WorkflowProvider_workflowProviderstatic StringENTRY_WORKFLOW_REINITIALIZATIONConstant for entry workflow reinitializationstatic StringROLEAvalon 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 neededvoidcontextualize(Context context)private FormPropertiesManagergetFormPropertiesManager()private FormTableManagergetFormTableManager()private JdbcWorkflowStoregetJdbcWorkflowStore()private WorkflowHelpergetWorkflowHelper()private WorkflowProvidergetWorkflowProvider()voidprocessContentForms(Content content)Find all the forms the content contains and process them.voidservice(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:
servicein interfaceServiceable- Throws:
ServiceException
-
contextualize
public void contextualize(Context context) throws ContextException
- Specified by:
contextualizein 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
-
-