You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@rave.apache.org by Jasha Joachimsthal <ja...@apache.org> on 2012/07/02 10:06:25 UTC

Re: patch for missing JpaPersonProperties in JpaPerson (with link to patch)

Thanks for diving into that code. The next days I won't have time to work
on it, so please be patient if the other committers don't pick it up
immediately (we have some other issues in the 0.13 release to solve).

On 29 June 2012 17:17, Roel van Dijk <ro...@finalist.com> wrote:

> This is because of this line in PersonHandler:
>
>     Set<String> fields = request.getFields(Person.Field.DEFAULT_FIELDS);
> The DEFAULT_FIELDS (id, name, thumbnail) are passed by default, if no
> fields are requested explicitly. So when you do ?fields=tags, you only get
> the tags, but other collections are defaulted to an empty ArrayList. The
> non-collection fields are set to null, and ignored during JSON
> serialization. The empty collection show up as "[]".
>
> Also compare the implementations of getActivities and getAccounts in
> FieldRestrictingPerson, the latter makes more sense: the field is set to
> null if the accounts are not required to be displayed.
>
> Roel
>
>
>
> On Fri, Jun 29, 2012 at 3:46 PM, Jasha Joachimsthal <jasha@apache.org
> >wrote:
>
> > When I apply the patch and check it in the running instance, the only
> > difference I see is with ?fields=tags I don't see the name field. When I
> do
> > ?fields=name,tags it does return the name field, so it looks like it's
> > filtering something. I do see all kind of other fields like cars, heroes
> > etc.
> >
> >
> >
> > On 29 June 2012 15:25, Jasha Joachimsthal <ja...@jasha.eu> wrote:
> >
> > > Everyone can create a Jira account and then create a new issue. If
> you're
> > > planning to create more patches we can give you more rights in Jira
> (like
> > > assigning issues to you).
> > > The issue is https://issues.apache.org/jira/browse/RAVE-703 and I'm
> > > testing it right now :)
> > >
> > >
> > > On 29 June 2012 14:44, Roel van Dijk <ro...@finalist.com> wrote:
> > >
> > >> I thought I couldn't create a new issue on JIRA.. Next time I'll try
> > >> harder.
> > >>
> > >> And yes, you can apply it. I hope it will make 0.13!
> > >>
> > >> Roel
> > >>
> > >>
> > >> On Fri, Jun 29, 2012 at 1:59 PM, Jasha Joachimsthal <jasha@apache.org
> > >> >wrote:
> > >>
> > >> > Thanks for the patch. Next time you can upload it to
> > >> > https://reviews.apache.org/ or attach it to a (new) issue in
> > >> > https://issues.apache.org/jira/browse/RAVE
> > >> >
> > >> > I assume you grant permission to apply the patch into the Apache
> Rave
> > >> > codebase.
> > >> >
> > >> > On 29 June 2012 13:25, Roel van Dijk <ro...@finalist.com> wrote:
> > >> >
> > >> > > The attachment didn't come through, here is a link to the patch:
> > >> > >
> > >> > >
> > >> > >
> > >> >
> > >>
> >
> https://dl.dropbox.com/u/21051489/work/fetch_eager_person_properties_fix.patch
> > >> > >
> > >> > > --
> > >> > > Kind regards,
> > >> > >
> > >> > > Roel van Dijk
> > >> > > Software Engineer
> > >> > >
> > >> > > Finalist -  open *IT* oplossingen
> > >> > > Amsterdam - Eindhoven - Maarssen - Maastricht - Rotterdam
> > >> > > *www.finalist.nl*
> > >> > >
> > >> > > Telefoon 088 217 08 02
> > >> > >
> > >> >
> > >>
> > >
> > >
> >
>
>
>
> --
> Met vriendelijke groet,
>
> Roel van Dijk
> Software Engineer
>
> Finalist -  open *IT* oplossingen
> Amsterdam - Eindhoven - Maarssen - Maastricht - Rotterdam
> *www.finalist.nl*
>
> Telefoon 088 217 08 02
>

Re: patch for missing JpaPersonProperties in JpaPerson (with link to patch)

Posted by Jasha Joachimsthal <ja...@apache.org>.
On 2 July 2012 10:06, Jasha Joachimsthal <ja...@apache.org> wrote:

> Thanks for diving into that code. The next days I won't have time to work
> on it, so please be patient if the other committers don't pick it up
> immediately (we have some other issues in the 0.13 release to solve).
>
>
> On 29 June 2012 17:17, Roel van Dijk <ro...@finalist.com> wrote:
>
>> This is because of this line in PersonHandler:
>>
>>     Set<String> fields = request.getFields(Person.Field.DEFAULT_FIELDS);
>> The DEFAULT_FIELDS (id, name, thumbnail) are passed by default, if no
>> fields are requested explicitly. So when you do ?fields=tags, you only get
>> the tags, but other collections are defaulted to an empty ArrayList. The
>> non-collection fields are set to null, and ignored during JSON
>> serialization. The empty collection show up as "[]".
>>
>> Also compare the implementations of getActivities and getAccounts in
>> FieldRestrictingPerson, the latter makes more sense: the field is set to
>> null if the accounts are not required to be displayed.
>>
>
>> Roel
>>
>
Changed the behaviour to leave away the arrays that weren't requested
instead of returning empty values and I applied your patch.

Jasha


>>
>>
>> On Fri, Jun 29, 2012 at 3:46 PM, Jasha Joachimsthal <jasha@apache.org
>> >wrote:
>>
>> > When I apply the patch and check it in the running instance, the only
>> > difference I see is with ?fields=tags I don't see the name field. When
>> I do
>> > ?fields=name,tags it does return the name field, so it looks like it's
>> > filtering something. I do see all kind of other fields like cars, heroes
>> > etc.
>> >
>> >
>> >
>> > On 29 June 2012 15:25, Jasha Joachimsthal <ja...@jasha.eu> wrote:
>> >
>> > > Everyone can create a Jira account and then create a new issue. If
>> you're
>> > > planning to create more patches we can give you more rights in Jira
>> (like
>> > > assigning issues to you).
>> > > The issue is https://issues.apache.org/jira/browse/RAVE-703 and I'm
>> > > testing it right now :)
>> > >
>> > >
>> > > On 29 June 2012 14:44, Roel van Dijk <ro...@finalist.com> wrote:
>> > >
>> > >> I thought I couldn't create a new issue on JIRA.. Next time I'll try
>> > >> harder.
>> > >>
>> > >> And yes, you can apply it. I hope it will make 0.13!
>> > >>
>> > >> Roel
>> > >>
>> > >>
>> > >> On Fri, Jun 29, 2012 at 1:59 PM, Jasha Joachimsthal <
>> jasha@apache.org
>> > >> >wrote:
>> > >>
>> > >> > Thanks for the patch. Next time you can upload it to
>> > >> > https://reviews.apache.org/ or attach it to a (new) issue in
>> > >> > https://issues.apache.org/jira/browse/RAVE
>> > >> >
>> > >> > I assume you grant permission to apply the patch into the Apache
>> Rave
>> > >> > codebase.
>> > >> >
>> > >> > On 29 June 2012 13:25, Roel van Dijk <ro...@finalist.com> wrote:
>> > >> >
>> > >> > > The attachment didn't come through, here is a link to the patch:
>> > >> > >
>> > >> > >
>> > >> > >
>> > >> >
>> > >>
>> >
>> https://dl.dropbox.com/u/21051489/work/fetch_eager_person_properties_fix.patch
>> > >> > >
>> > >> > > --
>> > >> > > Kind regards,
>> > >> > >
>> > >> > > Roel van Dijk
>> > >> > > Software Engineer
>> > >> > >
>> > >> > > Finalist -  open *IT* oplossingen
>> > >> > > Amsterdam - Eindhoven - Maarssen - Maastricht - Rotterdam
>> > >> > > *www.finalist.nl*
>> > >> > >
>> > >> > > Telefoon 088 217 08 02
>> > >> > >
>> > >> >
>> > >>
>> > >
>> > >
>> >
>>
>>
>>
>> --
>> Met vriendelijke groet,
>>
>> Roel van Dijk
>> Software Engineer
>>
>> Finalist -  open *IT* oplossingen
>> Amsterdam - Eindhoven - Maarssen - Maastricht - Rotterdam
>> *www.finalist.nl*
>>
>> Telefoon 088 217 08 02
>>
>
>