Skip to content
Snippets Groups Projects
Verified Commit db1d9c87 authored by Luc Everse's avatar Luc Everse :passport_control:
Browse files

Add a Submit report generator

parent a5c3977b
Branches
Tags
2 merge requests!179Release 2.5.0,!177Submit integration
package nl.tudelft.ewi.auta.core.report;
import nl.tudelft.ewi.auta.core.authentication.UserProvider;
import org.springframework.stereotype.Service;
import org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer;
/**
* Generates reports for consumption by Submit.
*
* Follows a Markdown-like style.
*/
@Service
public class SubmitAppReportGenerator extends GenericReportGenerator {
/**
* Creates a new Submit report generator.
*
* @param configurer the freemarker configurer
* @param reportAuthorizationFilter the report authorization filter
* @param userProvider the user provider to determine the current authorization level
*/
public SubmitAppReportGenerator(
final FreeMarkerConfigurer configurer,
final ReportAuthorizationFilter reportAuthorizationFilter,
final UserProvider userProvider
) {
super(configurer, reportAuthorizationFilter, userProvider);
}
/**
* Returns the template name.
*
* @return the template name
*/
@Override
public String getTemplateName() {
return "submit/submit-report.ftlh";
}
}
<#-- @ftlvariable name="error" type="String" -->
<#-- @ftlvariable name="tips" type="java.util.Map<String, java.util.List>" -->
<#-- @ftlvariable name="warnings" type="java.util.Map<String, java.util.List>" -->
<#-- @ftlvariable name="failures" type="java.util.Map<String, java.util.List>" -->
<#if error??>
## A server-side error occurred. Please show this message to your TA
${error}
<#else>
<#list tips as tip, entityNames>
## Tip
${tip}
This applies to:
<#list entityNames as entityName>
* ${entityName}
</#list>
</#list>
<#if failures?has_content>
## Failures
<#list failures as entityName, failureMessages>
<#if failureMessages?has_content>
### ${entityName}
<#list failureMessages as msg>
${msg}
</#list>
</#if>
</#list>
</#if>
<#if warnings?has_content>
## Warnings
<#list warnings as entityName, warningMessages>
<#if warningMessages?has_content>
### ${entityName}
<#list warningMessages as msg>
${msg}
</#list>
</#if>
</#list>
</#if>
<#if info?has_content>
## Info
<#list info as entityName, infoMessage>
<#if infoMessage?has_content>
### ${entityName}
<#list infoMessage as msg>
<#noautoesc>
#### ${msg}
</#noautoesc>
</#list>
</#if>
</#list>
</#if>
</#if>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment