Versions Compared

Key

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

...

Expand

Create and configure the grouper-hibernate.properties for postgres (for example)

  1. cd grouper/conf
  2. cp .../misc/grouper.hibernate.example.properties grouper.hibernate.properties
  3. edit grouper.hibernate.properties to look like the following:


Example for HSQL database: make a file grouper/conf/grouper.hibernate.properties:


Code Block
########################################
## DB settings
########################################

# e.g. mysql:           jdbc:mysql://localhost:3306/grouper?useSSL=false
# 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/grouper
# e.g. postgres:        jdbc:postgresql://localhost:5432/database
# e.g. mssql:           jdbc:sqlserver://localhost:3280;databaseName=grouper
hibernate.connection.url = jdbc:hsqldb:hsql://localhost:9001/grouper

hibernate.connection.username         = sa
# If you are using an empty password, depending upon your version of
# Java and Ant you may need to specify a password of "".
# Note: you can keep passwords external and encrypted: https://bugs.internet2.edu/jira/browse/GRP-122
hibernate.connection.password         = 

Create and configure morphString.properties

  1. cd grouper/conf
  2. cp .../misc/morphString.example.properties morphString.properties  
  3. Edit .../grouper/grouper/conf/morphString.properties
  4. encrypt.key = not_a_random_key
  • Make a file grouper/conf/morphString.properties  (make up an encrypt.key or generate alphanumeric from password generator)


Code Block
########################################
## Encryption configuration
########################################

# Put a random alphanumeric string (Case sensitive) for the password encryption.  e.g. fh43IRJ4Nf5jn4Qp9k2
# or put a filename where the random alphanumeric string is.  e.g. c:/whatever/key.txt
# use encrypt.key.elConfig instead if the config has an expression language scriptlet
encrypt.key = abcndme45jg32fj32JNdQ23

  • Copy grouper/conf/log4j.example.properties to log4j.properties
  • Make a grouper/conf/subject.properties

    Code Block
    ########################################
    
    # 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: jdbc
    ## Source configName: jdbc
    #########################################
    subjectApi.source.jdbc.id = jdbc
    
    # this is a friendly name for the source
    subjectApi.source.jdbc.name = Example JDBC Source Adapter
    
    # type is not used all that much.  Can have multiple types, comma separate.  Can be person, group, application
    subjectApi.source.jdbc.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.jdbc.adapterClass = edu.internet2.middleware.grouper.subj.GrouperJdbcSourceAdapter
    
    subjectApi.source.jdbc.param.jdbcConnectionProvider.value = edu.internet2.middleware.grouper.subj.GrouperJdbcConnectionProvider
    
    subjectApi.source.jdbc.param.emailAttributeName.value = email
    
    # maximum number of results from a search, generally no need to get more than 1000
    subjectApi.source.jdbc.param.maxResults.value = 1000
    
    subjectApi.source.jdbc.param.maxPageSize.value = 100
    
    # ldap attribute which is the subject id.  e.g. exampleEduRegID   Each subject has one and only one subject id.  Generally it is opaque and permanent.
    subjectApi.source.jdbc.param.SubjectID_AttributeType.value = id
    
    # attribute which is the subject name
    subjectApi.source.jdbc.param.Name_AttributeType.value = name
    
    # attribute which is the subject description
    subjectApi.source.jdbc.param.Description_AttributeType.value = description
    
    # This virtual attribute index 0 is accessible via: subject.getAttributeValue("searchAttribute0");
    subjectApi.source.jdbc.param.subjectVirtualAttribute_0_searchAttribute0.value = ${subject.name},${subjectUtils.defaultIfBlank(subject.getAttributeValue('LFNAME'), "")},${subjectUtils.defaultIfBlank(subject.getAttributeValue('LOGINID'), "")},${subjectUtils.defaultIfBlank(subject.description, "")},${subjectUtils.defaultIfBlank(subject.getAttributeValue('EMAIL'), "")}
    
    # 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.jdbc.param.sortAttribute0.value = LFNAME
    
    # 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.jdbc.param.sortAttribute1.value = LOGINID
    
    # 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.jdbc.param.searchAttribute0.value = searchAttribute0
    
    subjectApi.source.jdbc.param.useInClauseForIdAndIdentifier.value = true
    
    subjectApi.source.jdbc.param.identifierAttributes.value = LOGINID
    
    # subject identifier to store in grouper's member table.  this is used to increase speed of loader and perhaps for provisioning
    # you can have up to max 1 subject identifier
    subjectApi.source.jdbc.param.subjectIdentifierAttribute0.value = LOGINID
    
    #searchSubject: find a subject by ID.  ID is generally an opaque and permanent identifier, e.g. 12345678.
    #  Each subject has one and only on ID.  Returns one result when searching for one ID.
    
    # sql is the sql to search for the subject by id should use an {inclause}
    subjectApi.source.jdbc.search.searchSubject.param.sql.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}
    
    # inclause allows searching by subject for multiple ids or identifiers in one query, must have {inclause} in the sql query,
    #    this will be subsituted to in clause with the following.  Should use a question mark ? for bind variable
    subjectApi.source.jdbc.search.searchSubject.param.inclause.value = s.subjectid = ?
    
    #searchSubjectByIdentifier: find a subject by identifier.  Identifier is anything that uniquely
    #  identifies the user, e.g. jsmith or jsmith@institution.edu.
    #  Subjects can have multiple identifiers.  Note: it is nice to have if identifiers are unique
    #  even across sources.  Returns one result when searching for one identifier.
    
    # sql is the sql to search for the subject by identifier should use an {inclause}
    subjectApi.source.jdbc.search.searchSubjectByIdentifier.param.sql.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, subjectattribute a where    a.name='loginid' and s.subjectid = a.subjectid and {inclause}
    
    # inclause allows searching by subject for multiple ids or identifiers in one query, must have {inclause} in the sql query,
    #    this will be subsituted to in clause with the following.  Should use a question mark ? for bind variable
    subjectApi.source.jdbc.search.searchSubjectByIdentifier.param.inclause.value = a.value = ?
    
    #   search: find subjects by free form search.  Returns multiple results.
    
    # sql is the sql to search for the subject free-form search.  user question marks for bind variables
    subjectApi.source.jdbc.search.search.param.sql.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(?,'%'))    )
    
    # internal attributes are used by grouper only not exposed to code that uses subjects.  comma separated
    subjectApi.source.jdbc.internalAttributes = searchAttribute0
    
    
    


  • Make a grouper/conf/grouper.properties and add

    Code Block
    grouper.dev.env.allowMissingServlets = true



Code Block
groovy:000> :gshFileLoad 'D:\mchyzer\git\grouper_v2_5\grouper\temp\addUser.gsh'
===> 8d2b86db8f2541f181d862af1aa3c6c3,'GrouperSystem','application'
===> edu.internet2.middleware.grouper.authentication.GrouperPasswordSave@738a39cc
===> edu.internet2.middleware.grouper.authentication.GrouperPasswordSave@738a39cc
===> edu.internet2.middleware.grouper.authentication.GrouperPasswordSave@738a39cc
===> null
groovy:000> :exit


...