Skip to Content.
Sympa Menu

grouper-users - [grouper-users] Re: identifierAttributes in sources.xml

Subject: Grouper Users - Open Discussion List

List archive

[grouper-users] Re: identifierAttributes in sources.xml


Chronological Thread 
  • From: Scott Koranda <>
  • To: grouper-users <>
  • Subject: [grouper-users] Re: identifierAttributes in sources.xml
  • Date: Wed, 29 Aug 2012 15:50:05 -0500

> Hi,
>
> I have in the past used the JNDI source to obtain subjects
> from an LDAP directory.
>
> Now I want to configure a JDBC source to obtain subjects from
> a relational database.
>
> I am confused about the role of 'identifierAttributes'.

I am also confused about the {inclause}.

So again in the example sources.xml distributed with 2.1.0 the
example for

<searchType>searchSubject</searchType>

has

<param>
<param-name>sql</param-name>
<param-value>
select
s.subjectid as id, s.name as name,
(select sa2.value from subjectattribute sa2 where name='name' and
sa2.SUBJECTID = s.subjectid) as lfname,
(select sa3.value from subjectattribute sa3 where name='loginid' and
sa3.SUBJECTID = s.subjectid) as loginid,
(select sa4.value from subjectattribute sa4 where name='description' and
sa4.SUBJECTID = s.subjectid) as description,
(select sa5.value from subjectattribute sa5 where name='email' and
sa5.SUBJECTID = s.subjectid) as email
from
subject s
where
{inclause}
</param-value>
</param>
<param>
<param-name>inclause</param-name>
<param-value>
s.subjectid = ?
</param-value>
</param>

I take that to mean that the '?' in the value for the inclause
will be replaced by whatever string is being used for a
search.

I am guessing that it's a requirement that the '?' has to be
in the value of the inclause and not in the value for the sql
or the substitution will not happen.

Is that correct?

I see later, however, this:

<search>
<searchType>search</searchType>
<param>
<param-name>sql</param-name>
<param-value>
select
s.subjectid as id, s.name as name,
(select sa2.value from subjectattribute sa2 where name='name' and
sa2.SUBJECTID = s.subjectid) as lfname,
(select sa3.value from subjectattribute sa3 where name='loginid' and
sa3.SUBJECTID = s.subjectid) as loginid,
(select sa4.value from subjectattribute sa4 where name='description' and
sa4.SUBJECTID = s.subjectid) as description,
(select sa5.value from subjectattribute sa5 where name='email' and
sa5.SUBJECTID = s.subjectid) as email
from
subject s
where
s.subjectid in (
select subjectid from subject where lower(name) like
concat('%',concat(?,'%')) union
select subjectid from subjectattribute where searchvalue like
concat('%',concat(?,'%')))
</param-value>
</param>
</search>

In that example the '?' is not in a inclause but in the value
for the sql itself.

Why the difference?

Thanks,

Scott



Archive powered by MHonArc 2.6.16.

Top of Page