public class FOContentCreationHelper extends AbstractLogEnabled implements Serviceable, Component, Contextualizable
| Modifier and Type | Field and Description |
|---|---|
private ContentTypesHelper |
_contentTypeHelper |
private ContentWorkflowHelper |
_contentWorkflowHelper |
private Context |
_context |
private ContentTypeExtensionPoint |
_cTypeExtPt |
private CurrentUserProvider |
_currentUserProvider |
private JSONUtils |
_jsonUtils |
private FrontOfficeSearcherFactory |
_searcherFactory |
private SourceResolver |
_srcResolver |
private UploadManager |
_uploadManager |
static String |
ROLE
The component role.
|
| Constructor and Description |
|---|
FOContentCreationHelper() |
| Modifier and Type | Method and Description |
|---|---|
protected Request |
_getRequest()
Get the request
|
private Map<String,Object> |
_getUploadFileValue(Part partUploaded) |
private void |
_saxContentEnumeratorValue(ContentHandler contentHandler,
MetadataDefinition metadataDef,
String language)
Sax enumeration value for enum or a content metadata
|
private boolean |
_validateFormField(MetadataDefinition metadataDef,
String fieldName,
Object value,
Multimap<String,I18nizableText> errors) |
void |
contextualize(Context context) |
Map<String,Object> |
createAndEditContent(int initActionId,
String contentTypeId,
String siteName,
String contentName,
String contentTitle,
String language,
Map<String,Object> values,
String workflowName,
String viewName)
Create and edit a content
|
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,Object> inputs)
Create and edit a content
|
Map<String,Object> |
getAndValidateFormValues(Map<String,Object> rawValues,
ContentType contentType,
String viewName,
Multimap<String,I18nizableText> errors)
Get the values for this content type from request
|
Map<String,Object> |
getAndValidateFormValues(Request request,
ContentType contentType,
String viewName,
Multimap<String,I18nizableText> errors)
Get the values for this content type from request
|
protected Map<String,String> |
getContentValues(String cTypeId,
String language)
Get values for contents enumeration
|
void |
saxContentValues(ContentHandler contentHandler,
ContentType contentType,
String rootTagName,
String language)
SAX contents values for metadata of type CONTENT
|
void |
saxViewIfExists(ContentHandler contentHandler,
ContentType contentType,
String rootTagName,
String viewName)
SAX the view of a content type
|
void |
service(ServiceManager smanager) |
getLogger, setLoggerprivate ContentTypesHelper _contentTypeHelper
private JSONUtils _jsonUtils
private UploadManager _uploadManager
private CurrentUserProvider _currentUserProvider
private ContentWorkflowHelper _contentWorkflowHelper
private SourceResolver _srcResolver
private ContentTypeExtensionPoint _cTypeExtPt
private FrontOfficeSearcherFactory _searcherFactory
public FOContentCreationHelper()
public void service(ServiceManager smanager) throws ServiceException
service in interface ServiceableServiceExceptionpublic void contextualize(Context context) throws ContextException
contextualize in interface ContextualizableContextExceptionprotected Request _getRequest()
public void saxViewIfExists(ContentHandler contentHandler, ContentType contentType, String rootTagName, String viewName) throws SAXException
contentHandler - The content handler to sax intocontentType - The content typerootTagName - the root tag nameviewName - The view nameSAXException - if an error occurspublic void saxContentValues(ContentHandler contentHandler, ContentType contentType, String rootTagName, String language) throws SAXException
contentHandler - The content handler to sax intocontentType - The content typerootTagName - The root tag namelanguage - the current languageSAXException - if an error occurs when saxingprivate void _saxContentEnumeratorValue(ContentHandler contentHandler, MetadataDefinition metadataDef, String language) throws SAXException
contentHandler - The content handler to sax intometadataDef - The metadata definition.language - The current languageSAXException - If an error occurred while saxingprotected Map<String,String> getContentValues(String cTypeId, String language)
cTypeId - The id of content typelanguage - The current languagepublic Map<String,Object> getAndValidateFormValues(Map<String,Object> rawValues, ContentType contentType, String viewName, Multimap<String,I18nizableText> errors)
rawValues - the input valuescontentType - the edited content typeviewName - the view nameerrors - The errors to fillpublic Map<String,Object> getAndValidateFormValues(Request request, ContentType contentType, String viewName, Multimap<String,I18nizableText> errors)
request - the requestcontentType - the edited content typeviewName - the view nameerrors - The errors to fillpublic 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.WorkflowException
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 nameAmetysRepositoryException - if an error occurscom.opensymphony.workflow.WorkflowException - if an error occurspublic 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,Object> inputs) throws AmetysRepositoryException, com.opensymphony.workflow.WorkflowException
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 inputsAmetysRepositoryException - if an error occurscom.opensymphony.workflow.WorkflowException - if an error occursprivate boolean _validateFormField(MetadataDefinition metadataDef, String fieldName, Object value, Multimap<String,I18nizableText> errors)
private Map<String,Object> _getUploadFileValue(Part partUploaded)