[Lift] Re: Db.addLogFunc

2009-08-11 Thread marius d.

Please do so. If you need any help for some reason (time availability
etc.) please let me know. As a note probably the wrappers should be
only only when there is at least one log function registered.

Br's,
Marius

On Aug 6, 11:48 pm, Derek Chen-Becker dchenbec...@gmail.com wrote:
 If there's a consensus that we want our own JDBC wrappers I'll go ahead and
 write them.

 Derek

 On Thu, Aug 6, 2009 at 1:19 PM, marius d. marius.dan...@gmail.com wrote:

  Probably building our own wrappers would be more lightweight then 3-rd
  party. Jus' guessing

  Br's,
  Marius

  On Aug 6, 9:58 pm, Derek Chen-Becker dchenbec...@gmail.com wrote:
   Well, I started looking at it and determined that the only way for us to
   truly log the queries would be to essentially make our own wrappers over
   Statement and PreparedStatement. There are projects (log4jdbc, notably)
  that
   already do this, and in a transparent manner. I'm not sure that adding a
   whole bunch of SQL logging directly to Lift is better than leveraging
  some
   existing libraries to do it.

   Derek

   On Thu, Aug 6, 2009 at 11:03 AM, marius d. marius.dan...@gmail.com
  wrote:

Yeah we're aware of that. That is based on toString application which
is JDBC driver dependent. I think Derek started some work on this to
correct this behavior. Derek ?

Br's,
Marius

On Aug 6, 8:01 pm, jon jonhoff...@gmail.com wrote:
 Hi,

 I have the following in boot:
   DB.addLogFunc((query, len) = Log.info(The query: +query+ took
 +len+ milliseconds))

 I was expecting the query parameter to be sql, but it's actually some
 sort of guid

 INFO - The query: 6839c016-0122-f09a-9c96-003844e8 took 5
 milliseconds

 Any ideas?
 I'm running with derby.

 Thanks,

 Jon
--~--~-~--~~~---~--~~
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: SOAP web services?

2009-08-11 Thread Timothy Perrett

Hey Greg,

Im not sure about WSDL2.0, but my understanding was that WADL
( https://wadl.dev.java.net/ ) was making the most ground in the REST
service description arena.

Cheers, Tim

On Aug 10, 10:58 pm, Meredith Gregory lgreg.mered...@gmail.com
wrote:
 Lifted RESTafarians,

 Has anyone tried the Apache Axis 2 WSDL 2.0 support? i'm looking at this
 pagehttp://ws.apache.org/axis2/tools/1_2/maven-plugins/maven-wsdl2code-pl...and
 it claims they have a maven plugin to generate the stubs for a WSDL
 2.0
 REST binding. i'm going to play around with it to wrap BNF Converter in a
 RESTful service; but, i was wondering if anyone else had experience with it.

 Best wishes,

 --greg

 On Fri, Aug 7, 2009 at 12:31 AM, Viktor Klang viktor.kl...@gmail.comwrote:





  Hello Jacek,

  actually, if I were you I'd consider implementing your webservices as REST
  services and then just have your SOAP stubs call your rest services. (If
  you're not using anything voodooesque)

  Then you have the benefit of using the existing plumbing as much as
  possible, while still maintaining your SOAP interface as well as a potential
  migration path to something non-WSDL.

  (I am severely biased by having to work with SOAP, which has scarred me for
  life)

  On Thu, Aug 6, 2009 at 5:26 PM, Jacek Furmankiewicz 
  jace...@gmail.comwrote:

  I was reading through the Lift book PDF and it mentions only REST-
  style web services.

  In our case, we need to look at re-implementing a set of existing SOAP
  web services (is there anything like 'wsdl2scala' anywhere?).

  I would appreciate any best practices and suggestions for implementing
  SOAP web services in the context of a larger Lift app (and Scala in
  general).

  --
  Viktor Klang

  Rogue Scala-head

  Blog: klangism.blogspot.com
  Twttr: viktorklang

 --
 L.G. Meredith
 Managing Partner
 Biosimilarity LLC
 1219 NW 83rd St
 Seattle, WA 98117

 +1 206.650.3740

 http://biosimilarity.blogspot.com
--~--~-~--~~~---~--~~
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: bind with outer element?

2009-08-11 Thread Timothy Perrett

Jon,

To read attributes, you do the following:

S.attr(shorten) // = Box[String]

Cheers, Tim


On Aug 10, 9:44 pm, jon jonhoff...@gmail.com wrote:
 Hi,

 I have a template with the following

 lift:Snippit
   t:name shorten=true /
   t:foo form=POST
     form:name/
     ...
   /t:foo
 /lift:Snippet

 And a snippet like:

 def doSnippet(x:NodeSeq):NodeSeq = {
   bind(t, x,
     name- (doName(_)),
     foo - (doForm(_))
   )

 }

 In the code above only the contents of the bound tags are available
 for doName and doForm, if I want to be able to read the attribute
 shorten in doName and have foo render with an enclosing form
 tag,  how do I create the bind params?

 I am doing an expensive batch operation upfront, so I want everything
 to be in the same snippet.

 Thanks,

 Jon
--~--~-~--~~~---~--~~
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] How to override lift messages?

2009-08-11 Thread Ewan

 There are a couple of cases where I would like to override the
localised messages that Lift itself users such as S.notice(S.??
(logged.in)) in MetaMegaProtoUser.login().  I was hoping I could
override by popping the name=value in my message bundle properties
file but it does not work.  I realise I could override/copy
MetaMegaProtoUser.login() and replace that one line with a key from my
own bundle but I am not a fan of copy/paste inheritance.  Would you
accept a request to change S.notice(S.??(logged.in)) etc to call
functions we can override?

-- Ewan

--~--~-~--~~~---~--~~
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: How to override lift messages?

2009-08-11 Thread marius d.

You can specify your own ResourceBundle for Lift's strings:

LiftRules.liftCoreResourceName which is currently set to i18n.lift-
core

or you can manually change lift-core.properties files from the Lift's
jar file.

Current Lift's strings are in lift\src\main\resources\i18n\lift-
core.properties

Br's,
Marius

On Aug 11, 1:13 pm, Ewan ehar...@gmail.com wrote:
  There are a couple of cases where I would like to override the
 localised messages that Lift itself users such as S.notice(S.??
 (logged.in)) in MetaMegaProtoUser.login().  I was hoping I could
 override by popping the name=value in my message bundle properties
 file but it does not work.  I realise I could override/copy
 MetaMegaProtoUser.login() and replace that one line with a key from my
 own bundle but I am not a fan of copy/paste inheritance.  Would you
 accept a request to change S.notice(S.??(logged.in)) etc to call
 functions we can override?

 -- Ewan
--~--~-~--~~~---~--~~
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] Beginning Scala

2009-08-11 Thread Viktor Klang
I now, in my hand, hold a copy of the book!

I hope everyone take a chance to support David for all the awesomeness that
he's contributed to the Scala community!

-- 
Viktor Klang

Rogue Scala-head

Blog: klangism.blogspot.com
Twttr: viktorklang

--~--~-~--~~~---~--~~
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: bind with outer element?

2009-08-11 Thread Naftoli Gugenheim

If I'm not mistaken, S.attr is an attribute on the snippet xml node; for the 
node currently being processed by bind you use BindHelpers.attr

-
Timothy Perretttimo...@getintheloop.eu wrote:


Jon,

To read attributes, you do the following:

S.attr(shorten) // = Box[String]

Cheers, Tim


On Aug 10, 9:44 pm, jon jonhoff...@gmail.com wrote:
 Hi,

 I have a template with the following

 lift:Snippit
   t:name shorten=true /
   t:foo form=POST
     form:name/
     ...
   /t:foo
 /lift:Snippet

 And a snippet like:

 def doSnippet(x:NodeSeq):NodeSeq = {
   bind(t, x,
     name- (doName(_)),
     foo - (doForm(_))
   )

 }

 In the code above only the contents of the bound tags are available
 for doName and doForm, if I want to be able to read the attribute
 shorten in doName and have foo render with an enclosing form
 tag,  how do I create the bind params?

 I am doing an expensive batch operation upfront, so I want everything
 to be in the same snippet.

 Thanks,

 Jon


--~--~-~--~~~---~--~~
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: Alternate part of view

2009-08-11 Thread Naftoli Gugenheim

Great. So what kind of syntax do you want to see? What do you think of my 
bindSwitch syntax?

-
georgegeo...@mattandgeorge.com wrote:


I've been following this thread with interest because I have a very
similar use case. I also want to show different form fields depending
on what the user previously entered.

My solution was to dynamically create the bind params and bind Empty
to anything irrelevant.

I thought this felt a bit awkward, but I couldn't see a better
alternative being new to both Lift and Scala.

So I am also interested in finding a better way to do this.


On Aug 10, 8:05 pm, Naftoli Gugenheim naftoli...@gmail.com wrote:
 For example, I have requests. Every request is of a particular nature. Every 
 nature specifies a set of location types--for example a Transportation 
 request has a From and a To--and each type has a set of allowed location 
 kinds--for example, transportation can be from/to a street address, 
 hospital, etc., while a Hospital Visitation has one location type 
 (Location) which only has one location kind (hospital).
 Now, when you are entering a request, once you select your nature, you are 
 shown a list of location types, each of which you have to choose the location 
 kind for. When you select the location kind of a location type, you then see 
 the fields for that location kind. For example a street address has text 
 fields while a hospital location has two dropdowns and a text field.
 The point being, that each location type is a switch, depending on whether a 
 location kind has been selected for it. But they are inside an xml node that 
 is reused for each location type, which has to be inside the snippet. But 
 there is static formatting there.
 Nested snippets isn't a great solution here because the inner xml needs 
 access to the location being iterated in the outer snippet, and class 
 variables are less preferable than direct scope access.
 Thanks!

 -

 David Pollakfeeder.of.the.be...@gmail.com wrote:

 On Mon, Aug 10, 2009 at 11:29 AM, Naftoli Gugenheim 
 naftoli...@gmail.comwrote:



  By context I mean where it is in the xml.
  For example, br's between the switch and everything else.
  In other words, your code implements a switch. But where are you putting
  it back in the view? chooseTemplate etc. extract data out of context as
  oppo'sed to bind which is in place. And if indeed you are calling it from
  within bind then why is it better than a NodeSeq function (FuncBindParam)?

 Put the static content outside the snippet invocation:

 lift:foo  bsome text/b
   choose:one/choose:one
   choose:two/choose:two
   some more stuff
 /lift:foo

 Is exactly the same as:

 bsome text/b
 lift:foo  choose:one/choose:one
   choose:two/choose:two
 /lift:foo
 some more stuff

 The snippet operates on the content that must be modified and the static
 text is outside the snippet invocation.





  Thanks.

  -
  David Pollakfeeder.of.the.be...@gmail.com wrote:

  On Mon, Aug 10, 2009 at 11:18 AM, Naftoli Gugenheim naftoli...@gmail.com
  wrote:

   The problem with using the template methods is that they pull the node
  out
   of context. So if I need to let the view html file decide how everything
  is
   assembled, then these calls to the template methods have to be used
  inside a
   bind. You can put the alternatives inside a dedicated parent xml node and
   bind on that (sometimes), but what have I saved?

  I don't understand your question.

  I don't understand the pattern you are trying to use.

  I don't understand what kind of context a node might have other than
  binding
  based on a condition.

  What does the code that I wrote not do that your code does?

   Thanks.

   -
   David Pollakfeeder.of.the.be...@gmail.com wrote:

   On Thu, Aug 6, 2009 at 9:28 AM, Naftoli Gugenheim naftoli...@gmail.com
   wrote:

Here's some view xhtml:

 req:noClient

 label for=clientqueryClient /label

 client:query id=clientquery size=5/

 client:set /

 /req:noClient

 req:client

 Client client:unset /

 client:editclient:name //client:editbr /

 client:details /

 /req:client

 hr /

   How about:

   def doBinding(xhtml: NodeSeq): NodeSeq = {
    def doClientBind(c: Client): Box[NodeSeq] =
      Helpers.template(xhtml, req, client).map(t = bind(client, t,
   ...))

    def doClientFreeBind: Box[NodeSeq] =
      Helpers.template(xhtml, req, noClient).map(t = bind(client, t,
   ...))

    (client.flatMap(doClientBind) or doClientFreeBind) openOr NodeSeq.Empty
   }

And here's some snippet code:

    xhtml.bind(req,

      noClient - noClient _,

      client - hasClient _,

      ...

    )

    def noClient(xhtml: NodeSeq) = {

      var clientQuery: String = 

      def queryClient {

         ...

      }

      

[Lift] Mapper: Hide field from form but show in list?

2009-08-11 Thread Jeppe Nejsum Madsen

Hi

I'm a little confused about the meanings of dbDisplay_? and
dbIncludeInForm_? when using Mapper  CRUDify

How can I have a field that is

1) Not shown in the list view
2) Shown in the edit form

It seems that:

1) Setting dbDisplay_? = false hides the field from both list and
form. This works 
2) Setting dbDisplay_?=true, dbIncludeInForm_?=false. Hides the field
from the form and removes the contents from the list, but still shows
the header in the list. Doesn't seem to work

Looking at MetaMapper.formFields, it seems as if both display 
IncludeInForm needs to be true in order to show in the form. It would
seem the two settings are orthogonal so that 

dbDisplay could control inclusion in list views
dbIncludeInForm could control inclusion in forms
and by default dbIncludeInForm = dbDisplay

What did I miss?

/Jeppe

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



[Lift] Mapper Problem: id = -1 after safe

2009-08-11 Thread steffen.weissmann

Hi,

I have two Mapper classes, both extend LongKeyedMapper[...] with IdPK.
When i create and save an instance of each class, one keeps id=-1, the
other class nicely counts up as i would expect. Any explanation for
that behavior?

Thanks, Steffen.

--~--~-~--~~~---~--~~
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] Mapper with id=-1

2009-08-11 Thread Steffen Weißmann

Hi,

i am using two Mapper classes, both extend LongKeyedMapper[..] with
IdPK. After saving (returns true for both) one class always has id=-1,
the id of the other class counts up as expected. The id is however
correct when i list the table from another snippet. Any hints?

Thanks, Steffen.

--~--~-~--~~~---~--~~
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: todo app., Oracle: Invalid column type

2009-08-11 Thread Kris Nuttycombe

ROWID is indeed a pseudo-column that isn't even stable, to my
knowledge. I've always know it as a 0-based index over the rows
returned from a query.

As of 9i, at least, Oracle insisted that you implement
auto-incrementing columns manually using a sequence and an associated
trigger. I presume that they have a good reason for this, perhaps
related to replication or something. It's a hassle.

Kris

On Mon, Aug 10, 2009 at 4:26 PM, Derek Chen-Beckerdchenbec...@gmail.com wrote:
 OK, I think that I've at least figured out the cause of the exception. The
 Oracle driver is set to use ROWID for primary keys and long indices. As far
 as I can tell from the Oracle docs, ROWID is a pseudo-column and shouldn't
 really be used as a column type in table creation DDL. The Boolean
 conversion appears to be working correctly, so now I just need to figure out
 the best way to abstract auto-increment column creation.

 Derek

 On Mon, Aug 10, 2009 at 1:51 AM, Jon Kleiser jon.klei...@usit.uio.no
 wrote:

 Hi,

 Here's the contents of my default.props file:

 db.driver = oracle.jdbc.OracleDriver
 db.url = jdbc:oracle:thin:@myserver.site.no:1540:mydatabase
 db.user = myuser
 db.password = xxx

 The file is located in todo/src/main/webapp/WEB-INF/classes/props/

 /Jon


 On 8/10/09 5:01 AM, Derek Chen-Becker wrote:

 Or at least the JDBC connection URL that you're using (no passwords or
 username needed).

 On Sun, Aug 9, 2009 at 8:25 AM, Derek Chen-Becker dchenbec...@gmail.com
 mailto:dchenbec...@gmail.com wrote:

    Please send me the props file. I want to duplicate exactly (as much
    as possible) what you're doing.

    Derek


    On Sat, Aug 8, 2009 at 2:14 PM, Jon Kleiser jon.klei...@usit.uio.no
    mailto:jon.klei...@usit.uio.no wrote:

        Hi Derek,

        The attached file should be identical to the project I use for
        the Oracle
        testing, except that the file specifying the Oracle connection
        (was it
        default.props?) is missing. I have it on my PPC Mac, not here. I
        guess you
        know how to create that file and where to put it. If you're not
        sure, let
        me know, and I'll send you the info early Monday (or later).

        /Jon


 


--~--~-~--~~~---~--~~
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: todo app., Oracle: Invalid column type

2009-08-11 Thread Derek Chen-Becker
Yeah, that's basically how you do it in PostgreSQL, although they have an
alias SERIAL that does the work of setting up the sequence and everything
for you.

Derek

On Tue, Aug 11, 2009 at 10:23 AM, Kris Nuttycombe kris.nuttyco...@gmail.com
 wrote:


 ROWID is indeed a pseudo-column that isn't even stable, to my
 knowledge. I've always know it as a 0-based index over the rows
 returned from a query.

 As of 9i, at least, Oracle insisted that you implement
 auto-incrementing columns manually using a sequence and an associated
 trigger. I presume that they have a good reason for this, perhaps
 related to replication or something. It's a hassle.

 Kris

 On Mon, Aug 10, 2009 at 4:26 PM, Derek Chen-Beckerdchenbec...@gmail.com
 wrote:
  OK, I think that I've at least figured out the cause of the exception.
 The
  Oracle driver is set to use ROWID for primary keys and long indices. As
 far
  as I can tell from the Oracle docs, ROWID is a pseudo-column and
 shouldn't
  really be used as a column type in table creation DDL. The Boolean
  conversion appears to be working correctly, so now I just need to figure
 out
  the best way to abstract auto-increment column creation.
 
  Derek
 
  On Mon, Aug 10, 2009 at 1:51 AM, Jon Kleiser jon.klei...@usit.uio.no
  wrote:
 
  Hi,
 
  Here's the contents of my default.props file:
 
  db.driver = oracle.jdbc.OracleDriver
  db.url = jdbc:oracle:thin:@myserver.site.no:1540:mydatabase
  db.user = myuser
  db.password = xxx
 
  The file is located in todo/src/main/webapp/WEB-INF/classes/props/
 
  /Jon
 
 
  On 8/10/09 5:01 AM, Derek Chen-Becker wrote:
 
  Or at least the JDBC connection URL that you're using (no passwords or
  username needed).
 
  On Sun, Aug 9, 2009 at 8:25 AM, Derek Chen-Becker 
 dchenbec...@gmail.com
  mailto:dchenbec...@gmail.com wrote:
 
 Please send me the props file. I want to duplicate exactly (as much
 as possible) what you're doing.
 
 Derek
 
 
 On Sat, Aug 8, 2009 at 2:14 PM, Jon Kleiser 
 jon.klei...@usit.uio.no
 mailto:jon.klei...@usit.uio.no wrote:
 
 Hi Derek,
 
 The attached file should be identical to the project I use for
 the Oracle
 testing, except that the file specifying the Oracle connection
 (was it
 default.props?) is missing. I have it on my PPC Mac, not here. I
 guess you
 know how to create that file and where to put it. If you're not
 sure, let
 me know, and I'll send you the info early Monday (or later).
 
 /Jon
 
 
  
 

 


--~--~-~--~~~---~--~~
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: SOAP web services?

2009-08-11 Thread Meredith Gregory
Tim,

i was under the same impression, but then read a couple of IBM comparison
articles and a WSO2 blog and it seemed that the WSDL 2.0 was gaining ground.
Further, the tooling for WSDL, with integration into all the major IDE's,
has been significantly more developed than the WADL tooling. However,
yesterday i tried a simple example with a schema-valid WSDL 2.0 xml document
for a simple service with 1 operation and the Apache Axis2 tool barfed on
the fact that the schema pointed to in the document was for WSDL 2.0 and not
WSDL 1.1 -- despite the fact that they claim on their home page to support
WSDL 2.0.

For the record, WSDL -- as much as i hate it -- was not meant to be tied to
a transport. As a matter of fact, neither was SOAP. You should be able to
effect these over any transport, HTTP included, and presumably in more than
one way. WADL is tied to HTTP. This means its scope is considerably more
limited.

Best wishes,

--greg

On Tue, Aug 11, 2009 at 12:55 AM, Timothy Perrett
timo...@getintheloop.euwrote:


 Hey Greg,

 Im not sure about WSDL2.0, but my understanding was that WADL
 ( https://wadl.dev.java.net/ ) was making the most ground in the REST
 service description arena.

 Cheers, Tim

 On Aug 10, 10:58 pm, Meredith Gregory lgreg.mered...@gmail.com
 wrote:
  Lifted RESTafarians,
 
  Has anyone tried the Apache Axis 2 WSDL 2.0 support? i'm looking at this
  page
 http://ws.apache.org/axis2/tools/1_2/maven-plugins/maven-wsdl2code-pl..
 .and
  it claims they have a maven plugin to generate the stubs for a WSDL
  2.0
  REST binding. i'm going to play around with it to wrap BNF Converter in a
  RESTful service; but, i was wondering if anyone else had experience with
 it.
 
  Best wishes,
 
  --greg
 
  On Fri, Aug 7, 2009 at 12:31 AM, Viktor Klang viktor.kl...@gmail.com
 wrote:
 
 
 
 
 
   Hello Jacek,
 
   actually, if I were you I'd consider implementing your webservices as
 REST
   services and then just have your SOAP stubs call your rest services.
 (If
   you're not using anything voodooesque)
 
   Then you have the benefit of using the existing plumbing as much as
   possible, while still maintaining your SOAP interface as well as a
 potential
   migration path to something non-WSDL.
 
   (I am severely biased by having to work with SOAP, which has scarred me
 for
   life)
 
   On Thu, Aug 6, 2009 at 5:26 PM, Jacek Furmankiewicz jace...@gmail.com
 wrote:
 
   I was reading through the Lift book PDF and it mentions only REST-
   style web services.
 
   In our case, we need to look at re-implementing a set of existing SOAP
   web services (is there anything like 'wsdl2scala' anywhere?).
 
   I would appreciate any best practices and suggestions for implementing
   SOAP web services in the context of a larger Lift app (and Scala in
   general).
 
   --
   Viktor Klang
 
   Rogue Scala-head
 
   Blog: klangism.blogspot.com
   Twttr: viktorklang
 
  --
  L.G. Meredith
  Managing Partner
  Biosimilarity LLC
  1219 NW 83rd St
  Seattle, WA 98117
 
  +1 206.650.3740
 
  http://biosimilarity.blogspot.com
 



-- 
L.G. Meredith
Managing Partner
Biosimilarity LLC
1219 NW 83rd St
Seattle, WA 98117

+1 206.650.3740

http://biosimilarity.blogspot.com

--~--~-~--~~~---~--~~
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: SOAP web services?

2009-08-11 Thread marius d.



On Aug 11, 7:09 pm, Meredith Gregory lgreg.mered...@gmail.com wrote:
 Tim,

 i was under the same impression, but then read a couple of IBM comparison
 articles and a WSO2 blog and it seemed that the WSDL 2.0 was gaining ground.
 Further, the tooling for WSDL, with integration into all the major IDE's,
 has been significantly more developed than the WADL tooling. However,
 yesterday i tried a simple example with a schema-valid WSDL 2.0 xml document
 for a simple service with 1 operation and the Apache Axis2 tool barfed on
 the fact that the schema pointed to in the document was for WSDL 2.0 and not
 WSDL 1.1 -- despite the fact that they claim on their home page to support
 WSDL 2.0.

 For the record, WSDL -- as much as i hate it -- was not meant to be tied to
 a transport. As a matter of fact, neither was SOAP. You should be able to
 effect these over any transport, HTTP included, and presumably in more than
 one way. WADL is tied to HTTP. This means its scope is considerably more
 limited.

Very true. But then again in reality how often are we seeing WSDL/SOAP
bound to something else then HTTP? ... in some respects this seems a
false selling point of SOAP.

Assuming an enterprise application where let's say we can escape HTTP
realm, probably RMI/IIOP, JINI, JXTA etc. even proprietary on the wire
representation etc.becomes valid choices.


 Best wishes,

 --greg

 On Tue, Aug 11, 2009 at 12:55 AM, Timothy Perrett
 timo...@getintheloop.euwrote:





  Hey Greg,

  Im not sure about WSDL2.0, but my understanding was that WADL
  (https://wadl.dev.java.net/) was making the most ground in the REST
  service description arena.

  Cheers, Tim

  On Aug 10, 10:58 pm, Meredith Gregory lgreg.mered...@gmail.com
  wrote:
   Lifted RESTafarians,

   Has anyone tried the Apache Axis 2 WSDL 2.0 support? i'm looking at this
   page
 http://ws.apache.org/axis2/tools/1_2/maven-plugins/maven-wsdl2code-pl..
  .and
   it claims they have a maven plugin to generate the stubs for a WSDL
   2.0
   REST binding. i'm going to play around with it to wrap BNF Converter in a
   RESTful service; but, i was wondering if anyone else had experience with
  it.

   Best wishes,

   --greg

   On Fri, Aug 7, 2009 at 12:31 AM, Viktor Klang viktor.kl...@gmail.com
  wrote:

Hello Jacek,

actually, if I were you I'd consider implementing your webservices as
  REST
services and then just have your SOAP stubs call your rest services.
  (If
you're not using anything voodooesque)

Then you have the benefit of using the existing plumbing as much as
possible, while still maintaining your SOAP interface as well as a
  potential
migration path to something non-WSDL.

(I am severely biased by having to work with SOAP, which has scarred me
  for
life)

On Thu, Aug 6, 2009 at 5:26 PM, Jacek Furmankiewicz jace...@gmail.com
  wrote:

I was reading through the Lift book PDF and it mentions only REST-
style web services.

In our case, we need to look at re-implementing a set of existing SOAP
web services (is there anything like 'wsdl2scala' anywhere?).

I would appreciate any best practices and suggestions for implementing
SOAP web services in the context of a larger Lift app (and Scala in
general).

--
Viktor Klang

Rogue Scala-head

Blog: klangism.blogspot.com
Twttr: viktorklang

   --
   L.G. Meredith
   Managing Partner
   Biosimilarity LLC
   1219 NW 83rd St
   Seattle, WA 98117

   +1 206.650.3740

  http://biosimilarity.blogspot.com

 --
 L.G. Meredith
 Managing Partner
 Biosimilarity LLC
 1219 NW 83rd St
 Seattle, WA 98117

 +1 206.650.3740

 http://biosimilarity.blogspot.com
--~--~-~--~~~---~--~~
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: SOAP web services?

2009-08-11 Thread Timothy Perrett


Id say you are correct Marius - you simply don't see it; I think that's
partly because of marketing (wind back to 2004... SOA == SOAP, and SOAP ==
XML + HTTP), and partly because of companies such as Microsoft implementing
SOAP in their tooling such as they did (and still do).

To that end, perhaps WSDL/SOAP has too much of a stigma attached to it now
to become successful in the wider service description arena? I also think
that same stigma gave rise to efforts like WADL...

But as usual, we digress!

Cheers, Tim

On 11/08/2009 17:27, marius d. marius.dan...@gmail.com wrote:

 Very true. But then again in reality how often are we seeing WSDL/SOAP
 bound to something else then HTTP? ... in some respects this seems a
 false selling point of SOAP.
 
 Assuming an enterprise application where let's say we can escape HTTP
 realm, probably RMI/IIOP, JINI, JXTA etc. even proprietary on the wire
 representation etc.becomes valid choices.



--~--~-~--~~~---~--~~
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: Db.addLogFunc

2009-08-11 Thread Derek Chen-Becker
Will do.

On Tue, Aug 11, 2009 at 2:33 AM, marius d. marius.dan...@gmail.com wrote:


 Please do so. If you need any help for some reason (time availability
 etc.) please let me know. As a note probably the wrappers should be
 only only when there is at least one log function registered.

 Br's,
 Marius

 On Aug 6, 11:48 pm, Derek Chen-Becker dchenbec...@gmail.com wrote:
  If there's a consensus that we want our own JDBC wrappers I'll go ahead
 and
  write them.
 
  Derek
 
  On Thu, Aug 6, 2009 at 1:19 PM, marius d. marius.dan...@gmail.com
 wrote:
 
   Probably building our own wrappers would be more lightweight then 3-rd
   party. Jus' guessing
 
   Br's,
   Marius
 
   On Aug 6, 9:58 pm, Derek Chen-Becker dchenbec...@gmail.com wrote:
Well, I started looking at it and determined that the only way for us
 to
truly log the queries would be to essentially make our own wrappers
 over
Statement and PreparedStatement. There are projects (log4jdbc,
 notably)
   that
already do this, and in a transparent manner. I'm not sure that
 adding a
whole bunch of SQL logging directly to Lift is better than leveraging
   some
existing libraries to do it.
 
Derek
 
On Thu, Aug 6, 2009 at 11:03 AM, marius d. marius.dan...@gmail.com
   wrote:
 
 Yeah we're aware of that. That is based on toString application
 which
 is JDBC driver dependent. I think Derek started some work on this
 to
 correct this behavior. Derek ?
 
 Br's,
 Marius
 
 On Aug 6, 8:01 pm, jon jonhoff...@gmail.com wrote:
  Hi,
 
  I have the following in boot:
DB.addLogFunc((query, len) = Log.info(The query: +query+
 took
  +len+ milliseconds))
 
  I was expecting the query parameter to be sql, but it's actually
 some
  sort of guid
 
  INFO - The query: 6839c016-0122-f09a-9c96-003844e8 took 5
  milliseconds
 
  Any ideas?
  I'm running with derby.
 
  Thanks,
 
  Jon
 


--~--~-~--~~~---~--~~
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: Beginning Scala

2009-08-11 Thread Derek Chen-Becker
Hear, hear! I'm reading it right now and it's a fantastic work so far.

Derek

On Tue, Aug 11, 2009 at 7:13 AM, Viktor Klang viktor.kl...@gmail.comwrote:

 I now, in my hand, hold a copy of the book!

 I hope everyone take a chance to support David for all the awesomeness that
 he's contributed to the Scala community!

 --
 Viktor Klang

 Rogue Scala-head

 Blog: klangism.blogspot.com
 Twttr: viktorklang

 


--~--~-~--~~~---~--~~
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: Beginning Scala

2009-08-11 Thread David Pollak
On Tue, Aug 11, 2009 at 5:13 AM, Viktor Klang viktor.kl...@gmail.comwrote:

 I now, in my hand, hold a copy of the book!

 I hope everyone take a chance to support David for all the awesomeness that
 he's contributed to the Scala community!


Viktor,

Thanks for the call out... but the best way to support me is to build great
things with Lift and to contribute back to the Lift community.

Thanks,

David




 --
 Viktor Klang

 Rogue Scala-head

 Blog: klangism.blogspot.com
 Twttr: viktorklang

 



-- 
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] Re: Looking for an additional team member for ESME

2009-08-11 Thread Kevin Wright
Someone has to ask the obvious question here...
Where is it?


On Mon, Aug 10, 2009 at 10:37 PM, David Pollak 
feeder.of.the.be...@gmail.com wrote:

 Folks,
 I'm heavily involved with ESME http://incubator.apache.org/esme/, the
 Enterprise Social Messaging Experiment, an Apache Incubator project.

 ESME was founded by folks in the SAP ecosystem and used by some SAP
 ecosystem 
 companieshttps://www.it-solutions.siemens.com/b2b/it/en/global/press/press-releases/2009/Pages/enterprise-social-messaging-experiment.aspx
 .

 We're looking for a stellar UI person to join the project to build leading
 edge DHTML and Air front ends for ESME.

 If you'd like to have the opportunity to put your UI skills in front of
 corporate users, have fun with a very bright bunch of people, materially
 influence ESME and help shape Lift's multi-front-end APIs, please contact me
 off list.

 Thanks,

 David

 --
 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] Re: Looking for an additional team member for ESME

2009-08-11 Thread David Pollak
On Tue, Aug 11, 2009 at 10:33 AM, Kevin Wright 
kev.lee.wri...@googlemail.com wrote:

 Someone has to ask the obvious question here...
 Where is it?


ESME is an open source project.  You can read more about it at
http://incubator.apache.org/esme/

If you're asking where the project is physically located... in 7 different
time zones around the world... but as near as your local Internet
connection.




 On Mon, Aug 10, 2009 at 10:37 PM, David Pollak 
 feeder.of.the.be...@gmail.com wrote:

 Folks,
 I'm heavily involved with ESME http://incubator.apache.org/esme/, the
 Enterprise Social Messaging Experiment, an Apache Incubator project.

 ESME was founded by folks in the SAP ecosystem and used by some SAP
 ecosystem 
 companieshttps://www.it-solutions.siemens.com/b2b/it/en/global/press/press-releases/2009/Pages/enterprise-social-messaging-experiment.aspx
 .

 We're looking for a stellar UI person to join the project to build leading
 edge DHTML and Air front ends for ESME.

 If you'd like to have the opportunity to put your UI skills in front of
 corporate users, have fun with a very bright bunch of people, materially
 influence ESME and help shape Lift's multi-front-end APIs, please contact me
 off list.

 Thanks,

 David

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




 



-- 
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] Re: Mapper Problem: id = -1 after safe

2009-08-11 Thread Naftoli Gugenheim
Code to reproduce?

On Tue, Aug 11, 2009 at 6:27 AM, steffen.weissmann 
steffen.weissm...@googlemail.com wrote:


 Hi,

 I have two Mapper classes, both extend LongKeyedMapper[...] with IdPK.
 When i create and save an instance of each class, one keeps id=-1, the
 other class nicely counts up as i would expect. Any explanation for
 that behavior?

 Thanks, Steffen.

 


--~--~-~--~~~---~--~~
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: SOAP web services?

2009-08-11 Thread Alex Cruise

Disclaimer: I worked at http://www.layer7tech.com/ for six years so I 
have a fair bit of déformation professionelle.

rant target=urn:noOneInParticular

While I wholeheartedly agree that SOAP, WSDL, WS-* and the whole 
mainstream SOA stack, as it's currently broadly defined and implemented, 
is ugly and verbose and redundant and regrettable, I'll posit that it is 
currently the *only* game in town that **meets all of the requirements** 
that drove its creation:

* Vendor- and platform-neutral
* Standards-based
* Business semantics decoupled from transport
* Supports message-level security (allowing decoupling from transport 
and business semantics)
* Declarative service publishing and discovery, and automatic 
RPC/OO-style stub generation
* ... and many more requirements that you, personally, may not ever feel 
the need for. 

But a lot of companies actually do need a significant subset of these 
requirements on a significant subset of their projects, and there is 
certainly a great deal of value in having a global, IT-industry-wide 
consensus (even among bitter competitors, which was never the case 
previously) on a set of technologies, standards and practices that 
actually do meet those requirements.

/rant :)

-0xe1a

--~--~-~--~~~---~--~~
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: Mapper with id=-1

2009-08-11 Thread Derek Chen-Becker
Is it always the same one that gets a correct ID, and if you comment out
that save does the other one get a correct ID? I'm just wondering if there's
something sequential related to retrieving the generated IDs.

Derek

On Tue, Aug 11, 2009 at 6:25 AM, Steffen Weißmann 
steffen.weissm...@googlemail.com wrote:


 Hi,

 i am using two Mapper classes, both extend LongKeyedMapper[..] with
 IdPK. After saving (returns true for both) one class always has id=-1,
 the id of the other class counts up as expected. The id is however
 correct when i list the table from another snippet. Any hints?

 Thanks, Steffen.

 


--~--~-~--~~~---~--~~
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: SOAP web services?

2009-08-11 Thread Timothy Perrett


 But I'm just a weird guy with weird opinions...

We hadn't noticed Viktor ;-)

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: Mapper nullability

2009-08-11 Thread Naftoli Gugenheim
Is this output expected or odd?

On Mon, Aug 10, 2009 at 12:33 PM, Naftoli Gugenheim naftoli...@gmail.comwrote:

 INFO - CREATE TABLE requestlocationstringvalue (ID BIGINT NOT NULL
 AUTO_INCREMENT , field BIGINT , requestlocation BIGINT)
 INFO - CREATE INDEX requestlocationstringvalue_id ON
 requestlocationstringvalue ( id )
 INFO - CREATE INDEX requestlocationstringvalue_requestlocation ON
 requestlocationstringvalue ( requestlocation )

 (output is retyped)

 -
 Derek Chen-Beckerdchenbec...@gmail.com wrote:

 I don't think that Mapper currently supports NOT NULL in the schema
 generation, although off the top of my head I think that we should be able
 to add that (please open an issue). I'm not sure about the H2 issue. What
 does the output from Schemifier look like when it runs?

 Derek

 On Sun, Aug 9, 2009 at 7:15 PM, Naftoli Gugenheim naftoli...@gmail.com
 wrote:

 
  Does Mapper have control over the nullability of a column? Is there a way
  to specify NOT NULL?
  Also, what am I doing wrong if my IdPK'd tables aren't having their id
  columns created as primary keys in H2?
  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: Mapper nullability

2009-08-11 Thread Naftoli Gugenheim
Is this output expected or odd?

On Mon, Aug 10, 2009 at 12:33 PM, Naftoli Gugenheim naftoli...@gmail.comwrote:

 INFO - CREATE TABLE requestlocationstringvalue (ID BIGINT NOT NULL
 AUTO_INCREMENT , field BIGINT , requestlocation BIGINT)
 INFO - CREATE INDEX requestlocationstringvalue_id ON
 requestlocationstringvalue ( id )
 INFO - CREATE INDEX requestlocationstringvalue_requestlocation ON
 requestlocationstringvalue ( requestlocation )

 (output is retyped)

 -
 Derek Chen-Beckerdchenbec...@gmail.com wrote:

 I don't think that Mapper currently supports NOT NULL in the schema
 generation, although off the top of my head I think that we should be able
 to add that (please open an issue). I'm not sure about the H2 issue. What
 does the output from Schemifier look like when it runs?

 Derek

 On Sun, Aug 9, 2009 at 7:15 PM, Naftoli Gugenheim naftoli...@gmail.com
 wrote:

 
  Does Mapper have control over the nullability of a column? Is there a way
  to specify NOT NULL?
  Also, what am I doing wrong if my IdPK'd tables aren't having their id
  columns created as primary keys in H2?
  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: SOAP web services?

2009-08-11 Thread Viktor Klang
On Tue, Aug 11, 2009 at 8:32 PM, Alex Cruise a...@cluonflux.com wrote:


 Disclaimer: I worked at http://www.layer7tech.com/ for six years so I
 have a fair bit of déformation professionelle.

 rant target=urn:noOneInParticular

 While I wholeheartedly agree that SOAP, WSDL, WS-* and the whole
 mainstream SOA stack, as it's currently broadly defined and implemented,
 is ugly and verbose and redundant and regrettable, I'll posit that it is
 currently the *only* game in town that **meets all of the requirements**
 that drove its creation:

 * Vendor- and platform-neutral
 * Standards-based
 * Business semantics decoupled from transport
 * Supports message-level security (allowing decoupling from transport
 and business semantics)
 * Declarative service publishing and discovery, and automatic
 RPC/OO-style stub generation
 * ... and many more requirements that you, personally, may not ever feel
 the need for.

 But a lot of companies actually do need a significant subset of these
 requirements on a significant subset of their projects, and there is
 certainly a great deal of value in having a global, IT-industry-wide
 consensus (even among bitter competitors, which was never the case
 previously) on a set of technologies, standards and practices that
 actually do meet those requirements.

 /rant :)


So basically it's very good for very few.
In all other cases I'll opt for something more suiting :)




 -0xe1a

 



-- 
Viktor Klang

Rogue Scala-head

Blog: klangism.blogspot.com
Twttr: viktorklang

--~--~-~--~~~---~--~~
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: SOAP web services?

2009-08-11 Thread Alex Cruise

Viktor Klang wrote:
 So basically it's very good for very few.
And for everyone else, it's at least useful at the outset, due to the 
maturity of tools, and will also interoperate well with emergent 
requirements that tend to pile up over the years the system is in 
production. :)  It's also very fair to point out that most of the 
mainstream SOA stack is totally overkill for non-enterprise applications.
 In all other cases I'll opt for something more suiting :)
The title of my moribund presentation on this subject is SOA is Not For 
You (a reference to http://www.penny-arcade.com/comic/2004/3/24/ :)

-0xe1a

--~--~-~--~~~---~--~~
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: SOAP web services?

2009-08-11 Thread Viktor Klang
On Tue, Aug 11, 2009 at 8:47 PM, Alex Cruise a...@cluonflux.com wrote:


 Viktor Klang wrote:
  So basically it's very good for very few.
 And for everyone else, it's at least useful at the outset, due to the
 maturity of tools, and will also interoperate well with emergent
 requirements that tend to pile up over the years the system is in
 production. :)  It's also very fair to point out that most of the
 mainstream SOA stack is totally overkill for non-enterprise applications.
  In all other cases I'll opt for something more suiting :)
 The title of my moribund presentation on this subject is SOA is Not For
 You (a reference to http://www.penny-arcade.com/comic/2004/3/24/ :)


SOA and SOAP are as RAPE is to GRAPE




 -0xe1a

 



-- 
Viktor Klang

Rogue Scala-head

Blog: klangism.blogspot.com
Twttr: viktorklang

--~--~-~--~~~---~--~~
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: Mapper with id=-1

2009-08-11 Thread Steffen Weißmann

Sorry, it was a beginning scala problem: Instead of

val prod = Product.create i had
def prod = Product.create...

then prod.save returned true and prod.id=-1...

Also sorry for posting this twice, but for some reason it took several
hours until the mails showed up on the list, I didn't expect that...

BTW: I have bought your Lift book (the paper version...), and I am a
little disappointed that it has neither an appendix nor an index. What
was the reason for that?


Cheers, Steffen.

On Tue, Aug 11, 2009 at 8:34 PM, Derek Chen-Beckerdchenbec...@gmail.com wrote:
 Is it always the same one that gets a correct ID, and if you comment out
 that save does the other one get a correct ID? I'm just wondering if there's
 something sequential related to retrieving the generated IDs.

 Derek

 On Tue, Aug 11, 2009 at 6:25 AM, Steffen Weißmann
 steffen.weissm...@googlemail.com wrote:

 Hi,

 i am using two Mapper classes, both extend LongKeyedMapper[..] with
 IdPK. After saving (returns true for both) one class always has id=-1,
 the id of the other class counts up as expected. The id is however
 correct when i list the table from another snippet. Any hints?

 Thanks, Steffen.




 




-- 
Steffen Weissmann

Technische Universitaet Berlin - Math. Department - MA 3-2

Str. des 17. Juni 136
10623 Berlin - Germany

Phone: +49 30 314-29278
Mail: weissm...@math.tu-berlin.de
Web: www.math.tu-berlin.de/~weissman

--~--~-~--~~~---~--~~
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: Mapper with id=-1

2009-08-11 Thread marius d.

Steffen new members are moderated ... so please have a little
patience. Once someone brings valuable information and show genuine
interest in Lift and this list, most likely his/her posts will not be
moderated anymore.

Br's,
Marius

On Aug 11, 10:01 pm, Steffen Weißmann
steffen.weissm...@googlemail.com wrote:
 Sorry, it was a beginning scala problem: Instead of

 val prod = Product.create i had
 def prod = Product.create...

 then prod.save returned true and prod.id=-1...

 Also sorry for posting this twice, but for some reason it took several
 hours until the mails showed up on the list, I didn't expect that...

 BTW: I have bought your Lift book (the paper version...), and I am a
 little disappointed that it has neither an appendix nor an index. What
 was the reason for that?

 Cheers, Steffen.



 On Tue, Aug 11, 2009 at 8:34 PM, Derek Chen-Beckerdchenbec...@gmail.com 
 wrote:
  Is it always the same one that gets a correct ID, and if you comment out
  that save does the other one get a correct ID? I'm just wondering if there's
  something sequential related to retrieving the generated IDs.

  Derek

  On Tue, Aug 11, 2009 at 6:25 AM, Steffen Weißmann
  steffen.weissm...@googlemail.com wrote:

  Hi,

  i am using two Mapper classes, both extend LongKeyedMapper[..] with
  IdPK. After saving (returns true for both) one class always has id=-1,
  the id of the other class counts up as expected. The id is however
  correct when i list the table from another snippet. Any hints?

  Thanks, Steffen.

 --
 Steffen Weissmann

 Technische Universitaet Berlin - Math. Department - MA 3-2

 Str. des 17. Juni 136
 10623 Berlin - Germany

 Phone:+49 30 314-29278
 Mail: weissm...@math.tu-berlin.de
 Web:www.math.tu-berlin.de/~weissman
--~--~-~--~~~---~--~~
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: Mapper with id=-1

2009-08-11 Thread Derek Chen-Becker
We're also disappointed that the book had neither an index or the
appendices. Their omission was due to some issues with the way that APress
handles FirstPress books. The index was definitely not possible for them,
and the removal of the appendices was done so that the book would be printed
in time (their printing workflow supposedly didn't allow for  X chapters
and would have had to been rewritten). The appendices are available in PDF
here:

http://www.apress.com/book/downloadfile/4390

If you want a full PDF with index and appendices, you can check out the
open-source version of the book here:

http://groups.google.com/group/the-lift-book

The master.pdf under Files is the most up-to-date version, and as I have
time I update it with feedback. The two versions aren't 100% identical but
they are very similar.

Derek

On Tue, Aug 11, 2009 at 1:01 PM, Steffen Weißmann 
steffen.weissm...@googlemail.com wrote:


 Sorry, it was a beginning scala problem: Instead of

 val prod = Product.create i had
 def prod = Product.create...

 then prod.save returned true and prod.id=-1...

 Also sorry for posting this twice, but for some reason it took several
 hours until the mails showed up on the list, I didn't expect that...

 BTW: I have bought your Lift book (the paper version...), and I am a
 little disappointed that it has neither an appendix nor an index. What
 was the reason for that?


 Cheers, Steffen.

 On Tue, Aug 11, 2009 at 8:34 PM, Derek Chen-Beckerdchenbec...@gmail.com
 wrote:
  Is it always the same one that gets a correct ID, and if you comment out
  that save does the other one get a correct ID? I'm just wondering if
 there's
  something sequential related to retrieving the generated IDs.
 
  Derek
 
  On Tue, Aug 11, 2009 at 6:25 AM, Steffen Weißmann
  steffen.weissm...@googlemail.com wrote:
 
  Hi,
 
  i am using two Mapper classes, both extend LongKeyedMapper[..] with
  IdPK. After saving (returns true for both) one class always has id=-1,
  the id of the other class counts up as expected. The id is however
  correct when i list the table from another snippet. Any hints?
 
  Thanks, Steffen.
 
 
 
 
  
 



 --
 Steffen Weissmann

 Technische Universitaet Berlin - Math. Department - MA 3-2

 Str. des 17. Juni 136
 10623 Berlin - Germany

 Phone: +49 30 314-29278
 Mail: weissm...@math.tu-berlin.de
 Web: www.math.tu-berlin.de/~weissmanhttp://www.math.tu-berlin.de/%7Eweissman

 


--~--~-~--~~~---~--~~
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: Alternate part of view

2009-08-11 Thread george

I will have a think about it and get back to you.

On Aug 11, 1:38 pm, Naftoli Gugenheim naftoli...@gmail.com wrote:
 Great. So what kind of syntax do you want to see? What do you think of my 
 bindSwitch syntax?

 -

 georgegeo...@mattandgeorge.com wrote:

 I've been following this thread with interest because I have a very
 similar use case. I also want to show different form fields depending
 on what the user previously entered.

 My solution was to dynamically create the bind params and bind Empty
 to anything irrelevant.

 I thought this felt a bit awkward, but I couldn't see a better
 alternative being new to both Lift and Scala.

 So I am also interested in finding a better way to do this.

 On Aug 10, 8:05 pm, Naftoli Gugenheim naftoli...@gmail.com wrote:



  For example, I have requests. Every request is of a particular nature. 
  Every nature specifies a set of location types--for example a 
  Transportation request has a From and a To--and each type has a set of 
  allowed location kinds--for example, transportation can be from/to a 
  street address, hospital, etc., while a Hospital Visitation has one 
  location type (Location) which only has one location kind (hospital).
  Now, when you are entering a request, once you select your nature, you are 
  shown a list of location types, each of which you have to choose the 
  location kind for. When you select the location kind of a location type, 
  you then see the fields for that location kind. For example a street 
  address has text fields while a hospital location has two dropdowns and a 
  text field.
  The point being, that each location type is a switch, depending on whether 
  a location kind has been selected for it. But they are inside an xml node 
  that is reused for each location type, which has to be inside the snippet. 
  But there is static formatting there.
  Nested snippets isn't a great solution here because the inner xml needs 
  access to the location being iterated in the outer snippet, and class 
  variables are less preferable than direct scope access.
  Thanks!

  -

  David Pollakfeeder.of.the.be...@gmail.com wrote:

  On Mon, Aug 10, 2009 at 11:29 AM, Naftoli Gugenheim 
  naftoli...@gmail.comwrote:

   By context I mean where it is in the xml.
   For example, br's between the switch and everything else.
   In other words, your code implements a switch. But where are you putting
   it back in the view? chooseTemplate etc. extract data out of context as
   oppo'sed to bind which is in place. And if indeed you are calling it 
   from
   within bind then why is it better than a NodeSeq function (FuncBindParam)?

  Put the static content outside the snippet invocation:

  lift:foo  bsome text/b
    choose:one/choose:one
    choose:two/choose:two
    some more stuff
  /lift:foo

  Is exactly the same as:

  bsome text/b
  lift:foo  choose:one/choose:one
    choose:two/choose:two
  /lift:foo
  some more stuff

  The snippet operates on the content that must be modified and the static
  text is outside the snippet invocation.

   Thanks.

   -
   David Pollakfeeder.of.the.be...@gmail.com wrote:

   On Mon, Aug 10, 2009 at 11:18 AM, Naftoli Gugenheim naftoli...@gmail.com
   wrote:

The problem with using the template methods is that they pull the node
   out
of context. So if I need to let the view html file decide how everything
   is
assembled, then these calls to the template methods have to be used
   inside a
bind. You can put the alternatives inside a dedicated parent xml node 
and
bind on that (sometimes), but what have I saved?

   I don't understand your question.

   I don't understand the pattern you are trying to use.

   I don't understand what kind of context a node might have other than
   binding
   based on a condition.

   What does the code that I wrote not do that your code does?

Thanks.

-
David Pollakfeeder.of.the.be...@gmail.com wrote:

On Thu, Aug 6, 2009 at 9:28 AM, Naftoli Gugenheim naftoli...@gmail.com
wrote:

 Here's some view xhtml:

  req:noClient

  label for=clientqueryClient /label

  client:query id=clientquery size=5/

  client:set /

  /req:noClient

  req:client

  Client client:unset /

  client:editclient:name //client:editbr /

  client:details /

  /req:client

  hr /

How about:

def doBinding(xhtml: NodeSeq): NodeSeq = {
 def doClientBind(c: Client): Box[NodeSeq] =
   Helpers.template(xhtml, req, client).map(t = bind(client, t,
...))

 def doClientFreeBind: Box[NodeSeq] =
   Helpers.template(xhtml, req, noClient).map(t = bind(client, t,
...))

 (client.flatMap(doClientBind) or doClientFreeBind) openOr NodeSeq.Empty
}

 And here's some snippet code:

     xhtml.bind(req,

       

[Lift] Re: how do you initialise a MappedLongForeignKey object?

2009-08-11 Thread Naftoli Gugenheim

Try mixing in LongMappedForeignMapper to address, or calling 
address.primeObj(addressObj).
What doesn't work the way you tried?

-
georgegeo...@mattandgeorge.com wrote:


I have extended MegaProtoUser in order to add a related Address object
which is a MappedLongForeignKey.

The idea being simply that there is a 1 to 1 relationship between a
User and their Address.

When a new User object is instantiated (but not yet persisted), I want
to be able to get the related address object like this:

user.address.obj

But the returned Box is always empty, I guess because nothing has been
saved yet.

I need to somehow initialise the address if it is Empty otherwise
return the current Address.

I thought something like this would work, but it doesn't:

user.address.obj.openOr(user.address(new Address).address.obj.open_!)

Anyone know how to do this 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] Cant generating liftweb document from source

2009-08-11 Thread Lance Zheng

I try to generate doc but got an error.
http://wiki.liftweb.net/index.php/Generating_Lift_scaladocs_locally
my OS is vista and maven's version is 2.2.0


D:\scalasrc\liftwebmvn -v
Apache Maven 2.2.0 (r788681; 2009-06-26 21:04:01+0800)
Java version: 1.6.0_13
Java home: C:\Program Files\Java\jdk1.6.0_13\jre
Default locale: zh_CN, platform encoding: GBK
OS name: windows vista version: 6.0 arch: x86 Family: windows

D:\scalasrc\liftwebmvn scala:doc
..
[WARNING] [Fatal Error] :1:38: Open quote is expected for attribute
{1} associated with an  elemen
t type  href.
[WARNING] Exception in thread main org.xml.sax.SAXParseException:
Open quote is expected for attri
bute {1} associated with an  element type  href.
[WARNING]   at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse
(AbstractSAXPar
ser.java:1231)
[WARNING]   at
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl
$JAXPSAXParser.parse(SAXPars
erImpl.java:522)
[WARNING]   at javax.xml.parsers.SAXParser.parse(SAXParser.java:
395)
[WARNING]   at scala.xml.parsing.FactoryAdapter.loadXML
(FactoryAdapter.scala:292)
[WARNING]   at scala.xml.parsing.NoBindingFactoryAdapter.loadXML
(NoBindingFactoryAdapter.scala:6
0)
[WARNING]   at scala.xml.XML$.load(XML.scala:68)
[WARNING]   at org.scala_tools.vscaladoc.DocUtil$.load
(DocUtil.scala:28)
[WARNING]   at org.scala_tools.vscaladoc.Services$cfg$.setFrom
(Services.scala:38)
[WARNING]   at org.scala_tools.vscaladoc.Main$.process(Main.scala:
81)
[WARNING]   at org.scala_tools.vscaladoc.Main$.main(Main.scala:
107)
[WARNING]   at org.scala_tools.vscaladoc.Main.main(Main.scala)
[INFO]

[ERROR] BUILD ERROR
[INFO]

[INFO] wrap: org.apache.maven.reporting.MavenReportException: wrap:
command line returned non-zero v
alue:1

--~--~-~--~~~---~--~~
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: Mapper with id=-1

2009-08-11 Thread Steffen Weißmann

I was aware of master.pdf before I ordered the book. Somehow I had
expected that the publisher would do some value-adding for the print
version, like formatting and indexing.  When I tried to follow a See
appendix... hint in the book for the first time I thought amazon had
sent me a misprint version... Another thing that I really miss is a
page header telling the current chapter. Just in case you publish a
second edition ;-)

Nonetheless thanks for writing the book!

Steffen.

 We're also disappointed that the book had neither an index or the
 appendices. Their omission was due to some issues with the way that APress
 handles FirstPress books. The index was definitely not possible for them,
 and the removal of the appendices was done so that the book would be printed
 in time (their printing workflow supposedly didn't allow for  X chapters
 and would have had to been rewritten). The appendices are available in PDF
 here:

 http://www.apress.com/book/downloadfile/4390

 If you want a full PDF with index and appendices, you can check out the
 open-source version of the book here:

 http://groups.google.com/group/the-lift-book

 The master.pdf under Files is the most up-to-date version, and as I have
 time I update it with feedback. The two versions aren't 100% identical but
 they are very similar.

 Derek

 On Tue, Aug 11, 2009 at 1:01 PM, Steffen Weißmann
 steffen.weissm...@googlemail.com wrote:

 Sorry, it was a beginning scala problem: Instead of

 val prod = Product.create i had
 def prod = Product.create...

 then prod.save returned true and prod.id=-1...

 Also sorry for posting this twice, but for some reason it took several
 hours until the mails showed up on the list, I didn't expect that...

 BTW: I have bought your Lift book (the paper version...), and I am a
 little disappointed that it has neither an appendix nor an index. What
 was the reason for that?


 Cheers, Steffen.

 On Tue, Aug 11, 2009 at 8:34 PM, Derek Chen-Beckerdchenbec...@gmail.com
 wrote:
  Is it always the same one that gets a correct ID, and if you comment out
  that save does the other one get a correct ID? I'm just wondering if
  there's
  something sequential related to retrieving the generated IDs.
 
  Derek
 
  On Tue, Aug 11, 2009 at 6:25 AM, Steffen Weißmann
  steffen.weissm...@googlemail.com wrote:
 
  Hi,
 
  i am using two Mapper classes, both extend LongKeyedMapper[..] with
  IdPK. After saving (returns true for both) one class always has id=-1,
  the id of the other class counts up as expected. The id is however
  correct when i list the table from another snippet. Any hints?
 
  Thanks, Steffen.
 
 
 
 
  
 



 --
 Steffen Weissmann

 Technische Universitaet Berlin - Math. Department - MA 3-2

 Str. des 17. Juni 136
 10623 Berlin - Germany

 Phone: +49 30 314-29278
 Mail: weissm...@math.tu-berlin.de
 Web: www.math.tu-berlin.de/~weissman




 


--~--~-~--~~~---~--~~
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: how do you initialise a MappedLongForeignKey object?

2009-08-11 Thread Steffen Weißmann

I think the problem is the new Address. You need
Address.create.save. My code is:

def addAddress(form: NodeSeq) = {
val user = User.currentUser.open_!
val addr = user.address.obj.openOr {
val newAdr = Address.create
newAdr.save
user.address(newAdr).save
println(Creating new Address for user 
+user.firstName+ +user.lastName)
newAdr
}
def doBind(form: NodeSeq): NodeSeq =
table{bind(form, form,
table - 
addr.toForm(Full(S.?(address.submit)), doBind, addr
= addr.save)
)}/table
doBind(form)
}

Steffen.

On Tue, Aug 11, 2009 at 10:48 PM, Naftoli Gugenheimnaftoli...@gmail.com wrote:

 Try mixing in LongMappedForeignMapper to address, or calling 
 address.primeObj(addressObj).
 What doesn't work the way you tried?

 -
 georgegeo...@mattandgeorge.com wrote:


 I have extended MegaProtoUser in order to add a related Address object
 which is a MappedLongForeignKey.

 The idea being simply that there is a 1 to 1 relationship between a
 User and their Address.

 When a new User object is instantiated (but not yet persisted), I want
 to be able to get the related address object like this:

 user.address.obj

 But the returned Box is always empty, I guess because nothing has been
 saved yet.

 I need to somehow initialise the address if it is Empty otherwise
 return the current Address.

 I thought something like this would work, but it doesn't:

 user.address.obj.openOr(user.address(new Address).address.obj.open_!)

 Anyone know how to do this properly?


 




-- 
Steffen Weissmann

Technische Universitaet Berlin - Math. Department - MA 3-2

Str. des 17. Juni 136
10623 Berlin - Germany

Phone: +49 30 314-29278
Mail: weissm...@math.tu-berlin.de
Web: www.math.tu-berlin.de/~weissman

--~--~-~--~~~---~--~~
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: how do you initialise a MappedLongForeignKey object?

2009-08-11 Thread george

Thanks for the suggestions.

I have tried primeObj, but it gives me an error: value primeObj is not
a member of Long

This is what I have on my User class:

object address extends MappedLongForeignKey(this, Address)

def getAddress : Address =
address.obj match {
case Full(a) = a
case _ =
val a = new Address
address.primeObj(a)
a
}


The problem with this code..

user.address.obj.openOr(user.address(new Address).address.obj.open_!)

..is that when address is Empty, it always results in a
java.lang.NullPointerException: Trying to open an empty Box





On Aug 11, 9:48 pm, Naftoli Gugenheim naftoli...@gmail.com wrote:
 Try mixing in LongMappedForeignMapper to address, or calling 
 address.primeObj(addressObj).
 What doesn't work the way you tried?

 -

 georgegeo...@mattandgeorge.com wrote:

 I have extended MegaProtoUser in order to add a related Address object
 which is a MappedLongForeignKey.

 The idea being simply that there is a 1 to 1 relationship between a
 User and their Address.

 When a new User object is instantiated (but not yet persisted), I want
 to be able to get the related address object like this:

 user.address.obj

 But the returned Box is always empty, I guess because nothing has been
 saved yet.

 I need to somehow initialise the address if it is Empty otherwise
 return the current Address.

 I thought something like this would work, but it doesn't:

 user.address.obj.openOr(user.address(new Address).address.obj.open_!)

 Anyone know how to do this 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: how do you initialise a MappedLongForeignKey object?

2009-08-11 Thread george

ah sorry, I forgot to wrap the address passed to primeObj in a Box.

address.primeObj(Full(a))

Hopefully it will work now..

On Aug 11, 10:11 pm, george geo...@mattandgeorge.com wrote:
 Thanks for the suggestions.

 I have tried primeObj, but it gives me an error: value primeObj is not
 a member of Long

 This is what I have on my User class:

 object address extends MappedLongForeignKey(this, Address)

 def getAddress : Address =
         address.obj match {
                 case Full(a) = a
                 case _ =
                         val a = new Address
                         address.primeObj(a)
                         a
         }

 The problem with this code..

 user.address.obj.openOr(user.address(new Address).address.obj.open_!)

 ..is that when address is Empty, it always results in a
 java.lang.NullPointerException: Trying to open an empty Box

 On Aug 11, 9:48 pm, Naftoli Gugenheim naftoli...@gmail.com wrote:



  Try mixing in LongMappedForeignMapper to address, or calling 
  address.primeObj(addressObj).
  What doesn't work the way you tried?

  -

  georgegeo...@mattandgeorge.com wrote:

  I have extended MegaProtoUser in order to add a related Address object
  which is a MappedLongForeignKey.

  The idea being simply that there is a 1 to 1 relationship between a
  User and their Address.

  When a new User object is instantiated (but not yet persisted), I want
  to be able to get the related address object like this:

  user.address.obj

  But the returned Box is always empty, I guess because nothing has been
  saved yet.

  I need to somehow initialise the address if it is Empty otherwise
  return the current Address.

  I thought something like this would work, but it doesn't:

  user.address.obj.openOr(user.address(new Address).address.obj.open_!)

  Anyone know how to do this 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: Cant generating liftweb document from source

2009-08-11 Thread Timothy Perrett

Can you try:

mvn install scala:doc

Cheers, Tim

On Aug 11, 8:49 pm, Lance Zheng lanc...@gmail.com wrote:
 I try to generate doc but got an 
 error.http://wiki.liftweb.net/index.php/Generating_Lift_scaladocs_locally
 my OS is vista and maven's version is 2.2.0

 D:\scalasrc\liftwebmvn -v
 Apache Maven 2.2.0 (r788681; 2009-06-26 21:04:01+0800)
 Java version: 1.6.0_13
 Java home: C:\Program Files\Java\jdk1.6.0_13\jre
 Default locale: zh_CN, platform encoding: GBK
 OS name: windows vista version: 6.0 arch: x86 Family: windows

 D:\scalasrc\liftwebmvn scala:doc
 ..
 [WARNING] [Fatal Error] :1:38: Open quote is expected for attribute
 {1} associated with an  elemen
 t type  href.
 [WARNING] Exception in thread main org.xml.sax.SAXParseException:
 Open quote is expected for attri
 bute {1} associated with an  element type  href.
 [WARNING]       at
 com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse
 (AbstractSAXPar
 ser.java:1231)
 [WARNING]       at
 com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl
 $JAXPSAXParser.parse(SAXPars
 erImpl.java:522)
 [WARNING]       at javax.xml.parsers.SAXParser.parse(SAXParser.java:
 395)
 [WARNING]       at scala.xml.parsing.FactoryAdapter.loadXML
 (FactoryAdapter.scala:292)
 [WARNING]       at scala.xml.parsing.NoBindingFactoryAdapter.loadXML
 (NoBindingFactoryAdapter.scala:6
 0)
 [WARNING]       at scala.xml.XML$.load(XML.scala:68)
 [WARNING]       at org.scala_tools.vscaladoc.DocUtil$.load
 (DocUtil.scala:28)
 [WARNING]       at org.scala_tools.vscaladoc.Services$cfg$.setFrom
 (Services.scala:38)
 [WARNING]       at org.scala_tools.vscaladoc.Main$.process(Main.scala:
 81)
 [WARNING]       at org.scala_tools.vscaladoc.Main$.main(Main.scala:
 107)
 [WARNING]       at org.scala_tools.vscaladoc.Main.main(Main.scala)
 [INFO]
 
 [ERROR] BUILD ERROR
 [INFO]
 
 [INFO] wrap: org.apache.maven.reporting.MavenReportException: wrap:
 command line returned non-zero v
 alue:1
--~--~-~--~~~---~--~~
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: how do you initialise a MappedLongForeignKey object?

2009-08-11 Thread george

Hi Steffen, thanks for the thought.

In your case I think the User object will already be saved in the
database when you add an address to it.

I'm trying to make it so that when a new User signs up, they fill in
their address at the same time as the other fields. So there is no
User object in the database to add an address to yet.


On Aug 11, 9:57 pm, Steffen Weißmann
steffen.weissm...@googlemail.com wrote:
 I think the problem is the new Address. You need
 Address.create.save. My code is:

         def addAddress(form: NodeSeq) = {
             val user = User.currentUser.open_!
                 val addr = user.address.obj.openOr {
                         val newAdr = Address.create
                         newAdr.save
                         user.address(newAdr).save
                         println(Creating new Address for user 
 +user.firstName+ +user.lastName)
                         newAdr
                 }
                 def doBind(form: NodeSeq): NodeSeq =
                         table{bind(form, form,
                                 table - 
 addr.toForm(Full(S.?(address.submit)), doBind, addr
 = addr.save)
                         )}/table
                 doBind(form)
         }

 Steffen.





 On Tue, Aug 11, 2009 at 10:48 PM, Naftoli Gugenheimnaftoli...@gmail.com 
 wrote:

  Try mixing in LongMappedForeignMapper to address, or calling 
  address.primeObj(addressObj).
  What doesn't work the way you tried?

  -
  georgegeo...@mattandgeorge.com wrote:

  I have extended MegaProtoUser in order to add a related Address object
  which is a MappedLongForeignKey.

  The idea being simply that there is a 1 to 1 relationship between a
  User and their Address.

  When a new User object is instantiated (but not yet persisted), I want
  to be able to get the related address object like this:

  user.address.obj

  But the returned Box is always empty, I guess because nothing has been
  saved yet.

  I need to somehow initialise the address if it is Empty otherwise
  return the current Address.

  I thought something like this would work, but it doesn't:

  user.address.obj.openOr(user.address(new Address).address.obj.open_!)

  Anyone know how to do this properly?

 --
 Steffen Weissmann

 Technische Universitaet Berlin - Math. Department - MA 3-2

 Str. des 17. Juni 136
 10623 Berlin - Germany

 Phone: +49 30 314-29278
 Mail: weissm...@math.tu-berlin.de
 Web:www.math.tu-berlin.de/~weissman
--~--~-~--~~~---~--~~
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: how do you initialise a MappedLongForeignKey object?

2009-08-11 Thread Naftoli Gugenheim

Did you try LongMappedForeignMapper? I created it for this exact purpose, so if 
it's not working I want to know.
Thanks.

-
georgegeo...@mattandgeorge.com wrote:


Hi Steffen, thanks for the thought.

In your case I think the User object will already be saved in the
database when you add an address to it.

I'm trying to make it so that when a new User signs up, they fill in
their address at the same time as the other fields. So there is no
User object in the database to add an address to yet.


On Aug 11, 9:57 pm, Steffen Weißmann
steffen.weissm...@googlemail.com wrote:
 I think the problem is the new Address. You need
 Address.create.save. My code is:

         def addAddress(form: NodeSeq) = {
             val user = User.currentUser.open_!
                 val addr = user.address.obj.openOr {
                         val newAdr = Address.create
                         newAdr.save
                         user.address(newAdr).save
                         println(Creating new Address for user 
 +user.firstName+ +user.lastName)
                         newAdr
                 }
                 def doBind(form: NodeSeq): NodeSeq =
                         table{bind(form, form,
                                 table - 
 addr.toForm(Full(S.?(address.submit)), doBind, addr
 = addr.save)
                         )}/table
                 doBind(form)
         }

 Steffen.





 On Tue, Aug 11, 2009 at 10:48 PM, Naftoli Gugenheimnaftoli...@gmail.com 
 wrote:

  Try mixing in LongMappedForeignMapper to address, or calling 
  address.primeObj(addressObj).
  What doesn't work the way you tried?

  -
  georgegeo...@mattandgeorge.com wrote:

  I have extended MegaProtoUser in order to add a related Address object
  which is a MappedLongForeignKey.

  The idea being simply that there is a 1 to 1 relationship between a
  User and their Address.

  When a new User object is instantiated (but not yet persisted), I want
  to be able to get the related address object like this:

  user.address.obj

  But the returned Box is always empty, I guess because nothing has been
  saved yet.

  I need to somehow initialise the address if it is Empty otherwise
  return the current Address.

  I thought something like this would work, but it doesn't:

  user.address.obj.openOr(user.address(new Address).address.obj.open_!)

  Anyone know how to do this properly?

 --
 Steffen Weissmann

 Technische Universitaet Berlin - Math. Department - MA 3-2

 Str. des 17. Juni 136
 10623 Berlin - Germany

 Phone: +49 30 314-29278
 Mail: weissm...@math.tu-berlin.de
 Web:www.math.tu-berlin.de/~weissman


--~--~-~--~~~---~--~~
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: how do you initialise a MappedLongForeignKey object?

2009-08-11 Thread george

I'm not sure exactly how to implement that.

Like this?

Address.scala
class Address extends LongKeyedMapper[Address] with IdPK with
LongMappedForeignMapper[T,Address]

User.scala
class User extends MegaProtoUser[User] {
object address extends MappedLongForeignKey(this, Address) with
LongMappedForeignMapper[User, Address]
}


This was the only docs I could find on the LongMappedForeignMapper:

http://wiki.github.com/dpp/liftweb/how-to-work-with-one-to-many-relationships

How does it work for a 1 - 1 relationship?

On Aug 11, 10:36 pm, Naftoli Gugenheim naftoli...@gmail.com wrote:
 Did you try LongMappedForeignMapper? I created it for this exact purpose, so 
 if it's not working I want to know.
 Thanks.

 -

 georgegeo...@mattandgeorge.com wrote:

 Hi Steffen, thanks for the thought.

 In your case I think the User object will already be saved in the
 database when you add an address to it.

 I'm trying to make it so that when a new User signs up, they fill in
 their address at the same time as the other fields. So there is no
 User object in the database to add an address to yet.

 On Aug 11, 9:57 pm, Steffen Weißmann



 steffen.weissm...@googlemail.com wrote:
  I think the problem is the new Address. You need
  Address.create.save. My code is:

          def addAddress(form: NodeSeq) = {
              val user = User.currentUser.open_!
                  val addr = user.address.obj.openOr {
                          val newAdr = Address.create
                          newAdr.save
                          user.address(newAdr).save
                          println(Creating new Address for user 
  +user.firstName+ +user.lastName)
                          newAdr
                  }
                  def doBind(form: NodeSeq): NodeSeq =
                          table{bind(form, form,
                                  table - 
  addr.toForm(Full(S.?(address.submit)), doBind, addr
  = addr.save)
                          )}/table
                  doBind(form)
          }

  Steffen.

  On Tue, Aug 11, 2009 at 10:48 PM, Naftoli Gugenheimnaftoli...@gmail.com 
  wrote:

   Try mixing in LongMappedForeignMapper to address, or calling 
   address.primeObj(addressObj).
   What doesn't work the way you tried?

   -
   georgegeo...@mattandgeorge.com wrote:

   I have extended MegaProtoUser in order to add a related Address object
   which is a MappedLongForeignKey.

   The idea being simply that there is a 1 to 1 relationship between a
   User and their Address.

   When a new User object is instantiated (but not yet persisted), I want
   to be able to get the related address object like this:

   user.address.obj

   But the returned Box is always empty, I guess because nothing has been
   saved yet.

   I need to somehow initialise the address if it is Empty otherwise
   return the current Address.

   I thought something like this would work, but it doesn't:

   user.address.obj.openOr(user.address(new Address).address.obj.open_!)

   Anyone know how to do this properly?

  --
  Steffen Weissmann

  Technische Universitaet Berlin - Math. Department - MA 3-2

  Str. des 17. Juni 136
  10623 Berlin - Germany

  Phone: +49 30 314-29278
  Mail: weissm...@math.tu-berlin.de
  Web:www.math.tu-berlin.de/~weissman
--~--~-~--~~~---~--~~
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: how do you initialise a MappedLongForeignKey object?

2009-08-11 Thread Naftoli Gugenheim

Just on the field, like you have it; not on the mapper.

-
georgegeo...@mattandgeorge.com wrote:


I'm not sure exactly how to implement that.

Like this?

Address.scala
class Address extends LongKeyedMapper[Address] with IdPK with
LongMappedForeignMapper[T,Address]

User.scala
class User extends MegaProtoUser[User] {
object address extends MappedLongForeignKey(this, Address) with
LongMappedForeignMapper[User, Address]
}


This was the only docs I could find on the LongMappedForeignMapper:

http://wiki.github.com/dpp/liftweb/how-to-work-with-one-to-many-relationships

How does it work for a 1 - 1 relationship?

On Aug 11, 10:36 pm, Naftoli Gugenheim naftoli...@gmail.com wrote:
 Did you try LongMappedForeignMapper? I created it for this exact purpose, so 
 if it's not working I want to know.
 Thanks.

 -

 georgegeo...@mattandgeorge.com wrote:

 Hi Steffen, thanks for the thought.

 In your case I think the User object will already be saved in the
 database when you add an address to it.

 I'm trying to make it so that when a new User signs up, they fill in
 their address at the same time as the other fields. So there is no
 User object in the database to add an address to yet.

 On Aug 11, 9:57 pm, Steffen Weißmann



 steffen.weissm...@googlemail.com wrote:
  I think the problem is the new Address. You need
  Address.create.save. My code is:

          def addAddress(form: NodeSeq) = {
              val user = User.currentUser.open_!
                  val addr = user.address.obj.openOr {
                          val newAdr = Address.create
                          newAdr.save
                          user.address(newAdr).save
                          println(Creating new Address for user 
  +user.firstName+ +user.lastName)
                          newAdr
                  }
                  def doBind(form: NodeSeq): NodeSeq =
                          table{bind(form, form,
                                  table - 
  addr.toForm(Full(S.?(address.submit)), doBind, addr
  = addr.save)
                          )}/table
                  doBind(form)
          }

  Steffen.

  On Tue, Aug 11, 2009 at 10:48 PM, Naftoli Gugenheimnaftoli...@gmail.com 
  wrote:

   Try mixing in LongMappedForeignMapper to address, or calling 
   address.primeObj(addressObj).
   What doesn't work the way you tried?

   -
   georgegeo...@mattandgeorge.com wrote:

   I have extended MegaProtoUser in order to add a related Address object
   which is a MappedLongForeignKey.

   The idea being simply that there is a 1 to 1 relationship between a
   User and their Address.

   When a new User object is instantiated (but not yet persisted), I want
   to be able to get the related address object like this:

   user.address.obj

   But the returned Box is always empty, I guess because nothing has been
   saved yet.

   I need to somehow initialise the address if it is Empty otherwise
   return the current Address.

   I thought something like this would work, but it doesn't:

   user.address.obj.openOr(user.address(new Address).address.obj.open_!)

   Anyone know how to do this properly?

  --
  Steffen Weissmann

  Technische Universitaet Berlin - Math. Department - MA 3-2

  Str. des 17. Juni 136
  10623 Berlin - Germany

  Phone: +49 30 314-29278
  Mail: weissm...@math.tu-berlin.de
  Web:www.math.tu-berlin.de/~weissman


--~--~-~--~~~---~--~~
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: how do you initialise a MappedLongForeignKey object?

2009-08-11 Thread george

Ok I am getting somewhere now, thanks!

The address goes into the database fine when I get a reference to it
like this:

def getAddress : Address =
address.obj match {
case Full(a) = a
case _ =
val a = new Address
address(a)
a
}

But the problem now is that the corresponding foreign key on the users
table is not set...

On Aug 11, 11:13 pm, Naftoli Gugenheim naftoli...@gmail.com wrote:
 Just on the field, like you have it; not on the mapper.

 -

 georgegeo...@mattandgeorge.com wrote:

 I'm not sure exactly how to implement that.

 Like this?

 Address.scala
 class Address extends LongKeyedMapper[Address] with IdPK with
 LongMappedForeignMapper[T,Address]

 User.scala
 class User extends MegaProtoUser[User] {
 object address extends MappedLongForeignKey(this, Address) with
 LongMappedForeignMapper[User, Address]

 }

 This was the only docs I could find on the LongMappedForeignMapper:

 http://wiki.github.com/dpp/liftweb/how-to-work-with-one-to-many-relat...

 How does it work for a 1 - 1 relationship?

 On Aug 11, 10:36 pm, Naftoli Gugenheim naftoli...@gmail.com wrote:



  Did you try LongMappedForeignMapper? I created it for this exact purpose, 
  so if it's not working I want to know.
  Thanks.

  -

  georgegeo...@mattandgeorge.com wrote:

  Hi Steffen, thanks for the thought.

  In your case I think the User object will already be saved in the
  database when you add an address to it.

  I'm trying to make it so that when a new User signs up, they fill in
  their address at the same time as the other fields. So there is no
  User object in the database to add an address to yet.

  On Aug 11, 9:57 pm, Steffen Weißmann

  steffen.weissm...@googlemail.com wrote:
   I think the problem is the new Address. You need
   Address.create.save. My code is:

           def addAddress(form: NodeSeq) = {
               val user = User.currentUser.open_!
                   val addr = user.address.obj.openOr {
                           val newAdr = Address.create
                           newAdr.save
                           user.address(newAdr).save
                           println(Creating new Address for user 
   +user.firstName+ +user.lastName)
                           newAdr
                   }
                   def doBind(form: NodeSeq): NodeSeq =
                           table{bind(form, form,
                                   table - 
   addr.toForm(Full(S.?(address.submit)), doBind, addr
   = addr.save)
                           )}/table
                   doBind(form)
           }

   Steffen.

   On Tue, Aug 11, 2009 at 10:48 PM, Naftoli Gugenheimnaftoli...@gmail.com 
   wrote:

Try mixing in LongMappedForeignMapper to address, or calling 
address.primeObj(addressObj).
What doesn't work the way you tried?

-
georgegeo...@mattandgeorge.com wrote:

I have extended MegaProtoUser in order to add a related Address object
which is a MappedLongForeignKey.

The idea being simply that there is a 1 to 1 relationship between a
User and their Address.

When a new User object is instantiated (but not yet persisted), I want
to be able to get the related address object like this:

user.address.obj

But the returned Box is always empty, I guess because nothing has been
saved yet.

I need to somehow initialise the address if it is Empty otherwise
return the current Address.

I thought something like this would work, but it doesn't:

user.address.obj.openOr(user.address(new Address).address.obj.open_!)

Anyone know how to do this properly?

   --
   Steffen Weissmann

   Technische Universitaet Berlin - Math. Department - MA 3-2

   Str. des 17. Juni 136
   10623 Berlin - Germany

   Phone: +49 30 314-29278
   Mail: weissm...@math.tu-berlin.de
   Web:www.math.tu-berlin.de/~weissman
--~--~-~--~~~---~--~~
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] ajaxForm with mapped function

2009-08-11 Thread jon

Hi,

I'm not sure if this behavior already exists via some other mechanism,
but I wanted an ajaxForm that executed a JsCmd sent from the sever
after submit.  Here it is:

def ajaxForm(body: NodeSeq,func: ()=JsCmd) = {
  val id = Helpers.nextFuncName

  fmapFunc(func)(name = form action=javascript:// id={id}
onsubmit={makeAjaxCall(LiftRules.jsArtifacts.serialize(id)).toJsCmd+;
return false;} input type=hidden name={name} value=true/ {body}
/form)
}

Is there a better way?  jsonForms seemed like a bit of overkill to do
what i wanted= simple update of div after submit.

- Jon
--~--~-~--~~~---~--~~
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: how do you initialise a MappedLongForeignKey object?

2009-08-11 Thread Naftoli Gugenheim

What do you mean?

-
georgegeo...@mattandgeorge.com wrote:


Ok I am getting somewhere now, thanks!

The address goes into the database fine when I get a reference to it
like this:

def getAddress : Address =
address.obj match {
case Full(a) = a
case _ =
val a = new Address
address(a)
a
}

But the problem now is that the corresponding foreign key on the users
table is not set...

On Aug 11, 11:13 pm, Naftoli Gugenheim naftoli...@gmail.com wrote:
 Just on the field, like you have it; not on the mapper.

 -

 georgegeo...@mattandgeorge.com wrote:

 I'm not sure exactly how to implement that.

 Like this?

 Address.scala
 class Address extends LongKeyedMapper[Address] with IdPK with
 LongMappedForeignMapper[T,Address]

 User.scala
 class User extends MegaProtoUser[User] {
 object address extends MappedLongForeignKey(this, Address) with
 LongMappedForeignMapper[User, Address]

 }

 This was the only docs I could find on the LongMappedForeignMapper:

 http://wiki.github.com/dpp/liftweb/how-to-work-with-one-to-many-relat...

 How does it work for a 1 - 1 relationship?

 On Aug 11, 10:36 pm, Naftoli Gugenheim naftoli...@gmail.com wrote:



  Did you try LongMappedForeignMapper? I created it for this exact purpose, 
  so if it's not working I want to know.
  Thanks.

  -

  georgegeo...@mattandgeorge.com wrote:

  Hi Steffen, thanks for the thought.

  In your case I think the User object will already be saved in the
  database when you add an address to it.

  I'm trying to make it so that when a new User signs up, they fill in
  their address at the same time as the other fields. So there is no
  User object in the database to add an address to yet.

  On Aug 11, 9:57 pm, Steffen Weißmann

  steffen.weissm...@googlemail.com wrote:
   I think the problem is the new Address. You need
   Address.create.save. My code is:

           def addAddress(form: NodeSeq) = {
               val user = User.currentUser.open_!
                   val addr = user.address.obj.openOr {
                           val newAdr = Address.create
                           newAdr.save
                           user.address(newAdr).save
                           println(Creating new Address for user 
   +user.firstName+ +user.lastName)
                           newAdr
                   }
                   def doBind(form: NodeSeq): NodeSeq =
                           table{bind(form, form,
                                   table - 
   addr.toForm(Full(S.?(address.submit)), doBind, addr
   = addr.save)
                           )}/table
                   doBind(form)
           }

   Steffen.

   On Tue, Aug 11, 2009 at 10:48 PM, Naftoli Gugenheimnaftoli...@gmail.com 
   wrote:

Try mixing in LongMappedForeignMapper to address, or calling 
address.primeObj(addressObj).
What doesn't work the way you tried?

-
georgegeo...@mattandgeorge.com wrote:

I have extended MegaProtoUser in order to add a related Address object
which is a MappedLongForeignKey.

The idea being simply that there is a 1 to 1 relationship between a
User and their Address.

When a new User object is instantiated (but not yet persisted), I want
to be able to get the related address object like this:

user.address.obj

But the returned Box is always empty, I guess because nothing has been
saved yet.

I need to somehow initialise the address if it is Empty otherwise
return the current Address.

I thought something like this would work, but it doesn't:

user.address.obj.openOr(user.address(new Address).address.obj.open_!)

Anyone know how to do this properly?

   --
   Steffen Weissmann

   Technische Universitaet Berlin - Math. Department - MA 3-2

   Str. des 17. Juni 136
   10623 Berlin - Germany

   Phone: +49 30 314-29278
   Mail: weissm...@math.tu-berlin.de
   Web:www.math.tu-berlin.de/~weissman


--~--~-~--~~~---~--~~
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: How to override lift messages?

2009-08-11 Thread Ewan


Thanks that does work but is still a maintainance issue if subsequent
Lift releases add new strings.  I suppose I want to selectively
override individual strings and if not then fall back to lift-core
resource bundle.

-- Ewan
On Aug 11, 11:53 am, marius d. marius.dan...@gmail.com wrote:
 You can specify your own ResourceBundle for Lift's strings:

 LiftRules.liftCoreResourceName which is currently set to i18n.lift-
 core

 or you can manually change lift-core.properties files from the Lift's
 jar file.

 Current Lift's strings are in lift\src\main\resources\i18n\lift-
 core.properties

 Br's,
 Marius

 On Aug 11, 1:13 pm, Ewan ehar...@gmail.com wrote:



   There are a couple of cases where I would like to override the
  localised messages that Lift itself users such as S.notice(S.??
  (logged.in)) in MetaMegaProtoUser.login().  I was hoping I could
  override by popping the name=value in my message bundle properties
  file but it does not work.  I realise I could override/copy
  MetaMegaProtoUser.login() and replace that one line with a key from my
  own bundle but I am not a fan of copy/paste inheritance.  Would you
  accept a request to change S.notice(S.??(logged.in)) etc to call
  functions we can override?

  -- Ewan

--~--~-~--~~~---~--~~
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: SOAP web services?

2009-08-11 Thread Meredith Gregory
Marius,

The original design goals of WSDL were very straightforward:

   - a Port Type is a set of Message Types governing all the messages
   arriving on the Port
   - A Message Type is given precisely by an XML Schema (e.g. an XSD)
   - A Port is instanced by binding a Port Type to an Endpoint (URL)
   supporting a transport protocol

In symbols, WSDL was intended to be able to make statements of the form

   - URL+Transport : { XMLSchema1, ..., XMLSchemaN }
   - Notice the close correlation between this and the statement you see on
   the Scala REPL all the time:
   - ScalaExpr ret
  - res1 : ScalaType

URL is the location of the resource/instance in the same way that res1
provides a location that the Scala REPL can use to look up the instance.
PortType is very much like a ScalaType. In the case of typing at the Scala
REPL from a command shell there is no question of transport and any
encoding/decoding necessary. However, if one had a more remote network
access to the Scala REPL that did involve some issues around transport and
encoding/decoding, then these two cases would be isomorphic.

BTW, this lines up nearly perfectly with the idea of sorts and sorting in
Milner's π-calculus.

Because message exchange usually involves parameter-passing  because of
confusion about the role of Object Technology in all this, WSDL was
extended with the notion of Operation. This could have been done more
cleanly, but was not. Not everyone involved in WSDL's design had the same
picture in their minds of what they were attempting to accomplish.

As for what happens today, i could easily imaging WSDL and/or WSDL+SOAP over
RabbitMQ, for example. i think something like this is considerably better
than JSON over transport. The basic reason for this is straightforward.
XMLSchema are a form of typing discipline. So, you get a typing discipline
for messaging-style applications that fits well with the typing discipline
of a language like Scala.

This could, for example, play out very nicely in an actor framework. An
actor's mailbox is a good thing to locate at an URL. Then you have
statements of the form

   - URL + Transport/Actor : { MessageType1, ..., MessageTypeN }

Today, Scala actors do not even support statements of this basic form,
though they would greatly enhance the actor package.

Beyond this, you can imagine putting constraints on the order of messages.
Here's a general scheme

   - Actor : ( { MsgType1 - Type1, ..., MsgTypeN - TypeN },
   RegularExpressionOver(MsgType1,...,MsgTypeN) )
   - The first element in the pair just maps message type names to Scala
   types (or the types of some host language) and the second element in the
   pair says the order you expect to see messages in the mailbox.
   - Here's an example: ( { Init - OpenSession( id, pwd ), Read - ReadDb(
   ... ), Update - UpdateDB( ... ), Finish - CloseSession( ... ) },
   Init.(Read+Update)*.Finish )
  - It says that the only legal sequences of messages in the mbox are of
  the form Init :: Read-or-Update :: ... :: Read-or-Update :: FInish.


Best wishes,

--greg

On Tue, Aug 11, 2009 at 9:27 AM, marius d. marius.dan...@gmail.com wrote:




 On Aug 11, 7:09 pm, Meredith Gregory lgreg.mered...@gmail.com wrote:
  Tim,
 
  i was under the same impression, but then read a couple of IBM comparison
  articles and a WSO2 blog and it seemed that the WSDL 2.0 was gaining
 ground.
  Further, the tooling for WSDL, with integration into all the major IDE's,
  has been significantly more developed than the WADL tooling. However,
  yesterday i tried a simple example with a schema-valid WSDL 2.0 xml
 document
  for a simple service with 1 operation and the Apache Axis2 tool barfed on
  the fact that the schema pointed to in the document was for WSDL 2.0 and
 not
  WSDL 1.1 -- despite the fact that they claim on their home page to
 support
  WSDL 2.0.
 
  For the record, WSDL -- as much as i hate it -- was not meant to be tied
 to
  a transport. As a matter of fact, neither was SOAP. You should be able to
  effect these over any transport, HTTP included, and presumably in more
 than
  one way. WADL is tied to HTTP. This means its scope is considerably more
  limited.

 Very true. But then again in reality how often are we seeing WSDL/SOAP
 bound to something else then HTTP? ... in some respects this seems a
 false selling point of SOAP.

 Assuming an enterprise application where let's say we can escape HTTP
 realm, probably RMI/IIOP, JINI, JXTA etc. even proprietary on the wire
 representation etc.becomes valid choices.

 
  Best wishes,
 
  --greg
 
  On Tue, Aug 11, 2009 at 12:55 AM, Timothy Perrett
  timo...@getintheloop.euwrote:
 
 
 
 
 
   Hey Greg,
 
   Im not sure about WSDL2.0, but my understanding was that WADL
   (https://wadl.dev.java.net/) was making the most ground in the REST
   service description arena.
 
   Cheers, Tim
 
   On Aug 10, 10:58 pm, Meredith Gregory lgreg.mered...@gmail.com
   wrote:
Lifted RESTafarians,
 
Has 

[Lift] Re: Mapper with id=-1

2009-08-11 Thread TylerWeir

I wanted to echo Derek's surprise at some of the omissions in the
paper book.

It was a disappointment for us as well.

Thanks for ordering the book.

On Aug 11, 4:52 pm, Steffen Weißmann
steffen.weissm...@googlemail.com wrote:
 I was aware of master.pdf before I ordered the book. Somehow I had
 expected that the publisher would do some value-adding for the print
 version, like formatting and indexing.  When I tried to follow a See
 appendix... hint in the book for the first time I thought amazon had
 sent me a misprint version... Another thing that I really miss is a
 page header telling the current chapter. Just in case you publish a
 second edition ;-)

 Nonetheless thanks for writing the book!

 Steffen.

  We're also disappointed that the book had neither an index or the
  appendices. Their omission was due to some issues with the way that APress
  handles FirstPress books. The index was definitely not possible for them,
  and the removal of the appendices was done so that the book would be printed
  in time (their printing workflow supposedly didn't allow for  X chapters
  and would have had to been rewritten). The appendices are available in PDF
  here:

 http://www.apress.com/book/downloadfile/4390

  If you want a full PDF with index and appendices, you can check out the
  open-source version of the book here:

 http://groups.google.com/group/the-lift-book

  The master.pdf under Files is the most up-to-date version, and as I have
  time I update it with feedback. The two versions aren't 100% identical but
  they are very similar.

  Derek

  On Tue, Aug 11, 2009 at 1:01 PM, Steffen Weißmann
  steffen.weissm...@googlemail.com wrote:

  Sorry, it was a beginning scala problem: Instead of

  val prod = Product.create i had
  def prod = Product.create...

  then prod.save returned true and prod.id=-1...

  Also sorry for posting this twice, but for some reason it took several
  hours until the mails showed up on the list, I didn't expect that...

  BTW: I have bought your Lift book (the paper version...), and I am a
  little disappointed that it has neither an appendix nor an index. What
  was the reason for that?

  Cheers, Steffen.

  On Tue, Aug 11, 2009 at 8:34 PM, Derek Chen-Beckerdchenbec...@gmail.com
  wrote:
   Is it always the same one that gets a correct ID, and if you comment out
   that save does the other one get a correct ID? I'm just wondering if
   there's
   something sequential related to retrieving the generated IDs.

   Derek

   On Tue, Aug 11, 2009 at 6:25 AM, Steffen Weißmann
   steffen.weissm...@googlemail.com wrote:

   Hi,

   i am using two Mapper classes, both extend LongKeyedMapper[..] with
   IdPK. After saving (returns true for both) one class always has id=-1,
   the id of the other class counts up as expected. The id is however
   correct when i list the table from another snippet. Any hints?

   Thanks, Steffen.

  --
  Steffen Weissmann

  Technische Universitaet Berlin - Math. Department - MA 3-2

  Str. des 17. Juni 136
  10623 Berlin - Germany

  Phone: +49 30 314-29278
  Mail: weissm...@math.tu-berlin.de
  Web:www.math.tu-berlin.de/~weissman


--~--~-~--~~~---~--~~
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] javascript error in embed.js

2009-08-11 Thread David Persons

Hello everybody,

I got stuck trying to embed a Wave on an already existing website.. My
guess is there is a conflict with another js file used on the page:

Error: uncaught exception: [Exception... Operation is not supported
code: 9 nsresult: 0x80530009 (NS_ERROR_DOM_NOT_SUPPORTED_ERR)
location: http://wave-api.appspot.com/public/embed.js Line: 2]

Anyone has seen this error before and/or any tips anyone?

kind regards,
David Persons
--~--~-~--~~~---~--~~
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: javascript error in embed.js

2009-08-11 Thread David Pollak
Google is not honoring XHTML.

To serve the pages as text/html:

LiftRules.useXhtmlMimeType = false

Thanks,

David

On Tue, Aug 11, 2009 at 4:45 PM, David Persons dhwpers...@gmail.com wrote:


 Hello everybody,

 I got stuck trying to embed a Wave on an already existing website.. My
 guess is there is a conflict with another js file used on the page:

 Error: uncaught exception: [Exception... Operation is not supported
 code: 9 nsresult: 0x80530009 (NS_ERROR_DOM_NOT_SUPPORTED_ERR)
 location: http://wave-api.appspot.com/public/embed.js Line: 2]

 Anyone has seen this error before and/or any tips anyone?

 kind regards,
 David Persons
 



-- 
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] foreign key reference that will never be null

2009-08-11 Thread harryh

In my app I have a bunch of Users.  Each User is always in a city so I
put this in User:

object cityid extends MappedLongForeignKey(this, City)

but this allows for things like cityid = NULL or cityid = something
that is not a valid City pk.  And also cityid.obj is a Box[City]
instead of just a City.  Is there something I can do to enforce a
stronger constraint?  It would be great if

A) I could avoid the Box entirely and just get a City
B) The Schemafier set cityid NOT NULL and set a foreign key constraint
in the database

-harryh

--~--~-~--~~~---~--~~
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: ajaxForm with mapped function

2009-08-11 Thread David Pollak
On Tue, Aug 11, 2009 at 3:31 PM, jon jonhoff...@gmail.com wrote:


 Hi,

 I'm not sure if this behavior already exists via some other mechanism,
 but I wanted an ajaxForm that executed a JsCmd sent from the sever
 after submit.  Here it is:

def ajaxForm(body: NodeSeq,func: ()=JsCmd) = {
  val id = Helpers.nextFuncName

  fmapFunc(func)(name = form action=javascript:// id={id}
 onsubmit={makeAjaxCall(LiftRules.jsArtifacts.serialize(id)).toJsCmd+;
 return false;} input type=hidden name={name} value=true/ {body}
 /form)
}

 Is there a better way?


You could use an ajaxButton to update the div... alternatively, put an
SHtml.hidden field in the form itself.


  jsonForms seemed like a bit of overkill to do
 what i wanted= simple update of div after submit.

 - Jon
 



-- 
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] Re: bind with outer element?

2009-08-11 Thread David Pollak
On Mon, Aug 10, 2009 at 1:44 PM, jon jonhoff...@gmail.com wrote:


 Hi,

 I have a template with the following

 lift:Snippit
  t:name shorten=true /
  t:foo form=POST
form:name/
...
  /t:foo
 /lift:Snippet

 And a snippet like:

 def doSnippet(x:NodeSeq):NodeSeq = {
  bind(t, x,
name- (doName(_)),


try:

def myFunc(node: NodeSeq): NodeSeq = if ((node \ @shorten).isEmpty)
longVersion else shortVersion

bind(t, x, FuncBindParam(name, myFunc _))

You get the complete t:name shorten=true/ passed to myFunc.

Thanks,

David


foo - (doForm(_))
  )
 }

 In the code above only the contents of the bound tags are available
 for doName and doForm, if I want to be able to read the attribute
 shorten in doName and have foo render with an enclosing form
 tag,  how do I create the bind params?

 I am doing an expensive batch operation upfront, so I want everything
 to be in the same snippet.

 Thanks,

 Jon

 



-- 
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] Re: bind with outer element?

2009-08-11 Thread Naftoli Gugenheim

Doesn't the FuncBindParam only get the element's child NodeSeq?

-
David Pollakfeeder.of.the.be...@gmail.com wrote:

On Mon, Aug 10, 2009 at 1:44 PM, jon jonhoff...@gmail.com wrote:


 Hi,

 I have a template with the following

 lift:Snippit
  t:name shorten=true /
  t:foo form=POST
form:name/
...
  /t:foo
 /lift:Snippet

 And a snippet like:

 def doSnippet(x:NodeSeq):NodeSeq = {
  bind(t, x,
name- (doName(_)),


try:

def myFunc(node: NodeSeq): NodeSeq = if ((node \ @shorten).isEmpty)
longVersion else shortVersion

bind(t, x, FuncBindParam(name, myFunc _))

You get the complete t:name shorten=true/ passed to myFunc.

Thanks,

David


foo - (doForm(_))
  )
 }

 In the code above only the contents of the bound tags are available
 for doName and doForm, if I want to be able to read the attribute
 shorten in doName and have foo render with an enclosing form
 tag,  how do I create the bind params?

 I am doing an expensive batch operation upfront, so I want everything
 to be in the same snippet.

 Thanks,

 Jon

 



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