[Lift] MegaProtoUser + MappedPassword question

2009-11-08 Thread george

I'm using MegaProtoUser which has a MappedPassword field.

When the sign up form is displayed, the password field is pre-
populated to '***' which is proving very confusing for some users.

I would like to display the password field as a completely empty
field, but I can not see a way to override this behavior.

MegaProtoUser is mostly suiting my needs pretty well right now, so I
am reluctant to roll my own for the sake of such a small detail.

Does anyone have any ideas how I can achieve this?

thanks

george
--~--~-~--~~~---~--~~
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] MegaProtoUser + MappedPassword question

2009-11-08 Thread george

I'm using MegaProtoUser which has a MappedPassword field.

When the sign up form is displayed, the password field is pre-
populated to '***' which is proving very confusing for some users.

I would like to display the password field as a completely empty
field, but I can not see a way to override this behavior.

MegaProtoUser is mostly suiting my needs pretty well right now, so I
am reluctant to roll my own for the sake of such a small detail.

Does anyone have any ideas how I can achieve this?

thanks

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



[Lift] Re: Proposal : Lift ticketing system

2009-10-29 Thread george

It might be worth taking a look at Redmine (http://www.redmine.org)
for some inspiration.

I think it has the features you want and a very nice, simple UI.

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



[Lift] Re: Proposal : Lift ticketing system

2009-10-29 Thread george

The things I find really useful in redmine are:

- the contextual menu when you right click an issue.
Speeds up quite a few actions by reducing clicks.
http://www.redmine.org/projects/redmine/issues

- the git integration.
You can update the status of your issues by putting
keywords in the commit message
http://www.redmine.org/wiki/redmine/RedmineSettings#Referencing-issues-in-commit-messages


george

--~--~-~--~~~---~--~~
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 use mapper like clause questions

2009-10-27 Thread george

 I have not validated this, but try:

 BySql(users.email like ?, ..., %+q+%)

that works

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] how to use mapper like clause questions

2009-10-26 Thread george

Is there any way to do this, but have it match on OR instead of AND?

User.findAll(Like(User.firstName, % + q + %), Like(User.lastName,
% + q + %))

I couldn't see a way to do it, so I tried out BySQL instead. However,
when I put in the % wildcards I get a sql exception..

User.findAll( BySql(users.email like '%?%',
  IHaveValidatedThisSQL(george, 2009-10-26), q) )

So how do you specify the wildcards?

thanks

george
--~--~-~--~~~---~--~~
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: **Breaking Changes** **README** **Important**

2009-10-22 Thread george

 - Secondly, I also get compilation error for calling
 scheduleAtFixedRate method on ActorPing. Says no such method. Has this
 method been deprecated and if so, what is the method I should be
 calling instead?

I have this problem also.

--~--~-~--~~~---~--~~
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: **Breaking Changes** **README** **Important**

2009-10-22 Thread george

ok so..

object LocalSmtp extends Actor

should become

object LocalSmtp extends GenericActor[LocalSmtp]

?

--~--~-~--~~~---~--~~
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: **Breaking Changes** **README** **Important**

2009-10-22 Thread george

Thanks Dan, I will try that.
--~--~-~--~~~---~--~~
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 / where to set the runmode of a lift application?

2009-09-13 Thread george

Thanks Xavi

 I believe you can also modify web.xml in some way, but I'm not really sure.

that would be useful as I don't have the ability to set properties on
the production environment.

I wonder if anyone else can confirm?
--~--~-~--~~~---~--~~
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 send an attachment using Mailer?

2009-09-13 Thread george

hello all

I need to send a pdf attachment with my xhtml mail body.

At first I thought I might be able to treat it as an inline image
(byte array). But this doesn't seem to work (the pdf file has 0 bytes
when received).

Then I thought I could make my own MailBodyType and include it that
way, but it seems the design of the Mailer singleton doesn't allow me
to do this.

I need to be able to do something like this:

val attachment = new MimeBodyPart
attachment.setFileName(fileName)
attachment.setContentID(fileName)
attachment.setDisposition(attachment)
attachment.setDataHandler(new _root_.javax.activation.DataHandler(new
_root_.javax.activation.DataSource {
def getContentType = application/pdf
def getInputStream = new _root_.java.io.ByteArrayInputStream
(pdf.toByteArray)
def getName = fileName
def getOutputStream = throw new _root_.java.io.IOException(Unable to
write to item)
}))

The ability to somehow add arbitrary attachments to an email would be
a very useful feature I think.

Is there a way to do it that I have missed?


--~--~-~--~~~---~--~~
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 send an attachment using Mailer?

2009-09-13 Thread george

update:

ok, so it turns out that you can send pdfs as inline attachments using
XHTMLPlusImages. (the byte array being empty was my fault).

however, it would still be good to be able to add arbitrary
attachments. a pdf isn't really an image.


--~--~-~--~~~---~--~~
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 / where to set the runmode of a lift application?

2009-09-12 Thread george

can anyone tell me how I can change the runmode of my application to
production?

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] how do you set system properties in lift?

2009-09-08 Thread george

say I wanted to change the port / host that the Mailer uses.

how would I go about that?

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: how to schedule a job?

2009-09-05 Thread george

Thanks Xavi
--~--~-~--~~~---~--~~
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 schedule a job?

2009-09-04 Thread george

If I needed to schedule a job say for example to do a database query
that returned a set of users matching some criteria and send them an
email. How would I do that in Lift?

I started looking through the API and noticed that we have
net.liftweb.util.Scheduled in ActorPing.scala is this what I need?
Anyone have any examples?

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] lift:msgs - how to override the default markup?

2009-09-03 Thread george

Hello folks,

If I want to change the XHTML output of the builtin snippet Msgs, what
is the best way to do that? / Can I do that?

Say for example if I didn't want an unordered list..

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: lift:msgs - how to override the default markup?

2009-09-03 Thread george

thanks marius, I'll explore both options and hopefully I'll learn some
more about scala and lift along the way..


--~--~-~--~~~---~--~~
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: Menu.builder li_item being applied to all?

2009-08-25 Thread george

Maybe the fix for this issue has caused the problem..?

http://groups.google.com/group/liftweb/browse_thread/thread/aca3b12c397e3b87
http://github.com/dpp/liftweb/issues/closed/#issue/53

--~--~-~--~~~---~--~~
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: Menu builder group and li_item

2009-08-25 Thread george

Thanks for looking into this so quickly. I haven't had a chance to
test it yet, but I notice another user is now having a slightly
different problem. Not sure if it's related.

http://groups.google.com/group/liftweb/browse_thread/thread/12415c178ee7b1ee/75d38df3617f77b6#75d38df3617f77b6
--~--~-~--~~~---~--~~
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: can I do something like this with nested snippets?

2009-08-25 Thread george

That seems to make sense mostly. I'll give it a try.

One thing I am not sure about is this:

As the License.index is iterating over the licenses, when I call
License.id how will the License snippet know which is the current
object? Do I have to maintain a reference to it somewhere?

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] can I do something like this with nested snippets?

2009-08-25 Thread george

lift:Licenses.index

h3l:type //h3

table
lift:Ratings.index
tr
  tdr:rating //td
/tr
/lift:Ratings.index
/table

/lift:Licenses.index


and if so..

can I pass a parameter to the inner Ratings.index snippet - e.g the ID
of the current license object being processed - so that the
Ratings.index function can use it to find the ratings.

the idea being that this way I could re-use my existing Rating snippet
code to display ratings on the same page as licenses. or is this just
a bad idea?
--~--~-~--~~~---~--~~
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: Menu builder group and li_item

2009-08-25 Thread george

awesome 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: can I do something like this with nested snippets?

2009-08-25 Thread george

David - thanks for this.

I understand most of what is going on here.

I've not come across DynamicVariable before, but having looked it up I
think I see why you have used it.

Please could you explain a bit more what is happening in this line:

CurrentLicense.withValue(Full(currentLicense))
{session.processSurroundAndInclude(PageName get, bound)}

What/where is PageName get ?

--~--~-~--~~~---~--~~
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: Menu builder group and li_item

2009-08-24 Thread george

Issue is filed here:

http://github.com/dpp/liftweb/issues#issue/53
--~--~-~--~~~---~--~~
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] Menu builder group and li_item

2009-08-22 Thread george

I'm trying to work with a SiteMap which has some different LocGroups.

When I do:

lift:Menu.builder li_item:class=selected /

I can render a menu for the whole sitemap and the selected item has
the class attribute applied.

But, when I do:

lift:Menu.builder group=site li_item:class=selected /

I would expect the same behavior with a subset of items, but it just
doesn't work. The selected item doesn't get the class attribute.

However, if I do:

lift:Menu.builder group=site li:class=hello /

Every item gets the class attribute.

To me this seems like a bug, or am I missing something?

--~--~-~--~~~---~--~~
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: managing foreign key object relationships with mapper

2009-08-21 Thread george

in case it helps anyone else, here is the solution to the above
problem

the dirty_? function should (obviously) use || not 

override def dirty_?(toCheck: User): Boolean =
Address.dirty_?(toCheck.getAddress) || super.dirty_?(toCheck)

it appears i have been suffering from a severe bout of code
blindness / stupidity!

@naftoli - I tried out your LongMappedForeignMapper pulled from github
today, and it does now seem to work as advertised by setting the long
foreign key properly. It would be nice though if a call to user.save
could propogate to all the LongMappedForeignMapper children in the
User class. I have implemented this by overriding the dirty_? function
and using a beforeSave, but there is probably a better way.

--~--~-~--~~~---~--~~
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: managing foreign key object relationships with mapper

2009-08-20 Thread george

anyone have any ideas about this?
--~--~-~--~~~---~--~~
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] managing foreign key object relationships with mapper

2009-08-18 Thread george

What I want to do:

Create a one-to-zero-or-one relationship between User and Address.
I.e. User belongs to Address.

When a new user signs up for an account they need to fill in an
address form at that same time. So the user.address object needs to be
initialised properly when the user object is created. (this part is
working ok).

I also want (for backwards compatibility) existing users to get a new
Address object when they update their profile if they currently don't
have an address. I.e. in the users table the address foreign key is
null. (this part nearly works)

What the problem is:

When a new user signs up it seems to work fine. The address is saved
in the database and the foreign key is set on the user.

However, when there is an existing user with no address (the
user.address FK is NULL), they fill in the form and click update. The
address is saved into the database, BUT the user.address FK is not set
in the users table. It remains NULL.

I have tried various combinations of things such as primeObj(), apply
() and LongMappedForeignMapper, but I don't understand why the FK is
not being updated.

Here is my User.scala
http://gist.github.com/169639

and my Address.scala
http://gist.github.com/169638

I also have a hello-lift app that demonstrates this problem if it's
useful.

Thanks in advance!

--~--~-~--~~~---~--~~
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: managing foreign key object relationships with mapper

2009-08-18 Thread george

I last tried your LongMappedForeignMapper about a week ago and it had
exactly the same problem.

I am also using the lifecycle callbacks to make sure that the address
is saved at the right time and if I log the address object in the
beforeSave handler I can see the values set properly and the id that
the database has given it.

Which means something doesn't work in u.address() here:

// This is called beforeSave and beforeUpdate
private def saveAddresses(u:User) : Unit = {
u.address(u.address.obj.open_!.saveMe)
Log.info(u.address.obj.open_!.toString) // This outputs what I
expect
}

I would really like to understand why my code doesn't work before I
add in any code from elsewhere.

--~--~-~--~~~---~--~~
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: managing foreign key object relationships with mapper

2009-08-18 Thread george

Full source code is here:

http://github.com/mattandgeorge/hello-lift
--~--~-~--~~~---~--~~
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: managing foreign key object relationships with mapper

2009-08-18 Thread george

The long value seems to be updated correctly. But it doesn't make it
into the database.

private def saveAddresses(u:User) : Unit = {
u.address(u.address.obj.open_!.saveMe)
Log.info(u.address.is.toString)
Log.info(u.address.obj.open_!.toString)
}

INFO - 69
INFO - formfiller.model.Address=
{line3=,id=69,line2=,line1=sadfas,country=,postcode=}

The address is created like this:

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

Full source here:  http://gist.github.com/169639

--~--~-~--~~~---~--~~
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: managing foreign key object relationships with mapper

2009-08-18 Thread george

What do you mean by is it saved?

The long value of the address field is not being saved to the address
FK field on the user row in the database. It remains NULL.

I am assuming that user.save is being called because the beforeSave
handler is triggered.
--~--~-~--~~~---~--~~
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: managing foreign key object relationships with mapper

2009-08-18 Thread george

I have managed to narrow the problem down some more.

It seems that when the User object is saved there is a check to see
whether it is clean_?

This check does not seem to include a check to see if the Address
object is also clean_?

To get around this I tried to provide an override implementation of
the dirty_? and clean_? methods on my User singleton.

override def clean_?(toCheck: User): Boolean =
Address.clean_?(toCheck.getAddress)  super.clean_?(toCheck)

override def dirty_?(toCheck: User): Boolean =
Address.dirty_?(toCheck.getAddress)  super.dirty_?(toCheck)

However, there seems to be something wrong with the way I have done
this because it is preventing the User from being saved.

When I remove both the above overrides, I get the desired
functionality, EXCEPT that when an address field is changed, that
change is not saved because the User object is still clean_?.

So the question becomes how do I let Mapper know that when the nested
address object is dirty then the user object is also dirty?

Or, put another way, how can I force an object to save when it is
clean?


--~--~-~--~~~---~--~~
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-13 Thread george

when I do mvn install scala:doc i get

[WARNING] /Users/george/Sites/git/liftweb/lift-util/src/main/scala/net/
liftweb/util/CurrencyZone.scala:32: error: AU is already defined as
package AU
[WARNING] object AU extends CurrencyZone {
[WARNING]^
[WARNING] /Users/george/Sites/git/liftweb/lift-util/src/main/scala/net/
liftweb/util/CurrencyZone.scala:39: error: US is already defined as
package US
[WARNING] object US extends CurrencyZone {
[WARNING]^
[WARNING] /Users/george/Sites/git/liftweb/lift-util/src/main/scala/net/
liftweb/util/CurrencyZone.scala:46: error: GB is already defined as
package GB
[WARNING] object GB extends CurrencyZone {
[WARNING]^
[WARNING] /Users/george/Sites/git/liftweb/lift-util/src/main/scala/net/
liftweb/util/CurrencyZone.scala:53: error: EU is already defined as
package EU
[WARNING] object EU extends CurrencyZone {
[WARNING]^
[WARNING] /Users/george/Sites/git/liftweb/lift-util/src/main/scala/net/
liftweb/util/Mailer.scala:27: error: Mailer is already defined as
package Mailer
[WARNING] object Mailer {
[WARNING]^
[WARNING] /Users/george/Sites/git/liftweb/lift-util/src/main/scala/net/
liftweb/util/RE.scala:27: error: RE is already defined as package RE
[WARNING] object RE {
[WARNING]^
[WARNING] Aug 13, 2009 9:03:31 AM
org.scala_tools.vscaladoc.HtmlRenderer render
[WARNING] INFO: write page for overview
[WARNING] Aug 13, 2009 9:03:32 AM
org.scala_tools.vscaladoc.HtmlRenderer render
[WARNING] INFO: write page for all-classes (list)
[WARNING] Aug 13, 2009 9:03:32 AM
org.scala_tools.vscaladoc.HtmlRenderer render
[WARNING] INFO: write index.html
[WARNING] Aug 13, 2009 9:03:32 AM
org.scala_tools.vscaladoc.HtmlRenderer render
[WARNING] INFO: write doc for  each classes
[WARNING] 6 errors found
[INFO]

[ERROR] BUILD ERROR
[INFO]

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


it seems to have generated the documentation. but the packages are not
combined into a one set of docs. how do we do that?


On Aug 11, 10:22 pm, Timothy Perrett timo...@getintheloop.eu wrote:
 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-12 Thread george

I add the address to the user

user.address(a)

later on the user gets saved

the address is inserted in the address table

but in the user table, the address id is NULL



On Aug 11, 11:36 pm, Naftoli Gugenheim naftoli...@gmail.com wrote:
 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 do you initialise a MappedLongForeignKey object?

2009-08-12 Thread george

ok. thanks for your help, i'll try out the various options and see
what works best for me.

On Aug 12, 1:26 pm, Naftoli Gugenheim naftoli...@gmail.com wrote:
 You have to mix it in to each foreign key field, i.e., User.address and 
 Address.user. Or only have one field, e.g., User.address, and a method on 
 Address that finds the user that references it (but it will only work once 
 they're saved).

 -

 georgegeo...@mattandgeorge.com wrote:

 I add the address to the user

 user.address(a)

 later on the user gets saved

 the address is inserted in the address table

 but in the user table, the address id is NULL

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



  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

 

[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 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: 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 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 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] radio input trouble

2009-07-30 Thread george

I am trying to follow the radio input example in the Lift book(s), but
I cannot get it to work.

Firstly, the example in the book uses this call to the SHtml.radio
function

SHtml.radio(colorMap.keys.toList, Empty, myColor = colorMap(_))

Using Lift 1.1-SNAPSHOT and Scala 2.7.5 This gives me the error:

missing parameter type for expanded function ((x$1) = colorMap(x$1))
colour - radio(colorMap.keys.toList, Empty, myColor = colorMap(_) )


So I change my code to the below:

...
var myColor : Color = _
val colorMap = Map(Red - Color.red, White - Color.white, Blue -
 Color.blue)

def renew(xhtml : NodeSeq) : NodeSeq = {
  bind(form, xhtml,
colour - radio(colorMap.keys.toList, Empty, (a:String) =
myColor = colorMap(a) )
  )
}
...

But this yields the following error:

overloaded method value - with alternatives [T :
net.liftweb.util.Bindable](T with net.liftweb.util.Bindable)
net.liftweb.util.Helpers.TheBindableBindParam[T] and (Boolean)
net.liftweb.util.Helpers.BooleanBindParam and (Long)
net.liftweb.util.Helpers.LongBindParam and (Int)
net.liftweb.util.Helpers.IntBindParam and (Symbol)
net.liftweb.util.Helpers.SymbolBindParam and (Option
[scala.xml.NodeSeq])net.liftweb.util.Helpers.OptionBindParam and
(net.liftweb.util.Box[scala.xml.NodeSeq])
net.liftweb.util.Helpers.BoxBindParam and ((scala.xml.NodeSeq) =
scala.xml.NodeSeq)net.liftweb.util.Helpers.FuncBindParam and (Seq
[scala.xml.Node])net.liftweb.util.Helpers.TheBindParam and
(scala.xml.Node)net.liftweb.util.Helpers.TheBindParam and
(scala.xml.Text)net.liftweb.util.Helpers.TheBindParam and
(scala.xml.NodeSeq)net.liftweb.util.Helpers.TheBindParam and (String)
net.liftweb.util.Helpers.TheStrBindParam cannot be applied to
(net.liftweb.http.SHtml.ChoiceHolder[String])
colour - radio(colorMap.keys.toList, Empty, 
(a:String) =
myColor = colorMap(a) )


Seems like the bind function doesn't like the ChoiceHolder[String]
param (?)

What am I doing wrong?!

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



[Lift] Re: radio input trouble

2009-07-30 Thread george

Thanks marius for pointing me in the right direction. I nearly got
there :)

Both of the following work:

SHtml.radio(colorMap.keys.toList, Empty, (a:String) = myColor =
colorMap(a) ).toForm

// Or if you want to override the XHTML output
SHtml.radio(colorMap.keys.toList, Empty, (a:String) = myColor =
colorMap(a) ).flatMap(c = (span{c.xhtml} {c.key.toString}/span))

Is there a better way to override XHTML output of the ChoiceHolder?
Could it be done once somewhere for the whole application?

On Jul 30, 9:26 pm, marius d. marius.dan...@gmail.com wrote:
 How about :

 SHtml.radio(colorMap.keys.toList, Empty, (a:String) = myColor =
 colorMap(a) ).flatMap(_.xhtml)

 I haven't tested but SHtml.radiorturns a ChoiceHolde which contains a
 Seq[ChoiceItem[T]]] ... and ChoiceItem has an xhtml member

 Br's,
 Marius

 On Jul 30, 10:49 pm, george geo...@mattandgeorge.com wrote:



  I am trying to follow theradioinputexample in the Lift book(s), but
  I cannot get it to work.

  Firstly, the example in the book uses this call to the SHtml.radio
  function

  SHtml.radio(colorMap.keys.toList, Empty, myColor = colorMap(_))

  Using Lift 1.1-SNAPSHOT and Scala 2.7.5 This gives me the error:

  missing parameter type for expanded function ((x$1) = colorMap(x$1))
  colour -radio(colorMap.keys.toList, Empty, myColor = colorMap(_) )

  So I change my code to the below:

  ...
  var myColor : Color = _
  val colorMap = Map(Red - Color.red, White - Color.white, Blue -

   Color.blue)

  def renew(xhtml : NodeSeq) : NodeSeq = {
    bind(form, xhtml,
      colour -radio(colorMap.keys.toList, Empty, (a:String) =
  myColor = colorMap(a) )
    )}

  ...

  But this yields the following error:

  overloaded method value - with alternatives [T :
  net.liftweb.util.Bindable](T with net.liftweb.util.Bindable)
  net.liftweb.util.Helpers.TheBindableBindParam[T] and (Boolean)
  net.liftweb.util.Helpers.BooleanBindParam and (Long)
  net.liftweb.util.Helpers.LongBindParam and (Int)
  net.liftweb.util.Helpers.IntBindParam and (Symbol)
  net.liftweb.util.Helpers.SymbolBindParam and (Option
  [scala.xml.NodeSeq])net.liftweb.util.Helpers.OptionBindParam and
  (net.liftweb.util.Box[scala.xml.NodeSeq])
  net.liftweb.util.Helpers.BoxBindParam and ((scala.xml.NodeSeq) =
  scala.xml.NodeSeq)net.liftweb.util.Helpers.FuncBindParam and (Seq
  [scala.xml.Node])net.liftweb.util.Helpers.TheBindParam and
  (scala.xml.Node)net.liftweb.util.Helpers.TheBindParam and
  (scala.xml.Text)net.liftweb.util.Helpers.TheBindParam and
  (scala.xml.NodeSeq)net.liftweb.util.Helpers.TheBindParam and (String)
  net.liftweb.util.Helpers.TheStrBindParam cannot be applied to
  (net.liftweb.http.SHtml.ChoiceHolder[String])
                          colour -radio(colorMap.keys.toList, Empty, 
  (a:String) =
  myColor = colorMap(a) )

  Seems like the bind function doesn't like the ChoiceHolder[String]
  param (?)

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



[Lift] Re: YA menu question: separate menus

2009-06-30 Thread george

This feature will be very useful for me also. Thanks.

However, I would like to be able to show a separate menu for the
MegaProtoUser menu items.

So it would be great if the MegaProtoUser built in menu items had some
default LocGroup set. Or if there was a way to change the LocGroup of
a Loc at runtime.

Maybe this is possible but I have missed it?

George

On Jun 30, 9:37 pm, Derek Chen-Becker dchenbec...@gmail.com wrote:
 Yes. The error you're getting looks like a version mismatch or some other
 dependency issue. Can you wipe ~/.m2 and try th build again?

 Derek



 On Tue, Jun 30, 2009 at 10:44 AM, glenn gl...@exmbly.com wrote:

  Derek,

  I was out of town all last week and just tried to rebuild and run with
  your
  new changes, but got the following error:

  ERROR - Failed to Boot
  java.lang.NoSuchMethodError: net.liftweb.sitemap.SiteMap.init(Lscala/
  Seq;)V
         at bootstrap.liftweb.Boot.boot(Boot.scala:41)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke
  (NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke
  (DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at net.liftweb.util.ClassHelpers$$anonfun$createInvoker$1.apply
  (ClassHelpers.scala:408)
         at net.liftweb.util.ClassHelpers$$anonfun$createInvoker$1.apply
  (ClassHelpers.scala:406)
         at net.liftweb.http.DefaultBootstrap$$anonfun$boot$1.apply
  (LiftRules.scala:1049)
         at net.liftweb.http.DefaultBootstrap$$anonfun$boot$1.apply
  (LiftRules.scala:1049)
         at net.liftweb.util.Full.map(Box.scala:330)
         at net.liftweb.http.DefaultBootstrap$.boot(LiftRules.scala:1049)
         at net.liftweb.http.LiftFilter.bootLift(LiftServlet.scala:561)
         at net.liftweb.http.LiftFilter.init(LiftServlet.scala:529)
         at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:
  97)
         at org.mortbay.component.AbstractLifeCycle.start
  (AbstractLifeCycle.java:50)
         at org.mortbay.jetty.servlet.ServletHandler.initialize
  (ServletHandler.java:653)
         at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
         at org.mortbay.jetty.webapp.WebAppContext.startContext
  (WebAppContext.java:1239)
         at org.mortbay.jetty.handler.ContextHandler.doStart
  (ContextHandler.java:517)
         at
  org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:
  466)
         at org.mortbay.jetty.plugin.Jetty6PluginWebAppContext.doStart
  (Jetty6PluginWebAppContext.java:124)
         at org.mortbay.component.AbstractLifeCycle.start
  (AbstractLifeCycle.java:50)
         at org.mortbay.jetty.handler.HandlerCollection.doStart
  (HandlerCollection.java:152)
         at org.mortbay.jetty.handler.ContextHandlerCollection.doStart
  (ContextHandlerCollection.java:156)
         at org.mortbay.component.AbstractLifeCycle.start
  (AbstractLifeCycle.java:50)
         at org.mortbay.jetty.handler.HandlerCollection.doStart
  (HandlerCollection.java:152)
         at org.mortbay.component.AbstractLifeCycle.start
  (AbstractLifeCycle.java:50)
         at org.mortbay.jetty.handler.HandlerWrapper.doStart
  (HandlerWrapper.java:130)
         at org.mortbay.jetty.Server.doStart(Server.java:222)
         at org.mortbay.component.AbstractLifeCycle.start
  (AbstractLifeCycle.java:50)
         at org.mortbay.jetty.plugin.Jetty6PluginServer.start
  (Jetty6PluginServer.java:132)
         at org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty
  (AbstractJettyMojo.java:441)
         at org.mortbay.jetty.plugin.AbstractJettyMojo.execute
  (AbstractJettyMojo.java:383)
         at org.mortbay.jetty.plugin.AbstractJettyRunMojo.execute
  (AbstractJettyRunMojo.java:210)
         at
  org.mortbay.jetty.plugin.Jetty6RunMojo.execute(Jetty6RunMojo.java:
  184)
         at org.apache.maven.plugin.DefaultPluginManager.executeMojo
  (DefaultPluginManager.java:579)
         at

  org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFai 
  lures
  (DefaultLifecycleExecutor.java:498)
         at

  org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmentForPr 
  oject
  (DefaultLifecycleExecutor.java:265)
         at
  org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments
  (DefaultLifecycleExecutor.java:191)
         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute
  (DefaultLifecycleExecutor.java:149)
         at org.apache.maven.DefaultMaven.execute_aroundBody0
  (DefaultMaven.java:223)
         at org.apache.maven.DefaultMaven.execute_aroundBody1$advice
  (DefaultMaven.java:304)
         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:1)
         at org.apache.maven.embedder.MavenEmbedder.execute_aroundBody2
  (MavenEmbedder.java:904)
         at
  org.apache.maven.embedder.MavenEmbedder.execute_aroundBody3$advice
  (MavenEmbedder.java:304

[Lift] Re: liftweb.net down now, and maven refuses to compile

2009-06-28 Thread george

Thanks

George

On Jun 27, 7:53 pm, David Bernard david.bernard...@gmail.com wrote:
 Hi,

 * To generate the api : all the jar should be installed  (mvn install
 scala:doc). that is very long because generating api redo compilation
 (vscaladoc and scaldoc use the scalac api)
 * To generate the api in a single doc, I used experimental feature of
 maven-scala-plugin (2.11-SNAPSHOT) and vscaladoc (1.2-SNASHOT). But the test
 case I used to check this feature failed with latest SNAPSHOT of both tool
 (a failure when scala.XML try to load DTD of HTML). I'll release
 maven-scala-plugin soon (few days) and vscaladoc when the agregate feature
 will be fixed + some other fix. I hope both will be available before
 2009-07-15.

 /davidB

 On Sat, Jun 27, 2009 at 20:16, Timothy Perrett timo...@getintheloop.euwrote:





  That im not sure - its a vscaladoc thing (which DavidB wrote)...
  perhaps he'll chime in shortly with a solution. From what I remember
  it requires some additional configuration to do this which we don't
  use by default in the lift code base proper (the online api doc is
  pushed out by our hudson install)

  Cheers, Tim

  On Jun 27, 5:29 pm, george geo...@mattandgeorge.com wrote:
   ok, well i upgraded maven to 2.1.0 and the build succeeded.

   but how can I generate the docs so they are combined into one set like
   onhttp://scala-tools.org/scaladocs/liftweb/1.0, instead of broken up
   by package ?
--~--~-~--~~~---~--~~
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: liftweb.net down now, and maven refuses to compile

2009-06-27 Thread george

Is there any way to locally generate the Lift API scaladocs without
needing scala-tools.org?

George

On Jun 27, 1:16 pm, Josh Suereth joshua.suer...@gmail.com wrote:
 Hi, I forwarded the email to ad...@scala-tools.org, but I have not received
 it back (meaning is has not been sent).   I also tried ssh'ing onto the box,
 and was unsuccessful.  That's being my powers of admin for
 scala-tools.orguntil we can get it active again.

 David Pollak and Derek Chen-Becker are the other admins (for future
 reference).

 - Josh



 On Sat, Jun 27, 2009 at 5:28 AM, marius d. marius.dan...@gmail.com wrote:

  dunno who can help .. I sent an email on scala-list but nothing yet

  On Jun 27, 12:17 pm, Timothy Perrett timo...@getintheloop.eu wrote:
   @marius Is there anyone around to checkup on scala-tools? DavidB
   doesn't monitor the lift list much these days and I'm not sure if
   there are any other non-American guys (I.e people who are awake now!)
   to take a look at the server?

   Cheers, Tim

   Sent from my iPhone

   On 27 Jun 2009, at 10:06, marius d. marius.dan...@gmail.com wrote:

try maven -o 

Marius

On Jun 27, 11:46 am, Ellis ellis.whiteh...@gmail.com wrote:
Maven is suddenly refusing to compile because scala-tools.org is
down.  Can the liftweb-snapshot-1.1 POM be changed in order to let
maven work in offline mode?

Here's an excerpt of the error message when trying to run in offline
mode:
$ mvn -o -npu compile
[INFO]
NOTE: Maven is executing in offline mode. Any artifacts not already
in
your local
repository will be
inaccessible.
...
[ERROR] BUILD
ERROR
[INFO]
---
-
[INFO] Failed to resolve
artifact.
...
Missing:
--
1) net.liftweb:lift-util:jar:1.1-SNAPSHOT
...

The files DO appear to be in my local repository, last updated via
maven yesterday at 15:20 GMT:
$ ls -1 /home/ellis/.m2/repository/net/liftweb/lift-util/1.1-
SNAPSHOT/
lift-util-1.1-SNAPSHOT.jar
lift-util-1.1-SNAPSHOT.jar.sha1
lift-util-1.1-SNAPSHOT-javadoc.jar.lastUpdated
lift-util-1.1-SNAPSHOT.pom
lift-util-1.1-SNAPSHOT.pom.sha1
lift-util-1.1-SNAPSHOT-sources.jar
lift-util-1.1-SNAPSHOT-sources.jar.sha1
maven-metadata-scala-tools.org.snapshots.xml
maven-metadata-scala-tools.org.snapshots.xml.sha1
maven-metadata-scala-tools.org.xml
resolver-status.properties

Any ideas how to force maven to use the files that it was content to
use yesterday?

Thanks,
Ellis
--~--~-~--~~~---~--~~
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: liftweb.net down now, and maven refuses to compile

2009-06-27 Thread george

Thanks Tim

It seems that scala-tools.org is back up now, but even so I get this
error:

$ mvn scala:doc -e
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] Reactor build order:
[INFO]   Lift
[INFO]   Lift Utils
[INFO]   Lift Actor
[INFO]   Lift WebKit
[INFO]   Lift OSGi
[INFO]   Lift Widgets
[INFO]   Lift Mapper
[INFO]   Lift Machine
[INFO]   Lift Record
[INFO]   Lift Textile
[INFO]   Lift Facebook
[INFO]   Lift AMQP
[INFO]   Lift XMPP
[INFO]   Lift OpenID
[INFO]   Lift OAuth
[INFO]   Lift PayPal
[INFO]   Lift TestKit
[INFO]   Lift Core (full lift)
[INFO]   Lift JPA
[INFO]   Lift Sites
[INFO]   Lift Example
[INFO]   OSGi Examples for Lift - Hello
[INFO]   OSGi Examples for Lift
[INFO]   Skittr Example
[INFO]   HelloLift example application
[INFO]   HelloDarwin tutorial application
[INFO]   JPA Demo Master
[INFO]   JPADemo-spa
[INFO]   JPADemo-web
[INFO]   HTTP Authentication example
[INFO]   lift-archetype-blank
[INFO]   lift-archetype-basic
[INFO]   lift-archetype-jpa-basic
[INFO]   lift-archetype-jpa-blank
[INFO]   lift-archetype-jpa-blank-single
[INFO] Searching repository for plugin with prefix: 'scala'.
WAGON_VERSION: 1.0-beta-2
[INFO]

[INFO] Building Lift
[INFO]task-segment: [scala:doc]
[INFO]

[INFO] [scala:doc]
[INFO] Checking for multiple versions of scala
[WARNING] No source files found in /Users/george/Sites/git/liftweb/src/
main/scala
[INFO]

[INFO] Building Lift Utils
[INFO]task-segment: [scala:doc]
[INFO]

[INFO] [scala:doc]
[INFO] Checking for multiple versions of scala
[INFO] Checking for multiple versions of scala
[INFO] delete :/Users/george/Sites/git/liftweb/lift-util/target/site/
scaladocs/scaladocs
[WARNING] warning: there were unchecked warnings; re-run with -
unchecked for details
[INFO] failed to find baseUri for org.slf4j.Logger :: org.slf4j
[INFO] failed to find baseUri for org.slf4j.Logger :: org.slf4j
[INFO] failed to find baseUri for org.apache.log4j.Logger ::
org.apache.log4j
[INFO] failed to find baseUri for org.apache.log4j.Logger ::
org.apache.log4j
[INFO] failed to find baseUri for org.apache.log4j.Level ::
org.apache.log4j
[INFO] failed to find baseUri for org.apache.log4j.Priority ::
org.apache.log4j
[WARNING] one warning found
[INFO]

[INFO] Building Lift Actor
[INFO]task-segment: [scala:doc]
[INFO]

[INFO] [scala:doc]
[INFO] Checking for multiple versions of scala
[INFO] Checking for multiple versions of scala
[INFO] delete :/Users/george/Sites/git/liftweb/lift-actor/target/site/
scaladocs/scaladocs
[WARNING] /Users/george/Sites/git/liftweb/lift-actor/src/main/scala/
net/liftweb/actor/LAFuture.scala:20: error: not found: value Helpers
[WARNING] import Helpers._
[WARNING]^
[WARNING] /Users/george/Sites/git/liftweb/lift-actor/src/main/scala/
net/liftweb/actor/LAPinger.scala:18: error: not found: value Helpers
[WARNING] import Helpers.TimeSpan
[WARNING]^
[WARNING] /Users/george/Sites/git/liftweb/lift-actor/src/main/scala/
net/liftweb/actor/LiftActor.scala:20: error: not found: value Helpers
[WARNING] import Helpers._
[WARNING]^
[WARNING] /Users/george/Sites/git/liftweb/lift-actor/src/main/scala/
net/liftweb/actor/LiftActor.scala:179: error: missing parameter type
for expanded function ((x0$1) = x0$1 match {
[WARNING]   case (e @ _) = Log.error(Error processing Actor .$plus
(this), e)
[WARNING] })
[WARNING]   protected def exceptionHandler: PartialFunction[Throwable,
Unit] = {
[WARNING]
^
[WARNING] four errors found
[INFO]

[ERROR] BUILD ERROR
[INFO]

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

[INFO]

[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: wrap:
org.apache.maven.reporting.MavenReportException: wrap: command line
returned non-zero value:1
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals
(DefaultLifecycleExecutor.java:584)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal
(DefaultLifecycleExecutor.java:513)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal
(DefaultLifecycleExecutor.java:483)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures
(DefaultLifecycleExecutor.java:331

[Lift] Re: liftweb.net down now, and maven refuses to compile

2009-06-27 Thread george

ok, well i upgraded maven to 2.1.0 and the build succeeded.

but how can I generate the docs so they are combined into one set like
on http://scala-tools.org/scaladocs/liftweb/1.0, instead of broken up
by package ?

On Jun 27, 2:31 pm, Timothy Perrett timo...@getintheloop.eu wrote:
 But of course! Clone the lift source repo onto your local machine then do
 the following:

 cd the place you cloned lift
 mvn scala:doc

 Cheers, Tim

 On 27/06/2009 14:07, george geo...@mattandgeorge.com wrote:





  Is there any way to locally generate the Lift API scaladocs without
  needing scala-tools.org?

  George

  On Jun 27, 1:16 pm, Josh Suereth joshua.suer...@gmail.com wrote:
  Hi, I forwarded the email to ad...@scala-tools.org, but I have not received
  it back (meaning is has not been sent).   I also tried ssh'ing onto the 
  box,
  and was unsuccessful.  That's being my powers of admin for
  scala-tools.orguntil we can get it active again.

  David Pollak and Derek Chen-Becker are the other admins (for future
  reference).

  - Josh

  On Sat, Jun 27, 2009 at 5:28 AM, marius d. marius.dan...@gmail.com wrote:

  dunno who can help .. I sent an email on scala-list but nothing yet

  On Jun 27, 12:17 pm, Timothy Perrett timo...@getintheloop.eu wrote:
  @marius Is there anyone around to checkup on scala-tools? DavidB
  doesn't monitor the lift list much these days and I'm not sure if
  there are any other non-American guys (I.e people who are awake now!)
  to take a look at the server?

  Cheers, Tim

  Sent from my iPhone

  On 27 Jun 2009, at 10:06, marius d. marius.dan...@gmail.com wrote:

  try maven -o 

  Marius

  On Jun 27, 11:46 am, Ellis ellis.whiteh...@gmail.com wrote:
  Maven is suddenly refusing to compile because scala-tools.org is
  down.  Can the liftweb-snapshot-1.1 POM be changed in order to let
  maven work in offline mode?

  Here's an excerpt of the error message when trying to run in offline
  mode:
  $ mvn -o -npu compile
  [INFO]
  NOTE: Maven is executing in offline mode. Any artifacts not already
  in
  your local
  repository will be
  inaccessible.
  ...
  [ERROR] BUILD
  ERROR
  [INFO]
  ---
  -
  [INFO] Failed to resolve
  artifact.
  ...
  Missing:
  --
  1) net.liftweb:lift-util:jar:1.1-SNAPSHOT
  ...

  The files DO appear to be in my local repository, last updated via
  maven yesterday at 15:20 GMT:
  $ ls -1 /home/ellis/.m2/repository/net/liftweb/lift-util/1.1-
  SNAPSHOT/
  lift-util-1.1-SNAPSHOT.jar
  lift-util-1.1-SNAPSHOT.jar.sha1
  lift-util-1.1-SNAPSHOT-javadoc.jar.lastUpdated
  lift-util-1.1-SNAPSHOT.pom
  lift-util-1.1-SNAPSHOT.pom.sha1
  lift-util-1.1-SNAPSHOT-sources.jar
  lift-util-1.1-SNAPSHOT-sources.jar.sha1
  maven-metadata-scala-tools.org.snapshots.xml
  maven-metadata-scala-tools.org.snapshots.xml.sha1
  maven-metadata-scala-tools.org.xml
  resolver-status.properties

  Any ideas how to force maven to use the files that it was content to
  use yesterday?

  Thanks,
  Ellis
--~--~-~--~~~---~--~~
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: Cheap Hosting

2009-06-26 Thread george

we have recently been trying out

http://en.gandi.net/hosting

and it seems pretty good. there is also an offer on at the moment for
free hosting until end August...

George

On Jun 24, 4:35 pm, anothertestapp test anothertest...@gmail.com
wrote:
 I have account withhttp://javaprovider.netthey offer good service
 for java hosting

 Thanks
 Warren

 On Jun 16, 7:00 am, Harshad RJ harshad...@gmail.com wrote:



  Mark,

  Try VPSLink.

 http://vpslink.com/?ref=7J32ZZ

  The cheapest plan is about 6.6$ p/mo and you will get a discount of 10% if
  you use the above link (referral program).

  I have successfully run scala based servlets + postgresql db on it, with
  performance sufficient for my needs.

  I haven't tried Lift on it though.

  cheers,
  --
  Harshad RJ
  WebHome   »  http://hrj.wikidot.com
  Classifieds  »  http://uproot.in

--~--~-~--~~~---~--~~
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 serve html fragments

2009-05-21 Thread george

Thanks guys for following up on this.

It's a great help here too.

George

On May 21, 5:42 am, David Pollak feeder.of.the.be...@gmail.com
wrote:
 On Wed, May 20, 2009 at 8:38 PM, fatu fab...@gmail.com wrote:

  Hi David,

  yes it will do, thank you so much for such a lightning-fast
  development in reply!

  I'm only thinking about a case that is probably much more of an
  exception than a rule, i.e. when the snippet dynamically decides if it
  needs to generate a full page or a fragment (which is not a very good
  design anyway IMHO), for example based on some info passed. But even
  in that case the snippet will know that and will be able to set
  S.skipDocType = true accordingly, so it should be perfectly fine. Plus
  it won't be difficult at all to make the processing diverge in the 2
  cases by using URL rewrites, redirecting it to a different template /
  snippet depending on parameters or URL structure, which is probably a
  better design too.

 You could also pass a header flag from your AJAX call.  If the header's set,
 you don't do the boilerplate surround that'll include all the html, head
 and body tags.

 Anyway, enjoy and thanks for the use case.

 Party on.







  Again many thanks everyone and David especially!

  On May 20, 4:05 pm, David Pollak feeder.of.the.be...@gmail.com
  wrote:
   I'm about to commit S.skipDocType = true | false.  If you set it to true,
   the !DOCTYPE .../ will be omitted from the response page.  This will
  allow
   your AJAX fragements to pull parts of pages from the server.  Note that
   someplace in your snippets, you'll have to set S.skipDocType = true.

   Does this address your issue?

   On Wed, May 20, 2009 at 5:13 AM, fatu fab...@gmail.com wrote:

Hi Marius,

as I understand them, Jx classes help in generating JS that can itself
generate DOM at the client.  Am I wrong? I'd really like to serve back
an HTML fragment built by using the normal Lift template pipeline (so
including surround  bind). Is that possible?

Thanks

On 20 Mag, 13:16, marius d. marius.dan...@gmail.com wrote:
 As I understood you want to make an Ajax request and serve back a
 Document Fragment. If so please also take a look at Jx stuff. We
 discuss Jx classes in a fairly amount of details in the lift book.

 Br's,
 Marius

 On May 20, 9:32 am, fatu fab...@gmail.com wrote:

  Timothy,

  thanks for the links, I found them useful and I find your blog in
  general very interesting. Came across scala-blogs.org and it looks
  quite promising as well.

  I knew bind already from the Exploring Lift book which I pull
  from
  git, build with Lyx and keep at hand regularly. In the doctype
  post,
  though, I couldn't find a way to specify no doctype  which I
  think
  is necessary to serve a fragment; plus I couldn't find any other
  easy
  out-of-the-box way to do it. Shouldn't this use case (serving
  fragments), which I think is quite common, be better / more easily
  supported by the framework? Can someone post an example of how to
  do
  it with raw response handling in the meanwhile?

  Thanks anybody.

  Fabio

  On 26 Apr, 21:49, Timothy Perrett timo...@getintheloop.eu wrote:

   George,

   To tell lift what doctype you want to use see my blog post here:
   http://is.gd/uJ4L

   Also, you'll want to read another one of my posts in which I
  discuss
   the bind(...) method and how you can stop putting markup into
  your
   snippets:http://is.gd/sfyT

   Cheers, Tim

   On Apr 26, 1:02 pm, george geo...@mattandgeorge.com wrote:

hello all,

hopefully someone can help me out here.

i am trying to port some simple ajax stuff over to lift from a
rails
app. basically it just loads anhtmlfragmentand puts it into the
  dom
using prototype.

i have set up a template which contains thefragmentat src/main/
webapp/fragment.html

ulliitem/li/ul

then i made the page available using the SiteMap and all seems
good,
but here comes the problem

the lift response adds the xml declaration and doctype, one of
which
seems to cause prototype some problems

?xml version=1.0 encoding=UTF-8?
!DOCTYPEhtmlPUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN 
   http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
ulliitem/li/ul

so the question is, how can i make lift send back the
rawhtmlwithout
meddling with it?

i have tried out using ResourceServer to serve it statically
  which
works, but this wouldn't allow me to generate thefragment
dynamically.

i would also prefer to have a separatehtmltemplate file rather
  than
embedding the markup code in a snippet.

any thoughts gratefully received..

george

   --
   Lift, the simply functional web frameworkhttp

[Lift] how to serve html fragments

2009-04-26 Thread george

hello all,

hopefully someone can help me out here.

i am trying to port some simple ajax stuff over to lift from a rails
app. basically it just loads an html fragment and puts it into the dom
using prototype.

i have set up a template which contains the fragment at src/main/
webapp/fragment.html

ulliitem/li/ul

then i made the page available using the SiteMap and all seems good,
but here comes the problem

the lift response adds the xml declaration and doctype, one of which
seems to cause prototype some problems

?xml version=1.0 encoding=UTF-8?
!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
ulliitem/li/ul

so the question is, how can i make lift send back the raw html without
meddling with it?

i have tried out using ResourceServer to serve it statically which
works, but this wouldn't allow me to generate the fragment
dynamically.

i would also prefer to have a separate html template file rather than
embedding the markup code in a snippet.

any thoughts gratefully received..

george

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