Re: [5.4B1] StyleSheet/Stack Bug?
That worked perfectly, Chris. Thanks! mrg On Thu, Mar 20, 2014 at 8:19 AM, Chris Poulsen wrote: > We do something like this for our T5.4 stack: > > @Inject > @Path( "classpath:META-INF/assets/css/font-awesome.css" ) > private Asset fontAwesomeStylesheet; > > ... > > public List getStylesheets() > { > List stylesheetLinks = new > ArrayList(); > > stylesheetLinks.add( new StylesheetLink( fontAwesomeStylesheet ) ); > ... > > HTH > > -- > Chris > > > > On Thu, Mar 20, 2014 at 12:26 PM, Michael Gentry >wrote: > > > I tried with getClasspathAsset() and 5.4B3, neither of which found the > CSS > > under src/main/resources. Is this a bug or should I just move the CSS to > > src/main/webapp? > > > > Thanks, > > > > mrg > > > > > > > > On Wed, Mar 19, 2014 at 6:49 PM, Michael Gentry > >wrote: > > > > > On Wed, Mar 19, 2014 at 5:56 PM, Thiago H de Paula Figueiredo < > > > thiag...@gmail.com> wrote: > > > > > >> On Wed, 19 Mar 2014 18:23:48 -0300, Michael Gentry < > > mgen...@masslight.net> > > >> wrote: > > >> > > >> Hi! > > >> > > >> Have you tried 5.4-beta-3? If not, please do it. > > >> > > > > > > Hi Thiago! > > > > > > I haven't tried 5.4B3 yet because I have to bootleg the JARs into work, > > > which is a hassle, but I can attempt to do so. (Part of what I'm doing > > > with 5.4 is evaluating how difficult it'll be to migrate our large 5.3 > > code > > > base in the future.) > > > > > > > > > * public List getStylesheets() { > > List > > >>> > > >>> stylesheets = new ArrayList();stylesheets.add(new > > >>> StylesheetLink(assetSource.getContextAsset("datatables/ > > >>> css/dataTables.bootstrap.css", > > >>> null))); return stylesheets; }* > > >>> > > >> > > >> There you are getting an asset from the context (getContextAsset()), > > >> while in the @Import you're getting it from the classpath. Try > > >> getClasspathAsset() instead > > > > > > > > > I'll try getClasspathAsset() tomorrow. I used getContextAsset() > because > > > that's what we used in 5.3 and that's what the documentation mentions > at > > > the bottom of https://tapestry.apache.org/javascript.html. I thought > > the > > > general direction in 5.4 was to put CSS/JS/Modules under > > > src/main/resourcesMETA-INF instead of src/main/webapp and since @Import > > > worked, I figured the Stack would do the same. > > > > > > Thanks again, > > > > > > mrg > > > > > > > > >
Re: [5.4B1] StyleSheet/Stack Bug?
We do something like this for our T5.4 stack: @Inject @Path( "classpath:META-INF/assets/css/font-awesome.css" ) private Asset fontAwesomeStylesheet; ... public List getStylesheets() { List stylesheetLinks = new ArrayList(); stylesheetLinks.add( new StylesheetLink( fontAwesomeStylesheet ) ); ... HTH -- Chris On Thu, Mar 20, 2014 at 12:26 PM, Michael Gentry wrote: > I tried with getClasspathAsset() and 5.4B3, neither of which found the CSS > under src/main/resources. Is this a bug or should I just move the CSS to > src/main/webapp? > > Thanks, > > mrg > > > > On Wed, Mar 19, 2014 at 6:49 PM, Michael Gentry >wrote: > > > On Wed, Mar 19, 2014 at 5:56 PM, Thiago H de Paula Figueiredo < > > thiag...@gmail.com> wrote: > > > >> On Wed, 19 Mar 2014 18:23:48 -0300, Michael Gentry < > mgen...@masslight.net> > >> wrote: > >> > >> Hi! > >> > >> Have you tried 5.4-beta-3? If not, please do it. > >> > > > > Hi Thiago! > > > > I haven't tried 5.4B3 yet because I have to bootleg the JARs into work, > > which is a hassle, but I can attempt to do so. (Part of what I'm doing > > with 5.4 is evaluating how difficult it'll be to migrate our large 5.3 > code > > base in the future.) > > > > > > * public List getStylesheets() { > List > >>> > >>> stylesheets = new ArrayList();stylesheets.add(new > >>> StylesheetLink(assetSource.getContextAsset("datatables/ > >>> css/dataTables.bootstrap.css", > >>> null))); return stylesheets; }* > >>> > >> > >> There you are getting an asset from the context (getContextAsset()), > >> while in the @Import you're getting it from the classpath. Try > >> getClasspathAsset() instead > > > > > > I'll try getClasspathAsset() tomorrow. I used getContextAsset() because > > that's what we used in 5.3 and that's what the documentation mentions at > > the bottom of https://tapestry.apache.org/javascript.html. I thought > the > > general direction in 5.4 was to put CSS/JS/Modules under > > src/main/resourcesMETA-INF instead of src/main/webapp and since @Import > > worked, I figured the Stack would do the same. > > > > Thanks again, > > > > mrg > > > > >
Re: [5.4B1] StyleSheet/Stack Bug?
I tried with getClasspathAsset() and 5.4B3, neither of which found the CSS under src/main/resources. Is this a bug or should I just move the CSS to src/main/webapp? Thanks, mrg On Wed, Mar 19, 2014 at 6:49 PM, Michael Gentry wrote: > On Wed, Mar 19, 2014 at 5:56 PM, Thiago H de Paula Figueiredo < > thiag...@gmail.com> wrote: > >> On Wed, 19 Mar 2014 18:23:48 -0300, Michael Gentry >> wrote: >> >> Hi! >> >> Have you tried 5.4-beta-3? If not, please do it. >> > > Hi Thiago! > > I haven't tried 5.4B3 yet because I have to bootleg the JARs into work, > which is a hassle, but I can attempt to do so. (Part of what I'm doing > with 5.4 is evaluating how difficult it'll be to migrate our large 5.3 code > base in the future.) > > > * public List getStylesheets() {List >>> >>> stylesheets = new ArrayList();stylesheets.add(new >>> StylesheetLink(assetSource.getContextAsset("datatables/ >>> css/dataTables.bootstrap.css", >>> null))); return stylesheets; }* >>> >> >> There you are getting an asset from the context (getContextAsset()), >> while in the @Import you're getting it from the classpath. Try >> getClasspathAsset() instead > > > I'll try getClasspathAsset() tomorrow. I used getContextAsset() because > that's what we used in 5.3 and that's what the documentation mentions at > the bottom of https://tapestry.apache.org/javascript.html. I thought the > general direction in 5.4 was to put CSS/JS/Modules under > src/main/resourcesMETA-INF instead of src/main/webapp and since @Import > worked, I figured the Stack would do the same. > > Thanks again, > > mrg > >
Re: [5.4B1] StyleSheet/Stack Bug?
On Wed, Mar 19, 2014 at 5:56 PM, Thiago H de Paula Figueiredo < thiag...@gmail.com> wrote: > On Wed, 19 Mar 2014 18:23:48 -0300, Michael Gentry > wrote: > > Hi! > > Have you tried 5.4-beta-3? If not, please do it. > Hi Thiago! I haven't tried 5.4B3 yet because I have to bootleg the JARs into work, which is a hassle, but I can attempt to do so. (Part of what I'm doing with 5.4 is evaluating how difficult it'll be to migrate our large 5.3 code base in the future.) * public List getStylesheets() {List >> >> stylesheets = new ArrayList();stylesheets.add(new >> StylesheetLink(assetSource.getContextAsset("datatables/ >> css/dataTables.bootstrap.css", >> null))); return stylesheets; }* >> > > There you are getting an asset from the context (getContextAsset()), while > in the @Import you're getting it from the classpath. Try > getClasspathAsset() instead I'll try getClasspathAsset() tomorrow. I used getContextAsset() because that's what we used in 5.3 and that's what the documentation mentions at the bottom of https://tapestry.apache.org/javascript.html. I thought the general direction in 5.4 was to put CSS/JS/Modules under src/main/resourcesMETA-INF instead of src/main/webapp and since @Import worked, I figured the Stack would do the same. Thanks again, mrg
Re: [5.4B1] StyleSheet/Stack Bug?
On Wed, 19 Mar 2014 18:23:48 -0300, Michael Gentry wrote: Hi! Have you tried 5.4-beta-3? If not, please do it. * public List getStylesheets() { List stylesheets = new ArrayList();stylesheets.add(new StylesheetLink(assetSource.getContextAsset("datatables/css/dataTables.bootstrap.css", null))); return stylesheets; }* There you are getting an asset from the context (getContextAsset()), while in the @Import you're getting it from the classpath. Try getClasspathAsset() instead. -- Thiago H. de Paula Figueiredo Tapestry, Java and Hibernate consultant and developer http://machina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
[5.4B1] StyleSheet/Stack Bug?
Hi everyone, It may be that I did something wrong, but I think there is an issue with JS Stacks in 5.4 (CSS handling). I decided to create a Stack for the DataTables component we use instead of specifying the CSS/etc on each page. I originally had * @Import(stylesheet="datatables/css/dataTables.bootstrap.css") public class Index ...* My CSS was located in: * src/main/resources/META-INF/assets/datatables/css/dataTables.bootstrap.css * This was working fine. However, when I created a Stack, it could no longer find the CSS: * Render queue error in SetupRender[Index]: Unable to locate asset 'context:datatables/css/dataTables.bootstrap.css' (the file does not exist). * Here is getStylesheets() from my Stack: * public List getStylesheets() {List stylesheets = new ArrayList();stylesheets.add(new StylesheetLink(assetSource.getContextAsset("datatables/css/dataTables.bootstrap.css", null))); return stylesheets; }* I tried everything I could think of to try to make T5.4 find the CSS, but nothing worked. Then, on a whim, I moved the CSS to: * src/main/webapp/datatables/css/dataTables.bootstrap.css* The Stack then started working and found the CSS. So, my question is, shouldn't @Import(stylesheet="...") and the Stack's getStylesheets() handle the same CSS locations/paths or was I doing something bad? Thanks, mrg PS. I tried to get the Stack to find other CSS/Less under src/main/resources/META-INF, too, and none of those worked.