@Override public String getDimensionItem( IdScheme idScheme ) { String item = null; if ( dataElement != null ) { item = dataElement.getPropertyValue( idScheme ); if ( categoryOptionCombo != null ) { item += SEPARATOR + categoryOptionCombo.getPropertyValue( idScheme ); } else if ( attributeOptionCombo != null ) { item += SEPARATOR + SYMBOL_WILDCARD; } if ( attributeOptionCombo != null ) { item += SEPARATOR + attributeOptionCombo.getPropertyValue( idScheme ); } } return item; }
attributes.put( optionComboName, catOptCombo.getPropertyValue( catOptComboIdScheme ) );
void preheat( IdentifiableObjectManager manager, final ImportConfig config ) { dataSets.load( manager.getAll( DataSet.class ), ds -> ds.getPropertyValue( config.dsScheme ) ); orgUnits.load( manager.getAll( OrganisationUnit.class ), ou -> ou.getPropertyValue( config.ouScheme ) ); attrOptionCombos.load( manager.getAll( CategoryOptionCombo.class ), oc -> oc.getPropertyValue( config.aocScheme ) ); } }
private void heatCaches( MetaDataCaches caches, ImportConfig config ) { if ( !caches.dataSets.isCacheLoaded() && exceedsThreshold( caches.dataSets ) ) { caches.dataSets.load( idObjManager.getAll( DataSet.class ), ds -> ds.getPropertyValue( config.dsScheme ) ); log.info( "Data set cache heated after cache miss threshold reached" ); } if ( !caches.orgUnits.isCacheLoaded() && exceedsThreshold( caches.orgUnits ) ) { caches.orgUnits.load( idObjManager.getAll( OrganisationUnit.class ), ou -> ou.getPropertyValue( config.ouScheme ) ); log.info( "Org unit cache heated after cache miss threshold reached" ); } // TODO Consider need for checking/re-heating attrOptCombo and period caches if ( !caches.attrOptionCombos.isCacheLoaded() && exceedsThreshold( caches.attrOptionCombos ) ) { caches.attrOptionCombos.load( idObjManager.getAll( CategoryOptionCombo.class ), aoc -> aoc.getPropertyValue( config.aocScheme ) ); log.info( "Attribute option combo cache heated after cache miss threshold reached" ); } if ( !caches.periods.isCacheLoaded() && exceedsThreshold( caches.periods ) ) { caches.periods.load( idObjManager.getAll( Period.class ), pe -> pe.getPropertyValue( null ) ); } }
optionComboMap.load( identifiableObjectManager.getAll( CategoryOptionCombo.class ), o -> o.getPropertyValue( categoryOptComboIdScheme ) ); optionComboMap.load( identifiableObjectManager.getAll( CategoryOptionCombo.class ), o -> o.getPropertyValue( categoryOptComboIdScheme ) );