Class CoutMaquettesReport
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.plugins.odfpilotage.report.AbstractPilotageReport
-
- org.ametys.plugins.odfpilotage.report.impl.AbstractReport
-
- org.ametys.plugins.odfpilotage.report.impl.CoutMaquettesReport
-
- All Implemented Interfaces:
PilotageReport
,LogEnabled
,PluginAware
,Initializable
,Configurable
,Serviceable
public class CoutMaquettesReport extends AbstractReport
Pilotage report for cost model
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
CoutMaquettesReport.ProgramTitleComparator
-
Nested classes/interfaces inherited from class org.ametys.plugins.odfpilotage.report.AbstractPilotageReport
AbstractPilotageReport.PilotageFile, AbstractPilotageReport.PilotageReportStatus
-
Nested classes/interfaces inherited from interface org.ametys.plugins.odfpilotage.report.PilotageReport
PilotageReport.PilotageReportTarget
-
-
Field Summary
Fields Modifier and Type Field Description private static String
__ETAPE_PORTEUSE
private static String
__VALUE_YEAR
protected CostComputationComponent
_costComputationComponent
CalculerEffectifComponentprivate int
_order
-
Fields inherited from class org.ametys.plugins.odfpilotage.report.AbstractPilotageReport
_currentFormattedDate, _i18nUtils, _odfHelper, _pilotageHelper, _refTableHelper, _reportHelper, _resolver, _sourceResolver, _tmpFolder, _userManager, MANIFEST_FILENAME
-
Fields inherited from interface org.ametys.plugins.odfpilotage.report.PilotageReport
OUTPUT_FORMAT_DOC, OUTPUT_FORMAT_XLS, PARAMETER_CATALOG, PARAMETER_LANG, PARAMETER_ORGUNIT, PARAMETER_OUTPUT_FORMAT, PARAMETER_PROGRAM
-
-
Constructor Summary
Constructors Constructor Description CoutMaquettesReport()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
_generateReport(TransformerHandler handler, CostComputationData costData, String uaiCode, String lang, String catalog)
private Container
_getEtapePorteuse(Course course, String hierarchy)
private String
_getEtapeTitle(Container etape)
private String
_getHierarchy(Program program, SubProgram subprogram, Container containerYear, Container containerSemester, String courseHierarchy)
private OrgUnit
_getOrgUnit(Course course, String hierarchy)
private String
_getPorte(Container etape, Container containerYear)
protected Set<Container>
_getStepsHolder(ProgramItem programItem)
Find steps holdersprivate Map<Program,Object>
_getStructure(String uaiCode, String lang, String catalog)
Generate the data structure that will be used to create the reportprivate Map<String,String>
_getYearsToDisplay(CostComputationData costData)
protected void
_launchByOrgUnit(String uaiCode, String catalog, String lang)
Launch a report generation on an orgunit.private void
_saxChoiceList(TransformerHandler handler, CourseList list)
private void
_saxContainer(TransformerHandler handler, Container container, Course parentCourse)
private void
_saxCourse(TransformerHandler handler, Program program, SubProgram subprogram, Container containerYear, Container containerSemester, CourseList list, Integer listPosition, Course course, Course parentCourse, int level, boolean lastLevel, String courseHierarchy)
private void
_saxCourseFromTree(TransformerHandler handler, Map<ProgramItem,Object> programTree, Program program)
private void
_saxCourseFromTree(TransformerHandler handler, Map<ProgramItem,Object> tree, Program program, SubProgram subprogram, Container containerYear, Container containerSemester, CourseList list, Integer listPosition, Course parentCourse, int level, String courseHierarchy)
private void
_saxCourseList(TransformerHandler handler, CourseList list, Integer position)
private void
_saxOrgUnits(TransformerHandler handler, Program program)
private void
_saxSubProgram(TransformerHandler handler, SubProgram subprogram)
private void
_saxTree(TransformerHandler handler, Map<Program,Object> programTree)
Sax the information related to the courses of the treeprivate void
_writeColumn(TransformerHandler handler, Map.Entry<String,String> entry)
private void
_writeColumns(TransformerHandler handler, CostComputationData costData)
private void
_writeCoutMaquettesReport(String uaiCode, String catalog, String lang, CostComputationData costData)
Create the groups' report for one organization unitprivate void
_writeLines(TransformerHandler handler, CostComputationData costData)
Write lines content of the reportprotected Set<String>
getSupportedOutputFormats()
Get the list of supported output formatsprotected String
getType()
Get the name of the reportprivate Map<String,String>
getValues(CostComputationData costData, CoursePart coursePart, CoursePartCostData coursePartCostData)
Create a map of values to saxprotected void
saxAdditionalCourseData(TransformerHandler handler, Course course)
Sax a additional data of aCourse
.void
service(ServiceManager manager)
-
Methods inherited from class org.ametys.plugins.odfpilotage.report.impl.AbstractReport
_getReportFileName, isSupportedTarget, launchByOrgUnit, launchByProgram
-
Methods inherited from class org.ametys.plugins.odfpilotage.report.AbstractPilotageReport
_buildZipName, addManifest, configure, convertReport, createZipFile, getId, getLabel, getMailBody, getMailSubject, getOutputFormat, getPipeline, getPluginName, getReportName, initialize, isCompatibleSchedulable, isGeneric, isSupportedFormat, launch, sendMail, setPluginInfo, supports
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
__ETAPE_PORTEUSE
private static final String __ETAPE_PORTEUSE
- See Also:
- Constant Field Values
-
__VALUE_YEAR
private static final String __VALUE_YEAR
- See Also:
- Constant Field Values
-
_costComputationComponent
protected CostComputationComponent _costComputationComponent
CalculerEffectifComponent
-
_order
private int _order
-
-
Constructor Detail
-
CoutMaquettesReport
public CoutMaquettesReport()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classAbstractPilotageReport
- Throws:
ServiceException
-
getType
protected String getType()
Description copied from class:AbstractPilotageReport
Get the name of the report- Specified by:
getType
in classAbstractPilotageReport
- Returns:
- The report name
-
getSupportedOutputFormats
protected Set<String> getSupportedOutputFormats()
Description copied from class:AbstractPilotageReport
Get the list of supported output formats- Overrides:
getSupportedOutputFormats
in classAbstractPilotageReport
- Returns:
- A
Set
of supported output formats
-
_launchByOrgUnit
protected void _launchByOrgUnit(String uaiCode, String catalog, String lang) throws Exception
Description copied from class:AbstractReport
Launch a report generation on an orgunit.- Specified by:
_launchByOrgUnit
in classAbstractReport
- Parameters:
uaiCode
- The UAI code of theOrgUnit
catalog
- The cataloglang
- The language- Throws:
Exception
- if an exception occurs
-
_writeCoutMaquettesReport
private void _writeCoutMaquettesReport(String uaiCode, String catalog, String lang, CostComputationData costData)
Create the groups' report for one organization unit- Parameters:
uaiCode
- the reference to the organization unit whose formations are going to be saxedcatalog
- the cataloglang
- The language codecostData
- object containing informations about the formation
-
_generateReport
private void _generateReport(TransformerHandler handler, CostComputationData costData, String uaiCode, String lang, String catalog)
-
_saxTree
private void _saxTree(TransformerHandler handler, Map<Program,Object> programTree) throws SAXException
Sax the information related to the courses of the tree- Parameters:
handler
- the transformer handlerprogramTree
- the program tree to sax- Throws:
SAXException
- if an error occurs when SAXing
-
_saxCourseFromTree
private void _saxCourseFromTree(TransformerHandler handler, Map<ProgramItem,Object> programTree, Program program) throws SAXException
- Throws:
SAXException
-
_saxCourseFromTree
private void _saxCourseFromTree(TransformerHandler handler, Map<ProgramItem,Object> tree, Program program, SubProgram subprogram, Container containerYear, Container containerSemester, CourseList list, Integer listPosition, Course parentCourse, int level, String courseHierarchy) throws SAXException
- Throws:
SAXException
-
_getHierarchy
private String _getHierarchy(Program program, SubProgram subprogram, Container containerYear, Container containerSemester, String courseHierarchy)
-
_saxCourse
private void _saxCourse(TransformerHandler handler, Program program, SubProgram subprogram, Container containerYear, Container containerSemester, CourseList list, Integer listPosition, Course course, Course parentCourse, int level, boolean lastLevel, String courseHierarchy) throws SAXException
- Throws:
SAXException
-
_getEtapeTitle
private String _getEtapeTitle(Container etape)
-
saxAdditionalCourseData
protected void saxAdditionalCourseData(TransformerHandler handler, Course course) throws AmetysRepositoryException, SAXException
Sax a additional data of aCourse
.- Parameters:
handler
- The handlercourse
- The course to SAX- Throws:
AmetysRepositoryException
- if an error occursSAXException
- if an error occurs
-
_saxContainer
private void _saxContainer(TransformerHandler handler, Container container, Course parentCourse) throws AmetysRepositoryException, SAXException
-
_saxSubProgram
private void _saxSubProgram(TransformerHandler handler, SubProgram subprogram) throws AmetysRepositoryException, SAXException
-
_saxOrgUnits
private void _saxOrgUnits(TransformerHandler handler, Program program) throws SAXException
- Throws:
SAXException
-
_getOrgUnit
private OrgUnit _getOrgUnit(Course course, String hierarchy)
-
_getEtapePorteuse
private Container _getEtapePorteuse(Course course, String hierarchy)
-
_getStepsHolder
protected Set<Container> _getStepsHolder(ProgramItem programItem)
Find steps holders- Parameters:
programItem
- the item we want to explore- Returns:
- a list of steps holders
-
_saxCourseList
private void _saxCourseList(TransformerHandler handler, CourseList list, Integer position) throws SAXException
- Throws:
SAXException
-
_saxChoiceList
private void _saxChoiceList(TransformerHandler handler, CourseList list) throws SAXException
- Throws:
SAXException
-
_getStructure
private Map<Program,Object> _getStructure(String uaiCode, String lang, String catalog)
Generate the data structure that will be used to create the report- Parameters:
uaiCode
- the uai code of the organization unitlang
- the lang of programscatalog
- the catalog of programs- Returns:
- The structure
-
_writeLines
private void _writeLines(TransformerHandler handler, CostComputationData costData) throws SAXException
Write lines content of the report- Parameters:
handler
- the transformer handlercostData
- informations about the capacity- Throws:
SAXException
- to handle XMLUtils exceptions
-
_writeColumns
private void _writeColumns(TransformerHandler handler, CostComputationData costData) throws SAXException
- Throws:
SAXException
-
_writeColumn
private void _writeColumn(TransformerHandler handler, Map.Entry<String,String> entry) throws SAXException
- Throws:
SAXException
-
_getYearsToDisplay
private Map<String,String> _getYearsToDisplay(CostComputationData costData)
-
getValues
private Map<String,String> getValues(CostComputationData costData, CoursePart coursePart, CoursePartCostData coursePartCostData)
Create a map of values to sax- Parameters:
costData
- informations about the formationcoursePart
- the coursePartcoursePartCostData
- the coursePart cost data- Returns:
- the map of values to sax
-
-