Package org.ametys.cms.repository
Class ImportSimpleContentsAction
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.apache.cocoon.acting.AbstractAction
-
- org.apache.cocoon.acting.ServiceableAction
-
- org.ametys.cms.repository.ImportSimpleContentsAction
-
- All Implemented Interfaces:
Component,LogEnabled,Serviceable,Action
public class ImportSimpleContentsAction extends ServiceableAction
Imports simple contents from a CSV file
-
-
Field Summary
Fields Modifier and Type Field Description private static String[]_ALLOWED_EXTENSIONSprivate ContentTypeExtensionPoint_contentTypeEPprivate ContentTypesHelper_contentTypeHelperprivate ContentWorkflowHelper_contentWorkflowHelperprivate ContentTypeExtensionPoint_cTypeEPprivate JSONUtils_jsonUtils-
Fields inherited from class org.apache.cocoon.acting.ServiceableAction
manager
-
Fields inherited from class org.apache.cocoon.acting.AbstractAction
EMPTY_MAP
-
-
Constructor Summary
Constructors Constructor Description ImportSimpleContentsAction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private Content_createSimpleContent(String cTypeId, String lang, String contentTitle, String workflowName, int actionId)private List<String>_createSimpleContents(String contentTypeId, String lang, String workflowName, int initActionId, int editActionId, File uploadedFile)private Map<String,Object>_editSimpleContent(Content content, String[] metadataNames, List<String> values, int actionId, String defaultLang)protected Reader_getReader(InputStream in)Get a reader on the data stream that detects the charset.private boolean_startsWithAlpha(String stringToTest)Mapact(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters)voidservice(ServiceManager smanager)-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Field Detail
-
_ALLOWED_EXTENSIONS
private static final String[] _ALLOWED_EXTENSIONS
-
_contentTypeEP
private ContentTypeExtensionPoint _contentTypeEP
-
_contentWorkflowHelper
private ContentWorkflowHelper _contentWorkflowHelper
-
_cTypeEP
private ContentTypeExtensionPoint _cTypeEP
-
_contentTypeHelper
private ContentTypesHelper _contentTypeHelper
-
_jsonUtils
private JSONUtils _jsonUtils
-
-
Constructor Detail
-
ImportSimpleContentsAction
public ImportSimpleContentsAction()
-
-
Method Detail
-
service
public void service(ServiceManager smanager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classServiceableAction- Throws:
ServiceException
-
act
public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) throws Exception
- Throws:
Exception
-
_createSimpleContents
private List<String> _createSimpleContents(String contentTypeId, String lang, String workflowName, int initActionId, int editActionId, File uploadedFile) throws IOException, com.opensymphony.workflow.WorkflowException
- Throws:
IOExceptioncom.opensymphony.workflow.WorkflowException
-
_getReader
protected Reader _getReader(InputStream in)
Get a reader on the data stream that detects the charset.- Parameters:
in- the data stream.- Returns:
- the reader with the correct character set.
-
_editSimpleContent
private Map<String,Object> _editSimpleContent(Content content, String[] metadataNames, List<String> values, int actionId, String defaultLang) throws AmetysRepositoryException, com.opensymphony.workflow.WorkflowException
- Throws:
AmetysRepositoryExceptioncom.opensymphony.workflow.WorkflowException
-
_createSimpleContent
private Content _createSimpleContent(String cTypeId, String lang, String contentTitle, String workflowName, int actionId) throws com.opensymphony.workflow.WorkflowException
- Throws:
com.opensymphony.workflow.WorkflowException
-
_startsWithAlpha
private boolean _startsWithAlpha(String stringToTest)
-
-