[Lift] Re: Welcome Dirk Louwers to the Lift committers

2009-10-23 Thread Dirk Louwers

Hi all,

Sorry for the late update. Had a few busy weeks business wise.

I am a Dutch self taught software writer. I am running my own company
from home and planning to use lift to make rich web applications.
Meanwhile I work part time as a coder for a healthcare company to pay
the bills. I have mainly focussed on web applications so far. I
started with PHP, then moved to C# (.NET) and am finally looking at
the java side of web applications through scala since recently. I have
done some small open source contributions, like Spring.NET Db4o
(object database) integration.

Like David said, I am indeed planning to integrate Ext 3 Core into
Lift, which is a modest contribution. After that I am planning to
create an Ext Direct stack which will probably be an external module.

Best,

Dirk

On 15 okt, 19:16, Timothy Perrett timo...@getintheloop.eu wrote:
 Welcome to the team dude - care to give some information about
 yourself and background?

 Cheers, Tim

 On Oct 15, 4:46 pm, David Pollak feeder.of.the.be...@gmail.com
 wrote:

  Folks,
  Please join me in welcoming Dirk to theLift committers.  Dirk is going to
  integrate Ext.Js (the MIT licensed part of it) into Lift.

  Welcome Dirk and we look forward to your contributions!

  Thanks,

  David

  --
  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: Ext.Direct

2009-10-09 Thread Dirk Louwers

Ok, the ExtJsArtifacts class and the companion script named liftExtJs
is finished. I have tested them with the JSON example in the wiki
since that seems to use a reasonable amount of functionality. All
seems to be working.
I would like to write a wiki page detailing how to get Ext support
using these files if you think that will be usefull. Also, would you
be interested in using this in the Lift distribution? Please advise.

Best,

Dirk Louwers

On Oct 8, 5:04 pm, Dirk Louwers dirk.louw...@stormlantern.nl wrote:
 Ok, risking that someone else might also be busy doing this, for now,
 I am writing ExtJsCommands which depends on the MIT licensed Ext-Core
 3. I will ask some questions when I am not sure about some things and
 will make sure I will add adequate comments so others might use them
 when adapting to another JS framework:

 - I take it that JsLeft and JsRight are there to chain effects/
 operations on an element (visitor style). Is that correct?
 - Is ScrollToBottom there to make an element and it's siblings scroll
 to the bottom of the visible document? Is it supposed to be animated
 or instant?
 - I think that Click is meant to fire a click event on an element.
 However I am not sure what the exp: JsExp parameter is for. What does
 it do?

 That's it for now. Will continue my work later tonight.

 Best,

 Dirk Louwers

 On Oct 8, 4:07 pm, Dirk Louwers dirk.louw...@stormlantern.nl wrote:

  Any news on this?

  I am currently doing some rudimentary Ext.Direct stuff with Lift
  myself. I would gladly help out there.

  Best,

  Dirk Louwers

  On Aug 31, 7:30 pm, David Pollak feeder.of.the.be...@gmail.com
  wrote:

   On Sat, Aug 29, 2009 at 11:14 AM, Josh Suereth 
   joshua.suer...@gmail.comwrote:

I believe the core of ExtJS is now  MIT licenesed (the widgets being GPL
with Commercial licenses available).   You could potentially build the 
Ajax
calls on top of this (as long as you stay away from ui components).   
Then
users who have bought an ExtJS subscription (like my company) would 
have a
much easier time moving to lift!  I believe the ExtJS core supports 
many of
the same operations as jQuery's core.

   Josh,

   Feel free (encouraged, even) to do the ExtJS core layer for Lift... just
   ping me privately for the specifics of being a Lift committer.

   Thanks,

   David

- Josh

On Thu, Aug 27, 2009 at 5:53 PM, Charles F. Munat c...@munat.com 
wrote:

I haven't used Ext.Direct yet, but I am currently building a site 
(three
sites, really) that uses Ext JS 3.0 for the front end.

One site is essentially a CRUD app. The back end is a PostgreSQL
database. The middle layer is a Lift app that uses JPA/Hibernate to
access the database. It provides a REST interface to the data that
accepts and returns JSON. (I've hand written this but must learn more
about Lift's JSON capabilities.)

The front end is pure Ext JS. All connections to the database are via
AJAX-like calls (AJAJ?). The REST interface is pretty pure, using only
GET, PUT, and DELETE.

(I like idempotency, so I don't use POST. The back end generates UUIDs
and prepopulates the add forms with a UUID, then the create calls use
the same URL as the update calls. If the object with that ID already
exists, it is updated. If it doesn't, it is created. Thus all calls are
idempotent. This also improves security, as you're, um, unlikely to
guess a UUID.)

I'd be happy to talk to you about this. It's still in the early stages,
but I have to debut it in a couple weeks if not sooner (what's new?), 
so
I'll be zooming through the front end stuff over the next few days.

I plan for all future sites that I build in Lift to follow a similar
pattern on the front end.

Chas.

Naftoli Gugenheim wrote:
 Has anyone used lift with Ext.JS forms/Ext.Direct?

 P.S. It would be neat if it could interact with Lift's JSON support. 
 I
wonder what it would take.

   --
   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: YUI Compressor Fatal Error

2009-10-08 Thread Dirk Louwers

Hi,

I am running 9.04 and have used a workaround to fix the YUI compressor
issue.

See: https://bugs.launchpad.net/ubuntu/+source/openjdk-6/+bug/255149

If I remember correctly I romoved a symlink to the rhino jar from /usr/
lib/jvm/java-6-openjdk/jre/lib and that fixed it (without any
noticable side-effects so far).

Best,

Dirk

On Oct 8, 2:23 pm, Peter Robinett pe...@bubblefoundry.com wrote:
 Hi all,

 I just switched to the Sun JVM and everything works now, so it
 definitely was OpenJDK. Oh well.

 Peter

 On Oct 6, 7:10 pm, David Pollak feeder.of.the.be...@gmail.com wrote:

  On Tue, Oct 6, 2009 at 1:39 AM, Peter Robinett 
  pe...@bubblefoundry.comwrote:

   Thanks, all. While David Bernard's plan to update the maven plugin is
   very welcome, the fact that Scala Actors don't work for Comet actors
   suggests that I should switch to the Sun JVM.

  Keep in mind I was on Ubuntu 8.04 (granted this is the LTS version).

  I'll try on 9.04 today.

   Peter

   On Oct 6, 8:50 am, David Bernard david.bernard...@gmail.com wrote:
yuicompressor 2.3.x doesn't work with openjdk
(https://bugs.launchpad.net/ubuntu/+source/openjdk-6/+bug/287035)
But it seems that yuicompressor 2.4.2 works
(http://www.electrictoolbox.com/minify-javascript-css-yui-compressor/)

It's a long time I didn't update yuicompressor-maven-plugin. I'll
deploy a new version latter this week.

/davidB

On Tue, Oct 6, 2009 at 02:19, Ross Mellgren dri...@gmail.com wrote:
 According to his version number he's running ubuntu and that 
 particular
 version corresponds to jaunty jackalope (9.04)
 Unless he spliced that package into debian or something else.
 -Ross
 On Oct 5, 2009, at 8:06 PM, David Pollak wrote:

 d...@david-desktop:~/Desktop/liftweb/examples/example$ java -version
 Picked up JAVA_TOOL_OPTIONS: -Xmx1024M
 java version 1.6.0_0
 OpenJDK  Runtime Environment (build 1.6.0_0-b11)
 OpenJDK Client VM (build 1.6.0_0-b11, mixed mode, sharing)
 d...@david-desktop:~/Desktop/liftweb/examples/example$

 I'm running on Ubuntu 8.04 with the OpenJDK installation.

 I get compilation failures on about half the runs.  They appear to be
 random.

 Scala Actors do not work (I'm not trying to throw gasoline on any
   fires,
 just reporting what I'm seeing) when powering Lift's comet stuff.
   However,
 Lift Actors do work.

 I'm not seeing any explicit issues with other libraries.

 What OS are you running under your OpenJDK installation?

 On Mon, Oct 5, 2009 at 1:10 PM, Peter Robinett 
   pe...@bubblefoundry.com
 wrote:

 Ross, I am using OpenJDK:
 $ java -version
 java version 1.6.0_0
 OpenJDK Runtime Environment (IcedTea6 1.4.1) (6b14-1.4.1-0ubuntu11)
 OpenJDK 64-Bit Server VM (build 14.0-b08, mixed mode)

 Is it possible to use YUI Compressor at all with OpenJDK?

 Peter

 On Oct 5, 7:32 pm, Ross Mellgren dri...@gmail.com wrote:
  I thought someone mentioned this a little while ago and it was due
   to
  OpenJDK (and only related to the YUI compressor)?

  -Ross

  On Oct 5, 2009, at 1:25 PM, jon wrote:

   Is there a syntax problem in one of your javascript files?

   On Oct 5, 1:23 pm, Peter Robinett pe...@bubblefoundry.com
   wrote:
   Hi all,

   I've been compiling and running my Lift app on my personal
   machine
   without any problems but when I try to run it on another machine
   (where it had previously worked), I am getting fatal YUI
   Compressor
   errors.

   Not knowing YUI Compressor or how Lift and Maven use it (but
   willing
   to learn!), I'd appreciate any tips on how to get it to work
   again.

   Thanks in advance,
   Peter Robinett

   PS I thought I already posted a version of this message but I
   don't
   see it on the Groups site. My apologies if this message is a
   duplicate.

   $ mvn jetty:run
   [INFO] Scanning for projects...
   [INFO] Searching repository for plugin with prefix: 'jetty'.
   [INFO]

   
   [INFO] Building server
   [INFO]    task-segment: [jetty:run]
   [INFO]

   
   [INFO] Preparing jetty:run
   [INFO] [resources:resources]
   [INFO] Using default encoding to copy filtered resources.
   [INFO] [yuicompressor:compress {execution: default}]
   [INFO] equalnetworks.css (267b) - equalnetworks.css (197b)[73%]
   [INFO] dashboard.css (5511b) - dashboard.css (4478b)[81%]
   [INFO] jquery.tooltip.css (172b) - jquery.tooltip.css
   (145b)[84%]
   [INFO]

   
   [ERROR] FATAL ERROR
   [INFO]

   
   [INFO] null
   [INFO]

   

[Lift] Re: Ext.Direct

2009-10-08 Thread Dirk Louwers

Any news on this?

I am currently doing some rudimentary Ext.Direct stuff with Lift
myself. I would gladly help out there.

Best,

Dirk Louwers

On Aug 31, 7:30 pm, David Pollak feeder.of.the.be...@gmail.com
wrote:
 On Sat, Aug 29, 2009 at 11:14 AM, Josh Suereth 
 joshua.suer...@gmail.comwrote:

  I believe the core of ExtJS is now  MIT licenesed (the widgets being GPL
  with Commercial licenses available).   You could potentially build the Ajax
  calls on top of this (as long as you stay away from ui components).   Then
  users who have bought an ExtJS subscription (like my company) would have a
  much easier time moving to lift!  I believe the ExtJS core supports many of
  the same operations as jQuery's core.

 Josh,

 Feel free (encouraged, even) to do the ExtJS core layer for Lift... just
 ping me privately for the specifics of being a Lift committer.

 Thanks,

 David





  - Josh

  On Thu, Aug 27, 2009 at 5:53 PM, Charles F. Munat c...@munat.com wrote:

  I haven't used Ext.Direct yet, but I am currently building a site (three
  sites, really) that uses Ext JS 3.0 for the front end.

  One site is essentially a CRUD app. The back end is a PostgreSQL
  database. The middle layer is a Lift app that uses JPA/Hibernate to
  access the database. It provides a REST interface to the data that
  accepts and returns JSON. (I've hand written this but must learn more
  about Lift's JSON capabilities.)

  The front end is pure Ext JS. All connections to the database are via
  AJAX-like calls (AJAJ?). The REST interface is pretty pure, using only
  GET, PUT, and DELETE.

  (I like idempotency, so I don't use POST. The back end generates UUIDs
  and prepopulates the add forms with a UUID, then the create calls use
  the same URL as the update calls. If the object with that ID already
  exists, it is updated. If it doesn't, it is created. Thus all calls are
  idempotent. This also improves security, as you're, um, unlikely to
  guess a UUID.)

  I'd be happy to talk to you about this. It's still in the early stages,
  but I have to debut it in a couple weeks if not sooner (what's new?), so
  I'll be zooming through the front end stuff over the next few days.

  I plan for all future sites that I build in Lift to follow a similar
  pattern on the front end.

  Chas.

  Naftoli Gugenheim wrote:
   Has anyone used lift with Ext.JS forms/Ext.Direct?

   P.S. It would be neat if it could interact with Lift's JSON support. I
  wonder what it would take.

 --
 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: Ext.Direct

2009-10-08 Thread Dirk Louwers

Ok, risking that someone else might also be busy doing this, for now,
I am writing ExtJsCommands which depends on the MIT licensed Ext-Core
3. I will ask some questions when I am not sure about some things and
will make sure I will add adequate comments so others might use them
when adapting to another JS framework:

- I take it that JsLeft and JsRight are there to chain effects/
operations on an element (visitor style). Is that correct?
- Is ScrollToBottom there to make an element and it's siblings scroll
to the bottom of the visible document? Is it supposed to be animated
or instant?
- I think that Click is meant to fire a click event on an element.
However I am not sure what the exp: JsExp parameter is for. What does
it do?

That's it for now. Will continue my work later tonight.

Best,

Dirk Louwers

On Oct 8, 4:07 pm, Dirk Louwers dirk.louw...@stormlantern.nl wrote:
 Any news on this?

 I am currently doing some rudimentary Ext.Direct stuff with Lift
 myself. I would gladly help out there.

 Best,

 Dirk Louwers

 On Aug 31, 7:30 pm, David Pollak feeder.of.the.be...@gmail.com
 wrote:

  On Sat, Aug 29, 2009 at 11:14 AM, Josh Suereth 
  joshua.suer...@gmail.comwrote:

   I believe the core of ExtJS is now  MIT licenesed (the widgets being GPL
   with Commercial licenses available).   You could potentially build the 
   Ajax
   calls on top of this (as long as you stay away from ui components).   Then
   users who have bought an ExtJS subscription (like my company) would have a
   much easier time moving to lift!  I believe the ExtJS core supports many 
   of
   the same operations as jQuery's core.

  Josh,

  Feel free (encouraged, even) to do the ExtJS core layer for Lift... just
  ping me privately for the specifics of being a Lift committer.

  Thanks,

  David

   - Josh

   On Thu, Aug 27, 2009 at 5:53 PM, Charles F. Munat c...@munat.com wrote:

   I haven't used Ext.Direct yet, but I am currently building a site (three
   sites, really) that uses Ext JS 3.0 for the front end.

   One site is essentially a CRUD app. The back end is a PostgreSQL
   database. The middle layer is a Lift app that uses JPA/Hibernate to
   access the database. It provides a REST interface to the data that
   accepts and returns JSON. (I've hand written this but must learn more
   about Lift's JSON capabilities.)

   The front end is pure Ext JS. All connections to the database are via
   AJAX-like calls (AJAJ?). The REST interface is pretty pure, using only
   GET, PUT, and DELETE.

   (I like idempotency, so I don't use POST. The back end generates UUIDs
   and prepopulates the add forms with a UUID, then the create calls use
   the same URL as the update calls. If the object with that ID already
   exists, it is updated. If it doesn't, it is created. Thus all calls are
   idempotent. This also improves security, as you're, um, unlikely to
   guess a UUID.)

   I'd be happy to talk to you about this. It's still in the early stages,
   but I have to debut it in a couple weeks if not sooner (what's new?), so
   I'll be zooming through the front end stuff over the next few days.

   I plan for all future sites that I build in Lift to follow a similar
   pattern on the front end.

   Chas.

   Naftoli Gugenheim wrote:
Has anyone used lift with Ext.JS forms/Ext.Direct?

P.S. It would be neat if it could interact with Lift's JSON support. I
   wonder what it would take.

  --
  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: Overriding date/time formatting

2009-10-07 Thread Dirk Louwers

Yes, I am indeed using version.

My solution is now properly working and does this as follows:
1) It has a dateParser and dateFormatter that are set to another field
by default: defaultDateFormat. The dateParser will be used to parse
and format the form fields. The dateFormatter is for display (used in
asHtml). These two fields can be overridden to change per field
behavior. This can either be done by assigning shortDateFormat,
longDateFormat, mediumDateFormat or fullDateFormat to them or
specifying your own DateFormat entirely.
2) The predefined fields named default, short, medium, long and
fullDateFormat get their DateFormat by first checking S ?
x.date.format, otherwise they will switch to DEFAULT, SHORT, MEDIUM,
LONG and FULL respectively and use the locale provided by S.locale.

If it would be at all usefull I'd be happy to share the code.

Best,

Dirk Louwers

On Oct 7, 2:29 am, Naftoli Gugenheim naftoli...@gmail.com wrote:
 Also more flexibility should be coming soon if I'm not mistaken. I
 think there's a ticket and Derek is planning on working on it.

 On Tue, Oct 6, 2009 at 4:59 PM, Jeppe Nejsum Madsen je...@ingolfs.dk wrote:



  Dirk Louwers dirk.louw...@stormlantern.nl writes:

  Hi,

  After having toyed around with Scala and recently Lift for a few weeks
  I have a question. To avoid jumping to conclusions let me first
  explain what I am trying to achieve:

  I am not happy with the way MappedDateTime parses strings and formats
  dates by default. I want to be able to change these parsers/formatters
  globally and/or on a per mapper field basis.

  Here is what I did:

  By looking at the sourcecode I noticed that following MappedDateTime
  ultimately this depends on internetDateFormatter, dateFormatter and
  toInternetDate inside TimeHelpers. Since I don't know how to change
  the dependency of MappedDateTime on TimeHelpers to a subclass of
  TimeHelpers I decided to break the dependency by subclassing
  MappedDateTime and overriding _toForm and setFromAny and have my
  setFromAny call a modified toDate that in turn depends on a custom
  function to parse a string to a date. This function:
  1) Tries to use a specifically definded DateFormat on the field
  2) Tries to get a dateformat from a localized bundle
  3) Falls back to the SHORT date format of the JVM locale.

  Here is what I would like to know:

  1) Is there a way to have Lift use a TimeHelpers subclass without
  having to subclass stuff that depends on it?
  2) Does anyone have suggestions how to improve/invalidate my approach?

  Just checking to see if I am on the right path or making this
  needlessly hard.
  Thanks in advance for any response.

  Sounds like you're using 1.0? In 1.1-SNAPSHOT, date/time
  parsing/formatting is done in LiftRules.parseDate/formatDate and can be
  changed. Not quite per field flexibility though

  I think that this is also not locale specific (ie. per request), but
  haven't looked too closely at this yet

  /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: Override the display names for (Mega)ProtoUser

2009-10-07 Thread Dirk Louwers

Hi,

Not to be an evil hijacker of threads, but can anyone supply me the
english Lift core resource bundle? I would like to work on a dutch
translation.

Best,

Dirk Louwers

On Oct 7, 7:43 am, Heiko Seeberger heiko.seeber...@googlemail.com
wrote:
 Jeppe,
 You are my hero ;-)

 Thanks,

 Heiko

 2009/10/6 Jeppe Nejsum Madsen je...@ingolfs.dk



  Heiko Seeberger heiko.seeber...@googlemail.com writes:

   Hi,
   It is not possible to localize or override the display names for
   (Mega)ProtoUser's first name, last name and time zone. This is because it
  is
   determined by ??(First Name) and analogous, with First Name (with a
   blank) not a valid key for a PropertyResourceBundle.

   Am I missing something? Or should I file a bug?

  I think you're missing something :-)

  I had the same issue. Some studying of

 http://java.sun.com/j2se/1.4.2/docs/api/java/util/Properties.html#loa...

  leads to this explanation: The key contains all of the characters in the
  line starting
  with the first non-white space character and up to, but not including,
  the first unescaped '=', ':', or white space character other than a line
  terminator. All of these key termination characters may be included in
  the key by escaping them with a preceding backslash character

  And, while not very intuitive, this works for me:

  First\ Name = Fornavn
  Last\ Name = Efternavn

  /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: Override the display names for (Mega)ProtoUser

2009-10-07 Thread Dirk Louwers

Cheers,

I've finished the translation. Who do I send the file to for
integration and how can I have Lift pick it up in the meanwhile?

Best,

Dirk Louwers

On Oct 7, 8:41 am, Heiko Seeberger heiko.seeber...@googlemail.com
wrote:
 Take it from 
 here:http://github.com/dpp/liftweb/tree/master/lift/src/main/resources/i18n/

 Heiko

 2009/10/7 Dirk Louwers dirk.louw...@stormlantern.nl





  Hi,

  Not to be an evil hijacker of threads, but can anyone supply me the
  english Lift core resource bundle? I would like to work on a dutch
  translation.

  Best,

  Dirk Louwers

  On Oct 7, 7:43 am, Heiko Seeberger heiko.seeber...@googlemail.com
  wrote:
   Jeppe,
   You are my hero ;-)

   Thanks,

   Heiko

   2009/10/6 Jeppe Nejsum Madsen je...@ingolfs.dk

Heiko Seeberger heiko.seeber...@googlemail.com writes:

 Hi,
 It is not possible to localize or override the display names for
 (Mega)ProtoUser's first name, last name and time zone. This is
  because it
is
 determined by ??(First Name) and analogous, with First Name (with
  a
 blank) not a valid key for a PropertyResourceBundle.

 Am I missing something? Or should I file a bug?

I think you're missing something :-)

I had the same issue. Some studying of

   http://java.sun.com/j2se/1.4.2/docs/api/java/util/Properties.html#loa.
  ..

leads to this explanation: The key contains all of the characters in
  the
line starting
with the first non-white space character and up to, but not including,
the first unescaped '=', ':', or white space character other than a
  line
terminator. All of these key termination characters may be included in
the key by escaping them with a preceding backslash character

And, while not very intuitive, this works for me:

First\ Name = Fornavn
Last\ Name = Efternavn

/Jeppe

 --
 Heiko Seeberger

 My job: weiglewilczek.com
 My blog: heikoseeberger.name
 Follow me: twitter.com/hseeberger
 OSGi on Scala: scalamodules.org
 Lift, the simply functional web framework: liftweb.net

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



[Lift] Re: Overriding date/time formatting

2009-10-07 Thread Dirk Louwers

Here goes. I have also added the possibility to mark the field as
required. That proved to be less trivial than expected since
validators can only work on the field type and not the raw string.

class MappedLocalDateTime[T:Mapper[T]](fieldOwner: T) extends
MappedDateTime[T](fieldOwner) {

private var rawString: String = 
def requiredField_? = false

override def validate : List[FieldError] = {
if (rawString.trim ==   requiredField_?) FieldError(this, 
Text
(S ? field.required)) :: Nil
else super.validate
}

override def asHtml = Text(dateFormatter.format(is))

override def _toForm: Box[NodeSeq] =
S.fmapFunc({s: List[String] = this.setFromAny(s)}){funcName =
Full(input type='text' id={fieldId}
name={funcName} lift:gc={funcName}
value={is match {case null =  case s = 
dateParser.format(s)}}/
)
}

override def setFromAny(f : Any): Date = toDate(f).map(d = 
this.set
(d)).openOr(this.is)

def toDate(in: Any): Box[Date] = {
try {
in match {
case null = Empty
  case d: Date = Full(d)
  case lng: Long = Full(new Date(lng))
  case lng: Number = Full(new Date(lng.longValue))
  case Nil | Empty | None | Failure(_, _, _) = Empty
  case Full(v) = toDate(v)
  case Some(v) = toDate(v)
  case v :: vs = toDate(v)
  case s : String = rawString = s; parseDate(s)
  case o = toDate(o.toString)
}
  } catch {
case e = Log.debug(Error parsing date +in, e); Failure(Bad
date: +in, Full(e), Empty)
  }
}

/**
 * This DateFormat is used to parse incoming strings and to format
this field's date when displaying
 * in a form. Override this to change the format. Default format
is DateFormat.SHORT for the
 * current locale.
 */
def dateParser = shortDateFormat
/**
 * This DateFormat is used to display this field's date as html.
Override to change the format. The
 * default is DateFormat.DEFAULT for the current locale.
 */
def dateFormatter = defaultDateFormat

final protected def makeDateFormat(key: String, format: Int):
DateFormat = {
val formatString = S ? key
def localeFormat: DateFormat = {
try { DateFormat.getDateInstance(format, S.locale) }
catch { case e = DateFormat.getDateInstance(DateFormat.DEFAULT,
S.locale) }
}
if (formatString == key) localeFormat
else
try { new SimpleDateFormat(formatString, S.locale) }
catch { case e = localeFormat }
}

def defaultDateFormat = DateFormat.getDateInstance
(DateFormat.DEFAULT, S.locale)
def shortDateFormat = makeDateFormat(date.short.formatter,
DateFormat.SHORT)
def mediumDateFormat = makeDateFormat(date.medium.formatter,
DateFormat.MEDIUM)
def longDateFormat = makeDateFormat(date.long.formatter,
DateFormat.LONG)
def fullDateFormat = makeDateFormat(date.full.formatter,
DateFormat.FULL)

final protected def parseDate(s: String): Box[Date] = {
try {
Full(dateParser.parse(s))
} catch {
case _ = Empty
}
}
}


Have fun with it.

Dirk Louwers

On Oct 7, 9:31 am, Jeppe Nejsum Madsen je...@ingolfs.dk wrote:
 Dirk Louwers dirk.louw...@stormlantern.nl writes:

  If it would be at all usefull I'd be happy to share the code.

 Please do. I'll eventually have to support different locales at some
 point

 /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: Override the display names for (Mega)ProtoUser

2009-10-07 Thread Dirk Louwers

Thanks, works like a charm.
Am quite happy with the way Lift calculates the locale at the moment
though.

Dirk

On Oct 7, 2:25 pm, Timothy Perrett timo...@getintheloop.eu wrote:
 An example of locale calculator can be found here:http://is.gd/1NXGN

 Cheers, Tim

 On 7 Oct 2009, at 13:04, Jeppe Nejsum Madsen wrote:



  Dirk Louwers dirk.louw...@stormlantern.nl writes:

  Cheers,

  I've finished the translation. Who do I send the file to for
  integration and how can I have Lift pick it up in the meanwhile?

  You can place the file in src/main/resources/i18n and set the locale
  using LiftRules.localeCalculator

  /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] Overriding date/time formatting

2009-10-06 Thread Dirk Louwers

Hi,

After having toyed around with Scala and recently Lift for a few weeks
I have a question. To avoid jumping to conclusions let me first
explain what I am trying to achieve:

I am not happy with the way MappedDateTime parses strings and formats
dates by default. I want to be able to change these parsers/formatters
globally and/or on a per mapper field basis.

Here is what I did:

By looking at the sourcecode I noticed that following MappedDateTime
ultimately this depends on internetDateFormatter, dateFormatter and
toInternetDate inside TimeHelpers. Since I don't know how to change
the dependency of MappedDateTime on TimeHelpers to a subclass of
TimeHelpers I decided to break the dependency by subclassing
MappedDateTime and overriding _toForm and setFromAny and have my
setFromAny call a modified toDate that in turn depends on a custom
function to parse a string to a date. This function:
1) Tries to use a specifically definded DateFormat on the field
2) Tries to get a dateformat from a localized bundle
3) Falls back to the SHORT date format of the JVM locale.

Here is what I would like to know:

1) Is there a way to have Lift use a TimeHelpers subclass without
having to subclass stuff that depends on it?
2) Does anyone have suggestions how to improve/invalidate my approach?

Just checking to see if I am on the right path or making this
needlessly hard.
Thanks in advance for any response.

Best,

Dirk Louwers




--~--~-~--~~~---~--~~
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: Why fields are declared as 'object' with Mapper/Record?

2009-10-06 Thread Dirk Louwers

Well, I am only a beginner myself but here are my 2 cents:

- My guess is that they are declared as inner objects to make it
possible to reach certain global field properties through the
companion MetaMapper object.
- As far as I know traits cannot be directly instantiated, only
extended or mixed in.

Dirk Louwers

On Oct 6, 8:38 am, Oleg G. ojo...@gmail.com wrote:
 Sorry if its a stupid question, but why?

 I like the idea very much and trying to understand all the aspects.
 Fields declared as 'objects' can't be overridden. Is it intended? If
 so why?

 Consider following oversimplified example:
   trait Field
   trait Prop1
   trait Prop2
   trait Prop3

   class Person {
     val name = new Field with Prop1 with Prop2
   }

   class CustomPerson extends Person {
     override val name = new Field with Prop1 with Prop2 with Prop3
   }

 Is there something wrong?

--~--~-~--~~~---~--~~
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: Using ExtJS with Lift?

2009-08-07 Thread Dirk Louwers

Hi,

I am new to this group and have used ExtJS for some projects and have
recently stumbled across Scala and Lift and am very impressed with
both.

Stefan, I would greatly appreciate it if you could supply your
JsArtifacts trait implementation for ExtJS.
Another option that I'm trying now is to use ExtJS's JQuery adapter
which makes all the widget's DOM manipulation footwork and possibly
asynch calls done by JQuery. This way you can keep using Lift's full
JQuery support while being able to use Ext. However, the Ext's native
base library is more performant than JQuery's.

Thanks in advance. And nice to meet you.

Dirk Louwers

On Aug 5, 1:47 am, Stefan Scott stefanscottal...@gmail.com wrote:
 Thanks for this info, Marius.

 To get started with Lift I'm reading through the excellent book
 Exploring Lift you wrote with Eric and Tyler (version 27 July 2009),
 plus the source for the PocketChange app and liftweb, downloaded from
 GitHub.

 As I'm still finding my way through the various packages and file
 locations, I hope you can bear with me a bit while I think out loud
 here to make sure I understand where to put the .js files and the
 references for JavaScript resources which aren't integrated into
 lift.

 ***
 The only real question I have is way down towards the end of this
 message, at the end of point (a):

 Where do I put the 'toserve' directory, and how do I make sure that
 Maven uses it?

 Feel free to skip most of this lengthy message and just read point (a)
 which is the only real question I have. I'm still just getting used to
 Maven and how it pulls files from various locations either locally or
 online.

 ***

 (1) Searching in directory C:\www\work\PocketChange\ (I'm currently
 serving lift web apps just locally, running Jetty under Windows), I
 see several .js files for JQuery:

 date.js
 jquery.datePicker.js
 jquery.tablesorter.min.js
 jquery-ui.min.js

 in directory:

 C:\www\work\PocketChange\src\main\webapp\scripts\

 So it looks like I could put any needed .js files in that directory.

 Searching for the string .js *inside* all .html files in directory C:
 \www\work\PocketChange, I find the file:

 C:\www\work\PocketChange\src\main\webapp\index.html

 which contains the tag:

 script type=text/javascript src=/scripts/jquery-ui.min.js/
 script

 referencing the file:

 jquery-ui.min.js

 in directory C:\www\work\PocketChange\src\main\webapp\scripts\ above.

 So again it looks like I can put any needed .js files in that
 directory, and reference them in the app's .html file(s) as shown
 above.

 (One strange minor thing I noticed: if I search inside all .html files
 in directory C:\www\work\PocketChange\ for the string datePicker.js,
 it only shows up in lines that have been commented out. So one minor
 curiosity I have is: how is the code for datePicker.js being used?
 There appears to be a definition of it in jquery-ui.min.js, as well as
 a more readable definition of it in datePicker.js as well. I
 understand that JavaScript files are minified to remove unnecessary
 characters - does jquery-ui.min.js include the minified version of
 datePicker? Is file datePicker.js never sent to the browser?)

 (2) The search for the string .js inside all .html files also turned
 up two occurences in file:

 C:\www\work\PocketChange\src\main\webapp\templates-hidden\default.html

 in the tags:

 script id=jquery src=/classpath/jquery.js type=text/
 javascript/script
 script id=json src=/classpath/json.js type=text/javascript/
 script

 These seem to be referring not to individual JavaScript widgets - but
 maybe to entire JavaScript libraries.

 I couldn't find any relevant files called jquery.js on my machine -
 but reading section 7.8 Resource Server in the Exploring Lift book
 (pp. 119-120) I see it says that Maven puts .css (and presumably .js)
 resources to be served *inside* the WAR/JAR file, and lift uses the
 var LiftRules.resourceServerPath:

 var resourceServerPath = classpath

 to find these resources.

 The book goes on to say that in order to find a .css resource in a
 subdirectory such as:

 my-project\src\main\resources\toserve\css\mystyle.css

 I would call the following in Boot:

 ResourceServer.allow {
   case css :: _ = true

 }

 So, examining the lift source code for object ResourceServer in
 package net.liftweb.http (in directory ...\liftweb\lift\src\main\scala
 \net\liftweb\http\), I think I see how this is all put together:

 object ResourceServer {
   private var allowedPaths: PartialFunction[List[String], Boolean] = {
     case jquery.js :: Nil = true
     case yui :: _ = true
     case liftYUI.js :: Nil = true
     case json2.js :: Nil = true
     case json.js :: Nil = true
     case jlift.js :: Nil = true
     case bp @ (blueprint :: _) if bp.last.endsWith(.css) ||
 bp.last.endsWith(.png) = true
     case jquery-autocomplete :: jquery.autocomplete.js :: Nil