Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In grouper 2.3.0 (unpatched) and previous versions, the subject API was configured with a sources.xml .  This needs to be converted to config overlays in 2.4.0 so Grouper packaging can have defaults and overlays.  Also so the Grouper team can manage internal sources without having to merge with a potentially changed file.

Conversion

Run the grouperInstaller, admin task, upgradeTasks, convert sources xml to properties

Follow the prompt to identify the location of the sources.xml file

This will generate the subject.properties file based on your sources.xml edits

Code Block
[appadmin@i2midev1 patchesAuto]$ java -jar grouperInstaller.jar
Do you want to 'install' a new installation of grouper, 'upgrade' an existing installation,
  'patch' an existing installation, 'admin' utilities, or 'createPatch' for Grouper developers
  (enter: 'install', 'upgrade', 'patch', 'admin', 'createPatch' or blank for the default) [install]: admin
What admin action do you want to do (manage, upgradeTask)? : upgradeTask
What upgrade task do you want to do (convertEhcacheXmlToProperties, convertSourcesXmlToProperties)? : convertSourcesXmlToProperties
Note, you need to convert the sources.xml file for each Grouper runtime, e.g. loader, WS, UI.
Note, to use subject sources from subject.properties, you need to be running Grouper 2.3.0+ with API patch 40 installed.
Enter the location of the sources.xml file: /opt/tomcats/tomcat_f/webapps/grouper_v2_3/WEB-INF/classes/sources.xml
Enter the location of the subject.base.properties file [/opt/tomcats/tomcat_f/webapps/grouper_v2_3/WEB-INF/classes/subject.properties]: 
File was written: /opt/tomcats/tomcat_f/webapps/grouper_v2_3/WEB-INF/classes/subject.properties
You should archive your sources.xml and remove it from your project since it is now unused:
  /opt/tomcats/tomcat_f/webapps/grouper_v2_3/WEB-INF/classes/sources.xml

Configuration

Sample sources.xml config

Code Block
<?xml version="1.0" encoding="utf-8"?>
<sources>
 <source adapterClass="edu.internet2.middleware.grouper.subj.GrouperJdbcSourceAdapter">
    <id>jdbc</id>
    <name>Example JDBC Source Adapter</name>
     <type>person</type>
     
     <init-param>
       <param-name>sortAttribute1</param-name>
       <param-value>LOGINID</param-value>
     </init-param>
     <init-param>
       <param-name>searchAttribute0</param-name>
       <param-value>searchAttribute0</param-value>
     </init-param>
     <internal-attribute>searchAttribute0</internal-attribute>

     <search>
         <searchType>searchSubject</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
   {inclause}
            </param-value>
         </param>
         <param>
             <param-name>inclause</param-name>
             <param-value>
s.subjectid = ?
            </param-value>
         </param>
     </search>
   </source>
</sources>

This needs to be converted to config overlays so Grouper packaging can have defaults and overlays.  Also so the Grouper team can manage internal sources without having to merge with a potentially changed file. 

Sample subject.properties config:

...