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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classODFSkillsHelper.Skill
-
Field Summary
Fields Modifier and Type Field Description protected ContentWorkflowHelper_contentWorkflowHelperThe content workflow helperprotected ObservationManager_observationManagerThe observation managerprotected ODFHelper_odfHelperThe ODF helperprotected AmetysObjectResolver_resolverThe ametys object resolverstatic StringCOURSES_REPEATER_ACQUIRED_SKILLSThe name of repeater for acquired skillsstatic StringROLEThe avalon role.static StringSKILL_CONTENT_TYPEThe skill content type idstatic StringSKILL_OTHER_NAMES_ATTRIBUTE_NAMEThe skills other names attribute namestatic StringSKILLS_ATTRIBUTE_NAMEThe attribute name of the skills
-
Constructor Summary
Constructors Constructor Description ODFSkillsHelper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void_buildSkillsDistribution(Course course, Course parentCourse, Map<Content,Map<Content,Map<Content,Content>>> skillsDistribution, int depth, int maxDepth)private void_buildSkillsDistribution(ProgramItem programItem, Map<Content,Map<Content,Map<Content,Content>>> skillsDistribution, int maxDepth)private Set<ContentValue>_computeSkills(ProgramItem programItem, int depth, int maxDepth)protected void_createSkillTableRef(ODFSkillsHelper.Skill skill)Create a skill table ref content from the skill objectprivate Content_getMaxAcquisitionLevel(Content level1, Content level2)protected List<ODFSkillsHelper.Skill>_getSkillsFromCSVFile(String skillsCSVFilePath)Get the list of skills from the csv filevoidcreateSkillsFromESCOFileCSV(String skillsCSVFilePath)Create all skills from ESCO fileSet<ContentValue>getComputedSkills(AbstractProgram abstractProgram, int maxDepth)Get the computed skill values for a givenAbstractProgramMap<Content,Map<Content,Map<Content,Content>>>getSkillsDistribution(ProgramItem programItem)Get the skills distribution by courses over aProgramItemDistribution 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 aProgramItemvoidservice(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:
servicein 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
-
_computeSkills
private Set<ContentValue> _computeSkills(ProgramItem programItem, int depth, int maxDepth)
-
getSkillsDistribution
public Map<Content,Map<Content,Map<Content,Content>>> getSkillsDistribution(ProgramItem programItem)
Get the skills distribution by courses over aProgramItemDistribution 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>>>
-
_buildSkillsDistribution
private void _buildSkillsDistribution(ProgramItem programItem, Map<Content,Map<Content,Map<Content,Content>>> skillsDistribution, int maxDepth)
-
_buildSkillsDistribution
private void _buildSkillsDistribution(Course course, Course parentCourse, Map<Content,Map<Content,Map<Content,Content>>> skillsDistribution, int depth, int maxDepth)
-
_getMaxAcquisitionLevel
private Content _getMaxAcquisitionLevel(Content level1, Content level2)
-
createSkillsFromESCOFileCSV
public void createSkillsFromESCOFileCSV(String skillsCSVFilePath)
Create all skills from ESCO file- Parameters:
skillsCSVFilePath- the skills CSV file path
-
_getSkillsFromCSVFile
protected List<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(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
-
-