wisdom-framework / wisdom

A modular and dynamic web framework
http://wisdom-framework.org
Apache License 2.0
88 stars 42 forks source link

Identify missing web resources during wisdom:run #247

Open Riduidel opened 10 years ago

Riduidel commented 10 years ago

When updating an HTML file, it would be of great help to have wisdom identify missing ressources, be them scripts or images.

Typically, I would like to have wisdom:run show me the missing assets in the console. Ideally, that error message would use data provided by #245 to show available ressources (or a subset of them if possible).

I guess it could be possible to do it using a wisdom Watcher, no ? (don't yet know how to do it, however)

cescoffier commented 10 years ago

Do you mean logging a message when the resource controller and the webjar controller (these two controllers are serving respectively the assets and the webjar resources) can't find the requested assets ?

To do this, no need for a watcher.

Riduidel commented 10 years ago

On 30/06/2014 19:01, Clement Escoffier wrote:

Do you mean logging a message when the resource controller and the webjar controller (these two controllers are serving respectively the assets and the webjar resources) can't find the requested assets ?

No. Well .... when thinking about it, it may be a yes. Let me rephrase it.

My issue was that I was writing an HTML page using angular.js script. And, dumb as I am, I was unable to locate it. So i tried libs/angular/angular.js and other paths, but none resulted into what I wanted. So I tried to see that issue fro the developper stand point, and told to myself "well, if I was in Eclipse, i would have an error marker for that". Which immediatly sent me into the watcher direction :

what I want is that, when I save an HTML page, contained links are (

If Wisdom is not able to compute one of these urls, a page explaining the error is displayed (see image)

org_thymeleaf_exceptions_templateprocessingexception_cannot_find_the_url_of_the_asset_js_bootstrap_min_js-missing__bundleentry___56_fwk394714818_templates_samples_samples_thl_html29 https://cloud.githubusercontent.com/assets/402301/3452785/24e290a8-01ba-11e4-8b5a-7a0a2a55ab8a.png

This means one should never use direct link, but rather always use that route resolution ... which, as far as I know, isn't documented :-) Yeah, i've just checked in main documentation, the "#routes.asset(...)" expression can't be found. Which obviously idnicates it's an easter egg, where it's precisely the kind of things that would make that link checker useless (provided it can be enforced ... which is another question).

Nicolas Delsaux

cescoffier commented 10 years ago

I've implemented this feature last night (despite the low issue number). Documentation is coming, just be patient ;-)

On 2 juil. 2014, at 14:09, Nicolas Delsaux notifications@github.com wrote:

On 02/07/2014 09:26, Clement Escoffier wrote:

Just for information, in #13 https://github.com/wisdom-framework/wisdom/issues/13 we have extended the |route| object injected in template to compute the url of assets as follows:

|<link th:href="${#routes.asset('css/bootstrap.min.css')}" rel="stylesheet"/> <link th:href="${#routes.asset('/css/bootstrap-theme.min.css')}" rel="stylesheet"/>

If Wisdom is not able to compute one of these urls, a page explaining the error is displayed (see image)

org_thymeleaf_exceptions_templateprocessingexception_cannot_find_the_url_of_the_asset_js_bootstrap_min_js-missing__bundleentry___56_fwk394714818_templates_samples_samples_thl_html29 < https://cloud.githubusercontent.com/assets/402301/3452785/24e290a8-01ba-11e4-8b5a-7a0a2a55ab8a.png

This means one should never use direct link, but rather always use that route resolution ... which, as far as I know, isn't documented :-) Yeah, i've just checked in main documentation, the "#routes.asset(...)" expression can't be found. Which obviously idnicates it's an easter egg, where it's precisely the kind of things that would make that link checker useless (provided it can be enforced ... which is another question).

Nicolas Delsaux

— Reply to this email directly or view it on GitHub https://github.com/wisdom-framework/wisdom/issues/247#issuecomment-47767878 .

cescoffier commented 10 years ago

I've made some documentation (in the master branch).