@Override public void addJobConfigurations( List<JobConfiguration> jobConfigurations ) { jobConfigurations.forEach( jobConfiguration -> jobConfigurationStore.save( jobConfiguration ) ); }
@Override public int saveConstant( Constant constant ) { constantStore.save( constant ); return constant.getId(); }
@Override public int addIndicatorGroup( IndicatorGroup indicatorGroup ) { indicatorGroupStore.save( indicatorGroup ); return indicatorGroup.getId(); }
public int addPredictorGroup( PredictorGroup predictorGroup ) { predictorGroupStore.save( predictorGroup ); return predictorGroup.getId(); }
@Override public int addValidationRuleGroup( ValidationRuleGroup validationRuleGroup ) { validationRuleGroupStore.save( validationRuleGroup ); return validationRuleGroup.getId(); }
@Override public int addLegendSet( LegendSet legend ) { legendSetStore.save( legend ); return legend.getId(); }
@Override @Transactional public int addProgramIndicatorGroup( ProgramIndicatorGroup programIndicatorGroup ) { programIndicatorGroupStore.save( programIndicatorGroup ); return programIndicatorGroup.getId(); }
@Override public void save( IdentifiableObject object, boolean clearSharing ) { IdentifiableObjectStore<IdentifiableObject> store = getIdentifiableObjectStore( object.getClass() ); if ( store != null ) { store.save( object, clearSharing ); } }
@Override public int addDataElementGroup( DataElementGroup dataElementGroup ) { dataElementGroupStore.save( dataElementGroup ); return dataElementGroup.getId(); }
@Override public int addTrackedEntityType( TrackedEntityType trackedEntityType ) { trackedEntityTypeStore.save( trackedEntityType ); return trackedEntityType.getId(); }
@Override public int saveOptionSet( OptionSet optionSet ) { optionSetStore.save( optionSet ); return optionSet.getId(); }
@Override public int addIndicatorGroupSet( IndicatorGroupSet groupSet ) { indicatorGroupSetStore.save( groupSet ); return groupSet.getId(); }
@Override public int addProgramTrackedEntityAttributeGroup( ProgramTrackedEntityAttributeGroup attributeGroup ) { attributeGroupStore.save( attributeGroup ); return attributeGroup.getId(); }
@Override public int saveReport( Report report ) { reportStore.save( report ); return report.getId(); }
public int addColorSet( ColorSet colorSet ) { colorSetStore.save( colorSet ); return colorSet.getId(); }
@Override public int addUserGroup( UserGroup userGroup ) { userGroupStore.save( userGroup ); return userGroup.getId(); }
@Override public int addIndicatorType( IndicatorType indicatorType ) { indicatorTypeStore.save( indicatorType ); return indicatorType.getId(); }
@Override public int addJobConfiguration( JobConfiguration jobConfiguration ) { if ( !jobConfiguration.isInMemoryJob() ) { jobConfigurationStore.save( jobConfiguration ); } return jobConfiguration.getId(); }
private String saveFileResourceInternal( FileResource fileResource, Callable<String> saveCallable ) { fileResource.setStorageStatus( FileResourceStorageStatus.PENDING ); fileResourceStore.save( fileResource ); sessionFactory.getCurrentSession().flush(); final String uid = fileResource.getUid(); final ListenableFuture<String> saveContentTask = schedulingManager.executeJob( saveCallable ); saveContentTask.addCallback( uploadCallback.newInstance( uid ) ); return uid; }
@Override public void implement( RuleEffect ruleEffect, ProgramInstance programInstance ) { if ( !validate( ruleEffect, programInstance ) ) { return; } ProgramNotificationTemplate template = getNotificationTemplate( ruleEffect.ruleAction() ); String key = generateKey( template, programInstance ); String date = ruleEffect.data(); if ( !isDateValid( date ) ) { return; } ProgramNotificationInstance notificationInstance = createNotificationInstance( template, date ); notificationInstance.setProgramStageInstance( null ); notificationInstance.setProgramInstance( programInstance ); programNotificationInstanceStore.save( notificationInstance ); log.info( String.format( "Notification with id:%s has been scheduled", template.getUid() ) ); ExternalNotificationLogEntry entry = createLogEntry( key, template.getUid() ); entry.setNotificationTriggeredBy( NotificationTriggerEvent.PROGRAM ); notificationLoggingService.save( entry ); }