Skip to Content.
Sympa Menu

grouper-users - [grouper-users] RE: subject source in sources.xml

Subject: Grouper Users - Open Discussion List

List archive

[grouper-users] RE: subject source in sources.xml


Chronological Thread 
  • From: Chris Hyzer <>
  • To: Matt Wilks <>
  • Cc: "" <>
  • Subject: [grouper-users] RE: subject source in sources.xml
  • Date: Fri, 21 Oct 2011 14:58:57 +0000
  • Accept-language: en-US

You can specify DB connection properties like this:

<!--
e.g. mysql: com.mysql.jdbc.Driver
e.g. p6spy (log sql): com.p6spy.engine.spy.P6SpyDriver
for p6spy, put the underlying driver in spy.properties
e.g. oracle: oracle.jdbc.driver.OracleDriver
e.g. hsqldb: org.hsqldb.jdbcDriver
e.g. postgres: org.postgresql.Driver -->

<init-param>
<param-name>dbDriver</param-name>
<param-value>org.hsqldb.jdbcDriver</param-value>
</init-param>

<!--
e.g. mysql: jdbc:mysql://localhost:3306/grouper
e.g. p6spy (log sql): [use the URL that your DB requires]
e.g. oracle: jdbc:oracle:thin:@server.school.edu:1521:sid
e.g. hsqldb (a): jdbc:hsqldb:dist/run/grouper;create=true
e.g. hsqldb (b): jdbc:hsqldb:hsql://localhost:9001
e.g. postgres: jdbc:postgresql:grouper -->

<init-param>
<param-name>dbUrl</param-name>

<param-value>jdbc:hsqldb:C:/projects/GrouperI2MI_1-2/grouper/dist/run/grouper</param-value>
</init-param>
<init-param>
<param-name>dbUser</param-name>
<param-value>sa</param-value>
</init-param>
<init-param>
<param-name>dbPwd</param-name>
<param-value></param-value>
</init-param>


Run this from GSH and see the output:

#> cd /usr/local/grouper/grouper
#> bin/gsh.sh

sources.xml read from:
/usr/local/grouper/grouper.apiBinary-2.0.0/conf/sources.xml
sources.xml groupersource id: g:gsa
sources.xml jdbc source id: jdbc: GrouperJdbcConnectionProvider
sources.xml jdbc source id: sourceId: GrouperJdbcConnectionProvider

You need to see an entry there for source, which you have as id: sourceId.
You should probably change:

FROM:

<id>sourceId</id>

TO:

<id>utiddb</id>

(or something more descriptive)

Then, based on that source id, run this:

gsh 0% grouperSession = GrouperSession.startRootSession();
edu.internet2.middleware.grouper.GrouperSession:
c7405c374ef6489b8b9fd3194b8784ec,'GrouperSystem','application'
gsh 1% SubjectFinder.findByIdOrIdentifierAndSource("whateverId",
"yourSourceId", true);
subject: id='10021368' type='person' source='pennperson' name='Chris Hyzer'

Thanks,
Chris

-----Original Message-----
From: Matt Wilks
[mailto:]

Sent: Friday, October 21, 2011 10:51 AM
To: Chris Hyzer
Cc:

Subject: Re: subject source in sources.xml

Whoops, two mistakes. Forgot to reply to the list and forgot to attach
the file! Sorry about that.

On 11-10-21 10:49 AM, "Chris Hyzer"
<>
wrote:

>Where is the sources.xml?
>
>-----Original Message-----
>From: Matt Wilks
>[mailto:]
>Sent: Friday, October 21, 2011 10:46 AM
>To: Chris Hyzer
>Subject: Re: subject source in sources.xml
>
>Here's the command I'm running, and I'll attach sources.xml (everything
>but the source I added has been stripped out). I put the uoft_id table in
>the same database as the grouper tables because I didn't see how to
>specify alternate database credentials in the <source> tag. 'uoft_id'
>just contains a bunch of dummy data, one record per user.
>
>================
>#> cd /usr/local/grouper/grouper
>#> bin/gsh -xmlimport conf/sources.xml
>Using GROUPER_HOME: /usr/local/grouper/grouper
>Using GROUPER_CONF: /usr/local/grouper/grouper/conf
>Using JAVA: java
>using MEMORY: 64m-512m
>(note, might need to type in your response multiple times (Java stdin is
>flaky))
>(note, you can whitelist or blacklist db urls and users in the
>grouper.properties)
>Are you sure you want to import data from xml in db user 'grouper', db url
>'jdbc:mysql://localhost:3306/grouper'? (y|n):
>y
>Continuing...
>Grouper starting up: version: 2.0.0, build date: 2011/09/06 07:55:27, env:
><no label configured>
>grouper.properties read from:
>/usr/local/grouper/grouper.apiBinary-2.0.0/conf/grouper.properties
>Grouper current directory is: /usr/local/grouper/grouper.apiBinary-2.0.0
>log4j.properties read from:
>/usr/local/grouper/grouper.apiBinary-2.0.0/conf/log4j.properties
>Grouper is logging to file:
>/usr/local/grouper/grouper/logs/grouper_error.log, at min level WARN for
>package: edu.internet2.middleware.grouper, based on log4j.properties
>grouper.hibernate.properties:
>/usr/local/grouper/grouper.apiBinary-2.0.0/conf/grouper.hibernate.properti
>e
>s
>grouper.hibernate.properties:
>grouper@jdbc:mysql://localhost:3306/grouper
>sources.xml read from:
>/usr/local/grouper/grouper.apiBinary-2.0.0/conf/sources.xml
>sources.xml groupersource id: g:gsa
>sources.xml jdbc source id: jdbc: GrouperJdbcConnectionProvider
>sources.xml jdbc source id: sourceId: GrouperJdbcConnectionProvider
>XML file contains 0 records
>10:38:52: Beginning import: database contains 1,432 records
>Ending import: processed 0 records
>Ending import: database contains 1432 records
>Ending import: 0 inserts, 0 updates, and 0 skipped records
>DONE: 10:38:53: imported 0 records from:
>/usr/local/grouper/grouper.apiBinary-2.0.0/conf/sources.xml
>There are no inserts or updates from XML file, registry is in sync
>================
>
>
>
>Thanks again,
>Matt.
>
>On 11-10-21 9:08 AM, "Chris Hyzer"
><>
> wrote:
>
>>You don't have to import it, just put it on the classpath, can you send a
>>sanitized copy of the sources.xml and the gsh command you are running and
>>the output?
>>
>>Thanks,
>>Chris
>>
>>-----Original Message-----
>>From:
>>
>>[mailto:]
>> On Behalf Of Matt Wilks
>>Sent: Friday, October 21, 2011 8:09 AM
>>To:
>>
>>Subject: [grouper-users] subject source in sources.xml
>>
>>I'm trying to configure another subject source in conf/sources.xml. I
>>think I've got the syntax right, but is there anything I have to do to
>>make grouper recognize it? I tried loading the sources.xml file with
>>gsh:
>>
>> # gsh -xmlimport conf/sources.xml
>>
>>But the new subjects still aren't showing up from an entity search in the
>>admin UI. There must be something simple I'm missing...
>>
>>Thanks,
>>
>>--
>>Matt Wilks
>>University of Toronto Information Security, I+TS
>>
>




Archive powered by MHonArc 2.6.16.

Top of Page