Skip to Content.
Sympa Menu

grouper-dev - Re: [grouper-dev] finding groups by attribute value with wildcards

Subject: Grouper Developers Forum

List archive

Re: [grouper-dev] finding groups by attribute value with wildcards


Chronological Thread 
  • From: Tom Zeller <>
  • To: Chris Hyzer <>
  • Cc: Grouper Dev <>
  • Subject: Re: [grouper-dev] finding groups by attribute value with wildcards
  • Date: Thu, 4 Feb 2010 14:51:06 -0600
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; b=dCYNkAFdQbRqMvTQzX0TwhdwH4d2juorA3PZaYIGzZBAVWngx3QcIU24iRvVTdZ8Lo 8+xJwudMXjN6eu9oWLlnvqZkSEaGbK3Euc7xfadqEOq0bEgk6KtQ3H3J+KXYhkdoWbUo WIQnlFl2wdeApdYLvX3ADOyqWrISX2CebbiNk=

How about 2 constructor parameters, one for value wildcards and one
for stem scope, for GroupAttributeFilter and GroupAnyAttributeFilter ?
for example :

/**
*
{@link
QueryFilter} that returns groups matching the specified
* attribute specification.
* <p>
* This performs a substring, lowercased query on <i>attribute</i>.
* </p>
* @param attr Search on this attribute.
* @param value Search for this value.
* @param ns Restrict results to within this stem.
* @param wildcards Surround search value with wildcards
* @param scope Stem scope
*/
public GroupAttributeFilter(String attr, String value, Stem ns,
boolean wildcards, Stem.Scope scope) {

The method overrides for Hib3GroupDAO seem straightforward.

On Thu, Feb 4, 2010 at 12:59 PM, Chris Hyzer
<>
wrote:
> I guess I was thinking that if we didn't have it added automatically, then
> if you didn't pass one, it would only find groups directly in a stem.  But
> if you pass in a %, then it will be that stem and all substems.  But I
> don't want to derail you :)  If you want me to contribute that part I can
> (will need to join to Stems table and got for a stem_id associated with
> that group).
>
> Thanks,
> Chris
>
> -----Original Message-----
> From:
>
>
> [mailto:]
> On Behalf Of Tom Zeller
> Sent: Thursday, February 04, 2010 10:26 AM
> To: Chris Hyzer
> Cc: Grouper Dev
> Subject: Re: [grouper-dev] finding groups by attribute value with wildcards
>
> I think the scope still needs the "%", right ?
>
> On Thu, Jan 28, 2010 at 11:19 PM, Chris Hyzer
> <>
> wrote:
>> Sounds good to me, Id vote for an overload with a boolean which specifies
>> whether percents are added or not (which would be those two, and the stem
>> scope one)... then we can reuse the logic/query.  But if you disagree,
>> feel free to make another duplicate method.
>>
>> Thanks,
>> Chris
>>
>> -----Original Message-----
>> From:
>>
>>
>> [mailto:]
>> On Behalf Of Tom Zeller
>> Sent: Thursday, January 28, 2010 11:44 AM
>> To: Grouper Dev
>> Subject: [grouper-dev] finding groups by attribute value with wildcards
>>
>> I'd like to find groups using a query "... like value" where I can
>> specify wildcards in the value.
>>
>> The Hib3GroupDAO method findAllByApproximateAttr uses "like %value%",
>> and findAllByAttr uses "= value", but what I need is "like value".
>>
>> I don't see such a method, is there one ? I'll offer to do the work,
>> does this sound reasonable ?
>>
>> My use case is that I'm checking our mail namespace for uniqueness. We
>> store email addresses as attributes, e.g.
>> "",
>> and I
>> want to find groups based on the mail left-hand-side of the @. The
>> mail right-hand-sides of the @ are variable and dynamic.
>>
>> Thanks,
>> TomZ
>>
>



Archive powered by MHonArc 2.6.16.

Top of Page