[Lift] Re: in a heap o' trouble
http://scala-tools.org/mvnsites/maven-scala-plugin/plugin-info.html Click on any particular goal and you'll get a list of its configuration options. A union of all those is the complete list for the plugin. Those are generated from the annotations in the source code, so they should be *way* more up-to-date than what's in my head (although, perhaps not DavidB's). :) -Josh On Fri, Mar 20, 2009 at 6:16 PM, David Pollak feeder.of.the.be...@gmail.com wrote: On Fri, Mar 20, 2009 at 3:13 PM, Charles F. Munat c...@munat.com wrote: AH HA! I thought so. In fact, I was busy searching Google for exactly this. Thank you very much. I can get down off the roof now. Is there anywhere online where all these Maven POM settings are documented? I've been to the Maven site, but can't find it. In DavidB and Josh's heads. :-( Chas. David Pollak wrote: In your pom.xml file: plugin groupIdorg.scala-tools/groupId artifactIdmaven-scala-plugin/artifactId version2.9/version executions execution goals goalcompile/goal goaltestCompile/goal /goals /execution /executions configuration jvmArgs jvmArg-Xmx1024m/jvmArg /jvmArgs scalaVersion${scala.version}/scalaVersion /configuration /plugin plugin groupIdorg.scala-tools/groupId artifactIdmaven-scala-plugin/artifactId configuration jvmArgs jvmArg-Xmx1024m/jvmArg /jvmArgs scalaVersion${scala.version}/scalaVersion /configuration /plugin Scalac doesn't obey MAVEN_OPTS On Fri, Mar 20, 2009 at 2:35 PM, Charles F. Munat c...@munat.com mailto:c...@munat.com wrote: Suddenly, my Lift app won't compile. Maven complains that it is out of heap space. I have set Maven with MAVEN_OPTS=-Xmx768M -- which should be doubling the heap space. No effect. I removed all the code I added since the last time it compiled. No effect. What could possibly be causing this? I'm completely at a loss... Chas. -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: in a heap o' trouble
I just noticed that some of those documented configuration options aren't very enlightening. I may take a pass at providing more in-depth descriptions so one isn't left to guess what things mean. If anyone want to help de-mavenize the descriptions, feel free to contribute! (The goals documentation is automatically generated from the javadoc comments on the various injected fields for a given mojo). - Josh On Mon, Mar 23, 2009 at 3:38 AM, Josh Suereth joshua.suer...@gmail.comwrote: http://scala-tools.org/mvnsites/maven-scala-plugin/plugin-info.html Click on any particular goal and you'll get a list of its configuration options. A union of all those is the complete list for the plugin. Those are generated from the annotations in the source code, so they should be *way* more up-to-date than what's in my head (although, perhaps not DavidB's). :) -Josh On Fri, Mar 20, 2009 at 6:16 PM, David Pollak feeder.of.the.be...@gmail.com wrote: On Fri, Mar 20, 2009 at 3:13 PM, Charles F. Munat c...@munat.com wrote: AH HA! I thought so. In fact, I was busy searching Google for exactly this. Thank you very much. I can get down off the roof now. Is there anywhere online where all these Maven POM settings are documented? I've been to the Maven site, but can't find it. In DavidB and Josh's heads. :-( Chas. David Pollak wrote: In your pom.xml file: plugin groupIdorg.scala-tools/groupId artifactIdmaven-scala-plugin/artifactId version2.9/version executions execution goals goalcompile/goal goaltestCompile/goal /goals /execution /executions configuration jvmArgs jvmArg-Xmx1024m/jvmArg /jvmArgs scalaVersion${scala.version}/scalaVersion /configuration /plugin plugin groupIdorg.scala-tools/groupId artifactIdmaven-scala-plugin/artifactId configuration jvmArgs jvmArg-Xmx1024m/jvmArg /jvmArgs scalaVersion${scala.version}/scalaVersion /configuration /plugin Scalac doesn't obey MAVEN_OPTS On Fri, Mar 20, 2009 at 2:35 PM, Charles F. Munat c...@munat.com mailto:c...@munat.com wrote: Suddenly, my Lift app won't compile. Maven complains that it is out of heap space. I have set Maven with MAVEN_OPTS=-Xmx768M -- which should be doubling the heap space. No effect. I removed all the code I added since the last time it compiled. No effect. What could possibly be causing this? I'm completely at a loss... Chas. -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: in a heap o' trouble
Thanks! Josh Suereth wrote: http://scala-tools.org/mvnsites/maven-scala-plugin/plugin-info.html Click on any particular goal and you'll get a list of its configuration options. A union of all those is the complete list for the plugin. Those are generated from the annotations in the source code, so they should be *way* more up-to-date than what's in my head (although, perhaps not DavidB's). :) -Josh On Fri, Mar 20, 2009 at 6:16 PM, David Pollak feeder.of.the.be...@gmail.com mailto:feeder.of.the.be...@gmail.com wrote: On Fri, Mar 20, 2009 at 3:13 PM, Charles F. Munat c...@munat.com mailto:c...@munat.com wrote: AH HA! I thought so. In fact, I was busy searching Google for exactly this. Thank you very much. I can get down off the roof now. Is there anywhere online where all these Maven POM settings are documented? I've been to the Maven site, but can't find it. In DavidB and Josh's heads. :-( Chas. David Pollak wrote: In your pom.xml file: plugin groupIdorg.scala-tools/groupId artifactIdmaven-scala-plugin/artifactId version2.9/version executions execution goals goalcompile/goal goaltestCompile/goal /goals /execution /executions configuration jvmArgs jvmArg-Xmx1024m/jvmArg /jvmArgs scalaVersion${scala.version}/scalaVersion /configuration /plugin plugin groupIdorg.scala-tools/groupId artifactIdmaven-scala-plugin/artifactId configuration jvmArgs jvmArg-Xmx1024m/jvmArg /jvmArgs scalaVersion${scala.version}/scalaVersion /configuration /plugin Scalac doesn't obey MAVEN_OPTS On Fri, Mar 20, 2009 at 2:35 PM, Charles F. Munat c...@munat.com mailto:c...@munat.com mailto:c...@munat.com mailto:c...@munat.com wrote: Suddenly, my Lift app won't compile. Maven complains that it is out of heap space. I have set Maven with MAVEN_OPTS=-Xmx768M -- which should be doubling the heap space. No effect. I removed all the code I added since the last time it compiled. No effect. What could possibly be causing this? I'm completely at a loss... Chas. -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Menu widget
OK, I've pushed the new code on the wip-dcb-dropdown branch. I made some minor mods to the builtin Menu snippet (and changes to the Menu widget to match): 1. Added an expandAll attribute that renders the entire SiteMap. 2. Added a new top prefix to the builder snippet to allow for attributes on the top-level menu UL element. 3. Added API documentation to the Menu class. For some reason, the branch isn't showing up on github. I did a git push origin wip-dcb-dropdown And it says it's up-to-date, but I'm not seeing it on github. Derek On Sat, Mar 21, 2009 at 3:04 PM, Charles F. Munat c...@munat.com wrote: +1 I am understanding exactly what you have in mind and think it's a great idea. I wrote some kludgy code months ago (I knew zero about Scala back then -- now I know *infinity* times more! :-) to do pretty much the same thing, and I ended up completely rewriting the Menu snippet to my own needs. More flexibility == good, I think. Chas. (For anyone a little slow on the uptake this fine Saturday, please note that anything times zero is still zero.) Derek Chen-Becker wrote: I think I'm not being very clear. I'm going to modify the builtin Menu snippet, not SiteMap. In my view, SiteMap should not be concerned with how it's rendered, but the builtin snippet surely should be able to handle this. Once I have the Menu snippet modified, the MenuWidget class would just embed a lift:Menu.builder expandAll=true / tag where it wants the menu. I'll work on it this weekend and let you know when I have something usable. Derek On Sat, Mar 21, 2009 at 10:01 AM, marius d. marius.dan...@gmail.com mailto:marius.dan...@gmail.com wrote: I think I am aware what you meant ... If you want to make SiteMap to know how to render itself as ul/li hence centralize this fine by me. I have nothing against it, I just don't see the need ... the good news is that it may be just me ;) The analogy with chooseTemplate is not very relevant IMHO because choseeTemplate is a construct that one can use in many application context whereas SiteMap is typically only one. But by all means don't let me stay in your way:) If you are implementing this in SIteMap then perhaps you should make both Menu built in snippet and MenuWidget to use it? Br's, Marius On Mar 21, 5:41 pm, Derek Chen-Becker dchenbec...@gmail.com mailto:dchenbec...@gmail.com wrote: Sorry, what I mean is that the builtin Menu snippet code is duplicated, not SiteMap. For instance, here's how the builtin snippet generates the ULs: S.request.map(_.buildMenu.lines.toList match { case Nil = List(Text(No Navigation Defined.)) case xs = val liMap = S.prefixedAttrsToMap(li) val li = S.mapToAttrs(liMap) def buildANavItem(i: MenuItem) = { i match { case MenuItem(text, uri, kids, true, _, _) = (lispan{text}/span{buildUlLine(kids)}/li) % S.prefixedAttrsToMetaData(li_item, liMap) case MenuItem(text, uri, kids, _, true, _) = (lia href={uri}{text}/a{buildUlLine(kids)}/li) % S.prefixedAttrsToMetaData(li_path, liMap) case MenuItem(text, uri, kids, _, _, _) = (lia href={uri}{text}/a{buildUlLine(kids)}/li % li) } } def buildUlLine(in: Seq[MenuItem]): Node = if (in.isEmpty) Text() else ul{in.flatMap(buildANavItem)}/ul % S.prefixedAttrsToMetaData(ul) buildUlLine(xs) }) And here's the new code you put together: private def buildMenu(kids: Seq[MenuItem]): Elem = { ul{ for (m - kids) yield { li{ a href={m.uri}{m.text}/a ++ (m.kids.isEmpty match { case true = NodeSeq.Empty case _ = buildMenu(m.kids) }) }/li } }/ul } What you've written is very similar, albeit without some of the attribute handling, etc. I was just saying that if someone else comes along and finds a need for fully expanding SiteMap into nested ULs, then they have to write similar code again. It's a fairly small snippet of code, but I don't know that that's really an argument against providing it as a general mechanism. I mean, chooseTemplate is just a few lines, but we include it because it's useful. I would be happy to make changes to the builtin Menu snippet on a new branch to show what I mean if
[Lift] Re: Where are the lift jars?
It should be functional (as in, no errors). The XML parsing error is an issue with Firefox and Lift, and is fixed in 1.1, but not 1.0, which is what PocketChange currently uses (to match the book). I think we're working on backporting the fix to 1.0. If you see other errors, please let us know with detailed info. Derek On Sat, Mar 21, 2009 at 7:06 PM, Alex a...@liivid.com wrote: Click on Edit User: XML Parsing Error: prefix not bound to a namespace Location: http://localhost:8080/user_mgt/edit Line Number 5, Column 38: I think I got another error before there were any transactions in the system, but don't remember what it was. I figured it's an alpha demo so I can't expect everything to work. On Mar 21, 6:43 am, TylerWeir tyler.w...@gmail.com wrote: PocketChange app, and I can get it to run (although the current version is quiet broken and I had to create a postgres db user) but Could you expand on quite broken please? On Mar 20, 4:46 pm, Alex a...@liivid.com wrote: This is a n00b question, but I've spent a bit too much time trying to find where a number of the Lift classes are defined. I installed the PocketChange app, and I can get it to run (although the current version is quiet broken and I had to create a postgres db user) but when I open it as a project in IntelliJ (with apologies to David - I'm giving it a chance :) it can't find many of the Lift classes, including the mapper ones (e.g. LongKeyedMapper). There seems to be a custom MappedDecimal class, but that's the only one I (and IntelliJ) can find in net.liftweb.mapper. It also can't find net.liftweb.util. {Box,Empty,Full}. I am new to maven I think it downloaded them magically and put them somewhere, but where? Can maven also download the source so I don't have to keep a separate source directory in sync somehow? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Getting Started HTML Has Rogue Tildas
Convert the PDF to HTML? The PDF is already on the site. If you're talking about converting the LaTeX to HTML, let me know and I can send you a dump of the current LaTeX. Derek On Sat, Mar 21, 2009 at 11:39 PM, lmorroni la...@morroni.com wrote: I see it on some inline text too: The form=~post~ attribute is a shortcut. I'd be happy to help convert the PDF if you are willing to send me what you have done so far. Larry On Mar 20, 5:49 pm, Derek Chen-Becker dchenbec...@gmail.com wrote: Wow. I totally missed that. Unfortunately, I'm not very familiar with tex4ht, so I really need to dig into that to figure out what the heck is going on there. From what I can tell, it's only doing it for code listings. Are you seeing it anywhere else? Derek On Fri, Mar 20, 2009 at 2:59 PM, lmorroni la...@morroni.com wrote: Hey Everyone, This stumped me for a few minutes. I thought I was looking at some Scala Ninja Moves but in reality I think that the HTML version of the Getting Started docs has tildas instead of double quotes in a lot of places. Can anyone else confirm? Thanks, Larry --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Menu widget
Cool ... if you tested it and the MenuWidget, from my perspective it is good to go into master. And it's really great that you added the ScalaDocs !!! Br's, Marius On Mar 23, 6:07 pm, Derek Chen-Becker dchenbec...@gmail.com wrote: OK, I've pushed the new code on the wip-dcb-dropdown branch. I made some minor mods to the builtin Menu snippet (and changes to the Menu widget to match): 1. Added an expandAll attribute that renders the entire SiteMap. 2. Added a new top prefix to the builder snippet to allow for attributes on the top-level menu UL element. 3. Added API documentation to the Menu class. For some reason, the branch isn't showing up on github. I did a git push origin wip-dcb-dropdown And it says it's up-to-date, but I'm not seeing it on github. Derek On Sat, Mar 21, 2009 at 3:04 PM, Charles F. Munat c...@munat.com wrote: +1 I am understanding exactly what you have in mind and think it's a great idea. I wrote some kludgy code months ago (I knew zero about Scala back then -- now I know *infinity* times more! :-) to do pretty much the same thing, and I ended up completely rewriting the Menu snippet to my own needs. More flexibility == good, I think. Chas. (For anyone a little slow on the uptake this fine Saturday, please note that anything times zero is still zero.) Derek Chen-Becker wrote: I think I'm not being very clear. I'm going to modify the builtin Menu snippet, not SiteMap. In my view, SiteMap should not be concerned with how it's rendered, but the builtin snippet surely should be able to handle this. Once I have the Menu snippet modified, the MenuWidget class would just embed a lift:Menu.builder expandAll=true / tag where it wants the menu. I'll work on it this weekend and let you know when I have something usable. Derek On Sat, Mar 21, 2009 at 10:01 AM, marius d. marius.dan...@gmail.com mailto:marius.dan...@gmail.com wrote: I think I am aware what you meant ... If you want to make SiteMap to know how to render itself as ul/li hence centralize this fine by me. I have nothing against it, I just don't see the need ... the good news is that it may be just me ;) The analogy with chooseTemplate is not very relevant IMHO because choseeTemplate is a construct that one can use in many application context whereas SiteMap is typically only one. But by all means don't let me stay in your way:) If you are implementing this in SIteMap then perhaps you should make both Menu built in snippet and MenuWidget to use it? Br's, Marius On Mar 21, 5:41 pm, Derek Chen-Becker dchenbec...@gmail.com mailto:dchenbec...@gmail.com wrote: Sorry, what I mean is that the builtin Menu snippet code is duplicated, not SiteMap. For instance, here's how the builtin snippet generates the ULs: S.request.map(_.buildMenu.lines.toList match { case Nil = List(Text(No Navigation Defined.)) case xs = val liMap = S.prefixedAttrsToMap(li) val li = S.mapToAttrs(liMap) def buildANavItem(i: MenuItem) = { i match { case MenuItem(text, uri, kids, true, _, _) = (lispan{text}/span{buildUlLine(kids)}/li) % S.prefixedAttrsToMetaData(li_item, liMap) case MenuItem(text, uri, kids, _, true, _) = (lia href={uri}{text}/a{buildUlLine(kids)}/li) % S.prefixedAttrsToMetaData(li_path, liMap) case MenuItem(text, uri, kids, _, _, _) = (lia href={uri}{text}/a{buildUlLine(kids)}/li % li) } } def buildUlLine(in: Seq[MenuItem]): Node = if (in.isEmpty) Text() else ul{in.flatMap(buildANavItem)}/ul % S.prefixedAttrsToMetaData(ul) buildUlLine(xs) }) And here's the new code you put together: private def buildMenu(kids: Seq[MenuItem]): Elem = { ul{ for (m - kids) yield { li{ a href={m.uri}{m.text}/a ++ (m.kids.isEmpty match { case true = NodeSeq.Empty case _ = buildMenu(m.kids) }) }/li } }/ul } What you've written is very similar, albeit without some of the attribute handling, etc. I was just saying that if someone else comes along and finds a need for fully expanding SiteMap into nested ULs, then they have to write similar code again. It's a fairly small snippet of code, but I don't know that that's really an argument
[Lift] Portable components of logic?
Guys, Has anyone got a good strategy for packaging up components of logic within lift? At our company we have a particular application that im writing some really nice logic for inside lift and im wondering how I can package that up and re-use it (short of copy and paste snippet files and the various css / js files)? I know we have a snippet search path, and thats cool as we can just bundle a bunch of logic into seperate JARs, but what about view / UI content? Perhaps some specially formated JAR layout with some kind of extension to LiftRules that says also look here for stuff? Thanks Tim --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Lift as a UI in server side OSGi
I'm working with a couple of the OSGi gurus on this issue. They're in town for EclipseCon this week and I'll be meeting with them on Thursday. Don't worry about doing anything... we'll get OSGi support into Lift. David and everyone, Thanks for all of your help on this and your effort on this Framework. I may be rambling and this may not be useful, but it helps me to clarify my thoughts to try to get them written down. I work for a school district with one other web/java developer and we are in a vacuum most of the time. So I do a lot of reading, trying to learn new things, but a lot of the time my understanding is faulty and so I am hoping some of you can point out where I have come to the wrong conclusions or where I am right for that matter. Your OSGi Gurus will most likely have much better insight, but here are my thoughts on Lift with OSGi and I hope to hear more after your meeting on thursday, will you be posting their thoughts on how this integration could/should occur. Here are some of my thoughts: Bundle Activation: * Initialize the lift framework and perform the boot actions (register bundle resource paths and snippet packages) * Export a service that could be called to process the lift request -or- register a servlet to handle lift requests * Register a service that can expose Lift templates to other bundles * Register a service that can serve the bundle's internal classpath resources Bundle Shutdown: * Unregister the services / servlet * Destroy the lift instance In a way the initialization process performed by the Boot class and the ServletFilter would be performed by the OSGi Bundle Activator Calling a Lift Service: There are two ways that I can see Lift utilized: 1) by registering individual servlets with OSGi, and 2) by having a service call a utility class that knows how to render the requested lift snippet/template. This utility class should be independent of the request mechanism so that it could be utilized by the current implementation, OSGi services and the portlet implementation. Template Resolution: There are two methods I can see for OSGi to work with Lift: Bundles export almost everything or bundles register template and snippet services. I believe that if the bundles export almost everything that the templating system should work, but there will be a great deal of direct dependencies between modules. If there was a service that each bundle could register its templates / snippets with these dependencies could be reduced, but this may require OSGi specific surrounds / embed tags. This would require embedded templates to be looked up in a service and when retrieved have its contents returned with all of the lift tags fully expanded. Likewise if a template uses a surround tag then the contents of the surround tag would be fully expanded and then the template service would be provided with the template name, content region and replacement xhtml content. What this would do is remove a lot of the direct ties to other bundles. For example, if an application contains three bundles: 1) The Core Module provides the template giving the overall appearance of the entire site 2) The Application template populates the core template's content region. 3) The Module template populates the Application template's moduleContent region. The Module Bundle (3) should not need to know that there is a Dependency on the Core Bundle's (1) template. As it only cares about the Application it is providing content to. This system would mean that all of the snippets used in a given template would have to reside in the same bundle as the template or be part of the Lift distribution to which all Lift bundles would have a dependency on. Resource Resolution: This is another point that would need to be addressed. If the bundles register the paths for their resources with a resource server service then it could facilitate looking up the resources in the registered bundles. Also, I can see having a utility class that could be configured in an activator and called by other services in order to retrieve resources. However, the LiftRules.resourceServerPath may need to be changed so that it can take wildcards so that prefix path elements could be ignored. For example, if the LiftRules.resourceServerPath is set to */classpath then the following: script src=/profile/private/blog/classpath/yui/event.js type=text/javascript/ would cause the bundles resource server to return the /yui/event.js file from the bundle. This is most likely very short sighted due to my lack of knowledge at this point, ... but hopefully not too far off base. -- Chad --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at
[Lift] Re: Portable components of logic?
Tim, Look in LiftRules for SnippetDispatchPF Yes, you can dispatch snippets to objects defined in other JARs. Thanks, David On Mon, Mar 23, 2009 at 11:03 AM, Tim Perrett timo...@getintheloop.euwrote: Guys, Has anyone got a good strategy for packaging up components of logic within lift? At our company we have a particular application that im writing some really nice logic for inside lift and im wondering how I can package that up and re-use it (short of copy and paste snippet files and the various css / js files)? I know we have a snippet search path, and thats cool as we can just bundle a bunch of logic into seperate JARs, but what about view / UI content? Perhaps some specially formated JAR layout with some kind of extension to LiftRules that says also look here for stuff? Thanks Tim -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Portable components of logic?
Sure, I know this :) But what about CSS etc, how can they then become resolvable / includable in html (and/or scala view) code? Thanks Tim On 23/03/2009 18:08, David Pollak feeder.of.the.be...@gmail.com wrote: Tim, Look in LiftRules for SnippetDispatchPF Yes, you can dispatch snippets to objects defined in other JARs. Thanks, David On Mon, Mar 23, 2009 at 11:03 AM, Tim Perrett timo...@getintheloop.eu wrote: Guys, Has anyone got a good strategy for packaging up components of logic within lift? At our company we have a particular application that im writing some really nice logic for inside lift and im wondering how I can package that up and re-use it (short of copy and paste snippet files and the various css / js files)? I know we have a snippet search path, and thats cool as we can just bundle a bunch of logic into seperate JARs, but what about view / UI content? Perhaps some specially formated JAR layout with some kind of extension to LiftRules that says also look here for stuff? Thanks Tim --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Portable components of logic?
On Mon, Mar 23, 2009 at 11:12 AM, Timothy Perrett timo...@getintheloop.euwrote: Sure, I know this :) But what about CSS etc, how can they then become resolvable / includable in html (and/or scala view) code? You could have the CSS reference generated in the Snippet. You can also have views in code (see ViewDispatchPF) and do lift:embed / in your code to refer to the Scala-based view code. Thanks Tim On 23/03/2009 18:08, David Pollak feeder.of.the.be...@gmail.com wrote: Tim, Look in LiftRules for SnippetDispatchPF Yes, you can dispatch snippets to objects defined in other JARs. Thanks, David On Mon, Mar 23, 2009 at 11:03 AM, Tim Perrett timo...@getintheloop.eu wrote: Guys, Has anyone got a good strategy for packaging up components of logic within lift? At our company we have a particular application that im writing some really nice logic for inside lift and im wondering how I can package that up and re-use it (short of copy and paste snippet files and the various css / js files)? I know we have a snippet search path, and thats cool as we can just bundle a bunch of logic into seperate JARs, but what about view / UI content? Perhaps some specially formated JAR layout with some kind of extension to LiftRules that says also look here for stuff? Thanks Tim -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Portable components of logic?
You could have the CSS reference generated in the Snippet. When you say reference, are you referring to a style-sheet link or the *actual* CSS itself? You can also have views in code (see ViewDispatchPF) and do lift:embed / in your code to refer to the Scala-based view code. I've seen ViewDispatchPF before - it is still somewhat mystical to me i'm afraid! I understand that its possible to create new views etc - any chance you can just give a quick example of how to use ViewDispatchPF? Something like: LiftRules.viewDispatch.append { case some :: path :: Nil = ??? } Cheers, Tim --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Portable components of logic?
On Mon, Mar 23, 2009 at 11:57 AM, Timothy Perrett timo...@getintheloop.euwrote: You could have the CSS reference generated in the Snippet. When you say reference, are you referring to a style-sheet link or the *actual* CSS itself? Either. You can also have views in code (see ViewDispatchPF) and do lift:embed / in your code to refer to the Scala-based view code. I've seen ViewDispatchPF before - it is still somewhat mystical to me i'm afraid! I understand that its possible to create new views etc - any chance you can just give a quick example of how to use ViewDispatchPF? Something like: LiftRules.viewDispatch.append { case some :: path :: Nil = ??? } Perhaps tomorrow. I will be whipped into a mass of jello if I don't get Ch08D2 done today... along with the front matter. :-) Cheers, Tim -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Schema management with JPA
I suggest checking out http://www.liquibase.org/ It's the best open source database change management tool I've come across to date. On Mar 20, 11:18 pm, Derek Chen-Becker dchenbec...@gmail.com wrote: Well. I think it depends. I know that if you use the hibernate provider that you can set a property to automatically create/update the schema when it runs. You can look at the JPA Demo site in the Lift repo: http://github.com/dpp/liftweb/blob/794cac5abf6b1ae5502f6321847f6186fc... The relevant property is hibernate.hbm2ddl.auto I haven't used TopLink but it appears to have a subset of this functionality: http://www.oracle.com/technology/products/ias/toplink/JPA/essentials/... The caveat is that with Hibernate it can alter existing tables to match changes in your entities, but toplink appears to do a drop-then-add, which kind of sucks. I haven't looked at JPOX or any other JPA impls. Derek On Fri, Mar 20, 2009 at 7:13 PM, Alex a...@liivid.com wrote: I'm going through the recently announced book and JPA looks pretty attractive. There is no mention of schema management - e.g. creating and modifying tables. Is there any or is that all done manually? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: How to correctly use MappedDateTime
I think the reason that it's set to midnight is because when the date parser parses a date with only the MM/dd/ format string, it sets HMS to zeros. Derek On Sun, Mar 22, 2009 at 8:52 AM, tclendenen tim...@hotmail.com wrote: Except for the todo:deadline I added to index.html, I believe the following are the only changes made to the original tutorial code Additions to TD.scala val dateFormat = new SimpleDateFormat(MM/dd/, hh:mm a) private def deadline(td: ToDo, reDraw: () = JsCmd) = swappable(span class=deadline{td.deadline}/span, span class=deadline {ajaxText(td.deadline.toString, v = {td.deadline(dateFormat.parse(v)).save; reDraw()})} /span) This was added to bind in the toList method. deadline - deadline(td, reDraw) and this was added to bind in doBind within the add method deadline - todo.deadline.toForm, Addition to ToDo.scala object deadline extends MappedDateTime(this){ val dateFormat = new SimpleDateFormat(MM/dd/, hh:mm a) override def defaultValue = time(millis + days(5)) override def asHtml = Text(toString) override def toString = dateFormat.format(is) } On Mar 22, 8:30 am, TylerWeir tyler.w...@gmail.com wrote: Can you add some of your code? How you're using MappedDateTime in your snippet and the definition in the model would be a good start. On Mar 21, 9:34 pm, tclendenen tim...@hotmail.com wrote: As an exercise I've added a deadline object to the ToDo class. It works as expected except that the time is always set to midnight (ex. 2009-07-16 00:00:00.0) in the database. Is this the expected behavior? Any help is appreciated. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: scalajpa not in maven repo
My apologies. I should have cleaned out my local Maven repo before building the demo app. I'll fix that in source and push a new version. Also, you're correct that it should probably be labeled as a demo archetype rather than a basic archetype. In the interest of making it useful for everyone I'll solicit input on exactly what people would want to see in a JPA basic archetype. Derek On Sun, Mar 22, 2009 at 2:05 PM, Alex a...@liivid.com wrote: The good news is I'm learning some things about maven and scalajpa is so far easy to set up. The bad news is lift-archetype-jpa-basic references scalajpa which is not on the main maven servers (at least where it's trying to find it). I added repositories repository idscala-tools/id urlhttp://scala-tools.org/repo-snapshots/url /repository /repositories and changed the version for scalajpa to 1.1-SNAPSHOT in web/pom.xml . Everything worked as advertised after that. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] What does everyone want in a basic JPA archetype?
As was recently pointed out, the current JPA archetype is really more of a demo site (built on the JPA demo site under liftweb/sites, actually), so it might be nice to provide a more bare-bones version. What would people like to see for a basic, hit-the-ground-running archetype for JPA? Derek --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: [scala-user] [ANN] Exploring Lift: a Book for the Scala-based Web Framework
On Mon, Mar 23, 2009 at 2:14 PM, Viktor Klang viktor.kl...@gmail.comwrote: Guys, I'm expecting a signed copy... ;) Who's the father? :-) On Mon, Mar 23, 2009 at 7:24 PM, TylerWeir tyler.w...@gmail.com wrote: Dave Griffith wrote: Garrett Rowe-2 wrote: I'll be buying the e-version of the book today. Me too, or, more precisely, I'll be buying it whenever APress actually lets people purchase the e-book. The publication date says April, but until then will the book be available as beta? I'll post again when I know dates. Thanks for the patience. -- View this message in context: http://www.nabble.com/-ANN---Exploring-Lift%3A-a-Book-for-the-Scala-based-Web-Framework-tp22663004p22666141.html Sent from the Scala - User mailing list archive at Nabble.com. -- Viktor Klang Senior Systems Analyst -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: [scala-user] [ANN] Exploring Lift: a Book for the Scala-based Web Framework
On Mon, Mar 23, 2009 at 10:16 PM, David Pollak feeder.of.the.be...@gmail.com wrote: On Mon, Mar 23, 2009 at 2:14 PM, Viktor Klang viktor.kl...@gmail.comwrote: Guys, I'm expecting a signed copy... ;) Who's the father? :-) You are the daddy. ;) On Mon, Mar 23, 2009 at 7:24 PM, TylerWeir tyler.w...@gmail.com wrote: Dave Griffith wrote: Garrett Rowe-2 wrote: I'll be buying the e-version of the book today. Me too, or, more precisely, I'll be buying it whenever APress actually lets people purchase the e-book. The publication date says April, but until then will the book be available as beta? I'll post again when I know dates. Thanks for the patience. -- View this message in context: http://www.nabble.com/-ANN---Exploring-Lift%3A-a-Book-for-the-Scala-based-Web-Framework-tp22663004p22666141.html Sent from the Scala - User mailing list archive at Nabble.com. -- Viktor Klang Senior Systems Analyst -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp -- Viktor Klang Senior Systems Analyst --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: [ANN] Exploring Lift: a Book for the Scala-based Web Framework
LOL ... but damn right. At this point I can only wholeheartedly thanks David and each and every committer for Lift's existence. Br's, Marius On Mar 23, 11:22 pm, Viktor Klang viktor.kl...@gmail.com wrote: On Mon, Mar 23, 2009 at 10:16 PM, David Pollak feeder.of.the.be...@gmail.com wrote: On Mon, Mar 23, 2009 at 2:14 PM, Viktor Klang viktor.kl...@gmail.comwrote: Guys, I'm expecting a signed copy... ;) Who's the father? :-) You are the daddy. ;) On Mon, Mar 23, 2009 at 7:24 PM, TylerWeir tyler.w...@gmail.com wrote: Dave Griffith wrote: Garrett Rowe-2 wrote: I'll be buying the e-version of the book today. Me too, or, more precisely, I'll be buying it whenever APress actually lets people purchase the e-book. The publication date says April, but until then will the book be available as beta? I'll post again when I know dates. Thanks for the patience. -- View this message in context: http://www.nabble.com/-ANN---Exploring-Lift%3A-a-Book-for-the-Scala-b... Sent from the Scala - User mailing list archive at Nabble.com. -- Viktor Klang Senior Systems Analyst -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Git some:http://github.com/dpp -- Viktor Klang Senior Systems Analyst --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Portable components of logic?
Perhaps tomorrow. I will be whipped into a mass of jello if I don't get Ch08D2 done today... along with the front matter. lol! No worries at all David. Tomorrow would be great :-) Thanks, Tim --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: How to correctly use MappedDateTime
That would make sense but the format string is MM/dd/, hh:mm a. My initial question, although not asked correctly, came from looking through the code and seeing the DateExtension class in TimeHelpers. It states This class adds a noTime method the Date class, in order to get at Date object starting at 00:00 and it is created by an implicit conversion. However, I couldn't see where the implicit converison would be invoked and didn't know if that was the expected behavior. I don't know that the parse/format on the Java side of things is not causing the issue, so I will look into that further. On Mar 23, 4:30 pm, Derek Chen-Becker dchenbec...@gmail.com wrote: I think the reason that it's set to midnight is because when the date parser parses a date with only the MM/dd/ format string, it sets HMS to zeros. Derek On Sun, Mar 22, 2009 at 8:52 AM, tclendenen tim...@hotmail.com wrote: Except for the todo:deadline I added to index.html, I believe the following are the only changes made to the original tutorial code Additions to TD.scala val dateFormat = new SimpleDateFormat(MM/dd/, hh:mm a) private def deadline(td: ToDo, reDraw: () = JsCmd) = swappable(span class=deadline{td.deadline}/span, span class=deadline {ajaxText(td.deadline.toString, v = {td.deadline(dateFormat.parse(v)).save; reDraw()})} /span) This was added to bind in the toList method. deadline - deadline(td, reDraw) and this was added to bind in doBind within the add method deadline - todo.deadline.toForm, Addition to ToDo.scala object deadline extends MappedDateTime(this){ val dateFormat = new SimpleDateFormat(MM/dd/, hh:mm a) override def defaultValue = time(millis + days(5)) override def asHtml = Text(toString) override def toString = dateFormat.format(is) } On Mar 22, 8:30 am, TylerWeir tyler.w...@gmail.com wrote: Can you add some of your code? How you're using MappedDateTime in your snippet and the definition in the model would be a good start. On Mar 21, 9:34 pm, tclendenen tim...@hotmail.com wrote: As an exercise I've added a deadline object to the ToDo class. It works as expected except that the time is always set to midnight (ex. 2009-07-16 00:00:00.0) in the database. Is this the expected behavior? Any help is appreciated. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: How to correctly use MappedDateTime
Ah, sorry, I misread. The parse should be working fine, then. The MappdeDateTime really should be saving the full Date instance that's passed to it, so please let me know if the Date that you're setting as the value is losing the time info. Also, what DB engine are you running against? Derek On Mon, Mar 23, 2009 at 4:31 PM, tclendenen tim...@hotmail.com wrote: That would make sense but the format string is MM/dd/, hh:mm a. My initial question, although not asked correctly, came from looking through the code and seeing the DateExtension class in TimeHelpers. It states This class adds a noTime method the Date class, in order to get at Date object starting at 00:00 and it is created by an implicit conversion. However, I couldn't see where the implicit converison would be invoked and didn't know if that was the expected behavior. I don't know that the parse/format on the Java side of things is not causing the issue, so I will look into that further. On Mar 23, 4:30 pm, Derek Chen-Becker dchenbec...@gmail.com wrote: I think the reason that it's set to midnight is because when the date parser parses a date with only the MM/dd/ format string, it sets HMS to zeros. Derek On Sun, Mar 22, 2009 at 8:52 AM, tclendenen tim...@hotmail.com wrote: Except for the todo:deadline I added to index.html, I believe the following are the only changes made to the original tutorial code Additions to TD.scala val dateFormat = new SimpleDateFormat(MM/dd/, hh:mm a) private def deadline(td: ToDo, reDraw: () = JsCmd) = swappable(span class=deadline{td.deadline}/span, span class=deadline {ajaxText(td.deadline.toString, v = {td.deadline(dateFormat.parse(v)).save; reDraw()})} /span) This was added to bind in the toList method. deadline - deadline(td, reDraw) and this was added to bind in doBind within the add method deadline - todo.deadline.toForm, Addition to ToDo.scala object deadline extends MappedDateTime(this){ val dateFormat = new SimpleDateFormat(MM/dd/, hh:mm a) override def defaultValue = time(millis + days(5)) override def asHtml = Text(toString) override def toString = dateFormat.format(is) } On Mar 22, 8:30 am, TylerWeir tyler.w...@gmail.com wrote: Can you add some of your code? How you're using MappedDateTime in your snippet and the definition in the model would be a good start. On Mar 21, 9:34 pm, tclendenen tim...@hotmail.com wrote: As an exercise I've added a deadline object to the ToDo class. It works as expected except that the time is always set to midnight (ex. 2009-07-16 00:00:00.0) in the database. Is this the expected behavior? Any help is appreciated. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Slash and burn
Hi Guys, I too would like to access /foo and /foo/. Any updates on this? Second, I have /foo.html that surrounds default at content. I have a situation where / should look exactly like /foo. I don't want to redirect to foo. How else can I achieve this without copying the contents of /foo.html to /index.html? Thanks, Bradford On Mar 14, 4:02 am, David Pollak feeder.of.the.be...@gmail.com wrote: On Fri, Mar 13, 2009 at 10:21 PM, Charles F. Munat c...@munat.com wrote: Sorry, I've missed most of this discussion, but thank you for your responses. Hopefully, I'll be able to figure out what they mean after I get some coffee (I had a very late night working). I organize all my sites the same way. Names of items are expressed as directories. All pages are called index. So instead of this: /folks bob.html bill.html brent.html I have this: /folks /bob index.html /bill index.html /brent index.html One big advantage is that this works even if I later switch to a static HTML site, or a ruby site, or god-knows-what. And I can change index.html to index.php or index.xml or whatever and the URLs don't change. I learned this system ten years ago and it has served me very well. It seems that Lift used to serve /folks/ when /folks was called, but recently it stopped. It would be nice if it looked for a *file* with that name first, but then tried directories if no file was found. Is there a downside to that? Yes, there's a huge downside. Files are only one place that Lift looks when it tries to resolve a list of path elements into the view to render. Please see my recommendation of using a DispatchPF in conjunction with SiteMap to determine if a request for /folks should be redirected to /folks/. That is the optimal way to solve the problem. We may choose to add this kind of thing into Lift. We will not add an alternate mechanism to achieving this goal. Sorry about the subject line. Couldn't resist. Made me laugh. Chas. Timothy Perrett wrote: Hmmm, I see your point. Will have a noodle at the weekend and see what would be the best route. Cheers, Tim On 13/03/2009 17:45, Derek Chen-Becker dchenbec...@gmail.com wrote: Well, treating a directory without a trailing slash (/path) as the directory + index (/path/index) is pretty standard behavior in web servers (Apache returns a 301 from the former to the latter), so I think something that requires less user intervention would be good. Perhaps at most we would want a boolean var on LiftRules to control the behavior. Derek On Fri, Mar 13, 2009 at 12:15 PM, Timothy Perrett timo...@getintheloop.eu wrote: Im pretty sure you could just do this with the existing infrastructure (RewritePF and DispatchPF) For instance, if Chas doesnt mind having two seperate resources, then he can easily use RewritePF to get the same content at two resource locations. Alternatively, he could just use a 301 redirect response in a dispatch call to get the appropriate resource - I've posted code to one of his questions about that before If memory serves. I think that should all be cool? Cant think of a good reason why this wouldnt work anyway :-) Cheers, Tim On Mar 13, 4:57 pm, Derek Chen-Becker dchenbec...@gmail.com wrote: I think I was confusing this with some other behavior of SiteMap, hence my question. I think it would be good to allow some really pre-processing of the URL. Would it useful to allow the user to control it, or do you think it would be better to just make it implicit? Something like LiftRules.pathRewrite.append { case List(parse) = List(parse, index) ... } I'm doing a lot of wand-waving there, but does that seem like a reasonable approach from the user side of things? Or maybe make a subclass of RewriteResponse that just tells Lift to modify the path but change nothing else? case class ModifiedPath (path : List[String]) extends RewriteResponse(...) Derek On Fri, Mar 13, 2009 at 10:51 AM, Timothy Perrett timo...@getintheloop.euwrote timo...@getintheloop.eu wrote: Within Lift, /page does what it says on the tin, whilst /page/ actually works out as: /page/index IMO, this is good. If you want them to be the same, I think you could either do a rewrite to the same content (if memory serves there is also
[Lift] Re: Slash and burn
On Mon, Mar 23, 2009 at 5:03 PM, bradford fingerm...@gmail.com wrote: Hi Guys, I too would like to access /foo and /foo/. Any updates on this? /foo maps to /foo.html /foo/ maps to /foo/index.html This has not and will not change. If you are using SiteMap, make sure there are SiteMap entried for both: List(foo) and List(foo, index) Second, I have /foo.html that surrounds default at content. I have a situation where / should look exactly like /foo. I don't want to redirect to foo. How else can I achieve this without copying the contents of /foo.html to /index.html? in index.html: lift:embed what=/foo/ Thanks, Bradford On Mar 14, 4:02 am, David Pollak feeder.of.the.be...@gmail.com wrote: On Fri, Mar 13, 2009 at 10:21 PM, Charles F. Munat c...@munat.com wrote: Sorry, I've missed most of this discussion, but thank you for your responses. Hopefully, I'll be able to figure out what they mean after I get some coffee (I had a very late night working). I organize all my sites the same way. Names of items are expressed as directories. All pages are called index. So instead of this: /folks bob.html bill.html brent.html I have this: /folks /bob index.html /bill index.html /brent index.html One big advantage is that this works even if I later switch to a static HTML site, or a ruby site, or god-knows-what. And I can change index.html to index.php or index.xml or whatever and the URLs don't change. I learned this system ten years ago and it has served me very well. It seems that Lift used to serve /folks/ when /folks was called, but recently it stopped. It would be nice if it looked for a *file* with that name first, but then tried directories if no file was found. Is there a downside to that? Yes, there's a huge downside. Files are only one place that Lift looks when it tries to resolve a list of path elements into the view to render. Please see my recommendation of using a DispatchPF in conjunction with SiteMap to determine if a request for /folks should be redirected to /folks/. That is the optimal way to solve the problem. We may choose to add this kind of thing into Lift. We will not add an alternate mechanism to achieving this goal. Sorry about the subject line. Couldn't resist. Made me laugh. Chas. Timothy Perrett wrote: Hmmm, I see your point. Will have a noodle at the weekend and see what would be the best route. Cheers, Tim On 13/03/2009 17:45, Derek Chen-Becker dchenbec...@gmail.com wrote: Well, treating a directory without a trailing slash (/path) as the directory + index (/path/index) is pretty standard behavior in web servers (Apache returns a 301 from the former to the latter), so I think something that requires less user intervention would be good. Perhaps at most we would want a boolean var on LiftRules to control the behavior. Derek On Fri, Mar 13, 2009 at 12:15 PM, Timothy Perrett timo...@getintheloop.eu wrote: Im pretty sure you could just do this with the existing infrastructure (RewritePF and DispatchPF) For instance, if Chas doesnt mind having two seperate resources, then he can easily use RewritePF to get the same content at two resource locations. Alternatively, he could just use a 301 redirect response in a dispatch call to get the appropriate resource - I've posted code to one of his questions about that before If memory serves. I think that should all be cool? Cant think of a good reason why this wouldnt work anyway :-) Cheers, Tim On Mar 13, 4:57 pm, Derek Chen-Becker dchenbec...@gmail.com wrote: I think I was confusing this with some other behavior of SiteMap, hence my question. I think it would be good to allow some really pre-processing of the URL. Would it useful to allow the user to control it, or do you think it would be better to just make it implicit? Something like LiftRules.pathRewrite.append { case List(parse) = List(parse, index) ... } I'm doing a lot of wand-waving there, but does that seem like a reasonable approach from the user side of things? Or maybe make a subclass of RewriteResponse that just tells Lift to modify the path but change nothing else? case class ModifiedPath (path : List[String]) extends RewriteResponse(...) Derek
[Lift] lift:Menu.group
The idea of LocGroup is great. I have a few Menu's with LocGroup (group1). I want to generate: ul class=menu lia href=/foo1spanFoo1/span/foo lia href=/foo1spanFoo1/span/foo lia href=/foo1spanFoo1/span/foo /ul for just group1. It appears that lift:Menu.group / does not print ul and li, and lift:Menu.builder won't recognize group. What are my alternatives? Also, I need to surround the item text with span /. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: How to correctly use MappedDateTime
I overrode the save method of the ToDo class and placed println (toString) before and after the getSingleton.save(this) call. Both print the correctly formatted date, but it still shows up on the page and in the database as 12:00. I am using the Derby 10.4.2.0 On Mar 23, 6:42 pm, Derek Chen-Becker dchenbec...@gmail.com wrote: Ah, sorry, I misread. The parse should be working fine, then. The MappdeDateTime really should be saving the full Date instance that's passed to it, so please let me know if the Date that you're setting as the value is losing the time info. Also, what DB engine are you running against? Derek On Mon, Mar 23, 2009 at 4:31 PM, tclendenen tim...@hotmail.com wrote: That would make sense but the format string is MM/dd/, hh:mm a. My initial question, although not asked correctly, came from looking through the code and seeing the DateExtension class in TimeHelpers. It states This class adds a noTime method the Date class, in order to get at Date object starting at 00:00 and it is created by an implicit conversion. However, I couldn't see where the implicit converison would be invoked and didn't know if that was the expected behavior. I don't know that the parse/format on the Java side of things is not causing the issue, so I will look into that further. On Mar 23, 4:30 pm, Derek Chen-Becker dchenbec...@gmail.com wrote: I think the reason that it's set to midnight is because when the date parser parses a date with only the MM/dd/ format string, it sets HMS to zeros. Derek On Sun, Mar 22, 2009 at 8:52 AM, tclendenen tim...@hotmail.com wrote: Except for the todo:deadline I added to index.html, I believe the following are the only changes made to the original tutorial code Additions to TD.scala val dateFormat = new SimpleDateFormat(MM/dd/, hh:mm a) private def deadline(td: ToDo, reDraw: () = JsCmd) = swappable(span class=deadline{td.deadline}/span, span class=deadline {ajaxText(td.deadline.toString, v = {td.deadline(dateFormat.parse(v)).save; reDraw()})} /span) This was added to bind in the toList method. deadline - deadline(td, reDraw) and this was added to bind in doBind within the add method deadline - todo.deadline.toForm, Addition to ToDo.scala object deadline extends MappedDateTime(this){ val dateFormat = new SimpleDateFormat(MM/dd/, hh:mm a) override def defaultValue = time(millis + days(5)) override def asHtml = Text(toString) override def toString = dateFormat.format(is) } On Mar 22, 8:30 am, TylerWeir tyler.w...@gmail.com wrote: Can you add some of your code? How you're using MappedDateTime in your snippet and the definition in the model would be a good start. On Mar 21, 9:34 pm, tclendenen tim...@hotmail.com wrote: As an exercise I've added a deadline object to the ToDo class. It works as expected except that the time is always set to midnight (ex. 2009-07-16 00:00:00.0) in the database. Is this the expected behavior? Any help is appreciated. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: lift:Menu.group
Also, I'm using 1.1-snapshot and lift:Menu.item name=foo1 / will always show except when i am on /foo1. For this case it doesn't even render. On Mar 23, 8:41 pm, bradford fingerm...@gmail.com wrote: The idea of LocGroup is great. I have a few Menu's with LocGroup (group1). I want to generate: ul class=menu lia href=/foo1spanFoo1/span/foo lia href=/foo1spanFoo1/span/foo lia href=/foo1spanFoo1/span/foo /ul for just group1. It appears that lift:Menu.group / does not print ul and li, and lift:Menu.builder won't recognize group. What are my alternatives? Also, I need to surround the item text with span /. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: lift:Menu.group
I apologize for all of the messages. I got a little hasty with this email. This is what I'm looking for: ul class=menu lia href=/foo1spanFoo1/span/foo lia href=/foo2spanFoo2/span/foo lia href=/foo3spanFoo3/span/foo /ul On Mar 23, 8:41 pm, bradford fingerm...@gmail.com wrote: The idea of LocGroup is great. I have a few Menu's with LocGroup (group1). I want to generate: ul class=menu lia href=/foo1spanFoo1/span/foo lia href=/foo1spanFoo1/span/foo lia href=/foo1spanFoo1/span/foo /ul for just group1. It appears that lift:Menu.group / does not print ul and li, and lift:Menu.builder won't recognize group. What are my alternatives? Also, I need to surround the item text with span /. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---