[Lift] Re: lift views
On Sun, May 31, 2009 at 7:05 PM, Timothy Perrett timo...@getintheloop.euwrote: Now you mention it though, it might well work quite nicely. Talk to me Viktor - what are you thinking? Just create an XSLT template to convert the lift templates to a a more readable form? Should be possible? Cheers, Tim On 31/05/2009 14:10, Viktor Klang viktor.kl...@gmail.com wrote: Couldn't they just define an XSLT template to view the lift templates with? -- Viktor Klang Rockstar Developer --~--~-~--~~~---~--~~ 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: JavaScript interface to Comet
On Jun 1, 2:59 am, Xavi Ramirez xavi@gmail.com wrote: Thanks for pointing me into the right direction. I've created a simple example (see attachment). In my example, the user can drag a div around the screen. Every time the div moves, the browser sends a json object with the x and y coordinates to the comet steam. Unfortunately I've ran into a couple of usability and performance problems. Assume the following set up: two browses are open (browser A and B) are all listening to comet stream K. Comet stream K broadcasts commands that update the position of a div. It seems that whenever browser A notifies comet stream K about an update to the div's position, stream K broadcasts the message to all its listeners, including browser A. In other words, browser A essentially hears its own echo. For the user of browser A, this causes the div to constantly jump between where the user actually dragged it and the position that comet stream K is currently broadcasting. This is something your app must handle. Your ShapeTracker actor is notified by all CometActor with AddListener hence your ShapeActor is sending messages to all running actors. Your app needs to discriminate the actors such that to not send the Comet response back if the notification request pertains to the same session. BTW Lift has ListenerManager trait such as: class ShapeDisplay extends CometActor with CometListenee { override def registerWith = ShapeTracker ... } object ShapeTracked extends Actor with ListenerManager { var msg: MoveShape = _ override def createUpdate = msg override lowPriority = { } } Also there does not seem to be any throttling mechanism for client-side comet calls. In my attached example, even a very simple drag action creates dozens of ajax calls at once. Firefox does not handle this well. This is an on purpose Lift mechanism that avoids Ajax connections starvation. For instance I assume that you opened 2 firefox instances and tried it out. Well there is not difference between opening a new browser tab or a new browser window and Ajax parallel connections are shared among all instances. If you open one FF instance and oen IE instance you will not see this behavior anymore. I'd greatly appreciate any tips or suggestions. Thanks, Xavi P.S. Random question: Is there a CometActor instance for every browser viewing a comet stream? P.P.S.S. I feel there's some utility in a JsCometActor. If you all are amenable, I'd love to write up a proposal and maybe even lend a hand with implementing it. On Sun, May 31, 2009 at 4:07 AM, marius d. marius.dan...@gmail.com wrote: Yes looks like this is exactly what you would need. Please see partialUpdate from CometActor. As an example you can see sites/example/ src/main/scala/net/liftweb/example/comet/Clock.scala. partialUPdate function returns a JsCmd but there are of course implicit conversions between JsExp and JsCmd. What you're trying to do seems like an interesting thing for a Lift demo app in the sense that it would provide an interesting visual effect through CometActor. Br's, Marius On May 31, 4:46 am, Xavi Ramirez xavi@gmail.com wrote: I'm trying add some comet features to an existing JS app. Essentially, I want to drag/drop a widget and have my movements reflected on other user's browsers. You mentioned that a CometActor can cause JsExp to be executed. This might be what I'm looking for. How does that work? Thanks, Xavi On Sat, May 30, 2009 at 5:02 PM, marius d. marius.dan...@gmail.com wrote: Lift generates the JavaScript for Comet so you essentially don't have to worry about it. From a CometActor you just provide the markup that you need to render asynchronously or just the JsExp to be executed by browser. However could you please provide an overview of what you're trying to achieve? P.S. By default Lift's Ajax/Comet support works against JavaScript content type responses and not JSON. However you can use JSON as well. Br's, Marius On May 30, 3:12 pm, Xavi Ramirez xavi@gmail.com wrote: Hello, I was wondering if Lift provides a javascript interface to comet? Ideally it would look something like this: lift.getComet(comet-name).addListener(callback); // callback takes a json object lift.getComet(comet-name).postMessage(jsonObj); Thanks, Xavi cometmove.zip 64KViewDownload --~--~-~--~~~---~--~~ 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: JavaScript interface to Comet
Sorry hit send too soon ... continuation below On Jun 1, 10:42 am, marius d. marius.dan...@gmail.com wrote: On Jun 1, 2:59 am, Xavi Ramirez xavi@gmail.com wrote: Thanks for pointing me into the right direction. I've created a simple example (see attachment). In my example, the user can drag a div around the screen. Every time the div moves, the browser sends a json object with the x and y coordinates to the comet steam. Unfortunately I've ran into a couple of usability and performance problems. Assume the following set up: two browses are open (browser A and B) are all listening to comet stream K. Comet stream K broadcasts commands that update the position of a div. It seems that whenever browser A notifies comet stream K about an update to the div's position, stream K broadcasts the message to all its listeners, including browser A. In other words, browser A essentially hears its own echo. For the user of browser A, this causes the div to constantly jump between where the user actually dragged it and the position that comet stream K is currently broadcasting. This is something your app must handle. Your ShapeTracker actor is notified by all CometActor with AddListener hence your ShapeActor is sending messages to all running actors. Your app needs to discriminate the actors such that to not send the Comet response back if the notification request pertains to the same session. BTW Lift has ListenerManager trait such as: class ShapeDisplay extends CometActor with CometListenee { override def registerWith = ShapeTracker ... } object ShapeTracked extends Actor with ListenerManager { var msg: MoveShape = _ override def createUpdate = msg override lowPriority = { case m @ MoveShape(x, y) = msg = chat; updateListeners } ... } This is just a mechanism for your actor to interract with CometActors but you still need to determine to which actor you don't want to send the message. You could probably use a SessionVar to set some value before notifying the CometActors and in CometActor you could probably check if this SessionVar has the right value. If it does it would mean that the CometActor pertains to the same session and you wont send down any message back to the client. You would nee to unset this value once you determined that. There are probably better ways to do it ... but I'm thinking now that maybe we should do something inside ListenerManager to allow the users to send messages only to CometActors pertaining to other sessions only. I'll look more into this and see if/how we can provide something out of the box. Also there does not seem to be any throttling mechanism for client-side comet calls. In my attached example, even a very simple drag action creates dozens of ajax calls at once. Firefox does not handle this well. This is an on purpose Lift mechanism that avoids Ajax connections starvation. For instance I assume that you opened 2 firefox instances and tried it out. Well there is not difference between opening a new browser tab or a new browser window and Ajax parallel connections are shared among all instances. If you open one FF instance and oen IE instance you will not see this behavior anymore. I'd greatly appreciate any tips or suggestions. Thanks, Xavi P.S. Random question: Is there a CometActor instance for every browser viewing a comet stream? P.P.S.S. I feel there's some utility in a JsCometActor. If you all are amenable, I'd love to write up a proposal and maybe even lend a hand with implementing it. On Sun, May 31, 2009 at 4:07 AM, marius d. marius.dan...@gmail.com wrote: Yes looks like this is exactly what you would need. Please see partialUpdate from CometActor. As an example you can see sites/example/ src/main/scala/net/liftweb/example/comet/Clock.scala. partialUPdate function returns a JsCmd but there are of course implicit conversions between JsExp and JsCmd. What you're trying to do seems like an interesting thing for a Lift demo app in the sense that it would provide an interesting visual effect through CometActor. Br's, Marius On May 31, 4:46 am, Xavi Ramirez xavi@gmail.com wrote: I'm trying add some comet features to an existing JS app. Essentially, I want to drag/drop a widget and have my movements reflected on other user's browsers. You mentioned that a CometActor can cause JsExp to be executed. This might be what I'm looking for. How does that work? Thanks, Xavi On Sat, May 30, 2009 at 5:02 PM, marius d. marius.dan...@gmail.com wrote: Lift generates the JavaScript for Comet so you essentially don't have to worry about it. From a CometActor you just provide the markup that you need to render asynchronously or just the JsExp to be executed by browser. However could you please provide an overview of what you're trying to achieve? P.S.
[Lift] Re: lift views
Just create an XSLT template to convert the lift templates to a a more readable form? Should be possible? Your thinking just have an XSLT just for preview purposes? That would be pretty sweet. Perhaps we can do something with this: http://mojo.codehaus.org/xslt-maven-plugin/transform-mojo.html 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: lift views
On Mon, Jun 1, 2009 at 11:05 AM, Timothy Perrett timo...@getintheloop.euwrote: Just create an XSLT template to convert the lift templates to a a more readable form? Should be possible? Your thinking just have an XSLT just for preview purposes? That would be pretty sweet. Yes, my point exactly! :) Perhaps we can do something with this: http://mojo.codehaus.org/xslt-maven-plugin/transform-mojo.html Cheers, Tim -- Viktor Klang Rockstar Developer --~--~-~--~~~---~--~~ 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 views
Don't worry I'm just being slow as per normal viktor! Do you want to try setting this up or shall I? Cheers, Tim Sent from my iPhone On 1 Jun 2009, at 10:52, Viktor Klang viktor.kl...@gmail.com wrote: On Mon, Jun 1, 2009 at 11:05 AM, Timothy Perrett timo...@getintheloop.eu wrote: Just create an XSLT template to convert the lift templates to a a more readable form? Should be possible? Your thinking just have an XSLT just for preview purposes? That would be pretty sweet. Yes, my point exactly! :) Perhaps we can do something with this: http://mojo.codehaus.org/xslt-maven-plugin/transform-mojo.html Cheers, Tim -- Viktor Klang Rockstar Developer --~--~-~--~~~---~--~~ 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 views
On Mon, Jun 1, 2009 at 12:15 PM, Timothy Perrett timo...@getintheloop.euwrote: Don't worry I'm just being slow as per normal viktor! Do you want to try setting this up or shall I? Make a draft and we'll help eachother out :) Cheers, Tim Sent from my iPhone On 1 Jun 2009, at 10:52, Viktor Klang viktor.kl...@gmail.com wrote: On Mon, Jun 1, 2009 at 11:05 AM, Timothy Perrett timo...@getintheloop.euwrote: Just create an XSLT template to convert the lift templates to a a more readable form? Should be possible? Your thinking just have an XSLT just for preview purposes? That would be pretty sweet. Yes, my point exactly! :) Perhaps we can do something with this: http://mojo.codehaus.org/xslt-maven-plugin/transform-mojo.html http://mojo.codehaus.org/xslt-maven-plugin/transform-mojo.html Cheers, Tim -- Viktor Klang Rockstar Developer -- Viktor Klang Rockstar Developer --~--~-~--~~~---~--~~ 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 views
Make a draft and we'll help eachother out :) Ok will do - perhaps try mocking this up later in the week. Any thoughts in and around this otherwise? Must haves vs nice to have? 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: Record and Field
what Java version are you using? On Jun 1, 1:58 pm, Oliver Lambert olambo...@gmail.com wrote: When I try to run createRecord on a net.liftweb.record.Record, I get a java.lang.ExceptionInInitializerError. Any ideas what I might be doing wrong? cheers Oliver --~--~-~--~~~---~--~~ 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: Record and Field
Im not at the machine right now, but I believe it was a version of 1.6 on Ubuntu, I was running against the snapshot of liftweb that I cloned a couple of days ago. I've rerun On my mac, build 1.6.0_07-b06-153 but the exception with build 1.0 is different, java.lang.IllegalArgumentException: wrong number of arguments On Mon, Jun 1, 2009 at 10:05 PM, marius d. marius.dan...@gmail.com wrote: what Java version are you using? On Jun 1, 1:58 pm, Oliver Lambert olambo...@gmail.com wrote: When I try to run createRecord on a net.liftweb.record.Record, I get a java.lang.ExceptionInInitializerError. Any ideas what I might be doing wrong? cheers Oliver --~--~-~--~~~---~--~~ 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] Prevent direct access to templates
In my webapp directory I have template called login_ru.xhtml. If I type http://localhost:8080/login; in my browser I see processed template. But if I type http://localhost:8080/login_ru.xhtml; I see not processed template. Why lift do not process template? --~--~-~--~~~---~--~~ 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] Advice for rendering results from snippet
I have a search page that contains a simple form with a single text field and submit button. On submit a search is performed using the value from the textfield as a param and the results are displayed. Easy so far except that I want to show the same page again i.e search.html with no results - search html with results. I have struggled with this for a while but finally got it working by making the snippet a stateful one but I don't really understand why it would have to be stateful to work as I don't need to remember the results between requests. Am I going about the the wrong way? In MVC land we'd show the initial search page with an empty results table and on submit pop the results into a list and add to the model which would be rendered by jsp tags. Code below which is not pretty and gets results from a Solr engine as xml: lift:surround with=default at=content div lift:PropertySearch.search form=POST div id=search s:searchField/s:submit/ /div s:theresults table theadtdId/tdtdName/tdtdLocation/tdtdHomepage/ tdtdSmoking/tdtdPets/td/thead tbodyresult:listtrtdr:id//tdtdr:name// tdtdr:location//tdtdr:url//tdtdr:smoking// tdtdr:pets//td/tr/result:list/tbody /table /s:theresults /lift:PropertySearch.search /div /lift:surround -- class PropertySearch extends StatefulSnippet { var searchTxt = var results = List[HashMap[String,String]]() ::: Nil var dispatch : DispatchIt = { case search = search _ } def search(xhtml: NodeSeq): NodeSeq = { def processSearch() = { results = List[HashMap[String,String]]() ::: Nil Log.info(Running camel route direct:querySolr to find docs) val p = RouteBuilderHelper.getTemplate p.start var resp = p.sendBodyAndHeader(direct:querySolr, direct:querySolr, HttpProducer.QUERY, q= + searchTxt) val x1 = RouteBuilderHelper.camelResponseToXml(resp) Log.info(Received: + x1) Log.info(resul...@numfound= + x1 \ result \ @numFound) if (hasResult(x1)) { Log.info(found matches) val xmlResults = x1 \ result Log.info(xmlResults) for(result - xmlResults \\ doc) { val attrMap = new HashMap[String, String] for(str - result \\ str) { val attrName = (str \ @name).text val attrVal = str.text Log.info(attrName + = + attrVal) attrMap += (attrName - attrVal) // add to map } for(i - result \\ int) { val attrName = (i \ @name).text val attrVal = i.text Log.info(attrName + = + attrVal) attrMap += (attrName - attrVal) // add to map } for(i - result \\ bool) { val attrName = (i \ @name).text val attrVal = i.text Log.info(attrName + = + attrVal) attrMap += (attrName - attrVal) // add to map } results = results ::: List(attrMap) // add to list } } else { Log.info(No matches) } p.stop Log.info(Finished results: + results) } bind(s, xhtml, searchField - SHtml.text(searchTxt, searchTxt = _), theresults - results.flatMap(r = bind(r, chooseTemplate (result,list, xhtml), id - r (id), name - r (name), location - r (location), url - r(url), smoking - r (smoking),pets - r(pets) )), submit - SHtml.submit(Search, processSearch) ) } } --~--~-~--~~~---~--~~ 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: Prevent direct access to templates
What do you have in your SiteMap? .. only login or both login and login_ru. Normally you should only have login and login_ru would be picked up automatically by lift depending on what Locale the LiftRules.localeCalculator returns. Br's, Marius On Jun 1, 9:52 am, feelgood asseliva...@gmail.com wrote: In my webapp directory I have template called login_ru.xhtml. If I type http://localhost:8080/login; in my browser I see processed template. But if I type http://localhost:8080/login_ru.xhtml; I see not processed template. Why lift do not process template? --~--~-~--~~~---~--~~ 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: Advice for rendering results from snippet
ah ha moment. I switched to using a requestVar that contains my results list and instead of trying to bind the results to the same snippet I have a second snippet in the same page (same src file but diff function) that is able to access the requestVar of results and bind the values to the tags. On Jun 1, 11:53 am, Ewan ehar...@gmail.com wrote: I have a search page that contains a simple form with a single text field and submit button. On submit a search is performed using the value from the textfield as a param and the results are displayed. Easy so far except that I want to show the same page again i.e search.html with no results - search html with results. I have struggled with this for a while but finally got it working by making the snippet a stateful one but I don't really understand why it would have to be stateful to work as I don't need to remember the results between requests. Am I going about the the wrong way? In MVC land we'd show the initial search page with an empty results table and on submit pop the results into a list and add to the model which would be rendered by jsp tags. Code below which is not pretty and gets results from a Solr engine as xml: lift:surround with=default at=content div lift:PropertySearch.search form=POST div id=search s:searchField/s:submit/ /div s:theresults table theadtdId/tdtdName/tdtdLocation/tdtdHomepage/ tdtdSmoking/tdtdPets/td/thead tbodyresult:listtrtdr:id//tdtdr:name// tdtdr:location//tdtdr:url//tdtdr:smoking// tdtdr:pets//td/tr/result:list/tbody /table /s:theresults /lift:PropertySearch.search /div /lift:surround -- class PropertySearch extends StatefulSnippet { var searchTxt = var results = List[HashMap[String,String]]() ::: Nil var dispatch : DispatchIt = { case search = search _ } def search(xhtml: NodeSeq): NodeSeq = { def processSearch() = { results = List[HashMap[String,String]]() ::: Nil Log.info(Running camel route direct:querySolr to find docs) val p = RouteBuilderHelper.getTemplate p.start var resp = p.sendBodyAndHeader(direct:querySolr, direct:querySolr, HttpProducer.QUERY, q= + searchTxt) val x1 = RouteBuilderHelper.camelResponseToXml(resp) Log.info(Received: + x1) Log.info(resul...@numfound= + x1 \ result \ @numFound) if (hasResult(x1)) { Log.info(found matches) val xmlResults = x1 \ result Log.info(xmlResults) for(result - xmlResults \\ doc) { val attrMap = new HashMap[String, String] for(str - result \\ str) { val attrName = (str \ @name).text val attrVal = str.text Log.info(attrName + = + attrVal) attrMap += (attrName - attrVal) // add to map } for(i - result \\ int) { val attrName = (i \ @name).text val attrVal = i.text Log.info(attrName + = + attrVal) attrMap += (attrName - attrVal) // add to map } for(i - result \\ bool) { val attrName = (i \ @name).text val attrVal = i.text Log.info(attrName + = + attrVal) attrMap += (attrName - attrVal) // add to map } results = results ::: List(attrMap) // add to list } } else { Log.info(No matches) } p.stop Log.info(Finished results: + results) } bind(s, xhtml, searchField - SHtml.text(searchTxt, searchTxt = _), theresults - results.flatMap(r = bind(r, chooseTemplate (result,list, xhtml), id - r (id), name - r (name), location - r (location), url - r(url), smoking - r (smoking),pets - r(pets) )), submit - SHtml.submit(Search, processSearch) ) } } --~--~-~--~~~---~--~~ 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: Prevent direct access to templates
SiteMap contains login only. On 1 июн, 19:21, marius d. marius.dan...@gmail.com wrote: What do you have in your SiteMap? .. only login or both login and login_ru. Normally you should only have login and login_ru would be picked up automatically by lift depending on what Locale the LiftRules.localeCalculator returns. Br's, Marius On Jun 1, 9:52 am, feelgood asseliva...@gmail.com wrote: In my webapp directory I have template called login_ru.xhtml. If I type http://localhost:8080/login; in my browser I see processed template. But if I type http://localhost:8080/login_ru.xhtml; I see not processed template. Why lift do not process template? --~--~-~--~~~---~--~~ 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] Newbie question: Templates cached?
Hi, To my surprise when I changed the css in the default.html in hidden templates I had to restart jetty. Is this expected? Normal? can it be turned off? Thanks, Jesse --~--~-~--~~~---~--~~ 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: Newbie question: Templates cached?
Templates are cached when running in production mode. Templates should not be cached in development (default) mode. What version of Lift are you using? On Mon, Jun 1, 2009 at 8:01 AM, Jesse Eichar jesse.eic...@camptocamp.comwrote: Hi, To my surprise when I changed the css in the default.html in hidden templates I had to restart jetty. Is this expected? Normal? can it be turned off? Thanks, Jesse -- 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: Prevent direct access to templates
In Boot.scala: LiftRules.passNotFoundToChain = false If this is set to true and Lift cannot process a page, it passes the request on to the Servlet chain which will serve the xhtml file. 2009/6/1 feelgood asseliva...@gmail.com SiteMap contains login only. On 1 июн, 19:21, marius d. marius.dan...@gmail.com wrote: What do you have in your SiteMap? .. only login or both login and login_ru. Normally you should only have login and login_ru would be picked up automatically by lift depending on what Locale the LiftRules.localeCalculator returns. Br's, Marius On Jun 1, 9:52 am, feelgood asseliva...@gmail.com wrote: In my webapp directory I have template called login_ru.xhtml. If I type http://localhost:8080/login; in my browser I see processed template. But if I type http://localhost:8080/login_ru.xhtml; I see not processed template. Why lift do not process template? -- 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: Snippet name clashes
What is about: lift:path.Snippet.action / Where there is following exclusive cases for path: 1 path is a relative path from one of the packages denoted by LiftRules.addToPackages to a Snippet class 2 path is a path from the _root_ to the Snippet class. And the Lift can sequentially try each case for resolve Snippet to use. On 21 май, 03:45, David Pollak feeder.of.the.be...@gmail.com wrote: On Wed, May 20, 2009 at 12:02 PM, Alex Boisvert boisv...@intalio.comwrote: 2009/5/20 David Pollak feeder.of.the.be...@gmail.com On Wed, May 20, 2009 at 9:38 AM, Alex Boisvert boisv...@intalio.comwrote: Maybe an optional package attribute? e.g., lift:snippet package=com.example type=Foo.bar form=POST ... /lift:snippet Dude... you're so 2008 with that syntax... :-) Yes, I know... I just couldn't come to terms with using dots in my XML elements. I guess I have issues ;) The current syntax is: lift:Foo.bar form=Post.../lift:Foo.bar I guess we can add a package attribute anyway, although it breaks the whole Snippet lookup mechanism (not the reflection code, but the partial functions). It seems it would be natural to use XML namespaces for mapping to Scala packages. LiftRules.mapNamespaceToPackage(http://com.example.myapp.widgets; - com.example.myapp.widgets) and then, html ... xmlns:example=http://com.example.myapp.snippets; example:Foo.bar ... /example:Foo.bar ? Interesting... it might impact rendering performance, but it's nice and flexible. alex -- 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 --~--~-~--~~~---~--~~ 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] Data model graph
Anyone know of an easy way to graph the data model of a JPA Lift app? I'm guessing there might be a way to do it with Eclipse or NetBeans. Chas. --~--~-~--~~~---~--~~ 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 does not display templates as described in the book.
On Sat, May 30, 2009 at 3:01 PM, Sean Reque seanre...@gmail.com wrote: Concrete examples are a great teaching tool, but unless you eventually teach the concepts behind the examples, your students are incapable of applying their knowledge to do anything beyond what they can glean from the examples example. It's like teaching math purely through example with no theory: your students may be able to pass your tests, but they won't understand what they are doing and come next year they won't be able to build on what they learned. I'm finding the lift book sorely lacking in teaching concepts, and because of that I'm having an all but impossible time learning what is actually possible in lift. I I am not the kind of programmer that just copies and pastes other peoples' examples. I want to understand my tool and use it to it's fullest potential. When the lift book describes how pages are rendered, as if teaching a concept, and leaves out essential details like what scope templates are actually searched in, how am I supposed to understand how Lift works without posting to this mailing list or reading the source code? I wasted a couple of hours reducing my problem down to the simplest test case, and this is not the first time since learning lift where I've wasted so much time only to learn that either something doesn't work or doesn't work the way I thought. I'm pretty sure that had I picked rails or django for my pet project I would have been done already. Is it simply that Lift is too cutting edge for me? Am I the only one wasting hours of time learning how Lift and other Java tools work rather than getting my app written? Simple rule... if you have a question and have spent more than 30 minutes puzzling on it, please send a message to this list. The best way for us to understand the common questions and to write documentation (books, wiki pages, etc.) is to hear questions and get a cross-section of the kinds of questions people have. As long as you are polite, you will get a polite answer. You will not get a RTFM answer on this list. This list is populated by the Lift committers and most of the traffic on the list is from the Lift committers... that means you've got the ears and eyes of the people who are improving Lift and the Lift documentation. In terms of being frustrated... I am deeply sorry and I understand how something different can be very frustrating. Lift is different. It's not MVC because I think MVC (at least the web version) is very limiting. SiteMap is baked in because I believe in security first. But, we are here to help and we want to help and we want to learn what works and what doesn't. Finally, please upgrade to 1.1-SNAPSHOT. A lot of the frustrations (e.g., SiteMap) that people have had with Lift are made more developer friendly with nicer error messages in 1.1-SNAPSHOT. This, I hope, will help guide you and other developers in the right direction. Thanks, David I'm sorry if I sound frustrated. It is not just Lift I am struggling with. It's the whole stack I'm trying to learn! I am just getting immersed into the Java world again during my spare time. JAXB (especially JAXB!), buildr/maven/ant, Jetty, Scala and it's Eclipse plugin, Lift, each one of these tools has taken up hours of my time as I struggle to do what I thought I could do easily by reading about the tool or reading the tool's documentation. I am grateful for your response though and will take time to learn more about what the sitemap means in Lift. - Sean Reque On May 30, 2:56 pm, marius d. marius.dan...@gmail.com wrote: To access a page you need to add it in the SiteMap. I assume you are a bit confused about the relation between a Menu and a page. I mean after all maybe for your site you don't really need a menu but in Lift a Menu is much more then a visual representation of a way to navigate to your pages. It specifies various things such as how to access a page (constraints definition), visibility of a page in the sitemap Menu etc. So in short the SiteMap + Menu + Loc describes how pages can be accesses in a Lift app. The Lift book describes that by the means of concrete examples, detailed Menu Loc descriptions etc. Maybe some things in the book are not very obvious for a first read or just reading it as ultimatelly learning Lift is about coding trying things. The book is just a mean to an end, I would say. Br's, Marius On May 30, 9:38 pm, Sean Reque seanre...@gmail.com wrote: I have the pocketchange app with lift 1.0. I add a directory in webapp with an index.html file, identical to the help directory except with some changed text. I visit the URL corresponding to the directory and it doesn't show up at all, but tells me the requested resource is not found. I then add the directory index.html file to the global sitemap in Boot.scala the same as it's help counterpart, recompile and restart jetty, and
[Lift] Re: Continued problems with JPA archetypes
Hi, Derek, There are definitely some bugs since the move to 2.7.4. I mentioned the missing templates-hidden folder for one of the archetypes (basic, I think). It's missing for the other as well (blank?). I was able to get a blank one up and running and things seem to be going smoothly, but you should check them out when you get a chance. Chas. Derek Chen-Becker wrote: The velocity warnings are normal. What you're seeing may be a bug. I haven't tested the archetype since the change to 2.7.4, so it may be related. I'll test it out this week. Derek On Sat, May 30, 2009 at 6:38 PM, c...@munat.com mailto:c...@munat.com wrote: I tried again, running this: mvn archetype:generate \ -DarchetypeRepository=http://scala-tools.org/repo-snapshots \ -DarchetypeGroupId=net.liftweb \ -DarchetypeArtifactId=lift-archetype-jpa-basic \ -DarchetypeVersion=1.1-SNAPSHOT \ -DgroupId=com.xxx -DartifactId=xxx-master I then did a cd to xxx-master and ran mvn compile. I got this: mvn compile [15:06] [INFO] Scanning for projects... [INFO] Reactor build order: [INFO] xxx-master Master [INFO] xxx-master-spa [INFO] xxx-master-web [INFO] [INFO] Building xxx-master Master [INFO]task-segment: [compile] [INFO] Downloading: http://scala-tools.org/repo-snapshots/org/scala-lang/scala-compiler/2.7.4/scala-compiler-2.7.4.pom Downloading: http://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.7.4/scala-compiler-2.7.4.pom Downloading: http://scala-tools.org/repo-snapshots/org/scala-lang/scala-library/2.7.4/scala-library-2.7.4.pom Downloading: http://repo1.maven.org/maven2/org/scala-lang/scala-library/2.7.4/scala-library-2.7.4.pom Downloading: http://scala-tools.org/repo-snapshots/org/apache/derby/derby/10.4.2.0/derby-10.4.2.0.pom Downloading: http://repo1.maven.org/maven2/org/apache/derby/derby/10.4.2.0/derby-10.4.2.0.pom 1K http://repo1.maven.org/maven2/org/apache/derby/derby/10.4.2.0/derby-10.4.2.0.pom%0A1K downloaded Downloading: http://scala-tools.org/repo-snapshots/org/apache/derby/derby/10.4.2.0/derby-10.4.2.0.jar Downloading: http://repo1.maven.org/maven2/org/apache/derby/derby/10.4.2.0/derby-10.4.2.0.jar 2389K http://repo1.maven.org/maven2/org/apache/derby/derby/10.4.2.0/derby-10.4.2.0.jar%0A2389K downloaded [INFO] [scala:compile {execution: default}] [INFO] suggestion: remove the scalaVersion from pom.xml [ERROR] /private/var/www/xxx-master/src/main/scala [ERROR] /private/var/www/xxx-master/src/main/scala/../scala [WARNING] No source files found. [INFO] [INFO] Building xxx-master-spa [INFO]task-segment: [compile] [INFO] [INFO] [resources:resources] [INFO] Using default encoding to copy filtered resources. [INFO] [compiler:compile] [INFO] Nothing to compile - all classes are up to date [INFO] [scala:compile {execution: default}] [INFO] suggestion: remove the scalaVersion from pom.xml [ERROR] /private/var/www/xxx-master/spa/src/main/scala [ERROR] /private/var/www/xxx-master/spa/src/main/scala/../scala [INFO] Compiling 9 source files to /private/var/www/xxx-master/spa/target/classes [WARNING] /private/var/www/xxx-master/spa/src/main/scala/com/xxx/model/EnumvType.scala:48: error: value valueOf is not a member of Enumeration with com.xxx.model.Enumv [WARNING] return et.valueOf(value).getOrElse(null) [WARNING] ^ [WARNING] one error found [INFO] [ERROR] BUILD FAILURE [INFO] [INFO] command line returned non-zero value:1 [INFO] [INFO] For more information, run Maven with the -e switch [INFO] [INFO] Total time: 2 minutes 34 seconds [INFO] Finished at: Sat May 30 15:19:22 PDT 2009 [INFO] Final Memory: 7M/14M [INFO] I've changed nothing. Am I doing something wrong or is there a bug? Could part of the problem be the warnings below, which came up during generation of the app? [WARNING] org.apache.velocity.runtime.exception.ReferenceException:
[Lift] Could Lift have been implemented in another language?
This question is not intended to be inflammatory in any way. I have been developing web applications in Ruby on Rails for the last two years, and have recently been exploring Scala and Lift because of a growing dissatisfaction with Rails. I very much enjoy Ruby and appreciate the influence that Rails has had on other frameworks, but I have been increasingly frustrated with the Rails approach to MVC as my views have become more complex (which is the norm now). Anyway, this concern is what attracted me to Lift and its view-first approach which I think is superior. Having said that, I have been impressed with Scala, but find it somewhat difficult to grok compared to Ruby which always felt very natural to me. I'm not sure, but suspect this is because Scala attempts to do so much (object oriented, functional, type system, etc.). In what seems like a lifetime ago, I used to program in Lisp and say what you will about the parentheses, but you could go a long way with a relatively small number of concepts and a simple syntax. So, my question is whether something comparable to the Lift framework could be conveniently written in another language or is there something fundamental about Scala that makes Lift uniquely possible? By the way, I realize that the arguments against Ruby are generally performance and lack of support for concurrency, but what about other languages? In what way does the Lift approach uniquely benefit from Scala? - Mark --~--~-~--~~~---~--~~ 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: Could Lift have been implemented in another language?
On Mon, Jun 1, 2009 at 8:47 AM, Mark Lynn m...@sabado.com wrote: This question is not intended to be inflammatory in any way. I have been developing web applications in Ruby on Rails for the last two years, and have recently been exploring Scala and Lift because of a growing dissatisfaction with Rails. I very much enjoy Ruby and appreciate the influence that Rails has had on other frameworks, but I have been increasingly frustrated with the Rails approach to MVC as my views have become more complex (which is the norm now). Anyway, this concern is what attracted me to Lift and its view-first approach which I think is superior. Having said that, I have been impressed with Scala, but find it somewhat difficult to grok compared to Ruby which always felt very natural to me. I'm not sure, but suspect this is because Scala attempts to do so much (object oriented, functional, type system, etc.). In what seems like a lifetime ago, I used to program in Lisp and say what you will about the parentheses, but you could go a long way with a relatively small number of concepts and a simple syntax. So, my question is whether something comparable to the Lift framework could be conveniently written in another language or is there something fundamental about Scala that makes Lift uniquely possible? By the way, I realize that the arguments against Ruby are generally performance and lack of support for concurrency, but what about other languages? In what way does the Lift approach uniquely benefit from Scala? Lift could be implemented in another language, but Lift does make heavy use of Scala. Lift makes use of Scala's pattern matching and extractors for a lot of customization. This is type-safe, performant, declarative, and generally works very, very well. There are no other languages that have Scala's flexible pattern matching and extractors, so one would lose this important set of constructs in porting Lift to another language. Lift binds functions to GUIDs on the HTML page. This could be done in any language that has concise functions (e.g., Ruby, Python, Lisp, etc.) Lift uses Actors for long-running server-side components. Actors could be built in other languages, but without Scala's flexible pattern matching, the Actors would not be as clean. Lisp (and I presume Clojure) have similar concepts and could these Actor things could be used in a similar way. XML literals and immutable XML support. This is pretty much library-level stuff, but the Scala libraries have gotten XML more right than any other language I've seen (notably OCaml which I looked at for a while before coming to Scala.) Monadic stuff like Option and Box are an important part of Lift's concepts as are the for comprehensions. These are available (or could be written) in a fair number of languages. The J/EE infrastructure is a key part of Lift... being able to use large swaths of the Java/JVM tool chain is very important to performance and manageability. So, I'm guessing a Lift-like framework could be built best in Clojure. Personally, I like the type-safety of Scala. I find that my Ruby idioms translated nicely to Scala idioms. I've done a fair amount of dynamic language coding and well-typed language coding and I find that a good type system is worth its weight in gold to me. So, if you're a Lisp guy, how about writing a Lift-like framework in Clojure... I bet it can be done. Thanks, David - Mark -- 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: Strange behavior of RequestVar
Actually, based on my experience the first one shouldn't work and the second one should, because in the first one, oVar.is is called within the context of of the submit request, not the bind request. Derek On Sun, May 31, 2009 at 11:18 AM, feelgood asseliva...@gmail.com wrote: Compare two cases. First: class SnippetName { object oVar extends RequestVar(O.create) def processAdd(o: O) { ... } def add(xml: NodeSeq): NodeSeq = { bind (f, xml, field - SHtml.text(oVar.is.field, oVar.is.field(_)), submit - SHtml.submit(Submit, () = processAdd(oVar.is) ) } } And the second case: class SnippetName { object oVar extends RequestVar(O.create) def processAdd(o: O) { ... } def add(xml: NodeSeq): NodeSeq = { val o = oVar.is // CHANGES STARTS HERE bind (f, xml, field - SHtml.text(o.field, o.field(_)), submit - SHtml.submit(Submit, () = processAdd(o) ) } } In firts case all works fine, but in second case data not retained across submit trying. Why? --~--~-~--~~~---~--~~ 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: Strange behavior of RequestVar
Sorry, to clarify, the function () = processAdd(oVar.is) will not capture the current value of oVar. Rather, the oVar.is call is made when the submit function is called. Derek On Mon, Jun 1, 2009 at 10:51 AM, Derek Chen-Becker dchenbec...@gmail.comwrote: Actually, based on my experience the first one shouldn't work and the second one should, because in the first one, oVar.is is called within the context of of the submit request, not the bind request. Derek On Sun, May 31, 2009 at 11:18 AM, feelgood asseliva...@gmail.com wrote: Compare two cases. First: class SnippetName { object oVar extends RequestVar(O.create) def processAdd(o: O) { ... } def add(xml: NodeSeq): NodeSeq = { bind (f, xml, field - SHtml.text(oVar.is.field, oVar.is.field(_)), submit - SHtml.submit(Submit, () = processAdd(oVar.is) ) } } And the second case: class SnippetName { object oVar extends RequestVar(O.create) def processAdd(o: O) { ... } def add(xml: NodeSeq): NodeSeq = { val o = oVar.is // CHANGES STARTS HERE bind (f, xml, field - SHtml.text(o.field, o.field(_)), submit - SHtml.submit(Submit, () = processAdd(o) ) } } In firts case all works fine, but in second case data not retained across submit trying. Why? --~--~-~--~~~---~--~~ 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: Continued problems with JPA archetypes
The templates-hidden folder should be checked in already. I thought I fixed that last week. I'll work on the other bugs today. Derek On Sun, May 31, 2009 at 11:26 PM, Charles F. Munat c...@munat.com wrote: Hi, Derek, There are definitely some bugs since the move to 2.7.4. I mentioned the missing templates-hidden folder for one of the archetypes (basic, I think). It's missing for the other as well (blank?). I was able to get a blank one up and running and things seem to be going smoothly, but you should check them out when you get a chance. Chas. Derek Chen-Becker wrote: The velocity warnings are normal. What you're seeing may be a bug. I haven't tested the archetype since the change to 2.7.4, so it may be related. I'll test it out this week. Derek On Sat, May 30, 2009 at 6:38 PM, c...@munat.com mailto:c...@munat.com wrote: I tried again, running this: mvn archetype:generate \ -DarchetypeRepository=http://scala-tools.org/repo-snapshots \ -DarchetypeGroupId=net.liftweb \ -DarchetypeArtifactId=lift-archetype-jpa-basic \ -DarchetypeVersion=1.1-SNAPSHOT \ -DgroupId=com.xxx -DartifactId=xxx-master I then did a cd to xxx-master and ran mvn compile. I got this: mvn compile [15:06] [INFO] Scanning for projects... [INFO] Reactor build order: [INFO] xxx-master Master [INFO] xxx-master-spa [INFO] xxx-master-web [INFO] [INFO] Building xxx-master Master [INFO]task-segment: [compile] [INFO] Downloading: http://scala-tools.org/repo-snapshots/org/scala-lang/scala-compiler/2.7.4/scala-compiler-2.7.4.pom Downloading: http://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.7.4/scala-compiler-2.7.4.pom Downloading: http://scala-tools.org/repo-snapshots/org/scala-lang/scala-library/2.7.4/scala-library-2.7.4.pom Downloading: http://repo1.maven.org/maven2/org/scala-lang/scala-library/2.7.4/scala-library-2.7.4.pom Downloading: http://scala-tools.org/repo-snapshots/org/apache/derby/derby/10.4.2.0/derby-10.4.2.0.pom Downloading: http://repo1.maven.org/maven2/org/apache/derby/derby/10.4.2.0/derby-10.4.2.0.pom 1K http://repo1.maven.org/maven2/org/apache/derby/derby/10.4.2.0/derby-10.4.2.0.pom%0A1K downloaded Downloading: http://scala-tools.org/repo-snapshots/org/apache/derby/derby/10.4.2.0/derby-10.4.2.0.jar Downloading: http://repo1.maven.org/maven2/org/apache/derby/derby/10.4.2.0/derby-10.4.2.0.jar 2389K http://repo1.maven.org/maven2/org/apache/derby/derby/10.4.2.0/derby-10.4.2.0.jar%0A2389K downloaded [INFO] [scala:compile {execution: default}] [INFO] suggestion: remove the scalaVersion from pom.xml [ERROR] /private/var/www/xxx-master/src/main/scala [ERROR] /private/var/www/xxx-master/src/main/scala/../scala [WARNING] No source files found. [INFO] [INFO] Building xxx-master-spa [INFO]task-segment: [compile] [INFO] [INFO] [resources:resources] [INFO] Using default encoding to copy filtered resources. [INFO] [compiler:compile] [INFO] Nothing to compile - all classes are up to date [INFO] [scala:compile {execution: default}] [INFO] suggestion: remove the scalaVersion from pom.xml [ERROR] /private/var/www/xxx-master/spa/src/main/scala [ERROR] /private/var/www/xxx-master/spa/src/main/scala/../scala [INFO] Compiling 9 source files to /private/var/www/xxx-master/spa/target/classes [WARNING] /private/var/www/xxx-master/spa/src/main/scala/com/xxx/model/EnumvType.scala:48: error: value valueOf is not a member of Enumeration with com.xxx.model.Enumv [WARNING] return et.valueOf(value).getOrElse(null) [WARNING] ^ [WARNING] one error found [INFO] [ERROR] BUILD FAILURE [INFO] [INFO] command line returned non-zero value:1 [INFO] [INFO] For more information, run Maven with the -e switch [INFO] [INFO] Total time: 2 minutes 34 seconds [INFO] Finished at: Sat May 30 15:19:22 PDT 2009 [INFO] Final Memory: 7M/14M [INFO] I've changed
[Lift] Re: lift views
On Mon, Jun 1, 2009 at 1:53 PM, Timothy Perrett timo...@getintheloop.euwrote: Make a draft and we'll help eachother out :) Ok will do - perhaps try mocking this up later in the week. Any thoughts in and around this otherwise? Must haves vs nice to have? Hmmm, perhaps we should start with defining the needs. The OP could perhaps elaborate a bit more on how his needs are? Cheers, Tim -- Viktor Klang Rockstar Developer --~--~-~--~~~---~--~~ 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: Could Lift have been implemented in another language?
Thanks David. Your response was thoughtful and thorough which was exactly what I was hoping for. I did not want to start a language war. I have read good chunks of your Scala book and also Programming in Scala. I really like the language so far - just struggling to get it all through my thick skull and wanted to confirm that the investment was worth it. As I said, I really like the ideas in the Lift framework and am seriously considering using it for an upcoming project instead of Rails (the client does not care, and life might be easier using some Java libaries). For now, a new framework in Clojure will have to wait. :) - Mark On Jun 1, 2009, at 12:15 PM, David Pollak wrote: On Mon, Jun 1, 2009 at 8:47 AM, Mark Lynn m...@sabado.com wrote: This question is not intended to be inflammatory in any way. I have been developing web applications in Ruby on Rails for the last two years, and have recently been exploring Scala and Lift because of a growing dissatisfaction with Rails. I very much enjoy Ruby and appreciate the influence that Rails has had on other frameworks, but I have been increasingly frustrated with the Rails approach to MVC as my views have become more complex (which is the norm now). Anyway, this concern is what attracted me to Lift and its view-first approach which I think is superior. Having said that, I have been impressed with Scala, but find it somewhat difficult to grok compared to Ruby which always felt very natural to me. I'm not sure, but suspect this is because Scala attempts to do so much (object oriented, functional, type system, etc.). In what seems like a lifetime ago, I used to program in Lisp and say what you will about the parentheses, but you could go a long way with a relatively small number of concepts and a simple syntax. So, my question is whether something comparable to the Lift framework could be conveniently written in another language or is there something fundamental about Scala that makes Lift uniquely possible? By the way, I realize that the arguments against Ruby are generally performance and lack of support for concurrency, but what about other languages? In what way does the Lift approach uniquely benefit from Scala? Lift could be implemented in another language, but Lift does make heavy use of Scala. Lift makes use of Scala's pattern matching and extractors for a lot of customization. This is type-safe, performant, declarative, and generally works very, very well. There are no other languages that have Scala's flexible pattern matching and extractors, so one would lose this important set of constructs in porting Lift to another language. Lift binds functions to GUIDs on the HTML page. This could be done in any language that has concise functions (e.g., Ruby, Python, Lisp, etc.) Lift uses Actors for long-running server-side components. Actors could be built in other languages, but without Scala's flexible pattern matching, the Actors would not be as clean. Lisp (and I presume Clojure) have similar concepts and could these Actor things could be used in a similar way. XML literals and immutable XML support. This is pretty much library- level stuff, but the Scala libraries have gotten XML more right than any other language I've seen (notably OCaml which I looked at for a while before coming to Scala.) Monadic stuff like Option and Box are an important part of Lift's concepts as are the for comprehensions. These are available (or could be written) in a fair number of languages. The J/EE infrastructure is a key part of Lift... being able to use large swaths of the Java/JVM tool chain is very important to performance and manageability. So, I'm guessing a Lift-like framework could be built best in Clojure. Personally, I like the type-safety of Scala. I find that my Ruby idioms translated nicely to Scala idioms. I've done a fair amount of dynamic language coding and well-typed language coding and I find that a good type system is worth its weight in gold to me. So, if you're a Lisp guy, how about writing a Lift-like framework in Clojure... I bet it can be done. Thanks, David - Mark -- 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: Continued problems with JPA archetypes
Hmm. I just blew away my maven repo and tried the original command you used: mvn archetype:generate \ -DarchetypeRepository=http://scala-tools.org/repo-snapshots \ -DarchetypeGroupId=net.liftweb \ -DarchetypeArtifactId=lift-archetype-jpa-basic \ -DarchetypeVersion=1.1-SNAPSHOT \ -DgroupId=com.xxx -DartifactId=xxx-master I had to fix the resulting pom to make the releases repo on scala-tools.orghave a unique ID (fixed on master, this should be in the repo soon). The resulting project compiles fine for me: [INFO] [INFO] [INFO] [INFO] Reactor Summary: [INFO] [INFO] jpa-test Master ... SUCCESS [42.140s] [INFO] jpa-test-spa .. SUCCESS [52.224s] [INFO] jpa-test-web .. SUCCESS [1:10.868s] [INFO] [INFO] [INFO] BUILD SUCCESSFUL [INFO] [INFO] Total time: 2 minutes 45 seconds [INFO] Finished at: Mon Jun 01 12:29:12 MDT 2009 [INFO] Final Memory: 47M/519M [INFO] Just to double-check, have you cleared out your m2 folder? Derek On Mon, Jun 1, 2009 at 11:10 AM, Derek Chen-Becker dchenbec...@gmail.comwrote: The templates-hidden folder should be checked in already. I thought I fixed that last week. I'll work on the other bugs today. Derek On Sun, May 31, 2009 at 11:26 PM, Charles F. Munat c...@munat.com wrote: Hi, Derek, There are definitely some bugs since the move to 2.7.4. I mentioned the missing templates-hidden folder for one of the archetypes (basic, I think). It's missing for the other as well (blank?). I was able to get a blank one up and running and things seem to be going smoothly, but you should check them out when you get a chance. Chas. Derek Chen-Becker wrote: The velocity warnings are normal. What you're seeing may be a bug. I haven't tested the archetype since the change to 2.7.4, so it may be related. I'll test it out this week. Derek On Sat, May 30, 2009 at 6:38 PM, c...@munat.com mailto:c...@munat.com wrote: I tried again, running this: mvn archetype:generate \ -DarchetypeRepository=http://scala-tools.org/repo-snapshots \ -DarchetypeGroupId=net.liftweb \ -DarchetypeArtifactId=lift-archetype-jpa-basic \ -DarchetypeVersion=1.1-SNAPSHOT \ -DgroupId=com.xxx -DartifactId=xxx-master I then did a cd to xxx-master and ran mvn compile. I got this: mvn compile [15:06] [INFO] Scanning for projects... [INFO] Reactor build order: [INFO] xxx-master Master [INFO] xxx-master-spa [INFO] xxx-master-web [INFO] [INFO] Building xxx-master Master [INFO]task-segment: [compile] [INFO] Downloading: http://scala-tools.org/repo-snapshots/org/scala-lang/scala-compiler/2.7.4/scala-compiler-2.7.4.pom Downloading: http://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.7.4/scala-compiler-2.7.4.pom Downloading: http://scala-tools.org/repo-snapshots/org/scala-lang/scala-library/2.7.4/scala-library-2.7.4.pom Downloading: http://repo1.maven.org/maven2/org/scala-lang/scala-library/2.7.4/scala-library-2.7.4.pom Downloading: http://scala-tools.org/repo-snapshots/org/apache/derby/derby/10.4.2.0/derby-10.4.2.0.pom Downloading: http://repo1.maven.org/maven2/org/apache/derby/derby/10.4.2.0/derby-10.4.2.0.pom 1K http://repo1.maven.org/maven2/org/apache/derby/derby/10.4.2.0/derby-10.4.2.0.pom%0A1K downloaded Downloading: http://scala-tools.org/repo-snapshots/org/apache/derby/derby/10.4.2.0/derby-10.4.2.0.jar Downloading: http://repo1.maven.org/maven2/org/apache/derby/derby/10.4.2.0/derby-10.4.2.0.jar 2389K http://repo1.maven.org/maven2/org/apache/derby/derby/10.4.2.0/derby-10.4.2.0.jar%0A2389K downloaded [INFO] [scala:compile {execution: default}] [INFO] suggestion: remove the scalaVersion from pom.xml [ERROR] /private/var/www/xxx-master/src/main/scala [ERROR] /private/var/www/xxx-master/src/main/scala/../scala [WARNING] No source files found. [INFO] [INFO] Building xxx-master-spa [INFO]task-segment: [compile] [INFO] [INFO]
[Lift] Re: Continued problems with JPA archetypes
The templates-hidden folder was there with one archetype (basic) but not with the other (blank) when I ran them. But that was a few days ago. Chas. Derek Chen-Becker wrote: The templates-hidden folder should be checked in already. I thought I fixed that last week. I'll work on the other bugs today. Derek On Sun, May 31, 2009 at 11:26 PM, Charles F. Munat c...@munat.com mailto:c...@munat.com wrote: Hi, Derek, There are definitely some bugs since the move to 2.7.4. I mentioned the missing templates-hidden folder for one of the archetypes (basic, I think). It's missing for the other as well (blank?). I was able to get a blank one up and running and things seem to be going smoothly, but you should check them out when you get a chance. Chas. Derek Chen-Becker wrote: The velocity warnings are normal. What you're seeing may be a bug. I haven't tested the archetype since the change to 2.7.4, so it may be related. I'll test it out this week. Derek On Sat, May 30, 2009 at 6:38 PM, c...@munat.com mailto:c...@munat.com mailto:c...@munat.com mailto:c...@munat.com wrote: I tried again, running this: mvn archetype:generate \ -DarchetypeRepository=http://scala-tools.org/repo-snapshots \ -DarchetypeGroupId=net.liftweb \ -DarchetypeArtifactId=lift-archetype-jpa-basic \ -DarchetypeVersion=1.1-SNAPSHOT \ -DgroupId=com.xxx -DartifactId=xxx-master I then did a cd to xxx-master and ran mvn compile. I got this: mvn compile [15:06] [INFO] Scanning for projects... [INFO] Reactor build order: [INFO] xxx-master Master [INFO] xxx-master-spa [INFO] xxx-master-web [INFO] [INFO] Building xxx-master Master [INFO]task-segment: [compile] [INFO] Downloading: http://scala-tools.org/repo-snapshots/org/scala-lang/scala-compiler/2.7.4/scala-compiler-2.7.4.pom Downloading: http://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.7.4/scala-compiler-2.7.4.pom Downloading: http://scala-tools.org/repo-snapshots/org/scala-lang/scala-library/2.7.4/scala-library-2.7.4.pom Downloading: http://repo1.maven.org/maven2/org/scala-lang/scala-library/2.7.4/scala-library-2.7.4.pom Downloading: http://scala-tools.org/repo-snapshots/org/apache/derby/derby/10.4.2.0/derby-10.4.2.0.pom Downloading: http://repo1.maven.org/maven2/org/apache/derby/derby/10.4.2.0/derby-10.4.2.0.pom 1K http://repo1.maven.org/maven2/org/apache/derby/derby/10.4.2.0/derby-10.4.2.0.pom%0A1K downloaded Downloading: http://scala-tools.org/repo-snapshots/org/apache/derby/derby/10.4.2.0/derby-10.4.2.0.jar Downloading: http://repo1.maven.org/maven2/org/apache/derby/derby/10.4.2.0/derby-10.4.2.0.jar 2389K http://repo1.maven.org/maven2/org/apache/derby/derby/10.4.2.0/derby-10.4.2.0.jar%0A2389K downloaded [INFO] [scala:compile {execution: default}] [INFO] suggestion: remove the scalaVersion from pom.xml [ERROR] /private/var/www/xxx-master/src/main/scala [ERROR] /private/var/www/xxx-master/src/main/scala/../scala [WARNING] No source files found. [INFO] [INFO] Building xxx-master-spa [INFO]task-segment: [compile] [INFO] [INFO] [resources:resources] [INFO] Using default encoding to copy filtered resources. [INFO] [compiler:compile] [INFO] Nothing to compile - all classes are up to date [INFO] [scala:compile {execution: default}] [INFO] suggestion: remove the scalaVersion from pom.xml [ERROR] /private/var/www/xxx-master/spa/src/main/scala [ERROR] /private/var/www/xxx-master/spa/src/main/scala/../scala [INFO] Compiling 9 source files to /private/var/www/xxx-master/spa/target/classes [WARNING] /private/var/www/xxx-master/spa/src/main/scala/com/xxx/model/EnumvType.scala:48: error: value valueOf is not a member of Enumeration with com.xxx.model.Enumv [WARNING] return
[Lift] Re: Continued problems with JPA archetypes
Strange. I committed these back on the 26th: http://github.com/dpp/liftweb/commit/647f281e720720f09e3d6a5105ecb273cc0b592e Not sure where you're getting the stale archetypes from. As for the other issue with the enum, are you still seeing that? I can't reproduce it. Derek On Mon, Jun 1, 2009 at 1:52 PM, Charles F. Munat c...@munat.com wrote: The templates-hidden folder was there with one archetype (basic) but not with the other (blank) when I ran them. But that was a few days ago. Chas. Derek Chen-Becker wrote: The templates-hidden folder should be checked in already. I thought I fixed that last week. I'll work on the other bugs today. Derek On Sun, May 31, 2009 at 11:26 PM, Charles F. Munat c...@munat.com mailto:c...@munat.com wrote: Hi, Derek, There are definitely some bugs since the move to 2.7.4. I mentioned the missing templates-hidden folder for one of the archetypes (basic, I think). It's missing for the other as well (blank?). I was able to get a blank one up and running and things seem to be going smoothly, but you should check them out when you get a chance. Chas. Derek Chen-Becker wrote: The velocity warnings are normal. What you're seeing may be a bug. I haven't tested the archetype since the change to 2.7.4, so it may be related. I'll test it out this week. Derek On Sat, May 30, 2009 at 6:38 PM, c...@munat.com mailto:c...@munat.com mailto:c...@munat.com mailto:c...@munat.com wrote: I tried again, running this: mvn archetype:generate \ -DarchetypeRepository=http://scala-tools.org/repo-snapshots\ -DarchetypeGroupId=net.liftweb \ -DarchetypeArtifactId=lift-archetype-jpa-basic \ -DarchetypeVersion=1.1-SNAPSHOT \ -DgroupId=com.xxx -DartifactId=xxx-master I then did a cd to xxx-master and ran mvn compile. I got this: mvn compile [15:06] [INFO] Scanning for projects... [INFO] Reactor build order: [INFO] xxx-master Master [INFO] xxx-master-spa [INFO] xxx-master-web [INFO] [INFO] Building xxx-master Master [INFO]task-segment: [compile] [INFO] Downloading: http://scala-tools.org/repo-snapshots/org/scala-lang/scala-compiler/2.7.4/scala-compiler-2.7.4.pom Downloading: http://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.7.4/scala-compiler-2.7.4.pom Downloading: http://scala-tools.org/repo-snapshots/org/scala-lang/scala-library/2.7.4/scala-library-2.7.4.pom Downloading: http://repo1.maven.org/maven2/org/scala-lang/scala-library/2.7.4/scala-library-2.7.4.pom Downloading: http://scala-tools.org/repo-snapshots/org/apache/derby/derby/10.4.2.0/derby-10.4.2.0.pom Downloading: http://repo1.maven.org/maven2/org/apache/derby/derby/10.4.2.0/derby-10.4.2.0.pom 1K http://repo1.maven.org/maven2/org/apache/derby/derby/10.4.2.0/derby-10.4.2.0.pom%0A1K downloaded Downloading: http://scala-tools.org/repo-snapshots/org/apache/derby/derby/10.4.2.0/derby-10.4.2.0.jar Downloading: http://repo1.maven.org/maven2/org/apache/derby/derby/10.4.2.0/derby-10.4.2.0.jar 2389K http://repo1.maven.org/maven2/org/apache/derby/derby/10.4.2.0/derby-10.4.2.0.jar%0A2389K downloaded [INFO] [scala:compile {execution: default}] [INFO] suggestion: remove the scalaVersion from pom.xml [ERROR] /private/var/www/xxx-master/src/main/scala [ERROR] /private/var/www/xxx-master/src/main/scala/../scala [WARNING] No source files found. [INFO] [INFO] Building xxx-master-spa [INFO]task-segment: [compile] [INFO] [INFO] [resources:resources] [INFO] Using default encoding to copy filtered resources. [INFO] [compiler:compile] [INFO] Nothing to compile - all classes are up to date [INFO] [scala:compile {execution: default}] [INFO] suggestion: remove the scalaVersion from pom.xml [ERROR] /private/var/www/xxx-master/spa/src/main/scala [ERROR] /private/var/www/xxx-master/spa/src/main/scala/../scala
[Lift] Re: Continued problems with JPA archetypes
I think everything is working now. I blew away .m2 several times and retried things. When I used the blank archetype (and copied the templates-hidden file over from the basic), it worked fine. Maybe a server was down somewhere. If it's working for you, then it's probably OK now. Thanks for looking into it. Chas. Derek Chen-Becker wrote: Strange. I committed these back on the 26th: http://github.com/dpp/liftweb/commit/647f281e720720f09e3d6a5105ecb273cc0b592e Not sure where you're getting the stale archetypes from. As for the other issue with the enum, are you still seeing that? I can't reproduce it. Derek On Mon, Jun 1, 2009 at 1:52 PM, Charles F. Munat c...@munat.com mailto:c...@munat.com wrote: The templates-hidden folder was there with one archetype (basic) but not with the other (blank) when I ran them. But that was a few days ago. Chas. Derek Chen-Becker wrote: The templates-hidden folder should be checked in already. I thought I fixed that last week. I'll work on the other bugs today. Derek On Sun, May 31, 2009 at 11:26 PM, Charles F. Munat c...@munat.com mailto:c...@munat.com mailto:c...@munat.com mailto:c...@munat.com wrote: Hi, Derek, There are definitely some bugs since the move to 2.7.4. I mentioned the missing templates-hidden folder for one of the archetypes (basic, I think). It's missing for the other as well (blank?). I was able to get a blank one up and running and things seem to be going smoothly, but you should check them out when you get a chance. Chas. Derek Chen-Becker wrote: The velocity warnings are normal. What you're seeing may be a bug. I haven't tested the archetype since the change to 2.7.4, so it may be related. I'll test it out this week. Derek On Sat, May 30, 2009 at 6:38 PM, c...@munat.com mailto:c...@munat.com mailto:c...@munat.com mailto:c...@munat.com mailto:c...@munat.com mailto:c...@munat.com mailto:c...@munat.com mailto:c...@munat.com wrote: I tried again, running this: mvn archetype:generate \ -DarchetypeRepository=http://scala-tools.org/repo-snapshots \ -DarchetypeGroupId=net.liftweb \ -DarchetypeArtifactId=lift-archetype-jpa-basic \ -DarchetypeVersion=1.1-SNAPSHOT \ -DgroupId=com.xxx -DartifactId=xxx-master I then did a cd to xxx-master and ran mvn compile. I got this: mvn compile [15:06] [INFO] Scanning for projects... [INFO] Reactor build order: [INFO] xxx-master Master [INFO] xxx-master-spa [INFO] xxx-master-web [INFO] [INFO] Building xxx-master Master [INFO]task-segment: [compile] [INFO] Downloading: http://scala-tools.org/repo-snapshots/org/scala-lang/scala-compiler/2.7.4/scala-compiler-2.7.4.pom Downloading: http://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.7.4/scala-compiler-2.7.4.pom Downloading: http://scala-tools.org/repo-snapshots/org/scala-lang/scala-library/2.7.4/scala-library-2.7.4.pom Downloading: http://repo1.maven.org/maven2/org/scala-lang/scala-library/2.7.4/scala-library-2.7.4.pom Downloading: http://scala-tools.org/repo-snapshots/org/apache/derby/derby/10.4.2.0/derby-10.4.2.0.pom Downloading: http://repo1.maven.org/maven2/org/apache/derby/derby/10.4.2.0/derby-10.4.2.0.pom 1K http://repo1.maven.org/maven2/org/apache/derby/derby/10.4.2.0/derby-10.4.2.0.pom%0A1K downloaded Downloading: http://scala-tools.org/repo-snapshots/org/apache/derby/derby/10.4.2.0/derby-10.4.2.0.jar Downloading: http://repo1.maven.org/maven2/org/apache/derby/derby/10.4.2.0/derby-10.4.2.0.jar 2389K
[Lift] Future of the Lift wiki
Hello, I'm a bit confused about the future of the lift wiki. What's the end goal? In an ideal world is it supposed to be the main repository of lift knowledge, or just another documentation source? I personally feel that having one repository of knowledge is much more noob friendly. Currently new members have to navigate through started guides, books, e-mail threads, scala docs, and personal blogs to find relative information. Though the get started guided and book provide a good introduction, it's hard to progress from novice to intermediate with these fragmented resources. Thanks, Xavi --~--~-~--~~~---~--~~ 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] Maven lift-archetype-basic error
The 0.0.1-SNAPSHOT version of the lift-archetype-basic generates a default.html template with lift-tag:bind name=content /, which generate the following error: XML Parsing Error: prefix not bound to a namespace Changing the tab to lift:bind name=content/ eliminates this problem. Glenn... --~--~-~--~~~---~--~~ 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: Ideas for an ordered list in a form
I found this jQuery plugin that I think actually works much better than a simple palette control: http://plugins.jquery.com/project/asmselect There's an accompanying article that has a nice demo of it: http://www.ryancramer.com/journal/entries/select_multiple/ I'm going to see about making a widget from this instead. Much cleaner! Derek On Sun, May 31, 2009 at 5:28 PM, Derek Chen-Becker dchenbec...@gmail.comwrote: If it's not too much trouble to find that would be great, but don't work too hard searching : Derek On Sun, May 31, 2009 at 2:59 AM, marius d. marius.dan...@gmail.comwrote: A couple of years ago I did the same thing with drag and drop ... but I wrote the JS code, and for some reason I didn't really look for an existent solution :) ... I think I still have the damn thing and if you want to I could send it to you. On May 31, 3:01 am, Derek Chen-Becker dchenbec...@gmail.com wrote: I have some ideas for this, but my short term solution is to make a Lift version of Palette. Once I have it debugged I'll add it as a widget. Derek On Sat, May 30, 2009 at 3:17 AM, Joe Wass j...@folktunefinder.com wrote: Bump. I'm interested in this too. On May 28, 10:01 pm, Derek Chen-Becker dchenbec...@gmail.com wrote: Oops. I meant to give the link to Tapestry so that people could see what I'm talking about (image toward the middle of the page): http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tap... Derek On Thu, May 28, 2009 at 3:00 PM, Derek Chen-Becker dchenbec...@gmail.comwrote: I'd like to pick everyone's brains on a small requirement I have for an in-house app. I need to have the end-user select a subset of items from a master set. Additionally, the items should be ordered. Typically in the past I've used something like Tapestry's Palette control (or rolled my own with some selects and javascript). I don't think that this would be too hard to do in Lift, but I was wondering if anyone else has a better approach that they've used or seen in use. Thanks, 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: Future of the Lift wiki
Hi, Xavi, One of my tasks is to come up with a good organization for the wiki and a site map, as well as a list of things we'd like to add to it. Unfortunately, with the coming Scala/Liftoff and OSB conferences, I've been swamped with other things. But I am working on it, albeit slowly. If you have any specific recommendations, please post them. Thanks! Chas. Xavi Ramirez wrote: Hello, I'm a bit confused about the future of the lift wiki. What's the end goal? In an ideal world is it supposed to be the main repository of lift knowledge, or just another documentation source? I personally feel that having one repository of knowledge is much more noob friendly. Currently new members have to navigate through started guides, books, e-mail threads, scala docs, and personal blogs to find relative information. Though the get started guided and book provide a good introduction, it's hard to progress from novice to intermediate with these fragmented resources. Thanks, Xavi --~--~-~--~~~---~--~~ 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: Future of the Lift wiki
I agree that the wiki needs a clear remit. I have found it very useful for learning (especially the cheat sheet). But the first thing I ever did with lift (which was only last week) was firstly to read the 'getting started' document but secondly to RTFS (only some of it!), in particular Mapper. The API documentation is also invaluable for ultra- beginner learning. I felt reading the source code gave me the best feeling for the inside of Lift's head. I do think the wiki should be solidified and contain a page on every getting-started subject. But I think reading the source is an important step in learning and understanding Lift and the wiki should not duplicate the kind of information you can get that way. Things like the comments missing from the source (and therefore from the API) are perhaps better targets of Wiki material. Although perhaps that could be solved by adding more comments to source... I think the abstractions in Lift are fantastic but it doesn't do learners any favours to protect them from the abstractions that lie below... (by the way, how do I get an account? There's some typos I could fix) Joe On Jun 1, 10:07 pm, Xavi Ramirez xavi@gmail.com wrote: Hello, I'm a bit confused about the future of the lift wiki. What's the end goal? In an ideal world is it supposed to be the main repository of lift knowledge, or just another documentation source? I personally feel that having one repository of knowledge is much more noob friendly. Currently new members have to navigate through started guides, books, e-mail threads, scala docs, and personal blogs to find relative information. Though the get started guided and book provide a good introduction, it's hard to progress from novice to intermediate with these fragmented resources. Thanks, Xavi --~--~-~--~~~---~--~~ 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: JavaScript interface to Comet
Ahh thanks. I forget to wrap my script with ![CDATA[]]. Also, thanks for the working example. =] Adding the session variable did fix the echoing issue I was seeing, for the most part. As for my second problem, I still saw performance issues even when using a chrome/firefox combination. I've since added some simple throttling functionality. This seems to have fixed the majority of my performance problems. Thanks, Xavi On Mon, Jun 1, 2009 at 5:16 AM, Marius Danciu marius.dan...@gmail.com wrote: Xavi, I took the liebrty of doing some little changes to your code so that you won't get the echo. It is just an example (no elaborated design). It works for me, but let me know if this is suitable for you. Oh BTW, I've noticed that IE complains about some JS code. Br's, Marius --~--~-~--~~~---~--~~ 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: Future of the Lift wiki
Having gone through Rails, the Google App Engine with Django, and web2py over the last four years, I have seen it all as far as learning new frameworks goes, and I have posted a few ideas on that subject both here and on the book group. For those of us spoiled by the wealth of learning material on Rails, and to a lesser degree Django and web2py, all I can say is: 'Lift is a new framework, and a sophisticated one at that, which uses a new language derived from a convoluted one, and is at a relatively early stage of development, so therefore the designers are forging ahead to completion of the foundation, and thus there are few who can devote the time to creating the documentation we newcomers need.' My post on the book group defined the three classes of useful documents to be the Guidebook, the Encyclopedia, and the Cookbook. My role for the wiki is to hold Cookbook recipes which answer the most common 'how to' questions we encounter when building a website. In my personal learning quest, I am extending the 'ToDo' app by adding pieces of functionality, like many-to-many tagging, date manipulation, deletion, an admin interface, etc. As I come across solutions or questions, I post those on the group in order to help others and to get improvements and refinements from the members. David is right... Lift and Scala together are taking web applications to a whole new level of performance, so naturally it will take a little time to make things happen. By the way, today my copies of David's and Martin's Scala books arrived, and I urge all to purchase them yourselves! On Jun 1, 3:35 pm, Charles F. Munat c...@munat.com wrote: Hi, Xavi, One of my tasks is to come up with a good organization for the wiki and a site map, as well as a list of things we'd like to add to it. Unfortunately, with the coming Scala/Liftoff and OSB conferences, I've been swamped with other things. But I am working on it, albeit slowly. If you have any specific recommendations, please post them. Thanks! Chas. Xavi Ramirez wrote: Hello, I'm a bit confused about the future of the lift wiki. What's the end goal? In an ideal world is it supposed to be the main repository of lift knowledge, or just another documentation source? I personally feel that having one repository of knowledge is much more noob friendly. Currently new members have to navigate through started guides, books, e-mail threads, scala docs, and personal blogs to find relative information. Though the get started guided and book provide a good introduction, it's hard to progress from novice to intermediate with these fragmented resources. Thanks, Xavi --~--~-~--~~~---~--~~ 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: Newbie question: Templates cached?
If you're running from SBT, it's likely that SBT builds a WAR file and runs it (I'm just guessing here.) When you do an mvn jetty:run, you can change the templates, hit reload and all works just fine. On Mon, Jun 1, 2009 at 11:08 AM, Jesse Eichar jesse.eic...@camptocamp.comwrote: I am using lift-core 1.0 but perhaps it is related to the fact that I am building with SBT (simple-build-tool). I remember reading about a -D parameter that can be passed to control the mode. could you quickly remind me what the options are and I will take this to the SBT list and get the issue sorted. Jesse On Jun 1, 5:16 pm, David Pollak feeder.of.the.be...@gmail.com wrote: Templates are cached when running in production mode. Templates should not be cached in development (default) mode. What version of Lift are you using? On Mon, Jun 1, 2009 at 8:01 A M, Jesse Eichar jesse.eic...@camptocamp.comwrote: Hi, To my surprise when I changed the css in the default.html in hidden templates I had to restart jetty. Is this expected? Normal? can it be turned off? Thanks, Jesse -- 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 -- 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: Record with the new bind-immutable
On Sat, May 30, 2009 at 2:05 AM, marius d. marius.dan...@gmail.com wrote: On May 29, 4:32 pm, Oliver Lambert olambo...@gmail.com wrote: Hi Marius, To try and answer your question, I had to go and look at the Record code in more detail. I hadn't recently written the Binder Validator, so it wasn't designed to be complementary to anything else (however, some of the naming and methodology is very similar in both sets of code). What I found. 1) MetaRecord.validate === Binder.validate 2) Field.validators === BoundObj.validations 3) Field.validationFunction === Validator.validate 4) List[FieldError] === List[ValidationError] Can I get rid of Binder Validation and just use Record/Field validation? It certainly looks like I should try. However, I might have to add/change some of the original Lift code. For instance, I might want to add an errorType (with a default, so no code is broken) to FieldError. I might also want to move/change Field.validationFunction so its a little more like my Validator,with an errorType and toString (When I print my validators, the errorType give a little information on what they do, rather than just telling me I have a function - I also filter using the errorType) I think we should unify the models. What I particularly like about the existent validators is that it rlies on function type hence the flexibility to use anonymous functions or existent ones. SO IMHO it would be really neat to keep the existent validators per Field and if you would edd the errorType support would just great. I think Ive managed to unify the models. There is a new Validator object, net.liftweb.record.Validator that has an implicit conversion that accepts a function (anonymous or otherwise) and wraps it in a Validator class with an errorType. Thus validators can be written as functions or classes, and as they are wrapped in a class it should be easy enough to add support for javascript validation. I can't really test it on the existing Record code, as I can't even manage to instanciate a simple record. I have however, refactored the immutable binding code. Oh FWIW I'm not a fan of function names starting with capital letters such as: def Range(lower: Int, upper: Int, errStr: String) .. but that's just me. Me neither. Don't know why I did this. Other things of interest that I found. Could a Binder be a MetaRecord? There are definitely some similarities. Binder holds a set of immutable objects which can be an advantage, but MetaRecord can talk to databases which is kind of useful at times. I think we should keep the Meta Record and Record. Please keep in mind that MetaRecord and Record have NOTHING to do with database, they are completely separated per design so that Records can be also used outside of a RDBMS scope. For DB we have DBMetaRecord and DBRecord which are not fully implemented yet. Could a BoundObj be a Field. Same distinction as above. A BoundObj[T] may hold a reference to a string value that is completely invalid. I'm not sure I see this in Field. IMHO I would just add the features that your code has and current code does not (such as error type) and put them in the MetaRecord/Record (or wherever they belong) and have a single coherent model. Please also take a deeper look on the existent code, in MetaRecord, Record, Fields implementations Not DB Fields) and see what goodies can be added from your new code. And integrating client side validations (as Dave suggested) in the same model would be really cool. cheers Oliver On Fri, May 29, 2009 at 6:22 PM, marius d. marius.dan...@gmail.com wrote: I see ... still the question remains. What are we going to do with two validators? I'd like to understand the principles of your addition (... I know I should have dig into the code but I don't have much time now). I'd like to understand as I said previously if we have redundant validators or complementary functionality so that people to not get confused. I'm not trying at all to be negative or anything, just trying to understand the value added. Br's, Marius On May 29, 11:01 am, Oliver Lambert olambo...@gmail.com wrote: I'm aware of S.error and my ValidationError uses it when I'm ready to show errors. I've briefly looked at the ValidationFunction and the thing I might stumble on is the errorType which I rely on. I may be able to refactor the code to use List[FieldError] as I don't think I rely on errorType at this point. I'll have a go at modifying the Binder code. cheers Oliver On Fri, May 29, 2009 at 5:05 PM, Marius marius.dan...@gmail.com wrote: Oliver, I very briefly looked on your code and I saw that you have your own validator there. How would that play with the existent validattors that Record has where each field has a