Giter Site home page Giter Site logo

op-ted / eforms-notice-viewer Goto Github PK

View Code? Open in Web Editor NEW
10.0 5.0 0.0 8.11 MB

This is a sample eForms application that can visualise an eForms notice. It uses efx-translator-java to generate XSL templates from notice view templates written in EFX. It then uses an XSLT processor to generate an HTML visualisation of any given eForms notice.

License: European Union Public License 1.2

Java 91.69% FreeMarker 8.31%
eforms sample-app

eforms-notice-viewer's People

Contributors

bertrand-lorentz avatar lgreulich avatar meletev avatar papacst avatar rouschr avatar rousso avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

eforms-notice-viewer's Issues

Available in Python?

Hello, I am using eForms XML data from Doffin API.
But May I know if therer is any way to convert that XML to HTML using Python?
Thank you.

Problem with the translation key

Description:

I encountered an issue with a translation key used in an XSL file. When the translation key contains a period (e.g. "code|name|selection-criterion.sui-act"), it does not work. However, it works if the translation key does not contain a period (e.g. "business-term|description|BG-1").

Found Solution:

I solved this issue by modifying the label_from_expression.ftl file.

Here’s what I changed:

Before:

<xsl:variable name="label${labelSuffix}" select="."/>

After:

<xsl:variable name="label${labelSuffix}" select="normalize-space(.)"/>

add params to the command line for choosing the destination filename

actually the output file is generated in the directory build\output-html<NoticeSubTypeCode>.html

it is better if we could choose the destination filename like this
java -jar eforms-notice-viewer--app.jar -i summary en eforms-sdk/1.0/examples/notices/cn_24_minimal.xml -d d:\desttination\myfile.html

Handling restricted fields in viewer

We currently do not understand how this viewer would treat fields that are listed as restricted. We understand that restricted fields would be listed in BT-195. Does the viewer still display these fields like any other fields or does the viewer check if the duration of hiding these fields has passed and only then displays these fields? What other logic is applied here?

I already tried addressing this question to the TED helpdesk, they pointed me here.
Thanks in advance

Compilation failure in eforms-notice-viewer 0.10.0 due to missing dependency

Hi,

I'm encountering an issue while compiling the eForms Notice Viewer (0.10.0). The build process fails due to a missing dependency. Below is the detailed error log:

[INFO] Scanning for projects...
[INFO]
[INFO] -------------< eu.europa.ted.eforms:eforms-notice-viewer >--------------
[INFO] Building eForms Notice Viewer 0.10.0
[INFO] --------------------------------[ jar ]---------------------------------
Downloading from central: https://repo.maven.apache.org/maven2/eu/europa/ted/eforms/efx-toolkit-java/2.0.0-alpha.2/efx-toolkit-java-2.0.0-alpha.2.pom
[WARNING] The POM for eu.europa.ted.eforms:efx-toolkit-java:jar:2.0.0-alpha.2 is missing, no dependency information available
Downloading from central: https://repo.maven.apache.org/maven2/eu/europa/ted/eforms/efx-toolkit-java/2.0.0-alpha.2/efx-toolkit-java-2.0.0-alpha.2.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.863 s
[INFO] Finished at: 2023-12-11T17:15:20+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project eforms-notice-viewer: Could not resolve dependencies for project eu.europa.ted.eforms:eforms-notice-viewer:jar:0.10.0: Could not find artifact
eu.europa.ted.eforms:efx-toolkit-java:jar:2.0.0-alpha.2 in central (https://repo.maven.apache.org/maven2) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

It seems that the project is unable to find the required artifact eu.europa.ted.eforms:efx-toolkit-java:jar:2.0.0-alpha.2. I have checked Maven Central, and it appears that this particular version of the dependency is not available.

Thank you.

Problem generating HTML with multiple dates

Hello,

I'm encountering an issue when generating the HTML associated with this ContractAwardNotice using the following command:

java -jar .\target\eforms-notice-viewer-0.10.0-app.jar -f fr .\can.xml
<?xml version="1.0" encoding="UTF-8"?>
<ContractAwardNotice xmlns="urn:oasis:names:specification:ubl:schema:xsd:ContractAwardNotice-2"
                     xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
                     xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
                     xmlns:efac="http://data.europa.eu/p27/eforms-ubl-extension-aggregate-components/1"
                     xmlns:efbc="http://data.europa.eu/p27/eforms-ubl-extension-basic-components/1"
                     xmlns:efext="http://data.europa.eu/p27/eforms-ubl-extensions/1"
                     xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2"
                     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <ext:UBLExtensions>
        <ext:UBLExtension>
            <ext:ExtensionContent>
                <efext:EformsExtension>
                    <efac:NoticeResult>
                        <efac:LotResult>
                            <cbc:ID schemeName="result">RES-0001</cbc:ID>
                            <cbc:TenderResultCode listName="winner-selection-status">selec-w</cbc:TenderResultCode>
                            <efac:LotTender>
                                <cbc:ID>TEN-0001</cbc:ID>
                            </efac:LotTender>
                            <efac:SettledContract>
                                <cbc:ID>CON-0001</cbc:ID>
                            </efac:SettledContract>
                        </efac:LotResult>
                        <efac:LotTender>
                            <cbc:ID schemeName="tender">TEN-0001</cbc:ID>
                            <efac:TenderingParty>
                                <cbc:ID>TPA-0001</cbc:ID>
                            </efac:TenderingParty>
                            <efac:TenderReference>
                                <cbc:ID>5</cbc:ID>
                            </efac:TenderReference>
                        </efac:LotTender>
                        <efac:SettledContract>
                            <cbc:ID schemeName="contract">CON-0001</cbc:ID>
                            <cbc:AwardDate>2024-01-12+02:00</cbc:AwardDate>
                            <cbc:IssueDate>2024-01-29+02:00</cbc:IssueDate>
                            <efac:LotTender>
                                <cbc:ID>TEN-0001</cbc:ID>
                            </efac:LotTender>
                        </efac:SettledContract>
                        <efac:SettledContract>
                            <cbc:ID schemeName="contract">CON-0002</cbc:ID>
                            <cbc:AwardDate>2024-01-12+02:00</cbc:AwardDate>
                            <cbc:IssueDate>2024-01-29+02:00</cbc:IssueDate>
                            <efac:LotTender>
                                <cbc:ID>TEN-0001</cbc:ID>
                            </efac:LotTender>
                        </efac:SettledContract>
                        <efac:TenderingParty>
                            <cbc:ID schemeName="tendering-party">TPA-0001</cbc:ID>
                            <efac:Tenderer>
                                <cbc:ID>ORG</cbc:ID>
                            </efac:Tenderer>
                        </efac:TenderingParty>
                    </efac:NoticeResult>
                    <efac:NoticeSubType>
                        <cbc:SubTypeCode listName="notice-subtype">29</cbc:SubTypeCode>
                    </efac:NoticeSubType>
                    <efac:Organizations>
                        <efac:Organization>
                            <efac:Company>
                                <cac:PartyIdentification>
                                    <cbc:ID schemeName="organization">ORG</cbc:ID>
                                </cac:PartyIdentification>
                                <cac:PartyName>
                                    <cbc:Name languageID="FRA">XXX</cbc:Name>
                                </cac:PartyName>
                            </efac:Company>
                        </efac:Organization>
                    </efac:Organizations>
                </efext:EformsExtension>
            </ext:ExtensionContent>
        </ext:UBLExtension>
    </ext:UBLExtensions>
    <cbc:CustomizationID>eforms-sdk-1.9</cbc:CustomizationID>
    <cbc:NoticeLanguageCode listName="language">FRA</cbc:NoticeLanguageCode>
</ContractAwardNotice>

I've tried to simplify the XML as much as possible to reproduce the bug. It seems the bug occurs when we have multiple dates at the same time:

<xsl:value-of separator=", " select="format-date(for $tender2 in ./normalize-space(text()) return ../../../efac:SettledContract/cbc:AwardDate[../efac:LotTender/cbc:ID/normalize-space(text()) = $tender2]/xs:date(text()), '[D01]/[M01]/[Y0001]')"/>

The error StackTrace:

18:07:03.584 [main] DEBUG e.e.t.e.v.generator.XslGenerator - Successfully created XSL for SDK version [1.9].
18:07:03.783 [main] DEBUG e.e.t.e.v.generator.HtmlGenerator - Writing HTML for view ID [29] to file [build\output-html\29-fr.html]
18:07:03.784 [main] DEBUG e.e.t.e.v.generator.HtmlGenerator - Creating XSL transformer factory
18:07:04.025 [main] DEBUG e.e.t.e.v.generator.HtmlGenerator - Successfully created XSL transformer factory
18:07:04.026 [main] DEBUG e.e.t.e.v.generator.HtmlGenerator - Creating XSL transformer for language [fr] and view ID [29]
18:07:06.481 [main] DEBUG e.e.t.e.v.generator.HtmlGenerator - Successfully created XSL transformer for language [fr] and view ID [29]
18:07:06.481 [main] DEBUG e.e.t.e.v.generator.HtmlGenerator - Applying XSL transformation for language [fr] and view ID [29]
18:07:07.633 [main] ERROR e.e.ted.eforms.viewer.Application - Error executing the application with arguments [[fr, .\24-12190_XML_EFORM.xml]]. Please see the logs.
18:07:07.635 [main] DEBUG e.e.ted.eforms.viewer.Application - Exception thrown:
net.sf.saxon.trans.XPathException: A sequence of more than one item is not allowed as the first argument of fn:format-date() (xs:date("2024-01-12+02:00"), xs:date("2024-01-12+02:00")) 
	at net.sf.saxon.expr.Expression.typeError(Expression.java:1477)
	at net.sf.saxon.expr.CardinalityChecker.evaluateItem(CardinalityChecker.java:296)
	at net.sf.saxon.expr.parser.Evaluator$OptionalItem.evaluate(Evaluator.java:201)
	at net.sf.saxon.expr.SystemFunctionCall.evaluateArguments(SystemFunctionCall.java:469)
	at net.sf.saxon.expr.FunctionCall.iterate(FunctionCall.java:560)
	at net.sf.saxon.expr.Expression.process(Expression.java:948)
	at net.sf.saxon.expr.SystemFunctionCall.process(SystemFunctionCall.java:496)
	at net.sf.saxon.expr.instruct.ValueOf.processLeavingTail(ValueOf.java:345)
	at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:755)
	at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:142)
	at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:357)
	at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:298)
	at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:755)
	at net.sf.saxon.expr.LetExpression.processLeavingTail(LetExpression.java:755)
	at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:755)
	at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:142)
	at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:357)
	at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:298)
	at net.sf.saxon.expr.instruct.NamedTemplate.expand(NamedTemplate.java:266)
	at net.sf.saxon.expr.instruct.CallTemplate.process(CallTemplate.java:384)
	at net.sf.saxon.expr.instruct.ForEach.lambda$processLeavingTail$0(ForEach.java:531)
	at net.sf.saxon.om.SequenceTool.supply(SequenceTool.java:147)
	at net.sf.saxon.expr.instruct.ForEach.processLeavingTail(ForEach.java:531)
	at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:755)
	at net.sf.saxon.expr.LetExpression.processLeavingTail(LetExpression.java:755)
	at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:755)
	at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:142)
	at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:357)
	at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:298)
	at net.sf.saxon.expr.instruct.NamedTemplate.expand(NamedTemplate.java:266)
	at net.sf.saxon.expr.instruct.CallTemplate.process(CallTemplate.java:384)
	at net.sf.saxon.expr.instruct.ForEach.lambda$processLeavingTail$0(ForEach.java:531)
	at net.sf.saxon.om.SequenceTool.supply(SequenceTool.java:147)
	at net.sf.saxon.expr.instruct.ForEach.processLeavingTail(ForEach.java:531)
	at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:755)
	at net.sf.saxon.expr.LetExpression.processLeavingTail(LetExpression.java:755)
	at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:755)
	at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:142)
	at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:357)
	at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:298)
	at net.sf.saxon.expr.instruct.NamedTemplate.expand(NamedTemplate.java:266)
	at net.sf.saxon.expr.instruct.CallTemplate.process(CallTemplate.java:384)
	at net.sf.saxon.expr.instruct.ForEach.lambda$processLeavingTail$0(ForEach.java:531)
	at net.sf.saxon.om.SequenceTool.supply(SequenceTool.java:147)
	at net.sf.saxon.expr.instruct.ForEach.processLeavingTail(ForEach.java:531)
	at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:755)
	at net.sf.saxon.expr.LetExpression.processLeavingTail(LetExpression.java:755)
	at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:755)
	at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:142)
	at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:357)
	at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:298)
	at net.sf.saxon.expr.instruct.NamedTemplate.expand(NamedTemplate.java:266)
	at net.sf.saxon.expr.instruct.CallTemplate.process(CallTemplate.java:384)
	at net.sf.saxon.expr.instruct.ForEach.lambda$processLeavingTail$0(ForEach.java:531)
	at net.sf.saxon.om.SequenceTool.supply(SequenceTool.java:147)
	at net.sf.saxon.expr.instruct.ForEach.processLeavingTail(ForEach.java:531)
	at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:755)
	at net.sf.saxon.expr.LetExpression.processLeavingTail(LetExpression.java:755)
	at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:755)
	at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:142)
	at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:357)
	at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:298)
	at net.sf.saxon.expr.instruct.NamedTemplate.expand(NamedTemplate.java:266)
	at net.sf.saxon.expr.instruct.CallTemplate.process(CallTemplate.java:384)
	at net.sf.saxon.expr.instruct.ForEach.lambda$processLeavingTail$0(ForEach.java:531)
	at net.sf.saxon.om.SequenceTool.supply(SequenceTool.java:147)
	at net.sf.saxon.expr.instruct.ForEach.processLeavingTail(ForEach.java:531)
	at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:755)
	at net.sf.saxon.expr.LetExpression.processLeavingTail(LetExpression.java:755)
	at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:755)
	at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:142)
	at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:357)
	at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:298)
	at net.sf.saxon.expr.instruct.NamedTemplate.expand(NamedTemplate.java:266)
	at net.sf.saxon.expr.instruct.CallTemplate.process(CallTemplate.java:384)
	at net.sf.saxon.expr.instruct.ForEach.lambda$processLeavingTail$0(ForEach.java:531)
	at net.sf.saxon.om.SequenceTool.supply(SequenceTool.java:147)
	at net.sf.saxon.expr.instruct.ForEach.processLeavingTail(ForEach.java:531)
	at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:755)
	at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:142)
	at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:357)
	at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:298)
	at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:755)
	at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:142)
	at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:357)
	at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:298)
	at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:392)
	at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:551)
	at net.sf.saxon.trans.XsltController.applyTemplates(XsltController.java:685)
	at net.sf.saxon.s9api.AbstractXsltTransformer.applyTemplatesToSource(AbstractXsltTransformer.java:421)
	at net.sf.saxon.s9api.XsltTransformer.transform(XsltTransformer.java:353)
	at net.sf.saxon.jaxp.TransformerImpl.transform(TransformerImpl.java:75)
	at eu.europa.ted.eforms.viewer.generator.HtmlGenerator.applyXslTransformation(HtmlGenerator.java:212)
	at eu.europa.ted.eforms.viewer.generator.HtmlGenerator.generateFile(HtmlGenerator.java:109)
	at eu.europa.ted.eforms.viewer.NoticeViewer.generateHtmlFile(NoticeViewer.java:131)
	at eu.europa.ted.eforms.viewer.NoticeViewer.generateHtmlFile(NoticeViewer.java:103)
	at eu.europa.ted.eforms.viewer.cli.CliCommand.call(CliCommand.java:113)
	at eu.europa.ted.eforms.viewer.cli.CliCommand.call(CliCommand.java:37)
	at picocli.CommandLine.executeUserObject(CommandLine.java:1953)
	at picocli.CommandLine.access$1300(CommandLine.java:145)
	at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2358)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2352)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2314)
	at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
	at picocli.CommandLine$RunLast.execute(CommandLine.java:2316)
	at picocli.CommandLine.execute(CommandLine.java:2078)
	at eu.europa.ted.eforms.viewer.Application.main(Application.java:35)

I also tested with the API from https://viewer.preview.ted.europa.eu/api/v2/notices/render and I have the same problem, the HTML is incomplete, although the API returns a 200.

Thanks in advance.

install error

i have these jars
./.m2/repository/eu/europa/ted/eforms/eforms-sdk/0.6.0/eforms-sdk-0.6.0.jar
./.m2/repository/eu/europa/ted/eforms/efx-toolkit-java/0.1.0/efx-toolkit-java-0.1.0.jar

and get this error when running
mvn install clean

[INFO] Scanning for projects...
[INFO]
[INFO] -------------< eu.europa.ted.eforms:eforms-notice-viewer >--------------
[INFO] Building eForms Notice Viewer 0.1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[WARNING] The POM for eu.europa.ted.eforms:efx-toolkit-java:jar:0.1.0-SNAPSHOT is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.546 s
[INFO] Finished at: 2022-05-18T11:57:10+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project eforms-notice-viewer: Could not resolve dependencies for project eu.europa.ted.eforms:eforms-notice-viewer:jar:0.1.0-SNAPSHOT: eu.europa.ted.eforms:efx-toolkit-java:jar:0.1.0-SNAPSHOT was not found in https://public:[email protected]/OP-TED/* during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of github-public has elapsed or updates are forced -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

Error in eforms-notice-viewer when processing xml File

Hi @rousso,

I encountered an issue with the eforms-notice-viewer.

After compiling, I executed the jar with the following command: java -jar .\target\eforms-notice-viewer-0.10.0-SNAPSHOT-app.jar fr .\pin-cfc-social_25.xml.

This problem is not only present with the pin-cfc-social_25.xml but also occurs with multiple files in the examples/notices directory.

I got an error in the logs :

Error at char 61 in expression in xsl:value-of/@select on line 3605 column 287 FORG0001 The string "Informations de base sur lÆ[x2019]avi..." cannot be cast to a boolean at template block0401150505 on line 3596 column 42 invoked by xsl:call-template at #3500 at template block04011505 on line 3479 column 40 invoked by xsl:for-each at #3499 at template block04011505 on line 3479 column 40 invoked by xsl:call-template at #3040 at template block040115 on line 3021 column 38 invoked by xsl:for-each at #3039 at template block040115 on line 3021 column 38 invoked by xsl:call-template at #1451 at template block0401 on line 1396 column 36 invoked by xsl:for-each at #1450 at template block0401 on line 1396 column 36 invoked by xsl:call-template at #1392 at template block04 on line 1385 column 34 invoked by xsl:for-each at #1391 at template block04 on line 1385 column 34 invoked by xsl:call-template at #148 invoked by xsl:for-each at #147 In template rule with match="/" on line 132 of Error executing the application with arguments [[fr, .\pin-cfc-social_25.xml]].

This error seems to occur during the XSLT transformation process. Any guidance or fixes for this issue would be greatly appreciated.

NoticeViewer0.8.0 can't download https://repo.maven.apache.org/maven2/eu/europa/ted/eforms/eforms-sdk/1.7.0-SNAPSHOT/eforms-sdk-1.7.0-SNAPSHOT.jar

Hi there,

notice viewer 0.8.0 can't download eforms-sdk-1.7.0-SNAPSHOT.jar from the following URL:
https://repo.maven.apache.org/maven2/eu/europa/ted/eforms/eforms-sdk/1.7.0-SNAPSHOT/eforms-sdk-1.7.0-SNAPSHOT.jar

I tried to render a notice example from eFoms SDK 1.7.0

Here are the lines copied from the logs:

14:59:08.119 [main] DEBUG e.e.t.m.l.ConsoleRepositoryListener - Resolved metadata eu.europa.ted.eforms:eforms-sdk:1.7.0-SNAPSHOT/maven-metadata.xml from central (https://repo.maven.apache.org/maven2/, default, releases+snapshots)
14:59:08.122 [main] DEBUG e.e.t.m.l.ConsoleRepositoryListener - Downloading artifact eu.europa.ted.eforms:eforms-sdk:jar:1.7.0-SNAPSHOT from central (https://repo.maven.apache.org/maven2/, default, releases+snapshots)
14:59:08.122 [main] DEBUG e.e.t.m.l.ConsoleTransferListener - Downloading: https://repo.maven.apache.org/maven2/eu/europa/ted/eforms/eforms-sdk/1.7.0-SNAPSHOT/eforms-sdk-1.7.0-SNAPSHOT.jar
14:59:08.147 [main] DEBUG e.e.t.m.l.ConsoleTransferListener -

14:59:08.149 [main] DEBUG e.e.t.m.l.ConsoleTransferListener - Transfer failed.
org.eclipse.aether.transfer.ArtifactNotFoundException: Could not find artifact eu.europa.ted.eforms:eforms-sdk:jar:1.7.0-SNAPSHOT in central (https://repo.maven.apache.org/maven2/)

Thanks for your help

Michael

Validation of SDK example notices fails with this notice viewer

Hi there,

I understand that this is not supposed to be a production-ready application.
Nevertheless I was hoping that I could use it purely for the validation of eForms documents that I want to put into or get out of an application that I am currently preparing to test.
Unfortunately, even when trying the notice viewer with examples taken from the current 0.7.0 eForms SDK I get errors for most of the example eForms notices (the ones which are NOT marked as INVALID):

09:01:59.562 [main] INFO e.e.ted.eforms.viewer.NoticeViewer - noticeXmlPath=examples\notices\cn_25.xml 09:01:59.572 [main] INFO e.e.ted.eforms.viewer.NoticeViewer - noticeSubType=17, viewId=17, eformsSdkVersion=0.7 09:01:59.806 [main] INFO e.e.t.eforms.sdk.helpers.MapFromJson - Populating maps for context, jsonPath=C:\working\eforms-notice-viewer\eforms-sdk\0.7\fields\fields.json 09:01:59.964 [main] INFO e.e.t.eforms.sdk.helpers.MapFromJson - Populating maps for context, jsonPath=C:\working\eforms-notice-viewer\eforms-sdk\0.7\fields\fields.json org.antlr.v4.runtime.misc.ParseCancellationException: line 151:32 mismatched input 'OR' expecting {'[', EndExpression} at eu.europa.ted.efx.exceptions.ThrowingErrorListener.syntaxError(ThrowingErrorListener.java:17) at org.antlr.v4.runtime.ProxyErrorListener.syntaxError(ProxyErrorListener.java:41) at org.antlr.v4.runtime.Parser.notifyErrorListeners(Parser.java:544) at org.antlr.v4.runtime.DefaultErrorStrategy.reportInputMismatch(DefaultErrorStrategy.java:327) at org.antlr.v4.runtime.DefaultErrorStrategy.reportError(DefaultErrorStrategy.java:139) at eu.europa.ted.efx.sdk0.v7.EfxParser.contextDeclarationBlock(EfxParser.java:1311) at eu.europa.ted.efx.sdk0.v7.EfxParser.templateLine(EfxParser.java:361) at eu.europa.ted.efx.sdk0.v7.EfxParser.templateFile(EfxParser.java:287) at eu.europa.ted.efx.sdk0.v7.EfxTemplateTranslator07.renderTemplate(EfxTemplateTranslator07.java:152) at eu.europa.ted.efx.sdk0.v7.EfxTemplateTranslator07.renderTemplate(EfxTemplateTranslator07.java:136) at eu.europa.ted.efx.EfxTranslator.translateTemplate(EfxTranslator.java:50) at eu.europa.ted.eforms.viewer.NoticeViewer.buildXsl(NoticeViewer.java:253) at eu.europa.ted.eforms.viewer.NoticeViewer.generateHtml(NoticeViewer.java:88) at eu.europa.ted.eforms.viewer.CliCommand.call(CliCommand.java:63) at eu.europa.ted.eforms.viewer.CliCommand.call(CliCommand.java:1) at picocli.CommandLine.executeUserObject(CommandLine.java:1953) at picocli.CommandLine.access$1300(CommandLine.java:145) at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2358) at picocli.CommandLine$RunLast.handle(CommandLine.java:2352) at picocli.CommandLine$RunLast.handle(CommandLine.java:2314) at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179) at picocli.CommandLine$RunLast.execute(CommandLine.java:2316) at picocli.CommandLine.execute(CommandLine.java:2078) at eu.europa.ted.eforms.viewer.Application.main(Application.java:10)

Is this to be expected right now or am I totally missing the point of what this notice viewer should be able to do?

running eforms-notice-viewer-0.8.0-SNAPSHOT-app.jar thows error

After downloading sdk1.7.0 is now working, another error is thrown running java -jar D:\eForms-SDK\eforms-notice-viewer-develop\target\eforms-notice-viewer-0.8.0-SNAPSHOT-app.jar de cn23.xml

The cn23.xml file is copied from downloaded eforms-sdk\1.7\examples\notices directory.
the output is:
Error at char 19 in expression in xsl:variable/@select on line 7 column 257
FODC0005 URIs using protocol file are not permitted
at variable labels on line 7 column 257
invoked by global variable labels at #7
at template block01 on line 162 column 34
invoked by xsl:call-template at #139
invoked by xsl:for-each at #138
In template rule with match="/" on line 132 of
Error executing the application with arguments [[de, cn_23.xml]]. Please see the logs.

Log file is attatched.

eforms-notice-viewer.log

ParseCancellationException

hello

when i run

mvn compile exec:java -Dexec.mainClass="eu.europa.ted.eforms.viewer.Application" -Dexec.args="en ./eforms-sdk/0.6/examples/notices/cn_24_open.xml"

i get this errror:

[INFO] Scanning for projects...
[INFO]
[INFO] -------------< eu.europa.ted.eforms:eforms-notice-viewer >--------------
[INFO] Building eForms Notice Viewer 0.1.0
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:3.3.0:unpack (unpack-sdk) @ eforms-notice-viewer ---
[INFO] Configured Artifact: eu.europa.ted.eforms:eforms-sdk:0.6.2:jar
[INFO] eforms-sdk-0.6.2.jar already unpacked.
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ eforms-notice-viewer ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ eforms-notice-viewer ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- exec-maven-plugin:3.0.0:java (default-cli) @ eforms-notice-viewer ---
11:50:46,619 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
11:50:46,619 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [file:/home/stock/eforms-notice-viewer/target/classes/logback.xml]
11:50:46,715 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - Will scan for changes in [file:/home/stock/eforms-notice-viewer/target/classes/logback.xml]
11:50:46,715 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - Setting ReconfigureOnChangeTask scanning period to 30 seconds
11:50:46,718 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
11:50:46,720 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
11:50:46,723 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
11:50:46,740 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [net.sf.saxon.lib] to DEBUG
11:50:46,740 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to INFO
11:50:46,740 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
11:50:46,740 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
11:50:46,741 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@27860e7e - Registering current configuration as safe fallback point
11:50:46.742 [eu.europa.ted.eforms.viewer.Application.main()] INFO e.e.ted.eforms.viewer.Application - eForms Notice Viewer
11:50:46.743 [eu.europa.ted.eforms.viewer.Application.main()] INFO e.e.ted.eforms.viewer.Application - Usage: [] [SDK resources root folder]
11:50:46.743 [eu.europa.ted.eforms.viewer.Application.main()] INFO e.e.ted.eforms.viewer.Application - Example: en X02_registration.xml
11:50:46.743 [eu.europa.ted.eforms.viewer.Application.main()] INFO e.e.ted.eforms.viewer.Application - args=[en, ./eforms-sdk/0.6/examples/notices/cn_24_open.xml]
11:50:46.746 [eu.europa.ted.eforms.viewer.Application.main()] INFO e.e.ted.eforms.viewer.NoticeViewer - noticeXmlPath=./eforms-sdk/0.6/examples/notices/cn_24_open.xml
11:50:46.776 [eu.europa.ted.eforms.viewer.Application.main()] INFO e.e.ted.eforms.viewer.NoticeViewer - noticeSubType=16, viewId=16, eformsSdkVersion=eforms-sdk-0.6
11:50:46.842 [eu.europa.ted.eforms.viewer.Application.main()] INFO e.e.t.e.viewer.helpers.MapFromJson - Populating maps for context, sdkVersion=eforms-sdk-0.6, jsonPathname=/home/stock/eforms-notice-viewer/eforms-sdk/0.6/fields/fields.json
11:50:47.040 [eu.europa.ted.eforms.viewer.Application.main()] INFO e.e.t.e.viewer.helpers.MapFromJson - Populating maps for context, sdkVersion=eforms-sdk-0.6, jsonPathname=/home/stock/eforms-notice-viewer/eforms-sdk/0.6/fields/fields.json
[WARNING]
org.antlr.v4.runtime.misc.ParseCancellationException: line 24:27 mismatched input 'value' expecting {ShorthandContextFieldValueReference, StartExpression, CodelistAssetId, OtherAssetId, BtId, FieldId}
at eu.europa.ted.efx.exceptions.ThrowingErrorListener.syntaxError (ThrowingErrorListener.java:17)
at org.antlr.v4.runtime.ProxyErrorListener.syntaxError (ProxyErrorListener.java:41)
at org.antlr.v4.runtime.Parser.notifyErrorListeners (Parser.java:544)
at org.antlr.v4.runtime.DefaultErrorStrategy.reportInputMismatch (DefaultErrorStrategy.java:327)
at org.antlr.v4.runtime.DefaultErrorStrategy.reportError (DefaultErrorStrategy.java:139)
at eu.europa.ted.efx.sdk0.v6.EfxParser.assetId (EfxParser.java:1100)
at eu.europa.ted.efx.sdk0.v6.EfxParser.labelBlock (EfxParser.java:835)
at eu.europa.ted.efx.sdk0.v6.EfxParser.templateFragment (EfxParser.java:494)
at eu.europa.ted.efx.sdk0.v6.EfxParser.template (EfxParser.java:384)
at eu.europa.ted.efx.sdk0.v6.EfxParser.templateLine (EfxParser.java:343)
at eu.europa.ted.efx.sdk0.v6.EfxParser.templateFile (EfxParser.java:267)
at eu.europa.ted.efx.sdk0.v6.EfxTemplateTranslator.renderTemplate (EfxTemplateTranslator.java:144)
at eu.europa.ted.efx.sdk0.v6.EfxTemplateTranslator.renderTemplate (EfxTemplateTranslator.java:111)
at eu.europa.ted.efx.EfxTranslator.translateTemplate (EfxTranslator.java:33)
at eu.europa.ted.eforms.viewer.NoticeViewer.buildXsl (NoticeViewer.java:172)
at eu.europa.ted.eforms.viewer.NoticeViewer.generateHtml (NoticeViewer.java:91)
at eu.europa.ted.eforms.viewer.Application.main (Application.java:58)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:254)
at java.lang.Thread.run (Thread.java:829)

Notice viewer NPE since SDK dependency

Caused by: java.lang.NullPointerException: Cannot invoke "java.net.URL.toURI()" because the return value of "java.lang.ClassLoader.getResource(String)" is null
    at eu.europa.ted.eforms.viewer.helpers.ResourceLoader.getResourceAsPath (ResourceLoader.java:26)
    at eu.europa.ted.eforms.viewer.NoticeViewer.getNoticeXmlPath (NoticeViewer.java:211)
    at eu.europa.ted.eforms.viewer.NoticeViewer.generateHtml (NoticeViewer.java:54)
    at eu.europa.ted.eforms.viewer.Application.main (Application.java:48)

getResourceAsPath cannot work since the path is not to be found unless we expand the jar at root level.
To be discussed.
I also think the pom.xml should use the latest efx-toolkit-java 0.1.1-SNAPSHOT instead of 0.1.0-SNAPSHOT (to be discussed aswell).

why is it slow to generate xsl file ? - can i bypass if it is already created

Hello,

To generate xml to html, it's very long. about 1 min.
I saw in log file that the creation of .xsl file take the most of the time.

My question : How can i do to make it quicker ?
If 1.xsl or 19.xsl or ...xsl is already created, can i use the old instead of creating another each time i want to view an xml in html ?

Thank you for your answer,

Didier

increase performance

To convert xml to html (with the sdk that is already download) the notice viewer take about 5 secondes.
if we use the ted europa online API it is faster. 1-2 secondes
how can we increase performance of conversion in local env with eforms-notice-viewer project ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.