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_EXTENSIONS
private ContentTypeExtensionPoint
_contentTypeEP
private ContentTypesHelper
_contentTypeHelper
private ContentWorkflowHelper
_contentWorkflowHelper
private ContentTypeExtensionPoint
_cTypeEP
private 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)
Map
act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters)
void
service(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:
service
in interfaceServiceable
- Overrides:
service
in 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:
IOException
com.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:
AmetysRepositoryException
com.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)
-
-