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
ODF skills helper
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CurrentUserProviderThe current user providerprotected ObservationManagerThe observation managerprotected ODFHelperThe ODF helperprotected AmetysObjectResolverThe ametys object resolverprotected RightManagerThe right managerprotected SolrIndexHelperThe Solr index helperstatic final StringThe avalon role.static final StringThe internal attribute name to excluded from skills -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetCatalog(String contentId) Get the name of the catalog of a skill contentgetMicroSkills(String catalog) Get all micro skills of a requested catalogGet the path of the ODF root contentgetProgramMicroSkills(Program program) Get the micro skills of a programgetSkillsDistribution(AbstractProgram abstractProgram) Get the skills distribution by courses over aAbstractProgramDistribution is computed over the course of first level onlygetSkillsDistribution(AbstractProgram abstractProgram, int maxDepth) Get the skills distribution by courses over aAbstractProgramDistribution is computed over the course of first level onlygetSkillsDistribution(Program parentProgram, AbstractProgram program, int maxDepth) Get the skills distribution by courses over aProgramItembooleanisExcluded(ProgramItem programItem) trueif the program item is excluded from skills displaystatic booleanDetermines if rules are enabledvoidservice(ServiceManager manager) setProgramItemsExclusion(List<String> programItemIds, boolean excluded) Exclude or include the program items from skills displayMethods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
The avalon role. -
SKILLS_EXCLUDED_INTERNAL_ATTRIBUTE_NAME
The internal attribute name to excluded from skills- See Also:
-
_resolver
The ametys object resolver -
_odfHelper
The ODF helper -
_observationManager
The observation manager -
_solrIndexHelper
The Solr index helper -
_currentUserProvider
The current user provider -
_rightManager
The right manager
-
-
Constructor Details
-
ODFSkillsHelper
public ODFSkillsHelper()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
isSkillsEnabled
Determines if rules are enabled- Returns:
trueif rules are enabled
-
getCatalog
Get the name of the catalog of a skill content- Parameters:
contentId- The id of content- Returns:
- The catalog's name or null if the content does not have a catalog
-
getOdfRootContentPath
Get the path of the ODF root content- Returns:
- The path of the ODF root content
-
setProgramItemsExclusion
Exclude or include the program items from skills display- Parameters:
programItemIds- the list of program item idsexcluded-trueif the program items need to be excluded.- Returns:
- the map of changed program items properties
-
isExcluded
trueif the program item is excluded from skills display- Parameters:
programItem- the program item- Returns:
trueif the program item is excluded from skills display
-
getSkillsDistribution
public Map<Content,Map<Content, getSkillsDistributionSet<Content>>> (AbstractProgram abstractProgram) Get the skills distribution by courses over aAbstractProgramDistribution is computed over the course of first level only- Parameters:
abstractProgram- The program or subProgram for which to get the skills distribution- Returns:
- the skills distribution or null if the content is not a program or a compatible subProgram
-
getSkillsDistribution
public Map<Content,Map<Content, getSkillsDistributionSet<Content>>> (AbstractProgram abstractProgram, int maxDepth) Get the skills distribution by courses over aAbstractProgramDistribution is computed over the course of first level only- Parameters:
abstractProgram- The program or subProgram for which to get the skills distributionmaxDepth- 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 or null if the content is not a program or a compatible subProgram
-
getSkillsDistribution
public Map<Content,Map<Content, getSkillsDistributionSet<Content>>> (Program parentProgram, AbstractProgram program, int maxDepth) Get the skills distribution by courses over aProgramItem- Parameters:
parentProgram- The parent program that contains the skillsprogram- the programmaxDepth- 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<MacroSkill, Map<MicroSkill, Set<Course>>>
-
getMicroSkills
Get all micro skills of a requested catalog- Parameters:
catalog- The catalog- Returns:
- The micro skills
-
getProgramMicroSkills
Get the micro skills of a program- Parameters:
program- The program- Returns:
- The microskills attached to the program
-