Versions Compared

Key

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

...

Code Block
# Copyright 2016 Internet2
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

#
# Subject configuration
#

# The subject properties uses Grouper Configuration Overlays (documented on wiki)
# By default the configuration is read from subject.base.properties
# (which should not be edited), and the subject.properties overlays
# the base settings.  See the subject.base.properties for the possible
# settings that can be applied to the subject.properties

# enter the location of the sources.xml.  Must start with classpath: or file:
# blank means dont use sources.xml, use subject.properties
# default is: classpath:sources.xml
# e.g. file:/dir1/dir2/sources.xml
subject.sources.xml.location = 


#########################################
## Configuration for source id: pennperson
## Source configName: pennperson
#########################################
subjectApi.source.pennperson.id = pennperson

# this is a friendly name for the source
subjectApi.source.pennperson.name = Penn person

# type is not used all that much.  Can have multiple types, comma separate.  Can be person, group, application
subjectApi.source.pennperson.types = person

# the adapter class implements the interface: edu.internet2.middleware.subject.Source
# adapter class must extend: edu.internet2.middleware.subject.provider.BaseSourceAdapter
# edu.internet2.middleware.grouper.subj.GrouperJdbcSourceAdapter2  :  if doing JDBC this should be used if possible.  All subject data in one table/view.
# edu.internet2.middleware.grouper.subj.GrouperJdbcSourceAdapter   :  oldest JDBC source.  Put freeform queries in here
# edu.internet2.middleware.grouper.subj.GrouperJndiSourceAdapter   :  used for LDAP
subjectApi.source.pennperson.adapterClass = edu.internet2.middleware.subject.provider.JDBCSourceAdapter2

subjectApi.source.pennperson.param.maxPageSize.value = 100

# edu.internet2.middleware.subject.provider.C3p0JdbcConnectionProvider (default)
# edu.internet2.middleware.subject.provider.DbcpJdbcConnectionProvider (legacy) 
# edu.internet2.middleware.grouper.subj.GrouperJdbcConnectionProvider 
# (same settings as grouper.hibernate.properties, the driver, url, pass, maxActive, maxIdle, maxWait are forbidden
subjectApi.source.pennperson.param.jdbcConnectionProvider.value = edu.internet2.middleware.subject.provider.C3p0JdbcConnectionProvider

#       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
subjectApi.source.pennperson.param.dbUrl.value = jdbc:mysql://localhost:3306/grouper

# username when connecting to the database
subjectApi.source.pennperson.param.dbUser.value = sa

# password when connecting to the database (or file with encrypted password inside)
subjectApi.source.pennperson.param.dbPwd.value = whatever

# the table or view to query results from.  Note, could prefix with a schema name
subjectApi.source.pennperson.param.dbTableOrView.value = person_source_v

# the column name to get the subjectId from
subjectApi.source.pennperson.param.subjectIdCol.value = penn_id

# the column name to get the name from
subjectApi.source.pennperson.param.nameCol.value = name

subjectApi.source.pennperson.param.descriptionCol.value = description

# search col where general searches take place, lower case
subjectApi.source.pennperson.param.lowerSearchCol.value = description_lower

# optional col if you want the search results sorted in the API (note, UI might override)
subjectApi.source.pennperson.param.defaultSortCol.value = description

# you can count up from 0 to N of columns to search by identifier (which might also include by id)
subjectApi.source.pennperson.param.subjectIdentifierCol0.value = pennname

# you can count up from 0 to N of columns to search by identifier (which might also include by id)
subjectApi.source.pennperson.param.subjectIdentifierCol1.value = penn_id

# you can count up from 0 to N of columns to search by identifier (which might also include by id)
subjectApi.source.pennperson.param.subjectIdentifierCol2.value = eppn

# now you can count up from 0 to N of attributes for various cols.  The name is how to reference in subject.getAttribute()
subjectApi.source.pennperson.param.subjectAttributeCol0.value = pennname

# you can count up from 0 to N of attributes for various cols.  The name is how to reference in subject.getAttribute()
subjectApi.source.pennperson.param.subjectAttributeName0.value = PENNNAME

# now you can count up from 0 to N of attributes for various cols.  The name is how to reference in subject.getAttribute()
subjectApi.source.pennperson.param.subjectAttributeCol1.value = email

# you can count up from 0 to N of attributes for various cols.  The name is how to reference in subject.getAttribute()
subjectApi.source.pennperson.param.subjectAttributeName1.value = EMAIL

# now you can count up from 0 to N of attributes for various cols.  The name is how to reference in subject.getAttribute()
subjectApi.source.pennperson.param.subjectAttributeCol2.value = eppn

# you can count up from 0 to N of attributes for various cols.  The name is how to reference in subject.getAttribute()
subjectApi.source.pennperson.param.subjectAttributeName2.value = EPPN

# now you can count up from 0 to N of attributes for various cols.  The name is how to reference in subject.getAttribute()
subjectApi.source.pennperson.param.subjectAttributeCol3.value = first_name

# you can count up from 0 to N of attributes for various cols.  The name is how to reference in subject.getAttribute()
subjectApi.source.pennperson.param.subjectAttributeName3.value = FIRST_NAME

# now you can count up from 0 to N of attributes for various cols.  The name is how to reference in subject.getAttribute()
subjectApi.source.pennperson.param.subjectAttributeCol4.value = last_name

# you can count up from 0 to N of attributes for various cols.  The name is how to reference in subject.getAttribute()
subjectApi.source.pennperson.param.subjectAttributeName4.value = LAST_NAME

# now you can count up from 0 to N of attributes for various cols.  The name is how to reference in subject.getAttribute()
subjectApi.source.pennperson.param.subjectAttributeCol5.value = email_public

# you can count up from 0 to N of attributes for various cols.  The name is how to reference in subject.getAttribute()
subjectApi.source.pennperson.param.subjectAttributeName5.value = EMAIL_PUBLIC

# now you can count up from 0 to N of attributes for various cols.  The name is how to reference in subject.getAttribute()
subjectApi.source.pennperson.param.subjectAttributeCol6.value = name_first_public

# you can count up from 0 to N of attributes for various cols.  The name is how to reference in subject.getAttribute()
subjectApi.source.pennperson.param.subjectAttributeName6.value = NAME_FIRST_PUBLIC

# now you can count up from 0 to N of attributes for various cols.  The name is how to reference in subject.getAttribute()
subjectApi.source.pennperson.param.subjectAttributeCol7.value = name_last_public

# you can count up from 0 to N of attributes for various cols.  The name is how to reference in subject.getAttribute()
subjectApi.source.pennperson.param.subjectAttributeName7.value = NAME_LAST_PUBLIC

# now you can count up from 0 to N of attributes for various cols.  The name is how to reference in subject.getAttribute()
subjectApi.source.pennperson.param.subjectAttributeCol8.value = name_public

# you can count up from 0 to N of attributes for various cols.  The name is how to reference in subject.getAttribute()
subjectApi.source.pennperson.param.subjectAttributeName8.value = NAME_PUBLIC

# now you can count up from 0 to N of attributes for various cols.  The name is how to reference in subject.getAttribute()
subjectApi.source.pennperson.param.subjectAttributeCol9.value = preferred_first_name

# you can count up from 0 to N of attributes for various cols.  The name is how to reference in subject.getAttribute()
subjectApi.source.pennperson.param.subjectAttributeName9.value = PREFERRED_FIRST_NAME

# now you can count up from 0 to N of attributes for various cols.  The name is how to reference in subject.getAttribute()
subjectApi.source.pennperson.param.subjectAttributeCol10.value = description_lower

# you can count up from 0 to N of attributes for various cols.  The name is how to reference in subject.getAttribute()
subjectApi.source.pennperson.param.subjectAttributeName10.value = DESCRIPTION_LOWER

# the 1st sort attribute for lists on screen that are derived from member table (e.g. search for member in group)
# you can have up to 5 sort attributes 
subjectApi.source.pennperson.param.sortAttribute0.value = DESCRIPTION_LOWER

# the 2nd sort attribute for lists on screen that are derived from member table (e.g. search for member in group)
# you can have up to 5 sort attributes 
subjectApi.source.pennperson.param.sortAttribute1.value = LAST_NAME

# the 1st search attribute for lists on screen that are derived from member table (e.g. search for member in group)
# you can have up to 5 search attributes 
subjectApi.source.pennperson.param.searchAttribute0.value = DESCRIPTION_LOWER



Configuration sources.xml

Here is out config in the sources.xml

Code Block
 <source adapterClass="edu.internet2.middleware.subject.provider.JDBCSourceAdapter2">
    <id>pennperson</id>
    <name>Penn person</name>
     <type>person</type>
     <!-- init-param>
       <param-name>maxResults</param-name>
       <param-value>1000</param-value>
     </init-param -->
    <!-- on a findPage() this is the most results returned --> 
    <init-param>
      <param-name>maxPageSize</param-name>
      <param-value>100</param-value>
    </init-param>
     <init-param>
       <param-name>jdbcConnectionProvider</param-name>
       <param-value>edu.internet2.middleware.grouper.subj.GrouperJdbcConnectionProvider</param-value>
     </init-param>
      <init-param>
       <param-name>dbTableOrView</param-name>
       <param-value>person_source_v</param-value>
     </init-param>
      <init-param>
       <param-name>subjectIdCol</param-name>
       <param-value>penn_id</param-value>
     </init-param>
     <init-param>
       <param-name>nameCol</param-name>
       <param-value>name</param-value>
     </init-param>
     <init-param>
       <param-name>descriptionCol</param-name>
       <param-value>description</param-value>
     </init-param>
     <init-param>
       <!-- search col where general searches take place, lower case -->
       <param-name>lowerSearchCol</param-name>
       <param-value>description_lower</param-value>
     </init-param>
     <init-param>
       <!-- optional col if you want the search results sorted in the API (note, UI might override) -->
       <param-name>defaultSortCol</param-name>
       <param-value>description</param-value>
     </init-param>
     <init-param>
       <!-- col which identifies the row, perhaps not subjectId -->
       <param-name>subjectIdentifierCol0</param-name>
       <param-value>pennname</param-value>
     </init-param>
     <init-param>
       <param-name>subjectIdentifierCol1</param-name>
       <param-value>penn_id</param-value>
     </init-param>
     <init-param>
       <param-name>subjectIdentifierCol2</param-name>
       <param-value>eppn</param-value>
     </init-param>
     <!-- now you can count up from 0 to N of attributes for various cols -->
     <init-param>
       <param-name>subjectAttributeCol0</param-name>
       <param-value>pennname</param-value>
     </init-param>
     <init-param>
       <param-name>subjectAttributeName0</param-name>
       <param-value>PENNNAME</param-value>
     </init-param>
     <init-param>
       <param-name>subjectAttributeCol1</param-name>
       <param-value>email</param-value>
     </init-param>
     <init-param>
       <param-name>subjectAttributeName1</param-name>
       <param-value>EMAIL</param-value>
     </init-param>
     <init-param>
       <param-name>subjectAttributeCol2</param-name>
       <param-value>eppn</param-value>
     </init-param>
     <init-param>
       <param-name>subjectAttributeName2</param-name>
       <param-value>EPPN</param-value>
     </init-param>

     <init-param>
       <param-name>subjectAttributeCol3</param-name>
       <param-value>first_name</param-value>
     </init-param>
     <init-param>
       <param-name>subjectAttributeName3</param-name>
       <param-value>FIRST_NAME</param-value>
     </init-param>

     <init-param>
       <param-name>subjectAttributeCol4</param-name>
       <param-value>last_name</param-value>
     </init-param>
     <init-param>
       <param-name>subjectAttributeName4</param-name>
       <param-value>LAST_NAME</param-value>
     </init-param>

     <init-param>
       <param-name>subjectAttributeCol5</param-name>
       <param-value>email_public</param-value>
     </init-param>
     <init-param>
       <param-name>subjectAttributeName5</param-name>
       <param-value>EMAIL_PUBLIC</param-value>
     </init-param>

     <init-param>
       <param-name>subjectAttributeCol6</param-name>
       <param-value>name_first_public</param-value>
     </init-param>
     <init-param>
       <param-name>subjectAttributeName6</param-name>
       <param-value>NAME_FIRST_PUBLIC</param-value>
     </init-param>

     <init-param>
       <param-name>subjectAttributeCol7</param-name>
       <param-value>name_last_public</param-value>
     </init-param>
     <init-param>
       <param-name>subjectAttributeName7</param-name>
       <param-value>NAME_LAST_PUBLIC</param-value>
     </init-param>

     <init-param>
       <param-name>subjectAttributeCol8</param-name>
       <param-value>name_public</param-value>
     </init-param>
     <init-param>
       <param-name>subjectAttributeName8</param-name>
       <param-value>NAME_PUBLIC</param-value>
     </init-param>

     <init-param>
       <param-name>subjectAttributeCol9</param-name>
       <param-value>preferred_first_name</param-value>
     </init-param>
     <init-param>
       <param-name>subjectAttributeName9</param-name>
       <param-value>PREFERRED_FIRST_NAME</param-value>
     </init-param>

     <init-param>
       <param-name>subjectAttributeCol10</param-name>
       <param-value>description_lower</param-value>
     </init-param>
     <init-param>
       <param-name>subjectAttributeName10</param-name>
       <param-value>DESCRIPTION_LOWER</param-value>
     </init-param>

     <init-param>
       <param-name>sortAttribute0</param-name>
       <param-value>DESCRIPTION_LOWER</param-value>
     </init-param>
     <init-param>
       <param-name>sortAttribute1</param-name>
       <param-value>LAST_NAME</param-value>
     </init-param>

     <init-param>
       <param-name>searchAttribute0</param-name>
       <param-value>DESCRIPTION_LOWER</param-value>
     </init-param>

   </source>

sfd