Skip to content
This repository has been archived by the owner on Apr 3, 2024. It is now read-only.
/ prepr Public archive

Domain classes and client for the radiomanager API 'prepr' https://developers.prepr.io/

License

Notifications You must be signed in to change notification settings

vpro/prepr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

prepr

Domain classes and client for Prepr.io ('prepr')

Build Status Maven Central snapshots javadoc codecov

This was created because POMS sychronized (until april 2024) data from Prepr for radio related data of the Dutch public broadcasters. It doesn’t do that anymore, so this project may be archived soon.

Example code:

   PreprRepositoryImpl impl = new PreprRepositoryImpl(
       Prepr.
        .builder()
        .clientId("<your client id>")
        .clientSecret("<your client secret>")
        .build();



    public void getSchedule() throws IOException, URISyntaxException {
        log.info("schedule: {}",
            impl.getTimelines().getSchedule(UUID.fromString("59ad94c1-7dec-4ea0-a9b4-b9eb4b6cfb16") // Channel.RAD5)
                , LocalDate.of(2018, 5, 7), LocalDate.of(2018, 5, 8))
        );
    }

It is also possible to instantiate a bunch of repositories using spring

  <bean class="nl.vpro.io.prepr.spring.SpringPreprRepositoriesConfiguration">
    <constructor-arg value="media.properties" />
  </bean>

This will create PreprRepositoryImpl beans prepr.<channel>, and also one instance of PreprRepositories

Something similar can also be accomplished without spring

nl.vpro.io.prepr.StandalonePreprRepositories.fromMap()

(note that @CacheResult is not working then.)

Testing

There are junit test in the normal spots. Some things are in '*ITest' classes. These are currently mainly used to try things out. They find credentials in ${USER.HOME}/conf/prepr.properties. We don’t have proper integration tests yet.