Skip to Content.
Sympa Menu

grouper-users - Re: [grouper-users] Grouper Loader - Create reference groups from SQL rows?

Subject: Grouper Users - Open Discussion List

List archive

Re: [grouper-users] Grouper Loader - Create reference groups from SQL rows?


Chronological Thread 
  • From: John Schrader <>
  • To:
  • Cc: ,
  • Subject: Re: [grouper-users] Grouper Loader - Create reference groups from SQL rows?
  • Date: Fri, 13 Jul 2018 15:58:42 -0400
  • Ironport-phdr: 9a23:4EohTR/YPsNc8v9uRHKM819IXTAuvvDOBiVQ1KB41u8cTK2v8tzYMVDF4r011RmVBduds6oMotGVmpioYXYH75eFvSJKW713fDhBt/8rmRc9CtWOE0zxIa2iRSU7GMNfSA0tpCnjYgBaF8nkelLdvGC54yIMFRXjLwp1Ifn+FpLPg8it2O2+55zebx9UiDahfLh/MAi4oQLNu8cMnIBsMLwxyhzHontJf+RZ22ZlLk+Nkhj/+8m94odt/zxftPw9+cFAV776f7kjQrxDEDsmKWE169b1uhTFUACC+2ETUmQSkhpPHgjF8BT3VYr/vyfmquZw3jSRMMvrRr42RDui9b9mRxDmiCgFNzA3/mLZhNFugq1Hux+uvQBzzpTObY2JKPZzfKXQds4aS2pbWcZRUjRMDIe7b4sPCeoKIPtWoJX9p1sUtxSxGBejBPnywTJPgnH22q060+I7HQ/bwAMgH8gOv27Jo9rrLqcfSua1w7TSwTrdcvxWxC7w5Y7VeR4iufGBRax8fMvNxUQtEg7FgFadppf5Mz6Q2ekBr3SX4/dlWO2zl2IosAR8rz2xyssyjoTEgJ8exEre+iVj2ok1IMW1SE5lbt6gF5tdrySaOJF3QsMmWm1ouTo6xqEftZ+0YiQG1pAqywTQa/yAdIiI7RbjW/iLLThkg3Jlfaqzhxe08Ue+1u3xTte43VdWoidHl9TMuHMA2AfP5sWCRfZx4lut1SuK2g/P9u1LOkU5mK/FJ5I/xrM8jp8Tvl7CHi/ylkX2lqiWdkA89+iq8OTofrXmpoWGOIBphQzzKaIuldGlDesmLwcOQnCX+f6g27374U35XLJKg+U5kqnDt5DaONwbqbCjAwNMz4Yj8AiwDy290NkDmXkHLUlFeA6cj4T3IV3OIfb4DeuhjFS2ljdk2ezGMqP7DprTM3fDjeSpQbEo9EdYxAAywNt345taA6AMPO7+HEL9qY/2FBg8Zi6zw+CvM959zIoSVHjHVo2eMKWUilSI/OsjLvOkYoNTtTrgfat2r8XyhGM0zAdONZKi2oEaPSi1

fwiw ND has a structure:

etc:loader:banner:{a_group_that_represents_the_SQL_GROUP_LIST}
The loader attributes are set on this group.

We also use the grouperLoaderGroupQuery attribute (a distinct list of groups to load)

# This loader job will create and load orgCode reference groups from blablabla.

grouperSession = GrouperSession.startRootSession();
addGroup("etc:loader:banner", "orgCodes", "orgCodes");
cloaderGroup = GroupFinder.findByName(grouperSession, "etc:loader:banner:orgCodes");
groupAddType(cloaderGroup.name, "grouperLoader");
setGroupAttr(cloaderGroup.name, "grouperLoaderDbName", "banner");

setGroupAttr(cloaderGroup.name, "grouperLoaderGroupQuery", "SELECT DISTINCT lower('nd:basis:banner:employee:orgcode:' || ORGN_LEVEL_8) AS GROUP_NAME, ORGN_LEVEL_8_TITLE AS GROUP_DESCRIPTION FROM bla bla bla WHERE BLA");
setGroupAttr(cloaderGroup.name, "grouperLoaderQuery", "SELECT lower('nd:basis:banner:employee:orgcode:' || ORGN_LEVEL_8) AS GROUP_NAME, NDID AS SUBJECT_IDENTIFIER, 'nd' AS SUBJECT_SOURCE_ID FROM bla bla bla WHERE BLA");

setGroupAttr(cloaderGroup.name, "grouperLoaderType", "SQL_GROUP_LIST");

setGroupAttr(cloaderGroup.name, "grouperLoaderQuartzCron", "02 45 11,22 * * ?");
setGroupAttr(cloaderGroup.name, "grouperLoaderScheduleType", "CRON");

loaderRunOneJob(cloaderGroup);


Happy Friday !
-John






On Fri, Jul 13, 2018 at 3:51 PM Carl Waldbieser <> wrote:
Michael,

Thanks-- I think I get it, except-- what do you assign the LoaderType properties on?  The stem?  Some random group?

Thanks,
Carl Waldbieser
ITS Identity Management
Lafayette College

----- Original Message -----
From: "Michael Gettes" <>
To: "waldbiec" <>
Cc: "grouper-users" <>
Sent: Friday, 13 July, 2018 15:36:34
Subject: Re: [grouper-users] Grouper Loader - Create reference groups from SQL rows?

Change your SQL to do the following:

SELECT SUBJECT_ID, ‘Stem1:Stem2:’||grpname as GROUP_NAME
From tables
Where conditions;

And configure this as Loadertype SQL_GROUP_LIST and you’re done.

Later you can do things like SELECT SUBJECT_ID, ‘basis:byDept:’||DeptID||’:Staff:’StaffLevel as GROUP_NAME and now you are creating multi-level groups.  Be sure to set things such as 'Groups like sql part’  and 'Group query (metadata on groups)’ as needed.

A single SQL query with a loader job can generate 10s of thousands of groups.  Did this at PSU and managed 90,000 course groups in 1 hour daily run.

Happy to discuss by phone if you wish.

/mrg

On Jul 13, 2018, at 3:08 PM, Carl Waldbieser <<mailto:>> wrote:


I have rows coming from a SQL connection like this:

  SUBJECT_ID  GROUP_NAME
  ==========  ==========
  subject-A   group-1
  subject-B   group-1
  subject-C   group-2
  subject-D   group-1
  ...

I'd like the loader to create "group-1" and "group-2" and "group-N" in a particular stem and populate the memberships, but I'm unsure if (1) the loader can do that, and (2) how to configure the loader to do that if it is possible.

Any pointers would be great!

Thanks,
Carl Waldbieser
ITS Identity Management
Lafayette College


--
John Schrader
Identity and Access Management
Office of Information Technologies
University of Notre Dame

EVERYTHING SHOULD BE MADE AS SIMPLE AS POSSIBLE, BUT NOT ANY SIMPLER
—ALBERT EINSTEIN



Archive powered by MHonArc 2.6.19.

Top of Page