[Lift] CRUDify Customized Access Control Issues

2010-02-09 Thread Robert Thurnher
Dear list,

I'm pretty new to Lift (went thru the getting started tutorial,
checked out the book plus its sample app, dived into Lift's source a
little and am by now tinkering w/ coding up some rather simple first
apps for further learning etc.).
So, first of all, I'd like to thank you for this great framework;
really like it so far.

Currently, I'm having some issues w/ getting customized page access
control of CRUDified models to work properly. Unfortunately, I wasn't
able to figure them out solely by reading documentation, code and
previous list threads.
I'm using lift-core 1.0.2 and here's a respective code snippet (from a
model mixing in LongCRUDify trait):

val loggedIn = If(() = User.loggedIn_?, () =
RedirectResponse(/user_mgt/login))

override def createMenuLoc: Box[Menu] =
  Full(Menu(Loc(Create +Prefix, createPath, createMenuName,
locSnippets,
loggedIn, Loc.Template(createTemplate

Now, the compiler complains about a type mismatch at createPath
(List[java.lang.String] instead of
net.liftweb.sitemap.Loc.Link[net.liftweb.sitemap.NullLocParams]).

Probably a solution is obvious, sorry to bother you w/ this in
advance. :)

Thanks,
 Robert

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



Re: [Lift] CRUDify Customized Access Control Issues

2010-02-09 Thread Jeppe Nejsum Madsen
Robert Thurnher r.thurn...@gmail.com writes:

 Dear list,

 I'm pretty new to Lift (went thru the getting started tutorial,
 checked out the book plus its sample app, dived into Lift's source a
 little and am by now tinkering w/ coding up some rather simple first
 apps for further learning etc.).
 So, first of all, I'd like to thank you for this great framework;
 really like it so far.

 Currently, I'm having some issues w/ getting customized page access
 control of CRUDified models to work properly. Unfortunately, I wasn't
 able to figure them out solely by reading documentation, code and
 previous list threads.
 I'm using lift-core 1.0.2 

I suggest you upgrade to 2.0-SNAPSHOT (or M1}, much improved :-)

 and here's a respective code snippet (from a model mixing in
 LongCRUDify trait):

 val loggedIn = If(() = User.loggedIn_?, () =
 RedirectResponse(/user_mgt/login))

 override def createMenuLoc: Box[Menu] =
   Full(Menu(Loc(Create +Prefix, createPath, createMenuName,
 locSnippets,
 loggedIn, Loc.Template(createTemplate

 Now, the compiler complains about a type mismatch at createPath
 (List[java.lang.String] instead of
 net.liftweb.sitemap.Loc.Link[net.liftweb.sitemap.NullLocParams]).

 Probably a solution is obvious, sorry to bother you w/ this in
 advance. :)

Try to add 

import net.liftweb.sitemap.Loc._

to get the implicits in Loc.

/Jeppe

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



Re: [Lift] CRUDify Customized Access Control Issues

2010-02-09 Thread Jeppe Nejsum Madsen
On Tue, Feb 9, 2010 at 2:51 PM, Robert Thurnher r.thurn...@gmail.com wrote:
 On 9 February 2010 13:46, Jeppe Nejsum Madsen je...@ingolfs.dk wrote:
 Robert Thurnher r.thurn...@gmail.com writes:


 [...]

 Currently, I'm having some issues w/ getting customized page access
 control of CRUDified models to work properly. Unfortunately, I wasn't
 able to figure them out solely by reading documentation, code and
 previous list threads.
 I'm using lift-core 1.0.2

 I suggest you upgrade to 2.0-SNAPSHOT (or M1}, much improved :-)

 Am definitely going to give that a spin (wanted to get a better feel
 of Lift in general before it).
 BTW, how safe is it to use M* resp. SNAPSHOT releases?

The milestones are fairly safe. I can only recall one that didn't work
as expected. Snapshots are mostly fine, with an occasional breakage.

We're running SNAPSHOT on our production site and I can only recall a
few situations where deployment failed, and none where functionality
was compromised

/Jeppe

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



Re: [Lift] CRUDify Customized Access Control Issues

2010-02-09 Thread Robert Thurnher
On 9 February 2010 16:04, Jeppe Nejsum Madsen je...@ingolfs.dk wrote:

 [...]

 I suggest you upgrade to 2.0-SNAPSHOT (or M1}, much improved :-)

 Am definitely going to give that a spin (wanted to get a better feel
 of Lift in general before it).
 BTW, how safe is it to use M* resp. SNAPSHOT releases?

 The milestones are fairly safe. I can only recall one that didn't work
 as expected. Snapshots are mostly fine, with an occasional breakage.

 We're running SNAPSHOT on our production site and I can only recall a
 few situations where deployment failed, and none where functionality
 was compromised

Thanks for info, good to know.
Going to upgrade to 2.0-M1 (or at least the latest 1.1 one) ASAP.

-- Robert

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



Re: [Lift] CRUDify Customized Access Control Issues

2010-02-09 Thread Jeppe Nejsum Madsen
Robert Thurnher r.thurn...@gmail.com writes:

 On 9 February 2010 16:04, Jeppe Nejsum Madsen je...@ingolfs.dk wrote:

 [...]

 I suggest you upgrade to 2.0-SNAPSHOT (or M1}, much improved :-)

 Am definitely going to give that a spin (wanted to get a better feel
 of Lift in general before it).
 BTW, how safe is it to use M* resp. SNAPSHOT releases?

 The milestones are fairly safe. I can only recall one that didn't work
 as expected. Snapshots are mostly fine, with an occasional breakage.

 We're running SNAPSHOT on our production site and I can only recall a
 few situations where deployment failed, and none where functionality
 was compromised

 Thanks for info, good to know.
 Going to upgrade to 2.0-M1 (or at least the latest 1.1 one) ASAP.

Don't use the 1.1 ones, there was a naming change 1.1 - 2.0, so 2.0-M1
is considered the best non 1.0.x release...(I'll even say the best
release :-)

/Jeppe

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



Re: [Lift] CRUDify Customized Access Control Issues

2010-02-09 Thread Robert Thurnher
On 9 February 2010 20:11, Jeppe Nejsum Madsen je...@ingolfs.dk wrote:
 Robert Thurnher r.thurn...@gmail.com writes:

 On 9 February 2010 16:04, Jeppe Nejsum Madsen je...@ingolfs.dk wrote:

 [...]

 I suggest you upgrade to 2.0-SNAPSHOT (or M1}, much improved :-)

 Am definitely going to give that a spin (wanted to get a better feel
 of Lift in general before it).
 BTW, how safe is it to use M* resp. SNAPSHOT releases?

 The milestones are fairly safe. I can only recall one that didn't work
 as expected. Snapshots are mostly fine, with an occasional breakage.

 We're running SNAPSHOT on our production site and I can only recall a
 few situations where deployment failed, and none where functionality
 was compromised

 Thanks for info, good to know.
 Going to upgrade to 2.0-M1 (or at least the latest 1.1 one) ASAP.

 Don't use the 1.1 ones, there was a naming change 1.1 - 2.0, so 2.0-M1
 is considered the best non 1.0.x release...(I'll even say the best
 release :-)

Alright, thanks for all that useful info for a Lift newbie. :)

-- Robert

-- 
http://soup.robert42.com/

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



Re: [Lift] CRUDify Date picker

2010-02-01 Thread Jeppe Nejsum Madsen
The Trav the.t...@gmail.com writes:

 Hi All,

 I've been chasing this one for a while and found a few posts dancing
 around the edge, but so far I haven't seen any solid answer on it.

 Most MappedTypeField's have auto generated form fields, including
 Select elements if you override the correct method.

 I was hoping MappedDateTime would have an auto generated field that
 included a JQuery DatePicker, given that if it's a required field, you
 need it to do your crud editing.


 Is there anything at all like that in the framework? Or do I have to
 figure out how to implement it myself?

You can use this as a starting point:

class FancyMappedDate[T:Mapper[T]](fieldOwner: T) extends 
MappedDate[T](fieldOwner) {
  
  override def fieldId = Some(Text(name))
  override def setFromAny(f : Any): Date = f match {
case v :: vs =  
tryo({java.text.DateFormat.getDateInstance(java.text.DateFormat.MEDIUM, 
S.locale).parse(v.toString)}).map(d = this.set(d)).openOr(this.is)
case d:Date = this.set(d)
case _ = super.setFromAny(f)
  }

  override def _toForm: Box[NodeSeq] = {
  val onLoad =jQuery(function($){
$.datepicker.setDefaults($.datepicker.regional.da)
$('#+name+').datepicker({showOn: 'both', buttonImage: 
'/images/calendar.gif', buttonImageOnly: true});
});

  S.fmapFunc({s: List[String] = this.setFromAny(s)}){funcName =
  Full(xml:group
 head
script type=text/javascript 
src=/scripts/jquery/jquery-ui-1.7.2.custom.min.js/script
script src=/scripts/jquery/i18n/jquery-ui-i18n.js 
type=text/javascript/script
link type=text/css 
href=/css/south-street/jquery-ui-1.7.2.custom.css rel=stylesheet /
script type=text/javascript charset=utf-8{onLoad}/script
   /head
 input type='text' id={fieldId}
  name={funcName}
  class=date-pick dp-applied
  value={is match {case null =  case d = 
+java.text.DateFormat.getDateInstance(java.text.DateFormat.MEDIUM, 
S.locale).format(d)}}/
/xml:group)
  }
  }
}

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



[Lift] CRUDify Date picker

2010-01-31 Thread The Trav
Hi All,

I've been chasing this one for a while and found a few posts dancing
around the edge, but so far I haven't seen any solid answer on it.

Most MappedTypeField's have auto generated form fields, including
Select elements if you override the correct method.

I was hoping MappedDateTime would have an auto generated field that
included a JQuery DatePicker, given that if it's a required field, you
need it to do your crud editing.


Is there anything at all like that in the framework? Or do I have to
figure out how to implement it myself?

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



[Lift] CRUDify Menus as sub menus

2010-01-31 Thread The Trav
Ok, this one is a bit of a beginner question, but here goes anyway.

I've got a bunch of auto generated menus as part of my top level menu
(about 2 per model element) and it's starting to look pretty
cluttered.

What I want to do, is have a crud menu, then a sub element for every
model object, and then have the two CRUDify options as sub elements of
that crud menu.

The docs that I found (getting started and lift book) only describe
creating sub menus when working with individual items.  Is there a way
of doing it when working with Lists of menus?

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



Re: [Lift] CRUDify Menus as sub menus

2010-01-31 Thread Naftoli Gugenheim
I'm not sure what you're asking.
You want a List and Create submenu under each model without duplicate code?

-
The Travthe.t...@gmail.com wrote:

Ok, this one is a bit of a beginner question, but here goes anyway.

I've got a bunch of auto generated menus as part of my top level menu
(about 2 per model element) and it's starting to look pretty
cluttered.

What I want to do, is have a crud menu, then a sub element for every
model object, and then have the two CRUDify options as sub elements of
that crud menu.

The docs that I found (getting started and lift book) only describe
creating sub menus when working with individual items.  Is there a way
of doing it when working with Lists of menus?

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

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



[Lift] CRUDify view pages not working correctly

2009-11-02 Thread Jim McBeath

I have recently started using Lift (1.1-M6) to create a simple data
editing application.  I have a small table with a char(1) key column
(on which I set dbDisplay_? to true) and a name column for which I
created mapper code following the sample in the Exploring Lift book.
When my app displays the View page, the key column shows a value but
the name column is blank for all records.  The key field values are
not in sorted order, and when I click on a View link it displays a
page with a key value that is different from the key in the link. Each
time I click the link I get a different result. Some of the links
refer to keys that don't exist, and when I click on one of those I get
a message that the page is not in the SiteMap and is thus blocked.
Some links appear multiple times on different rows.

I am trying to figure out how I go about debugging this behavior.  I
have called DB.addLogFunc so that I can see what SQL has been
executed.  The query for the list of records includes an ORDER BY
clause and what I can see looks good.  When I execute that query in my
DB browser I get the expected results, properly sorted. Are there any
other debugging hooks I can set?  Is there a simple way I can get it
to print out the values it is pulling from the database? Any other
suggestions?

--
Jim

--~--~-~--~~~---~--~~
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] CRUDify trait in 1.1-SNAPSHOT

2009-09-10 Thread XiaomingZheng

when i knew the 1.1 M5 has been published, i updated the pom.xml of my
liftapp project and recomplie it. And i got an error about CRUDify:
self-type com.thesamegoal.simpleforum.model.Forum does not conform to
net.liftweb.mapper.CRUDify
[Long,com.thesamegoal.simpleforum.model.Forum]'s selftype
net.liftweb.mapper.CRUDify
[Long,com.thesamegoal.simpleforum.model.Forum] with
com.thesamegoal.simpleforum.model.Forum with
net.liftweb.mapper.KeyedMetaMapper
[Long,com.thesamegoal.simpleforum.model.Forum]

my Forum class was defined like this:
package com.thesamegoal.simpleforum.model
class Forum extends LongKeyedMapper[Forum] with IdPK with CRUDify
[Long, Forum] {
...
}

so i check the lift framework framework, in 1.0 version, CRUDify is
defined like this:
trait CRUDify[KeyType, CrudType : KeyedMapper[KeyType, CrudType]]
extends KeyedMetaMapper[KeyType, CrudType] {
  self: CrudType =
...
}
and 1.1 CRUDify is like this:
trait CRUDify[KeyType, CrudType : KeyedMapper[KeyType, CrudType]] {
  self: CrudType with KeyedMetaMapper[KeyType, CrudType] =
...
}

this change forced me to modify my Forum class to this:
class Forum extends LongKeyedMapper[Forum] with IdPK with
LongKeyedMetaMapper[forum] with CRUDify[Long, Forum]
and got the compile process succeed.

but why lift version 1.1 make this change? i feel that old fashion
defining model class with CRUDify trait is more comfortable and
reasonable, it's simple and intuitive
--~--~-~--~~~---~--~~
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] CRUDify trait in 1.1-SNAPSHOT

2009-09-10 Thread XiaomingZheng

when i knew the 1.1 M5 has been published, i updated the pom.xml of my
liftapp project and recomplie it. And i got an error about CRUDify:
self-type com.thesamegoal.simpleforum.model.Forum does not conform to
net.liftweb.mapper.CRUDify
[Long,com.thesamegoal.simpleforum.model.Forum]'s selftype
net.liftweb.mapper.CRUDify
[Long,com.thesamegoal.simpleforum.model.Forum] with
com.thesamegoal.simpleforum.model.Forum with
net.liftweb.mapper.KeyedMetaMapper
[Long,com.thesamegoal.simpleforum.model.Forum]

my Forum class was defined like this:
package com.thesamegoal.simpleforum.model
class Forum extends LongKeyedMapper[Forum] with IdPK with CRUDify
[Long, Forum] {
...
}

so i check the lift framework framework, in 1.0 version, CRUDify is
defined like this:
trait CRUDify[KeyType, CrudType : KeyedMapper[KeyType, CrudType]]
extends KeyedMetaMapper[KeyType, CrudType] {
  self: CrudType =
...
}
and 1.1 CRUDify is like this:
trait CRUDify[KeyType, CrudType : KeyedMapper[KeyType, CrudType]] {
  self: CrudType with KeyedMetaMapper[KeyType, CrudType] =
...
}

this change forced me to modify my Forum class to this:
class Forum extends LongKeyedMapper[Forum] with IdPK with
LongKeyedMetaMapper[forum] with CRUDify[Long, Forum]
and got the compile process succeed.

but why lift version 1.1 make this change? i feel that old fashion
defining model class with CRUDify trait is more comfortable and
reasonable, it's simple and intuitive
--~--~-~--~~~---~--~~
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] CRUDify

2009-09-01 Thread Randinn

Here are a couple of good posts on seting up CRUDify, I thought
initiates like myself might benefit.

http://neuralmonkey.blogspot.com/search/label/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] CRUDify and hidden fields?

2009-04-21 Thread Franz Bettag

Hey there,

is there any way to hide fields (createdOn/createdBy...) from CRUDify?

I was digging through the code since google didn't turn up anything
useful for this topic, but i didn't find anything (may be the lack of
my scala skill).

best regards

-franz

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