Class MCCDiffReport
- 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.AbstractMCCReport
-
- org.ametys.plugins.odfpilotage.report.impl.MCCDiffReport
-
- All Implemented Interfaces:
PilotageReport
,LogEnabled
,PluginAware
,Initializable
,Configurable
,Serviceable
public class MCCDiffReport extends AbstractMCCReport
The compare MCC catalog report (based on MCC report).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
MCCDiffReport.ChangeType
Change type-
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 ContentComparator
_contentComparator
private String
_oldCatalog
static String
PARAMETER_CATALOG_OLD
The key for the old catalog-
Fields inherited from class org.ametys.plugins.odfpilotage.report.impl.AbstractMCCReport
FIRST_SESSION_NAME, SECOND_SESSION_NAME, SESSION_NAME_PREFIX
-
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 MCCDiffReport()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private <T extends ProgramItem>
T_findOldProgramItem(T content)
Find the equivalent content in the new catalogprivate ContentComparatorResult
_getCourseChanges(Course oldCourse, Course newCourse)
Compare two courses.private Set<Integer>
_getEntryPositions(Content content, String sessionName)
private ContentComparatorResult
_getObjectChanges(ProgramItem oldProgramItem, ProgramItem newProgramItem)
private boolean
_hasChanges(ContentComparatorResult result, String sessionName, Integer entryPosition)
private boolean
_hasSameNature(ContentComparatorResult result, String sessionName, Integer entryPosition)
private void
_saxSessionEntry(TransformerHandler handler, Content content, String sessionName, Integer entryPosition, MCCDiffReport.ChangeType changeType)
protected void
addProgram2MCCAmetysObjectTree(MCCAmetysObjectTree tree, Program program)
Add and populate the program to theMCCAmetysObjectTree
protected String
getType()
Get the name of the reportprotected boolean
isCompatibleSchedulable(AbstractReportSchedulable schedulable)
Check if the given schedulable is compatible with the currentboolean
isGeneric()
Most of reports are generic.protected String
launchByOrgUnit(Map<String,String> reportParameters)
Launch a report generation on an orgunit.protected void
populateMCCAmetysObjectTree(MCCAmetysObjectTree tree)
Populate the MCC tree.protected void
saxGlobalInformations(TransformerHandler handler, Program program)
Sax the additional global informations of the report.protected void
saxMCCs(TransformerHandler handler, Course course, MCCAmetysObjectTree tree)
Sax the MCC sessions.void
service(ServiceManager manager)
-
Methods inherited from class org.ametys.plugins.odfpilotage.report.impl.AbstractMCCReport
_getReportFileName, _launchByOrgUnit, _processMCC, _writeReportsMcc, extractMCCAmetysObjectTree, saxContainer, saxCourse, saxCourseList, saxCourseParts, saxOrgUnit, saxProgram, saxSessionEntryDetails, saxSubProgram, saxTree, saxTreeChildren
-
Methods inherited from class org.ametys.plugins.odfpilotage.report.impl.AbstractReport
_getReportFileName, isSupportedTarget, launchByProgram
-
Methods inherited from class org.ametys.plugins.odfpilotage.report.AbstractPilotageReport
_buildZipName, addManifest, configure, convertReport, createZipFile, getId, getLabel, getMailBody, getMailSubject, getOutputFormat, getPipeline, getPluginName, getReportName, getSupportedOutputFormats, initialize, isSupportedFormat, launch, sendMail, setPluginInfo, supports
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
PARAMETER_CATALOG_OLD
public static final String PARAMETER_CATALOG_OLD
The key for the old catalog- See Also:
- Constant Field Values
-
_oldCatalog
private String _oldCatalog
-
_contentComparator
private ContentComparator _contentComparator
-
-
Constructor Detail
-
MCCDiffReport
public MCCDiffReport()
-
-
Method Detail
-
getType
protected String getType()
Description copied from class:AbstractPilotageReport
Get the name of the report- Specified by:
getType
in classAbstractPilotageReport
- Returns:
- The report name
-
isGeneric
public boolean isGeneric()
Description copied from class:AbstractPilotageReport
Most of reports are generic. This method can be overridden.- Overrides:
isGeneric
in classAbstractPilotageReport
- Returns:
true
if the current report is generic,false
otherwise
-
isCompatibleSchedulable
protected boolean isCompatibleSchedulable(AbstractReportSchedulable schedulable)
Description copied from class:AbstractPilotageReport
Check if the given schedulable is compatible with the current- Overrides:
isCompatibleSchedulable
in classAbstractPilotageReport
- Parameters:
schedulable
- The schedulable to test- Returns:
true
if the schedulable is compatible with the report
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classAbstractPilotageReport
- Throws:
ServiceException
-
launchByOrgUnit
protected String launchByOrgUnit(Map<String,String> reportParameters) throws Exception
Description copied from class:AbstractPilotageReport
Launch a report generation on an orgunit.- Overrides:
launchByOrgUnit
in classAbstractReport
- Parameters:
reportParameters
- The report parameters- Returns:
- the name of the generated file
- Throws:
Exception
- if an exception occurs
-
addProgram2MCCAmetysObjectTree
protected void addProgram2MCCAmetysObjectTree(MCCAmetysObjectTree tree, Program program)
Description copied from class:AbstractMCCReport
Add and populate the program to theMCCAmetysObjectTree
- Overrides:
addProgram2MCCAmetysObjectTree
in classAbstractMCCReport
- Parameters:
tree
- The object treeprogram
- The program to add
-
populateMCCAmetysObjectTree
protected void populateMCCAmetysObjectTree(MCCAmetysObjectTree tree)
Description copied from class:AbstractMCCReport
Populate the MCC tree.- Specified by:
populateMCCAmetysObjectTree
in classAbstractMCCReport
- Parameters:
tree
- The MCC tree
-
_getObjectChanges
private ContentComparatorResult _getObjectChanges(ProgramItem oldProgramItem, ProgramItem newProgramItem)
-
_getCourseChanges
private ContentComparatorResult _getCourseChanges(Course oldCourse, Course newCourse)
Compare two courses.- Parameters:
oldCourse
- The first course to compare (the old one)newCourse
- The second course to compare (the new one)- Returns:
- A
ContentComparatorResult
, or null if an exception occured
-
_findOldProgramItem
private <T extends ProgramItem> T _findOldProgramItem(T content)
Find the equivalent content in the new catalog- Type Parameters:
T
- Type of content to find- Parameters:
content
- Content in the current catalog- Returns:
- New equivalent content or null
-
_getEntryPositions
private Set<Integer> _getEntryPositions(Content content, String sessionName)
-
saxMCCs
protected void saxMCCs(TransformerHandler handler, Course course, MCCAmetysObjectTree tree) throws SAXException
Description copied from class:AbstractMCCReport
Sax the MCC sessions.- Specified by:
saxMCCs
in classAbstractMCCReport
- Parameters:
handler
- The transformer handlercourse
- The concernedCourse
to sax the MCCs ontree
- The MCC tree- Throws:
SAXException
- If an error occurs
-
_hasSameNature
private boolean _hasSameNature(ContentComparatorResult result, String sessionName, Integer entryPosition)
-
_hasChanges
private boolean _hasChanges(ContentComparatorResult result, String sessionName, Integer entryPosition)
-
_saxSessionEntry
private void _saxSessionEntry(TransformerHandler handler, Content content, String sessionName, Integer entryPosition, MCCDiffReport.ChangeType changeType) throws SAXException
- Throws:
SAXException
-
saxGlobalInformations
protected void saxGlobalInformations(TransformerHandler handler, Program program) throws SAXException
Description copied from class:AbstractMCCReport
Sax the additional global informations of the report.- Specified by:
saxGlobalInformations
in classAbstractMCCReport
- Parameters:
handler
- The transformer handlerprogram
- The program on which the report is launched- Throws:
SAXException
- If an error occurs
-
-