Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 369024

Summary: Correction LocalLookupCall and addition of a LocalLookupService
Product: z_Archived Reporter: Jeremie Bresson <dev>
Component: ScoutAssignee: Stephan Leicht Vogt <stephan.leichtvogt>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: ivan.motsch, jeremie.bresson
Version: unspecifiedFlags: ivan.motsch: juno+
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Unit Test for LocalLookupCall
ivan.motsch: iplog+
Patch for bug 369024
none
Unit Test for LocalLookupService
none
Patch for bug 369024 (v2) ivan.motsch: iplog+

Description Jeremie Bresson CLA 2012-01-19 00:40:03 EST
Build Identifier: 

LocalLookupCall#getDataByRec() is not implemented in Local LookupCall: for the moment this function only provide an empty array of LookupRows.

A LocalLookupService would be useful in the cases where you need to compute the list of rows using an external system (not a database)

Reproducible: Always
Comment 1 Jeremie Bresson CLA 2012-01-19 00:42:49 EST
Created attachment 209720 [details]
Unit Test for LocalLookupCall

Unit test cases for LocalLookupCall. 
To be run as normal Unit Test.
Comment 2 Jeremie Bresson CLA 2012-01-19 00:44:50 EST
Created attachment 209721 [details]
Patch for bug 369024

A patch for the two problems:
* Addition of the LocalLookupService (analog to the LocalLookupCall).
* Delegation of the filtering operations of rows to a Helper class.
* Implementation of  getDataByRec considering parent key (given by LookupCall#getRec())
Comment 3 Jeremie Bresson CLA 2012-01-19 00:47:17 EST
Created attachment 209722 [details]
Unit Test for LocalLookupService

Transposition of the unit test cases for LocalLookupService.
To be run as normal Unit Tests in the server.
Comment 4 Jeremie Bresson CLA 2012-01-19 08:17:55 EST
Move of createLowerCaseSearchPattern(..) in StringUtility is missing in the patch.
Comment 5 Jeremie Bresson CLA 2012-01-19 12:30:34 EST
Created attachment 209765 [details]
Patch for bug 369024 (v2)

Add missing StringUtility modification.
Comment 6 Ivan Motsch CLA 2012-05-03 10:17:13 EDT
The LocalLookupCall is designed for those cases that are not delegating to a service. Therefore I would introduce a service to handle local lookup calls.

Also LocalLookupCall instances are expected to be "fast" and local for quick handling. Therefore when having large and "slow" lookup calls one would use a normal LookupCall subclass.

Regarding customization of create search pattern i will use your patch as it makes sense to not having static code at that place. It will be a moved to a protected location using the StringUtility as proposed by you.

Regarding the method getDataByRec: That method is empty since a LocalLookupCall is due to its nature never loading incrementally and thus also hierarchical forms of that LookupCall are fetching the complete tree at once.
See the SmartField with hierarchical lookup call for more details. It is fetching all data by calling getDataByAll and never calls getDataByRec on LocalLookupCalls.

I will apply the parts of the patch.
Comment 7 Ivan Motsch CLA 2012-05-03 10:35:31 EDT
added LocalLookupCall#createSearchPattern(String)
added StringUtility#toRegEx(String, int)
implemented LocalLookupCall#getDataByRec
added scout james junit test LocalLookupCallTest
Comment 8 Matthias Zimmermann CLA 2012-07-09 06:50:55 EDT
ticket closed.
deliverd as part of eclipse scout 3.8.0 (juno release train)