[Lift] Re: OSGi support for Lift
Alex, [5285...@qtp-20735553-0 - /] INFO org.ops4j.pax.web.service.internal.HttpServiceContext - getting resource: [/templates-hidden/default.htm] [5285...@qtp-20735553-0 - /] INFO org.ops4j.pax.web.service.internal.HttpServiceContext - found resource: null Is that normal? I can see the following displayed: As far as I know Lift that *is* normal, because Lift tries different locales and suffixes to match index. Browse little further down and you should see that it finally finds index.html (not .htm): INFO org.ops4j.pax.web.service.internal.HttpServiceContext - getting resource: [/index_en_US] INFO org.ops4j.pax.web.service.internal.HttpServiceContext - found resource: null INFO org.ops4j.pax.web.service.internal.HttpServiceContext - getting resource: [/index_en] INFO org.ops4j.pax.web.service.internal.HttpServiceContext - found resource: null INFO org.ops4j.pax.web.service.internal.HttpServiceContext - getting resource: [/index] INFO org.ops4j.pax.web.service.internal.HttpServiceContext - found resource: null INFO org.ops4j.pax.web.service.internal.HttpServiceContext - getting resource: [/index_en_US.html] INFO org.ops4j.pax.web.service.internal.HttpServiceContext - found resource: null INFO org.ops4j.pax.web.service.internal.HttpServiceContext - getting resource: [/index_en.html] INFO org.ops4j.pax.web.service.internal.HttpServiceContext - found resource: null INFO org.ops4j.pax.web.service.internal.HttpServiceContext - getting resource: [/index.html] INFO org.ops4j.pax.web.service.internal.HttpServiceContext - found resource: bundle://16.0:1/webapp/index.html pFrom a snippet: spanHi, I am a snippet from a Lift-powered OSGi bundle!/span/p but there's no surrounding html body ... /body /html so the browser complains. Puh, I cannot reproduce this. My browser gets ?xml version=1.0 encoding=UTF-8? !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns:lift=http://liftweb.net/; xmlns=http://www.w3.org/1999/xhtml;head titleLift-OSGi/title script type=text/javascript src=/ajax_request/liftAjax.js;jsessionid=ll3rqumuelvm/script/head body h2Welcome to Lift on OSGi!/h2 pFrom a snippet: spanHi, I am a snippet from a Lift-powered OSGi bundle!/span/p script type=text/javascript // ![CDATA[ jQuery(document).ready(function() {lift_successRegisterGC();}); var lift_page = 'F1077120265494I14'; // ]] /script/body /html My fix for the build issues broke the example. I just pushed a new version that works again (for me). Could you please give it another try? Thanx Heiko --~--~-~--~~~---~--~~ 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: OSGi support for Lift
Alex, This is an interesting requirement and could be feasible but not trivial. Please keep in mind, that in OSGi *each* application is (potentially) made up from several bundles that can be installed, updated and removed at any point of (run)time = Whar really leverages the power of OSGi is to have one *composite* web application (under one context). Because then you can do things like adding functionality or hot deployment which have not been possible before. Also notice that in OSGi space you will not have a Jetty as the leading server, but an OSGi framework like Felix or Equinox where Jetty or another servlet container is just one bundle. Currently there are ongoing efforts on how to nest OSGi frameworks = This will provide a very mature way to have several isolated composite applications. Maybe we should wait for that ... Cheers Heiko 2009/5/12 Alex Boisvert boisv...@intalio.com Alright, thanks for your help! I was mostly kicking the tires to get a taste for the upcoming OSGi integration. I guess my main feedback at this point is that it would be nice to map the app into a non-root context of Jetty. e.g. http://localhost:8080/examples-osgi instead of directly under http://localhost:8080.This would make it possible to deploy several Lift apps onto the same OSGi container. alex On Tue, May 12, 2009 at 12:19 PM, Heiko Seeberger heiko.seeber...@googlemail.com wrote: Hm, does not look good :-(Thanx for trying and please keep on! I have to deal with some build issues, and will take a look at that tomorrow. Heiko 2009/5/12 Alex Boisvert boisv...@intalio.com That was it. I pulled again from git and now I can start the examples-osgi app. However, one more nitpick... I can load index.htm but the snippet isn't rendered correctly because some resources can't be found. e.g. [5285...@qtp-20735553-0 - /] INFO org.ops4j.pax.web.service.internal.HttpServiceContext - getting resource: [/templates-hidden/default.htm] [5285...@qtp-20735553-0 - /] INFO org.ops4j.pax.web.service.internal.HttpServiceContext - found resource: null Is that normal? I can see the following displayed: pFrom a snippet: spanHi, I am a snippet from a Lift-powered OSGi bundle!/span/p but there's no surrounding html body ... /body /html so the browser complains. alex On Tue, May 12, 2009 at 11:24 AM, Heiko Seeberger heiko.seeber...@googlemail.com wrote: When did you check out? I pushed again about one or two hours ago.From the log I can see that you use an old version of hello.composite. The new one should look like: scan-bundle:wrap:mvn:javax.mail/mail/1.4 scan-bundle:wrap:mvn:javax.activation/activation/1.1 ... The wrap: is important. Pax Runner will wrap vanilla JARs into OSGi bundles. Please pull again, that should help. Heiko 2009/5/12 Alex Boisvert boisv...@intalio.com Ok, I tried again based on your suggestion but I'm getting an error related to javax.mail:1.4 not being a valid bundle... - Preparing framework [Felix 1.6.0] - Downloading bundles... - mvn:javax.mail/mail/1.4 : 388864 bytes @ [ 471kBps ] s @ [ 498kBps ] ___ / / / / Oops, there has been a problem! / / /__/ org.ops4j.pax.runner.platform.PlatformException: [mvn:javax.mail/mail/1.4] is not a valid bundle ___ /__/ Use --log=debug to see details. To be sure, I wiped my M2 repo under javax/mail and retried but I'm getting the same error. Any idea? I'm attaching the full log in case it's helpful. alex On Tue, May 12, 2009 at 10:08 AM, Heiko Seeberger heiko.seeber...@googlemail.com wrote: Hi Alex, 2009/5/12 Alex Boisvert boisv...@intalio.com I downloaded and ran PAX runner, ./pax-run.sh --profiles=log,scala,felix.webconsole,web then installed the examples-osgi bundle, - install file:///home/boisvert/git/liftweb/sites/examples-osgi/hello/target/examples-osgi-hello-1.1-SNAPSHOT.jar Bundle ID: 9 - [FelixDispatchQueue] DEBUG net.liftweb.examples-osgi-hello - BundleEvent INSTALLED start 9 - [FelixDispatchQueue] DEBUG net.liftweb.examples-osgi-hello - BundleEvent RESOLVED [FelixDispatchQueue] DEBUG net.liftweb.examples-osgi-hello - BundleEvent STARTED OSGi support for Lift is implemented as extender in order to keep Lift core OSGi-agnostic. This means that there is a special add-on bundle (lift-osgi) which must be installed and started. It will watch all bundles if they are Lift-powered which means they have got a Lift-Config manifest entry. If so, these bundles will be delegated to for resource look-ups (templates) and also (latest checkin) bootstrap.liftweb.Boot classes will be called. OK, you have got to install lift-osgi and all its prerequesites, i.e. lift-webkit, lift-util, etc. You could install the example PLUS all the required other bundles manually. But better go for Pax Runner like that pax-run.sh --profiles=web,scala,others scan-composite:file:hello_comp with
[Lift] A few things about the lift installer
Hi, I had it everything working having the git sources and built lift from there. But then I tried the lift-installer. After I un-installed it the M2_HOME env variable was not set back to the previous value. 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: A few things about the lift installer
Which platform? windows? mac? Sent from my iPhone On 13 May 2009, at 07:41, Marius marius.dan...@gmail.com wrote: Hi, I had it everything working having the git sources and built lift from there. But then I tried the lift-installer. After I un-installed it the M2_HOME env variable was not set back to the previous value. 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] Builing Lift ... again
Hi, I tried again to build lift on Windows ... and it failed again. Yes I did clean um my repository folder. The problems I ran into so far: 1. The spec for sites/examples application in pom.xml it was pointing to 1.4.4-SNAPTHOT version but this version does not seem to exist on scala-tools. Replacing this version with 1.4.5-SNAPSHOT did the trick 2. I'm now having some problems building with Scala JPA. It seems that it looks for scalajpa at: http://scala-tools.org/repo-releases/org/scala-libs/scalajpa/1.1-SNAPSHOT/scalajpa-1.1-SNAPSHOT.pom The hing is that on http://scala-tools.org/repo-releases/org/scala-libs/scalajpa/1.1/ there is no 1.1-SNAPSHOT, just 1.1. 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: Constantly Ajax Request ?
Well since he may have meant that, to disable it you put in Boot: LiftRules.enableLiftGC = false On May 12, 8:01 pm, Timothy Perrett timo...@getintheloop.eu wrote: This im aware of - however it just seems more likely that if he asked for comet behavior by inserting the comet tag he would associate the two. However, the way the original query was worded indicated to me at least that he was not expecting the ajax calls... hence why i think he's probally talking about the GC page ajax rather than a comet call. Generally speaking people tend to exaggerate, hence his miss-use of constantly. I may be wrong, but i have a hunch... Cheers, tim Nope... the GC happens once every 75 seconds (by default). It's not constant. --~--~-~--~~~---~--~~ 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: Trouble with lift, GAE, JPA, adding child records
I guess I should include the views too to make it easier to reproduce the problem. Here is edit.html: lift:surround with=default at=content head titlelift:loc lift:Natures.newOrEdit if:editEdit/if:edit if:newNew/if:new /lift:Natures.newOrEditnbsp;Nature /lift:loc/title /head h3lift:loc lift:Natures.newOrEdit if:editUpdate/if:edit if:newCreate/if:new /lift:Natures.newOrEditnbsp;Request Nature/lift:loc/h3 lift:Natures.edit form=GET nature:id / fieldsetlegendlift:locName/lift:loc/legend nature:name / /fieldset fieldsetlegendlift:locLocations/lift:loc/legend table thead tr thLocation name/th th colspan=4Allowed locations/th th/th /tr /thead tr td/td tdStreet/td tdHospital/td tdDoctor/td tdEquipment/td td/td /tr nature:locations each:location tr tdlocation:id /location:name //td tdlocation:allowStreet //td tdlocation:allowHospital //td tdlocation:allowDoctorallowDoctorChk/location:allowDoctor/ td tdlocation:allowEquipmentallowEquipmentChk/ location:allowEquipment/td tdlocation:removeBtnRemoveBtn/location:removeBtn/td /tr /each:location /nature:locations tr td colspan=5/td tdnature:newLocationinsertLocationBtn/nature:newLocation/ td /tr /table /fieldset nature:submit / /lift:Natures.edit /lift:surround And here is list.html: lift:surround with=default at=content head titlelift:locNatures List/lift:loc/title /head h3Request Natures/h3 table thead tr thlift:locName/lift:loc/th thlift:locLocations/lift:loc/th th/th /tr /thead lift:Natures.list tr tdnature:name //td tdnature:locations //td tdnature:edit //td tdnature:remove //td /tr /lift:Natures.list a href=editlift:locNew/lift:loc/a /table /lift:surround --~--~-~--~~~---~--~~ 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: A few things about the lift installer
Windows... On May 13, 10:34 am, Timothy Perrett timo...@getintheloop.eu wrote: Which platform? windows? mac? Sent from my iPhone On 13 May 2009, at 07:41, Marius marius.dan...@gmail.com wrote: Hi, I had it everything working having the git sources and built lift from there. But then I tried the lift-installer. After I un-installed it the M2_HOME env variable was not set back to the previous value. 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: A few things about the lift installer
One other thing ... I just installed on Windows using the installer and I did not want it's maven and Java rebel. After installation I noticed that in my M2_REPO the lift's artifacts are not in my repository. Maybe I just don't understand how the installer works. Br's, Marius On May 13, 10:49 am, marius d. marius.dan...@gmail.com wrote: Windows... On May 13, 10:34 am, Timothy Perrett timo...@getintheloop.eu wrote: Which platform? windows? mac? Sent from my iPhone On 13 May 2009, at 07:41, Marius marius.dan...@gmail.com wrote: Hi, I had it everything working having the git sources and built lift from there. But then I tried the lift-installer. After I un-installed it the M2_HOME env variable was not set back to the previous value. 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: A few things about the lift installer
Hmm I'll have to think about it - uninstalling PATH adjustment might be quite difficult. Could probally remove the M2_HOME... I'll have a think :-) any other feedback? Sent from my iPhone On 13 May 2009, at 08:49, marius d. marius.dan...@gmail.com wrote: Windows... On May 13, 10:34 am, Timothy Perrett timo...@getintheloop.eu wrote: Which platform? windows? mac? Sent from my iPhone On 13 May 2009, at 07:41, Marius marius.dan...@gmail.com wrote: Hi, I had it everything working having the git sources and built lift from there. But then I tried the lift-installer. After I un-installed it the M2_HOME env variable was not set back to the previous value. 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: A few things about the lift installer
Please see my previous post :) On May 13, 11:04 am, Timothy Perrett timo...@getintheloop.eu wrote: Hmm I'll have to think about it - uninstalling PATH adjustment might be quite difficult. Could probally remove the M2_HOME... I'll have a think :-) any other feedback? Sent from my iPhone On 13 May 2009, at 08:49, marius d. marius.dan...@gmail.com wrote: Windows... On May 13, 10:34 am, Timothy Perrett timo...@getintheloop.eu wrote: Which platform? windows? mac? Sent from my iPhone On 13 May 2009, at 07:41, Marius marius.dan...@gmail.com wrote: Hi, I had it everything working having the git sources and built lift from there. But then I tried the lift-installer. After I un-installed it the M2_HOME env variable was not set back to the previous value. 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: A few things about the lift installer
Ah right yes - it just does not do that :-) The installer configures the environent ready for dev. We took the descion some time ago to not try and replicate the maven functionality as it will download all the release or snapshot jars for you. Can we add some text that makes this clear? Cheers, Tim Sent from my iPhone On 13 May 2009, at 09:02, marius d. marius.dan...@gmail.com wrote: One other thing ... I just installed on Windows using the installer and I did not want it's maven and Java rebel. After installation I noticed that in my M2_REPO the lift's artifacts are not in my repository. Maybe I just don't understand how the installer works. Br's, Marius On May 13, 10:49 am, marius d. marius.dan...@gmail.com wrote: Windows... On May 13, 10:34 am, Timothy Perrett timo...@getintheloop.eu wrote: Which platform? windows? mac? Sent from my iPhone On 13 May 2009, at 07:41, Marius marius.dan...@gmail.com wrote: Hi, I had it everything working having the git sources and built lift from there. But then I tried the lift-installer. After I un-installed it the M2_HOME env variable was not set back to the previous value. 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: A few things about the lift installer
So ... I'm lost :) ... Where are the lift's binaries? What I expected is this: 1. Install Lift via installer. 2. Create a lift project with Lift's archetypes 3. Build the project and run it So the only thing that differs from what I normally do is step #1 where I'm not getting Lift's sources from GIT and I'm not building Lift. I just wanted Lift's binaries and dependencies to be in my maven repository. I guess my expectation is wrong :( ... so how does the Lift installer help someone that is new to Lift and just wants to try it out? Please forgive me if I may seam blunt, it is not my intention, just want to understand it ... Br's, Marius On May 13, 11:09 am, Timothy Perrett timo...@getintheloop.eu wrote: Ah right yes - it just does not do that :-) The installer configures the environent ready for dev. We took the descion some time ago to not try and replicate the maven functionality as it will download all the release or snapshot jars for you. Can we add some text that makes this clear? Cheers, Tim Sent from my iPhone On 13 May 2009, at 09:02, marius d. marius.dan...@gmail.com wrote: One other thing ... I just installed on Windows using the installer and I did not want it's maven and Java rebel. After installation I noticed that in my M2_REPO the lift's artifacts are not in my repository. Maybe I just don't understand how the installer works. Br's, Marius On May 13, 10:49 am, marius d. marius.dan...@gmail.com wrote: Windows... On May 13, 10:34 am, Timothy Perrett timo...@getintheloop.eu wrote: Which platform? windows? mac? Sent from my iPhone On 13 May 2009, at 07:41, Marius marius.dan...@gmail.com wrote: Hi, I had it everything working having the git sources and built lift from there. But then I tried the lift-installer. After I un-installed it the M2_HOME env variable was not set back to the previous value. 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: A few things about the lift installer
The binaries are in our main maven repo of course on scala-tools... If we put them in the installer, this does 2 things: 1. makes more work for us to regularly update the installers with the latest JAR's and deploy to liftweb.net 2. Only saves the user about 1 min of download time during their first run. The point of the installer is to get a users environment setup - from there its just a simple case of running: mvn archetype:generate -DarchetypeCatalog=http://scala-tools.org/ Job Done. Also, remember that we actually cannot distribute all the required dependencies to make lift work because of licensing restrictions... So what will it do when it needs those dependencies? Its going to fetch them from the web. So, back to where we started... It might as well just download lift too and get the latest version. Thoughts? Cheers, Tim On 13/05/2009 09:23, marius d. marius.dan...@gmail.com wrote: So ... I'm lost :) ... Where are the lift's binaries? What I expected is this: 1. Install Lift via installer. 2. Create a lift project with Lift's archetypes 3. Build the project and run it So the only thing that differs from what I normally do is step #1 where I'm not getting Lift's sources from GIT and I'm not building Lift. I just wanted Lift's binaries and dependencies to be in my maven repository. I guess my expectation is wrong :( ... so how does the Lift installer help someone that is new to Lift and just wants to try it out? Please forgive me if I may seam blunt, it is not my intention, just want to understand it ... Br's, Marius On May 13, 11:09 am, Timothy Perrett timo...@getintheloop.eu wrote: Ah right yes - it just does not do that :-) The installer configures the environent ready for dev. We took the descion some time ago to not try and replicate the maven functionality as it will download all the release or snapshot jars for you. Can we add some text that makes this clear? Cheers, Tim Sent from my iPhone On 13 May 2009, at 09:02, marius d. marius.dan...@gmail.com wrote: One other thing ... I just installed on Windows using the installer and I did not want it's maven and Java rebel. After installation I noticed that in my M2_REPO the lift's artifacts are not in my repository. Maybe I just don't understand how the installer works. Br's, Marius On May 13, 10:49 am, marius d. marius.dan...@gmail.com wrote: Windows... On May 13, 10:34 am, Timothy Perrett timo...@getintheloop.eu wrote: Which platform? windows? mac? Sent from my iPhone On 13 May 2009, at 07:41, Marius marius.dan...@gmail.com wrote: Hi, I had it everything working having the git sources and built lift from there. But then I tried the lift-installer. After I un-installed it the M2_HOME env variable was not set back to the previous value. 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: A few things about the lift installer
Just thank you very very much ! :) Br's, Marius On May 13, 11:46 am, Timothy Perrett timo...@getintheloop.eu wrote: The binaries are in our main maven repo of course on scala-tools... If we put them in the installer, this does 2 things: 1. makes more work for us to regularly update the installers with the latest JAR's and deploy to liftweb.net 2. Only saves the user about 1 min of download time during their first run. The point of the installer is to get a users environment setup - from there its just a simple case of running: mvn archetype:generate -DarchetypeCatalog=http://scala-tools.org/ Job Done. Also, remember that we actually cannot distribute all the required dependencies to make lift work because of licensing restrictions... So what will it do when it needs those dependencies? Its going to fetch them from the web. So, back to where we started... It might as well just download lift too and get the latest version. Thoughts? Cheers, Tim On 13/05/2009 09:23, marius d. marius.dan...@gmail.com wrote: So ... I'm lost :) ... Where are the lift's binaries? What I expected is this: 1. Install Lift via installer. 2. Create a lift project with Lift's archetypes 3. Build the project and run it So the only thing that differs from what I normally do is step #1 where I'm not getting Lift's sources from GIT and I'm not building Lift. I just wanted Lift's binaries and dependencies to be in my maven repository. I guess my expectation is wrong :( ... so how does the Lift installer help someone that is new to Lift and just wants to try it out? Please forgive me if I may seam blunt, it is not my intention, just want to understand it ... Br's, Marius On May 13, 11:09 am, Timothy Perrett timo...@getintheloop.eu wrote: Ah right yes - it just does not do that :-) The installer configures the environent ready for dev. We took the descion some time ago to not try and replicate the maven functionality as it will download all the release or snapshot jars for you. Can we add some text that makes this clear? Cheers, Tim Sent from my iPhone On 13 May 2009, at 09:02, marius d. marius.dan...@gmail.com wrote: One other thing ... I just installed on Windows using the installer and I did not want it's maven and Java rebel. After installation I noticed that in my M2_REPO the lift's artifacts are not in my repository. Maybe I just don't understand how the installer works. Br's, Marius On May 13, 10:49 am, marius d. marius.dan...@gmail.com wrote: Windows... On May 13, 10:34 am, Timothy Perrett timo...@getintheloop.eu wrote: Which platform? windows? mac? Sent from my iPhone On 13 May 2009, at 07:41, Marius marius.dan...@gmail.com wrote: Hi, I had it everything working having the git sources and built lift from there. But then I tried the lift-installer. After I un-installed it the M2_HOME env variable was not set back to the previous value. 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: Constantly Ajax Request ?
Hi Hi : Thanks for the answer but what's the LiftGC used for?? What's the difference between enabling it and disabling it ? Thanks. --~--~-~--~~~---~--~~ 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: Builing Lift ... again
Do you have the scala-tools.org/repo-snapshots configured? Maven will look in all configured repositories for artifacts sequentially. If it is *only* looking in repo-releases, then you need to modify your pom so it will also look in repo-snapshots. -Josh On Wed, May 13, 2009 at 3:40 AM, Marius marius.dan...@gmail.com wrote: Hi, I tried again to build lift on Windows ... and it failed again. Yes I did clean um my repository folder. The problems I ran into so far: 1. The spec for sites/examples application in pom.xml it was pointing to 1.4.4-SNAPTHOT version but this version does not seem to exist on scala-tools. Replacing this version with 1.4.5-SNAPSHOT did the trick 2. I'm now having some problems building with Scala JPA. It seems that it looks for scalajpa at: http://scala-tools.org/repo-releases/org/scala-libs/scalajpa/1.1-SNAPSHOT/scalajpa-1.1-SNAPSHOT.pom The hing is that on http://scala-tools.org/repo-releases/org/scala-libs/scalajpa/1.1/ there is no 1.1-SNAPSHOT, just 1.1. 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: Builing Lift ... again
On Wed, May 13, 2009 at 12:40 AM, Marius marius.dan...@gmail.com wrote: Hi, I tried again to build lift on Windows ... and it failed again. Yes I did clean um my repository folder. The problems I ran into so far: 1. The spec for sites/examples application in pom.xml it was pointing to 1.4.4-SNAPTHOT version but this version does not seem to exist on scala-tools. Replacing this version with 1.4.5-SNAPSHOT did the trick This is weird and seems to be an artifact of a very old Lift version. It also seems that Specs 1.4.4 and 1.5 are missing from scala-tools.org. 2. I'm now having some problems building with Scala JPA. It seems that it looks for scalajpa at: http://scala-tools.org/repo-releases/org/scala-libs/scalajpa/1.1-SNAPSHOT/scalajpa-1.1-SNAPSHOT.pom The hing is that on http://scala-tools.org/repo-releases/org/scala-libs/scalajpa/1.1/ there is no 1.1-SNAPSHOT, just 1.1. 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 Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Builing Lift ... again
Well in the pom from master we have: 1. pluginRepositories points to repo-releases 2. repositories points to both repo-releases and repo-snapshots Br's, Marius On May 13, 4:17 pm, Josh Suereth joshua.suer...@gmail.com wrote: Do you have the scala-tools.org/repo-snapshots configured? Maven will look in all configured repositories for artifacts sequentially. If it is *only* looking in repo-releases, then you need to modify your pom so it will also look in repo-snapshots. -Josh On Wed, May 13, 2009 at 3:40 AM, Marius marius.dan...@gmail.com wrote: Hi, I tried again to build lift on Windows ... and it failed again. Yes I did clean um my repository folder. The problems I ran into so far: 1. The spec for sites/examples application in pom.xml it was pointing to 1.4.4-SNAPTHOT version but this version does not seem to exist on scala-tools. Replacing this version with 1.4.5-SNAPSHOT did the trick 2. I'm now having some problems building with Scala JPA. It seems that it looks for scalajpa at: http://scala-tools.org/repo-releases/org/scala-libs/scalajpa/1.1-SNAP... The hing is that on http://scala-tools.org/repo-releases/org/scala-libs/scalajpa/1.1/ there is no 1.1-SNAPSHOT, just 1.1. 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: Menu access control not working as expected
Glenn, I've added another Loc param: /** * Allows extra access testing for a given menu location such that * you can build a menu that is displayed but redirects the user to a login * page if they are not logged in */ case class TestAccess(func: () = Box[LiftResponse]) extends LocParam This will let you write a function that tests access for the page and return a RedirectResponse if the user needs to log in. It will not impact the display of the menu item. Hope this helps. Thanks, David On Tue, May 12, 2009 at 5:23 PM, glenn gl...@exmbly.com wrote: Hmm, Here's my complete menu list for this LocGroup: def quoteMenu:List[Menu] = { val groupquote = Menu(Loc(groupquote, List(quote, group), Group Quote, LocGroup(quote), loggedIn )) val businessquote = Menu(Loc(businessquote, List(quote, business), Commercial Quote, LocGroup(quote))) val lifequote = Menu(Loc(lifequote, List(quote, life), Life Ins. Quote, LocGroup(quote))) val autoquote = Menu(Loc(autoquote, List(quote, auto), Auto Quote, LocGroup(quote))) val homequote = Menu(Loc(homequote, List(quote, home), Homeowners Quote, LocGroup(quote))) val medicarequote = Menu(Loc(medicarequote, List(quote, medicare), Medicare Sup. Quote, LocGroup(quote))) List (groupquote,businessquote,lifequote,autoquote,homequote,medicarequote) } I want to control page access so that whenever the user clicks on one of the above menu items and isn't logged they are redirected to the login page. As I understand it, there are no submenus here, only siblings. Where would I put the loggedIn function to make this work? On May 12, 5:02 pm, David Pollak feeder.of.the.be...@gmail.com wrote: If a top-level menu item is not accessible, then none of its children are accessible. SiteMap does not display any pages that are inaccessible. In the example, you've got all the menus controlled by the loggedIn If() clause and that's blocking access to menu and thus the menu is not displayed. On Tue, May 12, 2009 at 4:54 PM, glenn gl...@exmbly.com wrote: I have a menu defined as follows: def quoteMenu:List[Menu] = { val groupquote = Menu(Loc(groupquote, List(quote, group), Group Quote,loggedIn, LocGroup(quote))) More menu items } and an If LocParam to check if the user is logged in: val loggedIn = If(() = User.loggedIn_?, () = RedirectResponse(/login)) When the sitemap is displayed, the menu item is not visible if the user isn't logged in. This is not the behavior expected. The user should be able to click on the menu item and be redirected to the login page. Any ideas as to what's going on here. Am I even using the right mechanism to control page access? Glenn... -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Git some:http://github.com/dpp -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Trouble with lift, GAE, JPA, adding child records
I took a quick look and nothing is jumping out at me as wrong. When you get these errors do you at least get a stack trace? Having that would help narrow down where it's happening. Derek On Tue, May 12, 2009 at 5:40 PM, ngug naftoli...@gmail.com wrote: I made the beginnings of a lift app for GAE. It's for a volunteer medical assistance organization, to manage requests that they get. Every request has a nature, e.g., transportation, hospital visitation, etc. Each nature has a OneToMany association with a NatureLocationType, which means that when you enter the request you have a different set of location fields depending on the nature. One screen lets you manage the natures. On the same screen that you edit the name of the nature you can add, remove, and edit location types for that nature. I'm new to lift, GAE, and JPA, although familiar with Scala. So far I'm only working with the dev server. I started with the lift JPA library demo's (snippet) code Anyway, after a while I got it pretty functional. (After discovering that after each request, when it processes the input from the previous request the same entity object is still in the JVM, but it has become detached and there's no way to reattach it other than re-looking it up via its id---why does the entity manager have a shorter lifespan than the entity?) However, every now and then I get an error that the object is dirty but no field are, and sometimes an error that a request completed without closing the (which?) transaction. Could someone look at the source code and help me? Thanks, it's really appreciated. Here's the source for the snippet class (models below; note that EntityManager is my name for what the library demo calls Model: object EntityManager extends LocalEMF(transactions-optional) with RequestVarEM): package liftgae1.snippet import javax.persistence.{EntityExistsException, PersistenceException} import scala.collection.jcl.Conversions.convertList import scala.xml.{NodeSeq, Text} import net.liftweb.http.{RequestVar, SHtml, S, StatefulSnippet} import S._ import net.liftweb.util.{Helpers, Log} import Helpers._ import lrbcol.model.{EntityManager, Nature, NatureLocationType} class Natures /*extends StatefulSnippet*/ { /* val dispatch: DispatchIt = { case list = list case newOrEdit = newOrEdit case edit = edit }*/ // Set up a requestVar to track the nature object for edits and adds private object natureVar extends RequestVar[Nature](new Nature) def nature: Nature = natureVar.is def nature_=(nature: Nature) = natureVar(nature) def hasNature = nature.id != null def reloadNature = if(hasNature) try {nature = Nature.lookup (nature.id).get} catch {case e = println(e)} def list(xhtml: NodeSeq): NodeSeq = { println(In list) Nature.all foreach println NatureLocationType.all foreach {l=println(l + for + l.nature)} Nature.all.flatMap { n = println(Binding with + n + , contained = + EntityManager.contains(n)) bind(nature, xhtml, name -Text(n.name), locations - Text(n.natureLocationTypes map {_.name} mkString ,), edit -SHtml.link(edit, () = nature = n, Text(?(Edit)) ), remove - SHtml.link(list, () = {nature = n; reloadNature; EntityManager.removeAndFlush(nature)}, Text(?(Remove)) ) ) } } def newOrEdit(xhtml: NodeSeq) = hasNature match { case false = chooseTemplate(if, new, xhtml) case _ = chooseTemplate(if, edit, xhtml) } def edit(xhtml: NodeSeq): NodeSeq = { def doSave() { println(In doSave with %s format(nature)) if (nature.name.isEmpty) { error(emptyNature, The nature's name cannot be blank) } else try { EntityManager.mergeAndFlush(nature) redirectTo(list) } catch { case ee: EntityExistsException = error(That nature already exists.) case pe: PersistenceException = error(Error adding nature); Log.error(Nature add failed, pe) } } def insertLocation() { val l = new NatureLocationType nature.natureLocationTypes += l l.nature = nature EntityManager.mergeAndFlush(if(hasNature) l else nature) } def removeLocation(l: NatureLocationType) { try { EntityManager.removeAndFlush(l) } catch { case e = e.printStackTrace } } println(In edit with nature %s. format(nature)) def bindLocation(loc: NatureLocationType) = { var l = loc bind(location, chooseTemplate(each, location, xhtml), id - SHtml.hidden(()= l = NatureLocationType.lookup (loc.id)), name - SHtml.text(l.name, l.name = _),
[Lift] Re: Trouble with lift, GAE, JPA, adding child records
Thanks for looking. The stack traces aren't very helpful because they concern the state which is caused by the previous sequence of events. Anyway, why is there a transaction taking place in the first place? --~--~-~--~~~---~--~~ 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: Trouble with lift, GAE, JPA, adding child records
JPA requires that a transaction be in place before *any* persistence operations occur. The ScalaJPA stuff is supposed to handle it for you, so that's why I was wondering about stack traces. In particular, the RequestVarEM trait should start a new transaction when the request begins and close the transaction on exit. Derek On Wed, May 13, 2009 at 2:14 PM, ngug naftoli...@gmail.com wrote: Thanks for looking. The stack traces aren't very helpful because they concern the state which is caused by the previous sequence of events. Anyway, why is there a transaction taking place in the first place? --~--~-~--~~~---~--~~ 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] Documentation and use cases?
I'm still working on S.scala documentation. I've put some examples in, but they feel really contrived. Does someone have some real-world use cases for highLevelSessionDispatch and/or sessionRewriter? Thanks, Derek --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Documentation and use cases?
On Wed, May 13, 2009 at 1:36 PM, Derek Chen-Becker dchenbec...@gmail.comwrote: I'm still working on S.scala documentation. I've put some examples in, but they feel really contrived. Does someone have some real-world use cases for highLevelSessionDispatch and/or sessionRewriter? I used each of these features once/twice before a lot of the LiftRules flexibility. The key place that the highLevelSessionDispatcher is useful is dispatching custom call-backs from external services. You can create a session-specific URL that the browser gets redirected to... thus stuff is very, very secure. Thanks, Derek -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Documentation and use cases?
Cool, I hadn't thought of that. Also, any objections to rearranging some of the code while I'm updating docs? There are two S.loc methods that are far apart in the file, for instance. Derek On Wed, May 13, 2009 at 2:40 PM, David Pollak feeder.of.the.be...@gmail.com wrote: On Wed, May 13, 2009 at 1:36 PM, Derek Chen-Becker dchenbec...@gmail.comwrote: I'm still working on S.scala documentation. I've put some examples in, but they feel really contrived. Does someone have some real-world use cases for highLevelSessionDispatch and/or sessionRewriter? I used each of these features once/twice before a lot of the LiftRules flexibility. The key place that the highLevelSessionDispatcher is useful is dispatching custom call-backs from external services. You can create a session-specific URL that the browser gets redirected to... thus stuff is very, very secure. Thanks, Derek -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Documentation and use cases?
On Wed, May 13, 2009 at 2:00 PM, Derek Chen-Becker dchenbec...@gmail.comwrote: Cool, I hadn't thought of that. Also, any objections to rearranging some of the code while I'm updating docs? There are two S.loc methods that are far apart in the file, for instance. Have a field day! Derek On Wed, May 13, 2009 at 2:40 PM, David Pollak feeder.of.the.be...@gmail.com wrote: On Wed, May 13, 2009 at 1:36 PM, Derek Chen-Becker dchenbec...@gmail.com wrote: I'm still working on S.scala documentation. I've put some examples in, but they feel really contrived. Does someone have some real-world use cases for highLevelSessionDispatch and/or sessionRewriter? I used each of these features once/twice before a lot of the LiftRules flexibility. The key place that the highLevelSessionDispatcher is useful is dispatching custom call-backs from external services. You can create a session-specific URL that the browser gets redirected to... thus stuff is very, very secure. Thanks, Derek -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Menu access control not working as expected
David, Pardon my ignorance, but I see a Test case class in the Lift 1.0 api for Loc, but not TestAccess, which seems similar. Glenn... On May 13, 6:58 am, David Pollak feeder.of.the.be...@gmail.com wrote: Glenn, I've added another Loc param: /** * Allows extra access testing for a given menu location such that * you can build a menu that is displayed but redirects the user to a login * page if they are not logged in */ case class TestAccess(func: () = Box[LiftResponse]) extends LocParam This will let you write a function that tests access for the page and return a RedirectResponse if the user needs to log in. It will not impact the display of the menu item. Hope this helps. Thanks, David On Tue, May 12, 2009 at 5:23 PM, glenn gl...@exmbly.com wrote: Hmm, Here's my complete menu list for this LocGroup: def quoteMenu:List[Menu] = { val groupquote = Menu(Loc(groupquote, List(quote, group), Group Quote, LocGroup(quote), loggedIn )) val businessquote = Menu(Loc(businessquote, List(quote, business), Commercial Quote, LocGroup(quote))) val lifequote = Menu(Loc(lifequote, List(quote, life), Life Ins. Quote, LocGroup(quote))) val autoquote = Menu(Loc(autoquote, List(quote, auto), Auto Quote, LocGroup(quote))) val homequote = Menu(Loc(homequote, List(quote, home), Homeowners Quote, LocGroup(quote))) val medicarequote = Menu(Loc(medicarequote, List(quote, medicare), Medicare Sup. Quote, LocGroup(quote))) List (groupquote,businessquote,lifequote,autoquote,homequote,medicarequote) } I want to control page access so that whenever the user clicks on one of the above menu items and isn't logged they are redirected to the login page. As I understand it, there are no submenus here, only siblings. Where would I put the loggedIn function to make this work? On May 12, 5:02 pm, David Pollak feeder.of.the.be...@gmail.com wrote: If a top-level menu item is not accessible, then none of its children are accessible. SiteMap does not display any pages that are inaccessible. In the example, you've got all the menus controlled by the loggedIn If() clause and that's blocking access to menu and thus the menu is not displayed. On Tue, May 12, 2009 at 4:54 PM, glenn gl...@exmbly.com wrote: I have a menu defined as follows: def quoteMenu:List[Menu] = { val groupquote = Menu(Loc(groupquote, List(quote, group), Group Quote,loggedIn, LocGroup(quote))) More menu items } and an If LocParam to check if the user is logged in: val loggedIn = If(() = User.loggedIn_?, () = RedirectResponse(/login)) When the sitemap is displayed, the menu item is not visible if the user isn't logged in. This is not the behavior expected. The user should be able to click on the menu item and be redirected to the login page. Any ideas as to what's going on here. Am I even using the right mechanism to control page access? Glenn... -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Git some:http://github.com/dpp -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Git some:http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Menu access control not working as expected
On Wed, May 13, 2009 at 2:19 PM, glenn gl...@exmbly.com wrote: David, Pardon my ignorance, but I see a Test case class in the Lift 1.0 api for Loc, but not TestAccess, which seems similar. I added TestAccess to 1.1-SNAPSHOT last night. It's possible to write something in 1.0, but it's a lot harder... basically, you have to write a Snippet and do a custom LocParam. Most of us are on 1.1-SNAPSHOT and the sites I deploy are on 1.1-SNAPSHOT and there hasn't been an instability due to working on trunk-head that I've seen. Glenn... On May 13, 6:58 am, David Pollak feeder.of.the.be...@gmail.com wrote: Glenn, I've added another Loc param: /** * Allows extra access testing for a given menu location such that * you can build a menu that is displayed but redirects the user to a login * page if they are not logged in */ case class TestAccess(func: () = Box[LiftResponse]) extends LocParam This will let you write a function that tests access for the page and return a RedirectResponse if the user needs to log in. It will not impact the display of the menu item. Hope this helps. Thanks, David On Tue, May 12, 2009 at 5:23 PM, glenn gl...@exmbly.com wrote: Hmm, Here's my complete menu list for this LocGroup: def quoteMenu:List[Menu] = { val groupquote = Menu(Loc(groupquote, List(quote, group), Group Quote, LocGroup(quote), loggedIn )) val businessquote = Menu(Loc(businessquote, List(quote, business), Commercial Quote, LocGroup(quote))) val lifequote = Menu(Loc(lifequote, List(quote, life), Life Ins. Quote, LocGroup(quote))) val autoquote = Menu(Loc(autoquote, List(quote, auto), Auto Quote, LocGroup(quote))) val homequote = Menu(Loc(homequote, List(quote, home), Homeowners Quote, LocGroup(quote))) val medicarequote = Menu(Loc(medicarequote, List(quote, medicare), Medicare Sup. Quote, LocGroup(quote))) List (groupquote,businessquote,lifequote,autoquote,homequote,medicarequote) } I want to control page access so that whenever the user clicks on one of the above menu items and isn't logged they are redirected to the login page. As I understand it, there are no submenus here, only siblings. Where would I put the loggedIn function to make this work? On May 12, 5:02 pm, David Pollak feeder.of.the.be...@gmail.com wrote: If a top-level menu item is not accessible, then none of its children are accessible. SiteMap does not display any pages that are inaccessible. In the example, you've got all the menus controlled by the loggedIn If() clause and that's blocking access to menu and thus the menu is not displayed. On Tue, May 12, 2009 at 4:54 PM, glenn gl...@exmbly.com wrote: I have a menu defined as follows: def quoteMenu:List[Menu] = { val groupquote = Menu(Loc(groupquote, List(quote, group), Group Quote,loggedIn, LocGroup(quote))) More menu items } and an If LocParam to check if the user is logged in: val loggedIn = If(() = User.loggedIn_?, () = RedirectResponse(/login)) When the sitemap is displayed, the menu item is not visible if the user isn't logged in. This is not the behavior expected. The user should be able to click on the menu item and be redirected to the login page. Any ideas as to what's going on here. Am I even using the right mechanism to control page access? Glenn... -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Git some:http://github.com/dpp -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Git some:http://github.com/dpp -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: OSGi support for Lift
Hi Heiko, On Tue, May 12, 2009 at 11:21 PM, Heiko Seeberger heiko.seeber...@googlemail.com wrote: This is an interesting requirement and could be feasible but not trivial. Please keep in mind, that in OSGi *each* application is (potentially) made up from several bundles that can be installed, updated and removed at any point of (run)time = Whar really leverages the power of OSGi is to have one *composite* web application (under one context). Because then you can do things like adding functionality or hot deployment which have not been possible before. Yes, I do get that and these are exactly the things I'm looking for in moving to OSGi. However, as applications grow I think it's eventually necessary to modularize and isolate them so that changing something in one app doesn't affect another one. Let's say I have 2 apps and I'd like one of them to run on Lift 1.0 and the other one on Lift 1.1-SNAPSHOT, how do you see this working? In a typical J2EE webapp, these would be deployed as separate wars, each having a separate web context and isolated Lift core instances. Ideally, these would run in the same OSGi container so the overhead of the OSGi platform remains fixed. (Yes, I can imagine cases where you'd want to run multiple containers for additional isolation but I'm personally not expecting this anytime soon) alex --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Menu access control not working as expected
Thanks for the heads-up on the 1.1-SNAPSHOT version, but now, when I compile, I get errors. I don't think this has anything to do with menu redirection, but, I have a Company class defined like so: class Company extends LongKeyedMapper[Company] with Address[Company] with IdPK with CRUDify[Long,Company] { ... } And, this is what my compiler output tells me: illegal inheritance; self-type com.exmbly.scala.apbul.model.Company does not conform to net.liftweb.mapper.CRUDify [Long,com.exmbly.scala.apbul.model.Company]'s selftype net.liftweb.mapper.CRUDify [Long,com.exmbly.scala.apbul.model.Company] with com.exmbly.scala.apbul.model.Company with net.liftweb.mapper.KeyedMetaMapper [Long,com.exmbly.scala.apbul.model.Company] Was something changed in the definition of Crudify? What do I need to change in my code? The error is a bit confusing. Glenn... On May 13, 2:58 pm, David Pollak feeder.of.the.be...@gmail.com wrote: On Wed, May 13, 2009 at 2:19 PM, glenn gl...@exmbly.com wrote: David, Pardon my ignorance, but I see a Test case class in the Lift 1.0 api for Loc, but not TestAccess, which seems similar. I added TestAccess to 1.1-SNAPSHOT last night. It's possible to write something in 1.0, but it's a lot harder... basically, you have to write a Snippet and do a custom LocParam. Most of us are on 1.1-SNAPSHOT and the sites I deploy are on 1.1-SNAPSHOT and there hasn't been an instability due to working on trunk-head that I've seen. Glenn... On May 13, 6:58 am, David Pollak feeder.of.the.be...@gmail.com wrote: Glenn, I've added another Loc param: /** * Allows extra access testing for a given menu location such that * you can build a menu that is displayed but redirects the user to a login * page if they are not logged in */ case class TestAccess(func: () = Box[LiftResponse]) extends LocParam This will let you write a function that tests access for the page and return a RedirectResponse if the user needs to log in. It will not impact the display of the menu item. Hope this helps. Thanks, David On Tue, May 12, 2009 at 5:23 PM, glenn gl...@exmbly.com wrote: Hmm, Here's my complete menu list for this LocGroup: def quoteMenu:List[Menu] = { val groupquote = Menu(Loc(groupquote, List(quote, group), Group Quote, LocGroup(quote), loggedIn )) val businessquote = Menu(Loc(businessquote, List(quote, business), Commercial Quote, LocGroup(quote))) val lifequote = Menu(Loc(lifequote, List(quote, life), Life Ins. Quote, LocGroup(quote))) val autoquote = Menu(Loc(autoquote, List(quote, auto), Auto Quote, LocGroup(quote))) val homequote = Menu(Loc(homequote, List(quote, home), Homeowners Quote, LocGroup(quote))) val medicarequote = Menu(Loc(medicarequote, List(quote, medicare), Medicare Sup. Quote, LocGroup(quote))) List (groupquote,businessquote,lifequote,autoquote,homequote,medicarequote) } I want to control page access so that whenever the user clicks on one of the above menu items and isn't logged they are redirected to the login page. As I understand it, there are no submenus here, only siblings. Where would I put the loggedIn function to make this work? On May 12, 5:02 pm, David Pollak feeder.of.the.be...@gmail.com wrote: If a top-level menu item is not accessible, then none of its children are accessible. SiteMap does not display any pages that are inaccessible. In the example, you've got all the menus controlled by the loggedIn If() clause and that's blocking access to menu and thus the menu is not displayed. On Tue, May 12, 2009 at 4:54 PM, glenn gl...@exmbly.com wrote: I have a menu defined as follows: def quoteMenu:List[Menu] = { val groupquote = Menu(Loc(groupquote, List(quote, group), Group Quote,loggedIn, LocGroup(quote))) More menu items } and an If LocParam to check if the user is logged in: val loggedIn = If(() = User.loggedIn_?, () = RedirectResponse(/login)) When the sitemap is displayed, the menu item is not visible if the user isn't logged in. This is not the behavior expected. The user should be able to click on the menu item and be redirected to the login page. Any ideas as to what's going on here. Am I even using the right mechanism to control page access? Glenn... -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Git some:http://github.com/dpp -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Git some:http://github.com/dpp -- Lift, the simply
[Lift] Re: Menu access control not working as expected
On Wed, May 13, 2009 at 3:30 PM, glenn gl...@exmbly.com wrote: Thanks for the heads-up on the 1.1-SNAPSHOT version, but now, when I compile, I get errors. I don't think this has anything to do with menu redirection, but, I have a Company class defined like so: CRUDify should be mixed into the Meta object not into th instance class. In this case, move CRUDify to object Company. This was the original intent with CRUDify, but I did not put the proper constraints on it in 1.0... I fixed that up in 1.1. class Company extends LongKeyedMapper[Company] with Address[Company] with IdPK with CRUDify[Long,Company] { ... } And, this is what my compiler output tells me: illegal inheritance; self-type com.exmbly.scala.apbul.model.Company does not conform to net.liftweb.mapper.CRUDify [Long,com.exmbly.scala.apbul.model.Company]'s selftype net.liftweb.mapper.CRUDify [Long,com.exmbly.scala.apbul.model.Company] with com.exmbly.scala.apbul.model.Company with net.liftweb.mapper.KeyedMetaMapper [Long,com.exmbly.scala.apbul.model.Company] Was something changed in the definition of Crudify? What do I need to change in my code? The error is a bit confusing. Glenn... On May 13, 2:58 pm, David Pollak feeder.of.the.be...@gmail.com wrote: On Wed, May 13, 2009 at 2:19 PM, glenn gl...@exmbly.com wrote: David, Pardon my ignorance, but I see a Test case class in the Lift 1.0 api for Loc, but not TestAccess, which seems similar. I added TestAccess to 1.1-SNAPSHOT last night. It's possible to write something in 1.0, but it's a lot harder... basically, you have to write a Snippet and do a custom LocParam. Most of us are on 1.1-SNAPSHOT and the sites I deploy are on 1.1-SNAPSHOT and there hasn't been an instability due to working on trunk-head that I've seen. Glenn... On May 13, 6:58 am, David Pollak feeder.of.the.be...@gmail.com wrote: Glenn, I've added another Loc param: /** * Allows extra access testing for a given menu location such that * you can build a menu that is displayed but redirects the user to a login * page if they are not logged in */ case class TestAccess(func: () = Box[LiftResponse]) extends LocParam This will let you write a function that tests access for the page and return a RedirectResponse if the user needs to log in. It will not impact the display of the menu item. Hope this helps. Thanks, David On Tue, May 12, 2009 at 5:23 PM, glenn gl...@exmbly.com wrote: Hmm, Here's my complete menu list for this LocGroup: def quoteMenu:List[Menu] = { val groupquote = Menu(Loc(groupquote, List(quote, group), Group Quote, LocGroup(quote), loggedIn )) val businessquote = Menu(Loc(businessquote, List(quote, business), Commercial Quote, LocGroup(quote))) val lifequote = Menu(Loc(lifequote, List(quote, life), Life Ins. Quote, LocGroup(quote))) val autoquote = Menu(Loc(autoquote, List(quote, auto), Auto Quote, LocGroup(quote))) val homequote = Menu(Loc(homequote, List(quote, home), Homeowners Quote, LocGroup(quote))) val medicarequote = Menu(Loc(medicarequote, List(quote, medicare), Medicare Sup. Quote, LocGroup(quote))) List (groupquote,businessquote,lifequote,autoquote,homequote,medicarequote) } I want to control page access so that whenever the user clicks on one of the above menu items and isn't logged they are redirected to the login page. As I understand it, there are no submenus here, only siblings. Where would I put the loggedIn function to make this work? On May 12, 5:02 pm, David Pollak feeder.of.the.be...@gmail.com wrote: If a top-level menu item is not accessible, then none of its children are accessible. SiteMap does not display any pages that are inaccessible. In the example, you've got all the menus controlled by the loggedIn If() clause and that's blocking access to menu and thus the menu is not displayed. On Tue, May 12, 2009 at 4:54 PM, glenn gl...@exmbly.com wrote: I have a menu defined as follows: def quoteMenu:List[Menu] = { val groupquote = Menu(Loc(groupquote, List(quote, group), Group Quote,loggedIn, LocGroup(quote))) More menu items } and an If LocParam to check if the user is logged in: val loggedIn = If(() = User.loggedIn_?, () = RedirectResponse(/login)) When the sitemap is displayed, the menu item is not visible if the user isn't logged in. This is not the behavior expected. The user should be able to click on the menu item and be redirected to the login page. Any ideas as to what's going on here. Am I even using the right mechanism to control page
[Lift] seeking advice on mvn process-sources target
Lifted, After some research, it appears that the path of least resistance for generating integrated parser using BNF Converter is to write an ant build.xml file that stands as an interface between the make file that BNF Converter will generate if passed the -m flag. i've got that working and integrated into my pom.xml file using the maven-antrun-plugin. This generates a bunch of java files that i have been conventionally putting in the model directory -- largely because i stumbled onto that solution and stuck with it. Just to clarify, i'm looking at a modified lift project structure that looks like /Users/lgm/work/src/projex/biosimilarity/rlambda.google |-src |---main !-- modified structure lives here -- |-bnfc |---com |-biosimilarity |---reflection |-rlambda |---Absyn |---haskell !-- end modified structure -- |-scala |---bootstrap |-liftweb |---com |-biosimilarity |---reflection |-comet |-lib |-model |---rlambda |-Absyn |-Compile |-Eval |-snippet |-view |-webapp |---WEB-INF |---templates-hidden |---test |-resources |-scala |---com |-biosimilarity |---reflection Again, what i usually do is generate the parser java sources to live in the package com.mycompany.mygroup.model.artifactId and then copy the directory artifactId over to src/main/scala/com/mycompany/mygroup/model/artifactId . So, i have two questions -- - Is there a more standard practice? i know i could put the generated sources in target/generated-sources/..., but i'm not really seeing the bang-for-buck in that. i've already got cleaning action going on. - Is there a canonical way to get from the maven ${groupId} to the reverse path string? Best wishes, --greg -- L.G. Meredith Managing Partner Biosimilarity LLC 1219 NW 83rd St Seattle, WA 98117 +1 206.650.3740 http://biosimilarity.blogspot.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: Menu access control not working as expected
David, Moving CRUDify to the object fixed the compiler error. However, back on the original menu issue, using TestAccess, as you suggest, still did not work as expected. The menu item doesn't display. Maybe I'm missing something important. Sorry to be a bother, but hope you can help. Here's my menu code: def logged:Box[LiftResponse] = if(User.loggedIn_?){ Full(RedirectResponse(/Login)) }else{ Full(PlainTextResponse(No such location)) } val testLogin = TestAccess(() = logged) override def deleteMenuLoc = Empty override def createMenuLoc: Box[Menu] = Full(Menu(Loc(Create +Prefix, createPath, Continue..., locSnippets, LocGroup(company), testLogin, Loc.Template(createTemplate On May 13, 4:03 pm, David Pollak feeder.of.the.be...@gmail.com wrote: On Wed, May 13, 2009 at 3:30 PM, glenn gl...@exmbly.com wrote: Thanks for the heads-up on the 1.1-SNAPSHOT version, but now, when I compile, I get errors. I don't think this has anything to do with menu redirection, but, I have a Company class defined like so: CRUDify should be mixed into the Meta object not into th instance class. In this case, move CRUDify to object Company. This was the original intent with CRUDify, but I did not put the proper constraints on it in 1.0... I fixed that up in 1.1. class Company extends LongKeyedMapper[Company] with Address[Company] with IdPK with CRUDify[Long,Company] { ... } And, this is what my compiler output tells me: illegal inheritance; self-type com.exmbly.scala.apbul.model.Company does not conform to net.liftweb.mapper.CRUDify [Long,com.exmbly.scala.apbul.model.Company]'s selftype net.liftweb.mapper.CRUDify [Long,com.exmbly.scala.apbul.model.Company] with com.exmbly.scala.apbul.model.Company with net.liftweb.mapper.KeyedMetaMapper [Long,com.exmbly.scala.apbul.model.Company] Was something changed in the definition of Crudify? What do I need to change in my code? The error is a bit confusing. Glenn... On May 13, 2:58 pm, David Pollak feeder.of.the.be...@gmail.com wrote: On Wed, May 13, 2009 at 2:19 PM, glenn gl...@exmbly.com wrote: David, Pardon my ignorance, but I see a Test case class in the Lift 1.0 api for Loc, but not TestAccess, which seems similar. I added TestAccess to 1.1-SNAPSHOT last night. It's possible to write something in 1.0, but it's a lot harder... basically, you have to write a Snippet and do a custom LocParam. Most of us are on 1.1-SNAPSHOT and the sites I deploy are on 1.1-SNAPSHOT and there hasn't been an instability due to working on trunk-head that I've seen. Glenn... On May 13, 6:58 am, David Pollak feeder.of.the.be...@gmail.com wrote: Glenn, I've added another Loc param: /** * Allows extra access testing for a given menu location such that * you can build a menu that is displayed but redirects the user to a login * page if they are not logged in */ case class TestAccess(func: () = Box[LiftResponse]) extends LocParam This will let you write a function that tests access for the page and return a RedirectResponse if the user needs to log in. It will not impact the display of the menu item. Hope this helps. Thanks, David On Tue, May 12, 2009 at 5:23 PM, glenn gl...@exmbly.com wrote: Hmm, Here's my complete menu list for this LocGroup: def quoteMenu:List[Menu] = { val groupquote = Menu(Loc(groupquote, List(quote, group), Group Quote, LocGroup(quote), loggedIn )) val businessquote = Menu(Loc(businessquote, List(quote, business), Commercial Quote, LocGroup(quote))) val lifequote = Menu(Loc(lifequote, List(quote, life), Life Ins. Quote, LocGroup(quote))) val autoquote = Menu(Loc(autoquote, List(quote, auto), Auto Quote, LocGroup(quote))) val homequote = Menu(Loc(homequote, List(quote, home), Homeowners Quote, LocGroup(quote))) val medicarequote = Menu(Loc(medicarequote, List(quote, medicare), Medicare Sup. Quote, LocGroup(quote))) List (groupquote,businessquote,lifequote,autoquote,homequote,medicarequote) } I want to control page access so that whenever the user clicks on one of the above menu items and isn't logged they are redirected to the login page. As I understand it, there are no submenus here, only siblings. Where would I put the loggedIn function to make this work? On May 12, 5:02 pm, David Pollak feeder.of.the.be...@gmail.com wrote: If a top-level menu item is not accessible, then none of its children are accessible. SiteMap does not display any pages that are inaccessible. In the example, you've got all the menus controlled by the loggedIn If()
[Lift] Re: Menu access control not working as expected
Glenn, Sorry... there was a bug in the code. I've fixed it. It'll be available when this build finishes: http://hudson.scala-tools.org/job/Lift/949/console Please remember to do an mvn -U clean install I'm enclosing the sample app that I used to test. Please note that you should only return Full(LiftResponse) if you want to redirect... not if you want to stay on the page. Thanks, David On Wed, May 13, 2009 at 8:51 PM, glenn gl...@exmbly.com wrote: David, Moving CRUDify to the object fixed the compiler error. However, back on the original menu issue, using TestAccess, as you suggest, still did not work as expected. The menu item doesn't display. Maybe I'm missing something important. Sorry to be a bother, but hope you can help. Here's my menu code: def logged:Box[LiftResponse] = if(User.loggedIn_?){ Full(RedirectResponse(/Login)) }else{ Full(PlainTextResponse(No such location)) } val testLogin = TestAccess(() = logged) override def deleteMenuLoc = Empty override def createMenuLoc: Box[Menu] = Full(Menu(Loc(Create +Prefix, createPath, Continue..., locSnippets, LocGroup(company), testLogin, Loc.Template(createTemplate On May 13, 4:03 pm, David Pollak feeder.of.the.be...@gmail.com wrote: On Wed, May 13, 2009 at 3:30 PM, glenn gl...@exmbly.com wrote: Thanks for the heads-up on the 1.1-SNAPSHOT version, but now, when I compile, I get errors. I don't think this has anything to do with menu redirection, but, I have a Company class defined like so: CRUDify should be mixed into the Meta object not into th instance class. In this case, move CRUDify to object Company. This was the original intent with CRUDify, but I did not put the proper constraints on it in 1.0... I fixed that up in 1.1. class Company extends LongKeyedMapper[Company] with Address[Company] with IdPK with CRUDify[Long,Company] { ... } And, this is what my compiler output tells me: illegal inheritance; self-type com.exmbly.scala.apbul.model.Company does not conform to net.liftweb.mapper.CRUDify [Long,com.exmbly.scala.apbul.model.Company]'s selftype net.liftweb.mapper.CRUDify [Long,com.exmbly.scala.apbul.model.Company] with com.exmbly.scala.apbul.model.Company with net.liftweb.mapper.KeyedMetaMapper [Long,com.exmbly.scala.apbul.model.Company] Was something changed in the definition of Crudify? What do I need to change in my code? The error is a bit confusing. Glenn... On May 13, 2:58 pm, David Pollak feeder.of.the.be...@gmail.com wrote: On Wed, May 13, 2009 at 2:19 PM, glenn gl...@exmbly.com wrote: David, Pardon my ignorance, but I see a Test case class in the Lift 1.0 api for Loc, but not TestAccess, which seems similar. I added TestAccess to 1.1-SNAPSHOT last night. It's possible to write something in 1.0, but it's a lot harder... basically, you have to write a Snippet and do a custom LocParam. Most of us are on 1.1-SNAPSHOT and the sites I deploy are on 1.1-SNAPSHOT and there hasn't been an instability due to working on trunk-head that I've seen. Glenn... On May 13, 6:58 am, David Pollak feeder.of.the.be...@gmail.com wrote: Glenn, I've added another Loc param: /** * Allows extra access testing for a given menu location such that * you can build a menu that is displayed but redirects the user to a login * page if they are not logged in */ case class TestAccess(func: () = Box[LiftResponse]) extends LocParam This will let you write a function that tests access for the page and return a RedirectResponse if the user needs to log in. It will not impact the display of the menu item. Hope this helps. Thanks, David On Tue, May 12, 2009 at 5:23 PM, glenn gl...@exmbly.com wrote: Hmm, Here's my complete menu list for this LocGroup: def quoteMenu:List[Menu] = { val groupquote = Menu(Loc(groupquote, List(quote, group), Group Quote, LocGroup(quote), loggedIn )) val businessquote = Menu(Loc(businessquote, List(quote, business), Commercial Quote, LocGroup(quote))) val lifequote = Menu(Loc(lifequote, List(quote, life), Life Ins. Quote, LocGroup(quote))) val autoquote = Menu(Loc(autoquote, List(quote, auto), Auto Quote, LocGroup(quote))) val homequote = Menu(Loc(homequote, List(quote, home), Homeowners Quote, LocGroup(quote))) val medicarequote = Menu(Loc(medicarequote, List(quote, medicare), Medicare Sup. Quote, LocGroup(quote))) List (groupquote,businessquote,lifequote,autoquote,homequote,medicarequote) } I want to control page access so that whenever