Hi! We would like to be able to set new colors in our gui at runtime, i.e. change the theme. We use less on component basis. To day we compile the less files to css at buildtime and these becom packacke resources.
Now we would like to change the colors by altering the appropriate less-variables. We want to set the colors (just values as - themeColor = #000000) in our legacy application. Our web app lives in another servletcontainer than the legacy applicaton, so one apporach is to fetch the new colors by REST (for example check for new colors once a minute) and get them as json in our wicket-web-app. Now we're thinking of using dynamic resources. i.e. do not compile the less-files at build-time, instead generate css-files fom the less files (hooking in a less-preprocessor) per component at runtime when requested. We don't want to generate the css-resource and send it to the client if it's already cached in browser and not updated on server. We don't want to generate the css if it has already been done for the component and new colors hasn't been set, i.e once a dynamic resource is generated, a cached version should be given as response for all clients that request the component. Now the question is if the right way to do this is by implementing a dynamic resource by extending AbstractResource and to cache the css (output a css-file on disk?, cache in application?) when once generated? Any drawbacks? Performance issues? Is there a better way to do it? Cheers Lasse
