[Lift] Re: Getting Started tutorial - not understanding some syntax
I think the difference is only true in a class body. Inside a code block I think the def is syntactic sugar for the other syntax. - Viktor Klangviktor.kl...@gmail.com wrote: On Thu, Jul 30, 2009 at 11:02 PM, DFectuoso santiago1...@gmail.com wrote: Viktor, that was a great explanation, im sure ben will apraciate that kind of teaching =) Well, thank you. A follow up question that just made me wonder, what is the diference between val square = (x : Int) = x * x This creates a final reference to a new function instance and def square(x:Int):Int = x * x This creates a method Now, you can transform a method into a function by adding an underscore after it, like this: def square(x : Int) = x * x val sq = square _ //--- notice the underscore. (I always think of it as detaching the method from an instance) This is what the Scala REPL says: scala def square(x : Int) = x * x square: (Int)Int scala val vsquare = (x : Int) = x * x vsquare: (Int) = Int = function scala val v2square = square _ v2square: (Int) = Int = function scala square(2) res0: Int = 4 scala vsquare(2) res1: Int = 4 scala v2square(2) res2: Int = 4 ? On Jul 30, 1:49 pm, Viktor Klang viktor.kl...@gmail.com wrote: Hello Ben! the following: val square = (x:Int) = x * x val square is the equivalent of a final reference in Java. (x : Int) = x * x This constructs a Function instance that takes an Int and returns that Int squared. The equivalent Java code would be something like: interface FunctionR,P //We're ignoring variance here, as to not confuse { public R call(P p); } final FunctionInteger,Integer square = new FunctionInteger,Integer() { public Integer call(Integer i) { return i * i; } } And then you can do: square.call(2) // 4 So, back to Scala: val square = (x : Int) = x * x square(2) // 4 On Thu, Jul 30, 2009 at 9:37 PM, ben b...@primrose.org.uk wrote: Hi, I feel I must apologise for this post ... I've only been doing scala for a week, and lift for 3 days, but I'm stuck. I'm coming from an experienced java background, just struggling with some scala constructs. I feel I understand the basics of lambda and function literals - but I'm blown away by some of the syntax in the lift Getting Started tutorial. For example, given : val mylist = Array(1,2,3) mylist..foreach(v = println(v) Here I understand where v comes from - its each int in the list. In the tutorial (http://liftweb.net/docs/getting_started/ mod_master.html http://liftweb.net/docs/getting_started/%0Amod_master.html ) there is a function desc (Listing 15) : private def desc(td: ToDo, reDraw: () = JsCmd) = swappable(span{td.desc}/span, span{ajaxText(td.desc, v = {td.desc(v).save; reDraw()})} /span) For my own brain to try and break it down, I have : private def desc(td: ToDo, reDraw: () = JsCmd) = { val myFunctionLiteral = (xxx: String) = {td.desc(xxx).save; println(!Desc function : + xxx); reDraw()} swappable(span{td.desc}/span, span{ajaxText(td.desc, myFunctionLiteral)}/span) } This is called from the doList method : private def doList(reDraw: () = JsCmd)(html: NodeSeq): NodeSeq = toShow. flatMap(td = bind(todo, html, desc - desc(td, reDraw) )) I understand where the ToDo object td is coming from, and how the reDraw thing works, and how they are passed to the desc function, but what I don't understand at all is where the val xxx in myFunctionLiteral comes from ? How is it passed into the function ? Is it currying ? I'm sorry for such a vague question, I'm totally at sea here. Thankyou for reading this, and for any help you may provide ! Ben -- Viktor Klang Rogue Scala-head Blog: klangism.blogspot.com Twttr: viktorklang -- Viktor Klang Rogue Scala-head Blog: klangism.blogspot.com Twttr: viktorklang --~--~-~--~~~---~--~~ 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: User questions
Also I could refactor login to allow programmatic logging in, e.g., def login(email:String, pwd:String):Boolean. Then logInFirst could optionally take an autologin function, which it calls if !loggedIn_?, and then checks loggedIn_? again. This way you can check cookies or IPs etc. and skip the login redirect step by logging in programmatically. Also there has to be a way to record autologin data, like an onLogin function. - Naftoli Gugenheimnaftoli...@gmail.com wrote: Also I could add a method called logInFirst which would return a TestAccess that if the user is logged in returns Empty, and if not sets loginRedirect and returns Full(RedirectResponse(User.loginPageURL)). I am currently using such a TestAccess in one of the top menus (minus the nonexistent lognRedirect). If there's a better way tell me! - Naftoli Gugenheimnaftoli...@gmail.com wrote: Using MegaProtoUser, how do you: 1. Have logging in redirect to the page that redirected to log in? 2. Automatically log in using cookies? 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: Simple Javascript question(from a lift snippet of course...)
Yes. And as much as possible redundancies eliminated. Say script tags with the same src etc. Br's, Marius On Jul 31, 7:20 am, Naftoli Gugenheim naftoli...@gmail.com wrote: Related question - if there are multiple head sections buried in different places in the xml are they all removed and combined? - marius d.marius.dan...@gmail.com wrote: Well assume you snippet returns a NodeSeq: import net.liftweb.http._ import js._ import JE._ import JsCmds._ def myFunc(xml: NodeSeq): NodeSeq = { ... resultingNode ++ head{Script(OnLoad(Call(myStartupFunction)))}/ head } In the above example we are returning a head node as well which will be merged by Lift automatically in the real page head. Then I'm using Lift's JavaScript abstractions to call on load function myStartupFunction. Instead of head{Script(OnLoad(Call(myStartupFunction)))}/head you can also use head script type=text/javascript charset=utf-8{ Unparsed( jQuery(document).ready(function() { myStartupFunction(); }) ) } /head Br's, Marius On Jul 30, 8:13 am, DFectuoso santiago1...@gmail.com wrote: This is probably trivial but can't seem to find the lifty way... without hand rolling javascript What is the best way to generate(in the snippet) a javascript command to be run on the window.onload event? Thank you very much you divine and infinite source or lift knowledge AKA lift google group =) --~--~-~--~~~---~--~~ 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: Help on Build from source
David: I build again on windows. and fond there are also some error. I log I've fixed it . and log my modify follow: # On branch master # Changed but not updated: # (use git add file... to update what will be committed) # (use git checkout -- file... to discard changes in working directory) # # modified: lift-actor/src/main/scala/net/liftweb/actor/LiftActor.scala # modified: lift-jta/src/main/scala/net/liftweb/transaction/hibernate/LiftTransactionManagerLookup.scala # modified: lift-mapper/src/main/scala/net/liftweb/mapper/MappedBinary.scala # modified: lift-osgi/src/main/scala/net/liftweb/osgi/internal/Activator.scala # modified: lift-record/src/main/scala/net/liftweb/record/DBMetaRecord.scala # modified: lift-record/src/main/scala/net/liftweb/record/Field.scala # modified: lift-record/src/main/scala/net/liftweb/record/MetaRecord.scala # modified: lift-record/src/main/scala/net/liftweb/record/field/BinaryField.scala # modified: lift-record/src/main/scala/net/liftweb/record/field/BooleanField.scala # modified: lift-record/src/main/scala/net/liftweb/record/field/DateTimeField.scala # modified: lift-record/src/main/scala/net/liftweb/record/field/DecimalField.scala # modified: lift-record/src/main/scala/net/liftweb/record/field/DoubleField.scala # modified: lift-record/src/main/scala/net/liftweb/record/field/EmailField.scala # modified: lift-record/src/main/scala/net/liftweb/record/field/EnumField.scala # modified: lift-record/src/main/scala/net/liftweb/record/field/IntField.scala # modified: lift-record/src/main/scala/net/liftweb/record/field/LocaleField.scala # modified: lift-record/src/main/scala/net/liftweb/record/field/LongField.scala # modified: lift-record/src/main/scala/net/liftweb/record/field/PasswordField.scala # modified: lift-record/src/main/scala/net/liftweb/record/field/PostalCodeField.scala # modified: lift-record/src/main/scala/net/liftweb/record/field/StringField.scala # modified: lift-record/src/main/scala/net/liftweb/record/field/TextareaField.scala # modified: lift-record/src/main/scala/net/liftweb/record/field/TimeZoneField.scala # modified: lift-textile/src/main/scala/net/liftweb/textile/TextileParser.scala # modified: lift-util/src/main/scala/net/liftweb/util/ConcurrentLock.scala # modified: lift-util/src/main/scala/net/liftweb/util/CurrencyZone.scala # modified: lift-util/src/main/scala/net/liftweb/util/IOHelpers.scala # modified: lift-util/src/main/scala/net/liftweb/util/Mailer.scala # modified: lift-util/src/main/scala/net/liftweb/util/PCDataMarkupParser.scala # modified: lift-util/src/main/scala/net/liftweb/util/Props.scala # modified: lift-util/src/main/scala/net/liftweb/util/SoftReferenceCache.scala # modified: lift-util/src/main/scala/net/liftweb/util/TemplateCache.scala # modified: lift-util/src/test/scala/net/liftweb/util/ActorPingUnit.scala # modified: lift-util/src/test/scala/net/liftweb/util/EnumWithDescriptionSpec.scala # modified: lift-util/src/test/scala/net/liftweb/util/XmlParsingSpecs.scala # modified: lift/src/main/scala/net/liftweb/http/LiftRules.scala # modified: lift/src/main/scala/net/liftweb/http/LiftServlet.scala # modified: lift/src/main/scala/net/liftweb/http/LiftSession.scala # modified: lift/src/main/scala/net/liftweb/http/Req.scala # modified: lift/src/main/scala/net/liftweb/http/S.scala # modified: sites/JPADemo/JPADemo-spa/src/main/scala/net/liftweb/jpademo/model/AU.scala # modified: sites/JPADemo/JPADemo-spa/src/main/scala/net/liftweb/jpademo/model/Author.scala # modified: sites/JPADemo/JPADemo-spa/src/main/scala/net/liftweb/jpademo/model/Book.scala # modified: sites/JPADemo/JPADemo-spa/src/main/scala/net/liftweb/jpademo/model/CurrencyUserType.scala # modified: sites/JPADemo/JPADemo-spa/src/main/scala/net/liftweb/jpademo/model/CurrencyZone.scala # modified: sites/JPADemo/JPADemo-spa/src/main/scala/net/liftweb/jpademo/model/EnumvType.scala # modified: sites/JPADemo/JPADemo-web/src/main/scala/net/liftweb/jpademo/snippet/Books.scala # modified: sites/JPADemo/JPADemo-web/src/main/webapp/css/datePicker.css # modified: sites/JPADemo/JPADemo-web/src/main/webapp/scripts/jquery.datePicker.js # modified: sites/JPADemo/JPADemo-web/src/test/scala/RunWebApp.scala # modified: sites/example/src/main/scala/net/liftweb/example/snippet/Ajax.scala # Untracked files: # (use git add file... to include in what will be committed) Nile Black On Thu, Jul 30, 2009 at 9:11 PM, David Pollak feeder.of.the.be...@gmail.com wrote: Does it also build on your Windows box? It should now... and if it doesn't I didn't nail all the _root_ causes. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the
[Lift] Re: Wymeditor or FCKEditor
So I can't use text/html or use java components that write to the DOM, except for JQuery? The error is the neither wymeditor or fckeditor work with Lift. Let's make things simple, shouldn't it be possible to simply add a wymeditor to the default html of the hello world example and have it render correctly? On Jul 30, 11:10 pm, David Pollak feeder.of.the.be...@gmail.com wrote: Lift, by default, serves with a mime type of application/xhtml+xml (except to IE). This puts browsers into a very strict mode for parsing and it means that scripts may not use write to change the DOM. So, what/where is the exception? Are you serving the static page as text/html or application/xhtml+xml ? When I browse tohttp://files.wymeditor.org/wymeditor/trunk/src/examples/01-basic.htmlit's served as text/html On Thu, Jul 30, 2009 at 7:52 PM, Avo Reid avor...@cox.net wrote: Here is some more specific code I should be able to include wymeditor.js in a lift page and add the following. The wymeditor doesn't come up it faults and a textarea comes up. If I include the same code in a non lift web page, even like a menu item in the sitemap to a page outside of the lift website the code works. div class=column span-24 id=editor h1WYMeditor integration example/h1 pa href=http://www.wymeditor.org/;WYMeditor/a is a web-based XHTML WYSIWYM editor./p form method=post action= textarea class=wymeditorlt;pgt;Hello, World!lt;/ pgt;/textarea input type=submit class=wymupdate / /form /div On Jul 30, 4:47 pm, marius d. marius.dan...@gmail.com wrote: Please specify the problems you are seeing. Br's, Marius On Jul 30, 11:24 pm, Avo Reid avor...@cox.net wrote: Has anyone tried to usewymeditoror FCKEditor in a lift page? I cannot get these plugins to work even thought they are based on JQuery. -- 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: AJAX form with returned NodeSeq
Sorry my original question was unclear. I'm looking to submit data with the form, and then get a response back from the server to act on. The use case is that I have a list of things that I would like to add elements to on the fly. The desired action is to have the list on the page, with an add form below it. This form has two text fields, quantity and item. When submit is clicked, I want to save the contents of those two fields on the server, and update the displayed list with the new item added. In other frameworks, the way that I've done this is to have the form onsubmit contain code that made a jquery ajax call with the contents of the form, and then would receive the full contents of the new list, which it would drop into the DOM. Not sure how to rig that up in Lift, though. -Cale On Thu, Jul 30, 2009 at 10:52 PM, David Pollak feeder.of.the.be...@gmail.com wrote: On Thu, Jul 30, 2009 at 7:28 PM, Calen Pennington calen.penning...@gmail.com wrote: Hey, all, I want to create a form that on submission executes some serverside code that returns a NodeSeq, and then updates the page with that xml. It seems like some combination of AjaxForm and SetHtml should do what I want, but I can't seem to get the server to send a response to the client that can be used to update the html. Is there a lifty way of doing this? ajaxButton(bPress me/b, () = SetHtml(myspan, spanThe time is {new java.util.Date}/span)) Thanks -Cale -- 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: Wymeditor or FCKEditor
I can't post the whole thing, as it's part of a larger work thing, but here are the TinyMCE relevant portions: Boot.scala: LiftRules.useXhtmlMimeType = false; ResourceServer.allow { case tiny_mce::_ = true } In my snippet bind: lift:form method=POST{ bind(block, ns, text - { (ns: NodeSeq) = SHtml.textarea(, text = editedText = Box!!text, currentNode .map(prefixedElemAttributesToPairs(textarea)).openOr(Nil): _*) }, submit - SHtml.submit(Done, () = println(got edited block -- + editedText))) }/lift:form I expanded the TinyMCE jQuery version into src/main/resources/toserve/ tiny_mce (such that jquery.tinymce.js was in toserve/tiny_mce/ jquery.tinymce.js) In my template head: script id=jquery src=/classpath/jquery.js type=text/ javascript/ script id=jquery src=/classpath/jquery-ui/js/jquery- ui.js type=text/javascript/ script id=jquery_tiny_mce type=text/javascript src=/ classpath/tiny_mce/jquery.tinymce.js / script id=tiny_mce type=text/javascript src=/ classpath/tiny_mce/tiny_mce.js / (I load both to have it warm up the load to tiny_mce.js, otherwise jquery.tinymce.js loads it and it lags the UI a bit. I use jQuery UI, and in particular my TinyMCE instance shows up in a jQuery dialog, although this shouldn't affect the overall behavior) In my template body: div id=emailwizard-edit-block-dialog edit:blockEditForm block:text textarea:id=emailwizard-edit-block- textarea textarea:style=width: 100%; height: 100%; / /edit:blockEditForm /div (edit:blockEditForm is a sub-bind of another snippet) In my javascript file for the page: /* Handle editing a block by popping the edit box and initializing TinyMCE */ function handleBlockEdit(target) { function finishTinyMCESetup() { var editor = $(#emailwizard-edit-block- textarea).tinymce(); editor.focus(); editor.setContent(/* prefill content */); editor.save(); $(#emailwizard-edit-block-dialog).dialog(enable); } $(#emailwizard-edit-block-dialog) .data(target, target) .dialog(open) .dialog(disable); $(#emailwizard-edit-block-textarea) .tinymce({ script_url: /classpath/tiny_mce/tiny_mce.js, // various configuration of the TinyMCE omitted for brevity -- none is really relevant to general integration init_instance_callback: finishTinyMCESetup }); } $(document).ready(function() { $(#emailwizard-edit-block-dialog) .dialog({ autoOpen: false, bgiframe: true, beforeclose: handleBlockDialogClose, buttons: { Done: handleBlockSubmit }, modal: true, resizable: false, title: Edit Block, width: 600, height: 308 }) .css(padding, 0); }); There is a separate button whose click handler calls handleBlockEdit to pop the dialog and initialize TinyMCE. The bit about enabling and disabling the dialog is to make the dialog gray while TinyMCE replaces the textarea with its own stuff. Note that I have not gotten the AJAXing of the edited content back to the server working, so the bit about the AJAX enabled textarea could very well be totally wrong. I think in general the only sticking points are that you can't use XHTML MIME type (as others mentioned on thread) as TinyMCE will want to use document.write. Hopefully the fact that this is extracted from a larger project isn't too confusing and that this helps. -Ross On Jul 30, 2009, at 11:35 PM, Avo Reid wrote: Ross, Can you send me some sample code on how you integrated TinyMCE, I would greatly appreciate it. Thanks On Jul 30, 6:25 pm, Ross Mellgren dri...@gmail.com wrote: I used TinyMCE and it integrated pretty well. It has a jQuery plugin that makes it pretty jQuery-ish: $(#my-textarea) .tinymce({ script_url: /classpath/tiny_mce/ tiny_mce.js, ... }); -Ross On Jul 30, 2009, at 4:47 PM, marius d. wrote: Please specify the problems you are seeing. Br's, Marius On Jul 30, 11:24 pm, Avo Reid avor...@cox.net wrote: Has anyone tried to usewymeditoror FCKEditor in a lift page? I cannot get these plugins to work even thought they are based on JQuery. --~--~-~--~~~---~--~~ 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
[Lift] Re: Wymeditor or FCKEditor
Yes I am getting errors on inner html from the lift site. So if I understand you correctly I can't use any java component that changes the DOM with write or serves text/html like wymeditor or CKeditor? So what are the options for an editor for a commercial application using Lift? And what are the java UI components that Lift supports, I thought the point behind Scala and Lift was to build on top of java but still support it? On Jul 30, 11:10 pm, David Pollak feeder.of.the.be...@gmail.com wrote: Lift, by default, serves with a mime type of application/xhtml+xml (except to IE). This puts browsers into a very strict mode for parsing and it means that scripts may not use write to change the DOM. So, what/where is the exception? Are you serving the static page as text/html or application/xhtml+xml ? When I browse tohttp://files.wymeditor.org/wymeditor/trunk/src/examples/01-basic.htmlit's served as text/html On Thu, Jul 30, 2009 at 7:52 PM, Avo Reid avor...@cox.net wrote: Here is some more specific code I should be able to include wymeditor.js in a lift page and add the following. The wymeditor doesn't come up it faults and a textarea comes up. If I include the same code in a non lift web page, even like a menu item in the sitemap to a page outside of the lift website the code works. div class=column span-24 id=editor h1WYMeditor integration example/h1 pa href=http://www.wymeditor.org/;WYMeditor/a is a web-based XHTML WYSIWYM editor./p form method=post action= textarea class=wymeditorlt;pgt;Hello, World!lt;/ pgt;/textarea input type=submit class=wymupdate / /form /div On Jul 30, 4:47 pm, marius d. marius.dan...@gmail.com wrote: Please specify the problems you are seeing. Br's, Marius On Jul 30, 11:24 pm, Avo Reid avor...@cox.net wrote: Has anyone tried to usewymeditoror FCKEditor in a lift page? I cannot get these plugins to work even thought they are based on JQuery. -- 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: erro: MappedDouble is not mapped to 'double precision' datatype in PostgreSQL?
Thanks, yes, I'll try tomorrow and let you know! On Jul 29, 12:43 am, Derek Chen-Becker dchenbec...@gmail.com wrote: OK, I've pushed 1.0.1-SNAPSHOT to the repo with something that should fix the PostgreSQL stuff. Can you update your POM to 1.0.1-SNAPSHOT and try it? Thanks, Derek On Tue, Jul 28, 2009 at 11:40 AM, JanWillem Tulp janwillem.t...@gmail.comwrote: Hi Derek, I am using liftweb version 1.0 Thanks! On Jul 27, 10:27 pm, Derek Chen-Becker dchenbec...@gmail.com wrote: This looks like an issue with PostgreSQLDriver. The type should be DOUBLE PRECISION. What version of Lift are you using? Let me know and I'll put a fix in the proper place. Derek On Sun, Jul 26, 2009 at 5:59 AM, JanWillem Tulp janwillem.t...@gmail.comwrote: Still looking to find a solution for this, or at least what causes this behavior. I am looking at the Liftweb source code, and see in the BaseMetaMapper trait a function called buildMapper that does some pattern matching on SQL column types (colType). Just for my understanding, why is there a match for almost any of the basic SQL types, but not for Types.DOUBLE? Has anyone else run into this problem? On Jul 26, 1:34 am, JanWillem Tulp janwillem.t...@gmail.com wrote: Hi all, I'm not sure that I am missing something here, but the Schemifier cannot create a table for a model class that contains an object that extends from MappedDouble. This is the Lift code: class MeasureValue extends LongKeyedMapper[MeasureValue] with IdPK { def getSingleton = MeasureValue object value extends MappedDouble(this) object measure extends MappedLongForeignKey(this, Measure) } object MeasureValue extends MeasureValue with LongKeyedMetaMapper [MeasureValue] I added MeasureValue to the Schemifier so that it will create a table when boot is executed. However, this is the stacktrace I get when I start the application: main INFO lift - CREATE TABLE measurevalue (measure BIGINT , value DOUBLE , id BIGSERIAL) main ERROR lift - Failed to Boot org.postgresql.util.PSQLException: ERROR: type double does not exist at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse (QueryExecutorImpl.java:1592) at org.postgresql.core.v3.QueryExecutorImpl.processResults (QueryExecutorImpl.java:1327) at org.postgresql.core.v3.QueryExecutorImpl.execute (QueryExecutorImpl.java:192) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute (AbstractJdbc2Statement.java:451) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags (AbstractJdbc2Statement.java:336) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute (AbstractJdbc2Statement.java:328) at net.liftweb.mapper.Schemifier$.net$liftweb$mapper$Schemifier$ $maybeWrite(Schemifier.scala:150) at net.liftweb.mapper.Schemifier$.net$liftweb$mapper$Schemifier$ $ensureTable(Schemifier.scala:160) at net.liftweb.mapper.Schemifier$$anonfun$schemify$1$$anonfun$1.apply (Schemifier.scala:60) at net.liftweb.mapper.Schemifier$$anonfun$schemify$1$$anonfun$1.apply (Schemifier.scala:60) at scala.List.foldLeft(List.scala:1066) at net.liftweb.mapper.Schemifier$$anonfun$schemify$1.apply (Schemifier.scala:60) at net.liftweb.mapper.Schemifier$$anonfun$schemify$1.apply (Schemifier.scala:54) at net.liftweb.mapper.DB$.use(DB.scala:305) at net.liftweb.mapper.Schemifier$.schemify(Schemifier.scala:53) at net.liftweb.mapper.Schemifier$.schemify(Schemifier.scala:36) at bootstrap.liftweb.Boot.boot(Boot.scala:26) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at net.liftweb.util.ClassHelpers$$anonfun$createInvoker$1.apply (ClassHelpers.scala:392) at net.liftweb.util.ClassHelpers$$anonfun$createInvoker$1.apply (ClassHelpers.scala:390) at net.liftweb.http.DefaultBootstrap$$anonfun$boot$1.apply (LiftRules.scala:909) at net.liftweb.http.DefaultBootstrap$$anonfun$boot$1.apply (LiftRules.scala:909) at net.liftweb.util.Full.map(Box.scala:330) at net.liftweb.http.DefaultBootstrap$.boot(LiftRules.scala:909) at net.liftweb.http.LiftFilter.bootLift(LiftServlet.scala:573) at net.liftweb.http.LiftFilter.init(LiftServlet.scala:548) at
[Lift] Re: Jersey + Lift, whats the story?
On Jul 30, 2009, at 7:57 PM, David Pollak wrote: I wonder if one day we can kinda get Jersey to expose its own SiteMap (of sorts) into Lift's SiteMap? There's a way to dynamically create submenus based on a function in SiteMap. We could wire that up to Jersey's mechanisms to expose dynamic stuff via SiteMap. On the Jersey side of things there are a bunch of paths that are known statically at deployment time and can be obtained either from the internal WADL or the abstract model of the root resource classes, those classes annotated with @Path. The stuff declared in @Path represent the entry points into the JAX-RS/Jersey application. Path matching can also occur dynamically and is determined by the annotations on the resource returned by a method annotated with @Path, for example: @Path(customer) public Object getSubResource() { if (/ preferred customer/) { return new PreferredCustomer(); // additional sub-resources for preferred customers } else { return new Customer(); } } Not sure if the above is relevant/important or not w.r.t. SiteMap. It might be if Lift templates are utilized. Paul. Also, a lot of Lift's dispatch stuff is based on PartialFunction. PartialFunction is just apply and isDefinedAt... so we can build partial functions based on the data supplied by Java frameworks and dynamically dispatch from the underlying stuff. It would certainly be useful to reuse Lift's Menu rendering when using a Lift template to render a JAXRS resource bean; am sure that would not be too hard to fix. We might want to support adding resource beans to the menus too -- James --- http://macstrac.blogspot.com/ Open Source Integration http://fusesource.com/ -- 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: JSON form with
I have had a look at the change, while better than the old one it still causes problems if you use a in a text box because you are building JSON as a string and then parsing it. In my example code you go from a javascript object to another one there is no need for parsing so you don't run into problems with escape characters. I don't know if you are building the JSON as a string then parsing it for compatibility reasons if so you should escape any found in the name and value. e.g. json += \ + e.name.replace(/\/g,\\\) + \:\ + e.value.replace (/\/g,\\\) + \,; James On Jul 30, 6:14 pm, marius d. marius.dan...@gmail.com wrote: James, I just committed the fix based on your approach. Please give it a try. Br's, Marius On Jul 30, 4:53 pm, marius d. marius.dan...@gmail.com wrote: Thank you James for your input. I hope I'll be able to look into it today. Br's, Marius On Jul 30, 4:42 pm, James Kearney ghostf...@googlemail.com wrote: I think the current implementation of the JSON form is broken. If you put an in a text field and try to submit it via a JSON form it doesn't get handled correctly. To be precise the formToJSON function in jlift.js doesn't work, and again to be more precise the params method is broken / not fit for purpose. The params method (line 249) calls s.join() and then returns but it doesn't escape the character (it also uses = but doesn't escape that). If the params function does what I think it is supposed to do which is split paramters for a URL then it should really call encodeURI on the values. That aside I don't think the formToJSON function should be using the param function. It gets a JSON object from jQuery serializeArray makes it into a string split by and = then goes and splits based on and = again building up some JSON (as a string) then parses the JSON. Why not operate on the JSON from jQuery from the start. e.g. formToJSON : function(formId) { json = jQuery(# + formId).serializeArray(); ret = {} for (var i in json) { var obj = json[i] ret[obj.name] = obj.value } return ret; } This does work differently from before since it won't call functions like params does but I don't think jQuery's serializeArray puts functions in the object it returns so that is not needed. James --~--~-~--~~~---~--~~ 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 use Mapper and record framework
Hi Giuseppe, Thanks for u r valuable support.i got the flavor of this framework. I did one POC(sample application) with MySQL ...and its worked very smoothly. Is Lift provides support for MS SQL.? Now i am using same thing with MS SQL but i am getting following error :- Message: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid column name 'id'. com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError (Unknown Source) com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(Unknown Source) com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement (Unknown Source) .. In my application i am just reading table content with findAll method. in my table i have only two fields - EmpId, EmpName i checked all things but didnt get any clue In short - Is lift's mapper framework provides Support for MS SQL ? Thanks -Pravin On Jul 30, 12:34 pm, Giuseppe Fogliazza g.foglia...@mcmspa.it wrote: Dear Pravin. Your requests address very basic behaviour of the framework, and you should not experience any problem in adapting examples from the aforementioned book. Even simpler you could follow the Todo example in Getting Started with Lift accessible from liftweb site (http://liftweb.net/docs/ getting_started/mod_master.html). Related to persistency at the moment you should concentrate on using Mapper. Creating your model object is a breeze. Create a MyItem.scala file with the following entities (your project should have a model package to contain this stuff) class MyItem extends LongKeyedMapper[MyItem] with IdPK { def getSingleton = MyItem object name extends MappedPoliteString(this,64)} object MyItem extends MyItem with LongKeyedMetaMapper[MyItem] Modify the Schemifier line in Boot.scala to add your MetaMapper object Schemifier.schemify(true, Log.infoF _, User, MyItem) ... and now you can start having fun in creating the next web killer app using Lift. Regards Giuseppe On 30 Lug, 07:52, pravin pravinka...@gmail.com wrote: Hi, Guys i am new to Lift. I want to use mapper and record framework. I have following case: 1. Table with two column [id,name] ...// I have MySQL DB 2. i want to fire select query on above table 3. Display above result on GUI How can i do this with mapper and record: I done with Boot.scala chages as per steps mentioned in Exploring Lift: Scala-based Web Framework book but i am not able to create mapper or record class ...how can i do this and put query on top of this. Also where can i get detail information about mapper and record framework as above book is not sufficient for this Thanks in advance.. -Pravin --~--~-~--~~~---~--~~ 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 use Mapper and record framework
Yup - Im using it no problems at all with MS SQL... Cheers, Tim In short - Is lift's mapper framework provides Support for MS SQL ? --~--~-~--~~~---~--~~ 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] Implementing KeyedRecord[T,K]
Guys, What is the intended implementation of KeyedRecord? The work done so far on DBRecord appears not to use it? When / How should one go about implementing a custom record backend? We could really do with some docs on this :-) Cheers, Tim --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: ajaxCall jlift.js and json2.js
Thanks On Jul 30, 5:38 pm, Timothy Perrett timo...@getintheloop.eu wrote: James, Correct, you do indeed need to include this in a page where you want to use json forms etc... Cheers, Tim On Jul 30, 3:53 pm,JamesKearneyghostf...@googlemail.com wrote: I wanted to use ajaxCall on a page but it didn't seem to be working due to javascript issues. Eventually I found that I needed to include script type=text/javascript src=classpath/jlift.js / in the page. I just wanted to check that you need to manually include these on every page that uses ajax or should it be included automatically and I have messed up the configuration some how. Thanks, James --~--~-~--~~~---~--~~ 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 10 seconds works?
Hi everyone, i am a rookie of lift and scala. now i am cofused about sth in the lift. Line 226 in LiftSession.scala ActorPing schedule (this, CheckAndPurge, 10 seconds) Does anybody tell me how 10 seconds works? that is how does the scala convert it to type TimeSpan? --~--~-~--~~~---~--~~ 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 10 seconds works?
Implicit conversions. In TimeHelpers.scala we have: 1. TimeSpanBuilder which contains method minutes, seconds etc. 2. And the implicits such as: implicit def intToTimeSpanBuilder(in: Int): TimeSpanBuilder = TimeSpanBuilder(in) therefore compiler automatically applies intToTimeSpanBuilder (10).seconds as the type of object 10 has no minutes method. So 10 minutes will yield a TimeSpan instance. Still you can use (3 + (10 seconds)) because there is another implicit conversion implicit def timeSpanToLong(in: TimeSpan): Long = in.millis to convert from a TimeSpan to a Long hence (10 minutes) can be used in arithmetic operations. Br's, Marius On Jul 31, 3:10 pm, Caesar You ucae...@gmail.com wrote: Hi everyone, i am a rookie of lift and scala. now i am cofused about sth in the lift. Line 226 in LiftSession.scala ActorPing schedule (this, CheckAndPurge, 10 seconds) Does anybody tell me how 10 seconds works? that is how does the scala convert it to type TimeSpan? --~--~-~--~~~---~--~~ 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 use Mapper and record framework
Hi Pravin, I'm sorry but I have no experience with MS SQL. By any chance does it change something if you modify the name of your MappedField from id to empId ? Regards Giuseppe --~--~-~--~~~---~--~~ 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] Submit like SHtml.text but with ajaxText
I'm looking for some guidance on how best to have the value of text field that's been ajax-ified picked up on a regular submit. What I mean is: If I have a field of object word extends RequestVar() which I bind like this bind(f, xhtml, word - SHtml.text(word,word(_)), submit - SHtml.submit(GO, processForm) ) and everything is lovely and this does what you expect: def processForm() = { Log.info(Submit from the form:) Log.info(word) } Now I want to add some dynamic feedback for the user of the form so I switch to... word - SHtml.ajaxText(word, checkWord(_)) with def checkWord(w:String) = { Log.info(Ajax check: +w) Noop } That also works just great. But when the submit button is hit, of course there's now no-longer the assignment into word RequestVar anymore. And I'd like there to be (regardless of if the Ajax checkWords is ever called or not). So where should I be looking to insert the word(_) call to get the AJAX goodness but also the good old submit behaviour? My current thinking is that I use a SHtml.text but then mess with the input that's created to include the appropriate Ajax calls I want. Lift 1.1-SNAPSHOT on 2.7.5.final Many thanks Richard --~--~-~--~~~---~--~~ 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: JSON form with
I'm curious as to why we have this function floating around in the first place. Isn't this something best done by a JavaScript library that has been tested cross browser (e.g., something in jQuery or YUI)? Also, doesn't the param function hardcode a dependency on jQuery... and we're support to be agnostic about the JavaScript library that we sit on? On Fri, Jul 31, 2009 at 3:34 AM, James Kearney ghostf...@googlemail.comwrote: I have had a look at the change, while better than the old one it still causes problems if you use a in a text box because you are building JSON as a string and then parsing it. In my example code you go from a javascript object to another one there is no need for parsing so you don't run into problems with escape characters. I don't know if you are building the JSON as a string then parsing it for compatibility reasons if so you should escape any found in the name and value. e.g. json += \ + e.name.replace(/\/g,\\\) + \:\ + e.value.replace (/\/g,\\\) + \,; James On Jul 30, 6:14 pm, marius d. marius.dan...@gmail.com wrote: James, I just committed the fix based on your approach. Please give it a try. Br's, Marius On Jul 30, 4:53 pm, marius d. marius.dan...@gmail.com wrote: Thank you James for your input. I hope I'll be able to look into it today. Br's, Marius On Jul 30, 4:42 pm, James Kearney ghostf...@googlemail.com wrote: I think the current implementation of the JSON form is broken. If you put an in a text field and try to submit it via a JSON form it doesn't get handled correctly. To be precise the formToJSON function in jlift.js doesn't work, and again to be more precise the params method is broken / not fit for purpose. The params method (line 249) calls s.join() and then returns but it doesn't escape the character (it also uses = but doesn't escape that). If the params function does what I think it is supposed to do which is split paramters for a URL then it should really call encodeURI on the values. That aside I don't think the formToJSON function should be using the param function. It gets a JSON object from jQuery serializeArray makes it into a string split by and = then goes and splits based on and = again building up some JSON (as a string) then parses the JSON. Why not operate on the JSON from jQuery from the start. e.g. formToJSON : function(formId) { json = jQuery(# + formId).serializeArray(); ret = {} for (var i in json) { var obj = json[i] ret[obj.name] = obj.value } return ret; } This does work differently from before since it won't call functions like params does but I don't think jQuery's serializeArray puts functions in the object it returns so that is not needed. James -- 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: JSON form with
On Jul 31, 4:42 pm, David Pollak feeder.of.the.be...@gmail.com wrote: I'm curious as to why we have this function floating around in the first place. Isn't this something best done by a JavaScript library that has been tested cross browser (e.g., something in jQuery or YUI)? Also, doesn't the param function hardcode a dependency on jQuery... and we're support to be agnostic about the JavaScript library that we sit on? I don't think that it was dependent on JQuery. Anyways that is gone now. On Fri, Jul 31, 2009 at 3:34 AM, James Kearney ghostf...@googlemail.comwrote: I have had a look at the change, while better than the old one it still causes problems if you use a in a text box because you are building JSON as a string and then parsing it. In my example code you go from a javascript object to another one there is no need for parsing so you don't run into problems with escape characters. I don't know if you are building the JSON as a string then parsing it for compatibility reasons if so you should escape any found in the name and value. e.g. json += \ + e.name.replace(/\/g,\\\) + \:\ + e.value.replace (/\/g,\\\) + \,; James On Jul 30, 6:14 pm, marius d. marius.dan...@gmail.com wrote: James, I just committed the fix based on your approach. Please give it a try. Br's, Marius On Jul 30, 4:53 pm, marius d. marius.dan...@gmail.com wrote: Thank you James for your input. I hope I'll be able to look into it today. Br's, Marius On Jul 30, 4:42 pm, James Kearney ghostf...@googlemail.com wrote: I think the current implementation of the JSON form is broken. If you put an in a text field and try to submit it via a JSON form it doesn't get handled correctly. To be precise the formToJSON function in jlift.js doesn't work, and again to be more precise the params method is broken / not fit for purpose. The params method (line 249) calls s.join() and then returns but it doesn't escape the character (it also uses = but doesn't escape that). If the params function does what I think it is supposed to do which is split paramters for a URL then it should really call encodeURI on the values. That aside I don't think the formToJSON function should be using the param function. It gets a JSON object from jQuery serializeArray makes it into a string split by and = then goes and splits based on and = again building up some JSON (as a string) then parses the JSON. Why not operate on the JSON from jQuery from the start. e.g. formToJSON : function(formId) { json = jQuery(# + formId).serializeArray(); ret = {} for (var i in json) { var obj = json[i] ret[obj.name] = obj.value } return ret; } This does work differently from before since it won't call functions like params does but I don't think jQuery's serializeArray puts functions in the object it returns so that is not needed. James -- 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: Wymeditor or FCKEditor
On Thu, Jul 30, 2009 at 8:29 PM, Avo Reid avor...@cox.net wrote: So I can't use text/html or use java components that write to the DOM, except for JQuery? No. Who ever said that? Lift *by default* serves content as application/xhtml+xml. You can change the behavior as another post in this thread points out. There is a downside to changing the mime type of served pages to text/html... the browsers go into a less well defined mode for rendering the pages. application/xhtml+xml is very well defined and I've only seen on very small cross browser rendering difference in the nearly 3 years of using XHTML. This is not true of the tag soup mode that browsers go into with text/html. The downside of using application/xhtml+xml is that certain non-standard (but broadly implemented) DOM manipulation methods are not supported. One of these is to open an DOM element and do a write to that DOM element. You may use innerHTML and other mechanisms to morph the DOM in XHTML mode. This is an XHTML thing. It is not a Lift thing. But it is a by-product of being in XHTML mode. Some JavaScript libraries use DOM write (once again, this is a single method that allows you to treat a DOM element like a stream and write characters into it.) These libraries will not work on any page that is served with the application/xhtml+xml mime type from any web server, from any web framework. This has nothing to do with Lift, this has to do with the browsers and the standards. The error is the neither wymeditor or fckeditor work with Lift. Let's make things simple, shouldn't it be possible to simply add a wymeditor to the default html of the hello world example and have it render correctly? I'm going to make it simple. You have come into this community and asked for help. We try to be very welcoming to newbies and to try to help people out with issues. The particular issue, mime type application/xhtml+xml vs. text/html, has been discussed numerous times in the last few months. But rather than saying RTFM or some other thing that could chase a newbie away, I asked that you work with me to diagnose the issue. Now, why is it better to diagnose the issue? First, if there is a problem in the external library (e.g., not being XHTML compatible), then we can take this information to the authors of the library and work with them to resolve the issue. We have done that in the past with issues... including an XHTML namespace issue that causes problems with jQuery on Firefox. But coming to the discussion armed with all the facts helps make the discussion smooth. The second reason to diagnose the issue is to give you and the whole community a deeper understanding of the issue and that allows more effective diagnosis of similar issues in the future. This builds institutional knowledge. So, if you want to work with me to diagnose the issue, I'm still here and willing to work with you. If you want to set the default rendering type to text/html it will likely solve your issue. If you want to continue to claim that there's some problem with Lift, you can be on your way. Lift simply generates the XHTML that you tell it to and returns that XHTML to the browser with with certain headers set by default, but that can be changed by your code. If there's something that's not rendering correctly in the browser and you've sent down proper XHTML, then talk to the library or browser maker rather than claiming that Lift isn't doing something correctly. Thanks, David On Jul 30, 11:10 pm, David Pollak feeder.of.the.be...@gmail.com wrote: Lift, by default, serves with a mime type of application/xhtml+xml (except to IE). This puts browsers into a very strict mode for parsing and it means that scripts may not use write to change the DOM. So, what/where is the exception? Are you serving the static page as text/html or application/xhtml+xml ? When I browse tohttp:// files.wymeditor.org/wymeditor/trunk/src/examples/01-basic.htmlit's served as text/html On Thu, Jul 30, 2009 at 7:52 PM, Avo Reid avor...@cox.net wrote: Here is some more specific code I should be able to include wymeditor.js in a lift page and add the following. The wymeditor doesn't come up it faults and a textarea comes up. If I include the same code in a non lift web page, even like a menu item in the sitemap to a page outside of the lift website the code works. div class=column span-24 id=editor h1WYMeditor integration example/h1 pa href=http://www.wymeditor.org/;WYMeditor/a is a web-based XHTML WYSIWYM editor./p form method=post action= textarea class=wymeditorlt;pgt;Hello, World!lt;/ pgt;/textarea input type=submit class=wymupdate / /form /div On Jul 30, 4:47 pm, marius d. marius.dan...@gmail.com wrote: Please specify the problems you are seeing. Br's, Marius On Jul 30, 11:24
[Lift] Re: Wymeditor or FCKEditor
Avo, Yes, I'm using wymeditor in a lIft app with great success. You need to put all the wymeditor js files in a source/main/resources/ toserve directory. Then I create a snippet: def onInit(xhtml: NodeSeq):NodeSeq = head script type=text/javascript src={/ + LiftRules.resourceServerPath + /wymeditor/jquery.wymeditor.pack.js} /script script type=text/javascript charset=utf-8{ Unparsed( jQuery(document).ready(function() { jQuery('.wymeditor').wymeditor(); }) ) } /script /head which i run in Boot.scala. Then, in a bind helper, use something like bind(content, xhtml, ... description = textarea(loadHtml(currentContent.link.is).toString, page(_), (class, wymeditor)), ...) Does that help? Glenn... On Jul 30, 1:24 pm, Avo Reid avor...@cox.net wrote: Has anyone tried to use wymeditor or FCKEditor in a lift page? I cannot get these plugins to work even thought they are based on JQuery. --~--~-~--~~~---~--~~ 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] Lift maven archetypes seem to be broken ... again
Seems like every time I create a new LIft project in Eclipse with , drawing on the snapshots in http://scala-tools.org/repo-snapshots, I get errors, telling me I'm missing some Apache commons jar, or worse. Could It be a problem with my system? It's worked in the past without a hitch, but something has changed, and I don't believe I've changed anything local to cause this. I am still investigating, but if anyone has similar experiences, that would help me to debug. Also, shouldn't the POM use Thanks. scala.version2.7.5/scala.version rather than 2.7.4? Glenn... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Wymeditor or FCKEditor
David, My apologies, I didn't mean to communicate that there is something wrong with Lift, I am very interested in Lift and have a great deal of respect for what you have accomplished here. My question about making things simple was frankly to clarify whether it was possible to drop in a java component like wymeditor or fckeditor, in an effort to get a long term view of the LOE on putting together a commercial web app with multiple 3rd party components. I understand the XHTML issue and I have learned a lot from the posts here to understand the answer to that question and how it can be done with Lift. I am going to implement these concepts and will get back to you with my findings on the different components and hopefully get them integrated the right way. Thanks for your time and patience, Avo The error is the neither wymeditor or fckeditor work with Lift. Let's make things simple, shouldn't it be possible to simply add a wymeditor to the default html of the hello world example and have it render correctly? On Jul 31, 10:16 am, David Pollak feeder.of.the.be...@gmail.com wrote: On Thu, Jul 30, 2009 at 8:29 PM, Avo Reid avor...@cox.net wrote: So I can't use text/html or use java components that write to the DOM, except for JQuery? No. Who ever said that? Lift *by default* serves content as application/xhtml+xml. You can change the behavior as another post in this thread points out. There is a downside to changing the mime type of served pages to text/html... the browsers go into a less well defined mode for rendering the pages. application/xhtml+xml is very well defined and I've only seen on very small cross browser rendering difference in the nearly 3 years of using XHTML. This is not true of the tag soup mode that browsers go into with text/html. The downside of using application/xhtml+xml is that certain non-standard (but broadly implemented) DOM manipulation methods are not supported. One of these is to open an DOM element and do a write to that DOM element. You may use innerHTML and other mechanisms to morph the DOM in XHTML mode. This is an XHTML thing. It is not a Lift thing. But it is a by-product of being in XHTML mode. Some JavaScript libraries use DOM write (once again, this is a single method that allows you to treat a DOM element like a stream and write characters into it.) These libraries will not work on any page that is served with the application/xhtml+xml mime type from any web server, from any web framework. This has nothing to do with Lift, this has to do with the browsers and the standards. The error is the neither wymeditor or fckeditor work with Lift. Let's make things simple, shouldn't it be possible to simply add a wymeditor to the default html of the hello world example and have it render correctly? I'm going to make it simple. You have come into this community and asked for help. We try to be very welcoming to newbies and to try to help people out with issues. The particular issue, mime type application/xhtml+xml vs. text/html, has been discussed numerous times in the last few months. But rather than saying RTFM or some other thing that could chase a newbie away, I asked that you work with me to diagnose the issue. Now, why is it better to diagnose the issue? First, if there is a problem in the external library (e.g., not being XHTML compatible), then we can take this information to the authors of the library and work with them to resolve the issue. We have done that in the past with issues... including an XHTML namespace issue that causes problems with jQuery on Firefox. But coming to the discussion armed with all the facts helps make the discussion smooth. The second reason to diagnose the issue is to give you and the whole community a deeper understanding of the issue and that allows more effective diagnosis of similar issues in the future. This builds institutional knowledge. So, if you want to work with me to diagnose the issue, I'm still here and willing to work with you. If you want to set the default rendering type to text/html it will likely solve your issue. If you want to continue to claim that there's some problem with Lift, you can be on your way. Lift simply generates the XHTML that you tell it to and returns that XHTML to the browser with with certain headers set by default, but that can be changed by your code. If there's something that's not rendering correctly in the browser and you've sent down proper XHTML, then talk to the library or browser maker rather than claiming that Lift isn't doing something correctly. Thanks, David On Jul 30, 11:10 pm, David Pollak feeder.of.the.be...@gmail.com wrote: Lift, by default, serves with a mime type of application/xhtml+xml (except to IE). This puts browsers into a very strict mode for parsing and it means that scripts may not use write to change the DOM. So, what/where is the
[Lift] Re: Lift maven archetypes seem to be broken ... again
Glenn, What command are you using to pull the archetype? Its certainly not an issue in lift as we don't have any 2.7.4 refs in the codebase now. The archetype catalog at http://scala-tools.org/ however still points to 1.0 of Lift, so that's on 2.7.3... Cheers, Tim On 31/07/2009 16:26, glenn gl...@exmbly.com wrote: Seems like every time I create a new LIft project in Eclipse with , drawing on the snapshots in http://scala-tools.org/repo-snapshots, I get errors, telling me I'm missing some Apache commons jar, or worse. Could It be a problem with my system? It's worked in the past without a hitch, but something has changed, and I don't believe I've changed anything local to cause this. I am still investigating, but if anyone has similar experiences, that would help me to debug. Also, shouldn't the POM use Thanks. scala.version2.7.5/scala.version rather than 2.7.4? Glenn... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: JSON form with
James, I just tested jsonForm with #$%^*(){}[]:;'|\,.?/|\ characters and الصفحة الر for testing international chars. Everything worked correctly. I am using FF3 on Ubuntu. What problems did you run into? P.S. What I committed yesterday is exactly your code so I don't get what the problem is. Did you do a git pull on master ? Br's, Marius On Jul 31, 1:34 pm, James Kearney ghostf...@googlemail.com wrote: I have had a look at the change, while better than the old one it still causes problems if you use a in a text box because you are building JSON as a string and then parsing it. In my example code you go from a javascript object to another one there is no need for parsing so you don't run into problems with escape characters. I don't know if you are building the JSON as a string then parsing it for compatibility reasons if so you should escape any found in the name and value. e.g. json += \ + e.name.replace(/\/g,\\\) + \:\ + e.value.replace (/\/g,\\\) + \,; James On Jul 30, 6:14 pm, marius d. marius.dan...@gmail.com wrote: James, I just committed the fix based on your approach. Please give it a try. Br's, Marius On Jul 30, 4:53 pm, marius d. marius.dan...@gmail.com wrote: Thank you James for your input. I hope I'll be able to look into it today. Br's, Marius On Jul 30, 4:42 pm, James Kearney ghostf...@googlemail.com wrote: I think the current implementation of the JSON form is broken. If you put an in a text field and try to submit it via a JSON form it doesn't get handled correctly. To be precise the formToJSON function in jlift.js doesn't work, and again to be more precise the params method is broken / not fit for purpose. The params method (line 249) calls s.join() and then returns but it doesn't escape the character (it also uses = but doesn't escape that). If the params function does what I think it is supposed to do which is split paramters for a URL then it should really call encodeURI on the values. That aside I don't think the formToJSON function should be using the param function. It gets a JSON object from jQuery serializeArray makes it into a string split by and = then goes and splits based on and = again building up some JSON (as a string) then parses the JSON. Why not operate on the JSON from jQuery from the start. e.g. formToJSON : function(formId) { json = jQuery(# + formId).serializeArray(); ret = {} for (var i in json) { var obj = json[i] ret[obj.name] = obj.value } return ret; } This does work differently from before since it won't call functions like params does but I don't think jQuery's serializeArray puts functions in the object it returns so that is not needed. James --~--~-~--~~~---~--~~ 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 maven archetypes seem to be broken ... again
Tim, I'm using Eclipse's maven plugin to create a new maven project with the following parameters: groupIdnet.liftweb/groupId artifactIdlift-archetype-basic/artifactId version1.1-SNAPSHOT/version repositoryhttp://scala-tools.org/repo-snapshot/repository The pom this creates in my project uses the 2.7.4 scala version. Could it be that my local .m2 repository is not being updated with a new archetype from repo-snapshot? Glenn... On Jul 31, 8:40 am, Timothy Perrett timo...@getintheloop.eu wrote: Glenn, What command are you using to pull the archetype? Its certainly not an issue in lift as we don't have any 2.7.4 refs in the codebase now. The archetype catalog athttp://scala-tools.org/however still points to 1.0 of Lift, so that's on 2.7.3... Cheers, Tim On 31/07/2009 16:26, glenn gl...@exmbly.com wrote: Seems like every time I create a new LIft project in Eclipse with , drawing on the snapshots inhttp://scala-tools.org/repo-snapshots, I get errors, telling me I'm missing some Apache commons jar, or worse. Could It be a problem with my system? It's worked in the past without a hitch, but something has changed, and I don't believe I've changed anything local to cause this. I am still investigating, but if anyone has similar experiences, that would help me to debug. Also, shouldn't the POM use Thanks. scala.version2.7.5/scala.version rather than 2.7.4? Glenn... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Implementing KeyedRecord[T,K]
To my understanding, KeyedRecord as well as KeyedField should provide the basis to implement relationship between model objects. If in my model object I have a relationship with another model object this will required the referred class to be at least a KeyedRecord. Such ReferenceField similar to the MappedForeignKey in Mapper, will have the same basic type of the KeyField in the referred KeyedRecord. Unfortunately in order to complete the design of a ReferenceField, it is required a getInstance or find method to load the object corresponding to the key. Implementation of this method is strictly related to the persistence backend but a generic definition should be inserted in MetaRecord (or better KeyedMetaRecord). Situation is even more complicated when yu have hierarchical (one to many) or even many to many relationship. I am studying sources from the recent addition to Mapper to get inspiration. In the ongoing jsr-170 backend to Record this is the way I am following even if after many redesigns some docs and support from the community on how to implements custom record backedn would be more than welcome. Regards Giuseppe In my ongoing implementation of a jsr-170 backend for Record is not using KeyedRecord On 31 Lug, 13:18, Timothy Perrett timo...@getintheloop.eu wrote: Guys, What is the intended implementation of KeyedRecord? The work done so far on DBRecord appears not to use it? When / How should one go about implementing a custom record backend? We could really do with some docs on this :-) Cheers, Tim --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Lift maven archetypes seem to be broken ... again
On Fri, Jul 31, 2009 at 8:55 AM, glenn gl...@exmbly.com wrote: Tim, I'm using Eclipse's maven plugin to create a new maven project with the following parameters: groupIdnet.liftweb/groupId artifactIdlift-archetype-basic/artifactId version1.1-SNAPSHOT/version repositoryhttp://scala-tools.org/repo-snapshot/repository The pom this creates in my project uses the 2.7.4 scala version. Could it be that my local .m2 repository is not being updated with a new archetype from repo-snapshot? Yeah... if there's a way to specify the -U flag from Eclipse, that should pull the latest from all the repos. Glenn... On Jul 31, 8:40 am, Timothy Perrett timo...@getintheloop.eu wrote: Glenn, What command are you using to pull the archetype? Its certainly not an issue in lift as we don't have any 2.7.4 refs in the codebase now. The archetype catalog athttp://scala-tools.org/however still points to 1.0 of Lift, so that's on 2.7.3... Cheers, Tim On 31/07/2009 16:26, glenn gl...@exmbly.com wrote: Seems like every time I create a new LIft project in Eclipse with , drawing on the snapshots inhttp://scala-tools.org/repo-snapshots, I get errors, telling me I'm missing some Apache commons jar, or worse. Could It be a problem with my system? It's worked in the past without a hitch, but something has changed, and I don't believe I've changed anything local to cause this. I am still investigating, but if anyone has similar experiences, that would help me to debug. Also, shouldn't the POM use Thanks. scala.version2.7.5/scala.version rather than 2.7.4? Glenn... -- 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: Lift maven archetypes seem to be broken ... again
Tim I cleaned out my local repository and even did a reindexing. When I tried to run the basic archetype this time, I got the following error: Couldn't find a version in [6.1.17, 6.1.18, 6.1.19] to match range [6.1.6,6.1.6] org.mortbay.jetty:jetty:jar:null from the specified remote repositories: apache.incubating (http://people.apache.org/repo/m2-incubating- repository), scala-tools.org (http://scala-tools.org/repo-releases), central (http://repo1.maven.org/maven2), scala-tools.org.snapshots (http://scala-tools.org/repo-snapshots) I thought this problem was fixed a while ago. Glenn... On Jul 31, 9:26 am, David Pollak feeder.of.the.be...@gmail.com wrote: On Fri, Jul 31, 2009 at 8:55 AM, glenn gl...@exmbly.com wrote: Tim, I'm using Eclipse's maven plugin to create a new maven project with the following parameters: groupIdnet.liftweb/groupId artifactIdlift-archetype-basic/artifactId version1.1-SNAPSHOT/version repositoryhttp://scala-tools.org/repo-snapshot/repository The pom this creates in my project uses the 2.7.4 scala version. Could it be that my local .m2 repository is not being updated with a new archetype from repo-snapshot? Yeah... if there's a way to specify the -U flag from Eclipse, that should pull the latest from all the repos. Glenn... On Jul 31, 8:40 am, Timothy Perrett timo...@getintheloop.eu wrote: Glenn, What command are you using to pull the archetype? Its certainly not an issue in lift as we don't have any 2.7.4 refs in the codebase now. The archetype catalog athttp://scala-tools.org/howeverstill points to 1.0 of Lift, so that's on 2.7.3... Cheers, Tim On 31/07/2009 16:26, glenn gl...@exmbly.com wrote: Seems like every time I create a new LIft project in Eclipse with , drawing on the snapshots inhttp://scala-tools.org/repo-snapshots, I get errors, telling me I'm missing some Apache commons jar, or worse. Could It be a problem with my system? It's worked in the past without a hitch, but something has changed, and I don't believe I've changed anything local to cause this. I am still investigating, but if anyone has similar experiences, that would help me to debug. Also, shouldn't the POM use Thanks. scala.version2.7.5/scala.version rather than 2.7.4? 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 --~--~-~--~~~---~--~~ 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 10 seconds works?
marius d. wrote: Implicit conversions. It's worth noting that Rails accomplishes a similar trick by adding methods to the Integer class at runtime. *shudder* :) -0xe1a --~--~-~--~~~---~--~~ 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 maven archetypes seem to be broken ... again
Glenn, I think you're pulling from a repository that is not the scala-tools.orgrepo. Unfortunately, I don't have enough Maven fu to diagnose the issue. :-( Sorry. David On Fri, Jul 31, 2009 at 9:36 AM, glenn gl...@exmbly.com wrote: Tim I cleaned out my local repository and even did a reindexing. When I tried to run the basic archetype this time, I got the following error: Couldn't find a version in [6.1.17, 6.1.18, 6.1.19] to match range [6.1.6,6.1.6] org.mortbay.jetty:jetty:jar:null from the specified remote repositories: apache.incubating (http://people.apache.org/repo/m2-incubating- repository), scala-tools.org (http://scala-tools.org/repo-releases), central (http://repo1.maven.org/maven2), scala-tools.org.snapshots (http://scala-tools.org/repo-snapshots) I thought this problem was fixed a while ago. Glenn... On Jul 31, 9:26 am, David Pollak feeder.of.the.be...@gmail.com wrote: On Fri, Jul 31, 2009 at 8:55 AM, glenn gl...@exmbly.com wrote: Tim, I'm using Eclipse's maven plugin to create a new maven project with the following parameters: groupIdnet.liftweb/groupId artifactIdlift-archetype-basic/artifactId version1.1-SNAPSHOT/version repositoryhttp://scala-tools.org/repo-snapshot/repository The pom this creates in my project uses the 2.7.4 scala version. Could it be that my local .m2 repository is not being updated with a new archetype from repo-snapshot? Yeah... if there's a way to specify the -U flag from Eclipse, that should pull the latest from all the repos. Glenn... On Jul 31, 8:40 am, Timothy Perrett timo...@getintheloop.eu wrote: Glenn, What command are you using to pull the archetype? Its certainly not an issue in lift as we don't have any 2.7.4 refs in the codebase now. The archetype catalog athttp://scala-tools.org/howeverstill points to 1.0 of Lift, so that's on 2.7.3... Cheers, Tim On 31/07/2009 16:26, glenn gl...@exmbly.com wrote: Seems like every time I create a new LIft project in Eclipse with , drawing on the snapshots inhttp://scala-tools.org/repo-snapshots, I get errors, telling me I'm missing some Apache commons jar, or worse. Could It be a problem with my system? It's worked in the past without a hitch, but something has changed, and I don't believe I've changed anything local to cause this. I am still investigating, but if anyone has similar experiences, that would help me to debug. Also, shouldn't the POM use Thanks. scala.version2.7.5/scala.version rather than 2.7.4? 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: JSON form with
Ah, sorry my mistake I was looking at the first of the two commits you made On Jul 31, 4:52 pm, marius d. marius.dan...@gmail.com wrote: James, I just tested jsonForm with #$%^*(){}[]:;'|\,.?/|\ characters and الصفحة الر for testing international chars. Everything worked correctly. I am using FF3 on Ubuntu. What problems did you run into? P.S. What I committed yesterday is exactly your code so I don't get what the problem is. Did you do a git pull on master ? Br's, Marius On Jul 31, 1:34 pm, James Kearney ghostf...@googlemail.com wrote: I have had a look at the change, while better than the old one it still causes problems if you use a in a text box because you are building JSON as a string and then parsing it. In my example code you go from a javascript object to another one there is no need for parsing so you don't run into problems with escape characters. I don't know if you are building the JSON as a string then parsing it for compatibility reasons if so you should escape any found in the name and value. e.g. json += \ + e.name.replace(/\/g,\\\) + \:\ + e.value.replace (/\/g,\\\) + \,; James On Jul 30, 6:14 pm, marius d. marius.dan...@gmail.com wrote: James, I just committed the fix based on your approach. Please give it a try. Br's, Marius On Jul 30, 4:53 pm, marius d. marius.dan...@gmail.com wrote: Thank you James for your input. I hope I'll be able to look into it today. Br's, Marius On Jul 30, 4:42 pm, James Kearney ghostf...@googlemail.com wrote: I think the current implementation of the JSON form is broken. If you put an in a text field and try to submit it via a JSON form it doesn't get handled correctly. To be precise the formToJSON function in jlift.js doesn't work, and again to be more precise the params method is broken / not fit for purpose. The params method (line 249) calls s.join() and then returns but it doesn't escape the character (it also uses = but doesn't escape that). If the params function does what I think it is supposed to do which is split paramters for a URL then it should really call encodeURI on the values. That aside I don't think the formToJSON function should be using the param function. It gets a JSON object from jQuery serializeArray makes it into a string split by and = then goes and splits based on and = again building up some JSON (as a string) then parses the JSON. Why not operate on the JSON from jQuery from the start. e.g. formToJSON : function(formId) { json = jQuery(# + formId).serializeArray(); ret = {} for (var i in json) { var obj = json[i] ret[obj.name] = obj.value } return ret; } This does work differently from before since it won't call functions like params does but I don't think jQuery's serializeArray puts functions in the object it returns so that is not needed. James --~--~-~--~~~---~--~~ 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 maven archetypes seem to be broken ... again
This has only been happening recently - its like maven cant find 6.1.6 version of jetty. Change the line in your pom.xml to: [6.1.6,) That will fix the problem for now... I need to change this in the archetypes but it will then mean that Eclipse wont run the tests out of the box (it appears to always try to donwload jetty 7 which doesn't have the right class)... Hmm. Annoying! Cheers, Tim On 31/07/2009 17:36, glenn gl...@exmbly.com wrote: Tim I cleaned out my local repository and even did a reindexing. When I tried to run the basic archetype this time, I got the following error: Couldn't find a version in [6.1.17, 6.1.18, 6.1.19] to match range [6.1.6,6.1.6] org.mortbay.jetty:jetty:jar:null from the specified remote repositories: apache.incubating (http://people.apache.org/repo/m2-incubating- repository), scala-tools.org (http://scala-tools.org/repo-releases), central (http://repo1.maven.org/maven2), scala-tools.org.snapshots (http://scala-tools.org/repo-snapshots) I thought this problem was fixed a while ago. Glenn... On Jul 31, 9:26 am, David Pollak feeder.of.the.be...@gmail.com wrote: On Fri, Jul 31, 2009 at 8:55 AM, glenn gl...@exmbly.com wrote: Tim, I'm using Eclipse's maven plugin to create a new maven project with the following parameters: groupIdnet.liftweb/groupId artifactIdlift-archetype-basic/artifactId version1.1-SNAPSHOT/version repositoryhttp://scala-tools.org/repo-snapshot/repository The pom this creates in my project uses the 2.7.4 scala version. Could it be that my local .m2 repository is not being updated with a new archetype from repo-snapshot? Yeah... if there's a way to specify the -U flag from Eclipse, that should pull the latest from all the repos. Glenn... On Jul 31, 8:40 am, Timothy Perrett timo...@getintheloop.eu wrote: Glenn, What command are you using to pull the archetype? Its certainly not an issue in lift as we don't have any 2.7.4 refs in the codebase now. The archetype catalog athttp://scala-tools.org/howeverstill points to 1.0 of Lift, so that's on 2.7.3... Cheers, Tim On 31/07/2009 16:26, glenn gl...@exmbly.com wrote: Seems like every time I create a new LIft project in Eclipse with , drawing on the snapshots inhttp://scala-tools.org/repo-snapshots, I get errors, telling me I'm missing some Apache commons jar, or worse. Could It be a problem with my system? It's worked in the past without a hitch, but something has changed, and I don't believe I've changed anything local to cause this. I am still investigating, but if anyone has similar experiences, that would help me to debug. Also, shouldn't the POM use Thanks. scala.version2.7.5/scala.version rather than 2.7.4? 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 --~--~-~--~~~---~--~~ 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 maven archetypes seem to be broken ... again
On Fri, Jul 31, 2009 at 9:47 AM, Timothy Perrett timo...@getintheloop.euwrote: This has only been happening recently - its like maven cant find 6.1.6 version of jetty. Change the line in your pom.xml to: [6.1.6,) [6.1.6, 6.1.19) This will find the latest versions, but won't try to find Jetty 7. That will fix the problem for now... I need to change this in the archetypes but it will then mean that Eclipse wont run the tests out of the box (it appears to always try to donwload jetty 7 which doesn't have the right class)... Hmm. Annoying! Cheers, Tim On 31/07/2009 17:36, glenn gl...@exmbly.com wrote: Tim I cleaned out my local repository and even did a reindexing. When I tried to run the basic archetype this time, I got the following error: Couldn't find a version in [6.1.17, 6.1.18, 6.1.19] to match range [6.1.6,6.1.6] org.mortbay.jetty:jetty:jar:null from the specified remote repositories: apache.incubating (http://people.apache.org/repo/m2-incubating- repository), scala-tools.org (http://scala-tools.org/repo-releases), central (http://repo1.maven.org/maven2), scala-tools.org.snapshots (http://scala-tools.org/repo-snapshots) I thought this problem was fixed a while ago. Glenn... On Jul 31, 9:26 am, David Pollak feeder.of.the.be...@gmail.com wrote: On Fri, Jul 31, 2009 at 8:55 AM, glenn gl...@exmbly.com wrote: Tim, I'm using Eclipse's maven plugin to create a new maven project with the following parameters: groupIdnet.liftweb/groupId artifactIdlift-archetype-basic/artifactId version1.1-SNAPSHOT/version repositoryhttp://scala-tools.org/repo-snapshot/repository The pom this creates in my project uses the 2.7.4 scala version. Could it be that my local .m2 repository is not being updated with a new archetype from repo-snapshot? Yeah... if there's a way to specify the -U flag from Eclipse, that should pull the latest from all the repos. Glenn... On Jul 31, 8:40 am, Timothy Perrett timo...@getintheloop.eu wrote: Glenn, What command are you using to pull the archetype? Its certainly not an issue in lift as we don't have any 2.7.4 refs in the codebase now. The archetype catalog athttp://scala-tools.org/howeverstill points to 1.0 of Lift, so that's on 2.7.3... Cheers, Tim On 31/07/2009 16:26, glenn gl...@exmbly.com wrote: Seems like every time I create a new LIft project in Eclipse with , drawing on the snapshots inhttp://scala-tools.org/repo-snapshots, I get errors, telling me I'm missing some Apache commons jar, or worse. Could It be a problem with my system? It's worked in the past without a hitch, but something has changed, and I don't believe I've changed anything local to cause this. I am still investigating, but if anyone has similar experiences, that would help me to debug. Also, shouldn't the POM use Thanks. scala.version2.7.5/scala.version rather than 2.7.4? 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: Automatic background AJAX: best way to do it?
On Wed, Jul 29, 2009 at 11:45 PM, Nolan Darilek no...@thewordnerd.infowrote: On 07/28/2009 07:28 PM, David Pollak wrote: I'd do the REST API thing. The mechanisms that Lift has for handling API calls from the browser are numerous, but they are associated with a session (you can do ajaxCall or a S.buildJsonFunc). Oh cool. When I listened to the podcast interview and heard about fast-pathing AJAX calls, I realized that this was exactly what I wanted, and that there wasn't a need to create a separate URL space just to accomodate this page update functionality--at least, not explicitly in the sense of what I meant by API. Neat. Thanks for the method pointers, too, that helped me focus my reading a bit. So here's what I have. I have this JS code as an interface to the geolocation API: function Location() { this.lat = 0; this.lon = 0; this.update = function(lat, lon) { this.lat = lat; this.lon = lon; this.onUpdate(lat, lon); }; this.onUpdate = function(lat, lon) {}; } var loc = new Location(); Next I wrote a snippet which needs to set loc.onUpdate to a function that calls into Lift to update the page. I have: class Geolocation { def updatePosition(pos:String):JsCmd = Alert(Got an update: +pos) def update(in:NodeSeq):NodeSeq = script type=text/javascript loc.onUpdate = function(lat, lon) { {SHtml.ajaxCall(JsObj(lat - JsVar(lat), lon - JsVar(lon)), updatePosition _)._2} }; /script } Lift is XHTML. The above will not work in XHTML because the code will be escaped into XML. Try the following: def update(in: NodeSeq): NodeSeq = Script(JsRaw( loc.onUpdate = function(lat, lon) { +SHtml.ajaxCall(JsObj(lat - JsVar(lat), lon - JsVar(lon)), updatePosition _)._2.toJsCmd+ }; )) Two issues here. First, how do I get those braces around the JS function containing the ajaxCall into my HTML? Seems like there should be a way to escape braces so I can include them in NodeSeq, but \{ didn't seem to do it. I'm also quite new to JS as well, so perhaps there's a better way to set that callback. All I can come up with is changing the callback signature to accept an object rather than individual values so perhaps I can set it directly to the Lift-generated function, but I think I'd rather have raw values for individual position components for now. 2. Ideally, I'd like for the JsObj to be an actual Map[String, Float]. Is there a way to do this? An included JSON parser that'd convert the string to a type I specify, perhaps? (assuming I'd have to give some sort of hint for Float vs. other numeric types, anyway) I'm committing up jsonCall which augments ajaxCall by serializing (JSON.stringify) the expression before sending it to the server and then JSON parsing on the server before sending it to your function. Thanks. Wow, this really makes AJAX development something I'd actually enjoy doing. :) -- 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: Getting Started tutorial - not understanding some syntax
Thankyou all for your posts, I now understand whats going on ! Victor : Thanks for the great examples of how to pass functions into other functions - a very illuminating example, I'm sitting here thinking about how much that will make a difference to code conciseness compared with Java ! David : Combined with Victor's example of how to pass a function via another function, I can now see how the value from the user is applied to the domain object. Pretty slick, once you grasp whats going on. Cracking stuff, looking forward to learning more about Lift+Scala, and hopefully getting a site into production in the future. Ben --~--~-~--~~~---~--~~ 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 form with returned NodeSeq
On Thu, Jul 30, 2009 at 8:13 PM, Calen Pennington calen.penning...@gmail.com wrote: Sorry my original question was unclear. I'm looking to submit data with the form, and then get a response back from the server to act on. The use case is that I have a list of things that I would like to add elements to on the fly. The desired action is to have the list on the page, with an add form below it. This form has two text fields, quantity and item. When submit is clicked, I want to save the contents of those two fields on the server, and update the displayed list with the new item added. In other frameworks, the way that I've done this is to have the form onsubmit contain code that made a jquery ajax call with the contents of the form, and then would receive the full contents of the new list, which it would drop into the DOM. Not sure how to rig that up in Lift, though. The To Do example in Getting Started has an example of doing this. See http://liftweb.net/docs/getting_started.html -Cale On Thu, Jul 30, 2009 at 10:52 PM, David Pollak feeder.of.the.be...@gmail.com wrote: On Thu, Jul 30, 2009 at 7:28 PM, Calen Pennington calen.penning...@gmail.com wrote: Hey, all, I want to create a form that on submission executes some serverside code that returns a NodeSeq, and then updates the page with that xml. It seems like some combination of AjaxForm and SetHtml should do what I want, but I can't seem to get the server to send a response to the client that can be used to update the html. Is there a lifty way of doing this? ajaxButton(bPress me/b, () = SetHtml(myspan, spanThe time is {new java.util.Date}/span)) Thanks -Cale -- 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: Asynchronous Javascript problem
On Thu, Jul 30, 2009 at 10:55 PM, Channing Walton channingwal...@mac.comwrote: Are you putting the result of: Script(Function(sendPointToServer, point, PointHandler.call(setPoint, JsVal(point Anywhere on your page? I believe so, the page has a snippet: lift:mapSnippet.mapFunctions/ which looks like this: def mapFunctions(xhtml : NodeSeq) : NodeSeq = { val node = Script(Function(sendPointToServer, List(point), PointHandler.call(setPoint, JsVar(point node ++ head{Script(OnLoad(Call(initialize)))}/head } Whoops... should be: Script(Function(sendPointToServer, point, PointHandler.call(setPoint, JsVal(point))) PointHandler.jsCmd) and in the page I see: function sendPointToServer(point) { F542198622797IUJ({'command': 'setPoint', 'params':point}); } -- 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] Offline building and documentation
I'm up at a cabin and hoped to be able to work offline, but am finding that Maven secretly assumes that you will always be on the internet and won't co-operate with me even using the -o (offline) option. Answers to some very (I'm hoping) simple questions can go a long way towards helping me out. 1) How can I build the Lift scaladocs locally on my machine? I have downloaded the latest Lift source from GitHub but for the life of me, digging through all the pom.xml files I can't figure out how to get Maven to build me scaladocs for everything. To make everything even more confusing, some of the packages built scaladocs (net.liftweb.util and ne.liftweb.wizard), but the rest don't. 2) In my quest to build the scaladocs, I addd scala, scalac and scaladoc to my $PATH. Suddenly, all I get from Maven is this: steelrain:engine grant$ mvn jetty:run ## ZeroTurnaround JavaRebel 1.2.2 (200812021546) (c) Copyright Webmedia, Ltd, 2007, 2008. All rights reserved. YOUR JAVAREBEL LIMITED LICENSE HAS EXPIRED! This product is licensed to Scala Community until July 1, 2009 for unlimited number of developer seats on site. With the following restrictions: For use with Scala only ## What is this? and why is it preventing me from doing anything at all with Maven on my machine? I removed the scala commands from my $PATH again (I'm on OSX 10.5.7) and it is still doing it. More importantly, how do I make this stop? I have very limited access to the Internet here (although watching the Eagles catch fish near our dock at sunrise this morning was a nice consolation) so I'm sorry if I can't respond right away. Thanks everyone for your patience and help. --~--~-~--~~~---~--~~ 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: Offline building and documentation
Don't know about scaladoc, but there was a bug in older maven versions about offline usage. What version do you have? As far as JavaRebel, scala users get a free license but you currently have an expired one. You have to replace the jar and .lic file. In the meantime can you comment it out from your POM? - Grant Woodsmackt...@gmail.com wrote: I'm up at a cabin and hoped to be able to work offline, but am finding that Maven secretly assumes that you will always be on the internet and won't co-operate with me even using the -o (offline) option. Answers to some very (I'm hoping) simple questions can go a long way towards helping me out. 1) How can I build the Lift scaladocs locally on my machine? I have downloaded the latest Lift source from GitHub but for the life of me, digging through all the pom.xml files I can't figure out how to get Maven to build me scaladocs for everything. To make everything even more confusing, some of the packages built scaladocs (net.liftweb.util and ne.liftweb.wizard), but the rest don't. 2) In my quest to build the scaladocs, I addd scala, scalac and scaladoc to my $PATH. Suddenly, all I get from Maven is this: steelrain:engine grant$ mvn jetty:run ## ZeroTurnaround JavaRebel 1.2.2 (200812021546) (c) Copyright Webmedia, Ltd, 2007, 2008. All rights reserved. YOUR JAVAREBEL LIMITED LICENSE HAS EXPIRED! This product is licensed to Scala Community until July 1, 2009 for unlimited number of developer seats on site. With the following restrictions: For use with Scala only ## What is this? and why is it preventing me from doing anything at all with Maven on my machine? I removed the scala commands from my $PATH again (I'm on OSX 10.5.7) and it is still doing it. More importantly, how do I make this stop? I have very limited access to the Internet here (although watching the Eagles catch fish near our dock at sunrise this morning was a nice consolation) so I'm sorry if I can't respond right away. Thanks everyone for your patience and help. --~--~-~--~~~---~--~~ 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: Asynchronous Javascript problem
cool thanks, that did it. Google recommends running a script on unload, their example has: body onload=initialize() onunload=GUnload() I couldn't see any Unload function anyway, I guess it would be a useful thing to add? --~--~-~--~~~---~--~~ 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: Offline building and documentation
Grant, Are you on Windows or OS X? Thanks, DAvid On Fri, Jul 31, 2009 at 12:40 PM, Grant Wood smackt...@gmail.com wrote: I'm up at a cabin and hoped to be able to work offline, but am finding that Maven secretly assumes that you will always be on the internet and won't co-operate with me even using the -o (offline) option. Answers to some very (I'm hoping) simple questions can go a long way towards helping me out. 1) How can I build the Lift scaladocs locally on my machine? I have downloaded the latest Lift source from GitHub but for the life of me, digging through all the pom.xml files I can't figure out how to get Maven to build me scaladocs for everything. To make everything even more confusing, some of the packages built scaladocs (net.liftweb.util and ne.liftweb.wizard), but the rest don't. 2) In my quest to build the scaladocs, I addd scala, scalac and scaladoc to my $PATH. Suddenly, all I get from Maven is this: steelrain:engine grant$ mvn jetty:run ## ZeroTurnaround JavaRebel 1.2.2 (200812021546) (c) Copyright Webmedia, Ltd, 2007, 2008. All rights reserved. YOUR JAVAREBEL LIMITED LICENSE HAS EXPIRED! This product is licensed to Scala Community until July 1, 2009 for unlimited number of developer seats on site. With the following restrictions: For use with Scala only ## What is this? and why is it preventing me from doing anything at all with Maven on my machine? I removed the scala commands from my $PATH again (I'm on OSX 10.5.7) and it is still doing it. More importantly, how do I make this stop? I have very limited access to the Internet here (although watching the Eagles catch fish near our dock at sunrise this morning was a nice consolation) so I'm sorry if I can't respond right away. Thanks everyone for your patience and help. -- 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: Offline building and documentation
Maven is a bit tricky when trying to go offline if you have snapshot dependencies. Having said that... I've definitely not been bitten by the issue since upgrading to 2.2 - so you really want to check you're on the latest version, as it looks like they've recently done a lot of releases in quick succession, On Fri, Jul 31, 2009 at 9:54 PM, David Pollak feeder.of.the.be...@gmail.com wrote: Grant, Are you on Windows or OS X? Thanks, DAvid On Fri, Jul 31, 2009 at 12:40 PM, Grant Wood smackt...@gmail.com wrote: I'm up at a cabin and hoped to be able to work offline, but am finding that Maven secretly assumes that you will always be on the internet and won't co-operate with me even using the -o (offline) option. Answers to some very (I'm hoping) simple questions can go a long way towards helping me out. 1) How can I build the Lift scaladocs locally on my machine? I have downloaded the latest Lift source from GitHub but for the life of me, digging through all the pom.xml files I can't figure out how to get Maven to build me scaladocs for everything. To make everything even more confusing, some of the packages built scaladocs (net.liftweb.util and ne.liftweb.wizard), but the rest don't. 2) In my quest to build the scaladocs, I addd scala, scalac and scaladoc to my $PATH. Suddenly, all I get from Maven is this: steelrain:engine grant$ mvn jetty:run ## ZeroTurnaround JavaRebel 1.2.2 (200812021546) (c) Copyright Webmedia, Ltd, 2007, 2008. All rights reserved. YOUR JAVAREBEL LIMITED LICENSE HAS EXPIRED! This product is licensed to Scala Community until July 1, 2009 for unlimited number of developer seats on site. With the following restrictions: For use with Scala only ## What is this? and why is it preventing me from doing anything at all with Maven on my machine? I removed the scala commands from my $PATH again (I'm on OSX 10.5.7) and it is still doing it. More importantly, how do I make this stop? I have very limited access to the Internet here (although watching the Eagles catch fish near our dock at sunrise this morning was a nice consolation) so I'm sorry if I can't respond right away. Thanks everyone for your patience and help. -- 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: New features
Naftoli, I set up my mapper to use your new ManyToMany trait, but I'm not sure how exactly to use it in a snippet or view. Here's what I have so far, a User, Role and UserRole for my model classes: class Role extends LongKeyedMapper[Role] with IdPK { def getSingleton = Role object name extends MappedPoliteString(this, 50) { override def setFilter = notNull _ :: trim _ :: super.setFilter } } class UserRole extends LongKeyedMapper[UserRole] with IdPK { def getSingleton = UserRole object role extends MappedLongForeignKey(this, Role){ override def dbIndexed_? = true } object user extends MappedLongForeignKey(this,User) { override def dbIndexed_? = true } } class User extends MegaProtoUser[User] with ManyToMany[UserRole, Role] { def getSingleton = User // what's the meta server // define an additional field for a personal essay object textArea extends MappedTextarea(this, 2048) { override def textareaRows = 10 override def textareaCols = 50 override def displayName = Personal Essay } object role extends MappedManyToMany(UserRole, this, Role) } and their corresponding singleton objects. In the past, without the ManyToMany trait, I would do this in User object override def editXhtml(user: User) = { (form method=post action={S.uri} tabletrtd colspan=2{S.??(edit)}/td/tr {localForm(user, true)} trtdRoles/tdtduser:roles//td/tr trtdnbsp;/tdtduser:submit//td/tr trtda href={changePasswordPath.mkString(/, /, )} {S.??(change.password)}/a/td/tr /table /form) } and bind this with the following to show the roles for a particular user as a comma delimited string. def innerEdit = User.isa_?(admin) match { case true = bind(user, editXhtml(theUser), roles - text(roles, doRolesAndSubmit), submit - SHtml.submit(S.??(edit), testEdit _)) case false = bind(user, editXhtml(theUser), roles - theUser.showRoles, submit - SHtml.submit(S.??(edit), testEdit _)) } here roles is defined as var roles = theUser.roles.map(_.name.is).mkString(, ) Do you have an example of how to achieve something similar with your new ManyToMany and MappedManyToMany code? Appreciate any help you can give me. Thanks, Glenn... On Jul 28, 3:05 pm, Naftoli Gugenheim naftoli...@gmail.com wrote: Did you update your source jar? Try deleting it from your repository just to be sure, then mvn dependency:sources etc. Either way you can access the source on github. - glenngl...@exmbly.com wrote: Naftoli, The ManyToMany class is in the new lift-mapper jar, but the source is not available in 1.1-SNAPSHOT-sources. Could you provide? Thanks, Glenn... On Jul 27, 3:50 pm, Naftoli Gugenheim naftoli...@gmail.com wrote: I committed it last night, so I think it should be there. To use many-to-many, simply mix ManyToMany to your mapper, then create a MappedManyToMany field like any other field. See the scaladocs for specifics. Then in your view you can use the field like a collection, e.g., remove an element with -=, and save the mapper to apply the changes. - glenngl...@exmbly.com wrote: Sounds great. I've been using hacks such as adding code like this to my mapper classes just to create a Many-to-Many relationship between say, tag and content tables (using an intermediary ContentTag table). Similarly, I've done User/Roles relationships. private object _dbTags extends HasManyThrough(this, Tag, ContentTag, ContentTag.content, ContentTag.tag) private[model] var _tags : List[Tag] = _ private val locker = new Object def tags : List[Tag] = locker.synchronized { if(_tags eq null){ _tags = _dbTags() } _tags } def tags(newTags:String) = locker.synchronized { _tags = newTags.roboSplit(,).map(Tag.byName(_)) this } def tags(newTags:List[Tag]) = locker.synchronized { _tags = newTags this } def tagsToo:List[Tag] = ContentTag.findAll(By(ContentTag.content, this.id)).map(_.tag.obj.open_!) def showTags = Text(tags.map(_.name.is).mkString(, )) But, then I have to add code like this to the meta-mapper objects: def addTags(entry: Content) { if(entry._tags ne null){ entry._tags.foreach(ContentTag.join(_, entry)) } } def delTags(entry:Content) = ContentTag.findAll(By(ContentTag.content, entry)).foreach (_.delete_!) It's not very pretty. Nor easy to duplicate. I hope your new code is considerably less messy. Is it in the repo-snapshot repository yet. On Jul 27, 12:57 pm, Naftoli Gugenheim naftoli...@gmail.com wrote: I committed some code last night, which can help building mapper-based view snippets, with G-d's help. It includes the
[Lift] Re: Submit like SHtml.text but with ajaxText
I just committed code that allows: bind(form, xhtml, first - text(firstName, firstName = _, s = {S.notice(First name +s); Noop}), last - text(lastName, lastName = _, s = {S.notice(Last name +s); Noop}), submit - submit(Send, validate _)) You can have an onblur associated with a server-side function. On Fri, Jul 31, 2009 at 6:33 AM, Richard Dallaway dalla...@gmail.comwrote: I'm looking for some guidance on how best to have the value of text field that's been ajax-ified picked up on a regular submit. What I mean is: If I have a field of object word extends RequestVar() which I bind like this bind(f, xhtml, word - SHtml.text(word,word(_)), submit - SHtml.submit(GO, processForm) ) and everything is lovely and this does what you expect: def processForm() = { Log.info(Submit from the form:) Log.info(word) } Now I want to add some dynamic feedback for the user of the form so I switch to... word - SHtml.ajaxText(word, checkWord(_)) with def checkWord(w:String) = { Log.info(Ajax check: +w) Noop } That also works just great. But when the submit button is hit, of course there's now no-longer the assignment into word RequestVar anymore. And I'd like there to be (regardless of if the Ajax checkWords is ever called or not). So where should I be looking to insert the word(_) call to get the AJAX goodness but also the good old submit behaviour? My current thinking is that I use a SHtml.text but then mess with the input that's created to include the appropriate Ajax calls I want. Lift 1.1-SNAPSHOT on 2.7.5.final Many thanks Richard -- 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: New features
I didn't yet look at your code too closely, but the idea is that the field that represents the relationship implements Buffer, so you can add, remove, and iterate its elements, which are the other side of the relationship. These changes are remembered until you call save, when they are acted on. - glenngl...@exmbly.com wrote: Naftoli, I set up my mapper to use your new ManyToMany trait, but I'm not sure how exactly to use it in a snippet or view. Here's what I have so far, a User, Role and UserRole for my model classes: class Role extends LongKeyedMapper[Role] with IdPK { def getSingleton = Role object name extends MappedPoliteString(this, 50) { override def setFilter = notNull _ :: trim _ :: super.setFilter } } class UserRole extends LongKeyedMapper[UserRole] with IdPK { def getSingleton = UserRole object role extends MappedLongForeignKey(this, Role){ override def dbIndexed_? = true } object user extends MappedLongForeignKey(this,User) { override def dbIndexed_? = true } } class User extends MegaProtoUser[User] with ManyToMany[UserRole, Role] { def getSingleton = User // what's the meta server // define an additional field for a personal essay object textArea extends MappedTextarea(this, 2048) { override def textareaRows = 10 override def textareaCols = 50 override def displayName = Personal Essay } object role extends MappedManyToMany(UserRole, this, Role) } and their corresponding singleton objects. In the past, without the ManyToMany trait, I would do this in User object override def editXhtml(user: User) = { (form method=post action={S.uri} tabletrtd colspan=2{S.??(edit)}/td/tr {localForm(user, true)} trtdRoles/tdtduser:roles//td/tr trtdnbsp;/tdtduser:submit//td/tr trtda href={changePasswordPath.mkString(/, /, )} {S.??(change.password)}/a/td/tr /table /form) } and bind this with the following to show the roles for a particular user as a comma delimited string. def innerEdit = User.isa_?(admin) match { case true = bind(user, editXhtml(theUser), roles - text(roles, doRolesAndSubmit), submit - SHtml.submit(S.??(edit), testEdit _)) case false = bind(user, editXhtml(theUser), roles - theUser.showRoles, submit - SHtml.submit(S.??(edit), testEdit _)) } here roles is defined as var roles = theUser.roles.map(_.name.is).mkString(, ) Do you have an example of how to achieve something similar with your new ManyToMany and MappedManyToMany code? Appreciate any help you can give me. Thanks, Glenn... On Jul 28, 3:05 pm, Naftoli Gugenheim naftoli...@gmail.com wrote: Did you update your source jar? Try deleting it from your repository just to be sure, then mvn dependency:sources etc. Either way you can access the source on github. - glenngl...@exmbly.com wrote: Naftoli, The ManyToMany class is in the new lift-mapper jar, but the source is not available in 1.1-SNAPSHOT-sources. Could you provide? Thanks, Glenn... On Jul 27, 3:50 pm, Naftoli Gugenheim naftoli...@gmail.com wrote: I committed it last night, so I think it should be there. To use many-to-many, simply mix ManyToMany to your mapper, then create a MappedManyToMany field like any other field. See the scaladocs for specifics. Then in your view you can use the field like a collection, e.g., remove an element with -=, and save the mapper to apply the changes. - glenngl...@exmbly.com wrote: Sounds great. I've been using hacks such as adding code like this to my mapper classes just to create a Many-to-Many relationship between say, tag and content tables (using an intermediary ContentTag table). Similarly, I've done User/Roles relationships. private object _dbTags extends HasManyThrough(this, Tag, ContentTag, ContentTag.content, ContentTag.tag) private[model] var _tags : List[Tag] = _ private val locker = new Object def tags : List[Tag] = locker.synchronized { if(_tags eq null){ _tags = _dbTags() } _tags } def tags(newTags:String) = locker.synchronized { _tags = newTags.roboSplit(,).map(Tag.byName(_)) this } def tags(newTags:List[Tag]) = locker.synchronized { _tags = newTags this } def tagsToo:List[Tag] = ContentTag.findAll(By(ContentTag.content, this.id)).map(_.tag.obj.open_!) def showTags = Text(tags.map(_.name.is).mkString(, )) But, then I have to add code like this to the meta-mapper objects: def addTags(entry: Content) { if(entry._tags ne null){ entry._tags.foreach(ContentTag.join(_, entry)) } } def delTags(entry:Content) = ContentTag.findAll(By(ContentTag.content,
[Lift] Re: New features
I should probably take Mapped out of the name, because it's not a MappedField. - glenngl...@exmbly.com wrote: Naftoli, I set up my mapper to use your new ManyToMany trait, but I'm not sure how exactly to use it in a snippet or view. Here's what I have so far, a User, Role and UserRole for my model classes: class Role extends LongKeyedMapper[Role] with IdPK { def getSingleton = Role object name extends MappedPoliteString(this, 50) { override def setFilter = notNull _ :: trim _ :: super.setFilter } } class UserRole extends LongKeyedMapper[UserRole] with IdPK { def getSingleton = UserRole object role extends MappedLongForeignKey(this, Role){ override def dbIndexed_? = true } object user extends MappedLongForeignKey(this,User) { override def dbIndexed_? = true } } class User extends MegaProtoUser[User] with ManyToMany[UserRole, Role] { def getSingleton = User // what's the meta server // define an additional field for a personal essay object textArea extends MappedTextarea(this, 2048) { override def textareaRows = 10 override def textareaCols = 50 override def displayName = Personal Essay } object role extends MappedManyToMany(UserRole, this, Role) } and their corresponding singleton objects. In the past, without the ManyToMany trait, I would do this in User object override def editXhtml(user: User) = { (form method=post action={S.uri} tabletrtd colspan=2{S.??(edit)}/td/tr {localForm(user, true)} trtdRoles/tdtduser:roles//td/tr trtdnbsp;/tdtduser:submit//td/tr trtda href={changePasswordPath.mkString(/, /, )} {S.??(change.password)}/a/td/tr /table /form) } and bind this with the following to show the roles for a particular user as a comma delimited string. def innerEdit = User.isa_?(admin) match { case true = bind(user, editXhtml(theUser), roles - text(roles, doRolesAndSubmit), submit - SHtml.submit(S.??(edit), testEdit _)) case false = bind(user, editXhtml(theUser), roles - theUser.showRoles, submit - SHtml.submit(S.??(edit), testEdit _)) } here roles is defined as var roles = theUser.roles.map(_.name.is).mkString(, ) Do you have an example of how to achieve something similar with your new ManyToMany and MappedManyToMany code? Appreciate any help you can give me. Thanks, Glenn... On Jul 28, 3:05 pm, Naftoli Gugenheim naftoli...@gmail.com wrote: Did you update your source jar? Try deleting it from your repository just to be sure, then mvn dependency:sources etc. Either way you can access the source on github. - glenngl...@exmbly.com wrote: Naftoli, The ManyToMany class is in the new lift-mapper jar, but the source is not available in 1.1-SNAPSHOT-sources. Could you provide? Thanks, Glenn... On Jul 27, 3:50 pm, Naftoli Gugenheim naftoli...@gmail.com wrote: I committed it last night, so I think it should be there. To use many-to-many, simply mix ManyToMany to your mapper, then create a MappedManyToMany field like any other field. See the scaladocs for specifics. Then in your view you can use the field like a collection, e.g., remove an element with -=, and save the mapper to apply the changes. - glenngl...@exmbly.com wrote: Sounds great. I've been using hacks such as adding code like this to my mapper classes just to create a Many-to-Many relationship between say, tag and content tables (using an intermediary ContentTag table). Similarly, I've done User/Roles relationships. private object _dbTags extends HasManyThrough(this, Tag, ContentTag, ContentTag.content, ContentTag.tag) private[model] var _tags : List[Tag] = _ private val locker = new Object def tags : List[Tag] = locker.synchronized { if(_tags eq null){ _tags = _dbTags() } _tags } def tags(newTags:String) = locker.synchronized { _tags = newTags.roboSplit(,).map(Tag.byName(_)) this } def tags(newTags:List[Tag]) = locker.synchronized { _tags = newTags this } def tagsToo:List[Tag] = ContentTag.findAll(By(ContentTag.content, this.id)).map(_.tag.obj.open_!) def showTags = Text(tags.map(_.name.is).mkString(, )) But, then I have to add code like this to the meta-mapper objects: def addTags(entry: Content) { if(entry._tags ne null){ entry._tags.foreach(ContentTag.join(_, entry)) } } def delTags(entry:Content) = ContentTag.findAll(By(ContentTag.content, entry)).foreach (_.delete_!) It's not very pretty. Nor easy to duplicate. I hope your new code is considerably less messy. Is it in the repo-snapshot repository yet. On Jul 27, 12:57 pm, Naftoli Gugenheim
[Lift] Re: Offline building and documentation
Grant, If your on windows or OSX, just take a look at your $M2 environment variable and remove the javarebel path... We didn¹t know at the time of making that installer that it would expire in one year if we had, we probably would have thought twice about enabling it. That¹s another story... Anyway if you don¹t know how to alter the environment var, just search your system for javarebel.jar and delete it; that will certainly remove the problem. Sorry for the confusion. Regarding building documentation offline, if you have a version of maven earlier than 2.2, you¹ll need to run: mvn install scala:doc However if you have 2.2+ then you can just do: nvn scala:doc Cheers Tim On 31/07/2009 22:06, Kevin Wright kev.lee.wri...@googlemail.com wrote: Maven is a bit tricky when trying to go offline if you have snapshot dependencies. Having said that... I've definitely not been bitten by the issue since upgrading to 2.2 - so you really want to check you're on the latest version, as it looks like they've recently done a l ot of releases in quick succession, On Fri, Jul 31, 2009 at 9:54 PM, David Pollak feeder.of.the.be...@gmail.com wrote: Grant, Are you on Windows or OS X? Thanks, DAvid On Fri, Jul 31, 2009 at 12:40 PM, Grant Wood smackt...@gmail.com wrote: I'm up at a cabin and hoped to be able to work offline, but am finding that Maven secretly assumes that you will always be on the internet and won't co-operate with me even using the -o (offline) option. Answers to some very (I'm hoping) simple questions can go a long way towards helping me out. 1) How can I build the Lift scaladocs locally on my machine? I have downloaded the latest Lift source from GitHub but for the life of me, digging through all the pom.xml files I can't figure out how to get Maven to build me scaladocs for everything. To make everything even more confusing, some of the packages built scaladocs (net.liftweb.util and ne.liftweb.wizard), but the rest don't. 2) In my quest to build the scaladocs, I addd scala, scalac and scaladoc to my $PATH. Suddenly, all I get from Maven is this: steelrain:engine grant$ mvn jetty:run ## ZeroTurnaround JavaRebel 1.2.2 (200812021546) (c) Copyright Webmedia, Ltd, 2007, 2008. All rights reserved. YOUR JAVAREBEL LIMITED LICENSE HAS EXPIRED! This product is licensed to Scala Community until July 1, 2009 for unlimited number of developer seats on site. With the following restrictions: For use with Scala only ## What is this? and why is it preventing me from doing anything at all with Maven on my machine? I removed the scala commands from my $PATH again (I'm on OSX 10.5.7) and it is still doing it. More importantly, how do I make this stop? I have very limited access to the Internet here (although watching the Eagles catch fish near our dock at sunrise this morning was a nice consolation) so I'm sorry if I can't respond right away. Thanks everyone for your patience and help. --~--~-~--~~~---~--~~ 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] Hudson failing again and Lift build failure
Guys, From a fresh github clone im now seeing the following when trying a full build: [WARNING] /Users/timperrett/repositories/lift/lift-framework/lift/src/ main/scala/net/liftweb/http/LiftServlet.scala:302: error: type mismatch; [WARNING] found : java.lang.Object [WARNING] required: net.liftweb.util.Box [net.liftweb.http.LiftResponse] [WARNING] tryo{LiftSession.onEndServicing.foreach(_(liftSession, requestState, ret))} [WARNING] ^ [WARNING] /Users/timperrett/repositories/lift/lift-framework/lift/src/ main/scala/net/liftweb/http/LiftServlet.scala:303: error: type mismatch; [WARNING] found : java.lang.Object [WARNING] required: net.liftweb.util.Box [net.liftweb.http.LiftResponse] [WARNING] ret [WARNING] ^ [WARNING] two errors found Moreover, when I checked hudson to see if that was building ok, i see the following error message when it tried to build: java.io.IOException: Cannot run program rm (in directory /home/ scalatools/hudson/.hudson/jobs/Lift/builds): java.io.IOException: error=24, Too many open files at java.lang.ProcessBuilder.start(ProcessBuilder.java:459) at hudson.Proc$LocalProc.init(Proc.java:132) at hudson.Proc$LocalProc.init(Proc.java:110) at hudson.Proc$LocalProc.init(Proc.java:102) at hudson.Util.createSymlink(Util.java:847) at hudson.model.Run.run(Run.java:921) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:234) at hudson.model.ResourceController.execute(ResourceController.java: 93) at hudson.model.Executor.run(Executor.java:119) Caused by: java.io.IOException: java.io.IOException: error=24, Too many open files at java.lang.UNIXProcess.init(UNIXProcess.java:148) at java.lang.ProcessImpl.start(ProcessImpl.java:65) at java.lang.ProcessBuilder.start(ProcessBuilder.java:452) ... 8 more Checkout (update) Fetching upstream changes [workspace] $ git fetch FATAL: Failed to fetch hudson.plugins.git.GitException: Failed to fetch at hudson.plugins.git.GitAPI.fetch(GitAPI.java:95) at hudson.plugins.git.GitAPI.fetch(GitAPI.java:103) at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:245) at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:235) at hudson.FilePath.act(FilePath.java:552) Cheers, Tim --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Hudson failing again and Lift build failure
Looks like hudson now recognizes the code failure too: http://hudson.scala-tools.org/job/Lift/1075/ Cheers, Tim On Aug 1, 12:24 am, Timothy Perrett timo...@getintheloop.eu wrote: Guys, From a fresh github clone im now seeing the following when trying a full build: [WARNING] /Users/timperrett/repositories/lift/lift-framework/lift/src/ main/scala/net/liftweb/http/LiftServlet.scala:302: error: type mismatch; [WARNING] found : java.lang.Object [WARNING] required: net.liftweb.util.Box [net.liftweb.http.LiftResponse] [WARNING] tryo{LiftSession.onEndServicing.foreach(_(liftSession, requestState, ret))} [WARNING] ^ [WARNING] /Users/timperrett/repositories/lift/lift-framework/lift/src/ main/scala/net/liftweb/http/LiftServlet.scala:303: error: type mismatch; [WARNING] found : java.lang.Object [WARNING] required: net.liftweb.util.Box [net.liftweb.http.LiftResponse] [WARNING] ret [WARNING] ^ [WARNING] two errors found Moreover, when I checked hudson to see if that was building ok, i see the following error message when it tried to build: java.io.IOException: Cannot run program rm (in directory /home/ scalatools/hudson/.hudson/jobs/Lift/builds): java.io.IOException: error=24, Too many open files at java.lang.ProcessBuilder.start(ProcessBuilder.java:459) at hudson.Proc$LocalProc.init(Proc.java:132) at hudson.Proc$LocalProc.init(Proc.java:110) at hudson.Proc$LocalProc.init(Proc.java:102) at hudson.Util.createSymlink(Util.java:847) at hudson.model.Run.run(Run.java:921) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:234) at hudson.model.ResourceController.execute(ResourceController.java: 93) at hudson.model.Executor.run(Executor.java:119) Caused by: java.io.IOException: java.io.IOException: error=24, Too many open files at java.lang.UNIXProcess.init(UNIXProcess.java:148) at java.lang.ProcessImpl.start(ProcessImpl.java:65) at java.lang.ProcessBuilder.start(ProcessBuilder.java:452) ... 8 more Checkout (update) Fetching upstream changes [workspace] $ git fetch FATAL: Failed to fetch hudson.plugins.git.GitException: Failed to fetch at hudson.plugins.git.GitAPI.fetch(GitAPI.java:95) at hudson.plugins.git.GitAPI.fetch(GitAPI.java:103) at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:245) at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:235) at hudson.FilePath.act(FilePath.java:552) Cheers, Tim --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Hudson failing again and Lift build failure
Is it somehow a result of too many open files? What did Derek do last time there was an error of too many open files? - Timothy Perretttimo...@getintheloop.eu wrote: Looks like hudson now recognizes the code failure too: http://hudson.scala-tools.org/job/Lift/1075/ Cheers, Tim On Aug 1, 12:24 am, Timothy Perrett timo...@getintheloop.eu wrote: Guys, From a fresh github clone im now seeing the following when trying a full build: [WARNING] /Users/timperrett/repositories/lift/lift-framework/lift/src/ main/scala/net/liftweb/http/LiftServlet.scala:302: error: type mismatch; [WARNING] found : java.lang.Object [WARNING] required: net.liftweb.util.Box [net.liftweb.http.LiftResponse] [WARNING] tryo{LiftSession.onEndServicing.foreach(_(liftSession, requestState, ret))} [WARNING] ^ [WARNING] /Users/timperrett/repositories/lift/lift-framework/lift/src/ main/scala/net/liftweb/http/LiftServlet.scala:303: error: type mismatch; [WARNING] found : java.lang.Object [WARNING] required: net.liftweb.util.Box [net.liftweb.http.LiftResponse] [WARNING] ret [WARNING] ^ [WARNING] two errors found Moreover, when I checked hudson to see if that was building ok, i see the following error message when it tried to build: java.io.IOException: Cannot run program rm (in directory /home/ scalatools/hudson/.hudson/jobs/Lift/builds): java.io.IOException: error=24, Too many open files at java.lang.ProcessBuilder.start(ProcessBuilder.java:459) at hudson.Proc$LocalProc.init(Proc.java:132) at hudson.Proc$LocalProc.init(Proc.java:110) at hudson.Proc$LocalProc.init(Proc.java:102) at hudson.Util.createSymlink(Util.java:847) at hudson.model.Run.run(Run.java:921) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:234) at hudson.model.ResourceController.execute(ResourceController.java: 93) at hudson.model.Executor.run(Executor.java:119) Caused by: java.io.IOException: java.io.IOException: error=24, Too many open files at java.lang.UNIXProcess.init(UNIXProcess.java:148) at java.lang.ProcessImpl.start(ProcessImpl.java:65) at java.lang.ProcessBuilder.start(ProcessBuilder.java:452) ... 8 more Checkout (update) Fetching upstream changes [workspace] $ git fetch FATAL: Failed to fetch hudson.plugins.git.GitException: Failed to fetch at hudson.plugins.git.GitAPI.fetch(GitAPI.java:95) at hudson.plugins.git.GitAPI.fetch(GitAPI.java:103) at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:245) at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:235) at hudson.FilePath.act(FilePath.java:552) Cheers, Tim --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Hudson failing again and Lift build failure
It's two issues - one is that we have busted code in the lift code base that needs correcting (looking at commits I can't see who changed it)... The other issue is the Hudson box; before the DoS attack we had no problems at all so that to me says it's something different now than compared to before that's causing all these open file handles. Cheers Tim Sent from my iPhone On 1 Aug 2009, at 00:32, Naftoli Gugenheim naftoli...@gmail.com wrote: Is it somehow a result of too many open files? What did Derek do last time there was an error of too many open files? - Timothy Perretttimo...@getintheloop.eu wrote: Looks like hudson now recognizes the code failure too: http://hudson.scala-tools.org/job/Lift/1075/ Cheers, Tim On Aug 1, 12:24 am, Timothy Perrett timo...@getintheloop.eu wrote: Guys, From a fresh github clone im now seeing the following when trying a full build: [WARNING] /Users/timperrett/repositories/lift/lift-framework/lift/ src/ main/scala/net/liftweb/http/LiftServlet.scala:302: error: type mismatch; [WARNING] found : java.lang.Object [WARNING] required: net.liftweb.util.Box [net.liftweb.http.LiftResponse] [WARNING] tryo{LiftSession.onEndServicing.foreach(_(liftSession, requestState, ret))} [WARNING] ^ [WARNING] /Users/timperrett/repositories/lift/lift-framework/lift/ src/ main/scala/net/liftweb/http/LiftServlet.scala:303: error: type mismatch; [WARNING] found : java.lang.Object [WARNING] required: net.liftweb.util.Box [net.liftweb.http.LiftResponse] [WARNING] ret [WARNING] ^ [WARNING] two errors found Moreover, when I checked hudson to see if that was building ok, i see the following error message when it tried to build: java.io.IOException: Cannot run program rm (in directory /home/ scalatools/hudson/.hudson/jobs/Lift/builds): java.io.IOException: error=24, Too many open files at java.lang.ProcessBuilder.start(ProcessBuilder.java:459) at hudson.Proc$LocalProc.init(Proc.java:132) at hudson.Proc$LocalProc.init(Proc.java:110) at hudson.Proc$LocalProc.init(Proc.java:102) at hudson.Util.createSymlink(Util.java:847) at hudson.model.Run.run(Run.java:921) at hudson.maven.MavenModuleSetBuild.run (MavenModuleSetBuild.java:234) at hudson.model.ResourceController.execute (ResourceController.java: 93) at hudson.model.Executor.run(Executor.java:119) Caused by: java.io.IOException: java.io.IOException: error=24, Too many open files at java.lang.UNIXProcess.init(UNIXProcess.java:148) at java.lang.ProcessImpl.start(ProcessImpl.java:65) at java.lang.ProcessBuilder.start(ProcessBuilder.java:452) ... 8 more Checkout (update) Fetching upstream changes [workspace] $ git fetch FATAL: Failed to fetch hudson.plugins.git.GitException: Failed to fetch at hudson.plugins.git.GitAPI.fetch(GitAPI.java:95) at hudson.plugins.git.GitAPI.fetch(GitAPI.java:103) at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:245) at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:235) at hudson.FilePath.act(FilePath.java:552) Cheers, Tim --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Hudson failing again and Lift build failure
On Fri, Jul 31, 2009 at 4:36 PM, Timothy Perrett timo...@getintheloop.euwrote: It's two issues - one is that we have busted code in the lift code base that needs correcting (looking at commits I can't see who changed it)... The other issue is the Hudson box; before the DoS attack we had no problems at all so that to me says it's something different now than compared to before that's causing all these open file handles. I've fixed the broken build. Josh will be upgrading Hudson (and perhaps adding a cron job to restart it daily) Cheers Tim Sent from my iPhone On 1 Aug 2009, at 00:32, Naftoli Gugenheim naftoli...@gmail.com wrote: Is it somehow a result of too many open files? What did Derek do last time there was an error of too many open files? - Timothy Perretttimo...@getintheloop.eu wrote: Looks like hudson now recognizes the code failure too: http://hudson.scala-tools.org/job/Lift/1075/ Cheers, Tim On Aug 1, 12:24 am, Timothy Perrett timo...@getintheloop.eu wrote: Guys, From a fresh github clone im now seeing the following when trying a full build: [WARNING] /Users/timperrett/repositories/lift/lift-framework/lift/ src/ main/scala/net/liftweb/http/LiftServlet.scala:302: error: type mismatch; [WARNING] found : java.lang.Object [WARNING] required: net.liftweb.util.Box [net.liftweb.http.LiftResponse] [WARNING] tryo{LiftSession.onEndServicing.foreach(_(liftSession, requestState, ret))} [WARNING] ^ [WARNING] /Users/timperrett/repositories/lift/lift-framework/lift/ src/ main/scala/net/liftweb/http/LiftServlet.scala:303: error: type mismatch; [WARNING] found : java.lang.Object [WARNING] required: net.liftweb.util.Box [net.liftweb.http.LiftResponse] [WARNING] ret [WARNING] ^ [WARNING] two errors found Moreover, when I checked hudson to see if that was building ok, i see the following error message when it tried to build: java.io.IOException: Cannot run program rm (in directory /home/ scalatools/hudson/.hudson/jobs/Lift/builds): java.io.IOException: error=24, Too many open files at java.lang.ProcessBuilder.start(ProcessBuilder.java:459) at hudson.Proc$LocalProc.init(Proc.java:132) at hudson.Proc$LocalProc.init(Proc.java:110) at hudson.Proc$LocalProc.init(Proc.java:102) at hudson.Util.createSymlink(Util.java:847) at hudson.model.Run.run(Run.java:921) at hudson.maven.MavenModuleSetBuild.run (MavenModuleSetBuild.java:234) at hudson.model.ResourceController.execute (ResourceController.java: 93) at hudson.model.Executor.run(Executor.java:119) Caused by: java.io.IOException: java.io.IOException: error=24, Too many open files at java.lang.UNIXProcess.init(UNIXProcess.java:148) at java.lang.ProcessImpl.start(ProcessImpl.java:65) at java.lang.ProcessBuilder.start(ProcessBuilder.java:452) ... 8 more Checkout (update) Fetching upstream changes [workspace] $ git fetch FATAL: Failed to fetch hudson.plugins.git.GitException: Failed to fetch at hudson.plugins.git.GitAPI.fetch(GitAPI.java:95) at hudson.plugins.git.GitAPI.fetch(GitAPI.java:103) at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:245) at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:235) at hudson.FilePath.act(FilePath.java:552) Cheers, Tim -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---