public static ProgramStageSection createProgramStageSection( char uniqueCharacter, Integer sortOrder ) { ProgramStageSection section = new ProgramStageSection(); section.setAutoFields(); section.setName( "ProgramStageSection" + uniqueCharacter ); section.setSortOrder( sortOrder ); return section; }
@Override public int compare( ProgramStageSection object0, ProgramStageSection object1 ) { if ( object0.getSortOrder() == null ) { return object1.getSortOrder() != null ? -1 : 0; } return object0.getSortOrder().compareTo( object1.getSortOrder() ); } }
@Override public void deleteProgramIndicator( ProgramIndicator programIndicator ) { Collection<ProgramStageSection> sections = idObjectManager.getAllNoAcl( ProgramStageSection.class ); for ( ProgramStageSection section : sections ) { if ( section.getProgramIndicators().remove( programIndicator ) ) { idObjectManager.update( section ); } } }
@Override public int saveProgramStageSection( ProgramStageSection programStageSection ) { programStageSectionStore.save( programStageSection ); return programStageSection.getId(); }
private void insertTable_ProgramStage( PdfPTable mainTable, PdfWriter writer, ProgramStage programStage ) throws IOException, DocumentException { Rectangle rectangle = new Rectangle( TEXTBOXWIDTH, PdfDataEntryFormUtil.CONTENT_HEIGHT_DEFAULT ); // Add Program Stage Sections if ( programStage.getProgramStageSections().size() > 0 ) { // Sectioned Ones for ( ProgramStageSection section : programStage.getProgramStageSections() ) { insertTable_ProgramStageSections( mainTable, rectangle, writer, section.getDataElements() ); } } else { // Default one insertTable_ProgramStageSections( mainTable, rectangle, writer, programStage.getAllDataElements() ); } }
private SetMap<Class<? extends IdentifiableObject>, IdentifiableObject> handleProgramStageSection( SetMap<Class<? extends IdentifiableObject>, IdentifiableObject> metadata, ProgramStageSection programStageSection ) { if ( programStageSection == null ) return metadata; metadata.putValue( ProgramStageSection.class, programStageSection ); handleAttributes( metadata, programStageSection ); programStageSection.getProgramIndicators().forEach( programIndicator -> handleProgramIndicator( metadata, programIndicator ) ); return metadata; }