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

Bug 364312

Summary: Improve extensibility of CodeLookupCall
Product: z_Archived Reporter: Sandro Blum <sandro.blum>
Component: ScoutAssignee: Project Inbox <scout.core-inbox>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: ivan.motsch, zimmermann
Version: unspecifiedFlags: zimmermann: juno+
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Patch for CodeLookupCall class
none
Patch for CodeLookupCall class
ivan.motsch: iplog+
unit test none

Description Sandro Blum CLA 2011-11-21 07:25:04 EST
Build Identifier: M20100211-1343

Sometimes there is a code-type-based lookup call needed that does not just return code texts but rather adapts the code texts, e.g. by adding a certain suffix to the text. Currently, the CodeLookupCall class does not allow subclasses to change or extend the way the cached codes are mapped to lookup rows.

Proposal:
- new execDecorateCode(..) method that allows subclasses to decorate codes returned by lookup call
- new getConfiguredSortComparator() method that allows sorting the codes before lookup rows are created

Funktionalität wird in Branches nicht benötigt, Anpassung auf Trunk ist ausreichend.

Reproducible: Always

Steps to Reproduce:
This is an enhancement. No error to reproduce.
Comment 1 Sandro Blum CLA 2011-11-21 07:28:29 EST
Not required on branches, enhancement of trunk is sufficient.
Comment 2 Sandro Blum CLA 2011-11-21 07:32:08 EST
Created attachment 207300 [details]
Patch for CodeLookupCall class
Comment 3 Ivan Motsch CLA 2012-02-16 07:07:23 EST
The revision of your patch is an old version of the CodeLookupCall class.
Please consult the current version, it already contains (resp. contained before)these enhancements:

use setFilter to filter the collection of affected codes

use execCreateLookupRowsFromCodes to customize the transformation from ICode to LookupRow.
Comment 4 Matthias Zimmermann CLA 2012-02-29 07:12:42 EST
updated target milestone
Comment 5 Sandro Blum CLA 2012-02-29 08:30:37 EST
Created attachment 211794 [details]
Patch for CodeLookupCall class
Comment 6 Sandro Blum CLA 2012-02-29 08:33:47 EST
Attached new CodeLookupCall patch based on proposals by Ivan Motsch.
Comment 7 Matthias Zimmermann CLA 2012-02-29 08:58:29 EST
status set to reopened as new patch was attached
Comment 8 Ivan Motsch CLA 2012-05-24 09:49:09 EDT
Thanks!
That code lookg good.
Since there change basically 50% of the code in that class, could you please add
a junit test that tests whether the behaviour BEFORE the patch (without custom Comparator) is same after (without Comparator).

You may create a similar test as the existing /org.eclipse.scout.james.shared/src/org/eclipse/scout/james/shared/tests/lookup/LocalLookupCallTest.java

Thanks
Comment 9 Matthias Zimmermann CLA 2012-05-24 11:36:20 EDT
updated target milestone to 3.8.1 as this change won't make it for juno at this time
Comment 10 Ivan Motsch CLA 2012-05-30 03:38:08 EDT
Created attachment 216453 [details]
unit test
Comment 11 Ivan Motsch CLA 2012-05-30 03:38:58 EDT
Thanks for the unit test, i added it to this ticket.
Works fine and looks good.
I applied to it to 3.8.1
Comment 12 Matthias Zimmermann CLA 2012-11-13 02:36:51 EST
shipped with scout juno sr1