Class ReportHelper
java.lang.Object
org.ametys.plugins.odfpilotage.helper.ReportHelper
- All Implemented Interfaces:
Initializable
,Component
,Serviceable
Helper for report creation.
-
Field Summary
Modifier and TypeFieldDescriptionprotected ODFHelper
The ODF helperprotected OdfReferenceTableHelper
The ODF enumeration helperprotected AmetysObjectResolver
The Ametys object resolverprotected RootOrgUnitProvider
The root orgunit providerstatic final NumberFormat
Number format with 2 digits after the commastatic final String
The avalon role -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionformatNumberToSax
(Long number) Format the given longgetAccronymOrUaiCode
(String uaiCode) Get the accronym if exists or UAI code of the orgunit given by the UAI code.getAccronymOrUaiCode
(OrgUnit orgUnit) Get the accronym if exists or UAI code of the orgunit given.getCodeDIP
(ModifiableDefaultContent content) Get code DIPgetCodeVRSVDI
(ModifiableDefaultContent content) Get code VRSVDIgetCoursesFromContent
(ProgramItem programItem) Get the list of courses underneath the given ametys objectGet the pilotage folder.Get the current date to the following format : 'dd/MM/yyyy'Get the temp pilotage folder.getUaiCodes
(String orgUnitId) Get the uaiCodes of the organization units involved in the groups reportvoid
minute2hour
(int duree) Convert a duration in minutes to a string representing the duration in hours.void
saxContentAttribute
(TransformerHandler handler, ModifiableDefaultContent content, String attributeName, String tagName) Generates SAX events for a multiple enumerated attribute.void
saxNaturesEnseignement
(ContentHandler handler, Logger logger) Sax the "natures d'enseignement" from the reference table.void
service
(ServiceManager manager)
-
Field Details
-
ROLE
The avalon role -
FORMAT_2_DIGITS
Number format with 2 digits after the comma -
_resolver
The Ametys object resolver -
_rootOrgUnitProvider
The root orgunit provider -
_odfHelper
The ODF helper -
_refTableHelper
The ODF enumeration helper
-
-
Constructor Details
-
ReportHelper
public ReportHelper()
-
-
Method Details
-
initialize
- Specified by:
initialize
in interfaceInitializable
- Throws:
Exception
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getReadableCurrentDate
Get the current date to the following format : 'dd/MM/yyyy'- Returns:
- The date as a
String
-
getUaiCodes
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
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
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
-
formatNumberToSax
Format the given long- Parameters:
number
- the long- Returns:
- string representation of this long
-
getCoursesFromContent
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
Get code VRSVDI- Parameters:
content
- the content- Returns:
- the codeVRSVDI if it's set, otherwise the second part of the content code
-
getCodeDIP
Get code DIP- Parameters:
content
- the content- Returns:
- the codeDIP if it's set, otherwise the first part of the content code
-
saxContentAttribute
public void saxContentAttribute(TransformerHandler handler, ModifiableDefaultContent content, String attributeName, String tagName) throws SAXException Generates SAX events for a multiple enumerated attribute. The attribute must be of type content or string- Parameters:
handler
- The handlercontent
- The contentattributeName
- The attribute nametagName
- The name of the tag- Throws:
SAXException
- if an error occurs
-
minute2hour
Convert a duration in minutes to a string representing the duration in hours.- Parameters:
duree
- in minutes- Returns:
- the duration in hours
-
saxNaturesEnseignement
Sax the "natures d'enseignement" from the reference table.- Parameters:
handler
- The transformer handlerlogger
- The logger- Throws:
SAXException
- if an error occurs
-
getPilotageFolder
Get the pilotage folder.- Returns:
- The pilotage folder
-
getTmpPilotageFolder
Get the temp pilotage folder.- Returns:
- The sub folder tmp in the pilotage folder
-