[Lift] Re: Serious widget action

2010-03-10 Thread aw

On Mar 10, 1:15 am, Timothy Perrett timo...@getintheloop.eu wrote:
 Personally, I would say forget ExtJS, compared to Cappuccino its streets 
 behind:

 http://cappuccino.org/

 Easily the most exciting UI framework out there right now

Perhaps I should add that I need sophisticated grids:
  http://www.extjs.com/deploy/dev/examples/#sample-3

A bunch of options like JQuery UI, YUI, and from what I see from
Cappuccino don't seam to come close to the kind of widget
sophistication that I am seeing in ExtJS.  Hence, ExtJS is my front
runner.  (Flex is ultimately competition, but I don't like dealing
with Flash.)

I have a sprinkling of JQuery usage in my app already, and my initial
thought was to simply use the JQuery adapter for ExtJS.
Alternatively, I could probably just rewrite my JQuery code in ExtJS
-- assuming then I would take the route to provide a jsArtifact for
ExtJS.

My real concern is factors like security and leveraging things like
SHtml.link -- I don't want an oil and water scenario.  I still need to
deep dive into ExtJS, but wanted to float the idea in case someone was
aware of a red flag before I wasted too much time.

It doesn't sound like anybody is using ZK [1], eh?

[1] http://zkoss.org/

-- 
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.



[Lift] Serious widget action

2010-03-09 Thread aw
It is time for me to add some serious widgets to my lift app.

So far, I am most enamored by ExtJS.
Another alternative could possibly be ZK.

Does anybody have any experience with these frameworks?  Can you
comment on why integrating them with Scala/Lift would be a bad idea
(or not work)?

I searched for some historical posts on ExtJS and discovered some
threads about it's license and how it impacts inclusion in the lift
framework.  Would a commercial license prohibit it from being a lift-
widget submodule candidate?

Does anybody have a better suggestion that you think can compete with
ExtJS?

-- 
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.



[Lift] IdPK Model boiler-plate

2010-03-07 Thread aw
My model classes mix-in IdPK and have the following boiler-plate for
equals and hashCode:

class Team extends LongKeyedMapper[Team] with IdPK {
  

  override def equals (other : Any) = other match {
case t : Team if t.id.is == this.id.is = true
case _ = false
  }

  override def hashCode = this.id.is.hashCode
}


I'm pretty sure I acquired this boiler-plate for equals and hashCode
from this Google Group.

Is this implementation for equals and hashCode a good idea?  If so,
shouldn't it be part of the IdPK trait?

-- 
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.



[Lift] Re: IdPK Model boiler-plate

2010-03-07 Thread aw
Done.  Issue 408.  Thanks!

https://www.assembla.com/spaces/liftweb/tickets/408-add-equals-and-hashcode-to-idpk-trait

On Mar 7, 11:53 am, David Pollak feeder.of.the.be...@gmail.com
wrote:
 Good idea.  Please open a ticket 
 athttps://liftweb.assembla.com/spaces/liftweb/ticketsand assign it to me.

-- 
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.



[Lift] Re: Response Optimizations too aggressive

2010-03-07 Thread aw

On Mar 4, 9:50 am, David Pollak feeder.of.the.be...@gmail.com wrote:
 On Thu, Mar 4, 2010 at 9:27 AM, aw anth...@whitford.com wrote:
  On Mar 4, 6:56 am, Naftoli Gugenheim naftoli...@gmail.com wrote:
   How about
   LiftRules.stripComments.default.set( () = !Req.isIE)
   etc.?

 This is where Lift's FactoryMaker shines.  You can modify the behavior of
 stripComments on a request-by-request basis.  You can have a snippet called
 from your default template that tests the request and does:

 LiftRules.stripComments.request.set(S.request.map(!_.isIE) openOr false)

 But, as you point out, that means that CometActors will not get the right
 settings... so you can set the rule on a session-by-session basis:

 LiftRules.stripComments.request.set(S.request.map(!_.isIE) openOr false)

I don't see the difference.  I presume that you meant to say:

LiftRules.stripComments.session.set(S.request.map(!_.isIE) openOr
false)

?  Alas, neither version works.  I get a syntax error:

[ERROR] ...\snippet\Hack.scala:31: error: value set is not a member of
net.liftweb.util.Maker[Boolean]
[INFO] LiftRules.stripComments.request.set(S.request.map(!_.isIE)
openOr false)
[INFO] ^
[ERROR] one error found

Seeing that request is really a RequestVar, I figure the mod is simple
(lose the .set), but:

[ERROR] ...\snippet\Hack.scala:31: error: value apply is not a member
of net.liftweb.util.Maker[Boolean]
[INFO] LiftRules.stripComments.request(S.request.map(!_.isIE)
openOr false)
[INFO] ^
[ERROR] one error found

Now I am puzzled because I actually do see a valid apply method for
Maker[Boolean] (see line 66 of Maker.scala).

So, what am I missing?  I think I really want:

LiftRules.stripComments.session(S.request.map(!_.isIE) openOr
false)

I feel close, but no compile...

-- 
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.



[Lift] Re: IdPK Model boiler-plate

2010-03-07 Thread aw
What's wrong with KeyedMapper's implementation?

Well, that was exactly why I was asking the question, Is this
implementation for equals and hashCode a good idea?  I had gotten
this at some point, been using it, and am only questioning it now
because if it truly is a good idea, I think it should be part of the
framework...

The hashCode implementation for KeyedMapper looks essentially the
same:

this.id.is.hashCode
vs.
primaryKeyField.is.hashCode

However, the equals implementation for KeyedMapper is a little
different:

 override def equals (other : Any) = other match {
case t : Team if t.id.is == this.id.is = true
case _ = false
  }

vs.

 override def equals (other : Any) : Boolean = {
other match {
  case null = false
  case km: KeyedMapper[Nothing,Nothing] if
this.getClass.isAssignableFrom(km.getClass) ||
km.getClass.isAssignableFrom(this.getClass) =
this.primaryKeyField == km.primaryKeyField
  case k = super.equals(k)
}
  }

There are some subtle differences.  I have never used inheritance with
Mapper to make a complex class hierarchy, so I'm not 100% sure of the
ramifications (or if it is even possible).


Personally, I would imagine that two mapper objects are equal using a
primary key comparison only as long as they are read-only singletons.
If I had instance #1 loaded into val A and again into var B, then
modified some elements of B, I would no longer expect A to equal B --
but with the above implementation, they remain equal as long as the
primary key field is not altered.

In JPA/Hibernate land, I actually have a different approach for equals
and hashCode:  each field is compared with the exception of the @Id
and @Version columns because they can change upon persistence, and so
are not part of the equality.  I leverage Apache Commons-Lang
builders:

@Override
public boolean equals (final Object obj) {
return EqualsBuilder.reflectionEquals(this, obj,
EXCLUDE_FROM_EQUALS_AND_HASH_CODE);
}

@Override
public int hashCode () {
return HashCodeBuilder.reflectionHashCode(this,
EXCLUDE_FROM_EQUALS_AND_HASH_CODE);
}

/**
 * Exclude fields from equals, hashCode, and compareTo that may
change upon
 * persistence.
 *
 * @see a href=http://www.hibernate.org/109.html;Best
strategies for
 * implementation of equals() and hashcode() in your persistent
classes./a
 */
private static final String [] EXCLUDE_FROM_EQUALS_AND_HASH_CODE =
{id, version};

So, if Hibernate suggests that you should NOT just compare the primary
key field, why should Lift-Mapper be doing that?

-- 
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.



[Lift] Re: 2.0-M3 SLF4J Logging

2010-03-06 Thread aw
Thanks Jeppe.  I definitely like this new logging stuff.  I updated
the wiki.

-- 
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.



[Lift] Re: superficial first impressions from a rails junkie

2010-03-06 Thread aw
I'm overall very impressed by the community response so far to this
post.  My first reaction to this was, please don't dismiss it (like
the first response seemed to).

Marius was quick to agree that the web site needs some work.  I have
to agree here.  I am surprised by a few things:
1.  So much activity, yet liftweb.net homepage is highly static.
There is no mention, for example, of the 2.0-M3 release, progress, new
features, etc.  A newbie really needs to dig into the Google Group and
source code, but the home page should be pulling you in.  I have
repeatedly complained that I can't seem to get aggregated scaladocs
for 2.0-M3 as easy as 1.0.  Why is the first impression for a newbie
so stale?
2.  The home page doesn't display correctly on IE.  It needs to (and
I'm sure this is an easy fix).  It may give an impression that Lift
itself is so cutting edge that you need Firefox or Chrome or something
-- but that is NOT the case.  IE is still (unfortunately) dominant
among businesses, and still has a decent market share, so it should
not be ignored.
3.  There are some real live solutions using Lift (like
foursquare.com), and the home page should point that out!  It helps
add credibility.  (The Novell Pulse demo was truly inspiring.)

A little while ago, someone was asking about a Lift project idea, and
I had recommended a Lift based CMS.  My thinking was that the lift
site itself could use it.  I love it when people eat their own dog
food -- it helps me buy into the solution.

On Mar 6, 9:02 am, jonathan mawson umpti...@gmail.com wrote:
 - How much of the difficulty that people seem to have in using Lift is
 intrinsic to the framework and how much to poor docs? What are the
 ***pay-offs*** for those design decisions that have made Lift harder to use?
 (Even when this simply means less Rails-like.) Communicating these would go
 a long way to reducing newbie frustration. Is Lift even designed to have as
 wide an appeal as RoR or Grails? If not, be frank about it and communicate
 where its strengths lie.

Documentation is a challenge:
 - Scala docs have been getting better, but overall they are still
pretty sparse.  I find myself requiring to read the scala code as the
docs are insufficient.  Certainly, this can be frustrating to a newbie
(though I do agree that it helps me learn Scala and Lift better).
 - The Wiki could be improved, and extended.  Is GitHub really the
best platform?  (I am a Confluence fan.)  Much like how GitHub was
ditched for Issue Tracking, I think some thought needs to be done
about the wiki platform.
 - White Papers don't really exist that explain the benefits of Lift's
features...  Topics that security, dependency injection,
optimizations, configuration management, etc. should be covered.
(Wiki might be a good storage and content management platform for this
information.)  A comparative analysis would be great:  solution in
Groovy/Grails vs. Scala/Lift vs. Ruby/Rails vs. Java/GWT vs. Java/Flex
vs. ColdFusion.  Many struggle with choosing a web framework, and the
Lift site should be explaining why they should choose Lift.
 - The Lift Book is already out of date, and it needs to grow.  For
some reason, it is sticking to 1.0 compliance, but so much has
changed.  This was my first serious introduction to the framework, and
this needs to be maintained in line with all the cool new features
that are being added.

Yesterday, I decided to upgrade my project from 2.0-M2 to 2.0-M3 and
take advantage of the new features.  In the 2.0-M3 announcement, it
really only had release notes -- there wasn't an explanation of how to
really use these new features.  Where is this information?  It should
be going to the Lift Book, but instead I had to triangulate the
information from searching the Google Group, reviewing Source Code,
and reviewing the Issue Tracker.  This definitely could be easier.

At the end of the day, Lift is a solid framework.  The attention to
stability is very impressive.  The attitude and activity from the
community is first rate.  I still question some aspects (like View
First, or when I would ever use a view), but I am still learning and
I think that Lift is still growing.

-- 
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.



[Lift] Re: Scaladocs

2010-03-05 Thread aw
Is there a way to get a consolidated scaladocs for 2.0-M3, just like
http://scala-tools.org/scaladocs/liftweb/1.0/ ?
The above link, for example, is just for common.
It is a major pain to have to traverse through the various projects
finding the right package, and the 1.0 docs are too out of date.

-- 
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.



[Lift] 2.0-M3 SLF4J Logging

2010-03-05 Thread aw
I just upgraded my code to M3 and also replaced my LOGGERs with the
new Loggable trait.  I am using LogBack (not Log4j).

I thought that with 2.0-M3, the following call would be deprecated and
no longer necessary:  Slf4jLogBoot.enable()
Alas, I discovered that it is still mandatory, otherwise I get a
NoClassDefFound exception for org.apache.log4j.Priority.
I thought SLF4J was enabled already, so I don't know why I need to
explicitly enable it.

Secondly, if you read the Wiki:  
http://wiki.github.com/dpp/liftweb/logging-in-lift
It says to exclude org.slf4j:slf4j-log4j12 from lift-mapper.
But I noticed that it is lift-webkit that has the dependency
(transitively from net.liftweb:lift-util) that needs to be excluded.
As a result, I have this instead:

dependency
groupIdnet.liftweb/groupId
artifactIdlift-webkit/artifactId
version2.0-M3/version
exclusions
exclusion
groupIdorg.slf4j/groupId
artifactIdslf4j-log4j12/artifactId
/exclusion
/exclusions
/dependency

I recommend updating the wiki entry.

Thanks!

-- 
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.



[Lift] 2.0-M3 JQuery 1.4

2010-03-05 Thread aw
I understand from Issue 363 that I can control which version of JQuery
to use.  I generally prefer the latest and greatest, and I see that I
am using 1.3.2, so I want to set it to 1.4.2.  According to this
thread:

http://groups.google.com/group/liftweb/browse_thread/thread/807a9397f1e3fa9?hl=en_US
I thought it was as easy as adding this line to boot:
LiftRules.jsArtifacts = JQuery14Artifacts

Alas, this doesn't seem to work for me as I am still getting 1.3.2...

Also, I see that Issue 311, which was closed in 2.0-M2, says that
1.4.1 is the default.  But I don't think that was the case, right?

Can somebody please tell me what I am missing?  This strikes me as a
good Wiki topic.  ;-)

-- 
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.



[Lift] Re: Response Optimizations too aggressive

2010-03-04 Thread aw
OK, I have disabled the stripping of comments:

LiftRules.stripComments.default.set( () = false )

It seems to work for me.


On Mar 4, 12:36 am, Jeppe Nejsum Madsen je...@ingolfs.dk wrote:
 aw anth...@whitford.com writes:
      !--[if IE 6] script type=text/javascript id=ie6fix ... /
  script ![endif]--

 Ross already described how to disable this, but this seems like a
 genuine useful feature (to not remove some comments). Iircc, there are
 other scenarios (such as AdWords) where you would like to keep the
 some comments.

 Not sure how to handle this in a general way though.

 In this case You can also handle it server side: Req.isIE6

 /Jeppe

Obviously, it would be great to make the stripComments variable
session specific where I could leverage something like isIE.  I do see
that FactoryMaker seems to have a session and request specific vending
concept, so this looks promising.  I think the code that actually does
the comment stripping is in LiftMerge, so I'm thinking that that would
need to be enriched too.  Ideally, I would like to see comments that
are not IE specific to be stripped.  (I am unfamiliar with AdWords and
how they use comments.)

Sound like a ticket?

Thanks everybody for the quick help!

-- 
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.



[Lift] Re: Response Optimizations too aggressive

2010-03-04 Thread aw
On Mar 4, 6:56 am, Naftoli Gugenheim naftoli...@gmail.com wrote:
 How about
 LiftRules.stripComments.default.set( () = !Req.isIE)
 etc.?

Well, this doesn't quite work because I need a Req class instance, not
just the static object.
Also, to me, this determination is really at the Session level rather
than the Request level as I don't expect it to change.  But of course
I don't have a Session.isIE field...  What about Comet responses?  I
have no Request in that scenario, but is it using the same code to
produce the xhtml?

I see that the Factory trait has a session-specific Maker and a
request-specific Maker, but it is unclear to me how I can get that
context.  I require more guidance.

-- 
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.



[Lift] Response Optimizations too aggressive

2010-03-03 Thread aw
After fielding calls as to why my UI doesn't look correctly on IE, I
discovered that Lift is doing an optimization in production mode
that is effectively breaking my application's compatibility for IE...

To get around IE6 deficiencies, I am leveraging JQuery.  For example,
if I have a CSS style that uses attribute selectors, like
input[type=checkbox], IE6 ignores them, but I can get JQuery to apply
the style.

Since this JavaScript applies to IE only, I wrap them in comments
like:

!--[if IE 6] script type=text/javascript id=ie6fix ... /
script ![endif]--

Firefox and Chrome will ignore these, which is perfect, and only IE
will pay attention (and suffer the overhead).

All was working fine in dev, then came time to roll out to production
and I naturally specified -Drun.mode=production.  Surprisingly,
production mode has an optimization that strips HTML comments from
the output.  Generally, I think this is a great idea -- EXCEPT if we
have IE specific comments responding to an IE browser.

Is there a way to modify the optimization so that IE specific comments
are retained?  Alternatively, can I simply disable this optimization
feature so that my IE users are OK?

How can I find out more about these production mode optimizations?
Is there a list?

I have drilled into Props.scala and I read it very carefully.  I think
of my environments as Dev/QA/Prod, but I think this translates best to
Test/Staging/Production in Lift-speak.  I am expecting that
production mode optimizations are applied to both Staging (aka QA)
as well as Production -- because I need to validate actual production
behavior.

Note that I am running 2.0-M2.

-- 
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.



[Lift] Re: Response Optimizations too aggressive

2010-03-03 Thread aw

On Mar 3, 10:56 pm, Ross Mellgren dri...@gmail.com wrote:
 There's a FactoryMaker in LiftRules that looks like it may do what you want 
 -- try:

 LiftRules.stripComments.default = () = false

 -Ross

This looks promising.  Alas:  error: reassignment to val

(I'm not familiar with FactoryMaker.)  I see that
LiftRules.stripComments is a val, not a var...  It's unclear to me how
to override this.

-- 
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.



[Lift] Re: ByList using OR instead of IN?

2010-03-01 Thread aw
I was searching for a prior thread and couldn't find it last night,
but I think I found it today:

http://groups.google.com/group/liftweb/browse_thread/thread/1cf5c0e153e98b47/5b60451a961ad78d?lnk=gstq=ByList#
Is this the thread you are referring to?

It leaves me with much to be desired since the precise issue is
unclear and limited to Postgres.  (It sounds like the author might
have experienced the issue with the IN (select ...) construct which
isn't even the same thing.)

I like James Iry's idea that the final SQL would be dependent on the
database dialect (Driver, I guess).  I know that different vendors
have different limits for the number of elements in an IN clause.  If
we had a limit of 250, for example, but had 300 items, you could
transform it into:

where (a in (1, 2, 3, ..., 250) or a in (251, 252, ..., 300))

That would be clever (and probably necessary if the database vendor
has a relatively small number for the maximum number of IN clause
elements).  I'm pretty sure that Oracle has a limit of 1,000 elements
for an IN clause, and I can't imagine requiring more than that.

For the average case ( 30 items), the IN clause is going to be easier
to read, faster to parse, and likely faster to execute on almost all
database vendors -- that is why I like it.

(I luckily don't have a large data set right now, so this won't bother
me too much.)

-- 
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.



[Lift] Re: New logging code is in master

2010-03-01 Thread aw
Very nice!  I am looking forward to this.

On Feb 28, 8:14 am, Jeppe Nejsum Madsen je...@ingolfs.dk wrote:
 The new logging code is now in master and should be fully usable.
 Therefore, the existing logging code has been deprecated.

 I've added a Wiki article 
 here:http://wiki.github.com/dpp/liftweb/logging-in-lift

 /Jeppe

-- 
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.



[Lift] ByList using OR instead of IN?

2010-02-28 Thread aw
From reading Exploring Lift (Section 6.1, page 81), it says that
ByList corresponds to the “field IN (x,y,z)” syntax in SQL.
Well, that was what I needed, so I took it for a test drive.  However,
instead of seeing SQL like:  where some.id in (4, 9, 20)
I am seeing SQL like:  where some.id = 4 or some.id = 9 or some.id =
20.

I double checked the latest code:
  
http://github.com/dpp/liftweb/blob/master/framework/lift-persistence/lift-mapper/src/main/scala/net/liftweb/mapper/MetaMapper.scala
and it looks like there isn't a magical workaround to get IN working
as I expected.

To me, this is a violation of SQL Tuning 101:  as a rule of thumb,
prefer the IN clause over an OR clause.

Is there a good reason why this code creates OR clauses instead of an
IN clause?

-- 
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.



[Lift] Re: This is the style of SQL persistence that I like ...

2010-02-24 Thread aw

On Feb 24, 12:47 pm, Jeppe Nejsum Madsen je...@ingolfs.dk wrote:
 We're currently using Rails migrations and I've been thinking if
 putting migrations into the app is really the right approach? What
 happens if migrations fail? It's not easy for the app itself to
 rollback to the previous version :-)

There is obviously a strong relationship between the code and the
database, especially when you are adding columns/fields to tables/
classes, so I like managing the code and database together.  But as
much as I like the DSL approach of Scala-Migrations, I'm sticking with
the richness of Liquibase:  http://liquibase.org/

-- 
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.



[Lift] Re: Setting run mode for Lift applications

2010-02-20 Thread aw
On Feb 18, 9:14 am, Petr Pudlak petr@gmail.com wrote:
     Hi all,

 I've written my first application using Lift and now I'm deploying it
 into a production. I find it inconvenient that the run mode is
 specified as a JVM system property.

 First, sometimes JVM system properties are inaccessible, for example
 when deploying to a hosted servlet container.

 Second, it's impossible to run different lift applications with
 different run modes in a single
 servlet container.

I have sympathy for your first point, but am suspicious about the
second point.  I generally don't recommend running applications in
different modes/environments on a single servlet container because
you run the risk that a destabilizing factor in Dev or QA could impact
a Production system, for example.  A dev servlet container instance
that hosted just dev instances, for example, would make sense, but
these would share the same run.mode.

 Generally, I believe that a *Java web application shouldn't be
 configured by JVM system properties*. I suggest that the run mode
 should be configured by a servlet context initialization parameter,
 called for example lift.run.mode. Or, for maximum flexibility, both
 alternatives should be provided.

Servlet context initialization parameters break down because the
servlet configuration is baked into the artifact, yet the goal is to
run the same artifact across several environments.  (Sure, there are
things like the global web.xml, but if you can't access system
properties, I don't see how you will change the global web.xml.)

Any other ideas?

-- 
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.



[Lift] Page transition using location.replace

2010-02-14 Thread aw
Is there a way to do a page transition using location.replace?
In some cases, I am interested in not having the back button function.
I think I am looking for an SHtml.link variation that leverages
location.replace.
Perhaps an S.redirectTo variation too.

-- 
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.



[Lift] Re: Page transition using location.replace

2010-02-14 Thread aw
Because I don't like how my back button can return me back to a state
that is no longer true.

In my particular use-case, I am drilling into an item and either want
to do an action or cancel.
Completing an Action, or hitting Cancel, will put me back on the
viewItem page, after possibly executing an action.
I really don't like the Back button functioning in this case because
if the user hits the back button, then the user can resubmit the
action.  Sometimes, that could be dangerous or confusing.

On Feb 14, 4:14 am, Timothy Perrett timo...@getintheloop.eu wrote:
 Why? What would be a good reason for doing this...?

 On 14 Feb 2010, at 08:06, aw wrote:
  Is there a way to do a page transition using location.replace?
  In some cases, I am interested in not having the back button function.
  I think I am looking for an SHtml.link variation that leverages
  location.replace.
  Perhaps an S.redirectTo variation too.

-- 
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.



[Lift] Re: Forcing Authentication not working

2010-02-08 Thread aw
On Feb 7, 11:31 pm, Marius marius.dan...@gmail.com wrote:
 Please open a defect herehttp://www.assembla.com/spaces/liftweb/tickets

Would love to, but the New Ticket button does not seem to exist...
Is this project configured correctly to accept non-teammate
submissions?

-- 
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.



[Lift] Re: Forcing Authentication not working

2010-02-07 Thread aw
Thank you for responding, and I can use your advice to make my code a
little less verbose and concise.  Alas, it did not address my core
issue of forcing authentication.  The behavior is exactly the same.

If I go to a protected resource with a Role requirement, then
authentication and an authorization check is performed.  But
otherwise, nothing, and I need the authentication done because that is
what defines the roles, and I have some pages that are accessible, but
adjust due to a user's restrictions (fine-grained access control)...

Perhaps it would help to elaborate on my solution...

My authentication mechanism is really done by a special SSO Filter.
The Filter populates the HTTPRequest's remote user, so then Lift can
simply ask that for who was authenticated.  While the Servlet layer
has a valid username, I still need to build some kind of bridge to
Lift land.  As a result, I have a specialized HttpAuthentication like
so:

case class FilterAuthentication (authorizationFunc:
PartialFunction[(String), Boolean]) extends HttpAuthentication {

  /** Extract the remote username from the HTTP Request. */
  private def authenticatedUsername (r : Req) =
r.request.asInstanceOf[HTTPRequestServlet].req.getRemoteUser().toLowerCase()

  /** Extract the Authenticated User and call the Authorization
function. */
  def verified_? = {
case req = {
  authenticatedUsername(req) match {
case u if null != u  u.length  1 
authorizationFunc.isDefinedAt(u) = authorizationFunc(u)
case _ = false
  }
}
  }
}

Then, I need to hook this into LiftRules like so:

LiftRules.authentication = FilterAuthentication( {
  case username = Log.info(Authenticating:  + username)
val isAuthorized = Auth.isAuthorized(username)
if (isAuthorized) {
  val authorizedRoles = Auth.authorizedRoles(username)
  userRoles(authorizedRoles)
}
isAuthorized
})

Note that the Filter will acquire an authenticated user -- but that
user may still not have access to this particular application.  As a
result, I need to do the isAuthorized check that basically does a
lookup to see if jdoe, for example, is authorized to access my
application.  If he is, then roles are populated and true is returned;
if not, false is returned.

I need to restrict some pages, so I do something like:

LiftRules.httpAuthProtectedResource.prepend {
  case Req(restricted :: _,_,_) = restrictedRole
  case _ = Empty
}

If the user goes to /restricted/, then I see the authentication and
authorization kick in.  But I am also interested in authentication
(i.e. validating that the user is allowed to access the application)
even if index.xhtml is hit.  I thought I am telling Lift to do that
with the case _ = Empty.

I am not using the siteMap to generate my menus because I need to
control the styling.  As a result, when I create my menus, I do
something like:

lift:Auth.secure role=restricteda href=/restricted/Restricted
Access/a/lift:Auth.secure

In my case, I actually have the privilege, so I should see this link,
however because Lift isn't calling the FilterAuthentication logic, it
doesn't know my roles and hence hides the link.
If I go to /restricted/, then all is well...

In summary, according to the documentation, returning an Empty should
force an authentication, but that doesn't seem to be working.  Am I
doing something wrong?  Or is the documentation incorrect?  Or is
there a bug in 2.0-M1?

(This is a big show stopper for me, so I certainly appreciate the
assistance.)

-- 
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.



[Lift] Re: Forcing Authentication not working

2010-02-07 Thread aw
OK, I think I found the source code that is the culprit.  From
LiftServlet.scala:

http://github.com/dpp/liftweb/blob/master/framework/lift-base/lift-webkit/src/main/scala/net/liftweb/http/LiftServlet.scala

  private def authPassed_?(req: Req): Boolean = {

val checkRoles: (Role, List[Role]) = Boolean = {
  case (resRole, roles) = (false /: roles)((l, r) = l ||
resRole.isChildOf(r.name))
}

val role = NamedPF.applyBox(req,
LiftRules.httpAuthProtectedResource.toList)
role.map(_ match {
  case Full(r) =
LiftRules.authentication.verified_?(req) match {
  case true = checkRoles(r, userRoles.get)
  case _ = false
}
  case _ = true
}) openOr true
  }

This logic seems to be inconsistent with the documentation found in
LiftRules.scala:

http://github.com/dpp/liftweb/blob/master/framework/lift-base/lift-webkit/src/main/scala/net/liftweb/http/LiftRules.scala

  /**
   * Defines the resources that are protected by authentication and
authorization. If this function
   * is notdefined for the input data, the resource is considered
unprotected ergo no authentication
   * is performed. If this function is defined and returns a Full can,
it means that this resource
   * is protected by authentication,and authenticated subjed must be
assigned to the role returned by
   * this function or to a role that is child-of this role. If this
function returns Empty it means that
   * this resource is protected by authentication but no authorization
is performed meaning that roles are
   * not verified.
   */
  val httpAuthProtectedResource =
RulesSeq[HttpAuthProtectedResourcePF]

Shouldn't there be something like:

  case Empty =
LiftRules.authentication.verified_?(req)

?

-- 
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.



[Lift] Forcing Authentication not working

2010-02-06 Thread aw
According to:

http://scala-tools.org/mvnsites-snapshots/liftweb/lift-base/lift-webkit/scaladocs/net/liftweb/http/LiftRules$object.html#httpAuthProtectedResource

It says that if I have a rule that responds with Empty, it means that
authentications is performed, but not an authorization check.  This is
what I need.  So, I have a rule something like:

LiftRules.httpAuthProtectedResource.append {
  case req :  Req = req.path match {
case ParsePath(restricted :: _, _, _, _) = restrictedRole
case _ = Empty
  }
}

Alas, I can clearly see that my authentication is NOT being performed
for just any page.

Am I missing something, or is the documentation incorrect, or is this
a bug?  Note that I am using 2.0-M1.

-- 
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.



[Lift] Re: Tomcat/Apache ESME: Shutdown Problems

2010-02-03 Thread aw
I don't think this issue is related to Derby because I am seeing this
problem too -- but I am not using Derby.

What version of Tomcat are you using?  I am using 6.0.24 on either
Windows or Solaris 10 and see these errors too, like:

Feb 3, 2010 10:49:22 PM org.apache.catalina.loader.WebappClassLoader
clearThreadLocalMap
SEVERE: A web application created a ThreadLocal with key of type
[java.lang.ThreadLocal] (value [java.lang.threadlo...@1a517bd]) and a
value of type [scala.collection.mutable.HashMap] (value [Map()]) but
failed to remove it when the web application was stopped. To prevent a
memory leak, the ThreadLocal has been forcibly removed.
Feb 3, 2010 10:49:22 PM org.apache.catalina.loader.WebappClassLoader
clearThreadLocalMap
SEVERE: A web application created a ThreadLocal with key of type
[java.lang.ThreadLocal] (value [java.lang.threadlo...@258c74]) and a
value of type [net.liftweb.common.Empty$] (value [Empty]) but failed
to remove it when the web application was stopped. To prevent a memory
leak, the ThreadLocal has been forcibly removed.
Feb 3, 2010 10:49:22 PM org.apache.catalina.loader.WebappClassLoader
clearThreadLocalMap
SEVERE: A web application created a ThreadLocal with key of type
[java.lang.ThreadLocal] (value [java.lang.threadlo...@258c74]) and a
value of type [net.liftweb.common.Empty$] (value [Empty]) but failed
to remove it when the web application was stopped. To prevent a memory
leak, the ThreadLocal has been forcibly removed.
Feb 3, 2010 10:49:22 PM org.apache.catalina.loader.WebappClassLoader
clearThreadLocalMap
SEVERE: A web application created a ThreadLocal with key of type
[org.slf4j.impl.CopyOnInheritThreadLocal] (value
[org.slf4j.impl.copyoninheritthreadlo...@1bb35b]) and a value of type
[null] (value [null]) but failed to remove it when the web application
was stopped. To prevent a memory leak, the ThreadLocal has been
forcibly removed.
Feb 3, 2010 10:49:22 PM org.apache.catalina.loader.WebappClassLoader
clearThreadLocalMap

Note that while there is a Lift object, there are also lots of other
objects, so I'm not convinced that there is a problem with Lift...

I got the impression that Tomcat added this detection logic in
6.0.24.  I don't know how to really fix it.  (BTW, I found that I
usually only need to kill, not a kill -9.)

-- 
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.



[Lift] Re: Tomcat/Apache ESME: Shutdown Problems

2010-02-03 Thread aw
I just noticed this:

Feb 3, 2010 10:49:23 PM org.apache.coyote.http11.Http11NioProtocol
destroy
INFO: Stopping Coyote HTTP/1.1 on http-8080
Feb 3, 2010 11:19:20 PM org.apache.catalina.loader.WebappClassLoader
loadClass
INFO: Illegal access: this web application instance has been stopped
already.  Could not load net.liftweb.http.SessionMaster$$anonfun$1$
$anonfun$apply$11$$anonfun$apply$12.  The eventual following stack
trace is caused by an error thrown for debugging purposes as well as
to attempt to terminate the thread which caused the illegal access,
and has no functional impact.
java.lang.IllegalStateException
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:
1370)
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:
1329)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:
319)
at net.liftweb.http.SessionMaster$$anonfun$1$$anonfun$apply
$11.apply(LiftSession.scala:162)
at net.liftweb.http.SessionMaster$$anonfun$1$$anonfun$apply
$11.apply(LiftSession.scala:159)
at scala.Iterator$class.foreach(Iterator.scala:414)
at scala.Iterator$$anon$7.foreach(Iterator.scala:36)
at net.liftweb.http.SessionMaster$$anonfun
$1.apply(LiftSession.scala:159)
at net.liftweb.http.SessionMaster$$anonfun
$1.apply(LiftSession.scala:136)
at net.liftweb.actor.LiftActor
$class.execTranslate(LiftActor.scala:252)
at net.liftweb.http.SessionMaster
$.execTranslate(LiftSession.scala:91)
at net.liftweb.actor.SpecializedLiftActor$class.net$liftweb
$actor$SpecializedLiftActor$$processMailbox(LiftActor.scala:147)
at net.liftweb.actor.SpecializedLiftActor$$anonfun$3$$anonfun
$apply$1.apply(LiftActor.scala:114)
at net.liftweb.actor.SpecializedLiftActor$$anonfun$3$$anonfun
$apply$1.apply(LiftActor.scala:114)
at net.liftweb.actor.LAScheduler$$anonfun$1$$anon$1$$anon
$2.run(LiftActor.scala:42)
at java.util.concurrent.ThreadPoolExecutor
$Worker.runTask(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
Exception in thread pool-2-thread-4 java.lang.NoClassDefFoundError:
net/liftweb/http/SessionMaster$$anonfun$1$$anonfun$apply$11$$anonfun
$apply$12
at net.liftweb.http.SessionMaster$$anonfun$1$$anonfun$apply
$11.apply(LiftSession.scala:162)
at net.liftweb.http.SessionMaster$$anonfun$1$$anonfun$apply
$11.apply(LiftSession.scala:159)
at scala.Iterator$class.foreach(Iterator.scala:414)
at scala.Iterator$$anon$7.foreach(Iterator.scala:36)
at net.liftweb.http.SessionMaster$$anonfun
$1.apply(LiftSession.scala:159)
at net.liftweb.http.SessionMaster$$anonfun
$1.apply(LiftSession.scala:136)
at net.liftweb.actor.LiftActor
$class.execTranslate(LiftActor.scala:252)
at net.liftweb.http.SessionMaster
$.execTranslate(LiftSession.scala:91)
at net.liftweb.actor.SpecializedLiftActor$class.net$liftweb
$actor$SpecializedLiftActor$$processMailbox(LiftActor.scala:147)
at net.liftweb.actor.SpecializedLiftActor$$anonfun$3$$anonfun
$apply$1.apply(LiftActor.scala:114)
at net.liftweb.actor.SpecializedLiftActor$$anonfun$3$$anonfun
$apply$1.apply(LiftActor.scala:114)
at net.liftweb.actor.LAScheduler$$anonfun$1$$anon$1$$anon
$2.run(LiftActor.scala:42)
at java.util.concurrent.ThreadPoolExecutor
$Worker.runTask(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassNotFoundException:
net.liftweb.http.SessionMaster$$anonfun$1$$anonfun$apply$11$$anonfun
$apply$12
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:
1484)
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:
1329)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:
319)
... 15 more

Maybe there is a shutdown order issue?

-- 
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.



[Lift] Re: Lift security vulnerability

2010-02-02 Thread aw

On Feb 2, 4:57 pm, David Pollak feeder.of.the.be...@gmail.com wrote:
 I'd like to get a sense of how important the community views this defect.
 Is it a backport the fix to every milestone and release yesterday or is it
 a fix it in 2.0-M2 or someplace in between.

I vote for 2.0-M2.

-- 
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.



[Lift] Re: Mapper CamelCase vs snake_case

2010-01-30 Thread aw

 Not sure what your use case is here:

 1) A single mapped object can exist in different dbs?
 2) Different mapped objects can exists in different dbs?

 With the current design, 1) is not possible. Once the name of a field
 has been determined, it'll stay fixed.

 2) Might be doable if we add the connection identifier as parameter to the 
 function
 that decides the names.

 In general, I don't think we should be too smart about this. There will
 probably always be scenarios that can fail, in which case you can
 manually override the name (except in 1) above :-)

My use case is really #2.  Imagine a Lift App that connects to a
Sybase database and an Oracle database.  I have Mapped objects for
each.  The Sybase objects should use camelCase, while the Oracle
objects should use snake_case.

My other goal is to be agnostic at the code level.  I want to be able
to create an application that could be deployed on several database
platforms.  (Like I can theoretically do with Hibernate.)  So, I want
to be able to define a Mapped class as straight forward as possible
(i.e. declare my primary key id (idPK trait), and the various fields,
etc.)  I don't want to make choices in the Mapped object that depend
on the underlying database platform.  Overriding the column name is
one of those choices; by overriding the dbColumName = 'widgetsHit', I
am making the camelCase/snake_case decision.

I'm not sure that I foresee use case #1...  (I'm not sure that is even
something that I could do in Hibernate.  I certainly have never needed
that functionality.)

FWIW...  JPA is not without its issues.  I don't like the fact that
the @Column annotation has a columnDefinition that is one value.
Certainly, you want to use it sparingly, but once you define it, you
have made your code database platform specific.  You can't say at this
level, for Sybase or SQL Server, the type is 'bit' and for Oracle,
the type is 'number(1)'.  I know there are ways around this -- you
need to come up with different orm.xml's for each database
platform...  But somehow, the spec breaks down for me.

-- 
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.



[Lift] Re: jQuery 1.4

2010-01-30 Thread aw

On Jan 27, 3:49 pm, Jonathan Hoffman jonhoff...@gmail.com wrote:
 Another change that comes to mind: Default to the unminified version in 
 DevMode

Oh, I like this idea!

I always have to hack my build and rebuild to get the uncompressed
version to debug an error, so the proposed trick would be smarter and
far more convenient.  This should be available for Lift built-in
javascript/css libraries, as well as additional ones.

(Maybe this idea deserves its own discussion thread.)

-- 
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.



[Lift] Re: Lift logging improvements

2010-01-27 Thread aw
One thing that bugs me is how all the logging comes from one logger:
lift [Slf4jLogger.scala:110]
As a result, you don't have the granularity to adjust just
org.liftweb.http or org.liftweb.mapper, for example.

I liked your suggestion about adding a Logging trait:
http://groups.google.com/group/liftweb/browse_thread/thread/6aa012b673946242/b51747a0009ebae2?lnk=gstq=LOGGER#b51747a0009ebae2
I'm thinking this would be a nice addition to the framework.

-- 
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.



[Lift] Re: Mapper CamelCase vs snake_case

2010-01-27 Thread aw
Would it make sense to have the ConnectionIdentifier play a role?
(Including DefaultConnectionIdentifier.)

Because, for me, the decision to use snake_case or camelCase depends
on the capabilities of the database.  If I have an application with
multiple database connections, the decision for snake_case or
camelCase is not universal.

-- 
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.



[Lift] Re: FIXME comet type Full(xxx) name Full(yyy) timeout

2010-01-26 Thread aw
My code is a variation of the Chat sample code.  To me, the material
change is the fact that I am running this on Tomcat (6.0.20).  I have
never seen this behavior using Jetty (mvn jetty:run) and it isn't
really load related because I am the only user (possibly with two
browser windows).

-- 
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.



[Lift] Re: Tomcat tips

2010-01-26 Thread aw
  Freeze in terms of minutes.  But sorry, I haven't timed it yet.

I stumbled across my issue again and checked the logs and the freeze
is apparently 522 seconds:

09:31:41.124 INFO  [http-8080-exec-8] lift [Slf4jLogger.scala:110] -
Service req
uest (GET) /mobile/mypage/ took 522397 Milliseconds

I can also confirm that CPU is 99% idle.

  Is anybody actually using Tomcat and Comet together with Lift?  Or is
  this oil and water?

 http://much4.usis Tomcat and Lift and has been running flawlessly for
 nearly 2 years.

Excellent news...  I enabled NIO on Tomcat thinking that it will help,
but still experiencing symptoms.  Since I never saw symptoms with
Jetty, I wondered if there were tips on configuring Tomcat for Lift.
Alas, doesn't sound like that would be the problem.

 Based on the other thread, you have a logic error in your Comet render
 method.  The application server is not freezing, the page is taking a long
 time to render and it's taking a long time to render because it's waiting
 for the comet component to render itself.  If the behavior differs between
 Jetty and Tomcat, it's likely that you have some sort of deadlock in your
 code that's triggered based on the timing that you get out of Tomcat.  It's
 not a Lift thing.

BTW...  I'm actually not 100% convinced my freeze problem is related
to Comet.  I actually am experiencing the freeze pulling up a non-
comet page.  I can confirm that the freeze is not related to the
database because each database query is coming pack in less than 10
ms.


Can I also assume that Browser choice is irrelevent?  Most of my
development testing was with Chrome, but now I am using IE (6 and 8)
in my testing.  That shouldn't matter, right?

-- 
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.



[Lift] FIXME comet type Full(xxx) name Full(yyy) timeout

2010-01-25 Thread aw
Mega weird!  Randomly I seem to be running into a problem with my
Comet code.  My xhtml doesn't render properly, and if I view source I
see this:

!--FIXME comet type Full(JournalClient) name Full(Other) timeout--

Uhm...  What does this mean?  What exactly is timing out?  Any idea
why it would be random?

(Note that if I wait a few minutes, the page works fine.  (No code
changes!)  This kind of stability (or lack thereof) is not going to
win me points...)

Help please!

-- 
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.



[Lift] Re: Tomcat tips

2010-01-25 Thread aw
 Can you define freeze?  Is that the Java process stops for a short period
 of time (~1 second)?  A long period of time (many minutes)?  Until you
 restart the Java process?  What does the CPU utilization look like?  Is the
 freezing for a single client/browser or all of them?

Freeze in terms of minutes.  But sorry, I haven't timed it yet.

I just posted a symptom here:  
http://groups.google.com/group/liftweb/browse_thread/thread/1d91ce365ed22216#

I decided to drill into my issue in more detail to try and find an
error message, stack trace, memory issue, CPU consumption -- anything
that might give me a hint.  Alas, the closest thing I have is the
FIXME comet timeout message.

I'd like to add that the code works some of the time (so I know that I
don't have a syntax error).  When it doesn't work, it is seemingly
random.  Not necessarily failing due to high load.  And actually, I am
the only one hitting the server (with perhaps two browser windows at
the most) right now.  So, it isn't like I have hundreds of users...


Is anybody actually using Tomcat and Comet together with Lift?  Or is
this oil and water?

Note that I am not using APR.  I don't think I am using NIO.  And I do
have compression turned on.  But that shouldn't matter, right?

-- 
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.



[Lift] Re: Lift 2.0 on Scala 2.8 update

2010-01-24 Thread aw

On Jan 24, 10:47 am, Indrajit Raychaudhuri indraj...@gmail.com
wrote:
 To ensure minimal delta between the master and 280_port_refresh, the
 codebase in master has been adjusted considerably to improve Scala 2.8
 compatibility. Thus, the master branch continues to be on Scala 2.7.7
 but is lot more Scala 2.8 friendly now. In fact, most of the modules
 (and all the examples) build cleanly on both 2.7 and 2.8 without any change.

Is a summary of these changes being maintained somewhere?  (Like the
wiki?)  Because I, and I'm sure other Lifters, would be interested in
making our code more 2.8 friendly without sacrificing 2.7
compatibility to ease our eventual migration.

-- 
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.



[Lift] Tomcat tips

2010-01-24 Thread aw
I have been developing my Lift app using the Jetty plugin on Windows,
but now am deploying production on a Tomcat 6 server on Solaris.  I
don't exactly have great details at this moment, but I will admit that
I am observing some behavior differences in Tomcat that I don't see
with Jetty.  I do still have a couple of configuration tweaks to make,
but I don't think that those are the underlying culprit.  My main
symptom is that Tomcat randomly seems to freeze.  I need to drill
into this more to isolate the problem, recreate it, and inspect the
log files, but I thought I would ask first...

Does anybody have any tips for deploying Lift apps on Tomcat?  I
assumed that I could just deploy the war and everything would work
just like on Jetty.  Alas, I realize now that the Comet implementation
is different for Jetty vs. other containers.  I am assuming, however,
that Tomcat can still do Comet reliably.  If there are any
configuration tasks that are necessary or recommended, I would
appreciate a heads up.

I am using 2.0-M1.

Thanks.

-- 
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.



[Lift] Re: Database Default for MappedDateTime

2010-01-23 Thread aw
Arguably, the primary key is a special case of my problem.

I have an object.  I populate some fields.  Upon persistence, some
fields (like the primary key) is populated.  In my particular example,
the field is populated due to a Default rule, but it could just as
well be a Trigger.

Fortunately, JDBC does provide a mechanism to provide the PK ID upon
an insert (if you use it, and your JDBC driver and Database server
supports it).  This mechanism avoids a subsequent select after an
insert.

I thought that I could work around my particular problem by declaring
the field nullable (in Scala, yet leave it not null in the
database)...  How do I do that?

-- 
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.



[Lift] Database Default for MappedDateTime

2010-01-19 Thread aw
I have an Oracle table that has a timestamp column with a default
value (current_timestamp).  Mapper doesn't allow a save operation
unless I specifically specify a value for the timestamp column.  I
would prefer to leverage the database's timestamp vs. the middle
tier's.  Is there a way that I can get the save operation to work?
Note that it doesn't fail -- an exception was thrown.
-- 
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.




[Lift] 1.1-M8 to 2.0-M1 behavior change

2010-01-17 Thread aw
I have this code:

object Auth {
def username = S.containerRequest.map( r = r.asInstanceOf
[HTTPRequestServlet].req.getRemoteUser() ).openOr(UNKNOWN_USER)
}

The background is that I have my own Servlet Filter that performs
authentication.  It fits in the chain before the Lift Filter.  For
Lift, then all I need to do is ask the HTTPRequestServlet's remoteUser
for the user context.


I recently migrated from 1.1-M8 to 2.0-M1.  In 1.1-M8, I would get the
remote user.  In 2.0-M1, I am getting UNKNOWN_USER.

What changed between 1.1-M8 and 2.0-M1 to break this?

How can this code be changed to work as I expected?

Thanks.
-- 
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.




[Lift] Re: Excessive select DISTINCT

2010-01-17 Thread aw
Note that I still see the excessive DISTINCTs in 2.0-M1.
-- 
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.




[Lift] Re: Schemifier broken for Oracle

2010-01-14 Thread aw
I found my issue -- the problem was that I specified
DB.globalDefaultSchemaName, and that was interfering with Schemifier.
Tried 2.0-SNAPSHOT too, but same issue.

I have another thread on trying to change the schema name:
   http://groups.google.com/group/liftweb/browse_thread/thread/00f7a484e9e71c73#

Sorry for the false alarm about Schemifier.
-- 
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.




[Lift] Re: Default Schema for DefaultConnectionIdentifier

2010-01-14 Thread aw
OK, I'm not 100% sure what DB.globalDefaultSchemaName is supposed to
do because specifying it broke Schemifier as well as my queries.
Certainly, it sounded like what I needed, but doesn't do what I
expected...

Basically, I am looking for the Lift equivalent to:
hibernate.default_schema

(See section 3.4: 
http://docs.jboss.org/hibernate/core/3.3/reference/en/html/session-configuration.html
)
-- 
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.




[Lift] Excessive select DISTINCT

2010-01-14 Thread aw
I enabled SQL logging recently, and started looking at the generated
SQL from Mapper.  I was surprised to see that select DISTINCT was
generally being done for queries when it is not necessary.  Is that
really necessary?

For example:
Team.findAll(OrderBy(Team.name, Ascending))
translated to:
SELECT  DISTINCT team.code, team.name, team.id FROM team   ORDER
BY name  ASC

Queries should perform better without a redundant DISTINCT operation.

I must say that I am surprised to see the DISTINCT added when a
Distinct object/class exists -- I would have expected that I would
have needed to use the Distinct object/class in order to generate the
DISTINCT keyword.
-- 
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.




[Lift] Re: Default Schema for DefaultConnectionIdentifier

2010-01-13 Thread aw
I found DB.globalDefaultSchemaName, but the Schemifier is still
breaking:

java.util.NoSuchElementException: key not found: mytablename
at scala.collection.Map$class.default(Map.scala:169) [scala-
library-2.7.7.jar:na]
at scala.collection.mutable.HashMap.default(HashMap.scala:33)
[scala-library-2.7.7.jar:na]
at scala.collection.Map$class.apply(Map.scala:80) [scala-
library-2.7.7.jar:na]
at scala.collection.mutable.HashMap.apply(HashMap.scala:33)
[scala-library-2.7.7.jar:na]
at net.liftweb.mapper.Schemifier$$anonfun$6$$anonfun$apply
$8.apply(Schemifier.scala:193) [lift-mapper-1.1-M8.jar:1.1-M8]
at net.liftweb.mapper.Schemifier$$anonfun$6$$anonfun$apply
$8.apply(Schemifier.scala:193) [lift-mapper-1.1-M8.jar:1.1-M8]
at net.liftweb.mapper.Schemifier$.net$liftweb$mapper$Schemifier
$$using(Schemifier.scala:44) [lift-mapper-1.1-M8.jar:1.1-M8]
at net.liftweb.mapper.Schemifier$$anonfun$6.apply
(Schemifier.scala:193)[lift-mapper-1.1-M8.jar:1.1-M8]
at net.liftweb.mapper.Schemifier$$anonfun$6.apply
(Schemifier.scala:187)[lift-mapper-1.1-M8.jar:1.1-M8]
-- 
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.




[Lift] Schemifier broken for Oracle

2010-01-13 Thread aw
I'm pretty sure that I discovered that a bug was introduced that
breaks Schemifier with Oracle...

First of all, Oracle's JDBC driver has the odd behavior of being case
sensitive when it comes to acquiring metadata.  For example:
DatabaseMetaData.getColumns(null, MYSCHEMA, MYTABLE, null) is not
the same as DatabaseMetaData.getColumns(null, MYSCHEMA, myTable,
null)...  In fact, the latter option yields no results...

Well, looking at 1.0 Schemifier source, see line 189:
  
http://scala-tools.org/scaladocs/liftweb/1.0/net/liftweb/mapper/Schemifier.scala.htm
You can see that it used:  table.dbTableName

If you look at the latest source, see line 193:
  
http://github.com/dpp/liftweb/blob/master/framework/lift-persistence/lift-mapper/src/main/scala/net/liftweb/mapper/Schemifier.scala#L193
You can see that it uses:  table._dbTableNameLC

This change broke ensureColumns for Oracle.

As a side note -- there was no useful error message explaining that no
column metadata was found for table X.  This took a while to trace.

I must admit that I am surprised by Oracle's behavior.  Since the
database isn't case sensitive, the table name parameter should not be
case sensitive -- but it certainly is by my testing (and I am using
11g).

Why was the code changed to specify a lower case value?
-- 
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.




[Lift] TextileParser

2010-01-12 Thread aw
Playing around with the TextileParser code, I am using paraFixer.  I
noticed that bbold/b yields bold HTML.  Similarly, emitalic/em
yields italic HTML.  But strongbold/strong does NOT yield bold
HTML...  Looks like we need to add some extra tags to the function
isValidTag.  I'd like to see tags like strong, i, and u added
for consistency.

See:
http://github.com/dpp/liftweb/blob/master/framework/lift-modules/lift-textile/src/main/scala/net/liftweb/textile/TextileParser.scala#L530


How complete is the Textile support?  Is there a wiki page that
describes what is supported?  The closest thing I could find was
wikipedia:  http://en.wikipedia.org/wiki/Textile_(markup_language)

I am interested in some basic wiki-markup to HTML translation, like
*bold* and _italic_, but not the more advanced stuff like embedded
images or links to other pages.  For security reasons, I am interested
in a layer that escapes offending HTML like script or img or
something that could be dangerous.  Is that what I would get if I
called TextileParser.toHtml(toParse: String, disableLinks: true)?
-- 
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.




[Lift] Default Schema for DefaultConnectionIdentifier

2010-01-12 Thread aw
I specify my database by specifying a jndiName for
DefaultConnectionIdentifier:

DefaultConnectionIdentifier.jndiName = jdbc/myOracleDb

I really need to specify a default schema too...  (For Hibernate, I
would specify this in persistence.xml.)  Is there a way to specify a
default schema?
-- 
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.




[Lift] Chat Input (order)

2010-01-11 Thread aw
I'm playing with the Chat example, and I am trying to do something
trivial, but I can't get it to work and am at a loss as to why...

Basically, I am interested in having the chat:input at the top of
the page, before the chat:body/.  As a result, I figured that I
could simply edit the Chat.html template and switch the order.  Alas,
that isn't working...

Clearly, the code is adding the chat:input at the end of the
chat:body, but I can't seem to figure out where or how.  Can I
please get a pointer?
-- 
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.




[Lift] Re: **IMPORTANT** Lift 2.0 Milestone1 is coming and it's time to test the SNAPSHOT in master

2010-01-11 Thread aw
 2. We are still on Scala 2.7.7. No excitement :) Lift is very
 sensitive to Scala version and the stability of Lift (and it's
 dependencies including Scala) is very important for those who are
 critically dependent on Lift. That said, Heiko maintains Lift's port
 on Scala 2.8.0 280_port actively. But that's not yet ready - you have
 been warned :)

Since Lift is sensitive to the Scala version, have you considered
using a classifier to separate 2.7.7 compatible artifacts from 2.8.0
compatible artifacts?

(This presumes that 2.0 will be released for 2.7.x as well as 2.8.x
(eventually).  Or will Lift support only ONE Scala version?  Right now
that is 2.7.x, but eventually that will change to 2.8.x?)
-- 
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.




[Lift] TimeHelpers and SimpleDateFormat

2010-01-11 Thread aw
See:  http://java.sun.com/javase/6/docs/api/java/text/SimpleDateFormat.html
---
Synchronization

Date formats are not synchronized. It is recommended to create
separate format instances for each thread. If multiple threads access
a format concurrently, it must be synchronized externally.
---


Since SimpleDateFormat is not thread-safe, do I potentially have a bug
when using TimeHelpers?

For example, see the Chat.scala example -- see line where it binds
when - hourFormat(c.when)...  Is there a potential problem there
that multiple threads will be running the snippet and accessing the
same underlying SimpleDateFormat?
-- 
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.




[Lift] Re: Lift Scaladocs for Maven?

2009-11-18 Thread aw
Note that the Maven Javadoc Plugin has a specific goal defined for
creating a jar of the javadocs:
http://maven.apache.org/plugins/maven-javadoc-plugin/jar-mojo.html
Then you need to add a goal to attach it when you create a package:

http://maven.apache.org/plugin-developers/cookbook/attach-source-javadoc-artifacts.html

Unfortunately, I don't see a corresponding goal for the Maven Scala
Plugin:
http://scala-tools.org/mvnsites/maven-scala-plugin/plugin-info.html

--

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=.




[Lift] Re: Ajax + Comet Chat across a Cluster

2009-11-18 Thread aw
I certainly understand the Actor model, but I am new to Akka...  From
browsing their wiki (http://wiki.github.com/jboner/akka), it is
unclear to me that they provide a publish/subscribe concept -- and I
think I would need that...  Please point me to that reference if you
are aware of that.

I'll take a closer look at RabbitMQ...

--

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=.




[Lift] Re: Lift Mapper support for Oracle Sequences

2009-11-18 Thread aw
Thank you Derek...  Clever trick!

I'm not using 1.1-SNAPSHOT -- I am using 1.1-M7...  But that shouldn't
matter to me since I am not using Schemifier to create and manage the
database...  (I am using LiquiBase.)

I had imagined an alternative strategy whereby I would provide a
sequence name to the id object and then it would simply create
statements like:

  insert into Table (id, colA, colB, colC) values
(Table_Sequence.NextVal, colA, colB, colC)

but the more I think about it...  I'm thinking your strategy insulates
my code from declaring anything Oracle specific in my mapper
objects...

I will give this a go.  Thanks!

--

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=.




[Lift] Ajax + Comet Chat across a Cluster

2009-11-17 Thread aw
I am looking to add a Chat feature to my Lift app, demonstrating the
Ajax + Comet whiz bang...  However, I do need to persist my chat
messages (to a database), and I will have a cluster of (at least) 2
nodes.  As a result, what recommendation is there to share an Ajax
event across the cluster so that each node can respond with its Comet
actor?

Should I just go with JMS or database polling?  (Note that I expect to
deploy on Tomcat...)

--

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=.




[Lift] Template help

2009-11-11 Thread aw

I need to create a snippet sequence that looks something like this:

a href=next
span class=namename/span
span class=commentdescription/span
span class=arrow/
/a

The anchor needs to be generated using SHtml.link, and name 
description need to be bound.  As a result, I end up with a template
sequence like this:

b1:link
span class=nameb2:name//span
span class=commentb2:description//span
span class=arrow/
/b1:link

Then, I need snippet code that does something like:

bind(b1, xhtml,
  link - SHtml.link(S.contextPath, () = clicked(b), bind(b2,
chooseTemplate(b1, link, xhtml), name - Text(b.name),
description - Text(b.description) ))

Yuk...  I'm just not happy with this.  Sure, I could make it a little
more readable, but this still seems unnecessarily complex and
verbose.  I also really don't like how the view logic is dictating my
binding logic.  In other words, if I wanted to change my view
organization, there is a high chance that I also need to change my
binding logic -- and that just isn't right...

Is there a better strategy?
--~--~-~--~~~---~--~~
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: Template help

2009-11-11 Thread aw

OK, your suggestion definitely makes the snippet code more readable,
but I fear I didn't make my point clear because the snippet code still
is highly coupled with the view layout.

Imagine that I want to change my view from this:

a href=next
span class=namename/span
span class=commentdescription/span
span class=arrow/
/a

to this:

span class=namename/span
span class=commentdescription/span
a href=next
span class=arrow/
/a

This would mean that I need to change my template from:

b1:link
span class=nameb2:name//span
span class=commentb2:description//span
span class=arrow/
/b1:link

to this:

span class=nameb:name//span
span class=commentb:description//span
b:link
span class=arrow/
/b:link

And then I need to update my code from:

bind(b1, xhtml,
   link - kids = SHtml.link(next, () = clicked(b),
   bind(b2, kids, name - b.name.is, description -
b.description.is
)))

to something like this:

bind(b, xhtml,
   name - b.name.is,
   description - b.description.is,
   link - kids = SHtml.link(next, () = clicked(b))
)))


My complaint is that reorganizing the view is tending to require code
changes at the snippet level.  And that just doesn't seem right to me.

At first, I thought that I could leverage the recursive nature of
snippets.  In other words, I thought I could avoid the b1 and b2
binding keys and simply use b, then when the first round contained
more b variables to bind, it would recurse.  Alas, this didn't work
(I'm sorry, but I don't recall the error message).  But this was what
I was thinking:

b:link
span class=nameb:name//span
span class=commentb:description//span
span class=arrow/
/b:link

or this:

span class=nameb:name//span
span class=commentb:description//span
b:link
span class=arrow/
/b:link

and the code would remain this:

bind(b, xhtml,
   name - b.name.is,
   description - b.description.is,
   link - kids = SHtml.link(next, () = clicked(b))
)))


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



[Lift] Lift Mapper support for Oracle Sequences

2009-11-10 Thread aw

For Oracle database tables, one typically creates a Sequence to
provide primary key values.  For example:

create table WIDGET (
id Number(8,0) not null,
name varchar2(50) not null,
...
constraint WIDGET_PK primary key (id),
...
)
create sequence WIDGET_ID_SEQ

When creating records using Mapper, is there a convenient way to get
Mapper to automatically leverage the corresponding sequence to
populate the id column?

(Why Oracle doesn't do this automatically in 2009 like SQL Server,
Sybase, and other database systems, is beyond me...)

--~--~-~--~~~---~--~~
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-08 Thread aw

Build is working now.  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] 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] javax.mail 1.4.3-SNAPSHOT

2009-11-05 Thread aw

I upgraded to 1.1-M7 and was surprised to see that javax.mail-1.4.3-
SNAPSHOT is now appearing as a dependency.  Generally speaking, we
don't want SNAPSHOT dependencies because they aren't re-creatable, but
somehow, it sneaked into the Java.Net Maven 2 Repository:
http://download.java.net/maven/2/javax/mail/mail/

It is being pulled in because the lift pom here:
http://scala-tools.org/repo-releases/net/liftweb/lift/1.1-M7/lift-1.1-M7.pom
declares the dependency:

  dependency
groupIdjavax.mail/groupId
artifactIdmail/artifactId
version[1.4,1.5)/version
  /dependency

Normally, the above should be fine.  Alas, I think the underlying
problem is really Java.Net's Maven 2 Repository -- the SNAPSHOT build
should not have made it to the repository...

BTW...  I noticed that the javax.activation dependency is explicitly
declared:

  dependency
groupIdjavax.activation/groupId
artifactIdactivation/artifactId
version[1.1,1.2)/version
  /dependency

but it should be a transitive dependency of javax,mail (so this could
be removed).

I'm not sure what I am going to do to resolve this -- probably add an
explicit dependency in my project to override it.  Thought I'd
share...

--~--~-~--~~~---~--~~
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] Button to run Javascript

2009-11-03 Thread aw

I needed a button that goes back, so I created an ajaxButton with
code like:

SHtml.ajaxButton(Cancel, () = JsCmds.jsExpToJsCmd(JsRaw
(history.back();)))

So, is this the best version?  Or can this be simplified?

(I didn't feel well acquainted to leveraging Javascript from reading
the Exploring Lift book.  Maybe there needs to be a few more
examples?)

--~--~-~--~~~---~--~~
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] camelCase to snake_case

2009-11-01 Thread aw

I am using Lift-Mapper with Oracle.  Oracle is a case-insensitive
database.  For Hibernate projects, I have used the Enhanced Naming
Convention to translate Java camelCase to a more Oracle friendly
snake_case.  I am interested in doing the same thing with Lift Mapper/
Record.

In the mean time, I need to override dbTableName and dbColumnName, but
I'd like to avoid that and just agree on the convention.

I could imagine that the Database Provider would maintain a flag to
say whether the database is case sensitive or not, and then based on
that flag, would pass either the camelCase directly (for case
sensitive), or snake_case(camelCase) (for case insensitive).

(Or, does this functionality already exist and I just haven't
configured it properly?)
--~--~-~--~~~---~--~~
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: camelCase to snake_case

2009-11-01 Thread aw

Thank you.  I will open an Issue for this.  I was reluctant to do it
thinking that it was a user issue.  ;-)

On Nov 1, 11:57 am, David Pollak feeder.of.the.be...@gmail.com
wrote:
 It's not currently a feature, but please open a 
 tickethttp://github.com/dpp/liftweb/issues.  We'll get it into M8

--~--~-~--~~~---~--~~
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: Proposal : Lift ticketing system

2009-10-24 Thread aw

I don't mean to be negative, but are other options being considered
besides a ticketing system?  I kind of wonder if the effort is worth
it when excellent alternatives exist (like JIRA -- their Git
integration may interest you:  https://plugins.atlassian.com/plugin/details/4984
-- I have used their Subversion integration and was very pleased).

I would be far more interested in seeing something done for the
benefit of the Lift Web Site.  (Is it written with Lift?)  I don't see
a Lift CMS -- and that is something that could evolve well over time.
I think it is important for a web framework to use their own stuff,
and it should be indicative of the cool things that it can do,
stability, scale, and performance...  (I am amazed that I have seen
rather poor demonstrations of this, specifically by Adobe and JBoss --
but again, I'm not trying to be negative...)

I see the Lift site integrating Google Analytics...  Is that something
that could be out of the box with Lift?  That could be a selling
point to people making external web sites.

Another area that would be neat to develop is instrumentation.  Sort
of the JMX-Console equivalent for Lift.  For scalability and sizing
analysis, this would be really useful.


Having said that, one major feature that I feel is missing from github
is the lack of attachments for an issue.  How do you attach test cases
or patches for an issue?

--~--~-~--~~~---~--~~
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: Are we willing to make a breaking change for Joda Time?

2009-10-23 Thread aw

 That's pretty much my take. The whole Java Calendar/Date/Timezone impl is
 poorly designed, hence Joda Time.


I like Joda Time too, and used to be apprehensive about integrating it
as a dependency into my projects -- at least for simple things that I
could probably do with Date/Calendar, just more hassle...  But I am
less apprehensive now that I know that Stephen Colebourne from Joda-
Time is developing JSR-310 (https://jsr-310.dev.java.net/) -- a new
Date and Time API for Java 7.  If you look at the API, the new
javax.time is basically stealing (I mean integrating) all of the best
parts of Joda-Time.

Now, I am happily using org.joda.time.LocalDate because I know that
eventually, I will just need to change my imports to upgrade to
javax.time.calendar.LocalDate.


I haven't had a close look at Scala-Time, but I am not sure if I
understand the value when using straight Joda Time with Scala was so
painless.  But I am sure there is room to leverage Scala features for
things like implicit conversions.

--~--~-~--~~~---~--~~
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: Security Explained

2009-10-23 Thread aw

Thank you for this, and so quickly!  I was able to leverage this for
what I needed.

--~--~-~--~~~---~--~~
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: SLF4J Logging for my classes

2009-10-23 Thread aw

Sure, I could create a trait as you suggested...  But, this sounds
like a common problem -- does this not already exist?  I see
discussions about adding it to Scala, but I don't think it exists.
And Lift already has a logging infrastructure (i.e. LogBoot as you
suggest).  Does it not make sense to add this trait to lift-util or
lift-common?  (I just want to avoid recreating the wheel.)

--~--~-~--~~~---~--~~
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] Security Explained

2009-10-22 Thread aw

My company is looking for an explanation of how Lift is secure.

I recall reading a comment saying that Lift deals well with most of
the Top 10 OWASP vulnerabilities (http://www.owasp.org/index.php/
Top_10_2007), but how?  Most, not all?  Are there strategies that are
recommended to deal with the weaknesses?

I am very interested in a Wiki post that explains how Lift addresses
the top 10 vulnerabilities.  (No pressure, but I needed this
yesterday.)  Please point me to any existing resource/documentation
that explains this.

Very often, I see points that mention how secure Lift is, and I
certainly appreciate the fact that Lift promotes security as a core
initiative.  I can also see how secure it is compared to other
strategies (yeah, you heard me ColdFusion!).  Keep up the good work.


Does anybody have experience submitting Lift Apps to third party
security assessment or vulnerability analysis?  Any tips from that
experience?

--~--~-~--~~~---~--~~
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] SLF4J Logging for my classes

2009-10-22 Thread aw

I am using SLF4J logging, but I am not sure if I am doing it the
right way...

I have pointed Lift to use SLF4J, and I call the enable routine and
have updated dependencies.  All of that seems fine.

My question is around, how do my classes best use it...  For example,
I am generally doing something like:

import org.slf4j.{Logger, LoggerFactory}
class Foo {
private val LOGGER = LoggerFactory.getLogger(getClass)
...
}

Is this what one would expect?  Or is there a Lift Way that
obsoletes the above?

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---