Class ReportHelper

    • Method Detail

      • getUaiCodes

        public List<StringgetUaiCodes​(String orgUnitId)
        Get the uaiCodes of the organization units involved in the groups report
        Parameters:
        orgUnitId - The parent UAI code
        Returns:
        if the uai code given by the user is valid, the list will contain solely this one if it is invalid, the list will contain no element and a warning message will be displayed if it is null, the list will contain all existing uai codes
      • getAccronymOrUaiCode

        public String getAccronymOrUaiCode​(OrgUnit orgUnit)
        Get the accronym if exists or UAI code of the orgunit given.
        Parameters:
        orgUnit - The orgUnit
        Returns:
        The accronym if it exists, otherwise the UAI code
      • getAccronymOrUaiCode

        public String getAccronymOrUaiCode​(String uaiCode)
        Get the accronym if exists or UAI code of the orgunit given by the UAI code.
        Parameters:
        uaiCode - The UAI code of the orgUnit
        Returns:
        The accronym if it exists, otherwise the UAI code
      • _getDirectSubOrgUnitsUAICodes

        private List<String_getDirectSubOrgUnitsUAICodes​(String orgUnitId)
        Retrieve the direct children's uai codes
        Parameters:
        orgUnitId - the id of the parent org unit
        Returns:
        the direct children's uai codes of the root organization unit
      • filterProgramsFromOrgUnits

        public List<ProgramfilterProgramsFromOrgUnits​(OrgUnit orgUnit,
                                                        String lang,
                                                        String catalog)
        Get Programs with the current catalog, language and selected orgUnit.
        Parameters:
        orgUnit - Selected orgunit
        lang - Selected language
        catalog - Selected catalog
        Returns:
        A List of Program in the catalog, language and selected orgUnit
      • getSubOrgUnits

        public List<StringgetSubOrgUnits​(String orgUnitId)
        Get the ids of the organization units beneath the organization unit with the given id
        Parameters:
        orgUnitId - the id of the parent organization unit
        Returns:
        the list of child organization units ids
      • getSubOrgUnits

        public List<StringgetSubOrgUnits​(OrgUnit orgUnit)
        Get the ids of all the sub org units
        Parameters:
        orgUnit - the organization unit
        Returns:
        the list of child organization units ids
      • formatNumberToSax

        public String formatNumberToSax​(Long number)
        Format the given long
        Parameters:
        number - the long
        Returns:
        string representation of this long
      • getProgramsByOrgUnitId

        public AmetysObjectIterable<ProgramgetProgramsByOrgUnitId​(String orgUnitId,
                                                                    String lang,
                                                                    String catalog)
        Get the programs' iterator of all programs contained in the organization unit with the given id
        Parameters:
        orgUnitId - the id of the organization unit
        lang - the lang of the programs
        catalog - the catalog of the programs
        Returns:
        the programs iterator
      • getCoursesFromContent

        public Map<ProgramItem,​ObjectgetCoursesFromContent​(ProgramItem programItem)
        Get the list of courses underneath the given ametys object
        Parameters:
        programItem - The program item to gather the courses from
        Returns:
        the map representation of the tree of ametys objects
      • getCodeVRSVDI

        public String getCodeVRSVDI​(ModifiableDefaultContent content)
        Get code VRSVDI
        Parameters:
        content - the content
        Returns:
        the codeVRSVDI if it's set, otherwise the second part of the content code
      • getCodeDIP

        public String getCodeDIP​(ModifiableDefaultContent content)
        Get code DIP
        Parameters:
        content - the content
        Returns:
        the codeDIP if it's set, otherwise the first part of the content code
      • minute2hour

        public String minute2hour​(int duree)
        Convert a duration in minutes to a string representing the duration in hours.
        Parameters:
        duree - in minutes
        Returns:
        the duration in hours
      • getSteps

        public Set<ContainergetSteps​(ProgramItem programItem)
        Get the steps which can hold this program item.
        Parameters:
        programItem - The program item
        Returns:
        The list of steps linked to the programItem
      • getStepsHolders

        public Set<ContainergetStepsHolders​(ProgramItem programItem,
                                              org.slf4j.Logger logger,
                                              String logPrefix)
        Get the potential steps holder (step or field "etapePorteuse" in courses) of the ProgramItem.
        Parameters:
        programItem - The program item
        logger - The logger
        logPrefix - The log prefix
        Returns:
        The list of potential steps holder linked to the programItem. It there are several, there is no defined step holder.