[Lift] Re: Writing data to the HttpServletResponse

2009-01-11 Thread Alli
Cheers Tim, will definately do that On Jan 12, 12:15 am, Tim Perrett wrote: > If you decide to make a component, check out lift-widgets for other > examples of UI widgets (components in lift terminology) > > http://github.com/dpp/liftweb/tree/master/lift-widgets > > Cheers, Tim > > On Jan 11, 11

[Lift] Re: Replacing a NodeSeq (further explanation)

2009-01-11 Thread Charles F. Munat
Essentially, the problem I am having, I think, is that SetHtml hard codes the HTML that will replace the current HTML. I need to use the HTML returned from the AJAX call to replace the current HTML. So I don't think SetHtml is going to work. Does this make more sense? Am I on the right track?

[Lift] Re: Redirects/new site

2009-01-11 Thread Charles F. Munat
That's good to know. Thanks! Chas. Tim Perrett wrote: > You do gain portability I agree - it just depends on your setup as to > whats best for you, if that means doing the rewrites in lift, then go > for it :-) > > FYI, rewrites with jetty are done like so: > > http://docs.codehaus.org/display

[Lift] Re: Replacing a NodeSeq

2009-01-11 Thread Charles F. Munat
Yeah, I found this and have been playing with it, but am sort of stuck. What I'm doing looks something like this (but is much more complicated): def getForm: NodeSeq = { val widgets = [List(id,name) of unused widgets] if (widgets.isEmpty) All widgets are in use. else SHtml.aj

[Lift] Re: Writing data to the HttpServletResponse

2009-01-11 Thread Tim Perrett
If you decide to make a component, check out lift-widgets for other examples of UI widgets (components in lift terminology) http://github.com/dpp/liftweb/tree/master/lift-widgets Cheers, Tim On Jan 11, 11:57 pm, Alli wrote: > I will show it to you once it's ready. I'm having some problems with

[Lift] Re: Redirects/new site

2009-01-11 Thread Tim Perrett
You do gain portability I agree - it just depends on your setup as to whats best for you, if that means doing the rewrites in lift, then go for it :-) FYI, rewrites with jetty are done like so: http://docs.codehaus.org/display/JETTY/RewriteHandler Cheers, Tim On Jan 11, 7:00 pm, "Charles F. Mu

[Lift] Re: Writing data to the HttpServletResponse

2009-01-11 Thread Alli
I will show it to you once it's ready. I'm having some problems with swfupload (not due to lift), it's my inexperience with flash and javascript. I'll let you know once I get this all sorted out. Once I get this sorted it's tempting to make some kind of plugin (component) as I'm gonna be using swf

[Lift] Re: Replacing a NodeSeq

2009-01-11 Thread David Pollak
SetHtml(id: String, stuff: NodeSeq) It's a JsCmd and it replaces the contents of the Elem with the give id on the page with stuff. Is this what you were looking for? On Sun, Jan 11, 2009 at 2:58 PM, Charles F. Munat wrote: > > Is there a JsCmd for replacing a NodeSeq? I want an AJAX button to r

[Lift] Replacing a NodeSeq

2009-01-11 Thread Charles F. Munat
Is there a JsCmd for replacing a NodeSeq? I want an AJAX button to run some code on the server, generate a NodeSeq, and then replace the similar NodeSeq on the page. I'm looking through the commands and I don't see how to do that, except to use Run and then JQuery... Am I missing something? Th

[Lift] Re: Writing data to the HttpServletResponse

2009-01-11 Thread David Pollak
Sure thing. Is your app public? I love to see what people have done with Lift... On Sun, Jan 11, 2009 at 8:47 AM, Alli wrote: > > Thanks chaps, that did the trick. > > Cheers, > Alfred > > On Jan 11, 3:25 pm, Marius wrote: > > Ummm ... Does it really need to return a DispatchPf? It could cre

[Lift] Re: Writing data to the HttpServletResponse

2009-01-11 Thread Alli
Thanks chaps, that did the trick. Cheers, Alfred On Jan 11, 3:25 pm, Marius wrote: > Ummm ... Does it really need to return a DispatchPf? It could create > internally the DispatchPF as just append it to LiftRules dispatch > list. > > On Jan 11, 5:09 pm, "David Pollak" > wrote: > > > I think so

[Lift] Re: Writing data to the HttpServletResponse

2009-01-11 Thread David Pollak
On Sun, Jan 11, 2009 at 7:25 AM, Marius wrote: > > Ummm ... Does it really need to return a DispatchPf? It could create > internally the DispatchPF as just append it to LiftRules dispatch > list. > It's a slippery slope into mutable state. If the calls that actually mutate state are limited, li

[Lift] Re: Writing data to the HttpServletResponse

2009-01-11 Thread Marius
dispatch is a RulesSeq so you can either append or prepend. I used the term loosely though. On Jan 11, 9:05 pm, "Charles F. Munat" wrote: > Isn't prependDispatch now dispatch.prepend? > > Tim Perrett wrote: > > Alli, > > > Mark is correct - I'd create a LiftResponse sublass and handle that > > r

[Lift] Re: Writing data to the HttpServletResponse

2009-01-11 Thread Charles F. Munat
Isn't prependDispatch now dispatch.prepend? Tim Perrett wrote: > Alli, > > Mark is correct - I'd create a LiftResponse sublass and handle that > request with a DispatchPF. If your not familiar, check out > prependDispatch in Boot.scala of the demo site. > > If you can supply a bit more informat

[Lift] Re: Redirects/new site

2009-01-11 Thread Charles F. Munat
Yeah, I was thinking about this, but I have no idea how to do that in Jetty. And then if I move to another servlet container, I have to figure it out all over again. The more I work in Lift, the easier and more portable it is. Chas. Tim Perrett wrote: > Chas, > > Can you not just do the norm

[Lift] Re: Writing data to the HttpServletResponse

2009-01-11 Thread Marius
Ummm ... Does it really need to return a DispatchPf? It could create internally the DispatchPF as just append it to LiftRules dispatch list. On Jan 11, 5:09 pm, "David Pollak" wrote: > I think something like: > createFileHandler(path: List[String], nameOfFileParam: String, > returnContentType: S

[Lift] Re: Writing data to the HttpServletResponse

2009-01-11 Thread David Pollak
I think something like: createFileHandler(path: List[String], nameOfFileParam: String, returnContentType: String)(f: Array[Byte] => Array[Byte]): DispatchPF would be a cool method. It would build the DispatchPF for you and all you need do is supply the transformation function. If you wanted to g

[Lift] Re: Writing data to the HttpServletResponse

2009-01-11 Thread Marius
I wonder if it makes sense to have a built-in DispatchPF to ease up things so that user to just provide a (FileParamHolder => LiftResponse) perhaps something like: FIleUploader.init { case (path, fileParamHolder ) => a LiftResponse } ... internally it will just add itsellf as a DispathPf B

[Lift] Re: Writing data to the HttpServletResponse

2009-01-11 Thread David Pollak
Alli, Yes, I think your want to go with a DispatchPF to handle the destination of the POST request from your Flash component. DispatchPF { case r @ Req("upload" :: "thing" :: Nil, "", PostRequent) if r.uploadedFiles.exists(_.name == "upload") => () => { val uploadedFile = r.uploadedFiles

[Lift] Re: Redirects/new site

2009-01-11 Thread David Pollak
Charles, I'd do a DispatchPF... pseudo-code: val oldToNew: Map[String, String] = Map() DispatchPF { case Req(path, _, _) if oldToNew.contains(path.mkString("/", "/", "")) => RedirectResponse(path.mkString("/", "/", "")) } On Sat, Jan 10, 2009 at 12:48 PM, Charles F. Munat wrote: > > I ha

[Lift] Re: Writing data to the HttpServletResponse

2009-01-11 Thread Alli
I'm not sure how i would hook SHtml.fileUpload into this because swfupload lets me configure an URL that it will post to for each file uploaded, I don't even need a form to do this (this is all flash/swf). I currently have a LiftView subclass that handles it and is processing it like this: S.req

[Lift] Re: Writing data to the HttpServletResponse

2009-01-11 Thread Marius
Alli are you using SHtml.fileUpload ... or you want to upload it "manually" processing everything in your dispatch? .. I'd opt in for SHtml.fileUpload because there is a bunch of stuff Lift does for you. On Jan 11, 5:12 am, Alli wrote: > Yeah I think I need to add a custom dispatch function and

[Lift] Re: Writing data to the HttpServletResponse

2009-01-11 Thread Alli
Yeah I think I need to add a custom dispatch function and make that return my own response. I was actually hoping I could do this straight from the snippet instead of having to redirect, makes the whole thing more complex. On Jan 11, 12:41 am, Marc Boschma wrote: > I'm not an expert but I would

[Lift] Re: Writing data to the HttpServletResponse

2009-01-11 Thread Alli
Thanks guys, that's very helpful. What I'm doing is using swfupload to let the user upload one or more images (png, gif, jpg etc.). Then I'm gonna resize them and send them back to the user. This is what I guess I'll have to do: 1) Subclass LiftResponse to send the appropriate headers (content-

[Lift] Re: Writing data to the HttpServletResponse

2009-01-11 Thread Marius
If your using SHtml.fileUpload after you process your file you can send a redirect back by calling S.redirectTo ... towards a path where you just download your processed file. Note that from your upload function you can not really return a LiftResponse since the function result is an Any ignored b

[Lift] Re: Writing data to the HttpServletResponse

2009-01-11 Thread Tim Perrett
Alli, Mark is correct - I'd create a LiftResponse sublass and handle that request with a DispatchPF. If your not familiar, check out prependDispatch in Boot.scala of the demo site. If you can supply a bit more information about what exacty you want to do (I'm guessing you want to force downlod a

[Lift] Re: Redirects/new site

2009-01-11 Thread Tim Perrett
Chas, Can you not just do the normal thing and use front end web server rewriting? I don't think you need to bother altering your lift application as having the rewiting in the application adds no more value right? Cheers Tim On Jan 10, 8:48 pm, "Charles F. Munat" wrote: > I have a new Lift s

[Lift] Re: Swampland

2009-01-11 Thread Viktor Klang
I've used FogBugz and Mantis, and here are my conclusions for a good issue-tracker: 1) Good integration possibilities (API:s to hook into, different VCS-backends etc) 2) Clean and intuitive UI 3) A priority list is NOT a list with items with different priority levels!!! A priority list is a li