Re: [Lift] Re: Lift is awesome (with reservations)

2009-12-27 Thread David Flemström
On Monday 28 December 2009 03:54:24 Naftoli Gugenheim wrote:
> Which is why they are called "Proto"User and CRUDify. If you need something
> more custom, it's really not hard to build it.

It seems that this is the point that I simply haven't forced myself to 
understand yet. If this really is the case, then I'll just have to get used to 
it... I like the concept of "evolving" code meaning that I can write one user 
model, and expand on that model later without having to rewrite everything 
form scratch.

Anyways, thank you for your thought-through comments. I'll try to do some code 
reconnaissance later to see if I can find something else to nag about :-)

David Flemström


signature.asc
Description: This is a digitally signed message part.


Re: [Lift] Re: Lift is awesome (with reservations)

2009-12-27 Thread David Flemström
On Sun, Dec 27, 2009 at 9:30 AM, Marius  wrote:
> In \liftweb\lift-examples\hellolift\src\main\scala\com\hellolift\model
> \User.scala ... one of the Lift examples
>
> There is something like:
>
> object User extends User with MetaMegaProtoUser[User] {
>  override def dbTableName = "users"
>  override def screenWrap = Full( at="content">
>                               ) // LiftNote: 6
>  override def signupFields = firstName :: lastName :: email ::
> locale :: timezone :: password :: blogtitle :: Nil
>  override val skipEmailValidation = true // LiftNote: 4
>
>  override val basePath: List[String] = "user_mgt" :: "usr" :: Nil
> }
>
> Have you tried setting the signupField list to use only the override
> def signupFields = firstName :: password ::  Nil ?

This will only change what appears when the user registers. There will
still be columns in the database for the fields you left out, and
there will be entries for them on the user's settings page (last time
I checked; I will check again).

>> - I'd like to use ProtoUser, but need to change the labels for some of the
>> fields in the registration form because I want to localize the site. Please
>> remember that ProtoUser uses "S.??", which makes it impossible to add
>> translations and/or change the default wordings from the outside. How do I
>> proceed with the least amount of hacks (like by writing
>> field.displayName.replace("First Name", S.?("...")) + overriding the correct
>> functions with slightly changed versions of their original code)?
>
> Why it makes it impossible? You can take lift-core.properties file and
> put it in your WEB-INF/classes/i18n. Another approach is to tell Lift
> from where it should take the core resource bundle. Thus in your boot
> youcan say:
>
> LiftRules.liftCoreResourceName = "my_bundles"
>
> this is currently set to "i18n.lift-core"

I did not know this, and it wasn't possible AFAIK last I tried (6
months ago), so thank you for the information. This deserves more
documentation, and I'd be happy to help out if I can.
Something that would be useful would be a tool that lists all of the
available translation strings inside of LiftCore so that you don't
have to search the source code for them. Also, why is something like
"First Name" used for the translation key, and why is there a method
called S.? and S.?? in the first place if the resource system can be
unified anyways?

Hoping to hear other responses to the issues I mentioned, as well.

David Flemström

--

You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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.




Re: [Lift] Re: Lift is awesome (with reservations)

2009-12-26 Thread David Flemström
On Saturday 26 December 2009 15:30:34 Marius wrote:
> So I believe it is much more constructive for ALL of us to ask
> concrete questions, described concrete problems and let's see how we
> can fix it. Many things though may be subjective and leading to
> endless discussions without substance.
OK, then, concrete cases it is. I will try to transform the problems I 
mentioned before into concrete scenarios. Hopefully, this will shed some more 
light on what I mean.

- I want a user system where each user registers with an user name and a 
password, nothing else (not First Name, Last Name, E-mail etc; there shouldn't 
be any entries for them in the DB either). For this, I would prefer to use 
pre-existing utility classes in the Lift framework so that I don't have to 
start from scratch (by extending LongKeyedMetaMapper etc), because, oh I don't 
know, I don't want to code the whole user session management and password 
exchange process by hand (even though it might not be too difficult; it's 
reinventing the wheel nonetheless). How do I proceed?

- I'd like to use ProtoUser, but need to change the labels for some of the 
fields in the registration form because I want to localize the site. Please 
remember that ProtoUser uses "S.??", which makes it impossible to add 
translations and/or change the default wordings from the outside. How do I 
proceed with the least amount of hacks (like by writing 
field.displayName.replace("First Name", S.?("...")) + overriding the correct 
functions with slightly changed versions of their original code)?

- I'd like to take a mapped object that I have, and CRUDify it (hint, hint). 
In my mapped object (e.g. an user), I have some fields that should always 
appear (e.g. basic contact information), some that should appear only to 
administrators (e.g. email addresses), and some that should be read-only to 
normal users and editable by administrators and specific users but not appear 
to unregistered users (e.g. user profile images). Columns that should be 
invisible should not be rendered in the CRUDify "list" with contents like 
"permission denied"; their rendered columns should rather not appear at all. 
How do I proceed with the least amount of hacks?

- I'd like to use CRUDify again, but I need to use external templates (inside 
of HTML files) for the "list", "edit", etc... pages, since I need to change 
these templates after the application was compiled (or for some similar 
reason, like that view/model code should be separate). How do I proceed?

- Same situation like the above (need to control the CRUDify templates from 
the outside), but I want to use a different HTML snippet depending on which 
field is being rendered (I don't want to use an uniform table for the view, but 
maybe one where some fields are stacked over another, or arranged in a 
different 
constellation). Like this:
=




















=
The ""s etc above are of course template-specific view code that mustn't be 
in the logic code.
How do I do this with the least amount of hacks?

These are of course scenarios that are fabricated but I've experienced similar 
ones that I've had problems with before; I don't know if there's some kind of 
solution to them that I've just missed (after some through looking, I gave up 
on most of them and just wrote everything form scratch by copy-pasting Lift 
source code). It all boils down to there being very specialized "starter" 
classes like ProtoUser and CRUDify, that cannot be used for anything but very 
small test sites in practice since they aren't extensible.

> 
> Br's,
> Marius

PS. It may be that a lot of the quirks of Lift are explained in the Lift book, 
and I think that that's a good start. That doesn't make them any more 
intuitive, however. You can make any man (almost) into a rocket scientist by 
using education, but that doesn't make rockets any easier to understand. 

David Flemström


signature.asc
Description: This is a digitally signed message part.


Re: [Lift] Re: Lift is awesome (with reservations)

2009-12-25 Thread David Flemström
A propos:
On Sat, Dec 26, 2009 at 1:19 AM, Erkki Lindpere  wrote:
> * I think _? and _! in methods come from Ruby, but they don't fit the
> naming conventions in Java/Scala (I think Scala should mostly follow
> Java conventions with some exceptions). This is a really minor point
> though.
Please see:
http://www.codecommit.com/scala-style-guide.pdf
...which is the product of a recent discussion on scala-u...@epfl I believe.

David Flemström
david.flemst...@gmail.com

--

You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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.




Re: [Lift] Re: Lift is awesome (with reservations)

2009-12-25 Thread David Flemström
On Friday 25 December 2009 20:09:10 Timothy Perrett wrote:
> It would be really good for us as a team to know what it is you *dont*
> get? Is it conceptual? code? If we can understand what is daunting for
> newbies that would really be helpful.
I think that Mr. Lindpere basically made this pretty clear:
- The structure of Lift is too messy
- The documentation is unstructured
- Lift is not easy enough to understand without having to look at varying 
amounts of examples.

However, since I understand that these points are pretty... vague, I will 
elaborate with my own experience (which still is pretty on-topic) I had one 
year ago when I started using Lift. I'll try to picture the way I thought back 
then.

- It is difficult to track exactly how a request is handled: it goes through 
views/dispatchPF's, and then it suddenly ends up reading a HTML file with 
"http://github.com/alandipert/step
> 
> Cheers, Tim
> 

David Flemström
david.flemst...@gmail.com


signature.asc
Description: This is a digitally signed message part.