Package org.ametys.odf.skill
Class ODFSkillsHelper
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.odf.skill.ODFSkillsHelper
-
- All Implemented Interfaces:
LogEnabled
,Component
,Serviceable
public class ODFSkillsHelper extends AbstractLogEnabled implements Serviceable, Component
ODF skills helper
-
-
Field Summary
Fields Modifier and Type Field Description protected ContentWorkflowHelper
_contentWorkflowHelper
The content workflow helperprotected ObservationManager
_observationManager
The observation managerprotected ODFHelper
_odfHelper
The ODF helperprotected AmetysObjectResolver
_resolver
The ametys object resolverstatic String
COURSES_REPEATER_ACQUIRED_SKILLS
The name of repeater for acquired skillsstatic String
ROLE
The avalon role.static String
SKILL_CONTENT_TYPE
The skill content type idstatic String
SKILL_OTHER_NAMES_ATTRIBUTE_NAME
The skills other names attribute namestatic String
SKILLS_ATTRIBUTE_NAME
The attribute name of the skills
-
Constructor Summary
Constructors Constructor Description ODFSkillsHelper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
_createSkillTableRef(org.ametys.odf.skill.ODFSkillsHelper.Skill skill)
Create a skill table ref content from the skill objectprotected List<org.ametys.odf.skill.ODFSkillsHelper.Skill>
_getSkillsFromCSVFile(String skillsCSVFilePath)
Get the list of skills from the csv filevoid
createSkillsFromESCOFileCSV(String skillsCSVFilePath)
Create all skills from ESCO fileSet<ContentValue>
getComputedSkills(AbstractProgram abstractProgram, int maxDepth)
Get the computed skill values for a givenAbstractProgram
Map<Content,Map<Content,Map<Content,Content>>>
getSkillsDistribution(ProgramItem programItem)
Get the skills distribution by courses over aProgramItem
Distribution is computed over the course of first level onlyMap<Content,Map<Content,Map<Content,Content>>>
getSkillsDistribution(ProgramItem programItem, int maxDepth)
Get the skills distribution by courses over aProgramItem
void
service(ServiceManager manager)
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
COURSES_REPEATER_ACQUIRED_SKILLS
public static final String COURSES_REPEATER_ACQUIRED_SKILLS
The name of repeater for acquired skills- See Also:
- Constant Field Values
-
SKILL_CONTENT_TYPE
public static final String SKILL_CONTENT_TYPE
The skill content type id- See Also:
- Constant Field Values
-
SKILLS_ATTRIBUTE_NAME
public static final String SKILLS_ATTRIBUTE_NAME
The attribute name of the skills- See Also:
- Constant Field Values
-
SKILL_OTHER_NAMES_ATTRIBUTE_NAME
public static final String SKILL_OTHER_NAMES_ATTRIBUTE_NAME
The skills other names attribute name- See Also:
- Constant Field Values
-
_contentWorkflowHelper
protected ContentWorkflowHelper _contentWorkflowHelper
The content workflow helper
-
_resolver
protected AmetysObjectResolver _resolver
The ametys object resolver
-
_odfHelper
protected ODFHelper _odfHelper
The ODF helper
-
_observationManager
protected ObservationManager _observationManager
The observation manager
-
-
Constructor Detail
-
ODFSkillsHelper
public ODFSkillsHelper()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getComputedSkills
public Set<ContentValue> getComputedSkills(AbstractProgram abstractProgram, int maxDepth)
Get the computed skill values for a givenAbstractProgram
- Parameters:
abstractProgram
- the abstract programmaxDepth
- the max depth of courses. For example, set to 1 to compute skills over UE only, set 2 to compute skills over UE and EC, ...- Returns:
- the skill values computed from the attached courses
-
getSkillsDistribution
public Map<Content,Map<Content,Map<Content,Content>>> getSkillsDistribution(ProgramItem programItem)
Get the skills distribution by courses over aProgramItem
Distribution is computed over the course of first level only- Parameters:
programItem
- the program item- Returns:
- the skills distribution
-
getSkillsDistribution
public Map<Content,Map<Content,Map<Content,Content>>> getSkillsDistribution(ProgramItem programItem, int maxDepth)
Get the skills distribution by courses over aProgramItem
- Parameters:
programItem
- the program itemmaxDepth
- the max depth of courses. For example, set to 1 to compute distribution over UE only, set 2 to compute distribution over UE and EC, ...- Returns:
- the skills distribution as Map<SkillSet, Map<Skill, Map<Course, AcquisitionLevel>>>
-
createSkillsFromESCOFileCSV
public void createSkillsFromESCOFileCSV(String skillsCSVFilePath)
Create all skills from ESCO file- Parameters:
skillsCSVFilePath
- the skills CSV file path
-
_getSkillsFromCSVFile
protected List<org.ametys.odf.skill.ODFSkillsHelper.Skill> _getSkillsFromCSVFile(String skillsCSVFilePath)
Get the list of skills from the csv file- Parameters:
skillsCSVFilePath
- the skills CSV file path- Returns:
- the list of skills
-
_createSkillTableRef
protected void _createSkillTableRef(org.ametys.odf.skill.ODFSkillsHelper.Skill skill) throws AmetysRepositoryException, com.opensymphony.workflow.WorkflowException
Create a skill table ref content from the skill object- Parameters:
skill
- the skill object- Throws:
AmetysRepositoryException
- if a repository error occurredcom.opensymphony.workflow.WorkflowException
- if a workflow error occurred
-
-