[Lift] Re: New Milestone coming soon
Hi David, I read your response, but I didn't replied. Sorry. I've to figure out, what causes my problem. Seems like the CometActor update or something doesn't work properly, in M6 it did. But I don't really know, yet. thanks. On Thu, Nov 12, 2009 at 11:37 AM, Hannes hannes.flo...@gmx.li mailto:hannes.flo...@gmx.li wrote: Hi David, I wrote you a message about the CometActor received shutdown thing. I'm almost sure, that this is related to M7, but I've no idea, why or what. Did you read my response? This message is normal and expected. kind regards Tobias Folks, There are two critical issues with M7: * Issue 164 http://github.com/dpp/liftweb/issues#issue/164 JSON/Ajax messages do not carry Notices back to the client. * The Session manager is not initialized properly. Basically, this means that sessions will be expired by the web container, but not by Lift and GUIDs that map to functions on the server side are not removed until the session is terminated. We're planning to do an M7.1 release later this week (probably Friday). If there are other *critical* defects (stuff that means you can't use M7 in production), please speak now. Thanks, David -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics --~--~-~--~~~---~--~~ 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] Is there a paginate plug in the lift ?
Hi all, Is there a paginate plug in the lift ? Just like the WillPaginate in the Rails. Thanks for any suggestion ! Cheers, Neil --~--~-~--~~~---~--~~ 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-webkit-1.1-SNAPSHOT contains duplicate classes (e.g. Box.class)
I fixed it and it is on review board ... Heiko 2009/11/13 Heiko Seeberger heiko.seeber...@googlemail.com OK, I spotted the problem and will work on the issue ... Heiko 2009/11/13 Heiko Seeberger heiko.seeber...@googlemail.com maven-bundle-plugin? Well, that's my business, I guess. I will take a look ... Heiko 2009/11/12 Alex Boisvert alex.boisv...@gmail.com Can one of our resident Maven experts quickly look at: http://github.com/dpp/liftweb/issues/#issue/166 I took a brief look at the poms but couldn't figure why Maven was including classes from lift-common and lift-actor into lift-webkit. It is a feature of the maven-bundle-plugin? I can take care of fixing the issue if pointed towards the right direction. thanks! alex -- Heiko Seeberger My job: weiglewilczek.com My blog: heikoseeberger.name Follow me: twitter.com/hseeberger OSGi on Scala: scalamodules.org Lift, the simply functional web framework: liftweb.net -- Heiko Seeberger My job: weiglewilczek.com My blog: heikoseeberger.name Follow me: twitter.com/hseeberger OSGi on Scala: scalamodules.org Lift, the simply functional web framework: liftweb.net -- Heiko Seeberger My job: weiglewilczek.com My blog: heikoseeberger.name Follow me: twitter.com/hseeberger OSGi on Scala: scalamodules.org Lift, the simply functional web framework: liftweb.net --~--~-~--~~~---~--~~ 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-webkit-1.1-SNAPSHOT contains duplicate classes (e.g. Box.class)
Heiko Seeberger heiko.seeber...@googlemail.com writes: I fixed it and it is on review board ... Does this by any chance also fix http://github.com/dpp/liftweb/issues#issue/167 They both seem to be related to the maven bundle config /Jeppe --~--~-~--~~~---~--~~ 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-webkit-1.1-SNAPSHOT contains duplicate classes (e.g. Box.class)
I cannot see, how the maven-bundle-plugin should affect the creation of the source jar, but who knows ... Locally my -SOURCE.jar files are OK. After I get a Ship it we will see how the Hudson build behaves. Heiko 2009/11/13 Jeppe Nejsum Madsen je...@ingolfs.dk Heiko Seeberger heiko.seeber...@googlemail.com writes: I fixed it and it is on review board ... Does this by any chance also fix http://github.com/dpp/liftweb/issues#issue/167 They both seem to be related to the maven bundle config /Jeppe -- Heiko Seeberger My job: weiglewilczek.com My blog: heikoseeberger.name Follow me: twitter.com/hseeberger OSGi on Scala: scalamodules.org Lift, the simply functional web framework: liftweb.net --~--~-~--~~~---~--~~ 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: Problem with BlazeDS and LiftFilter 1.0+
David, Your call to Service.say is outside the scope of the Lift HTTP request, so it's not wrapped with the transaction management stuff. Exactly. The thing that I want LiftFilter to wrap /messagebroker/*, so I will get per-HTTP request automatic transaction management and my code will remain clean. LiftFilter 0.9 and BlazeDS worked perfectly together, but when I switched to Lift 1.0 and greater, LiftFilter killed BlazeDS. Removing mappings from web.xml or adding LiftRules.liftRequest.append { case Req(messagebroker :: _, _, _) = false } didn't really solved the problem but diverged it: BlazeDS is alive, but it made nice features of Lift useless. I believe that these are attempts to cure symptoms while disease is still here: LiftFilter kills BlazeDS. It would be great to have a solution like this: - LiftFilter wraps /messagebroker/* but doesn't change requests, so BlazeDS servlet still working - methods like Service.say gain transaction management from Lift and its code remains clean -- Oleksandr --~--~-~--~~~---~--~~ 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-webkit-1.1-SNAPSHOT contains duplicate classes (e.g. Box.class)
Heiko Seeberger heiko.seeber...@googlemail.com writes: I cannot see, how the maven-bundle-plugin should affect the creation of the source jar, but who knows ... My bad..not knowing maven, I assumed the bundle plugin is the one that creates jars. From a cursory look, I can see it seems to only bundle class files Locally my -SOURCE.jar files are OK. After I get a Ship it we will see how the Hudson build behaves. In that case, nothing has probably changed wrt the sources jar.strange though that yours look correct locally. Clearly the repo versions are wrong, e.g. the source jar at http://scala-tools.org/repo-snapshots/net/liftweb/lift-mapper/1.1-SNAPSHOT/ is only 809 bytes, yet it was uploaded at the same time as the real jar. /Jeppe --~--~-~--~~~---~--~~ 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-webkit-1.1-SNAPSHOT contains duplicate classes (e.g. Box.class)
Heiko Seeberger heiko.seeber...@googlemail.com writes: I cannot see, how the maven-bundle-plugin should affect the creation of the source jar, but who knows ... My bad..not knowing maven, I assumed the bundle plugin is the one that creates jars. From a cursory look, I can see it seems to only bundle class files NP! Let's see what happens as soon as I am allowed to push to master ... --~--~-~--~~~---~--~~ 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] Problem with rewriting and SessionVar
Hi, I seem to have a problem with SessionVars which I try to initialize in a LocRewrite. This is an entry point url to the app. It receives some parameters from the url, picks out the parameters and puts them in SessionVars and rewrites the request. I have problems setting the SessionVar when I hit the url in a clean browser (ie with no session) This is the code: private object curAccountId extends SessionVar[Box[Long]](Empty) private object curAccount extends RequestVar[Box[Account]] ({ println(read:+curAccountId); val found = currentAccountId.flatMap(id = getSingleton.find(id)); println(Found: +found); found}) with CleanRequestVarOnSessionTransition def currentAccountId: Box[Long] = curAccountId.is def currentAccount: Box[Account] = curAccount.is def currentAccount_=(account: Box[Account]) { println(set account: +account); curAccount.remove curAccountId.remove curAccountId.set({val s = account.map{a = a.id.is}; println(set: +s);s}); curAccount.set(account); println(read2:+curAccountId.is) } In the LocRewrite I call Account.setCurrentAccount = someAccount When the URL is hit in a clean browser, this is logged: set account: Full(dk.fleetzone.model.Account={name=Demo Account,id=1}) set: Full(1) read2:Empty If I hit the login page first (and nothing else, but I believe it triggers the creation of a http session), and the exact same url, this is logged: set account: Full(dk.fleetzone.model.Account={name=Demo Account,id=1}) set: Full(1) read2:Full(1) Any clues?? /Jeppe --~--~-~--~~~---~--~~ 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: Problem cloning lift repo.
The correct command line: git clone git://github.com/dpp/liftweb.git On Thu, Nov 12, 2009 at 9:44 PM, ivan ivan.se...@gmail.com wrote: I am trying to clone git lift repo and keep getting this error: git clone http://github.com/dpp/liftweb.git Initialized empty Git repository in /home/ivan/Dokumenti/Projects/ scala/lift/liftweb/.git/ got 38024d4c9cdf764c6d5c8350c78a64ff233b7f05 walk 38024d4c9cdf764c6d5c8350c78a64ff233b7f05 Getting alternates list for http://github.com/dpp/liftweb.git Getting pack list for http://github.com/dpp/liftweb.git Getting index for pack e107de95ba6e027dbdf6c0a2579c57730b8d4dfd got 3090feee6cdeb344fe3d94137ba175c68c400f39 Getting index for pack 320b9931ea32d90ae87a12ecd43238843aee9eba Getting pack e107de95ba6e027dbdf6c0a2579c57730b8d4dfd which contains a5a70794c6ad5d414c5778bd450f21fda50135cb got 579d28493a4dede0eba92521b954f575cf947532 got d9e584740f3e10e95df3b1edc1d7bb093128e922 error: Unable to get pack file http://github.com/dpp/liftweb.git/objects/pack/pack-e107de95ba6e027dbdf6c0a2579c57730b8d4dfd.pack The requested URL returned error: 502 error: Unable to find a5a70794c6ad5d414c5778bd450f21fda50135cb under http://github.com/dpp/liftweb.git Cannot obtain needed object a5a70794c6ad5d414c5778bd450f21fda50135cb while processing commit 38024d4c9cdf764c6d5c8350c78a64ff233b7f05. fatal: Fetch failed. If I try clone over git protocol I get another error: git clone git://github.com/dpp/liftweb.git Initialized empty Git repository in /home/ivan/Dokumenti/Projects/ scala/lift/liftweb/.git/ ... after some time github.com[0: 207.97.227.239]: errno=Connection timed out fatal: unable to connect a socket (Connection timed out) I think that this other error could have something to do with a firewall blocking git protocol port, but shouldn't clone work over http? I can clone my repos from github without problems. Any ideas? -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics --~--~-~--~~~---~--~~ 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: MegaProtoUser + MappedPassword question
Open a ticket, as this should be configurable. In case you didn't find it, the ** is taken from the MappedPassword object, field blankPw. This should be a var and there should probably be a per-MappedPassword field override as well. Derek On Sun, Nov 8, 2009 at 6:48 AM, george geo...@mattandgeorge.com wrote: I'm using MegaProtoUser which has a MappedPassword field. When the sign up form is displayed, the password field is pre- populated to '***' which is proving very confusing for some users. I would like to display the password field as a completely empty field, but I can not see a way to override this behavior. MegaProtoUser is mostly suiting my needs pretty well right now, so I am reluctant to roll my own for the sake of such a small detail. Does anyone have any ideas how I can achieve this? thanks george --~--~-~--~~~---~--~~ 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: Changes to transaction handling since M6?
That's really odd. As far as I know the only thing JPA related that might have changed is for the JPA Demo site (pom Hibernate version change). The transaction handling code is all in ScalaJPA, which also hasn't changed. JndiEMF explicitly opens a transaction before it even retrieves the EM from JNDI, so I don't know how you could be getting that kind of error. If you could give me more details (on-list or privately) I'd like to figure out what's going on here. Derek On Thu, Nov 12, 2009 at 5:49 PM, Kris Nuttycombe kris.nuttyco...@gmail.comwrote: Hi, all (Derek! :), Have there been significant changes in how transactions are handled by lift-jpa since M6? Due to the rearrangement of the repository, I'm having a hard time figuring out if the code has changed. I have a repeatable issue that shows up when changing between M6 and SNAPSHOT wherein I now get javax.persistence.TransactionRequiredExceptions when doing a merge using a JndiEMF with RequestVarEM in an AJAX callback. Has anything major changed in this timeframe? Kris --~--~-~--~~~---~--~~ 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: Problem with BlazeDS and LiftFilter 1.0+
On Fri, Nov 13, 2009 at 3:08 AM, oshyshko oshys...@gmail.com wrote: David, Your call to Service.say is outside the scope of the Lift HTTP request, so it's not wrapped with the transaction management stuff. Exactly. The thing that I want LiftFilter to wrap /messagebroker/*, so I will get per-HTTP request automatic transaction management and my code will remain clean. Sorry. You can either pass the request onto the Filter chain or handle it in Lift. You cannot do both. LiftFilter 0.9 and BlazeDS worked perfectly together, but when I switched to Lift 1.0 and greater, LiftFilter killed BlazeDS. First, this sounds like a bug in Lift 0.9. If Lift 0.9 was wrapping the call to filter.chain in the Lift request context, that's definitely a bug in Lift. Second, Lift did not kill BlazeDS. As I demonstrated, Lift is able to pass the request down the filter chain to BlazeDS without impacting the request or the request state in any way. Removing mappings from web.xml or adding LiftRules.liftRequest.append { case Req(messagebroker :: _, _, _) = false } didn't really solved the problem but diverged it: BlazeDS is alive, but it made nice features of Lift useless. They are not useless. The issue you're facing is the the S context is not available around your method calls. If there's a way to extract the JSESSIONID from BlazeDS, you can call SessionMaster.getSession(jsessionId, Empty). With the resulting session, you can call S.initIfUninitted(foundSession) { your code here } I don't know how BlazeDS works, but it may be possible to do something that sets up this kind of context around the dispatch code and you'd have the Lift session context and BlazeDS. I believe that these are attempts to cure symptoms while disease is still here: LiftFilter kills BlazeDS. No, it most certainly does not. Repeating that refrain is not helping address the issue. It would be great to have a solution like this: - LiftFilter wraps /messagebroker/* but doesn't change requests, so BlazeDS servlet still working - methods like Service.say gain transaction management from Lift and its code remains clean Unfortunately, without digging into BlazeDS, I can't help beyond the suggestion above. Thanks, David -- Oleksandr -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics --~--~-~--~~~---~--~~ 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: Problem with rewriting and SessionVar
On Fri, Nov 13, 2009 at 5:21 AM, Jeppe Nejsum Madsen je...@ingolfs.dkwrote: Hi, I seem to have a problem with SessionVars which I try to initialize in a LocRewrite. This is an entry point url to the app. It receives some parameters from the url, picks out the parameters and puts them in SessionVars and rewrites the request. I have problems setting the SessionVar when I hit the url in a clean browser (ie with no session) This is the code: private object curAccountId extends SessionVar[Box[Long]](Empty) private object curAccount extends RequestVar[Box[Account]] ({ println(read:+curAccountId); val found = currentAccountId.flatMap(id = getSingleton.find(id)); println(Found: +found); found}) with CleanRequestVarOnSessionTransition def currentAccountId: Box[Long] = curAccountId.is def currentAccount: Box[Account] = curAccount.is def currentAccount_=(account: Box[Account]) { println(set account: +account); curAccount.remove curAccountId.remove curAccountId.set({val s = account.map{a = a.id.is}; println(set: +s);s}); curAccount.set(account); println(read2:+curAccountId.is) } In the LocRewrite I call Account.setCurrentAccount = someAccount When the URL is hit in a clean browser, this is logged: set account: Full(dk.fleetzone.model.Account={name=Demo Account,id=1}) set: Full(1) read2:Empty If I hit the login page first (and nothing else, but I believe it triggers the creation of a http session), and the exact same url, this is logged: set account: Full(dk.fleetzone.model.Account={name=Demo Account,id=1}) set: Full(1) read2:Full(1) Any clues?? Yes. The rewrite phase takes place very early in the HTTP request/response cycle. It takes place before the statelessDispatch call. The statelessDispatch call is very important for REST style APIs as it does *not* cause the creation of a session, thus for lots of API calls, we don't have a session created for each call. The rewrite phase has to come before the statelessDispatch phase because the request has to be properly rewritten before being pattern matched against the partial functions that define the statelessDispatch Based on some of your prior needs, I've made the session available during the rewrite phase, but it's only if the session actually exists (basically, the request is checked for a session, but the request is not told create one if it doesn't already exists. So, the first request from a browser does not have a session and thus does not have session vars. Is there a way you can use RequestVars here? /Jeppe -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics --~--~-~--~~~---~--~~ 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: Build Broken?
I don't know how others feel, but I would like all bugs, even for unit tests, to go through issue tracking and review board. Mostly this is so that we have good documentation of what is happening to the codebase and why. Derek On Sat, Nov 7, 2009 at 11:45 AM, Joni Freeman freeman.j...@gmail.comwrote: Thanks for the test results. It looked like a charset problem in unit test. I changed the assertion in test to use more robust case class comparison instead of String comparison. Please let us know if this fixes the build on your machine. Committers, I pushed this small fix directly into master, skipping Review Board. Please let me know if this is not allowed even if the change is very small and just for unit tests. Cheers Joni On 7 marras, 07:22, aw anth...@whitford.com wrote: OK, found Hudson: http://hudson.scala-tools.org/job/Lift/ But now if that isn't broken, why is my fresh clone failing? --~--~-~--~~~---~--~~ 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: Problem with rewriting and SessionVar
David Pollak feeder.of.the.be...@gmail.com writes: [...] Yes. The rewrite phase takes place very early in the HTTP request/response cycle. It takes place before the statelessDispatch call. The statelessDispatch call is very important for REST style APIs as it does *not* cause the creation of a session, thus for lots of API calls, we don't have a session created for each call. The rewrite phase has to come before the statelessDispatch phase because the request has to be properly rewritten before being pattern matched against the partial functions that define the statelessDispatch Based on some of your prior needs, I've made the session available during the rewrite phase, but it's only if the session actually exists (basically, the request is checked for a session, but the request is not told create one if it doesn't already exists. I sort of guessed it had to do with this. I find rewriting really useful to write apps that need to extract info from the URL in a type-safe way before continuing the processing. I seem to run into a number of issues with this approach (some which you've fixed, thanks!), so was wondering if perhaps I'm misusing rewriting and there are better ways to approach this? A few thoughts: - Is it possible to create a session manually in the rewrite phase? If no, maybe a LiftRule PF that could be used to force session creation for certain requests? - Would it be possible to detect (at least in Dev mode) some of these misuses (i.e. using a SessionVar with no session) and emit a warning? So, the first request from a browser does not have a session and thus does not have session vars. Is there a way you can use RequestVars here? I guess I can hack something together for this case, but I need to think a little more to make sure it fits cleanly with the rest. If I just redirect back to the same page, will this trigger the session creation or does the redirect happen before the session is created? It's a multipage workflow, so SessionVars seem like the easy way out :-) /Jeppe --~--~-~--~~~---~--~~ 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] Accessing functions of a lift webapp from the command line
Hi Lift Community, I'm pretty new to the Scala/Lift world. My idea is to port a web application written by me in PHP to Scala/Lift. Unfortunately, the PHP version also has some functions which are used by some cronjob, i.e. from the command line. So my first question is: Is there any possibility to access functions in a Lift webapp from the command line? My idea in a more general version is: I want to write some application which can be accessed in multiple ways: for example from the command line (as just described), from the web using normal xhtml pages, from the web using json requests etc. Of course, I want to write as less functionality as possible twice so there should be some core which has the logic (and probably some model/database in the background) and several interfaces (one command line interface, one webinterface, one json interface...) which should only act as translators. For example the web interface gets some (let's say POST) request, extracts the data needed to process the request and passes these date to the core. The core does something and returns the data needed for an answer. The webinterface takes these data and creates some xhtml page out of it. In contrast to that, the json interface only gets a request in json format, extracts the data, passes them to the core, gets the result and sends back a *json* answer. The command line interface will just take some command line arguments, extract data, pass them and answer with *some plain text*. So my second question is: How does this idea fit into the lift world? One reason for my questions: As I understood it, Lift is heavily bound to the webinterface part I described above. For example the snippets which seem to be one very important part of Lift can only work with xml/xhtml data. I hope you understand my ideas and questions, I'm still learning English ;-) Thanks in advance for all answers!! Julian --~--~-~--~~~---~--~~ 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 specify the SELECT statement in the Mapper ?
MetaMapper.findAllFields may work for what you're doing, but with the DAYOFWEEK conversion you may just have to go directly against the DB. Derek On Sun, Nov 8, 2009 at 11:44 PM, Neil.Lv anim...@gmail.com wrote: Hi all, There is some example code: ### SELECT id, name, sex, created_at, DAYOFWEEK(created_at,) as week, (CURRENT_DATE) as t FROM users WHERE created_at (CURRENT_DATE ) AND created_at (CURRENT_DATE + interval 2 day) ORDER BY created_at ASC ### How can i specify the SELECT statement that i don't want all the columns and i want add the column as week in the example code ? Any help would be much appreciated! Cheers, Neil --~--~-~--~~~---~--~~ 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: S.uri not including query params
You should be able to specify the redirect, so this may be a bug. Where are you setting the loginRedirect? It gets reset to the referred page when a login is required, so you'll have to set it after that point. Derek On Mon, Nov 9, 2009 at 3:12 AM, opyate opy...@gmail.com wrote: Hello guys, I thought the purpose of loginRedirect was to be able to override where the newly logged-in user gets redirected to. I'm doing it like so, in model/User: loginRedirect(Full(/loadPrivateKey)) ..but it just goes to the page I accessed before I clicked on / user_mgt/login Is there another way I should be aware of to reach my goal? I guess I could be more specific: once a user is logged in I need to load his/her private key into memory with which to decrypt sensitive data from the database (previously encrypted with a public key). I have all the code written using BouncyCastle, but was wondering if Lift offers something built-in. I'd be happy to forward my code on if this could be a useful extension to the Lift code. Thanks, Juan On Oct 21, 2:18 pm, Derek Chen-Becker dchenbec...@gmail.com wrote: http://github.com/dpp/liftweb/issues/#issue/121 If I have some time this afternoon I'll fix it. On Tue, Oct 20, 2009 at 8:07 PM, Naftoli Gugenheim naftoli...@gmail.com wrote: Then my addition to MetaMegaProtoUser of loginRedirect has a bug, because loginFirst sets it based on S.uri. Since I'm not usually around an internet connection, I won't be able to go through filing a ticket, putting a diff on Review Board, and pushing it, in any small amount of time. - David Pollakfeeder.of.the.be...@gmail.com wrote: On Tue, Oct 20, 2009 at 2:48 PM, Naftoli Gugenheim naftoli...@gmail.com wrote: Is S.uri supposed to return the part of the URL after '?'? No -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Surf the harmonics --~--~-~--~~~---~--~~ 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 Mapper support for Oracle Sequences
The code in 1.1-SNAPSHOT already uses sequences for Oracle. Here's the relevant code: override def primaryKeySetup(tableName : String, columnName : String) : List[String] = { /* * This trigger and sequence setup is taken from http://www.databaseanswers.org/sql_scripts/ora_sequence.htm */ super.primaryKeySetup(tableName, columnName) ::: List(CREATE SEQUENCE + tableName + _sequence START WITH 1 INCREMENT BY 1, CREATE OR REPLACE TRIGGER + tableName + _trigger BEFORE INSERT ON + tableName + + FOR EACH ROW + WHEN (new. + columnName + is null) + BEGIN + SELECT + tableName + _sequence.nextval INTO :new. + columnName + FROM DUAL; + END;) } Are you running into an issue with it? Derek On Tue, Nov 10, 2009 at 1:46 AM, aw anth...@whitford.com wrote: For Oracle database tables, one typically creates a Sequence to provide primary key values. For example: create table WIDGET ( id Number(8,0) not null, name varchar2(50) not null, ... constraint WIDGET_PK primary key (id), ... ) create sequence WIDGET_ID_SEQ When creating records using Mapper, is there a convenient way to get Mapper to automatically leverage the corresponding sequence to populate the id column? (Why Oracle doesn't do this automatically in 2009 like SQL Server, Sybase, and other database systems, is beyond me...) --~--~-~--~~~---~--~~ 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: Changes to scala-tools.org Hudson
Josh, ScalaJPA has the following distribution setup: distributionManagement repository idscala-tools.org/id urlhttp://nexus.scala-tools.org/content/repositories/releases/url /repository snapshotRepository idscala-tools.org/id urlhttp://nexus.scala-tools.org/content/repositories/snapshots/url uniqueVersiontrue/uniqueVersion /snapshotRepository site idscala-tools.org/id url http://nexus.scala-tools.org/content/repositories/mvnsites/${project.artifactId} /url /site /distributionManagement Does that look correct? On Thu, Nov 5, 2009 at 5:58 PM, Josh Suereth joshua.suer...@gmail.comwrote: Scala-tools.org's Hudson server will no longer allow local deployment to the repository. You *must* submit all snapshot/release artifacts through the nexus webapp. The hudson server will provide a server id ( nexus.scala-tools.org) that will have appropriate (and appropriately hidden) credentials for nightly deployments of snapshots. As such, the following changes should be made to lift's pom.xml (I'm trying to update your hudson lift configuration to cause the least amount of disruption): I have a forked repo (jsuereth/liftweb) with the changes as well (if you want to use github's fork queue feature): --- a/pom.xml +++ b/pom.xml @@ -806,16 +806,16 @@ idhudson/id distributionManagement repository - idhudson.scala-tools.org/id - urlfile:///home/scala-tools.org/www/repo-snapshots/url + idnexus.scala-tools.org/id + urlhttp://nexus.scala-tools.org/content/repositories/releases /url /repository snapshotRepository - idhudson.scala-tools.org/id - urlfile:///home/scala-tools.org/www/repo-snapshots/url + idnexus.scala-tools.org/id + url http://nexus.scala-tools.org/content/repositories/snapshots/url uniqueVersionfalse/uniqueVersion /snapshotRepository site - idhudson.scala-tools.org/id + idnexus.scala-tools.org/id urlfile:///home/ scala-tools.org/www/mvnsites-snapshots/liftweb/url /site /distributionManagement --~--~-~--~~~---~--~~ 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] Neat GitHub trick
Sorry if I'm the only one who didn't realize this before, but if you include the text Closes #xxx in your Git commit message, Git will automatically close the xxx ticket using your commit message. --~--~-~--~~~---~--~~ 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: URL in PlainMailBodyType to BlackBerry
Actually, I thought that Dumbster was more sophisticated than it is. I think that your approach is fine for verifying that the message is created properly. On Thu, Nov 12, 2009 at 2:37 PM, Naftoli Gugenheim naftoli...@gmail.comwrote: What's the advantage/purpose over they method I chose? On Thu, Nov 12, 2009 at 4:36 PM, Naftoli Gugenheim naftoli...@gmail.comwrote: Have you ever used Dumbster? On Thu, Nov 12, 2009 at 2:59 PM, Derek Chen-Becker dchenbec...@gmail.com wrote: I would like to see an integrated dumbster test. You can pick an arbitrary port to run the test on just by attempting to bind and iterating until you succeed. Something (roughly) like this: def openSmtpServer (startPort : Int, endPort : Int) : (Int,SimpleSmtpServer) = { var port = startPort var server : SimpleSmtpServer = null while (port = endPort (server eq null)) { try { server = SimpleSmtpServer.start(port) } catch { case _ = port += 1 } } return (port,server) } Then you can configure Lift's mailer to send to that port on localhost and go from there. Derek On Fri, Nov 6, 2009 at 11:54 AM, Naftoli Gugenheim naftoli...@gmail.com wrote: Can someone confirm or give other feedback? Are my tests good? http://reviewboard.liftweb.net/r/83/ On Wed, Nov 4, 2009 at 8:45 PM, Naftoli Gugenheim naftoli...@gmail.com wrote: Okay. Unit test are now on Review Board too (and they pass). I'm hoping someone will be able to confirm my work so that my client, a medical assistance volunteer-based charity organization, will have email working properly along with the rest of Lift's great features, so that the volunteer dispatchers will be able to click the links and help sick people. On Wed, Nov 4, 2009 at 2:04 AM, Naftoli Gugenheim naftoli...@gmail.com wrote: I thought of a smarter way to test it. Please tell me if you have any objections. I noticed that some of the specs extend the class they test. The idea is to refactor the call to actually send the email into an outside method. Then, after making some private members of Mailer protected, the spec can override the behavior of the method that sends it, to instead check the message object. This has the advantages of not adding another dependency to Lift, or relying on a given port being available to run an SMTP server on whoever builds Lift's computer. - David Pollakfeeder.of.the.be...@gmail.com wrote: On Tue, Nov 3, 2009 at 3:00 PM, Naftoli Gugenheim naftoli...@gmail.comwrote: I verified locally via dumbster that the content type is test/plain; charset=us-ascii for a single PlainMailBodyType. For two, or an XHTMLMailBodyType, it's multipart/alternative. Do I still need to contribute a test to Lift? Yes. This is the last time I will state this criteria or otherwise engage on this subject. - David Pollakfeeder.of.the.be...@gmail.com wrote: On Tue, Nov 3, 2009 at 1:47 PM, Naftoli Gugenheim naftoli...@gmail.com wrote: Wait a minute. You want me to test that my change works--that simple messages are not multipart--or that other messages still are multipart? Both. Test that mail sent as plain text is not multipart and that all other mail is multipart and that all the mail actually makes it through the system. It's 2 or 3 tests. Why am I imposing this burden on you? Almost every site that uses Lift uses the Mailer. I have given my cell phone number to some of these sites with the message I stand behind Lift... if you're experiencing a problem, please call me any time day or night. So, I'm on the hook if something goes wrong. My gut says, there could be more problems with this apparently simple change than meet the eye, so I'm asking you to write the tests. Or something else? - David Pollakfeeder.of.the.be...@gmail.com wrote: On Tue, Nov 3, 2009 at 1:30 PM, Naftoli Gugenheim naftoli...@gmail.com wrote: I asked you how to write one. I have no clue how to unit test email, or what content type an email is. And the test has to not fail on computers that don't have an SMTP server, I presume? I don't know how to write tests against mailers, but you're the one that made a change, so you have to figure out how to test it. I know no more about testing mailers than you do, so it's one of us that has to do the work. As I mentioned on review board, I did test it manually though and it works fine. Do most commits include a unit test? If this change breaks the mailer, the break impacts lots and lots of people. The mailer code has been stable and untouched for a long time (except for the change to LiftActors). So, my criteria for accepting this change is to have a test associated with it.
[Lift] Re: CometListener
Could you send over your pom.xml if you're using Maven? It sounds like maybe your build path is not correct. -Ross On Nov 13, 2009, at 12:09 AM, Jack Widman wrote: David, I'm using lift 1.1 and scala 2.5 now and the compiler says it cant find CometListener when I import net.liftweb.http._ Jack On Fri, Nov 13, 2009 at 12:01 AM, David Pollak feeder.of.the.be...@gmail.com wrote: On Thu, Nov 12, 2009 at 8:54 PM, Jack Widman jack.wid...@gmail.com wrote: C:\work\widman\src\main\scala\com\widman\comet\PackComet.scala:20: error: type CometListener is not a member of package net.liftweb.http I got this compile error. I must be missing something obvious. It's part of Lift 1.1, not Lift 1.0 On Thu, Nov 12, 2009 at 11:42 PM, Ross Mellgren dri...@gmail.com wrote: It is in net.liftweb.http. http://www.scala-tools.org/mvnsites-snapshots/liftweb/lift-webkit/scaladocs/net/liftweb/http/CometListener.html By the way, the link you gave only indicates it's in either net.liftweb.http, net.liftweb.util, net.liftweb or model (or a couple other packages, since scala implicitly imports superpackages). -Ross On Nov 12, 2009, at 11:38 PM, jack wrote: I also tried net.liftweb.http On Nov 12, 11:35 pm, jack jack.wid...@gmail.com wrote: I am trying to use CometListener. According tohttp://bit.ly/1Wnxt4, it is in the package net.liftweb._ but compiler says it can't be found. Is this the wrong package? -- Jack Widman co-founder / cto, Authoritude, Inc. 203-641-9355 -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics -- Jack Widman co-founder / cto, Authoritude, Inc. 203-641-9355 --~--~-~--~~~---~--~~ 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: Neat GitHub trick
On Fri, Nov 13, 2009 at 8:07 AM, Derek Chen-Becker dchenbec...@gmail.comwrote: Sorry if I'm the only one who didn't realize this before, but if you include the text Closes #xxx in your Git commit message, Git will automatically close the xxx ticket using your commit message. Yes... it's very cool... unfortunately, sometimes tickets get closed when the checkin is to a branch other than master... -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics --~--~-~--~~~---~--~~ 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: Unit testing a RESTful webservice with Lift
another question: is there any way (or need) to stop the Jetty server? Usually running my tests Jetty starts up in about a second or two, but once in a while it will take 10s or more, could this have to do with a previous instance hanging around or not been shut down properly? On Nov 11, 12:05 pm, David Pollak feeder.of.the.be...@gmail.com wrote: On Wed, Nov 11, 2009 at 7:09 AM, Alex Black a...@alexblack.ca wrote: What are you unhappy about? Those tests look pretty simple and slick to me! Yeah, but with this change:http://reviewboard.liftweb.net/r/95/ You'll get: Login in { for{ login - post(/api/login, token - token) !@ Failed to log in if (testSuccess(login)) status - login.get(/api/status) !@ Failed to get status if (testSuccess(status)) } { (status.xml \ user \ @id).text must_== theUser.id.toString } } It looks like the JettyTestServer is a singleton inside the test suite - what happens if you have another test suite? I think you'd then hit the same problem that I did, when the second test suite tries to fire up Jetty it will fail because Lift has already been initialized. The example in ESME is a singleton, but the start method is actually a lazy val, so you can call it from any test, but it will only be triggered once per run per classloader. Does this give you what you want? If not, it'll be some mucking around with multiple classloaders. - Alex On Nov 10, 2:25 pm, David Pollak feeder.of.the.be...@gmail.com wrote: I've just committed simple API test code up to the ESME project. The key pieces are at: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/test/sca .. After spending 30 minutes with the Lift TestKit, I'm wicked unhappy with it... but that will change later today. ;-) On Tue, Nov 10, 2009 at 9:51 AM, Alex Black a...@alexblack.ca wrote: My first unit test worked fine, but my second one dies: ERROR - Failed to Boot java.lang.IllegalStateException: Cannot modify after boot. at net.liftweb.http.RulesSeq$class.safe_$qmark(LiftRules.scala:885) at net.liftweb.http.RulesSeq$class.prepend(LiftRules.scala:892) at net.liftweb.http.RulesSeq$$anon$3.prepend(LiftRules.scala:872) Presumably because it has already loaded and started Lift, and my second unit test fires up Jetty again trying to start Lift again which I take it is not supported. So, I figure I should either: a. refactor my tests so that I only create one jetty and lift instance ever - this will probably require 'resetting' the service somehow to ensure a blank slate between each unit test, not sure how I get a hold of the instance in question for that b. somehow launch jetty/lift differently, or force lift to cleanup? On Nov 9, 10:50 pm, Jonathan Ferguson j...@spiralarm.com wrote: We fire up Jetty populate a temp database and then run a batch of tests. Seems to work well for us. Jono 2009/11/10 Alex Black a...@alexblack.ca Can anyone suggest some good examples or strategies to use to test a webservice written with Lift? I've started down the path of firing up Jetty in a unit test, then just hitting it with say a GET and checking the response. Whats a good way of firing up Jetty? It looks like using ServletTester would be the way to go: http://www.christianschenk.org/blog/testing-web-applications-with-jetty/ could that work with Lift? - Alex -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Surf the harmonics -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Surf the harmonics --~--~-~--~~~---~--~~ 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: Unit testing a RESTful webservice with Lift
On Fri, Nov 13, 2009 at 8:30 AM, Alex Black a...@alexblack.ca wrote: another question: is there any way (or need) to stop the Jetty server? No. Usually running my tests Jetty starts up in about a second or two, but once in a while it will take 10s or more, could this have to do with a previous instance hanging around or not been shut down properly? Yeah... I notice that as well. It's a lot worse on my Linux box than on my Mac. Oddly, my Mac (2ghz core duo) builds Lift almost as fast as my Linux desktop (3ghz i7 which runs about 4x faster than the Mac) because the Linux box has so many waits for Jetty to start. Would love to get this solved. On Nov 11, 12:05 pm, David Pollak feeder.of.the.be...@gmail.com wrote: On Wed, Nov 11, 2009 at 7:09 AM, Alex Black a...@alexblack.ca wrote: What are you unhappy about? Those tests look pretty simple and slick to me! Yeah, but with this change:http://reviewboard.liftweb.net/r/95/ You'll get: Login in { for{ login - post(/api/login, token - token) !@ Failed to log in if (testSuccess(login)) status - login.get(/api/status) !@ Failed to get status if (testSuccess(status)) } { (status.xml \ user \ @id).text must_== theUser.id.toString } } It looks like the JettyTestServer is a singleton inside the test suite - what happens if you have another test suite? I think you'd then hit the same problem that I did, when the second test suite tries to fire up Jetty it will fail because Lift has already been initialized. The example in ESME is a singleton, but the start method is actually a lazy val, so you can call it from any test, but it will only be triggered once per run per classloader. Does this give you what you want? If not, it'll be some mucking around with multiple classloaders. - Alex On Nov 10, 2:25 pm, David Pollak feeder.of.the.be...@gmail.com wrote: I've just committed simple API test code up to the ESME project. The key pieces are at: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/test/sca.. .. .. After spending 30 minutes with the Lift TestKit, I'm wicked unhappy with it... but that will change later today. ;-) On Tue, Nov 10, 2009 at 9:51 AM, Alex Black a...@alexblack.ca wrote: My first unit test worked fine, but my second one dies: ERROR - Failed to Boot java.lang.IllegalStateException: Cannot modify after boot. at net.liftweb.http.RulesSeq$class.safe_$qmark(LiftRules.scala:885) at net.liftweb.http.RulesSeq$class.prepend(LiftRules.scala:892) at net.liftweb.http.RulesSeq$$anon$3.prepend(LiftRules.scala:872) Presumably because it has already loaded and started Lift, and my second unit test fires up Jetty again trying to start Lift again which I take it is not supported. So, I figure I should either: a. refactor my tests so that I only create one jetty and lift instance ever - this will probably require 'resetting' the service somehow to ensure a blank slate between each unit test, not sure how I get a hold of the instance in question for that b. somehow launch jetty/lift differently, or force lift to cleanup? On Nov 9, 10:50 pm, Jonathan Ferguson j...@spiralarm.com wrote: We fire up Jetty populate a temp database and then run a batch of tests. Seems to work well for us. Jono 2009/11/10 Alex Black a...@alexblack.ca Can anyone suggest some good examples or strategies to use to test a webservice written with Lift? I've started down the path of firing up Jetty in a unit test, then just hitting it with say a GET and checking the response. Whats a good way of firing up Jetty? It looks like using ServletTester would be the way to go: http://www.christianschenk.org/blog/testing-web-applications-with-jetty/ could that work with Lift? - Alex -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Surf the harmonics -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Surf the harmonics -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics --~--~-~--~~~---~--~~ 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: Neat GitHub trick
Ah. I hadn't realized that part :( On Fri, Nov 13, 2009 at 9:28 AM, David Pollak feeder.of.the.be...@gmail.com wrote: On Fri, Nov 13, 2009 at 8:07 AM, Derek Chen-Becker dchenbec...@gmail.comwrote: Sorry if I'm the only one who didn't realize this before, but if you include the text Closes #xxx in your Git commit message, Git will automatically close the xxx ticket using your commit message. Yes... it's very cool... unfortunately, sometimes tickets get closed when the checkin is to a branch other than master... -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics --~--~-~--~~~---~--~~ 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: Problem with BlazeDS and LiftFilter 1.0+
Hello David, May be there can be a compromise solution. A custom filter that has only these duties: - to open LiftMapper-compatible transaction on HTTP-request (it will be accessible from DB entities like User) - call chain - when all chain was processed + commit the transaction + in case of exception, roll back the transaction + propagate exception filter filter-nameLiftFilterTransactionWrapper/filter-name filter-classservices.LiftFilterTransactionWrapper /filter- class /filter filter-mapping filter-name LiftFilterTransactionWrapper /filter-name url-pattern/messagebroker/*/url-pattern /filter-mapping class LiftFilterTransactionWrapper ... { ... } This will be just enough. What should be inside LiftFilterTransactionWrapper? -- Oleksandr --~--~-~--~~~---~--~~ 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: CometListener
sure. Thanks Ross. I will send it tonight. Also what is the difference between the CometListener and the CometListenee? On Fri, Nov 13, 2009 at 11:14 AM, Ross Mellgren dri...@gmail.com wrote: Could you send over your pom.xml if you're using Maven? It sounds like maybe your build path is not correct. -Ross On Nov 13, 2009, at 12:09 AM, Jack Widman wrote: David, I'm using lift 1.1 and scala 2.5 now and the compiler says it cant find CometListener when I import net.liftweb.http._ Jack On Fri, Nov 13, 2009 at 12:01 AM, David Pollak feeder.of.the.be...@gmail.com wrote: On Thu, Nov 12, 2009 at 8:54 PM, Jack Widman jack.wid...@gmail.comwrote: C:\work\widman\src\main\scala\com\widman\comet\PackComet.scala:20: error: type CometListener is not a member of package net.liftweb.http I got this compile error. I must be missing something obvious. It's part of Lift 1.1, not Lift 1.0 On Thu, Nov 12, 2009 at 11:42 PM, Ross Mellgren dri...@gmail.comwrote: It is in net.liftweb.http. http://www.scala-tools.org/mvnsites-snapshots/liftweb/lift-webkit/scaladocs/net/liftweb/http/CometListener.html By the way, the link you gave only indicates it's in either net.liftweb.http, net.liftweb.util, net.liftweb or model (or a couple other packages, since scala implicitly imports superpackages). -Ross On Nov 12, 2009, at 11:38 PM, jack wrote: I also tried net.liftweb.http On Nov 12, 11:35 pm, jack jack.wid...@gmail.com wrote: I am trying to use CometListener. According tohttp://bit.ly/1Wnxt4, it is in the package net.liftweb._ but compiler says it can't be found. Is this the wrong package? -- Jack Widman co-founder / cto, Authoritude, Inc. 203-641-9355 -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics -- Jack Widman co-founder / cto, Authoritude, Inc. 203-641-9355 -- Jack Widman co-founder / cto, Authoritude, Inc. 203-641-9355 --~--~-~--~~~---~--~~ 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: problems with tomcat
When running Lift-1.0.2 and Scala-2.7.5 I am able to compile and run my code through maven. However, I am concerned about my inability to run the mvn clean package command successfully without first running the clean command in eclipse. I am afraid that this extra eclipse step may be interfering with the proper creation of the .war file which may be contributing to the problem. When I try to execute mvn clean package without eclipse I get the following error appearing in my surefire-report: --- Test set: net.genomas.lift.test.AppTest --- Tests run: 2, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.251 sec FAILURE! testXml(net.genomas.lift.test.AppTest) Time elapsed: 1.228 sec ERROR! java.net.ConnectException: Connection refused: connect at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java: 195) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) at java.net.Socket.connect(Socket.java:525) at java.net.Socket.connect(Socket.java:475) at sun.net.NetworkClient.doConnect(NetworkClient.java:163) at sun.net.www.http.HttpClient.openServer(HttpClient.java:394) at sun.net.www.http.HttpClient.openServer(HttpClient.java:529) at sun.net.www.http.HttpClient.init(HttpClient.java:233) at sun.net.www.http.HttpClient.New(HttpClient.java:306) at sun.net.www.http.HttpClient.New(HttpClient.java:323) at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient (HttpURLConnection.java:860) at sun.net.www.protocol.http.HttpURLConnection.plainConnect (HttpURLConnection.java:801) at sun.net.www.protocol.http.HttpURLConnection.connect (HttpURLConnection.java:726) at sun.net.www.protocol.http.HttpURLConnection.getInputStream (HttpURLConnection.java:1049) at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity (XMLEntityManager.java:677) at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity (XMLEntityManager.java:1315) at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startDTDEntity (XMLEntityManager.java:1282) at com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.setInputSource (XMLDTDScannerImpl.java:283) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl $DTDDriver.dispatch(XMLDocumentScannerImpl.java:1193) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl $DTDDriver.next(XMLDocumentScannerImpl.java:1090) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl $PrologDriver.next(XMLDocumentScannerImpl.java:1003) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next (XMLDocumentScannerImpl.java:648) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument (XMLDocumentFragmentScannerImpl.java:510) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse (XML11Configuration.java:807) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse (XML11Configuration.java:737) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse (XMLParser.java:107) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse (AbstractSAXParser.java:1205) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl $JAXPSAXParser.parse(SAXParserImpl.java:522) at javax.xml.parsers.SAXParser.parse(SAXParser.java:395) at scala.xml.parsing.FactoryAdapter.loadXML(FactoryAdapter.scala:292) at scala.xml.parsing.NoBindingFactoryAdapter.loadXML (NoBindingFactoryAdapter.scala:60) at scala.xml.XML$.loadFile(XML.scala:42) at net.genomas.lift.test.AppTest.wellFormed$1(AppTest.scala:52) at net.genomas.lift.test.AppTest$$anonfun$wellFormed$1$1.apply (AppTest.scala:48) at net.genomas.lift.test.AppTest$$anonfun$wellFormed$1$1.apply (AppTest.scala:48) at scala.Iterator$class.foreach(Iterator.scala:414) at scala.runtime.BoxedArray$AnyIterator.foreach(BoxedArray.scala:45) at scala.Iterable$class.foreach(Iterable.scala:256) at scala.runtime.BoxedArray.foreach(BoxedArray.scala:24) at net.genomas.lift.test.AppTest.wellFormed$1(AppTest.scala:48) at net.genomas.lift.test.AppTest$$anonfun$wellFormed$1$1.apply (AppTest.scala:48) at net.genomas.lift.test.AppTest$$anonfun$wellFormed$1$1.apply (AppTest.scala:48) at scala.Iterator$class.foreach(Iterator.scala:414) at scala.runtime.BoxedArray$AnyIterator.foreach(BoxedArray.scala:45) at
[Lift] Re: Changes to transaction handling since M6?
On Thu, Nov 12, 2009 at 5:57 PM, David Pollak feeder.of.the.be...@gmail.com wrote: Kris, There was a bunch of changes in the net.liftweb.mapper.DB code for transaction management, but I don't think that would impact JPA. Also, in M7, there were changes in how RequestVars are handled during Ajax requests... basically, state is snapshotted when the Ajax request is created and then that snapshot state is restored during the servicing of the Ajax request. If the RequestVarEM stuff is being snapshotted, that could cause issues. Thanks, David That sounds like it could very likely be the culprit, but I'm going to have to dig a bit more to know for certain. the RequestVarEM trait uses the following RequestVar: object emVar extends RequestVar[EntityManager](openEM()) { this.registerGlobalCleanupFunc(ignore = closeEM(this.is)) override def __nameSalt = net.liftweb.util.Helpers.randomString(10) } openEM() is supplied in my case by JndiEMF. If this would not be called during handling of an AJAX request, that's definitely the issue. This brings to mind an issue I'd worried about a long time ago, back when I had my own implementation of a JNDI resource acquisition trait for persistence. We can tie into the cleanup phase of the RequestVar's lifecycle with a cleanup func, but if the RequestVar is going to be persisted across actual HTTP requests in the AJAX case, we will also need additional lifecycle hooks. I'm actually kind of concerned about this decision; it seems like it could really complicate usage of RequestVar in cases where the container has additional stuff it does related to the lifecycle of the HTTP request (like JTA). Maybe there should be a separate AnyVar subclass that is intended for this sort of persist-for-ajax situation? Kris On Thu, Nov 12, 2009 at 4:49 PM, Kris Nuttycombe kris.nuttyco...@gmail.com wrote: Hi, all (Derek! :), Have there been significant changes in how transactions are handled by lift-jpa since M6? Due to the rearrangement of the repository, I'm having a hard time figuring out if the code has changed. I have a repeatable issue that shows up when changing between M6 and SNAPSHOT wherein I now get javax.persistence.TransactionRequiredExceptions when doing a merge using a JndiEMF with RequestVarEM in an AJAX callback. Has anything major changed in this timeframe? Kris -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics --~--~-~--~~~---~--~~ 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 specify the SELECT statement in the Mapper ?
Is there a some simple code ~? Thanks very much! Cheers, Neil On Nov 13, 10:50 pm, Derek Chen-Becker dchenbec...@gmail.com wrote: MetaMapper.findAllFields may work for what you're doing, but with the DAYOFWEEK conversion you may just have to go directly against the DB. Derek On Sun, Nov 8, 2009 at 11:44 PM, Neil.Lv anim...@gmail.com wrote: Hi all, There is some example code: ### SELECT id, name, sex, created_at, DAYOFWEEK(created_at,) as week, (CURRENT_DATE) as t FROM users WHERE created_at (CURRENT_DATE ) AND created_at (CURRENT_DATE + interval 2 day) ORDER BY created_at ASC ### How can i specify the SELECT statement that i don't want all the columns and i want add the column as week in the example code ? Any help would be much appreciated! Cheers, Neil --~--~-~--~~~---~--~~ 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 specify the SELECT statement in the Mapper ?
If you mean raw sql: DB.runQuery(SELECT * FROM abc) Cheers, Tim On 13 Nov 2009, at 17:35, Neil.Lv wrote: Is there a some simple code ~? Thanks very much! Cheers, Neil On Nov 13, 10:50 pm, Derek Chen-Becker dchenbec...@gmail.com wrote: MetaMapper.findAllFields may work for what you're doing, but with the DAYOFWEEK conversion you may just have to go directly against the DB. Derek On Sun, Nov 8, 2009 at 11:44 PM, Neil.Lv anim...@gmail.com wrote: Hi all, There is some example code: ### SELECT id, name, sex, created_at, DAYOFWEEK(created_at,) as week, (CURRENT_DATE) as t FROM users WHERE created_at (CURRENT_DATE ) AND created_at (CURRENT_DATE + interval 2 day) ORDER BY created_at ASC ### How can i specify the SELECT statement that i don't want all the columns and i want add the column as week in the example code ? Any help would be much appreciated! Cheers, Neil --~--~-~--~~~---~--~~ 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: Changes to transaction handling since M6?
Looking at 81f1715f671e8b5ee4f6d3ce242cc9da272611d1, maybe the RequestVar needs to be changed to an UnboundRequestVar. It's not clear from the scaladocs on UnboundRequestVar, though, that this is the intent. It looks like those scaladocs were just copied and pasted from RequestVar. If this sounds like the right change to make I can fix RequestVarEM and update the scaladocs for UnboundRequestVar. Derek On Fri, Nov 13, 2009 at 11:24 AM, Kris Nuttycombe kris.nuttyco...@gmail.com wrote: On Thu, Nov 12, 2009 at 5:57 PM, David Pollak feeder.of.the.be...@gmail.com wrote: Kris, There was a bunch of changes in the net.liftweb.mapper.DB code for transaction management, but I don't think that would impact JPA. Also, in M7, there were changes in how RequestVars are handled during Ajax requests... basically, state is snapshotted when the Ajax request is created and then that snapshot state is restored during the servicing of the Ajax request. If the RequestVarEM stuff is being snapshotted, that could cause issues. Thanks, David That sounds like it could very likely be the culprit, but I'm going to have to dig a bit more to know for certain. the RequestVarEM trait uses the following RequestVar: object emVar extends RequestVar[EntityManager](openEM()) { this.registerGlobalCleanupFunc(ignore = closeEM(this.is)) override def __nameSalt = net.liftweb.util.Helpers.randomString(10) } openEM() is supplied in my case by JndiEMF. If this would not be called during handling of an AJAX request, that's definitely the issue. This brings to mind an issue I'd worried about a long time ago, back when I had my own implementation of a JNDI resource acquisition trait for persistence. We can tie into the cleanup phase of the RequestVar's lifecycle with a cleanup func, but if the RequestVar is going to be persisted across actual HTTP requests in the AJAX case, we will also need additional lifecycle hooks. I'm actually kind of concerned about this decision; it seems like it could really complicate usage of RequestVar in cases where the container has additional stuff it does related to the lifecycle of the HTTP request (like JTA). Maybe there should be a separate AnyVar subclass that is intended for this sort of persist-for-ajax situation? Kris On Thu, Nov 12, 2009 at 4:49 PM, Kris Nuttycombe kris.nuttyco...@gmail.com wrote: Hi, all (Derek! :), Have there been significant changes in how transactions are handled by lift-jpa since M6? Due to the rearrangement of the repository, I'm having a hard time figuring out if the code has changed. I have a repeatable issue that shows up when changing between M6 and SNAPSHOT wherein I now get javax.persistence.TransactionRequiredExceptions when doing a merge using a JndiEMF with RequestVarEM in an AJAX callback. Has anything major changed in this timeframe? Kris -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics --~--~-~--~~~---~--~~ 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: Changes to transaction handling since M6?
Hmmm is this now TransientRequestVar? It's private[http], but could it be protected instead? Kris On Fri, Nov 13, 2009 at 11:22 AM, Kris Nuttycombe kris.nuttyco...@gmail.com wrote: Let me just try it out since I've got a test case, and if need be I'll file the ticket commit. Kris On Fri, Nov 13, 2009 at 10:45 AM, Derek Chen-Becker dchenbec...@gmail.com wrote: Looking at 81f1715f671e8b5ee4f6d3ce242cc9da272611d1, maybe the RequestVar needs to be changed to an UnboundRequestVar. It's not clear from the scaladocs on UnboundRequestVar, though, that this is the intent. It looks like those scaladocs were just copied and pasted from RequestVar. If this sounds like the right change to make I can fix RequestVarEM and update the scaladocs for UnboundRequestVar. Derek On Fri, Nov 13, 2009 at 11:24 AM, Kris Nuttycombe kris.nuttyco...@gmail.com wrote: On Thu, Nov 12, 2009 at 5:57 PM, David Pollak feeder.of.the.be...@gmail.com wrote: Kris, There was a bunch of changes in the net.liftweb.mapper.DB code for transaction management, but I don't think that would impact JPA. Also, in M7, there were changes in how RequestVars are handled during Ajax requests... basically, state is snapshotted when the Ajax request is created and then that snapshot state is restored during the servicing of the Ajax request. If the RequestVarEM stuff is being snapshotted, that could cause issues. Thanks, David That sounds like it could very likely be the culprit, but I'm going to have to dig a bit more to know for certain. the RequestVarEM trait uses the following RequestVar: object emVar extends RequestVar[EntityManager](openEM()) { this.registerGlobalCleanupFunc(ignore = closeEM(this.is)) override def __nameSalt = net.liftweb.util.Helpers.randomString(10) } openEM() is supplied in my case by JndiEMF. If this would not be called during handling of an AJAX request, that's definitely the issue. This brings to mind an issue I'd worried about a long time ago, back when I had my own implementation of a JNDI resource acquisition trait for persistence. We can tie into the cleanup phase of the RequestVar's lifecycle with a cleanup func, but if the RequestVar is going to be persisted across actual HTTP requests in the AJAX case, we will also need additional lifecycle hooks. I'm actually kind of concerned about this decision; it seems like it could really complicate usage of RequestVar in cases where the container has additional stuff it does related to the lifecycle of the HTTP request (like JTA). Maybe there should be a separate AnyVar subclass that is intended for this sort of persist-for-ajax situation? Kris On Thu, Nov 12, 2009 at 4:49 PM, Kris Nuttycombe kris.nuttyco...@gmail.com wrote: Hi, all (Derek! :), Have there been significant changes in how transactions are handled by lift-jpa since M6? Due to the rearrangement of the repository, I'm having a hard time figuring out if the code has changed. I have a repeatable issue that shows up when changing between M6 and SNAPSHOT wherein I now get javax.persistence.TransactionRequiredExceptions when doing a merge using a JndiEMF with RequestVarEM in an AJAX callback. Has anything major changed in this timeframe? Kris -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics --~--~-~--~~~---~--~~ 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: Changes to transaction handling since M6?
Let me just try it out since I've got a test case, and if need be I'll file the ticket commit. Kris On Fri, Nov 13, 2009 at 10:45 AM, Derek Chen-Becker dchenbec...@gmail.com wrote: Looking at 81f1715f671e8b5ee4f6d3ce242cc9da272611d1, maybe the RequestVar needs to be changed to an UnboundRequestVar. It's not clear from the scaladocs on UnboundRequestVar, though, that this is the intent. It looks like those scaladocs were just copied and pasted from RequestVar. If this sounds like the right change to make I can fix RequestVarEM and update the scaladocs for UnboundRequestVar. Derek On Fri, Nov 13, 2009 at 11:24 AM, Kris Nuttycombe kris.nuttyco...@gmail.com wrote: On Thu, Nov 12, 2009 at 5:57 PM, David Pollak feeder.of.the.be...@gmail.com wrote: Kris, There was a bunch of changes in the net.liftweb.mapper.DB code for transaction management, but I don't think that would impact JPA. Also, in M7, there were changes in how RequestVars are handled during Ajax requests... basically, state is snapshotted when the Ajax request is created and then that snapshot state is restored during the servicing of the Ajax request. If the RequestVarEM stuff is being snapshotted, that could cause issues. Thanks, David That sounds like it could very likely be the culprit, but I'm going to have to dig a bit more to know for certain. the RequestVarEM trait uses the following RequestVar: object emVar extends RequestVar[EntityManager](openEM()) { this.registerGlobalCleanupFunc(ignore = closeEM(this.is)) override def __nameSalt = net.liftweb.util.Helpers.randomString(10) } openEM() is supplied in my case by JndiEMF. If this would not be called during handling of an AJAX request, that's definitely the issue. This brings to mind an issue I'd worried about a long time ago, back when I had my own implementation of a JNDI resource acquisition trait for persistence. We can tie into the cleanup phase of the RequestVar's lifecycle with a cleanup func, but if the RequestVar is going to be persisted across actual HTTP requests in the AJAX case, we will also need additional lifecycle hooks. I'm actually kind of concerned about this decision; it seems like it could really complicate usage of RequestVar in cases where the container has additional stuff it does related to the lifecycle of the HTTP request (like JTA). Maybe there should be a separate AnyVar subclass that is intended for this sort of persist-for-ajax situation? Kris On Thu, Nov 12, 2009 at 4:49 PM, Kris Nuttycombe kris.nuttyco...@gmail.com wrote: Hi, all (Derek! :), Have there been significant changes in how transactions are handled by lift-jpa since M6? Due to the rearrangement of the repository, I'm having a hard time figuring out if the code has changed. I have a repeatable issue that shows up when changing between M6 and SNAPSHOT wherein I now get javax.persistence.TransactionRequiredExceptions when doing a merge using a JndiEMF with RequestVarEM in an AJAX callback. Has anything major changed in this timeframe? Kris -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics --~--~-~--~~~---~--~~ 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: Changes to scala-tools.org Hudson
The site portion has not changed yet. I'm working on that ;) - Josh On Fri, Nov 13, 2009 at 11:04 AM, Derek Chen-Becker dchenbec...@gmail.comwrote: Josh, ScalaJPA has the following distribution setup: distributionManagement repository idscala-tools.org/id urlhttp://nexus.scala-tools.org/content/repositories/releases/url /repository snapshotRepository idscala-tools.org/id urlhttp://nexus.scala-tools.org/content/repositories/snapshots /url uniqueVersiontrue/uniqueVersion /snapshotRepository site idscala-tools.org/id url http://nexus.scala-tools.org/content/repositories/mvnsites/${project.artifactId}http://nexus.scala-tools.org/content/repositories/mvnsites/$%7Bproject.artifactId%7D /url /site /distributionManagement Does that look correct? On Thu, Nov 5, 2009 at 5:58 PM, Josh Suereth joshua.suer...@gmail.comwrote: Scala-tools.org's Hudson server will no longer allow local deployment to the repository. You *must* submit all snapshot/release artifacts through the nexus webapp. The hudson server will provide a server id ( nexus.scala-tools.org) that will have appropriate (and appropriately hidden) credentials for nightly deployments of snapshots. As such, the following changes should be made to lift's pom.xml (I'm trying to update your hudson lift configuration to cause the least amount of disruption): I have a forked repo (jsuereth/liftweb) with the changes as well (if you want to use github's fork queue feature): --- a/pom.xml +++ b/pom.xml @@ -806,16 +806,16 @@ idhudson/id distributionManagement repository - idhudson.scala-tools.org/id - urlfile:///home/scala-tools.org/www/repo-snapshots/url + idnexus.scala-tools.org/id + url http://nexus.scala-tools.org/content/repositories/releases/url /repository snapshotRepository - idhudson.scala-tools.org/id - urlfile:///home/scala-tools.org/www/repo-snapshots/url + idnexus.scala-tools.org/id + url http://nexus.scala-tools.org/content/repositories/snapshots/url uniqueVersionfalse/uniqueVersion /snapshotRepository site - idhudson.scala-tools.org/id + idnexus.scala-tools.org/id urlfile:///home/ scala-tools.org/www/mvnsites-snapshots/liftweb/url /site /distributionManagement --~--~-~--~~~---~--~~ 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] priority of events
What is the order that the following three things happen in? 1)localSetup 2)the first time render is called 3)a piece of code in the CometActor that is not inside any method. --~--~-~--~~~---~--~~ 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: Changes to transaction handling since M6?
Looks like it. Probably private[liftweb] would work, too. In any case, the scaladocs need to be updated to reflect what it's for. On Fri, Nov 13, 2009 at 12:26 PM, Kris Nuttycombe kris.nuttyco...@gmail.com wrote: Hmmm is this now TransientRequestVar? It's private[http], but could it be protected instead? Kris On Fri, Nov 13, 2009 at 11:22 AM, Kris Nuttycombe kris.nuttyco...@gmail.com wrote: Let me just try it out since I've got a test case, and if need be I'll file the ticket commit. Kris On Fri, Nov 13, 2009 at 10:45 AM, Derek Chen-Becker dchenbec...@gmail.com wrote: Looking at 81f1715f671e8b5ee4f6d3ce242cc9da272611d1, maybe the RequestVar needs to be changed to an UnboundRequestVar. It's not clear from the scaladocs on UnboundRequestVar, though, that this is the intent. It looks like those scaladocs were just copied and pasted from RequestVar. If this sounds like the right change to make I can fix RequestVarEM and update the scaladocs for UnboundRequestVar. Derek On Fri, Nov 13, 2009 at 11:24 AM, Kris Nuttycombe kris.nuttyco...@gmail.com wrote: On Thu, Nov 12, 2009 at 5:57 PM, David Pollak feeder.of.the.be...@gmail.com wrote: Kris, There was a bunch of changes in the net.liftweb.mapper.DB code for transaction management, but I don't think that would impact JPA. Also, in M7, there were changes in how RequestVars are handled during Ajax requests... basically, state is snapshotted when the Ajax request is created and then that snapshot state is restored during the servicing of the Ajax request. If the RequestVarEM stuff is being snapshotted, that could cause issues. Thanks, David That sounds like it could very likely be the culprit, but I'm going to have to dig a bit more to know for certain. the RequestVarEM trait uses the following RequestVar: object emVar extends RequestVar[EntityManager](openEM()) { this.registerGlobalCleanupFunc(ignore = closeEM(this.is)) override def __nameSalt = net.liftweb.util.Helpers.randomString(10) } openEM() is supplied in my case by JndiEMF. If this would not be called during handling of an AJAX request, that's definitely the issue. This brings to mind an issue I'd worried about a long time ago, back when I had my own implementation of a JNDI resource acquisition trait for persistence. We can tie into the cleanup phase of the RequestVar's lifecycle with a cleanup func, but if the RequestVar is going to be persisted across actual HTTP requests in the AJAX case, we will also need additional lifecycle hooks. I'm actually kind of concerned about this decision; it seems like it could really complicate usage of RequestVar in cases where the container has additional stuff it does related to the lifecycle of the HTTP request (like JTA). Maybe there should be a separate AnyVar subclass that is intended for this sort of persist-for-ajax situation? Kris On Thu, Nov 12, 2009 at 4:49 PM, Kris Nuttycombe kris.nuttyco...@gmail.com wrote: Hi, all (Derek! :), Have there been significant changes in how transactions are handled by lift-jpa since M6? Due to the rearrangement of the repository, I'm having a hard time figuring out if the code has changed. I have a repeatable issue that shows up when changing between M6 and SNAPSHOT wherein I now get javax.persistence.TransactionRequiredExceptions when doing a merge using a JndiEMF with RequestVarEM in an AJAX callback. Has anything major changed in this timeframe? Kris -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics --~--~-~--~~~---~--~~ 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: Changes to transaction handling since M6?
On Fri, Nov 13, 2009 at 11:46 AM, Derek Chen-Becker dchenbec...@gmail.com wrote: Looks like it. Probably private[liftweb] would work, too. In any case, the scaladocs need to be updated to reflect what it's for. On Fri, Nov 13, 2009 at 12:26 PM, Kris Nuttycombe kris.nuttyco...@gmail.com wrote: Hmmm is this now TransientRequestVar? It's private[http], but could it be protected instead? Kris David, do you have an opinion? Is there any reason to keep this private to lift, or is it something that 3rd-party libraries could make use of (as in this case?) Kris --~--~-~--~~~---~--~~ 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] Ajax and custom HTTP headers
Hi, Do you think it would worth having a better support for setting HTTP headers for Ajax requests ? I mean some REST API's may use some meta information in the HTTP headers and it migh be handy to set this up from lift code when using Ajax calls. Thoughts? 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: Changes to transaction handling since M6?
On Fri, Nov 13, 2009 at 12:12 PM, Kris Nuttycombe kris.nuttyco...@gmail.com wrote: On Fri, Nov 13, 2009 at 11:46 AM, Derek Chen-Becker dchenbec...@gmail.com wrote: Looks like it. Probably private[liftweb] would work, too. In any case, the scaladocs need to be updated to reflect what it's for. On Fri, Nov 13, 2009 at 12:26 PM, Kris Nuttycombe kris.nuttyco...@gmail.com wrote: Hmmm is this now TransientRequestVar? It's private[http], but could it be protected instead? Kris David, do you have an opinion? Is there any reason to keep this private to lift, or is it something that 3rd-party libraries could make use of (as in this case?) I wanted to keep it as narrow as possible while we saw how it worked and got better naming. Making it private[liftweb] is fine and we'll open it up later. Kris -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics --~--~-~--~~~---~--~~ 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: Changes to transaction handling since M6?
On Fri, Nov 13, 2009 at 3:42 PM, David Pollak feeder.of.the.be...@gmail.com wrote: On Fri, Nov 13, 2009 at 12:12 PM, Kris Nuttycombe kris.nuttyco...@gmail.com wrote: On Fri, Nov 13, 2009 at 11:46 AM, Derek Chen-Becker dchenbec...@gmail.com wrote: Looks like it. Probably private[liftweb] would work, too. In any case, the scaladocs need to be updated to reflect what it's for. On Fri, Nov 13, 2009 at 12:26 PM, Kris Nuttycombe kris.nuttyco...@gmail.com wrote: Hmmm is this now TransientRequestVar? It's private[http], but could it be protected instead? Kris David, do you have an opinion? Is there any reason to keep this private to lift, or is it something that 3rd-party libraries could make use of (as in this case?) I wanted to keep it as narrow as possible while we saw how it worked and got better naming. Making it private[liftweb] is fine and we'll open it up later. Okay, done and on ReviewBoard. --~--~-~--~~~---~--~~ 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: Ajax and custom HTTP headers
On Fri, Nov 13, 2009 at 1:37 PM, Marius marius.dan...@gmail.com wrote: Hi, Do you think it would worth having a better support for setting HTTP headers for Ajax requests ? I mean some REST API's may use some meta information in the HTTP headers and it migh be handy to set this up from lift code when using Ajax calls. Thoughts? Sounds great! Br's, Marius -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics --~--~-~--~~~---~--~~ 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: problems with tomcat
On Fri, Nov 13, 2009 at 9:15 AM, DavidV david.v.villa...@gmail.com wrote: When running Lift-1.0.2 and Scala-2.7.5 I am able to compile and run my code through maven. However, I am concerned about my inability to run the mvn clean package command successfully without first running the clean command in eclipse. Yeah... Eclipse is generally a problem. Are you running Windows or Linux/Mac? Can you quite Eclipses before doing a build. I am afraid that this extra eclipse step may be interfering with the proper creation of the .war file which may be contributing to the problem. When I try to execute mvn clean package without eclipse I get the following error appearing in my surefire-report: --- Test set: net.genomas.lift.test.AppTest --- Tests run: 2, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.251 sec FAILURE! testXml(net.genomas.lift.test.AppTest) Time elapsed: 1.228 sec ERROR! java.net.ConnectException: Connection refused: connect at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java: 195) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) at java.net.Socket.connect(Socket.java:525) at java.net.Socket.connect(Socket.java:475) at sun.net.NetworkClient.doConnect(NetworkClient.java:163) at sun.net.www.http.HttpClient.openServer(HttpClient.java:394) at sun.net.www.http.HttpClient.openServer(HttpClient.java:529) at sun.net.www.http.HttpClient.init(HttpClient.java:233) at sun.net.www.http.HttpClient.New(HttpClient.java:306) at sun.net.www.http.HttpClient.New(HttpClient.java:323) at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient (HttpURLConnection.java:860) at sun.net.www.protocol.http.HttpURLConnection.plainConnect (HttpURLConnection.java:801) at sun.net.www.protocol.http.HttpURLConnection.connect (HttpURLConnection.java:726) at sun.net.www.protocol.http.HttpURLConnection.getInputStream (HttpURLConnection.java:1049) at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity (XMLEntityManager.java:677) at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity (XMLEntityManager.java:1315) at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startDTDEntity (XMLEntityManager.java:1282) at com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.setInputSource (XMLDTDScannerImpl.java:283) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl $DTDDriver.dispatch(XMLDocumentScannerImpl.java:1193) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl $DTDDriver.next(XMLDocumentScannerImpl.java:1090) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl $PrologDriver.next(XMLDocumentScannerImpl.java:1003) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next (XMLDocumentScannerImpl.java:648) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument (XMLDocumentFragmentScannerImpl.java:510) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse (XML11Configuration.java:807) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse (XML11Configuration.java:737) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse (XMLParser.java:107) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse (AbstractSAXParser.java:1205) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl $JAXPSAXParser.parse(SAXParserImpl.java:522) at javax.xml.parsers.SAXParser.parse(SAXParser.java:395) at scala.xml.parsing.FactoryAdapter.loadXML(FactoryAdapter.scala:292) at scala.xml.parsing.NoBindingFactoryAdapter.loadXML (NoBindingFactoryAdapter.scala:60) at scala.xml.XML$.loadFile(XML.scala:42) Just comment out the test for now. at net.genomas.lift.test.AppTest.wellFormed$1(AppTest.scala:52) at net.genomas.lift.test.AppTest$$anonfun$wellFormed$1$1.apply (AppTest.scala:48) at net.genomas.lift.test.AppTest$$anonfun$wellFormed$1$1.apply (AppTest.scala:48) at scala.Iterator$class.foreach(Iterator.scala:414) at scala.runtime.BoxedArray$AnyIterator.foreach(BoxedArray.scala:45) at scala.Iterable$class.foreach(Iterable.scala:256) at scala.runtime.BoxedArray.foreach(BoxedArray.scala:24) at net.genomas.lift.test.AppTest.wellFormed$1(AppTest.scala:48) at
[Lift] Re: Empty Box exception in MetaMapper
On Thu, Nov 12, 2009 at 9:08 PM, Jim McBeath goo...@j.jimmc.org wrote: Assuming I prune it down to an example that requires only a few files, which would probably include an SQL script for creating a test database that has the appropriate schema in it, is there a procedure for submitting such a test case? Should I just post source code to this group? Make a jar file with sources and put it somewhere? If someone can point me to a wiki page or some other reference to clue me in as to standard procedure for doing this, that would be nice. Please open a ticket at http://github.com/dpp/liftweb/issues and if there's example code, the best thing is to create a GitHub project... the second best thing is to email me a tarball of the example. -- Jim On Thu, Nov 12, 2009 at 07:28:24PM -0800, David Pollak wrote: Date: Thu, 12 Nov 2009 19:28:24 -0800 From: David Pollak feeder.of.the.be...@gmail.com To: liftweb@googlegroups.com Subject: [Lift] Re: Empty Box exception in MetaMapper If you can create a reproducible case, we're look into it. On Thu, Nov 12, 2009 at 5:43 PM, Jim McBeath goo...@j.jimmc.org wrote: When I try to save a record in my table from the Create form built by CRUDify, I am getting a Trying to open an empty Box exception from within MetaMapper.scala, line 617 (in 1.1M7), which is this line:   findApplier(indexMap.open_!, rs.getObject(1)) match { It appears that indexMap is initialized to Empty at line 888 and is set to Full at line 985, but the latter happens only if dbPrimaryKey_? and dbAutogenerated? are both true.  In my case I have set dbAutogenerated_? = false for my primary key, so indexMap will always be Empty, and the code at line 617 will always throw an exception. Is this a bug, or am I misunderstanding or misusing something? My primary field in my KeyedMapper class looks essentially like this:   object pk extends MappedStringIndex(this,1) {     override def dbColumnName = TABLENAME_PK     override def dbDisplay_? = true     override def writePermission_? = true     override def dbAutogenerated_? = false     override lazy val defaultValue =   } -- Jim P.S. Thanks for the OracleDriver fix, Dave. -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics --~--~-~--~~~---~--~~ 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: ScalaTest in Lift archetypes
Hi Tim, Let's do that. See you next week. Bill On Wed, Nov 11, 2009 at 3:33 PM, Timothy Perrett timo...@getintheloop.eu wrote: Bill, can I propose you and I get together at devoxx and discuss the options? I belive my talk is not long after yours! Cheers, Tim Sent from my iPhone On 11 Nov 2009, at 21:50, Bill Venners b...@artima.com wrote: Hi, I was talking with David Pollak the other night about putting some ScalaTest examples into the Lift archetypes. He said I should post to the list. Can anyone out there let me know how we might go about that? Thanks. Bill Bill Venners Artima, Inc. http://www.artima.com -- Bill Venners Artima, Inc. http://www.artima.com --~--~-~--~~~---~--~~ 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: CometActor and render
Ah, nice, just checking if you knew about it as an option. On Nov 13, 8:08 am, Jack Widman jack.wid...@gmail.com wrote: I did and its actually in the code I attached. In one place I use Dispatch and in another place I use httpclient directly. I intend to use Dispatch for everything. On Thu, Nov 12, 2009 at 4:05 PM, Randinn rand...@gmail.com wrote: I'm not trying to change the subject but I was wondering if you looked at Databinder Dispatchhttp://databinder.net/dispatch/Aboutfor your url calls? On Nov 12, 3:26 pm, Jack Widman jack.wid...@gmail.com wrote: David, I have attached my code. It runs but does not behave as I intended it to. The code does a web search on the term scala and displays a list of URLs of the results. Next to each URL it says Page Length : -1. A process is running in the background which takes each URL, goes out and gets the page and takes the length of the page. The length of that page is then supposed to immediately appear on the page next to that URL. I put the lengths on a queue, as they come in, and I have the Comet page poll the queue and display the results. It would probably be better to have the results send a message to the Comet class so the page is only re-rendered when there is a change but for now I am polling. I can see the lengths coming in and being put on the queue, but the Comet page is not getting them till they are all retrieved. (This takes way too long and nothing changes on the screen till its too late). I need them to appear as they come in. Occasionally I can see a length being retrieved and the Comet page finds it but even then it is not displayed until all the lengths are in. I know this is not very clear but I think it will be clear from the code. I also know there are a lot of places in the code which can be improved and I welcome all of your input but what I would love is to have these numbers appear on the page as they they are retrieved. I have been stumped by this for a while and I suspect that somebody who knows Lift well might see the problem right away. The class that retrieves the page lengths is called Calculator and the queue is called SourceQueue. The classes are pretty small so hopefully it will be clear what is going on. I want you to know I think it is incredible how responsive you and the group are and I look forward to using Lift in the future. Thanks so much. Jack On Tue, Nov 10, 2009 at 1:27 AM, David Pollak feeder.of.the.be...@gmail.com wrote: On Mon, Nov 9, 2009 at 10:10 PM, Jack Widman jack.wid...@gmail.com wrote: The only difference between your working code and mine is that mine has a process in the background that is always running and puts Foo objects on a queue whenever they are ready. Where can I start this long running process so that it doesn't interfere with the lowPriority method that takes things off the queue and rerenders the page. I tried starting the process in its own Actor that I start in localSetup but it seems somehow to be blocking the lowPriority method from doing its thing. I have no idea what this means... sorry. Please post actual runnable code and we can help you debug. On Sun, Nov 8, 2009 at 11:35 PM, David Pollak feeder.of.the.be...@gmail.com wrote: Jack, I reproduced your code and it seems to work fine. I've enclosed a working copy. Some comments about your code: - The foos variable and the foo variable may be getting confused in the code... the render method may be rendering the same thing based on the unchanging foos variable. - Doing null testing is a sign that you have logic errors in your code. I strongly recommend using either Box or Option for everything that can logically not contain a value/reference. If you're bridging out to Java code and are expecting null from the Java code, write a small bridge that will wrapper the Java return values in Box/Option. - You have a case class (Tick) that contains no parameters. Please use a case object instead. - Your Tick look is a spin loop. You fire a Tick message as part of processing the Tick message. I would suggest that if you're polling, that you have a reasonable poll interval, otherwise you'll starve your CPU. Further, having reRender on each loop through means that you're forcing a lot of bytes over the wire rather than only doing a reRender on changed values. Thanks, David On Sun, Nov 8, 2009 at 3:47 PM, Jack Widman jack.wid...@gmail.com wrote: Sorry. Here it is: As I said, I know that when render is called, foo.getValue has the right value. But it does not show on the screen, unless I refresh the browser. package com.foo.comet import
[Lift] Re: Accessing functions of a lift webapp from the command line
Julian, The short answer to your question is to create separate projects that depend on one another. So, you can put all your business logic in a module and package it up as a JAR file (this is the basic unit of packaging for JVM-based applications). Then you can build a a web based application and/or a command line application that accesses the business logic (the library). On Fri, Nov 13, 2009 at 6:44 AM, Julian Backes julianbac...@googlemail.comwrote: Hi Lift Community, I'm pretty new to the Scala/Lift world. My idea is to port a web application written by me in PHP to Scala/Lift. Unfortunately, the PHP version also has some functions which are used by some cronjob, i.e. from the command line. So my first question is: Is there any possibility to access functions in a Lift webapp from the command line? See above. My idea in a more general version is: I want to write some application which can be accessed in multiple ways: for example from the command line (as just described), from the web using normal xhtml pages, from the web using json requests etc. Of course, I want to write as less functionality as possible twice so there should be some core which has the logic (and probably some model/database in the background) and several interfaces (one command line interface, one webinterface, one json interface...) which should only act as translators. For example the web interface gets some (let's say POST) request, extracts the data needed to process the request and passes these date to the core. The core does something and returns the data needed for an answer. The webinterface takes these data and creates some xhtml page out of it. In contrast to that, the json interface only gets a request in json format, extracts the data, passes them to the core, gets the result and sends back a *json* answer. The command line interface will just take some command line arguments, extract data, pass them and answer with *some plain text*. So my second question is: How does this idea fit into the lift world? Just fine. One reason for my questions: As I understood it, Lift is heavily bound to the webinterface part I described above. For example the snippets which seem to be one very important part of Lift can only work with xml/xhtml data. Yes, but the snippet is meant to bridge between business logic and XHTML presentation. I hope you understand my ideas and questions, I'm still learning English ;-) You speak it very well. Thanks, David Thanks in advance for all answers!! Julian -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics --~--~-~--~~~---~--~~ 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: MegaProtoUser + MappedPassword question
On Sun, Nov 8, 2009 at 5:48 AM, george geo...@mattandgeorge.com wrote: I'm using MegaProtoUser which has a MappedPassword field. When the sign up form is displayed, the password field is pre- populated to '***' which is proving very confusing for some users. The reason for the design is that all MappedPasswords in Lift contain a password. It's just that it's not possible to recover the password (it's 1-way hashed). I would like to display the password field as a completely empty field, but I can not see a way to override this behavior. You can change the _toForm method and as Derek suggested, we'll add a flag to change the behavior. MegaProtoUser is mostly suiting my needs pretty well right now, so I am reluctant to roll my own for the sake of such a small detail. Once the issues with Structural Types (see Scala defect 1006) go away (as in Scala 2.8), we'll change MegaProtoUser to support changing the mapped fields, but right now, you're kinda stuck. Sorry. David Does anyone have any ideas how I can achieve this? thanks george -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics --~--~-~--~~~---~--~~ 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: Problem with rewriting and SessionVar
On Fri, Nov 13, 2009 at 6:46 AM, Jeppe Nejsum Madsen je...@ingolfs.dkwrote: David Pollak feeder.of.the.be...@gmail.com writes: [...] Yes. The rewrite phase takes place very early in the HTTP request/response cycle. It takes place before the statelessDispatch call. The statelessDispatch call is very important for REST style APIs as it does *not* cause the creation of a session, thus for lots of API calls, we don't have a session created for each call. The rewrite phase has to come before the statelessDispatch phase because the request has to be properly rewritten before being pattern matched against the partial functions that define the statelessDispatch Based on some of your prior needs, I've made the session available during the rewrite phase, but it's only if the session actually exists (basically, the request is checked for a session, but the request is not told create one if it doesn't already exists. I sort of guessed it had to do with this. I find rewriting really useful to write apps that need to extract info from the URL in a type-safe way before continuing the processing. I seem to run into a number of issues with this approach (some which you've fixed, thanks!), so was wondering if perhaps I'm misusing rewriting and there are better ways to approach this? A few thoughts: - Is it possible to create a session manually in the rewrite phase? Yes. Please open a ticket If no, maybe a LiftRule PF that could be used to force session creation for certain requests? No, because we don't know what the request is during the rewrite phase. - Would it be possible to detect (at least in Dev mode) some of these misuses (i.e. using a SessionVar with no session) and emit a warning? Yes. Please open a ticket. So, the first request from a browser does not have a session and thus does not have session vars. Is there a way you can use RequestVars here? I guess I can hack something together for this case, but I need to think a little more to make sure it fits cleanly with the rest. Generally, the rewrite phase should not have side effects. Yeah, storing something in a RequestVar is one thing, but changing session state is another. I would strongly suggest looking at your code and seeing if you can set the SessionVar in the business logic portion of your code. If I just redirect back to the same page, will this trigger the session creation or does the redirect happen before the session is created? You could manually force the session to be created and then redirect. It's a multipage workflow, so SessionVars seem like the easy way out :-) Wizard is coming. :-) /Jeppe -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics --~--~-~--~~~---~--~~ 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: Changes to transaction handling since M6?
FWIW regarding naming, since the change I've started to mentally rename RequestVar to PageVar. I don't think it's reasonable to rename the actual class, since everybody uses it, but I found it was a helpful mnemonic to remember what scope it has. -Ross On Nov 13, 2009, at 6:00 PM, Kris Nuttycombe wrote: On Fri, Nov 13, 2009 at 3:42 PM, David Pollak feeder.of.the.be...@gmail.com wrote: On Fri, Nov 13, 2009 at 12:12 PM, Kris Nuttycombe kris.nuttyco...@gmail.com wrote: On Fri, Nov 13, 2009 at 11:46 AM, Derek Chen-Becker dchenbec...@gmail.com wrote: Looks like it. Probably private[liftweb] would work, too. In any case, the scaladocs need to be updated to reflect what it's for. On Fri, Nov 13, 2009 at 12:26 PM, Kris Nuttycombe kris.nuttyco...@gmail.com wrote: Hmmm is this now TransientRequestVar? It's private[http], but could it be protected instead? Kris David, do you have an opinion? Is there any reason to keep this private to lift, or is it something that 3rd-party libraries could make use of (as in this case?) I wanted to keep it as narrow as possible while we saw how it worked and got better naming. Making it private[liftweb] is fine and we'll open it up later. Okay, done and on ReviewBoard. --~--~-~--~~~---~--~~ 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: CometListener
Here is my pom.xml On Fri, Nov 13, 2009 at 12:09 PM, Jack Widman jack.wid...@gmail.com wrote: sure. Thanks Ross. I will send it tonight. Also what is the difference between the CometListener and the CometListenee? On Fri, Nov 13, 2009 at 11:14 AM, Ross Mellgren dri...@gmail.com wrote: Could you send over your pom.xml if you're using Maven? It sounds like maybe your build path is not correct. -Ross On Nov 13, 2009, at 12:09 AM, Jack Widman wrote: David, I'm using lift 1.1 and scala 2.5 now and the compiler says it cant find CometListener when I import net.liftweb.http._ Jack On Fri, Nov 13, 2009 at 12:01 AM, David Pollak feeder.of.the.be...@gmail.com wrote: On Thu, Nov 12, 2009 at 8:54 PM, Jack Widman jack.wid...@gmail.comwrote: C:\work\widman\src\main\scala\com\widman\comet\PackComet.scala:20: error: type CometListener is not a member of package net.liftweb.http I got this compile error. I must be missing something obvious. It's part of Lift 1.1, not Lift 1.0 On Thu, Nov 12, 2009 at 11:42 PM, Ross Mellgren dri...@gmail.comwrote: It is in net.liftweb.http. http://www.scala-tools.org/mvnsites-snapshots/liftweb/lift-webkit/scaladocs/net/liftweb/http/CometListener.html By the way, the link you gave only indicates it's in either net.liftweb.http, net.liftweb.util, net.liftweb or model (or a couple other packages, since scala implicitly imports superpackages). -Ross On Nov 12, 2009, at 11:38 PM, jack wrote: I also tried net.liftweb.http On Nov 12, 11:35 pm, jack jack.wid...@gmail.com wrote: I am trying to use CometListener. According tohttp://bit.ly/1Wnxt4, it is in the package net.liftweb._ but compiler says it can't be found. Is this the wrong package? -- Jack Widman co-founder / cto, Authoritude, Inc. 203-641-9355 -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics -- Jack Widman co-founder / cto, Authoritude, Inc. 203-641-9355 -- Jack Widman co-founder / cto, Authoritude, Inc. 203-641-9355 -- Jack Widman co-founder / cto, Authoritude, Inc. 203-641-9355 --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~--- project xmlns=http://maven.apache.org/POM/4.0.0; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd; modelVersion4.0.0/modelVersion groupIdcom.widman/groupId artifactIdwidman/artifactId version1.1-M6/version packagingwar/packaging namewidman/name inceptionYear2007/inceptionYear properties scala.version2.7.5/scala.version /properties repositories repository idscala-tools.org/id nameScala-Tools Maven2 Repository/name urlhttp://scala-tools.org/repo-releases/url /repository /repositories pluginRepositories pluginRepository idscala-tools.org/id nameScala-Tools Maven2 Repository/name urlhttp://scala-tools.org/repo-releases/url /pluginRepository /pluginRepositories dependencies dependency groupIdnet.liftweb/groupId artifactIdlift-textile/artifactId version1.1-M6/version /dependency dependency groupIdorg.scala-lang/groupId artifactIdscala-library/artifactId version${scala.version}/version /dependency dependency groupIdnet.liftweb/groupId artifactIdlift-util/artifactId version1.0/version /dependency dependency groupIdnet.liftweb/groupId artifactIdlift-webkit/artifactId version1.0/version /dependency dependency groupIdnet.liftweb/groupId artifactIdlift-mapper/artifactId version1.0/version /dependency dependency groupIdjavax.servlet/groupId artifactIdservlet-api/artifactId version2.5/version scopeprovided/scope /dependency dependency groupIdjunit/groupId artifactIdjunit/artifactId version4.5/version scopetest/scope /dependency dependency groupIdorg.mortbay.jetty/groupId artifactIdjetty/artifactId version[6.1.6,)/version scopetest/scope /dependency !-- for LiftConsole -- dependency groupIdorg.scala-lang/groupId artifactIdscala-compiler/artifactId version${scala.version}/version scopetest/scope /dependency !-- dependency groupIdorg.apache.httpcomponents/groupId artifactIdhttpcore/artifactId version4.0.1/version
[Lift] Comet Actor
I have a some code in a CometActor that I want to run right after render is called for the first time. What is the best way to do this? I could set a boolean variable in the render method and then send a message back to the CometActor to tell it to run the code. I suspect there is a better way? --~--~-~--~~~---~--~~ 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: CometListener
Your pom specifies lift 1.0, not 1.1 for the majority of lift modules. You are using 1.1-M6 for lift-textile. In addition, you don't have the snapshots repository configured. To fix this, first add the snapshot repository to repositories: repository idscala-tools.org.snapshots/id nameScala-Tools Maven2 Repository for Snapshots/name urlhttp://scala-tools.org/repo-snapshots/url snapshots/ /repository Then switch *all* your lift-* dependencies to 1.1-SNAPSHOT and your scala version to 2.7.7. I use a property for the lift version to use, myself, like this: properties scala.version2.7.7/scala.version lift.version1.1-SNAPSHOT/lift.version /properties ... dependency groupIdnet.liftweb/gropuId artifactIdlift-util/artifactId version${lift.version}/version} /dependency (and so on, for each lift-* dependency) I'm not sure what would happen exactly if you have mixed versions of the lift modules, but It Can't Be Good. Hope that helps, -Ross On Nov 13, 2009, at 10:17 PM, Jack Widman wrote: Here is my pom.xml On Fri, Nov 13, 2009 at 12:09 PM, Jack Widman jack.wid...@gmail.com wrote: sure. Thanks Ross. I will send it tonight. Also what is the difference between the CometListener and the CometListenee? On Fri, Nov 13, 2009 at 11:14 AM, Ross Mellgren dri...@gmail.com wrote: Could you send over your pom.xml if you're using Maven? It sounds like maybe your build path is not correct. -Ross On Nov 13, 2009, at 12:09 AM, Jack Widman wrote: David, I'm using lift 1.1 and scala 2.5 now and the compiler says it cant find CometListener when I import net.liftweb.http._ Jack On Fri, Nov 13, 2009 at 12:01 AM, David Pollak feeder.of.the.be...@gmail.com wrote: On Thu, Nov 12, 2009 at 8:54 PM, Jack Widman jack.wid...@gmail.com wrote: C:\work\widman\src\main\scala\com\widman\comet\PackComet.scala:20: error: type CometListener is not a member of package net.liftweb.http I got this compile error. I must be missing something obvious. It's part of Lift 1.1, not Lift 1.0 On Thu, Nov 12, 2009 at 11:42 PM, Ross Mellgren dri...@gmail.com wrote: It is in net.liftweb.http. http://www.scala-tools.org/mvnsites-snapshots/liftweb/lift-webkit/scaladocs/net/liftweb/http/CometListener.html By the way, the link you gave only indicates it's in either net.liftweb.http, net.liftweb.util, net.liftweb or model (or a couple other packages, since scala implicitly imports superpackages). -Ross On Nov 12, 2009, at 11:38 PM, jack wrote: I also tried net.liftweb.http On Nov 12, 11:35 pm, jack jack.wid...@gmail.com wrote: I am trying to use CometListener. According tohttp://bit.ly/ 1Wnxt4, it is in the package net.liftweb._ but compiler says it can't be found. Is this the wrong package? -- Jack Widman co-founder / cto, Authoritude, Inc. 203-641-9355 -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics -- Jack Widman co-founder / cto, Authoritude, Inc. 203-641-9355 -- Jack Widman co-founder / cto, Authoritude, Inc. 203-641-9355 -- Jack Widman co-founder / cto, Authoritude, Inc. 203-641-9355 pom.xml --~--~-~--~~~---~--~~ 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: CometListener
Thanks Ross. On Fri, Nov 13, 2009 at 11:55 PM, Ross Mellgren dri...@gmail.com wrote: Your pom specifies lift 1.0, not 1.1 for the majority of lift modules. You are using 1.1-M6 for lift-textile. In addition, you don't have the snapshots repository configured. To fix this, first add the snapshot repository to repositories: repository idscala-tools.org.snapshots/id nameScala-Tools Maven2 Repository for Snapshots/name urlhttp://scala-tools.org/repo-snapshots/url snapshots/ /repository Then switch *all* your lift-* dependencies to 1.1-SNAPSHOT and your scala version to 2.7.7. I use a property for the lift version to use, myself, like this: properties scala.version2.7.7/scala.version lift.version1.1-SNAPSHOT/lift.version /properties ... dependency groupIdnet.liftweb/gropuId artifactIdlift-util/artifactId version${lift.version}/version} /dependency (and so on, for each lift-* dependency) I'm not sure what would happen exactly if you have mixed versions of the lift modules, but It Can't Be Good. Hope that helps, -Ross On Nov 13, 2009, at 10:17 PM, Jack Widman wrote: Here is my pom.xml On Fri, Nov 13, 2009 at 12:09 PM, Jack Widman jack.wid...@gmail.comwrote: sure. Thanks Ross. I will send it tonight. Also what is the difference between the CometListener and the CometListenee? On Fri, Nov 13, 2009 at 11:14 AM, Ross Mellgren dri...@gmail.com wrote: Could you send over your pom.xml if you're using Maven? It sounds like maybe your build path is not correct. -Ross On Nov 13, 2009, at 12:09 AM, Jack Widman wrote: David, I'm using lift 1.1 and scala 2.5 now and the compiler says it cant find CometListener when I import net.liftweb.http._ Jack On Fri, Nov 13, 2009 at 12:01 AM, David Pollak feeder.of.the.be...@gmail.com wrote: On Thu, Nov 12, 2009 at 8:54 PM, Jack Widman jack.wid...@gmail.comwrote: C:\work\widman\src\main\scala\com\widman\comet\PackComet.scala:20: error: type CometListener is not a member of package net.liftweb.http I got this compile error. I must be missing something obvious. It's part of Lift 1.1, not Lift 1.0 On Thu, Nov 12, 2009 at 11:42 PM, Ross Mellgren dri...@gmail.comwrote: It is in net.liftweb.http. http://www.scala-tools.org/mvnsites-snapshots/liftweb/lift-webkit/scaladocs/net/liftweb/http/CometListener.html By the way, the link you gave only indicates it's in either net.liftweb.http, net.liftweb.util, net.liftweb or model (or a couple other packages, since scala implicitly imports superpackages). -Ross On Nov 12, 2009, at 11:38 PM, jack wrote: I also tried net.liftweb.http On Nov 12, 11:35 pm, jack jack.wid...@gmail.com wrote: I am trying to use CometListener. According tohttp://bit.ly/1Wnxt4 , it is in the package net.liftweb._ but compiler says it can't be found. Is this the wrong package? -- Jack Widman co-founder / cto, Authoritude, Inc. 203-641-9355 -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics -- Jack Widman co-founder / cto, Authoritude, Inc. 203-641-9355 -- Jack Widman co-founder / cto, Authoritude, Inc. 203-641-9355 -- Jack Widman co-founder / cto, Authoritude, Inc. 203-641-9355 pom.xml -- Jack Widman co-founder / cto, Authoritude, Inc. 203-641-9355 --~--~-~--~~~---~--~~ 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 specify the SELECT statement in the Mapper ?
Ok, Thanks for all your suggestion! I'll try it again, :) Cheers, Neil On Nov 14, 2:52 am, harryh har...@gmail.com wrote: You'll be better off if you don't do it that way. Compute the day of week from created_at in your scala code (personally I prefer joda time for this sort of thing), instead of having the database do it for you. Use the database to store and retrieve data, not to perform calculations. -harryh On Nov 9, 1:44 am, Neil.Lv anim...@gmail.com wrote: Hi all, There is some example code: ### SELECT id, name, sex, created_at, DAYOFWEEK(created_at,) as week, (CURRENT_DATE) as t FROM users WHERE created_at (CURRENT_DATE ) AND created_at (CURRENT_DATE + interval 2 day) ORDER BY created_at ASC ### How can i specify the SELECT statement that i don't want all the columns and i want add the column as week in the example code ? Any help would be much appreciated! Cheers, Neil --~--~-~--~~~---~--~~ 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] How to save the uploaded image into the folder via fileUpload in Lift?
Hi all, How to save the uploaded image into the folder via fileUpload in Lift? I don't want to save it in the database, the example code in the Pocketchangeapp ### val receiptOk = fileHolder match { case Full(FileParamHolder(_, null, _, _)) = true case Full(FileParamHolder(_, mime, _, data)) if mime.startsWith(image/) = { // How can i save the data into a image in the folder. e.receipt(data).receiptMime(mime) true } case Full(_) = { S.error(Invalid receipt attachment) false } case _ = true } ### To save the image into the webapp\images folder, and it's shown just use this link: /images/img1.jpg Thanks for any suggestion! Cheers, Neil --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---