qbicsoftware / statistics-portlet

MIT License
0 stars 0 forks source link

Add a configurable path from which config.yaml will be read #13

Closed chahuistle closed 5 years ago

chahuistle commented 5 years ago

Right now the portlet loads its configuration file, config.yaml, as a resource from the classpath.

When the portlet (class life.qbic.portal.portlet.StatisticsPortlet) is initialized, it provides a default location:

MainPresenter mainPresenter = new MainPresenter(this,  "/config.yaml" );

Which in the end will be loaded by the parser (class life.qbic.portal.io.YAMLParser) as a resource from the classpath:

return yaml.loadAs(YAMLParser.class.getResourceAsStream(inputFile), MainConfig.class);

The portlet should be able to read a property from a configuration file, i.e., our standard qbic-ext.properties. The value of this property should be the path from which the portlet should load its configuration file. If the property is not present, current behavior (i.e., load a default config.yaml that is present as a resource in the classpath) should be kept.

chahuistle commented 5 years ago

See #15