Class PilotageHelper
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.odfpilotage.helper.PilotageHelper
- All Implemented Interfaces:
LogEnabled
,Initializable
,Component
,Serviceable
- Direct Known Subclasses:
ElementRetriever
public class PilotageHelper
extends AbstractLogEnabled
implements Component, Serviceable, Initializable
The pilotage helper.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Enumeration for the step holder status -
Field Summary
Modifier and TypeFieldDescriptionprotected AbstractCacheManager
The cache managerprotected ODFHelper
The helper for ODF contentsprotected OdfReferenceTableHelper
The helper for reference tables from ODFprotected static final String
The cache id for step holders by program itemstatic final String
MCC Course naturestatic final String
MCC Course naturestatic final String
MCC Course naturestatic final String
Normestatic final String
The avalon role -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionInternal method to get the steps of a program item, can be directly called by subclasses._getStepsHolder
(ProgramItem programItem, String yearId, Cache<String, Set<Container>> cache) Get the potential steps holder (step or field "etapePorteuse" in courses) of theProgramItem
._getStepsToCache
(ProgramItem programItem, String yearId, Cache<String, Set<Container>> cache) Get the steps to add to the cache.protected boolean
_isContainerOfNature
(ProgramItem programItem, String natureId) Filter the program item to keep only container with the given nature.getStepHolder
(ProgramItem programItem) Get the step holder of a program itemgetSteps
(ProgramItem programItem) Get the steps of a program itemGet the year container nature identifier.void
void
service
(ServiceManager manager) static Double
transformEqTD2Double
(String eqTD) Transform eqTD (can be a quotient) to a double value.Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
The avalon role -
MCC_MODALITE_SESSION1
MCC Course nature- See Also:
-
MCC_MODALITE_SESSION2
MCC Course nature- See Also:
-
MCC_SESSION_NATURE
MCC Course nature- See Also:
-
NORME
Norme- See Also:
-
_STEP_HOLDERS_BY_ITEM_CACHE_ID
The cache id for step holders by program item -
_odfHelper
The helper for ODF contents -
_refTableHelper
The helper for reference tables from ODF -
_cacheManager
The cache manager
-
-
Constructor Details
-
PilotageHelper
public PilotageHelper()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
initialize
- Specified by:
initialize
in interfaceInitializable
- Throws:
Exception
-
getStepHolder
Get the step holder of a program item- Parameters:
programItem
- The program item- Returns:
Pair
with the step holder status as a key, and the step holder (if found) as a value
-
_getStepsHolder
protected Set<Container> _getStepsHolder(ProgramItem programItem, String yearId, Cache<String, Set<Container>> cache) Get the potential steps holder (step or field "etapePorteuse" in courses) of theProgramItem
.- Parameters:
programItem
- The program itemyearId
- The identifier of the year container naturecache
- The cache- Returns:
- The list of potential steps holder linked to the programItem. It there are several, there is no defined step holder.
-
_isContainerOfNature
Filter the program item to keep only container with the given nature.- Parameters:
programItem
- The program itemnatureId
- The container nature identifier- Returns:
true
if it is a container of the given nature,false
otherwise
-
getSteps
Get the steps of a program item- Parameters:
programItem
- The program item- Returns:
- The steps of the given program item
-
_getSteps
protected Set<Container> _getSteps(ProgramItem programItem, String yearId, Cache<String, Set<Container>> cache) Internal method to get the steps of a program item, can be directly called by subclasses.- Parameters:
programItem
- The program itemyearId
- The identifier of the year container naturecache
- The cache- Returns:
- The steps of the given program item
-
_getStepsToCache
protected Set<Container> _getStepsToCache(ProgramItem programItem, String yearId, Cache<String, Set<Container>> cache) Get the steps to add to the cache. -
getYearId
Get the year container nature identifier.- Returns:
- an
Optional
of the year identifier
-
transformEqTD2Double
Transform eqTD (can be a quotient) to a double value.- Parameters:
eqTD
- The eqTD to parse- Returns:
- The double value equivalent to the given eqTD
-