mirror of
https://github.com/itplr-kosit/validator.git
synced 2026-05-25 16:55:39 +00:00
#28 Add CreateReportInput to result in API
This commit is contained in:
parent
c8b81b78ea
commit
e83b316d95
4 changed files with 19 additions and 8 deletions
|
|
@ -5,6 +5,8 @@ import java.util.List;
|
|||
import org.oclc.purl.dsdl.svrl.SchematronOutput;
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
import de.kosit.validationtool.model.reportInput.CreateReportInput;
|
||||
|
||||
import net.sf.saxon.s9api.XdmNode;
|
||||
|
||||
/**
|
||||
|
|
@ -12,9 +14,15 @@ import net.sf.saxon.s9api.XdmNode;
|
|||
*
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
|
||||
public interface Result {
|
||||
|
||||
/**
|
||||
* Gibt die vom Validator erstelle interne Berichts-'Vorstufe' als Objekt zurück.
|
||||
*
|
||||
* @return die Berichts-'Vorstufe'
|
||||
*/
|
||||
CreateReportInput getReportInput();
|
||||
|
||||
/** Der generierte Report. */
|
||||
XdmNode getReport();
|
||||
|
||||
|
|
|
|||
|
|
@ -91,8 +91,7 @@ public class DefaultCheck implements Check {
|
|||
this.checkSteps.add(new SchemaValidationAction());
|
||||
this.checkSteps.add(new SchematronValidationAction(configuration.getScenarioRepository(), this.conversionService));
|
||||
this.checkSteps.add(new ValidateReportInputAction(this.conversionService, this.contentRepository.getReportInputSchema()));
|
||||
this.checkSteps
|
||||
.add(new CreateReportAction(processor, this.conversionService, this.repository, configuration.getScenarioRepository()));
|
||||
this.checkSteps.add(new CreateReportAction(processor, this.conversionService, configuration.getScenarioRepository()));
|
||||
this.checkSteps.add(new ComputeAcceptanceAction());
|
||||
}
|
||||
|
||||
|
|
@ -135,6 +134,7 @@ public class DefaultCheck implements Check {
|
|||
|
||||
private Result createResult(final Bag t) {
|
||||
final DefaultResult result = new DefaultResult(t.getReport(), t.getAcceptStatus(), this.contentRepository);
|
||||
result.setReportInput(t.getReportInput());
|
||||
if (t.getSchemaValidationResult() != null) {
|
||||
result.setSchemaViolations(convertErrors(t.getSchemaValidationResult().getErrors()));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ import lombok.Setter;
|
|||
import de.kosit.validationtool.api.AcceptRecommendation;
|
||||
import de.kosit.validationtool.api.Result;
|
||||
import de.kosit.validationtool.api.XmlError;
|
||||
import de.kosit.validationtool.model.reportInput.CreateReportInput;
|
||||
|
||||
import net.sf.saxon.dom.NodeOverNodeInfo;
|
||||
import net.sf.saxon.s9api.SaxonApiException;
|
||||
|
|
@ -23,15 +24,20 @@ import net.sf.saxon.s9api.Serializer;
|
|||
import net.sf.saxon.s9api.XdmNode;
|
||||
|
||||
/**
|
||||
* Das Default-{@link Result} für die Rückgabe in der API
|
||||
*
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
|
||||
public class DefaultResult implements Result {
|
||||
|
||||
/** Der generierte Report. */
|
||||
@Getter
|
||||
private final XdmNode report;
|
||||
|
||||
@Getter
|
||||
@Setter(AccessLevel.PACKAGE)
|
||||
private CreateReportInput reportInput;
|
||||
|
||||
/** Das evaluierte Ergebnis. */
|
||||
@Getter
|
||||
private final AcceptRecommendation acceptRecommendation;
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ import net.sf.saxon.s9api.XsltTransformer;
|
|||
|
||||
/**
|
||||
* Erzeugt den Report auf Basis der gesammelten Informationen über den Prüfling. Sollte kein Szenario identifiziert
|
||||
* worden sein, so wird ein {@link ScenarioRepository#getNoScenarioReport() default report} erzeugt.
|
||||
* worden sein, so wird ein {@link ScenarioRepository#getFallbackScenario()} () default report} erzeugt.
|
||||
*
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
|
|
@ -57,8 +57,6 @@ public class CreateReportAction implements CheckAction {
|
|||
|
||||
private final ConversionService conversionService;
|
||||
|
||||
private final ScenarioRepository repository;
|
||||
|
||||
private final URI contentRepository;
|
||||
|
||||
private static XsltExecutable loadFromScenario(final ScenarioType object) {
|
||||
|
|
@ -98,5 +96,4 @@ public class CreateReportAction implements CheckAction {
|
|||
return loadFromScenario(scenario.getObject());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue