Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 364312 - Improve extensibility of CodeLookupCall
Summary: Improve extensibility of CodeLookupCall
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Scout (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-21 07:25 EST by Sandro Blum CLA
Modified: 2021-08-19 11:17 EDT (History)
2 users (show)

See Also:
zimmermann: juno+


Attachments
Patch for CodeLookupCall class (3.53 KB, patch)
2011-11-21 07:32 EST, Sandro Blum CLA
no flags Details | Diff
Patch for CodeLookupCall class (8.03 KB, patch)
2012-02-29 08:30 EST, Sandro Blum CLA
ivan.motsch: iplog+
Details | Diff
unit test (20.15 KB, patch)
2012-05-30 03:38 EDT, Ivan Motsch CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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