mirror of
https://github.com/itplr-kosit/validator.git
synced 2026-05-25 16:55:39 +00:00
Merge branch '28-return-createreportinput-as-part-of-the-result-objekt-api' into 'master'
Resolve "Return 'CreateReportInput' as part of the Result-Objekt (API)" See merge request kosit/validator!15
This commit is contained in:
commit
3bc715ae85
4 changed files with 11 additions and 8 deletions
|
|
@ -12,7 +12,6 @@ import net.sf.saxon.s9api.XdmNode;
|
|||
*
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
|
||||
public interface Result {
|
||||
|
||||
/** Der generierte Report. */
|
||||
|
|
|
|||
|
|
@ -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,21 @@ 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;
|
||||
|
||||
/** Die vom Validator erstelle interne Berichts-'Vorstufe' */
|
||||
@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