You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by Alexander Saar <al...@mindquarry.com> on 2006/12/08 16:30:13 UTC
Refactoring request
Hello,
I've implemented a customized JSON Response writer. But I had to copy
the code of the existing JSONResponseWriter, because I wanted to reuse
the existing JSONWriter as super class.
The currently used JSONWriter is a nested class, which can not be
overwritten by subclasses. Is it possible to refactor it to its own
class file. It nobody has problems with that, I can make it and supply
an according patch to the JIRA.
Regards,
Alex
--
Alexander Saar
Mindquarry - achieving more together (http://www.mindquarry.com)
E-Mail: alexander.saar@mindquarry.com | Mindquarry GmbH
Work: +49 331 97992 223 | August-Bebel-Str. 88
Mobile: +49 177 59 85 437 | 14482 Potsdam, Germany
Weblog: http://alexsaar.blogspot.com/
OpenBC Profile: http://www.openbc.com/hp/Alexander_Saar/
Re: Refactoring request
Posted by Yonik Seeley <yo...@apache.org>.
On 12/8/06, Alexander Saar <al...@mindquarry.com> wrote:
> It does nothing really different than the existing JSON writer. But I
> need to transform the content of some fields like URLs for indexed
> documents.
>
> These URLs are posted to the index by another component I can't change,
> so I have to do the transformation on the results of a query. I'm sure
> this can also be done with JavaScript, but I think it is easier to do it
> with Java.
It might be easier to make your own field type by subclassing an
existing one... that way the change would be independent of output
syntax.
I'm not opposed to making JSONWriter public (for expert use) either though.
-Yonik
Re: Refactoring request
Posted by Alexander Saar <al...@mindquarry.com>.
It does nothing really different than the existing JSON writer. But I
need to transform the content of some fields like URLs for indexed
documents.
These URLs are posted to the index by another component I can't change,
so I have to do the transformation on the results of a query. I'm sure
this can also be done with JavaScript, but I think it is easier to do it
with Java.
Regards,
Alex
Erik Hatcher schrieb:
> Alex,
>
> I'm curious what your customized writer does differently. Care to
> elaborate?
>
> Thanks,
> Erik
>
>
> On Dec 8, 2006, at 10:30 AM, Alexander Saar wrote:
>
>> Hello,
>> I've implemented a customized JSON Response writer. But I had to copy
>> the code of the existing JSONResponseWriter, because I wanted to reuse
>> the existing JSONWriter as super class.
>>
>> The currently used JSONWriter is a nested class, which can not be
>> overwritten by subclasses. Is it possible to refactor it to its own
>> class file. It nobody has problems with that, I can make it and supply
>> an according patch to the JIRA.
>>
>> Regards,
>> Alex
>>
>>
>> --Alexander Saar
>> Mindquarry - achieving more together (http://www.mindquarry.com)
>>
>> E-Mail: alexander.saar@mindquarry.com | Mindquarry GmbH
>> Work: +49 331 97992 223 | August-Bebel-Str. 88
>> Mobile: +49 177 59 85 437 | 14482 Potsdam, Germany
>>
>> Weblog: http://alexsaar.blogspot.com/
>> OpenBC Profile: http://www.openbc.com/hp/Alexander_Saar/
>
--
Alexander Saar (CTO)
Mindquarry - achieving more together (http://www.mindquarry.com)
E-Mail: alexander.saar@mindquarry.com | Mindquarry GmbH
Work: +49 331 97992 223 | August-Bebel-Str. 88
Mobile: +49 177 59 85 437 | 14482 Potsdam, Germany
Weblog: http://alexsaar.blogspot.com/
OpenBC Profile: http://www.openbc.com/hp/Alexander_Saar/
Re: Refactoring request
Posted by Erik Hatcher <er...@ehatchersolutions.com>.
Alex,
I'm curious what your customized writer does differently. Care to
elaborate?
Thanks,
Erik
On Dec 8, 2006, at 10:30 AM, Alexander Saar wrote:
> Hello,
> I've implemented a customized JSON Response writer. But I had to
> copy the code of the existing JSONResponseWriter, because I wanted
> to reuse the existing JSONWriter as super class.
>
> The currently used JSONWriter is a nested class, which can not be
> overwritten by subclasses. Is it possible to refactor it to its own
> class file. It nobody has problems with that, I can make it and
> supply an according patch to the JIRA.
>
> Regards,
> Alex
>
>
> --
> Alexander Saar
> Mindquarry - achieving more together (http://www.mindquarry.com)
>
> E-Mail: alexander.saar@mindquarry.com | Mindquarry GmbH
> Work: +49 331 97992 223 | August-Bebel-Str. 88
> Mobile: +49 177 59 85 437 | 14482 Potsdam, Germany
>
> Weblog: http://alexsaar.blogspot.com/
> OpenBC Profile: http://www.openbc.com/hp/Alexander_Saar/