[Lift] Re: building lift

2009-07-19 Thread Wilson MacGyver

that fixed it. thank you very much,

On Mon, Jul 20, 2009 at 1:56 AM, Derek Chen-Becker wrote:
> I've added in an exclusion to prevent this version of the lib from being
> pulled. We generally use the geronimo version of JEE libs due to a less
> restrictive license.
>
> Derek
>
> On Sat, Jul 18, 2009 at 8:00 PM, Ross Mellgren  wrote:
>>
>> It looks like the maven central repository only has the POM and not
>> the JAR. Try adding this repository to your POM:
>>
>> 
>>        java.net
>>        http://download.java.net/maven/2
>> >
>>
>> Or manually downloading JTA and putting it in your jre/lib directory.
>>
>> -Ross
>>
>> On Jul 18, 2009, at 9:49 PM, Wilson MacGyver wrote:
>>
>> >
>> > Hi,
>> >
>> > I git clone the lift source from git hub. then run mvn install to
>> > build it.
>> >
>> > It fails with
>> >
>> > Downloading:
>> > http://scala-tools.org/repo-releases/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar
>> > [INFO] Unable to find resource 'javax.transaction:jta:jar:1.0.1B' in
>> > repository scala-tools.org (http://scala-tools.org/repo-releases)
>> > Downloading:
>> > http://scala-tools.org/repo-snapshots/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar
>> > [INFO] Unable to find resource 'javax.transaction:jta:jar:1.0.1B' in
>> > repository scala-tools.org.snapshots
>> > (http://scala-tools.org/repo-snapshots)
>> > Downloading:
>> > http://repo1.maven.org/maven2/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar
>> > [INFO] Unable to find resource 'javax.transaction:jta:jar:1.0.1B' in
>> > repository central (http://repo1.maven.org/maven2)
>> > [INFO]
>> > 
>> > [ERROR] BUILD ERROR
>> > [INFO]
>> > 
>> > [INFO] Failed to resolve artifact.
>> >
>> > Missing:
>> > --
>> > 1) javax.transaction:jta:jar:1.0.1B
>> >
>> >
>> > is this intentional due to some license issue with the jta jar?
>> >
>> > Thanks,
>> > Mac
>> >
>> > --
>> > Omnem crede diem tibi diluxisse supremum.
>> >
>> > >
>>
>>
>>
>
>
> >
>



-- 
Omnem crede diem tibi diluxisse supremum.

--~--~-~--~~~---~--~~
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: building lift

2009-07-19 Thread Derek Chen-Becker
I've added in an exclusion to prevent this version of the lib from being
pulled. We generally use the geronimo version of JEE libs due to a less
restrictive license.

Derek

On Sat, Jul 18, 2009 at 8:00 PM, Ross Mellgren  wrote:

>
> It looks like the maven central repository only has the POM and not
> the JAR. Try adding this repository to your POM:
>
> 
>java.net
>http://download.java.net/maven/2
> 
>
> Or manually downloading JTA and putting it in your jre/lib directory.
>
> -Ross
>
> On Jul 18, 2009, at 9:49 PM, Wilson MacGyver wrote:
>
> >
> > Hi,
> >
> > I git clone the lift source from git hub. then run mvn install to
> > build it.
> >
> > It fails with
> >
> > Downloading:
> http://scala-tools.org/repo-releases/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar
> > [INFO] Unable to find resource 'javax.transaction:jta:jar:1.0.1B' in
> > repository scala-tools.org (http://scala-tools.org/repo-releases)
> > Downloading:
> http://scala-tools.org/repo-snapshots/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar
> > [INFO] Unable to find resource 'javax.transaction:jta:jar:1.0.1B' in
> > repository scala-tools.org.snapshots
> > (http://scala-tools.org/repo-snapshots)
> > Downloading:
> http://repo1.maven.org/maven2/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar
> > [INFO] Unable to find resource 'javax.transaction:jta:jar:1.0.1B' in
> > repository central (http://repo1.maven.org/maven2)
> > [INFO]
> > 
> > [ERROR] BUILD ERROR
> > [INFO]
> > 
> > [INFO] Failed to resolve artifact.
> >
> > Missing:
> > --
> > 1) javax.transaction:jta:jar:1.0.1B
> >
> >
> > is this intentional due to some license issue with the jta jar?
> >
> > Thanks,
> > Mac
> >
> > --
> > Omnem crede diem tibi diluxisse supremum.
> >
> > >
>
>
> >
>

--~--~-~--~~~---~--~~
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: JTA Transaction Monad - Early Access Program

2009-07-19 Thread Derek Chen-Becker
... hit the enter key too quickly! Kudos on the work in this library. I
really like how this is coming together.

Derek

On Sun, Jul 19, 2009 at 11:52 PM, Derek Chen-Becker
wrote:

> FYI, it looks like the Hibernate dependency you had in your pom was pulling
> in the javax.transactions:jta lib, which isn't available in maven repos. I
> added an exclusion to prevent that from breaking the build.
>
> Derek
>
>
> On Sun, Jul 19, 2009 at 3:08 AM, Jonas Bonér  wrote:
>
>>
>> Thanks Tim and David.
>>
>> 2009/7/19 David Pollak :
>> >
>> >
>> > On Sat, Jul 18, 2009 at 11:20 AM, Timothy Perrett
>> 
>> > wrote:
>> >>
>> >> Awesome - kudos Jonas.
>> >
>> > +1
>> >
>> > And more generally, it's great to have such a diverse and talented group
>> of
>> > people contributing to Lift!
>> >
>> >>
>> >> Cheers, Tim
>> >>
>> >> On Jul 18, 11:53 am, Jonas Bonér  wrote:
>> >> > JTA stuff is in github master branch
>> >> > now.
>> http://github.com/dpp/liftweb/tree/4d8405a3dcf93570da8142c078784f9dc1...
>> >> >
>> >> > Have fun.
>> >> > /Jonas
>> >>
>> >>
>> >
>> >
>> >
>> > --
>> > Lift, the simply functional web framework http://liftweb.net
>> > Beginning Scala http://www.apress.com/book/view/1430219890
>> > Follow me: http://twitter.com/dpp
>> > Git some: http://github.com/dpp
>> >
>> > >
>> >
>>
>>
>>
>> --
>> Jonas Bonér
>>
>> twitter: @jboner
>> blog:http://jonasboner.com
>> work:   http://crisp.se
>> work:   http://scalablesolutions.se
>> code:   http://github.com/jboner
>>
>> >>
>>
>

--~--~-~--~~~---~--~~
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: JTA Transaction Monad - Early Access Program

2009-07-19 Thread Derek Chen-Becker
FYI, it looks like the Hibernate dependency you had in your pom was pulling
in the javax.transactions:jta lib, which isn't available in maven repos. I
added an exclusion to prevent that from breaking the build.

Derek

On Sun, Jul 19, 2009 at 3:08 AM, Jonas Bonér  wrote:

>
> Thanks Tim and David.
>
> 2009/7/19 David Pollak :
> >
> >
> > On Sat, Jul 18, 2009 at 11:20 AM, Timothy Perrett
> 
> > wrote:
> >>
> >> Awesome - kudos Jonas.
> >
> > +1
> >
> > And more generally, it's great to have such a diverse and talented group
> of
> > people contributing to Lift!
> >
> >>
> >> Cheers, Tim
> >>
> >> On Jul 18, 11:53 am, Jonas Bonér  wrote:
> >> > JTA stuff is in github master branch
> >> > now.
> http://github.com/dpp/liftweb/tree/4d8405a3dcf93570da8142c078784f9dc1...
> >> >
> >> > Have fun.
> >> > /Jonas
> >>
> >>
> >
> >
> >
> > --
> > Lift, the simply functional web framework http://liftweb.net
> > Beginning Scala http://www.apress.com/book/view/1430219890
> > Follow me: http://twitter.com/dpp
> > Git some: http://github.com/dpp
> >
> > >
> >
>
>
>
> --
> Jonas Bonér
>
> twitter: @jboner
> blog:http://jonasboner.com
> work:   http://crisp.se
> work:   http://scalablesolutions.se
> code:   http://github.com/jboner
>
> >
>

--~--~-~--~~~---~--~~
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: Code Review for Unique Key Constraints

2009-07-19 Thread Derek Chen-Becker
Try just

object RecipeIngredient extends RecipeIngredient with
LongKeyedMetaMapper[RecipeIngredient]
{
  override def dbIndexes = UniqueIndex(recipe, order) :: Nil
}

Also, there was a bug in index creation. I just checked in a fix.

Derek

On Sat, Jul 18, 2009 at 11:54 AM, Calen Pennington <
calen.penning...@gmail.com> wrote:

> So, I'm trying to make use of this code, now that it's in the git repo.
>
> However, I'm running into the follow issue:
>
> In my model, I have
>
> object RecipeIngredient extends RecipeIngredient with
> LongKeyedMetaMapper[RecipeIngredient] {
>   override def dbIndexes = UniqueIndex(new IndexField(recipe), new
> IndexField(order)) :: Nil
> }
>
> However, when the schemifier runs, I get a match error:
>
> scala.MatchError: UniqueIndex(Array(IndexField(NULL), IndexField(0)))
> at
> net.liftweb.mapper.Schemifier$$anonfun$net$liftweb$mapper$Schemifier$$ensureIndexes$2.apply(Schemifier.scala:266)
> at
> net.liftweb.mapper.Schemifier$$anonfun$net$liftweb$mapper$Schemifier$$ensureIndexes$2.apply(Schemifier.scala:261)
> ...
>
> It seems that the only way that the UniqueIndex wouldn't match would be if
> there was a type inconsistency. However, I can't figure out how that could
> be happening. (For reference, I get the same error if I use an Index, rather
> than a UniqueIndex).
>
> Any thoughts?
>
> Thanks
> -Cale
>
>
> On Tue, Jul 14, 2009 at 4:05 PM, Derek Chen-Becker 
> wrote:
>
>> OK, it's merged. An example usage of the new GenericIndex is:
>>
>> package com.test.model
>>
>> import _root_.net.liftweb.mapper._
>>
>> class DateItem extends Mapper[DateItem] with IdPK {
>>   def getSingleton = DateItem
>>   object timestamp extends MappedDateTime(this)
>>   object time extends MappedTime(this)
>>   object date extends MappedDate(this)
>> }
>>
>> object DateItem extends DateItem with MetaMapper[DateItem] {
>>   override def fieldOrder = date :: time :: timestamp :: Nil
>>   override def dbIndexes = GenericIndex({ (table,columns) =>
>> String.format("CREATE UNIQUE INDEX %s ON %s %s", "myindex_" + table + "_" +
>> columns.mkString("_"), table, columns.mkString("(", ",", ")"))},
>> IHaveValidatedThisSQL("Derek", "2009-07-13"), date) :: Nil
>> }
>>
>> It's basically up to you to generate the DDL statement based on the table
>> and column names.
>>
>> Derek
>>
>>
>> On Mon, Jul 13, 2009 at 4:11 PM, Derek Chen-Becker > > wrote:
>>
>>> OK, on wip-dcb-unique-indices there's now a GenericIndex that should give
>>> you full flexibility to do whatever you want for an index. I'll hold until
>>> tomorrow to merge with trunk.
>>>
>>> Derek
>>>
>>>
>>> On Mon, Jul 13, 2009 at 9:26 AM, Derek Chen-Becker <
>>> dchenbec...@gmail.com> wrote:
>>>
 I'll add a UserIndex type that will let you specify the creation of the
 index directly. Unique indices are generally supported across all DBs,
 AFAIK, so it makes it more clear to have a specific type.

 Derek


 On Mon, Jul 13, 2009 at 7:40 AM, Calen Pennington <
 calen.penning...@gmail.com> wrote:

>
> Hey, I'm glad the code could make it in. One comment on your changes:
> It seems to me that using the pattern matching in ensureIndexes puts
> Lift in the position of maintaining support for various DBs, rather
> than letting the client code do it in a project by project basis (for
> instance, the FULLTEXT and SPACIAL index types that I mentioned, that
> are mysql specific.) Is there a reason that you preferred that over
> allowing client code to specify the index type?
>
> -Cale
>
> On Fri, Jul 10, 2009 at 5:32 PM, Derek Chen-Becker<
> dchenbec...@gmail.com> wrote:
> > I've pushed a smaller commit into the wip-dcb-unique-indices branch
> on
> > GitHub that adds a UniqueIndex case class. Conceivably we could add
> other
> > types of indices if there's a need. If no one has any objections to
> what
> > I've added I can merge with trunk on Monday.
> >
> > Derek
> >
> > http://github.com/dpp/liftweb/tree/wip-dcb-unique-indices
> >
> > On Thu, Jul 9, 2009 at 9:44 PM, DFectuoso 
> wrote:
> >>
> >> I for one would like to say: Cool! Thanks! If i need unique indexes
> in
> >> the next couple of weeks i'll get this baby to the war( .war thats
> >> it ) =)
> >>
> >> On Jul 9, 11:30 am, Calen Pennington 
> >> wrote:
> >> > As mentioned is this issue
> >> > (http://github.com/dpp/liftweb/issues#issue/19), and as came up
> on the
> >> > list recently, Lift currently has no way to specify that a field
> or an
> >> > index be unique. I've coded up a patch that addresses this, and
> could
> >> > also be used for other index types on a project specific basis
> (for
> >> > instance, FULLTEXT or SPATIAL indexes in mysql).
> >> >
> >> > -Cale
> >> >
> >> >  0001-Adding-the-ability-to-create-UNIQUE-indexes-over-sin.patch
> >> > 5KViewDownl

[Lift] MetaMapper type

2009-07-19 Thread Naftoli Gugenheim

I have a function
def eachField[T <: Mapper[T]](mapper: T, fn: MappedField[_, T] => ...) ...
I need to call it using a val declared currently as
val metaMapper: MetaMapper[T] with T
where T is a type argument of its containing class.
I can't figure out how to pass metaMapper to eachField and satisfy the compiler.
The definitions can be changed somewhat but not too much because they are used 
elsewhere.
Thanks.

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



[Lift] Re: Contributing Life and/or Scala

2009-07-19 Thread David Pollak
Thanks for the offer to contribute.

My experience is that the best written and best maintained code comes from
people who need the code for their job or long term project.

So... what are you working on?  What do you need that's not provided?  How
can the Lift community help you integrate that into Lift?

On Sun, Jul 19, 2009 at 4:28 PM, egervari  wrote:

>
> Hi Everyone,
>
> What type of libraries would you like to see implement in Scala that
> are currently not available - like something that is written for Scala
> specifically to take advantage of the common idioms and natural style
> of the language.
>
> What big features are missing in Lift?
>
> I'd like to contribute to Scala/Lift in some way, so I'm just
> searching for ideas and there's a project "to be" that I really take a
> liking to, I'd like to work on it and build it.
>
> >
>


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

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



[Lift] Contributing Life and/or Scala

2009-07-19 Thread egervari

Hi Everyone,

What type of libraries would you like to see implement in Scala that
are currently not available - like something that is written for Scala
specifically to take advantage of the common idioms and natural style
of the language.

What big features are missing in Lift?

I'd like to contribute to Scala/Lift in some way, so I'm just
searching for ideas and there's a project "to be" that I really take a
liking to, I'd like to work on it and build it.

--~--~-~--~~~---~--~~
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: Writing Facebook applications in Lift (cookies, Javascript GC, example code)

2009-07-19 Thread Steven Murdoch

Hi Jon,

On Sun, Jul 12, 2009 at 10:30:31PM -0700, jon wrote:
> Have you done any more research into this problem?

Yes, I tried a few of the suggestions on the list. Thanks to everyone
for their helpful responses. I haven't had time to progress the
application very far, but the basics are working.

Here are a few of my notes:

Javascript
==

I disabled the addition of Javascript by adding to
bootstrap/liftweb/Boot.scala:

+// Do not insert Javascript-based GC
+LiftRules.enableLiftGC = false;
+
+// Do not include Ajax include
+LiftRules.autoIncludeAjax = _ => false;

Logging
===

Liftweb sends stack traces to the browser, when running in development
mode. This isn't good for Facebook applications, because the content
of 500 error responses is not shown. So I changed to logging to a file
by adding to bootstrap/liftweb/Boot.scala:

+// Send exceptions to log, not the browser
+LiftRules.exceptionHandler.prepend {
+  case (_, r, e) =>
+   Log.error("Exception being returned to browser when processing "+r, e)
+   XhtmlResponse((Something unexpected happened while serving the 
page at {r.uri}
+   ),ResponseInfo.docType(r), List("Content-Type" 
-> "text/html"), Nil, 500, S.ieMode)
+}

Input validation


It appears that the current version of the Lift Facebook API does not
verify the signature on the Facebook POST variables. This would allow
someone to spoof a different Facebook user to the application. I care
about this in my application, so I wrote the following method to
validate parameters:

+  /**
+   * Confirm that the parameters really came from Facebook
+   */
+  def validateParameters: Boolean = {
+// Check that the right parameters are present
+if (S.request.isEmpty)
+   return false
+
+val actualSignature = S.param("fb_sig")
+if (actualSignature.isEmpty)
+   return false
+
+// Format parameters for hashing, and append the secret
+val params = S.request.open_!.params
+val signedParams = for ((k,v) <- params if k.startsWith("fb_sig_")) yield 
k.substring(7) + "=" + v.mkString("")
+val signedParamStr = signedParams.toList.sort(_ < _).mkString("") + 
FacebookRestApi.secret
+
+// Hash the string and convert to hex
+val md = _root_.java.security.MessageDigest.getInstance("MD5")
+def byteToHex(b: Byte): String = Integer.toHexString((b & 0xf0) >>> 4) + 
Integer.toHexString(b & 0x0f)
+val expectedSignature = 
md.digest((signedParamStr).getBytes).map(byteToHex(_)).mkString("")
+
+// Verify the signature
+return expectedSignature == actualSignature.open_!
+  }

Maybe this should go into the Facebook API. I haven't tried this.

Templates
=

To keep the Lift XML parser happy, I added a namespace declaration for
the Facebook namespace. I also had to add a top level element. I found
that Facebook removes an  element before rendering FBML, so that
is a good choice.

This creates a template like the following:

+ http://apps.facebook.com/ns/1.0";>
+  Explanation message This is the 
explanation message text.  
+ 
 
> I am also exploring this area-- by creating your application as an
> iframe rather than fbml, which seems to be the recommended approach
> (http://stackoverflow.com/questions/219804/new-facebook-app-fbml-or-
> iframe), you should be able to use all the lift goodies out of the
> box.

Yes, I looked into this too, but it seems that opinions are split as
to what is better. For another set of ideas, see the Facebook wiki:
 
http://wiki.developers.facebook.com/index.php/Choosing_between_an_FBML_or_IFrame_Application

I went for FBML because it seemed simpler, and I've done one of these
before using Python and Pylons. I switched to Scala because I really
miss the lack of static type checking there.

Regarding cookies, it turns out that they are supported by the
Facebook API, although are a beta feature:
 http://wiki.developers.facebook.com/index.php/Cookies

This will hopefully mean that session-based things in Lift will still
work.

I hope this helps. I would be very interested in hearing your
experience too.

Steven.

-- 
http://www.cl.cam.ac.uk/users/sjm217/


--~--~-~--~~~---~--~~
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: Added upload progress widget

2009-07-19 Thread Timothy Perrett


Oops!!! I meant to say it IS perfectly functional in browsers! Lol.

On 19/07/2009 16:03, "Timothy Perrett"  wrote:

> I've just reworked the upload progress widget and could do with a few
> opinions... it still feels pretty raw but is not perfectly functional
> in a bunch of different browsers and i've managed to remove the
> implementing boiler plate.



--~--~-~--~~~---~--~~
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] Added upload progress widget

2009-07-19 Thread Timothy Perrett

Hey guys,

I've just reworked the upload progress widget and could do with a few
opinions... it still feels pretty raw but is not perfectly functional
in a bunch of different browsers and i've managed to remove the
implementing boiler plate.

Boot up the lift-widgets example application and have a go with it.

Interested in any thoughts / feedback.

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



[Lift] Re: File upload streaming and progress monitoring ...

2009-07-19 Thread Viktor Klang
Awesome work guys!

On Sat, Jul 18, 2009 at 8:54 PM, marius d.  wrote:

>
> Great. Let me know if I can help with anything.
>
> Br's,
> Marius
>
> On Jul 18, 9:22 pm, Timothy Perrett  wrote:
> > Marius,
> >
> > This is awesome. Things are now working as expected - I knew this
> > wasn't a browser connection issue causing the problems.
> >
> > The code in the widget package is pretty rubbish right now, but i just
> > had time to hack together a hardcoded sample to make sure that your
> > commit actually fix the problem... Im happy to report that it does
> > indeed now work exactly as required.
> >
> > The next step is to work backwards and clean all the code up and fix
> > the cross-browser issues as right now it works in firefox and IE but
> > not in safari or chrome et al.
> >
> > Cheers, Tim
> >
> > On Jul 18, 3:08 pm, "marius d."  wrote:
> >
> > > Just committed a fix ...
> >
> > > Br's,
> > > Marius
> >
> > > On Jul 18, 4:10 pm, "marius d."  wrote:
> >
> > > > A little more on this ...
> >
> > > > Living the above synchronized blocks where they are but removing the
> > > > one from LiftSession.runParams  made it work properly. Looks like
> this
> > > > one was holding the lock while the file upload progress was
> happening.
> > > > Dave I'm not really sure why in runParams the the toRun is obtained
> > > > from a synchronized block ... is it because we'rreading from
> > > > messageCallback there ? ..cause otherwise the entire expression is
> > > > about functions composition that does not change any state.
> >
> > > > Br's,
> > > > Marius
> >
> > > > On Jul 18, 3:57 pm, Marius  wrote:
> >
> > > > > HI there,
> >
> > > > > I know, there have been several other threads around the topic but
> I
> > > > > just wanted to yield somethings here. In the past few days I've
> been
> > > > > talking with Tim as he was having problems with his FileUpload
> widget.
> > > > > Even with short polling the progress was not reported even though
> the
> > > > > LiftSession.progressListener was properly called.
> >
> > > > > Today I started to look into it and here is what I've done:
> >
> > > > > 1. Here is the markup:
> >
> > > > >style="width:
> > > > > 0;height:0;border:0px solid #fff;">
> >
> > > > >> > > > target="upload_target">
> > > > > 
> > > > > 
> > > > >   
> >
> > > > >   A simple snippet that uses the invisible iframe trick to upload
> > > > > stuff in the background. The so called "Ajax" upload. (I had to add
> > > > > the target attribute into the supported form snippet attributed but
> > > > > that's ok)
> >
> > > > > 2. In boot had something like:
> >
> > > > > LiftSession.onSetupSession = ((session: LiftSession) => {
> > > > >   session.progessListener = Full((chunk, total, index) => {
> > > > >  Thread.sleep(100)
> > > > >  println(index + " read " + chunk + " out of " + total + "
> " +
> > > > > Thread.currentThread)
> > > > >   })
> > > > > }) :: Nil
> >
> > > > > Just monitor the progress ... and to make it last a little
> longer
> > > > > I'm sleeping for 100 milliseconds
> >
> > > > > 3. I set the GC polling to 10 seconds. The think is that GC polling
> > > > > would be just like the short polling for getting the progress
> status
> > > > > back in the browser.
> >
> > > > > The behavior that I observed was that while I was uploading a 30 Mb
> +
> > > > > file the polling requests timed out after 5 secconds per
> > > > > LiftRules.ajaxPostTimeout. This means that our progress monitoring
> > > > > ajax request would have timed out as well. On the server side the
> > > > > execution got stuck until the upload was complete.
> > > > > LiftServlet.handleAjax was not called until the upload terminates.
> >
> > > > > Initially I thought that this has to do to limited request channels
> > > > > that browser have but the thing is that we have several places in
> Lift
> > > > > code where we synchronize things. Such as LiftSession.getSession,
> > > > > LiftSession.fixSessionTime etc. Acquiring these locks made the
> > > > > progress polling to hang until the upload terminated. Of course
> > > > > removing th synchronized block made the polling to work right
> during
> > > > > the file upload. Now this was just for test ... I'm not suggesting
> to
> > > > > remove the synchronized blocks as  we'd loose consistency but this
> > > > > looks to stay in the way of properly dealing with multiple parallel
> > > > > request per same session like fileupload and progress monitoring.
> >
> > > > > It appears that there is either a thread starvation situation or
> > > > > simply a lock that is held while upload is is progress.
> >
> > > > > Br's,
> > > > > Marius
> >
>


-- 
Viktor Klang

Java Specialist
Scala Loudmouth
Lift Committer

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

Re: [scala] Re: [Lift] Re: Jersey + Lift, whats the story?

2009-07-19 Thread Meredith Gregory
David,

Thanks for your query. Here's an example from Hinze and Jeuring's
paper,
the syntax is Haskell(ish), but it's also simple enough to transliterate to
Scala.

rhs = Abs "n" (If (App (App (Var "=") (Var "n")) (Var "0"))
  (Var "1")
  (App (App (Var "+") (Var "n"))
   (App (Var "fac") (App (Var "pred") (Var
"n")

This is the body of a factorial calculation that has a typo in it. It should
have a (Var "*") where there is a (Var "+"). We'd like to navigate to that
location. Using a zipper our navigation would look like

> top rhs
Abs "n" (If (App ... ) )
> down $$
If (App (App ...) )
> down $$
App (App (Var ...) )
> right $$
Var "1"
> right $$
App (App (Var "+") (Var "n")) (App (Var "fac") ...)
> down $$
App (Var "+") (Var "n")
> down $$
Var "+"
> $${ it = (Var "*") }
Var "*"
> up $$
App (Var "*") (Var "n")

Let me know if this helps.

Best wishes,

--greg

On Sat, Jul 18, 2009 at 4:38 PM, David Pollak  wrote:

> Greg,
> This sounds interesting... but I'd like to see what the Scala code would
> look like that would manipulate the Zipper-based data structures.  If you've
> got a pile of XML, what does it look like to map it to nested [case]
> classes?  What does it look like to manipulate the XML?
>
> Thanks,
>
> David
>
>
> On Fri, Jul 17, 2009 at 10:54 AM, Meredith Gregory <
> lgreg.mered...@gmail.com> wrote:
>
>> Guys,
>>
>> After playing around with integrating Lift and Jersey before the Jersey
>> guys did an 'official' integration and thinking hard about how i wanted to
>> reference locations in data structures via URLs, i realized that 
>> zipper(cf. this
>> explanation ) is a much
>> better, much more functional, generic and maintainable solution.
>>
>> Briefly, the way this works is to automate the calculation of a context
>> type, C(T), from a data type T. The context type will allow for the
>> representation of locations in an instance of T in terms of contexts and
>> holes. There's a natural way to get from contexts to paths. So, there's a
>> natural map from URLs (viewed as paths) to locations. One great example of
>> how this works in practice is Oleg Kiselyov's Zipper-based file system. The
>> analogy between paths to files and URLs to resources should be clear.
>>
>> This has led me to look at where to cut the line on calculating zippers.
>> As the wikipedia article mentions above, it is possible do this completely
>> generically, provided one has a notion of differentiation on data
>> structures; that is, the zipper can be expressed in terms of the derivative
>> of a data structure. There are two natural (and somewhat competing) places
>> to hang the differentiation calculation:
>>
>>- the new collections library for scala
>>- the target of a mapping from one of the XML schema proposals to
>>scala types
>>
>> Jorge and i were chatting about this the other day. Either route is a bit
>> of a large task and i've got a bunch of other stuff on my plate right now.
>> However, i'd be very happy to collaborate with anyone who wants to make this
>> happen. Also, by the way, this works really well with a lot of other
>> monadically based machinery.
>>
>> Best wishes,
>>
>> --greg
>>
>>
>> On Fri, Jul 17, 2009 at 8:17 AM, TylerWeir  wrote:
>>
>>>
>>> >>Wait a few days, and I think there'll be some very good news on this
>>> front.
>>>
>>> Tease! :)
>>>
>>> On Jul 17, 10:51 am, David Pollak 
>>> wrote:
>>> > There are benefits to both approaches.  I prefer the partial function
>>> > composition, but annotations on Pojos have their place.
>>> > Wait a few days, and I think there'll be some very good news on this
>>> front.
>>> >
>>> > On Fri, Jul 17, 2009 at 7:28 AM, Timothy Perrett
>>> wrote:
>>> >
>>> >
>>> >
>>> >
>>> >
>>> > > Hey guys,
>>> >
>>> > > I've been taking a look at Jersey and how it operates with Lift by
>>> way
>>> > > of the recent integration that cropped up on dev.java.net...
>>> >
>>> > > From my perspective, I see how having a standard RS service framework
>>> > > could be helpful, but it appears to bypass important lift concepts
>>> > > like SiteMap etc so I'm just wondering what the benefit of using such
>>> > > a layer would be over using DispatchPF etc to create REST services or
>>> > > serving xml fragments for templates? (I have no idea about Jersey
>>> > > apart from the basic docs ive read, so if im missing a major benefit
>>> > > id love to hear discuss)
>>> >
>>> > > Cheers for any thoughts
>>> >
>>> > > Tim
>>> >
>>> > --
>>> > Lift, the simply functional web frameworkhttp://liftweb.net
>>> > Beginning Scalahttp://www.apress.com/book/view/1430219890
>>> > Follow me:http://twitter.com/dpp
>>> > Git some:http://github.com/dpp
>>> >>>
>>>
>>
>>
>> --
>> L.G. Meredith
>> Managing Partner
>> Biosimilarity LLC
>> 121

[Lift] JSON handler doesn't respond

2009-07-19 Thread Vassil Dichev

Hello folks,

I've gathered some information on the recent problems where ESME was hanging.
The problem seems to be that the json handler, generated with
S.buildJsonFunc, sometimes stops working after the browser has been
open for awhile. Not all user sessions stop working though (I'm
currently trying with 3 open sessions).

I've also tried calling the generated JavaScript function manually
from each of the browsers and it confirms the fact that for some
sessions the handler is not invoked. I execute the function e.g. in
the url bar like this:

   javascript:F6669067195625JG({'command': 'post', 'params':{'msg':
document.getElementById('textdude').value, 'tags':
document.getElementById('tagdude').value, 'access_pool':
document.getElementById('access_pool').value, 'reply-to':
currentConvNumber}});

As a result, in the sessions where things don't work the pattern
matching on JsonCmd is not reached at all, whereas "case JsonCmd"
matches fine where it works.

Any ideas on how to debug this? Has anyone experienced the same problem?

Greetings,
Vassil

P.S. We are running Lift version 1.1-SNAPSHOT. I experienced the
problem under OpenJDK 6, but it occurs with Sun's JDK 6 too.

--~--~-~--~~~---~--~~
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: JTA Transaction Monad - Early Access Program

2009-07-19 Thread Jonas Bonér

Thanks Tim and David.

2009/7/19 David Pollak :
>
>
> On Sat, Jul 18, 2009 at 11:20 AM, Timothy Perrett 
> wrote:
>>
>> Awesome - kudos Jonas.
>
> +1
>
> And more generally, it's great to have such a diverse and talented group of
> people contributing to Lift!
>
>>
>> Cheers, Tim
>>
>> On Jul 18, 11:53 am, Jonas Bonér  wrote:
>> > JTA stuff is in github master branch
>> > now.http://github.com/dpp/liftweb/tree/4d8405a3dcf93570da8142c078784f9dc1...
>> >
>> > Have fun.
>> > /Jonas
>>
>>
>
>
>
> --
> Lift, the simply functional web framework http://liftweb.net
> Beginning Scala http://www.apress.com/book/view/1430219890
> Follow me: http://twitter.com/dpp
> Git some: http://github.com/dpp
>
> >
>



-- 
Jonas Bonér

twitter: @jboner
blog:http://jonasboner.com
work:   http://crisp.se
work:   http://scalablesolutions.se
code:   http://github.com/jboner

--~--~-~--~~~---~--~~
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: building lift

2009-07-19 Thread Ross Mellgren

It looks like the maven central repository only has the POM and not  
the JAR. Try adding this repository to your POM:


java.net
http://download.java.net/maven/2

> Hi,
>
> I git clone the lift source from git hub. then run mvn install to  
> build it.
>
> It fails with
>
> Downloading: 
> http://scala-tools.org/repo-releases/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar
> [INFO] Unable to find resource 'javax.transaction:jta:jar:1.0.1B' in
> repository scala-tools.org (http://scala-tools.org/repo-releases)
> Downloading: 
> http://scala-tools.org/repo-snapshots/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar
> [INFO] Unable to find resource 'javax.transaction:jta:jar:1.0.1B' in
> repository scala-tools.org.snapshots
> (http://scala-tools.org/repo-snapshots)
> Downloading: 
> http://repo1.maven.org/maven2/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar
> [INFO] Unable to find resource 'javax.transaction:jta:jar:1.0.1B' in
> repository central (http://repo1.maven.org/maven2)
> [INFO]  
> 
> [ERROR] BUILD ERROR
> [INFO]  
> 
> [INFO] Failed to resolve artifact.
>
> Missing:
> --
> 1) javax.transaction:jta:jar:1.0.1B
>
>
> is this intentional due to some license issue with the jta jar?
>
> Thanks,
> Mac
>
> -- 
> Omnem crede diem tibi diluxisse supremum.
>
> >


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