[GeoNetwork-devel] Wro module - files processed question

Hi

Does anybody know why wro module seem processing files outside of the web-uimodule? Otherwise can be removed?

https://github.com/geonetwork/core-geonetwork/blob/master/web/src/main/webapp/WEB-INF/wro-sources.xml#L28-L31

Let me explain my case. I have done a xlst formatter to display xml metadata in html page (I know there’s a Groovy formatter for that, but doesn’t work well as changes the metadata displayed, removing namespaces from the header and adding to the xml elements, what make it useless and trying to fix it is not really clear).

So I added the xsl formatter to my schema and copied also these files to my schema to use highlight syntax:

Now I get the following:

2019-02-20 08:48:34,168 ERROR [geonetwork.wro4j] - Error occurred during a wro4j request handling

java.lang.IllegalArgumentException: Both ‘/XXXXX/web/src/main/webapp/WEB-INF/data/data/formatter/xml_view/highlight-json-xml.js’ and ‘org.fao.geonet.wro4j.ClosureRequireDependencyManager$Node@anonymised.com’ have the same provide id: highlight-json-xml

For sure I can check to reference the js/css from original paths in WEB-INF/data/data/formatter/xml_view, but wanted to create a schema with all required files and don’t rely in external resources.

Regards,
Jose García

Vriendelijke groeten / Kind regards,

Jose García


Veenderweg 13
6721 WD Bennekom
The Netherlands
T: +31 (0)318 416664

Please consider the environment before printing this email.

Hi,

It seems wro checks the formatter dir for css and js.
Your error is just about the file names, what is .cess ? I ddon’t exactly know if we can have same name for css and js, i would say yes, but maybe just change one file name and it should be fine ?

highlight-json-xml-css.cess

Other options is to remove wro check of formatterdir.

···

camptocamp
INNOVATIVE SOLUTIONS
BY OPEN SOURCE EXPERTS

Florent Gravin
Front-end Technical Leader
+33 4 58 48 20 36

Hi Florent

Thanks for the quick response, my colleague Juan pointed me to this code https://github.com/geonetwork/core-geonetwork/blob/master/wro4j/src/main/java/org/fao/geonet/wro4j/ClosureRequireDependencyManager.java#L179-L187, that seem uses the file name as resource id if no goog.provide is found (instead of full path), what avoids having files with duplicated names.

Not really sure the reason to scan the schemas/formatter folders, but for now I managed to remove the files from the schema and just point to the global ones. Not optimal if the global files are removed in the future, but probably it’s unlikely and for now works fine.
Regards,
Jose García

···

Vriendelijke groeten / Kind regards,

Jose García


Veenderweg 13
6721 WD Bennekom
The Netherlands
T: +31 (0)318 416664

Please consider the environment before printing this email.