Package org.ametys.odf.skill.imports.csv
Class SkillCSVImporter
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.contentio.csv.CSVImporter
org.ametys.odf.skill.imports.csv.SkillCSVImporter
- All Implemented Interfaces:
LogEnabled
,Component
,Serviceable
Import skills from an uploaded CSV file.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.ametys.plugins.contentio.csv.CSVImporter
CSVImporter.SynchronizeResult
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CatalogsManager
The catalog managerprotected ContentTypesHelper
The content types helperstatic final String
Avalon RoleFields inherited from class org.ametys.plugins.contentio.csv.CSVImporter
RESULT_CONTENT_IDS, RESULT_NB_ERRORS, RESULT_NB_WARNINGS
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected List
<Expression> additionalExpressionToRetrieveContent
(Map<String, Object> mapping, Map<String, String> row, ContentType contentType, Optional<? extends Content> parentContent, Map<String, Object> additionalTransientVars, List<String> valuesUsedAsIds) Returns a list of additional expression to retrieve the existing contentprotected CSVImporter.SynchronizeResult
processContent
(View view, Map<String, String> row, ContentType contentType, Map<String, Object> mapping, int createAction, int editAction, String workflowName, String language, List<ViewItem> errors, SynchronizeModeEnumerator.ImportMode importMode, Optional<? extends Content> parentContent, Map<String, Object> additionalTransientVars) Process content for CSV import or synchronizationvoid
service
(ServiceManager smanager) Methods inherited from class org.ametys.plugins.contentio.csv.CSVImporter
importContentsFromCSV
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
Avalon Role -
_contentTypesHelper
The content types helper -
_catalogsManager
The catalog manager
-
-
Constructor Details
-
SkillCSVImporter
public SkillCSVImporter()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classCSVImporter
- Throws:
ServiceException
-
additionalExpressionToRetrieveContent
protected List<Expression> additionalExpressionToRetrieveContent(Map<String, Object> mapping, Map<String, String> row, ContentType contentType, Optional<? extends Content> parentContent, Map<String, Object> additionalTransientVars, List<String> valuesUsedAsIds) Description copied from class:CSVImporter
Returns a list of additional expression to retrieve the existing content- Overrides:
additionalExpressionToRetrieveContent
in classCSVImporter
- Parameters:
mapping
- The mappingrow
- The rowcontentType
- The content typeparentContent
- The parent contentadditionalTransientVars
- Additional transients varsvaluesUsedAsIds
- The values used as ids, if some values are added in expression, they can be added in this list to be printed in error logs- Returns:
- a list of additional expression to retrieve the existing content
-
processContent
protected CSVImporter.SynchronizeResult processContent(View view, Map<String, String> row, ContentType contentType, Map<String, throws ExceptionObject> mapping, int createAction, int editAction, String workflowName, String language, List<ViewItem> errors, SynchronizeModeEnumerator.ImportMode importMode, Optional<? extends Content> parentContent, Map<String, Object> additionalTransientVars) Description copied from class:CSVImporter
Process content for CSV import or synchronization- Overrides:
processContent
in classCSVImporter
- Parameters:
view
- The viewrow
- The row containing the valuescontentType
- The content typemapping
- The mappingcreateAction
- The create actioneditAction
- The edit actionworkflowName
- The wokflow namelanguage
- The languageerrors
- The errorsimportMode
- The import modeparentContent
- The parent contentadditionalTransientVars
- The additional transient vars- Returns:
- The synchronize result
- Throws:
Exception
- If an error occurs
-