[Lift] Write javascript code in the Snippet ?

2009-11-07 Thread Neil.Lv

Hi all,

  Is there a easy way to write javascript code (dynamic for caculating
flashvars )in the Snippet ?

  To write javascript code directly just like the raw js code and
merge it into the head tag .

Cheers,
  Neil
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Flash can't displayed in Firefox ?

2009-11-07 Thread Neil.Lv


 It works well in the firefox, but not in IE.
 Result:
swfobject.embedSWF("/flash/test.swf", "myContent",
"300", "120", "9.0.0",
"expressInstall.swf");
###
 "flash" -> Text("""swfobject.embedSWF("/flash/test.swf", "myContent",
"300", "120", "9.0.0", "expressInstall.swf");"""),
###

It works well in Both of them.
###
var flashSrc = "/flash/test.swf"
"flash" -> Text("swfobject.embedSWF('" + {flashSrc} + "', 'myContent',
'300', '120', '9.0.0', 'expressInstall.swf');"),
###

Cheers,
  Neil



On Nov 8, 1:25 pm, "Neil.Lv"  wrote:
>   I use this code to achieve the purpose.
>
>   Maybe there is some another better way to do it.
>
> ###
> 
> 
>         
>         
>                 
>                         
>                 
>         
> 
> ###
> class HelloWorld {
>   lazy val date: Box[Date] = DependencyFactory.inject[Date] // inject
> the date
>
>   def howdy(in: NodeSeq): NodeSeq =
>   Helpers.bind("b", in, "time" -> date.map(d => Text(d.toString)))
>
>   var flashSrc = "/flash/test.swf"
>   def initFlash(in: NodeSeq) : NodeSeq = {
>         bind("init", in,
>          "flash" -> Text("""swfobject.embedSWF({flashSrc}, "myContent",
> "300", "120", "9.0.0", "expressInstall.swf");""")
>         )
>   }
>
> }
>
> ###
>
> Cheers,
>   Neil
>
> On Nov 8, 12:56 pm, "Neil.Lv"  wrote:
>
> > Tim,
>
> >   How can i use the lift to generate the dynamic flashvars ?  In the
> > snippet ?
>
> >   In the rails we can use the <%= %> to get the value that from the
> > server.
>
> > Cheers,
> >   Neil
>
> > On Nov 8, 12:48 pm, "Neil.Lv"  wrote:
>
> > >   Thank you very much!
>
> > >   This is very cool!  :)
>
> > > Cheers,
> > >   Neil
>
> > > On Nov 8, 2:52 am, Timothy Perrett  wrote:
>
> > > > Looks to me like a javascript issue - if your rendering flash, use  
> > > > swfobject:
>
> > > >http://code.google.com/p/swfobject/
>
> > > > Cheers, Tim
>
> > > > On 7 Nov 2009, at 18:49, Neil.Lv wrote:
>
> > > > > Hi all,
>
> > > > >  I have a silly question about the embeded flash in the Firefox .
>
> > > > >  The code like this (in the main/webapp/index.html page), and i added
> > > > > the
> > > > >   /*  */
> > > > > 
> > > > > ###
>
> > > > >   Thanks for any suggestion !
>
> > > > > Cheers,
> > > > >  Neil
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Flash can't displayed in Firefox ?

2009-11-07 Thread Neil.Lv


  I use this code to achieve the purpose.

  Maybe there is some another better way to do it.

###









###
class HelloWorld {
  lazy val date: Box[Date] = DependencyFactory.inject[Date] // inject
the date

  def howdy(in: NodeSeq): NodeSeq =
  Helpers.bind("b", in, "time" -> date.map(d => Text(d.toString)))

  var flashSrc = "/flash/test.swf"
  def initFlash(in: NodeSeq) : NodeSeq = {
bind("init", in,
 "flash" -> Text("""swfobject.embedSWF({flashSrc}, "myContent",
"300", "120", "9.0.0", "expressInstall.swf");""")
)
  }

}
###

Cheers,
  Neil

On Nov 8, 12:56 pm, "Neil.Lv"  wrote:
> Tim,
>
>   How can i use the lift to generate the dynamic flashvars ?  In the
> snippet ?
>
>   In the rails we can use the <%= %> to get the value that from the
> server.
>
> Cheers,
>   Neil
>
> On Nov 8, 12:48 pm, "Neil.Lv"  wrote:
>
> >   Thank you very much!
>
> >   This is very cool!  :)
>
> > Cheers,
> >   Neil
>
> > On Nov 8, 2:52 am, Timothy Perrett  wrote:
>
> > > Looks to me like a javascript issue - if your rendering flash, use  
> > > swfobject:
>
> > >http://code.google.com/p/swfobject/
>
> > > Cheers, Tim
>
> > > On 7 Nov 2009, at 18:49, Neil.Lv wrote:
>
> > > > Hi all,
>
> > > >  I have a silly question about the embeded flash in the Firefox .
>
> > > >  The code like this (in the main/webapp/index.html page), and i added
> > > > the
> > > >   /*  */
> > > > 
> > > > ###
>
> > > >   Thanks for any suggestion !
>
> > > > Cheers,
> > > >  Neil
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Flash can't displayed in Firefox ?

2009-11-07 Thread Neil.Lv

Tim,

  How can i use the lift to generate the dynamic flashvars ?  In the
snippet ?

  In the rails we can use the <%= %> to get the value that from the
server.

Cheers,
  Neil

On Nov 8, 12:48 pm, "Neil.Lv"  wrote:
>   Thank you very much!
>
>   This is very cool!  :)
>
> Cheers,
>   Neil
>
> On Nov 8, 2:52 am, Timothy Perrett  wrote:
>
> > Looks to me like a javascript issue - if your rendering flash, use  
> > swfobject:
>
> >http://code.google.com/p/swfobject/
>
> > Cheers, Tim
>
> > On 7 Nov 2009, at 18:49, Neil.Lv wrote:
>
> > > Hi all,
>
> > >  I have a silly question about the embeded flash in the Firefox .
>
> > >  The code like this (in the main/webapp/index.html page), and i added
> > > the
> > >   /*  */
> > > 
> > > ###
>
> > >   Thanks for any suggestion !
>
> > > Cheers,
> > >  Neil
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Flash can't displayed in Firefox ?

2009-11-07 Thread Neil.Lv

  Thank you very much!

  This is very cool!  :)

Cheers,
  Neil

On Nov 8, 2:52 am, Timothy Perrett  wrote:
> Looks to me like a javascript issue - if your rendering flash, use  
> swfobject:
>
> http://code.google.com/p/swfobject/
>
> Cheers, Tim
>
> On 7 Nov 2009, at 18:49, Neil.Lv wrote:
>
>
>
> > Hi all,
>
> >  I have a silly question about the embeded flash in the Firefox .
>
> >  The code like this (in the main/webapp/index.html page), and i added
> > the
> >   /*  */
> > 
> > ###
>
> >   Thanks for any suggestion !
>
> > Cheers,
> >  Neil
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Select multiple values

2009-11-07 Thread suls

Hi,

How can I access all the selected values from a select box? I am using
the following code to generate the select box itself:

"availableManagers"-> SHtml.selectObj[User](
  User.findAvailableManagers.map(v => (v,
v.email)),
  Empty,
  selected => Log.info(selected),
  "multiple" -> "multiple",
  "title" -> "Click to assign managers to this
fund")

Is it possible to iterate over all selected options in the  selected
=>  bit?
Any pointers how to solve this using different ways?

Cheers, suls

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: A little emacs help please

2009-11-07 Thread Derek Williams
On Sat, Nov 7, 2009 at 3:29 PM, Marius  wrote:

> > (add-hook 'scala-mode-hook
> >   '(lambda ()
> >  (yas/minor-mode-on)
>

Not sure if this is just an incomplete copy/paste, but looks like you are
missing some closing parenthesis there

-- 
Derek Williams

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: A little emacs help please

2009-11-07 Thread Ross Mellgren

Looks like you're missing two close parens at the end of file  
(matching add-hook and lambda)

-Ross

On Nov 7, 2009, at 5:29 PM, Marius wrote:

>
> Ok I got the answer for #2 and #3.
>
> For #1 I'm still not sure what it complains about but it seems to work
> though. ALso sometime the Yasnippet menu is disappearing or when
> clicking it, it has no sub-menus ... weird.
>
> Br's
> Marius
>
> On Nov 7, 11:20 pm, Marius  wrote:
>> Hi,
>>
>> Today I got real frustrated with Eclipse scala plugin (2.7.7) on
>> Ubuntu 9.10. Out of the sudden it interprets reads Scala files as  
>> Java
>> source ... I tried disabling the JDT weaver, I disabled it, but
>> nothing the same thing.
>>
>> Ok ... time to try emacs .. which I'm starting to like more and more.
>>
>> A couple of questions.
>>
>> 1. My .emacs looks like:
>>
>> (setq inhibit-splash-screen t)
>>
>> (setq x-select-enable-clipboard t) ;
>>  (setq interprogram-paste-function 'x-cut-buffer-or-selection-value)
>>
>> (add-to-list 'load-path "~/.emacs.d/plugins/scala-mode")
>>
>> (add-to-list 'load-path "~/.emacs.d/plugins/yasnippet-0.6.1c")
>> (require 'yasnippet) ;; not yasnippet-bundle
>> (yas/initialize)
>> (yas/load-directory "~/.emacs.d/plugins/yasnippet-0.6.1c/
>> snippets")
>>
>> (require 'scala-mode-auto)
>>
>> (add-hook 'scala-mode-hook
>>   '(lambda ()
>>  (yas/minor-mode-on)
>>
>> But at startup I'm getting this:
>>
>> "An error has occurred while loading `/home/marius/.emacs':
>> End of file during parsing: /home/marius/.emacs"
>>
>> If I use --debug-init I'm njot getting much info. Even with this
>> yasnippet seems to work fine and scala syntax highlight works ok
>>
>> 2.  Are there any shortcuts to put scala snippets in the code?.. I  
>> can
>> put them from the scala-mode menu but a shortcut would be nice
>>
>> 3. What do you use for continuous compilation?
>>
>> I know there has been previous talks around this but please bear with
>> me :)
>>
>> Br's,
>> Marius
> >


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: A little emacs help please

2009-11-07 Thread Marius

Ok I got the answer for #2 and #3.

For #1 I'm still not sure what it complains about but it seems to work
though. ALso sometime the Yasnippet menu is disappearing or when
clicking it, it has no sub-menus ... weird.

Br's
Marius

On Nov 7, 11:20 pm, Marius  wrote:
> Hi,
>
> Today I got real frustrated with Eclipse scala plugin (2.7.7) on
> Ubuntu 9.10. Out of the sudden it interprets reads Scala files as Java
> source ... I tried disabling the JDT weaver, I disabled it, but
> nothing the same thing.
>
> Ok ... time to try emacs .. which I'm starting to like more and more.
>
> A couple of questions.
>
> 1. My .emacs looks like:
>
> (setq inhibit-splash-screen t)
>
> (setq x-select-enable-clipboard t) ;
>  (setq interprogram-paste-function 'x-cut-buffer-or-selection-value)
>
> (add-to-list 'load-path "~/.emacs.d/plugins/scala-mode")
>
> (add-to-list 'load-path "~/.emacs.d/plugins/yasnippet-0.6.1c")
>     (require 'yasnippet) ;; not yasnippet-bundle
>     (yas/initialize)
>     (yas/load-directory "~/.emacs.d/plugins/yasnippet-0.6.1c/
> snippets")
>
> (require 'scala-mode-auto)
>
> (add-hook 'scala-mode-hook
>           '(lambda ()
>              (yas/minor-mode-on)
>
> But at startup I'm getting this:
>
> "An error has occurred while loading `/home/marius/.emacs':
> End of file during parsing: /home/marius/.emacs"
>
> If I use --debug-init I'm njot getting much info. Even with this
> yasnippet seems to work fine and scala syntax highlight works ok
>
> 2.  Are there any shortcuts to put scala snippets in the code?.. I can
> put them from the scala-mode menu but a shortcut would be nice
>
> 3. What do you use for continuous compilation?
>
> I know there has been previous talks around this but please bear with
> me :)
>
> Br's,
> Marius
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] A little emacs help please

2009-11-07 Thread Marius

Hi,

Today I got real frustrated with Eclipse scala plugin (2.7.7) on
Ubuntu 9.10. Out of the sudden it interprets reads Scala files as Java
source ... I tried disabling the JDT weaver, I disabled it, but
nothing the same thing.

Ok ... time to try emacs .. which I'm starting to like more and more.

A couple of questions.

1. My .emacs looks like:

(setq inhibit-splash-screen t)

(setq x-select-enable-clipboard t) ;
 (setq interprogram-paste-function 'x-cut-buffer-or-selection-value)

(add-to-list 'load-path "~/.emacs.d/plugins/scala-mode")

(add-to-list 'load-path "~/.emacs.d/plugins/yasnippet-0.6.1c")
(require 'yasnippet) ;; not yasnippet-bundle
(yas/initialize)
(yas/load-directory "~/.emacs.d/plugins/yasnippet-0.6.1c/
snippets")

(require 'scala-mode-auto)

(add-hook 'scala-mode-hook
  '(lambda ()
 (yas/minor-mode-on)

But at startup I'm getting this:

"An error has occurred while loading `/home/marius/.emacs':
End of file during parsing: /home/marius/.emacs"

If I use --debug-init I'm njot getting much info. Even with this
yasnippet seems to work fine and scala syntax highlight works ok

2.  Are there any shortcuts to put scala snippets in the code?.. I can
put them from the scala-mode menu but a shortcut would be nice

3. What do you use for continuous compilation?

I know there has been previous talks around this but please bear with
me :)

Br's,
Marius
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Flash can't displayed in Firefox ?

2009-11-07 Thread Timothy Perrett

Looks to me like a javascript issue - if your rendering flash, use  
swfobject:

http://code.google.com/p/swfobject/

Cheers, Tim


On 7 Nov 2009, at 18:49, Neil.Lv wrote:

>
> Hi all,
>
>  I have a silly question about the embeded flash in the Firefox .
>
>  The code like this (in the main/webapp/index.html page), and i added
> the
>   /*  */
> 
> ###
>
>   Thanks for any suggestion !
>
> Cheers,
>  Neil
> >
>


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: lift-wizard progress?

2009-11-07 Thread Timothy Perrett

Actually, just one other thing about this - sounds a bit like a  
workflow engine (to a degree its a specialised one) but JBoss Drools  
Flow has some interesting ideas in this area if your looking for some  
inspiration :-)

Cheers, Tim

On 7 Nov 2009, at 15:02, David Pollak wrote:

> Basically, I'm separating the field logic/flow logic from any UI.   
> This will allow for automated testing of the wizards without a front  
> end (and if you trust the wizard state <-> UI translation, then  
> there's no need to test the stuff in a browser).


--~--~-~--~~~---~--~~
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] Flash can't displayed in Firefox ?

2009-11-07 Thread Neil.Lv

Hi all,

  I have a silly question about the embeded flash in the Firefox .

  The code like this (in the main/webapp/index.html page), and i added
the
   /*  */

###

   Thanks for any suggestion !

Cheers,
  Neil
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Build Broken?

2009-11-07 Thread Joni Freeman

Thanks for the test results. It looked like a charset problem in unit
test. I changed the assertion in test to use more robust case class
comparison instead of String comparison. Please let us know if this
fixes the build on your machine.

Committers, I pushed this small fix directly into master, skipping
Review Board. Please let me know if this is not allowed even if the
change is very small and just for unit tests.

Cheers Joni


On 7 marras, 07:22, aw  wrote:
> OK, found Hudson:  http://hudson.scala-tools.org/job/Lift/
>
> But now if that isn't broken, why is my fresh clone failing?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Problem with BlazeDS and LiftFilter 1.0+

2009-11-07 Thread oshyshko

Removing BlazeDS servlet from LiftFilter coverage is a bad idea:
If it is done so, lift-mapper creates separate transactions for all
operations.

http://groups.google.com/group/liftweb/browse_thread/thread/e2c0dd2c5dcc458b

This means LiftFilter and BlazeDS servlet should become friends.

"LiftRules.passNotFoundToChain = true" is in my Boot.scala. The
response is:

HTTP/1.1 200 OK
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Set-Cookie: JSESSIONID=1a8mg0498vrwd;Path=/
Content-Length: 0
Server: Jetty(6.1.21)


Note: if I remove LiftFilter, the servlet works fine.

Any ideas how to make LiftFilter not to intrude into BlazeDS deeds?

On Oct 31, 2:19 pm, Timothy Perrett  wrote:
> You needed to specify the passNotFoundToChain var, thats why you were
> getting the 404 originally - as you detail, its not needed to
> explicitly set the /messagebroker URL in your web.xml.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Database transactions with Mapper

2009-11-07 Thread oshyshko

I have found the problem.

This is what I have in web.xml:

LiftFilter
*.html


By default it should be like this:


LiftFilter
/*


"S.addAround(DB.buildLoanWrapper)" does work, if the request path is
covered by LiftFilter.
And it does not work, if not covered (my case) -- in this case it will
create separate transactions.

So its okay.


Now I see thatreal problem is because I use BlazeDS servet which
should not be covered by LiftFilter. I wrote about it:
http://groups.google.com/group/liftweb/browse_thread/thread/33a4d1d111f54ef0/ea4c08393ce76c1d
Looks like the old problem has reappeared in a new place.


On Nov 7, 5:10 pm, David Pollak  wrote:
> On Fri, Nov 6, 2009 at 10:14 PM, oshyshko  wrote:
>
> > Looks like "S.addAround(DB.buildLoanWrapper)" has no effect.
>
> What code are you using to make the query?
>
> Please create a fully running example (making a GitHub project is the best
> way to do this) so that I can see exactly what is happening.

--~--~-~--~~~---~--~~
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: Removing entities from DB after X mins...

2009-11-07 Thread Emil

Thanks!

this pointed me in the right direction, I think. Adding a LiftActor
that removes my Peer entity to sessionWatchers would solve part of the
problem I suppose. However, a corner case is when a single peer
changes it's ip for some reason and connects from the new IP address.
This would create a new session. I suppose I could create an actor
that gets a message each time a peer connects and if it doesn't
connect in time deletes the peer...

Would using thin approach be a good idea? Should the PeerMonitorActor
hook up to some Watcher that can restart it (similar to the Supervisor
behaviour in Erlang/OTP)? Is there any documentation on how to use
actors in lift? Should I write something on it? I'm sure the issue of
removing database entries unless something happens within a timeperiod
is a pretty common use case (e.g. registering an account on a site).

Cheers,
  Emil

On Nov 6, 5:45 pm, David Pollak  wrote:
> On Fri, Nov 6, 2009 at 1:15 AM, Emil  wrote:
>
> > Hi!
>
> > For fun I have started to develop a very basic bittorrent tracker
> > using Lift while I'm on parental leave. So far so good, it manages to
> > share peer information and I can upload/download and search for
> > torrent files.
>
> > However, if a peer stop their client ungracefully and a stop event is
> > not sent to my tracker the peer will continue to appear as connected.
> > I think I read somewhere that it is possible to add a delete method
> > that is run after X amount of time, but I don't remember where. Is
> > this possible using some built-in feature of vanilla Lift? If so,
> > anyone got a short how-to?
>
> This is probably more elaborate than you want, but it's how Lift manages
> sessions.  You can find the code in LiftSession.scala:
>
> private[http] case class AddSession(session: LiftSession)
> private[http] case class RemoveSession(sessionId: String)
> case class SessionWatcherInfo(sessions: Map[String, LiftSession])
>
> /**
>  * Manages LiftSessions because the servlet container is less than optimal
> at
>  * timing sessions out.
>  */
> object SessionMaster extends LiftActor {
>   private var sessions: Map[String, LiftSession] = Map.empty
>   private object CheckAndPurge
>
>   def getSession(id: String, otherId: Box[String]): Box[LiftSession] =
> synchronized {
>     otherId.flatMap(sessions.get) or Box(sessions.get(id))
>   }
>
>   /**
>    * Put an Actor in this list and the Actor will receive a message
>    * every 10 seconds with the current list of sessions:
>    * SessionWatcherInfo
>    */
>   @volatile var sessionWatchers: List[LiftActor] = Nil
>
>   /**
>    * Returns a LiftSession or Empty if not found
>    */
>   def getSession(httpSession: => HTTPSession, otherId: Box[String]):
> Box[LiftSession] =
>     synchronized {
>       otherId.flatMap(sessions.get) or
> Box(sessions.get(httpSession.sessionId))
>     }
>
>   /**
>    * Returns a LiftSession or Empty if not found
>    */
>   def getSession(req: HTTPRequest, otherId: Box[String]): Box[LiftSession] =
>     synchronized {
>       otherId.flatMap(sessions.get) or
> Box(sessions.get(req.session.sessionId))
>     }
>
>   /**
>    * Adds a new session to SessionMaster
>    */
>   def addSession(liftSession: LiftSession) {
>     synchronized {
>       sessions = sessions + (liftSession.uniqueId -> liftSession)
>     }
>     liftSession.startSession()
>     liftSession.httpSession.foreach(_.link(liftSession))
>   }
>
>   protected def messageHandler = reaction
>
>   private val reaction: PartialFunction[Any, Unit] = {
>     case RemoveSession(sessionId) =>
>       val ses = synchronized(sessions)
>       ses.get(sessionId).foreach {
>         s =>
>                 try {
>                   s.doShutDown
>                   try {
>                     s.httpSession.foreach(_.unlink(s))
>                   } catch {
>                     case e => // ignore... sometimes you can't do this and
> it's okay
>                   }
>                 } catch {
>                   case e => Log.error("Failure in remove session", e)
>
>                 } finally {
>                   synchronized {sessions = sessions - sessionId}
>                 }
>       }
>
>     case CheckAndPurge =>
>       val now = millis
>       val ses = synchronized {sessions}
>       for ((id, session) <- ses.elements) {
>         session.doCometActorCleanup()
>         if (now - session.lastServiceTime > session.inactivityLength ||
> session.markedForTermination) {
>           Log.info(" Session " + id + " expired")
>           this.sendMsg(RemoveSession(id))
>         } else {
>           session.cleanupUnseenFuncs()
>         }
>       }
>       if (!Props.inGAE) {
>         sessionWatchers.foreach(_ ! SessionWatcherInfo(ses))
>         doPing()
>       }
>   }
>
>   private[http] def sendMsg(in: Any): Unit =
>     if (!Props.inGAE) this ! in
>     else {
>       this.synchronized {
>         tryo {
>           if (reaction.isDefinedAt(in)) reaction.apply(in)
>         }
>       }
>     }
>
>

[Lift] Re: lift-wizard progress?

2009-11-07 Thread Timothy Perrett



On Nov 7, 3:02 pm, David Pollak  wrote:
> Basically, I'm separating the field logic/flow logic from any UI.  This will
> allow for automated testing of the wizards without a front end (and if you
> trust the wizard state <-> UI translation, then there's no need to test the
> stuff in a browser).

Sounds interesting - looking fwd to seeing it.

> Interesting feature.  It brings up the whole serialization issue.  Marius
> and I were chatting about that on Friday.  Maybe it'll be my mission post M8
> to get serialization nailed.

ok sounds interesting - i'll keep an eye on the repo until monday
then!

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: Database transactions with Mapper

2009-11-07 Thread David Pollak
On Fri, Nov 6, 2009 at 10:14 PM, oshyshko  wrote:

>
> Looks like "S.addAround(DB.buildLoanWrapper)" has no effect.
>


What code are you using to make the query?

Please create a fully running example (making a GitHub project is the best
way to do this) so that I can see exactly what is happening.


>
>
> 2 Query SET autocommit=0
> 2 Query SET autocommit=0
> 2 Query SELECT accounts.id, accounts.name, accounts.user_c FROM
> accounts WHERE id = 205
> 2 Query commit
> 2 Query SET autocommit=0
> 2 Query SET autocommit=0
> 2 Query SELECT accounts.id, accounts.name, accounts.user_c FROM
> accounts WHERE id = 206
> 2 Query commit
> 2 Query SET autocommit=0
> 2 Query SET autocommit=0
> 2 Query SELECT accounts.id, accounts.name, accounts.user_c FROM
> accounts WHERE id = 207
>
>
> Any ideas what can be wrong?
>
>
> class Boot extends Bootable {
>  def boot {
>DB.defineConnectionManager(DefaultConnectionIdentifier, DBVendor)
>S.addAround(DB.buildLoanWrapper)
>...
>   }
> }
>
> - scala 2.7.6
> - liftweb 1.1-M6
> - MySQL 5.1
>
>
> On Nov 6, 6:19 pm, David Pollak  wrote:
> > If you have the following line in your Boot.scala file:
> >
> > S.addAround(DB.buildLoanWrapper)
> >
>
> >
>


-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Pretty Printed Output?

2009-11-07 Thread David Pollak
On Sat, Nov 7, 2009 at 1:01 AM, aw  wrote:

>
> Is there a mode whereby I can turn on pretty printed output for my
> xhtml?  (I'm thinking of a LiftRule, I think?).  Preferably, I'd also
> like to control some details like indentation size.
>

No mode for that... sorry.


> >
>


-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: lift-wizard progress?

2009-11-07 Thread David Pollak
On Fri, Nov 6, 2009 at 3:55 PM, Timothy Perrett wrote:

>
> Guys,
>
> I've noticed that the lift-wizard hasn't had any commits for ages -
> where is this too in terms of usability etc?
>

I'm presenting it at Bay Area Scala Enthusiasts on Monday... although I've
written almost no new code... but I have a killer design in my head.  Expect
something working and marginally usable on Monday night (just before I leave
for LinkedIn).

Basically, I'm separating the field logic/flow logic from any UI.  This will
allow for automated testing of the wizards without a front end (and if you
trust the wizard state <-> UI translation, then there's no need to test the
stuff in a browser).


>
> I was looking at the implementation and was wondering if wizard
> serialisation had been considered?


Interesting feature.  It brings up the whole serialization issue.  Marius
and I were chatting about that on Friday.  Maybe it'll be my mission post M8
to get serialization nailed.


> I would use the wizard code as soon
> as it was available and serialisation would be a really important
> feature for us - that is, the ability to serialise a wizard process,
> persist it, and reload it on-demand at a later date... its highly
> likely that we would have several wizard type processes to load
> dynamically from disk / datastore etc.
>
> 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
Surf the harmonics

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: About the localization with lift:loc !

2009-11-07 Thread Jeppe Nejsum Madsen

Timothy Perrett  writes:

> You should always be working with UTF-8 files for properties /
> localisation - I think the encoding reported by jetty is something
> different (that it reads from the system)... ensure your props files
> are UTF-8 and go from there.

Careful now :-) Property files that are to be read by java's Properties
class should be in iso-8859-1 encoding and converted with native2ascii.

http://java.sun.com/javase/6/docs/api/java/util/Properties.html#load%28java.io.InputStream%29


XML property files can be in UTF-8 though


/Jeppe

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: About the localization with lift:loc !

2009-11-07 Thread Neil.Lv

yk,

  I use the code that you write.

  1:) I use this link to test the i18n
  http://localhost:8080/?locale=ms_MY

  S.??("login")  =>  it works well !

  2:) But this code in the html page, it always doesn't work too, just
show the "Default value"
  Default value

  Thanks very much!

Cheers,
  Neil

On Nov 7, 8:29 pm, Timothy Perrett  wrote:
> You should always be working with UTF-8 files for properties /
> localisation - I think the encoding reported by jetty is something
> different (that it reads from the system)... ensure your props files
> are UTF-8 and go from there.
>
> Cheers, Tim
>
> On Nov 7, 12:48 am, yk  wrote:
>
> > Hi Tim,
>
> > I've developed n tested localization on windows and it worked
> > perfectly. however, localization of the same project placed on ubuntu
> > server 9.10 did not.
>
> > WinXP
> > ---
> > jdk1.6
> > maven 2.2.1
> > lifeweb 1.1-M7
> > encoding=cp1252 (as reported by "mvn jetty:run")
>
> > Ubuntu 9.10 server
> > ---
> > openjdk OR sun-jdk6
> > maven 2.2.1
> > liftweb 1.1-M7
> > encoding=UTF-8 (as reported by "mvn jetty:run")
>
> > I can't quite point my finger on why it worked on windows but not on
> > linux. Do i have to convert all files that need to be deployed to
> > UTF-8 encoding?
>
> > Thank you in advance.
>
> > Cheers,
> >   yk
>
> > On Oct 26, 9:12 pm, Timothy Perrett  wrote:
>
> > > The browser already knows the locale, you have it backward! Your  
> > > localeCalculator is so that the browser can get lift to return the  
> > > right content.
>
> > > Take a look at:
>
> > >http://scala-tools.org/mvnsites/liftweb-1.1-M6/lift-webkit/scaladocs/...
>
> > > I would start with just getting lift to explicitly set locale based on  
> > > a query string or something... it will help you understand how the  
> > > mechanism works.
>
> > > Cheers, Tim
>
> > > On 26 Oct 2009, at 12:34, Neil.Lv wrote:
>
> > > >  ...
>
> > > >  Where is the locale to be set that the browser can know the
> > > > locale ?
>
> > > >  Thanks very much!
>
> > > > Cheers,
> > > >  Neil
>
> > > > On Oct 26, 7:50 pm, Timothy Perrett  wrote:
> > > >> setLocale was a method created by me, specific to my application - it
> > > >> does not exist in Lift... hence why I removed it in my simplified
> > > >> example.
>
> > > >> Cheers, Tim
>
> > > >> On 26 Oct 2009, at 11:45, Neil.Lv wrote:
>
> > > >>> I have a silly question ,  where is the setLocale method ?
>
> > > >>> I don't know where the package located.
>
> > > >>> src\main\scala\bootstrap\liftweb\Boot.scala:63: error: not found:
> > > >>> value setLocale
> > > >>>   setLocale(selectedLocale)
>
> > > >>> :)
>
> > > >>> Cheers,
> > > >>>  Neil
>
> > > >>> On Oct 26, 5:50 pm, Timothy Perrett  wrote:
> > >  Yes, your template code is right - your just seeing the default  
> > >  value
> > >  because you have not told lift what resources to use when it gets  
> > >  the
> > >  locale header from the browser.
>
> > >  tryo() is like try/catch however, it will catch exceptions and
> > >  returns
> > >  Box[T]
>
> > >  I would really suggest starting with something a lot simpler than  
> > >  the
> > >  one i detailed that uses cookies and all sorts. Perhaps something
> > >  like:
>
> > >  def localeCalculator(request : Box[HTTPRequest]): Locale =
> > >     request.flatMap(r => {
> > >     tryo(r.locale) match {
> > >       // your match here
> > >     }
>
> > >  }).openOr(java.util.Locale.getDefault())
>
> > >  Hope that helps
>
> > >  Cheers, Tim
>
> > >  On 26 Oct 2009, at 09:21, Neil.Lv wrote:
>
> > > >  Log in 222
> > > >  That means this code is correctly, the problem is that the  
> > > > browser
> > > > doesn't know the locale?
>
> > > >  So we need to calculate the locale in the Boot.scala file ?
>
> > > > Cheers,
> > > >  Neil
>
> > > > On Oct 26, 5:09 pm, "Neil.Lv"  wrote:
> > > >> tryo(r.getParameter("locale")) match {
> > > >>    case Full(null) => workOutLocale
> > > >>    case Empty => workOutLocale
> > > >>    case Failure(_,_,_) => workOutLocale
> > > >>    case Full(selectedLocale) => {
> > > >>      setLocale(selectedLocale)
> > > >>      selectedLocale
> > > >>    }
> > > >>  }
>
> > > >>  In this code ,  what's the tryo ? is try ?
> > > >>  tryo () match {}
>
> > > >>  What's the changes about the HTTP container providers?
>
> > > >>  Thanks very much!
>
> > > >> Cheers,
> > > >>  Neil
>
> > > >> On Oct 26, 4:44 pm, Timothy Perrett 
> > > >> wrote:
>
> > > >>> Hmm - you posted a link to my article at the begining of this
> > > >>> thread;
> > > >>> in that article I explain lifts locale calculator. Without this,
> > > >>> Lift
> > > >>> has no idea how you want to handle different locales. By  
> > > >>> default,
> > > >>> the
> > > >>> following is used:
>
> > > >>>  var localeCalcula

[Lift] Re: About the localization with lift:loc !

2009-11-07 Thread Timothy Perrett

You should always be working with UTF-8 files for properties /
localisation - I think the encoding reported by jetty is something
different (that it reads from the system)... ensure your props files
are UTF-8 and go from there.

Cheers, Tim

On Nov 7, 12:48 am, yk  wrote:
> Hi Tim,
>
> I've developed n tested localization on windows and it worked
> perfectly. however, localization of the same project placed on ubuntu
> server 9.10 did not.
>
> WinXP
> ---
> jdk1.6
> maven 2.2.1
> lifeweb 1.1-M7
> encoding=cp1252 (as reported by "mvn jetty:run")
>
> Ubuntu 9.10 server
> ---
> openjdk OR sun-jdk6
> maven 2.2.1
> liftweb 1.1-M7
> encoding=UTF-8 (as reported by "mvn jetty:run")
>
> I can't quite point my finger on why it worked on windows but not on
> linux. Do i have to convert all files that need to be deployed to
> UTF-8 encoding?
>
> Thank you in advance.
>
> Cheers,
>   yk
>
> On Oct 26, 9:12 pm, Timothy Perrett  wrote:
>
>
>
> > The browser already knows the locale, you have it backward! Your  
> > localeCalculator is so that the browser can get lift to return the  
> > right content.
>
> > Take a look at:
>
> >http://scala-tools.org/mvnsites/liftweb-1.1-M6/lift-webkit/scaladocs/...
>
> > I would start with just getting lift to explicitly set locale based on  
> > a query string or something... it will help you understand how the  
> > mechanism works.
>
> > Cheers, Tim
>
> > On 26 Oct 2009, at 12:34, Neil.Lv wrote:
>
> > >  ...
>
> > >  Where is the locale to be set that the browser can know the
> > > locale ?
>
> > >  Thanks very much!
>
> > > Cheers,
> > >  Neil
>
> > > On Oct 26, 7:50 pm, Timothy Perrett  wrote:
> > >> setLocale was a method created by me, specific to my application - it
> > >> does not exist in Lift... hence why I removed it in my simplified
> > >> example.
>
> > >> Cheers, Tim
>
> > >> On 26 Oct 2009, at 11:45, Neil.Lv wrote:
>
> > >>> I have a silly question ,  where is the setLocale method ?
>
> > >>> I don't know where the package located.
>
> > >>> src\main\scala\bootstrap\liftweb\Boot.scala:63: error: not found:
> > >>> value setLocale
> > >>>   setLocale(selectedLocale)
>
> > >>> :)
>
> > >>> Cheers,
> > >>>  Neil
>
> > >>> On Oct 26, 5:50 pm, Timothy Perrett  wrote:
> >  Yes, your template code is right - your just seeing the default  
> >  value
> >  because you have not told lift what resources to use when it gets  
> >  the
> >  locale header from the browser.
>
> >  tryo() is like try/catch however, it will catch exceptions and
> >  returns
> >  Box[T]
>
> >  I would really suggest starting with something a lot simpler than  
> >  the
> >  one i detailed that uses cookies and all sorts. Perhaps something
> >  like:
>
> >  def localeCalculator(request : Box[HTTPRequest]): Locale =
> >     request.flatMap(r => {
> >     tryo(r.locale) match {
> >       // your match here
> >     }
>
> >  }).openOr(java.util.Locale.getDefault())
>
> >  Hope that helps
>
> >  Cheers, Tim
>
> >  On 26 Oct 2009, at 09:21, Neil.Lv wrote:
>
> > >  Log in 222
> > >  That means this code is correctly, the problem is that the  
> > > browser
> > > doesn't know the locale?
>
> > >  So we need to calculate the locale in the Boot.scala file ?
>
> > > Cheers,
> > >  Neil
>
> > > On Oct 26, 5:09 pm, "Neil.Lv"  wrote:
> > >> tryo(r.getParameter("locale")) match {
> > >>    case Full(null) => workOutLocale
> > >>    case Empty => workOutLocale
> > >>    case Failure(_,_,_) => workOutLocale
> > >>    case Full(selectedLocale) => {
> > >>      setLocale(selectedLocale)
> > >>      selectedLocale
> > >>    }
> > >>  }
>
> > >>  In this code ,  what's the tryo ? is try ?
> > >>  tryo () match {}
>
> > >>  What's the changes about the HTTP container providers?
>
> > >>  Thanks very much!
>
> > >> Cheers,
> > >>  Neil
>
> > >> On Oct 26, 4:44 pm, Timothy Perrett 
> > >> wrote:
>
> > >>> Hmm - you posted a link to my article at the begining of this
> > >>> thread;
> > >>> in that article I explain lifts locale calculator. Without this,
> > >>> Lift
> > >>> has no idea how you want to handle different locales. By  
> > >>> default,
> > >>> the
> > >>> following is used:
>
> > >>>  var localeCalculator: Box[HTTPRequest] => Locale =
> > >>> defaultLocaleCalculator _
>
> > >>>  def defaultLocaleCalculator(request: Box[HTTPRequest]) =
> > >>>  request.flatMap(_.locale).openOr(Locale.getDefault())
>
> > >>> As you can see, that will get only the locale of your JVM, not  
> > >>> the
> > >>> browser. You will need to write the appropriate locale  
> > >>> calculator;
> > >>> the
> > >>> one in my article is a little out of date as there was a  
> > >>> breaking
> > >>> change not so long ago to the HTTP container providers but 

[Lift] Re: Pretty Printed Output?

2009-11-07 Thread Timothy Perrett

Im not sure i understand the question - in what was it the current
output not pretty printed?

cheers, Tim

On Nov 7, 9:01 am, aw  wrote:
> Is there a mode whereby I can turn on pretty printed output for my
> xhtml?  (I'm thinking of a LiftRule, I think?).  Preferably, I'd also
> like to control some details like indentation size.
--~--~-~--~~~---~--~~
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: Latest API Documentation

2009-11-07 Thread night_stalker

I think crawling all pages under
http://scala-tools.org/mvnsites-snapshots/liftweb/ is a better
option,
which costs less band-width and less time, and is very much easier
than building documentation from source.

On Nov 6, 6:45 am, Jonathan Ferguson  wrote:
> Is it practical to build the snapshot documentation or is it being built to
> often?
>
> Jono
>
> 2009/11/6 David Pollak 
>
>
>
> > On Wed, Nov 4, 2009 at 10:44 PM, aw  wrote:
>
> >> When clicking on the "API Documentation" link, it links to 1.0
> >> documentation...  Is there a link for 1.1-M7 documentation?
>
> >> (I tried going tohttp://scala-tools.org/scaladocs/liftweb/1.1-M7/but
> >> that didn't work...)
>
> > Try:
> >http://scala-tools.org/mvnsites/liftweb-1.1-M6/
>
> > The M7 docs will be up in 30-60 minutes.
>
> > --
> > Lift, the simply functional web frameworkhttp://liftweb.net
> > Beginning Scalahttp://www.apress.com/book/view/1430219890
> > Follow me:http://twitter.com/dpp
> > Surf the harmonics
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: HttpServletRequest getRemoteUser()

2009-11-07 Thread Marius

Try this:

S.containerRequest.map(r => (r.asInstanceOf[HTTPRequestServlet]).req)

req is an HttpServletRequest when you run into a JEE web container.


Br's,
Marius

On Nov 7, 5:51 am, aw  wrote:
> I am using 1.1-M7...  I have a Servlet Filter that performs
> Authentication.  As far the other layers are concerned, they can
> assume that HttpServletRequest.getRemoteUser() returns a valid,
> authenticated user.
>
> Alas, I can't seem to figure out how to access this from Scala:
> I need:  
> http://java.sun.com/javaee/5/docs/api/javax/servlet/http/HttpServletR...()
>
> S.servletRequest has been replaced with S.containerRequest, but I
> don't seem to have a way to navigate to the corresponding
> HttpServletRequest to get the Remote User...  Help!  Please!  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: Build Broken?

2009-11-07 Thread Joni Freeman

Hi,

Can you send me surefire test result file at:
lift-base/lift-json/target/surefire-reports/TEST-
net.liftweb.json.XmlExamplesTest.xml

All tests pass on my machine (Ubuntu 8.10, jdk1.6.0_10, Maven 2.0.9),
but I will investigate why it fails on your setup. You can send the
file directly to me, not sure if Google Groups accepts attachments.

Cheers Joni

On 7 marras, 07:22, aw  wrote:
> OK, found Hudson:  http://hudson.scala-tools.org/job/Lift/
>
> But now if that isn't broken, why is my fresh clone failing?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Pretty Printed Output?

2009-11-07 Thread aw

Is there a mode whereby I can turn on pretty printed output for my
xhtml?  (I'm thinking of a LiftRule, I think?).  Preferably, I'd also
like to control some details like indentation size.
--~--~-~--~~~---~--~~
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: About the localization with lift:loc !

2009-11-07 Thread Neil.Lv

yk,

  Nice job!  It's so cool and very useful to us.

  Thank you very much!

  :)

Cheers,
  Neil

On Nov 7, 8:48 am, yk  wrote:
> Hi Tim,
>
> I've developed n tested localization on windows and it worked
> perfectly. however, localization of the same project placed on ubuntu
> server 9.10 did not.
>
> WinXP
> ---
> jdk1.6
> maven 2.2.1
> lifeweb 1.1-M7
> encoding=cp1252 (as reported by "mvn jetty:run")
>
> Ubuntu 9.10 server
> ---
> openjdk OR sun-jdk6
> maven 2.2.1
> liftweb 1.1-M7
> encoding=UTF-8 (as reported by "mvn jetty:run")
>
> I can't quite point my finger on why it worked on windows but not on
> linux. Do i have to convert all files that need to be deployed to
> UTF-8 encoding?
>
> Thank you in advance.
>
> Cheers,
>   yk
>
> On Oct 26, 9:12 pm, Timothy Perrett  wrote:
>
> > The browser already knows the locale, you have it backward! Your  
> > localeCalculator is so that the browser can get lift to return the  
> > right content.
>
> > Take a look at:
>
> >http://scala-tools.org/mvnsites/liftweb-1.1-M6/lift-webkit/scaladocs/...
>
> > I would start with just getting lift to explicitly set locale based on  
> > a query string or something... it will help you understand how the  
> > mechanism works.
>
> > Cheers, Tim
>
> > On 26 Oct 2009, at 12:34, Neil.Lv wrote:
>
> > >  ...
>
> > >  Where is the locale to be set that the browser can know the
> > > locale ?
>
> > >  Thanks very much!
>
> > > Cheers,
> > >  Neil
>
> > > On Oct 26, 7:50 pm, Timothy Perrett  wrote:
> > >> setLocale was a method created by me, specific to my application - it
> > >> does not exist in Lift... hence why I removed it in my simplified
> > >> example.
>
> > >> Cheers, Tim
>
> > >> On 26 Oct 2009, at 11:45, Neil.Lv wrote:
>
> > >>> I have a silly question ,  where is the setLocale method ?
>
> > >>> I don't know where the package located.
>
> > >>> src\main\scala\bootstrap\liftweb\Boot.scala:63: error: not found:
> > >>> value setLocale
> > >>>   setLocale(selectedLocale)
>
> > >>> :)
>
> > >>> Cheers,
> > >>>  Neil
>
> > >>> On Oct 26, 5:50 pm, Timothy Perrett  wrote:
> >  Yes, your template code is right - your just seeing the default  
> >  value
> >  because you have not told lift what resources to use when it gets  
> >  the
> >  locale header from the browser.
>
> >  tryo() is like try/catch however, it will catch exceptions and
> >  returns
> >  Box[T]
>
> >  I would really suggest starting with something a lot simpler than  
> >  the
> >  one i detailed that uses cookies and all sorts. Perhaps something
> >  like:
>
> >  def localeCalculator(request : Box[HTTPRequest]): Locale =
> >     request.flatMap(r => {
> >     tryo(r.locale) match {
> >       // your match here
> >     }
>
> >  }).openOr(java.util.Locale.getDefault())
>
> >  Hope that helps
>
> >  Cheers, Tim
>
> >  On 26 Oct 2009, at 09:21, Neil.Lv wrote:
>
> > >  Log in 222
> > >  That means this code is correctly, the problem is that the  
> > > browser
> > > doesn't know the locale?
>
> > >  So we need to calculate the locale in the Boot.scala file ?
>
> > > Cheers,
> > >  Neil
>
> > > On Oct 26, 5:09 pm, "Neil.Lv"  wrote:
> > >> tryo(r.getParameter("locale")) match {
> > >>    case Full(null) => workOutLocale
> > >>    case Empty => workOutLocale
> > >>    case Failure(_,_,_) => workOutLocale
> > >>    case Full(selectedLocale) => {
> > >>      setLocale(selectedLocale)
> > >>      selectedLocale
> > >>    }
> > >>  }
>
> > >>  In this code ,  what's the tryo ? is try ?
> > >>  tryo () match {}
>
> > >>  What's the changes about the HTTP container providers?
>
> > >>  Thanks very much!
>
> > >> Cheers,
> > >>  Neil
>
> > >> On Oct 26, 4:44 pm, Timothy Perrett 
> > >> wrote:
>
> > >>> Hmm - you posted a link to my article at the begining of this
> > >>> thread;
> > >>> in that article I explain lifts locale calculator. Without this,
> > >>> Lift
> > >>> has no idea how you want to handle different locales. By  
> > >>> default,
> > >>> the
> > >>> following is used:
>
> > >>>  var localeCalculator: Box[HTTPRequest] => Locale =
> > >>> defaultLocaleCalculator _
>
> > >>>  def defaultLocaleCalculator(request: Box[HTTPRequest]) =
> > >>>  request.flatMap(_.locale).openOr(Locale.getDefault())
>
> > >>> As you can see, that will get only the locale of your JVM, not  
> > >>> the
> > >>> browser. You will need to write the appropriate locale  
> > >>> calculator;
> > >>> the
> > >>> one in my article is a little out of date as there was a  
> > >>> breaking
> > >>> change not so long ago to the HTTP container providers but it
> > >>> should
> > >>> give you enough to go on.
>
> > >>> Does that help?
>
> > >>> Cheers, Tim
>
> > >>> On Oct 26, 8:35