Skip to Content.
Sympa Menu

grouper-users - RE: [grouper-users] attribute framework questions

Subject: Grouper Users - Open Discussion List

List archive

RE: [grouper-users] attribute framework questions


Chronological Thread 
  • From: Chris Hyzer <>
  • To: Scott Koranda <>, "" <>
  • Subject: RE: [grouper-users] attribute framework questions
  • Date: Sat, 9 Oct 2010 08:42:48 -0400
  • Accept-language: en-US
  • Acceptlanguage: en-US

Good questions, I updated the wiki with the answers below. Feel free to ask
any others as they arise...

Chris


>
> 1) Am I correct that I can use Grouper WS to assign attributes
> (and values) and query on attributes (and values) but I cannot
> use WS to define attributes?

There are web services for assigning or unassigning attributes and values,
and for reading attributes and values, but not for defining attributes (yet).

Assign/unassign attributes/values web service 
https://spaces.internet2.edu/display/GrouperWG/Assign+Attributes

Read attributes/values web service 
https://spaces.internet2.edu/display/GrouperWG/Get+Attribute+Assignments

>
> Consider on this page
>
> https://spaces.internet2.edu/display/GrouperWG/Grouper+attribute+framework
>
> this snippet of GSH code:
>
> addRootStem("school","school");
> addStem("school", "attr", "attr");
> addStem("school:attr", "students", "students");
> grouperSession = GrouperSession.startRootSession();
> attrStudentsStem = StemFinder.findByName(grouperSession,
> "school:attr:students");
> studentsAttrDef = attrStudentsStem.addChildAttributeDef("students",
> AttributeDefType.attr);
> studentsAttrDef.setAssignToGroup(true);
> studentsAttrDef.store();
>
> 2) In the line
>
> studentsAttrDef = attrStudentsStem.addChildAttributeDef("students",
> AttributeDefType.attr);
>
> what precisely is the first argument to addChildAttributeDef()?
>
> Is the second argument boilerplate, or can it take different
> values?

//this line will add an attribute definition in this stem, with the name
"students"
//the AttributeDefType is the type of attribute def. The possible values are
in the AttributeDefType
//class: attr, domain, limit, perm, type. Perm means permission. In the
future you could
//put a domain on objects to group them together in an application. Limit
also could be permissions related.
//type means a marker which doesnt have a value.
//
http://www.internet2.edu/grouper/release/1.6.0/doc/api/edu/internet2/middleware/grouper/attr/AttributeDefType.html

>
> 3) With the line
>
> studentsAttrDef.setAssignToGroup(true);
>
> what precisely does setAssignToGroup() do and why do I want or
> need to call it with argument 'true'?

//this line configures where this attribute can be assigned. In this case
the attribute can be
//assigned to groups, but not to stems, members, etc. Note, you can call
multiple, and the same attribute can be assigned to multiple types. Here are
the possible values:
// void setAssignToAttributeDef(boolean assignToAttributeDef)
// if can assign to attribute def
// void setAssignToAttributeDefAssn(boolean assignToAttributeDefAssn)
// allowed to assign to an attribute definition assignment
// void setAssignToEffMembership(boolean assignToEffMembership)
// if can assign to effective membership
// void setAssignToEffMembershipAssn(boolean
assignToEffMembershipAssn)
// allowed to assign to an effective membership assignment
// void setAssignToGroup(boolean assignToGroup)
// if can assign to group/role
// void setAssignToGroupAssn(boolean assignToGroupAssn)
// if can assign to assignment of group/role
// void setAssignToImmMembership(boolean assignToImmMembership)
// if can assign to immediate membership
// void setAssignToImmMembershipAssn(boolean
assignToImmMembershipAssn)
// allowed to assign to an immediate membership assignment
// void setAssignToMember(boolean assignToMember)
// if can assign to member
// void setAssignToMemberAssn(boolean assignToMemberAssn)
// allowed to assign to a member assignment
// void setAssignToStem(boolean assignToStem)
// if can assign to stem
// void setAssignToStemAssn(boolean assignToStemAssn)
// allowed to assign to a stem assignment
//http://www.internet2.edu/grouper/release/1.6.0/doc/api/edu/internet2/middleware/grouper/attr/AttributeDef.html

>
> 4) Is the line
>
> studentsAttrDef.store();
>
> necessary? Why?

Yes, definitely necessary,

//store the configuration to the DB


>
> Consider from that same page the GSH command
>
> attrArtsAndSciences =
> attrStudentsStem.addChildAttributeDefName(studentsAttrDef,
> "artsAndSciences", "artsAndSciences");
>
> 5) After I create an attribute definition, is it necessary that
> I also create an attribute definition name?
>
> If it is not necessary, why might I want to do it?

Attribute def names are what are actually assigned to the owner object. So
these are necessary to create. You might only have one attribute def name
for an attribute def, or you might have multiple. Having multiple on a
marker attribute (no value) is useful to simulate a list of values (e.g. for
permissions). Having multiple for non marker attributes is useful because
the same configuration of the attribute def is shared among all the attribute
def names. The attribute def names have no configuration for themselves, it
is all from the attribute def.

>
> Thanks,
>
> Scott
>



Archive powered by MHonArc 2.6.16.

Top of Page