grouper-users - RE: [grouper-users] sources.xml problems
Subject: Grouper Users - Open Discussion List
List archive
- From: "Chris Franks" <>
- To: <>
- Cc: "Tom Barton" <>
- Subject: RE: [grouper-users] sources.xml problems
- Date: Wed, 29 Aug 2007 15:52:25 +0100
Thanks for that Tom,
That fixed my login with subjectId/view subject summary problem.
The person search was a bit wierder. MySQL didn't seem to like the ''
around the search string that seem to be autogenerated by the ?
variable(?) so I had to change the <searchType>search</searchType> SQL
query to:
select * from Subject where (subjectId LIKE CONCAT('%', ?, '%')) or
(name LIKE CONCAT('%', ?, '%'))
To get around this.
Thanks again.
Chris
>-----Original Message-----
>From: Tom Barton
>[mailto:]
>
>Sent: 29 August 2007 14:16
>To: Chris Franks
>Cc:
>
>Subject: Re: [grouper-users] sources.xml problems
>
>Do your <search> elements contain a 'numParameters' declaration, as in
>
> <search>
> <searchType>searchSubject</searchType>
> <param>
> <param-name>numParameters</param-name>
> <param-value>1</param-value>
> </param>
> <param>
> <param-name>sql</param-name>
> <param-value>select * from Subject where
>(subjectId=?)</param-value>
> </param>
> </search>
>
>This was introduced in subject v0.3.X, which is included in
>grouper 1.2.0. The value of numParameters is the number of '?'
>in the following 'sql' parameter that must be substituted.
>
>Chris Franks wrote:
>> Hi Everyone,
>>
>> I'm having trouble with the sources.xml in Grouper 1.2.
>>
>> When I log in to the system, by default I have to use the "name"
>> attribute in the Subject table (I assume because the sources.xml
>> searchSubjectByIdentifier search block says select * from Subject
>> where
>> (name=?) and the searchSubject search block says select *
>from Subject
>> where (subjectId=?)). When I switch these around (which
>seems to make
>> more sense because the searchSubjectByIdentifier used the subjectId
>> attribute) this is cured.
>>
>> When I can do this, I can login. But when I try to view my
>subject's
>> summary I get:
>>
>> Unexpected error -
>> edu.internet2.middleware.subject.SubjectNotFoundException:subject not
>> found:
>> ,person
>>
>> Is this because the searchSubjectByIdentifier and
>searchSubject search
>> blocks in the sources.xml have been switched? In grouper
>1.1 I could
>> rectify this by editing the searches so that:
>>
>> searchSubjectByIdentifier = select * from Subject where
>> (subjectId='%TERM%') or (name='%TERM%')
>>
>> and
>>
>> searchSubject = select * from Subject where (subjectId='%TERM%') or
>> (name='%TERM%')
>>
>> But if I do the equivalent in Grouper 1.2, so:
>>
>> searchSubjectByIdentifier = select * from Subject where (name=?) or
>> (subjectId=?)
>>
>> and
>>
>> searchSubject = select * from Subject where (subjectId=?) or (name=?)
>>
>> Neither logging in with the subjectId attribute nor the name
>attribute
>> works.
>>
>> Looking at the query logs, the queries with "or" in them
>don't seem to
>> get executed at all. Similarly, if I make no changes at all to the
>> sources and login with the GrouperSystem user and try to do
>a search,
>> with working Subject and SubjectAttribute entries in the database, I
>> get no results and it looks as though the search query has not been
>> executed. This only happens in Grouper 1.2.
>>
>> Can anyone shed any light? I'm using MySQL 5 if this helps?
>>
>> Thanks in advance,
>>
>> Chris Franks
>> Newcastle University
>
- sources.xml problems, Chris Franks, 08/29/2007
- Re: [grouper-users] sources.xml problems, Tom Barton, 08/29/2007
- RE: [grouper-users] sources.xml problems, Chris Franks, 08/29/2007
- Re: [grouper-users] sources.xml problems, Tom Barton, 08/29/2007
Archive powered by MHonArc 2.6.16.