Skip to Content.
Sympa Menu

grouper-users - [grouper-users] RE: Query question answers 1 &2

Subject: Grouper Users - Open Discussion List

List archive

[grouper-users] RE: Query question answers 1 &2


Chronological Thread 
  • From: Chris Hyzer <>
  • To: Alan Rothenbush <>
  • Cc: "" <>
  • Subject: [grouper-users] RE: Query question answers 1 &2
  • Date: Mon, 30 Nov 2015 03:54:34 +0000
  • Accept-language: en-US

You have types, you have attributes, and you have values.

First off try to add the types to the groups that need it:

Make a text file that has:

grouperSession = GrouperSession.startRootSession();
groupAddType("a:b:c", "sfuIsADGroup");
groupAddType("a:b:d", "sfuIsADGroup");
groupAddType("a:b:c", "sfuIsSADGroup");
groupAddType("a:b:d", "sfuIsSADGroup");

You can make a script to create the file however you want, excel formulas
work, or a SQL can generate it e.g.

select concat('groupAddType("', groupAlias.NAME, '", "sfuIsADGroup");' as
script
from some query that returns the groups you want;

Then you need to do a similar thing for attributes:

setGroupAttr("a:b:c", "attrName", "");

Then run this script with:

gsh filename.gsh (or whatever name is)

ok?

Thanks,
Chris


-----Original Message-----
From: Alan Rothenbush
[mailto:]

Sent: Sunday, November 29, 2015 10:39 PM
To: Chris Hyzer
Subject: Re: Query question answers 1 &2

MySQL.

----- Original Message -----
> From: "Chris Hyzer"
> <>
> To: "Alan Rothenbush"
> <>
> Sent: Sunday, November 29, 2015 7:38:01 PM
> Subject: RE: Query question answers 1 &2
>
> Remind me what type of database you use?
>
> -----Original Message-----
> From: Alan Rothenbush
> [mailto:]
> Sent: Sunday, November 29, 2015 10:22 PM
> To: Chris Hyzer
> Subject: Re: Query question answers 1 &2
>
> Here's a query for two groups that "mirror" lists in our maillist system.
> Both are supposed to have the IsSAD and IsAD attribute set, but only one
> does.
>
>
> SELECT * FROM grouper_fields
> LEFT OUTER JOIN grouper_attributes ON grouper_attributes.field_id =
> grouper_fields.id
> LEFT OUTER JOIN grouper_groups ON grouper_attributes.group_id =
> grouper_groups.id
> WHERE grouper_groups.name = "maillist:a:at-class-admins" OR
> grouper_groups.name = "maillist:a:acs-ots";
>
>
> The data returned is attached.
>
>
> Alan
>
> ----- Original Message -----
> > From: "Chris Hyzer"
> > <>
> > To: "Alan Rothenbush"
> > <>
> > Sent: Sunday, November 29, 2015 7:10:17 PM
> > Subject: RE: Query question answers 1 &2
> >
> > Whats the query with joins you used to show the data? I need the fully
> > qualified attribute name, so you can send me that or the query and I will
> > tell you how to tweak the query to find out :)
> >
> > Thanks,
> > Chris
> >
> > -----Original Message-----
> > From: Alan Rothenbush
> > [mailto:]
> > Sent: Friday, November 27, 2015 11:51 AM
> > To: Chris Hyzer
> > Subject: Re: Query question answers 1 &2
> >
> > Many thanks for all the help!
> >
> > I was eventually able to figure it out, by reverse engineering the schema.
> > The SELECT needed (quite) a few JOINS, but it gave me the answer.
> >
> > Sadly, it told me what I didn't want to know, that something has "broken"
> > along the way.
> >
> >
> > In short, we've added a custom attribute, and the GROUPERLOADER sets that
> > attribute when reading its input source.
> >
> > And for years, it did exactly that, correctly setting an attribute to a
> > "1"
> > when required.
> >
> > But my query above shows that it stopped doing this somewhere along the
> > line.
> > (Not sure when.) So I have 2,000 groups with the attribute set properly
> > and another 1,200 where it SHOULD be set, but is NOT set.
> >
> > OK, well, we know which groups need setting, so do a SQL UPDATE to get us
> > back in sync; done.
> >
> > Only I can't do an UPDATE because if the attribute is not set, Grouper
> > does
> > not create a row! (To economize on space maybe?)
> >
> > So, with no row in the table to UPDATE, I need to do an INSERT before I
> > can
> > do an UPDATE.
> >
> > But an INSERT requires me to create a GUID, only I'm not sure of the
> > Grouper
> > logic to generate GUIDs, so I now have another puzzle.
> >
> >
> > The funny thing is, if I use the GUI, I can set the attribute manually and
> > the row appears with the attribute set. Remove the attribute (GUI field
> > blank) and the row is removed.
> >
> > MAYBE I can figure out from the code how the attribute row is created in
> > the
> > GUI. There sure is a lot of code to look through though ...
> >
> > <g>
> >
> >
> > Anyway, thanks again for all your assistance and your patience.
> >
> >
> >
> > Alan
> >
> >
> > ----- Original Message -----
> > > From: "Chris Hyzer"
> > > <>
> > > To: "Alan Rothenbush"
> > > <>
> > > Sent: Sunday, November 22, 2015 5:20:09 PM
> > > Subject: RE: Query question answers 1 &2
> > >
> > > Look in: grouper_groups_types_v
> > >
> > > Thanks,
> > > Chris
> > >
> > > -----Original Message-----
> > > From: Alan Rothenbush
> > > [mailto:]
> > > Sent: Friday, November 20, 2015 1:54 PM
> > > To: Chris Hyzer
> > > Subject: Re: Query question answers 1 &2
> > >
> > > Sadly, that view contains no data.
> > >
> > > Grouper is version 2.1.3, and given my limited knowledge and the mission
> > > critical nature of this otherwise running just fine service, I'm
> > > reluctant
> > > to update.
> > >
> > >
> > > Alan
> > >
> > >
> > >
> > > ----- Original Message -----
> > > > From: "Chris Hyzer"
> > > > <>
> > > > To: "Alan Rothenbush"
> > > > <>
> > > > Cc:
> > > >
> > > > Sent: Friday, November 20, 2015 9:28:51 AM
> > > > Subject: RE: Query question answers 1 &2
> > > >
> > > > If its not there remind me what version of grouper you have
> > > >
> > > > -----Original Message-----
> > > > From: Alan Rothenbush
> > > > [mailto:]
> > > > Sent: Friday, November 20, 2015 11:08 AM
> > > > To: Chris Hyzer
> > > > Subject: Re: Query question answers 1 &2
> > > >
> > > > 1. SQL is my preferred option, as the retrieved data will be processed
> > > > by
> > > > a
> > > > shell script, shell scripts and SQL being familiar to me.
> > > >
> > > > I'm actually a management type, who used to do real work way back
> > > > when,
> > > > but
> > > > with the departure of both of our Grouper people, the latest quite
> > > > suddenly
> > > > and unexpectedly, I'm now pressed into actually working again.
> > > >
> > > > Mostly, that means maintaining a well running instance, but there is
> > > > at
> > > > least
> > > > one little .. annoyance .. to be fixed.
> > > >
> > > > 2. I'm looking for all groups with the attribute set, The PCode would
> > > > look
> > > > like
> > > >
> > > > SELECT * from 'grouper_groups' where IsADGroup = '1'
> > > >
> > > > with a list of groups being returned.
> > > >
> > > >
> > > >
> > > > Alan
> > > >
> > > > --
> > > > Alan Rothenbush
> > > > IT Services
> > > > Simon Fraser University
> > > >
> > > > There is NOTHING -- absolutely nothing -- half so much worth doing
> > > > as simply messing about in boats.
> > > >
> > > >
> > >
> > > --
> > > Alan Rothenbush
> > > IT Services
> > > Simon Fraser University
> > >
> > > There is NOTHING -- absolutely nothing -- half so much worth doing
> > > as simply messing about in boats.
> > >
> > >
> >
> > --
> > Alan Rothenbush
> > IT Services
> > Simon Fraser University
> >
> > There is NOTHING -- absolutely nothing -- half so much worth doing
> > as simply messing about in boats.
> >
>
> --
> Alan Rothenbush
> IT Services
> Simon Fraser University
>
> There is NOTHING -- absolutely nothing -- half so much worth doing
> as simply messing about in boats.
>
>

--
Alan Rothenbush
IT Services
Simon Fraser University

There is NOTHING -- absolutely nothing -- half so much worth doing
as simply messing about in boats.




Archive powered by MHonArc 2.6.16.

Top of Page