Package org.ametys.web.content
Class FOContentCreationHelper
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.web.content.FOContentCreationHelper
- All Implemented Interfaces:
LogEnabled
,Component
,Contextualizable
,Serviceable
public class FOContentCreationHelper
extends AbstractLogEnabled
implements Serviceable, Component, Contextualizable
Helper for creating and editing a content from the submitted form
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Request
Get the requestvoid
contextualize
(Context context) createAndEditContent
(int initActionId, String[] contentTypeIds, String[] mixinIds, String siteName, String contentName, String contentTitle, String language, Map<String, Object> values, String workflowName, String viewName, Map<String, Object> inputs) Create and edit a contentcreateAndEditContent
(int initActionId, String contentTypeId, String siteName, String contentName, String contentTitle, String language, Map<String, Object> values, String workflowName, String viewName) Create and edit a contentcreateAndEditContent
(int initActionId, String contentTypeId, String siteName, String contentName, String contentTitle, String language, Map<String, Object> values, String workflowName, String viewName, Map<String, Object> inputs) Create and edit a contentgetAndValidateFormValues
(Request request, ContentType contentType, String viewName, Multimap<String, I18nizableText> errors) Get the values for this content type from requestgetContentValues
(String cTypeId, String language) Get values for contents enumerationvoid
saxContentValues
(ContentHandler contentHandler, ContentType contentType, String rootTagName, String language) SAX contents values for metadata of type CONTENTvoid
service
(ServiceManager smanager) validateValues
(Map<String, Object> values, ContentType contentType, String viewName) Validate the given valuesMethods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
The component role.
-
-
Constructor Details
-
FOContentCreationHelper
public FOContentCreationHelper()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
contextualize
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
_getRequest
Get the request- Returns:
- the request
-
saxContentValues
public void saxContentValues(ContentHandler contentHandler, ContentType contentType, String rootTagName, String language) throws SAXException SAX contents values for metadata of type CONTENT- Parameters:
contentHandler
- The content handler to sax intocontentType
- The content typerootTagName
- The root tag namelanguage
- the current language- Throws:
SAXException
- if an error occurs when saxing
-
getContentValues
Get values for contents enumeration- Parameters:
cTypeId
- The id of content typelanguage
- The current language- Returns:
- The contents
-
getAndValidateFormValues
public Map<String,Object> getAndValidateFormValues(Request request, ContentType contentType, String viewName, Multimap<String, I18nizableText> errors) Get the values for this content type from request- Parameters:
request
- the requestcontentType
- the edited content typeviewName
- the view nameerrors
- The errors to fill- Returns:
- The values
-
validateValues
public Multimap<String,I18nizableText> validateValues(Map<String, Object> values, ContentType contentType, String viewName) Validate the given values- Parameters:
values
- the values to validatecontentType
- the edited content typeviewName
- the view name- Returns:
- The errors if some values are not valid
-
createAndEditContent
public Map<String,Object> createAndEditContent(int initActionId, String contentTypeId, String siteName, String contentName, String contentTitle, String language, Map<String, Object> values, String workflowName, String viewName) throws AmetysRepositoryException, com.opensymphony.workflow.WorkflowExceptionCreate and edit a content- Parameters:
initActionId
- The initial workflow action id for creation and editioncontentTypeId
- The id of content typesiteName
- The current site namecontentName
- The content namecontentTitle
- The content titlelanguage
- The content languagevalues
- The submitted valuesworkflowName
- The workflow nameviewName
- The view name- Returns:
- The workflow result
- Throws:
AmetysRepositoryException
- if an error occurscom.opensymphony.workflow.WorkflowException
- if an error occurs
-
createAndEditContent
public Map<String,Object> createAndEditContent(int initActionId, String contentTypeId, String siteName, String contentName, String contentTitle, String language, Map<String, Object> values, String workflowName, String viewName, Map<String, throws AmetysRepositoryException, com.opensymphony.workflow.WorkflowExceptionObject> inputs) Create and edit a content- Parameters:
initActionId
- The initial workflow action id for creation and editioncontentTypeId
- The id of content typesiteName
- The current site namecontentName
- The content namecontentTitle
- The content titlelanguage
- The content languagevalues
- The submitted valuesworkflowName
- The workflow nameviewName
- The view nameinputs
- The initial workflow inputs- Returns:
- The workflow result
- Throws:
AmetysRepositoryException
- if an error occurscom.opensymphony.workflow.WorkflowException
- if an error occurs
-
createAndEditContent
public Map<String,Object> createAndEditContent(int initActionId, String[] contentTypeIds, String[] mixinIds, String siteName, String contentName, String contentTitle, String language, Map<String, Object> values, String workflowName, String viewName, Map<String, throws AmetysRepositoryException, com.opensymphony.workflow.WorkflowExceptionObject> inputs) Create and edit a content- Parameters:
initActionId
- The initial workflow action id for creation and editioncontentTypeIds
- The new content types. Cannot be null. Cannot be empty.mixinIds
- The new mixins. Can be null. Can be empty.siteName
- The current site namecontentName
- The content namecontentTitle
- The content titlelanguage
- The content languagevalues
- The values of the content attributesworkflowName
- The workflow nameviewName
- The view nameinputs
- The initial workflow inputs- Returns:
- The workflow result
- Throws:
AmetysRepositoryException
- if an error occurscom.opensymphony.workflow.WorkflowException
- if an error occurs
-