Skip to Content.
Sympa Menu

grouper-users - [grouper-users] Re: grouper UI validation

Subject: Grouper Users - Open Discussion List

List archive

[grouper-users] Re: grouper UI validation


Chronological Thread 
  • From: Rahul Doshi <>
  • To: "" <>
  • Subject: [grouper-users] Re: grouper UI validation
  • Date: Fri, 26 Jun 2015 15:19:34 +0000
  • Accept-language: en-US

This looks more complex then I thought.  I would very much appreciate complete hook if offer still stands.

Thanks,
Rahul

From: Chris Hyzer <>
Date: Friday, June 26, 2015 at 11:16 AM
To: Rahul Doshi <>, "" <>
Subject: RE: grouper UI validation

Theres two ways to query.  Might be best for performance to find the parent stem and look for extensions in that stem

 

    String parentFolderName = GrouperUtil.parentStemNameFromName(someName);

   

    Stem parentStem = StemFinder.findByName(grouperSession, parentFolderName, true);

   

    Group group = HibernateSession.byHqlStatic()

        .createQuery("select theGroup from Group theGroup "

            + "where lower(theGroup.extensionDb) = :theExtension "

            + "and theGroup.parentUuid = :stemUuid")

        .setString("theExtension", StringUtils.defaultString(GrouperUtil.extensionFromName(someName)).toLowerCase())

        .setString("stemUuid", parentStem.getId())

        .uniqueResult(Group.class);

 

 

 

Otherwise you can just do a case insensitive search for that full path.  If you have performance problems you might need a function based index on lower name

 

    Group group = HibernateSession.byHqlStatic()

        .createQuery("select theGroup from Group theGroup where lower(theGroup.nameDb) = :theName")

        .setString("theName", StringUtils.defaultString(someName).toLowerCase()).uniqueResult(Group.class);

 

 

From: Rahul Doshi []
Sent: Friday, June 26, 2015 10:51 AM
To: Chris Hyzer;
Subject: Re: grouper UI validation

 

Folders are ok.  I will take a look at hooks.example and will let you know if I am stuck.

 

Thanks,

Rahul

 

From: Chris Hyzer <>
Date: Friday, June 26, 2015 at 10:46 AM
To: Rahul Doshi <>, "" <>
Subject: RE: grouper UI validation

 

You would need a hook to veto conflicts.  There are examples in the hooks.examples package or I could write one for you if you like, let me know.  Do you want it to also not allow folders with a group name too (theres an example of that in there but its not case insensitive)?

 

Thanks,

Chris

 

From: [] On Behalf Of Rahul Doshi
Sent: Friday, June 26, 2015 9:56 AM
To:
Subject: [grouper-users] grouper UI validation

 

Hello,

 

We are moving from case insensitive to case sensitive database and one thing we need to do as part of it is put a validation to avoid creating duplicate group names.  For example users should not be able to create group Apps:TEST and Apps:test.   Any suggestions on best way to implement this?

 

Thanks,

Rahul




Archive powered by MHonArc 2.6.16.

Top of Page