esme-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ethan Jewett <esjew...@gmail.com>
Subject Re: new API2 calls for 1.3
Date Tue, 07 Jun 2011 06:15:11 GMT
Hi Dick,

It looks like it is problems with Boxed vs. un-Boxed values. The error
you are currently seeing is because tagId is a Box[String] but By()
expects a String in that position. So you need to un-Box it. I'd
recommend changing

def followTag(tagId: Box[String]): LiftResponse = {
  val ret: Box[Tuple3[Int,Map[String,String],Box[Elem]]] =
    for (user <- User.currentUser)
    yield {
      val tag = Tag.findAll(By(Tag.name, tagId)).headOption

to

def followTag(tagId: Box[String]): LiftResponse = {
  val ret: Box[Tuple3[Int,Map[String,String],Box[Elem]]] =
    for (user <- User.currentUser)
    yield {
      val tag = Tag.findAll(By(Tag.name, tagId.openOr(""))).headOption

Calling the openOr() method on a Box will return the value inside the
Box (a String in this case), or if the Box is Empty it will return the
parameter passed to the method ("" in this case). Hopefully searching
for a blank string will not return any results, but please check for
that!

Once you make this change, you'll get a bunch more errors that we can
work through. Most of them are similar, revolving around Box or Option
and incorrect type signatures for functions. Let's work through these
one-by-one? I should be able to respond more quickly today.

Cheers,
Ethan

On Mon, Jun 6, 2011 at 11:15 AM, Ethan Jewett <esjewett@gmail.com> wrote:
> Hi Dick,
>
> Great! I'll definitely take a look tonight.
>
> Cheers,
> Ethan
>
> On Mon, Jun 6, 2011 at 11:07 AM, Richard Hirsch <hirsch.dick@gmail.com> wrote:
>> Checked my first steps for follow/unfollow for tag/conversations.
>>
>> Conversations looks fine (I haven't tested it yet) but there is a
>> compile problem for the tags-related code.
>>
>> @Ethan - can you take a quick look at it and see what I did wrong...
>>
>> D.
>>
>

Mime
View raw message