Skip to Content.
Sympa Menu

grouper-users - RE: [grouper-users] creating empty groups from an SQL source

Subject: Grouper Users - Open Discussion List

List archive

RE: [grouper-users] creating empty groups from an SQL source


Chronological Thread 
  • From: "Hyzer, Chris" <>
  • To: Jeff McCullough <>, Shilen Patel <>
  • Cc: Gouper Users List <>
  • Subject: RE: [grouper-users] creating empty groups from an SQL source
  • Date: Mon, 10 Oct 2016 18:45:13 +0000
  • Accept-language: en-US
  • Authentication-results: spf=none (sender IP is ) ;
  • Ironport-phdr: 9a23:k/VnOxBrSyh/SMPxNHPuUyQJP3N1i/DPJgcQr6AfoPdwSP74ocbcNUDSrc9gkEXOFd2Crakb26yL6Ou5BCQp2tWojjMrSNR0TRgLiMEbzUQLIfWuLgnFFsPsdDEwB89YVVVorDmROElRH9viNRWJ+iXhpRZbIBj0NBJ0K+LpAcaSyp3vj6Hhs6HUNidFijT1RLhZMRGyqhjetoFCg4ZsJKM64hHEuHhFf+lHg25kOATX1y3858O9+tZb+jhdv7p17M5BVaj8V6glTrEeATg7ZTMb/sru4FPjXBmC/D9UeWUMkwECS1zA5xHrTJrrmirhvaxgwCScO4v7Qa1iCmfq1LtiVBK90HRPDDU+6myCz5Uo1K8=
  • Spamdiagnosticmetadata: NSPM
  • Spamdiagnosticoutput: 1:99

You need the grouperLoaderQuery to return no rows.  Then see if the grouperLoaderGroupQuery will create the empty groups.  Note, this will remove all members from those groups obviously.  Is this a one time load or ongoing?  If one time, maybe make a GSH script from SQL, detailed from GSH wiki page.  If ongoing, and you want groups members to be removed, then keep going with grouper loader.  If you want ongoing and members to stay intact, then it is a little more interesting.  You need a grouperLoaderQuery to return the grouper members of groups i.e. a select with where clause from grouper_memberships_lw_v, know what I mean?  J  And cross your fingers for no race conditions J

 

Thanks

Chris

 

 

From: [mailto:] On Behalf Of Jeff McCullough
Sent: Monday, October 10, 2016 2:40 PM
To: Shilen Patel <>
Cc: Gouper Users List <>
Subject: Re: [grouper-users] creating empty groups from an SQL source

 

I had thought that might be possible, but tried moving the select from grouperLoaderQuery to grouperLoaderGroupQuery. 

 

 

I get this error:

 

// Error: unable to evaluate command: Sourced file: inline evaluation of: ``loaderRunOneJob(group);'' : Error invoking compiled command: : Error in compiled command: java.lang.RuntimeException: java.lang.RuntimeException: Invalid query, must start with select:  order by group_name



java.lang.RuntimeException: Invalid query, must start with select:  order by group_name

        at edu.internet2.middleware.grouper.app.loader.db.GrouperLoaderResultset.<init>(GrouperLoaderResultset.java:404)



-------

        if (!query.toLowerCase().trim().startsWith("select")) {

                throw new RuntimeException("Invalid query, must start with select: " + query);

        }

———



I realized after a bit that what it means is that there isn’t a select statement in grouperLoaderQuery. As I read further, the grouperLoaderGroupQuery appeared to be an additional query that was only used as a way to add more descriptive information as well as permissions to the group. Given that, I went back to trying to find a way to load the empty groups independently of the grouperLoaderGroupQuery. If grouperLoaderGroupQuery is the way to do it, then I’m still missing what select statement needs to go in the grouperLoaderQuery?

 

Thank you,

Jeff

 

On Oct 10, 2016, at 5:07 AM, Shilen Patel <> wrote:

 

You should be able to do it by specifying a grouperLoaderGroupQuery that contains all the groups.

 

 

Thanks!

 

- Shilen

 

On 10/9/16, 11:59 PM, "Jeff McCullough" <> wrote:

 

I’ve been playing around with SQL_SIMPLE and GROUP_LIST for grouper loader connections. I’d like to create a list of title code groups that are empty to start, and then some are populated with current accounts. The empty to start part is necessary for creating title code groups for various jobs on campus. Some of the title codes are not currently being used, but they may in the future. We want to create title code based nested groups for various job types. We are hoping to hand this off to the HR group, since they are the authorities as title code groupings may change over time. They will want to add all the nested title code groups at once rather than having to worry about adding them later when someone new is using a previously unused title code.

 

I can’t see a easy way to directly create them besides using SQL_GROUP_LIST and using a select statement like:

 

select ‘0’ as subject_id, group_name, etc…

 

against a view that has a list of all possible title codes. The ‘0’ is unresolved, but it does create an empty group. Is there another way to do this? I haven’t seen it in the documentation, though there are discussions about creating org trees and class lists of nested groups. Maybe I’m missing the obvious. Who knows.

 

Thanks,

Jeff

 




Archive powered by MHonArc 2.6.19.

Top of Page