on 2018 Feb 24 1:57 PM
Hi experts,
We have an issue with Backoffice not reading the js-libraries.xml. We have an angular widget and built as explained in AngularJS in Backoffice Framework
The result of not loading the js-libraries.xml is that it shows an error message in the Backoffice:
AngularCNG is not defined and the built functionality does not work.
If we use the configuration property:
backoffice.cockpitng.additionalResourceLoader.enabled as true, it works, but, from the project.properties in backoffice:
if set true, widget resources and zul files are reloaded from the extension folder on page reload
(convenient for developing, should be set to false on a production system)
backoffice.cockpitng.additionalResourceLoader.enabled=false
From what we have investigated, it could be that WidgetJarResourceReader is not reading the entry in the jar file correctly. In WidgetJarResourceReader::hasResource looks for cng/js/js-libraries.xml and finds nothing, but the file exists in cockpitng/cng/js/js-libraries.xml
The rest of loaders are:
BackofficeResourceLoader (disabled through the property)
SassResourceLoader (only intended for css files)
WidgetClassPathResourceLoader (always returns false on hasResource)
The example Creating an AngularJS Widget does not work if the property before mentioned is enabled.
Is this a bug in the platform or something we would need to change?
Thanks for your help.
Request clarification before answering.
We made it to support!
And there is a workaround:
<macrodef name="YOUREXTENSION_before_compile_backoffice">
<sequential>
<if>
<available file="${ext.YOUREXTENSION.path}/backoffice/resources/cng/js/js-libraries.xml" />
<then>
<mkdir dir="${ext.YOUREXTENSION.path}/backoffice/classes/cng/js" />
<copy todir="${ext.YOUREXTENSION.path}/backoffice/classes/cng/js">
<fileset dir="${ext.YOUREXTENSION.path}/backoffice/resources/cng/js">
</fileset>
</copy>
</then>
</if>
</sequential>
</macrodef>
All the scripts that you add will need to be placed under cng/js folder
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.