Thanks guys! I think that Sébastien's 3) will do it. I'll test it and tell
you more.

Regards,

Pierre


On Fri, Jul 20, 2012 at 10:18 AM, Sébastien Gautrin <sgaut...@telemetris.com
> wrote:

> Hi,
>
> In your case, the general idea would be to create a ResourceReference to
> your downloaded css & js files, and then on your base page to contribute
> them dynamically with
>
>     @Override
>     public void renderHead(IHeaderResponse response) {
>         ResourceReference jsRef = [...]
>         ResourceReference cssRef = [...]
>         response.**renderJavaScriptReference(**jsRef);
>         response.renderCSSReference(**cssRef);
>     }
>
> Now for creating the ResourceReference for your files, there's several
> options depending on what you want to do:
> - if you want to refer directly to the external css/js, just do response.*
> *renderJavaScriptReference("htt**p://example.com/jsfile.js<http://example.com/jsfile.js>");
> I wouldn't do that unless the other site is a site you control and want to
> use as a CDN
> - you could load the data from the db: http://wicketinaction.com/**
> 2011/07/wicket-1-5-mounting-**resources/<http://wicketinaction.com/2011/07/wicket-1-5-mounting-resources/>gives
>  an example for images, wouldn't be much different with a file
> - you could save the downloaded files in a specific directory, mount that
> directory as a sharedresourcereference, and serve the files that way: see
> http://stackoverflow.com/a/**9232848 <http://stackoverflow.com/a/9232848>for 
> more information
>
> There's probably other ways (better maybe) though.
>
>
>
> Pierre Goupil wrote:
>
>> Good evening,
>>
>> I'd like to contribute CSSs & JSs to my <head> for which names I don't
>> know. More precisely, I'd like to be able to download a .zip, unzip it and
>> contribute its CSS & JS content to the <head>, plus being able to display
>> the images of the zip thanks to the links in the CSS.
>>
>> Regarding the downloading and unzipping steps, it's easy. But for the
>> header contributions, I can't figure out how to do that since :
>>
>> 1) I don't know the names of the CSS & JS files before download
>>
>> 2) the CSS files link to the images using their regular names, but Wicket
>> appends characters of its own to their names.
>>
>> What I'm trying to achieve is to be able to switch (at run-time) my app's
>> theme by downloading a new one on a themes website, like
>> http://www.freecsstemplates.**org/ <http://www.freecsstemplates.org/>
>>
>> I use Wicket 1.5.7 but a solution for Wicket 6.0 is OK as well.
>>
>> Any help will be much appreciated.
>>
>> Regards,
>>
>> Pierre Goupil
>>
>>
>>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: 
> users-unsubscribe@wicket.**apache.org<users-unsubscr...@wicket.apache.org>
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
Le bonheur n'est pas une destination, mais une façon de voyager.

Papa d'une petite Lou-Ann depuis le 30 juin.

Reply via email to