Skip to content

Commit

Permalink
avniproject/avni-webapp#1140 | Added Rest point to get external repor…
Browse files Browse the repository at this point in the history
…ting system
  • Loading branch information
vedfordev committed Mar 4, 2024
1 parent d7fabb1 commit 0c4aea8
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package org.avni.server.web;

import org.avni.server.web.util.Configuration;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ConfigurationController {
@Autowired
private Configuration configuration;
@GetMapping("/Config")
public ResponseEntity<Configuration> getReportConfig(){
return ResponseEntity.ok(configuration);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package org.avni.server.web.util;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
@ConfigurationProperties(prefix = "avni")
public class Configuration {
private List<ReportingSystem> reportingSystems;

public List<ReportingSystem> getReportingSystems() {
return reportingSystems;
}

public void setReportingSystems(List<ReportingSystem> reportingSystems) {
this.reportingSystems = reportingSystems;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package org.avni.server.web.util;

public class ReportingSystem {
private String name;
private String url;

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public String getUrl() {
return url;
}

public void setUrl(String url) {
this.url = url;
}

}
8 changes: 8 additions & 0 deletions avni-server-api/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,11 @@ avni.enhancedValidation.enabled=${AVNI_ENHANCED_VALIDATION:true}
avni.exception.in.response=${AVNI_SEND_EXCEPTION_IN_RESPONSE:true}

logging.level.org.hibernate.SQL=OFF

#reporting
avni.reportingSystems[0].name=Metabase Reports
avni.reportingSystems[0].url=https://reporting.avniproject.org
avni.reportingSystems[1].name=Jasper Reports
avni.reportingSystems[1].url=https://reporting-jasper.avniproject.org/jasperserver/login.html
avni.reportingSystems[2].name=Superset Reports
avni.reportingSystems[2].url=https://reporting-superset.avniproject.org/login/

0 comments on commit 0c4aea8

Please sign in to comment.