[jsword-devel] jsword-devel Digest, Vol 47, Issue 11

DM Smith dmsmith555 at yahoo.com
Sun Apr 20 13:54:58 MST 2008


On Apr 20, 2008, at 8:01 AM, Yiguang Hu wrote:

> DM,
> Yes. It makes perfect sense to refactor the
> getOSISString method with one more parameter like
> startCount instead of making another one.
>
> I think it is useful to make "total" available for
> client. So that user may know the significance of the
> key word from the numerical statistics.

I added both. I did not give them much of a test. But it compiles and  
it looks like it should work :)

>
> Regarding paging, looks like we do need some way such
> as cache to avoiding repeating the process of
> searching/count total etc for the same
> key/locale/book, when we start to take into account of
> performance.

I'm not a terribly familiar with servlets, nor with DWR. I know we can  
cache on the client side, which will minimize trips to the server.  
These trips are the most costly. I don't think that we can have state  
in DwrBridge, or at least I am not sure of whether it persists and if  
so, then whether or how it is shared.

The key is relatively lightweight. Each book translates the string  
reference into a key by parsing it. What it references does not have  
to actually exist in the book. Doing operations on a key can be  
expensive, such as getting the number of verses in a reference.  
Caching "total" on the client makes lots of sense.

-- DM



>
> Thanks
> Yiguang
> --- DM Smith <dmsmith555 at yahoo.com> wrote:
>
>> Yiguang,
>>
>> This is a good idea. But, I'd rather replace the
>> current call with
>> your suggestion. Right now it is not set in stone.
>>
>> Question: How would you propose the handling of
>> "total"?
>>
>> Is it only known on the server side and when the
>> call can return no
>> more then it returns an empty string? This would
>> lead to having an
>> active next button when there is no next.
>>
>> Or should it be available on the client?
>>
>> Should we add something like the following that will
>> get the "total"?
>>
>>
>> In Him,
>> 	DM
>>
>> On Apr 19, 2008, at 10:57 PM, Yiguang Hu wrote:
>>
>>> DM,
>>>
>>> I'd like to propose another api in DwrBridge.java
>>> similar to getOSISString:
>>>
>>> public String getOSISString(String bookInitials,
>>> String reference, int maxKeyCount)
>>>
>>> The new api better be called something other than
>>> getOSISString such as
>>>
>>> public String getOSISStringAny(String
>> bookInitials,
>>> String reference, int startCount, int maxKeyCount)
>>>
>>> for easy use with DWR.
>>>
>>> This api need to deal with the bounday condition
>> such
>>> as the following scenario:
>>> if (startCount<0){
>>> startCount=0;
>>> }
>>> if (total<startCount+maxKeyCount){
>>> startCount=total-maxKeyCount;
>>> }
>>>
>>> With this api, we could create paging effect with
>>> buttons"<<" and ">>" etc to navigate forward and
>>> backward through all the search results instead of
>> the
>>> first maxKeyCount results.
>>>
>>> Thanks
>>> Yiguang
>>>
>
>
>       
> ____________________________________________________________________________________
> Be a better friend, newshound, and
> know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ





More information about the jsword-devel mailing list