Main Overview Wiki Issues Forum Build Fisheye
Issue Details (XML | Word | Printable)

Key: CMP-208
Type: New Feature New Feature
Status: Open Open
Priority: Major Major
Assignee: Shay Banon
Reporter: Jason Carreira
Votes: 0
Watchers: 2

If you were logged in you would be able to see more operations.

Add named filters to resource mappings

Created: 01/Jun/06 01:38 PM   Updated: 01/Jun/06 01:38 PM
Component/s: Compass::Core
Affects Version/s: 0.9.1
Fix Version/s: None

 Description  « Hide
Add the ability to have global named filters with resource-specific mappings of the filters. For example, we may have a global "organizationFilter" which specifies that it takes one parameter, "orgId", which is the organization of the current user and should be the owning organization of the data returned by the index. For an Organization record, this is as simple as comparing the org.getId() with the supplied "orgId". For a catalog item, it might be: item.getVendorProfile().getOrganization().getId().

In the main compass config, you could map a global filter like this:

<filter-def name="organizationFilter">
<filter-param name="orgId" type="string" />

then, in a specific resource mapping, the filter would be applied like this:

<filter ref="organizationFilter"> = :orgId

Similarly for an effectivity filter:

<filter-def name="effectivityFilter">
<filter-param name="asOfDate" type="date" />

<filter ref="effectivityFilter">
startDate <= :asOfDate <= endDate

Not sure how you do that last one...

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.