grouper-users - Re: [grouper-users] WsSampleAssignAttributesRest_json.txt and values
Subject: Grouper Users - Open Discussion List
List archive
- From: Scott Koranda <>
- To: Chris Hyzer <>
- Cc: "" <>
- Subject: Re: [grouper-users] WsSampleAssignAttributesRest_json.txt and values
- Date: Fri, 15 Oct 2010 14:13:44 -0500
Hi,
> I added a sample for assigning an attribute value:
>
> https://spaces.internet2.edu/display/GrouperWG/Assign+Attributes
>
> Note the attribute def needs to have a value type (e.g. string, integer,
> etc), and whether or not multi-valued:
>
> attributeDef.setValueType(AttributeDefValueType.integer);
> attributeDef.setMultiValued(true);
> attributeDef.store();
>
> attributeAssignValueOperation is required if passing values to assign. It
> is the operation to perform for attribute value on attribute assignments:
> assign_value, add_value, remove_value, replace_values. Like the attribute
> assign operation, assign_value will assign if not there, or ignore if
> already there. add_value will add even if assigned. And replace_values
> will remove orphans not in the assign list.
> Let me know if you need more...
Thanks.
I am still, however, having problems.
I started a new GSH session and used it to prove to myself
that the attribute is defined and has the name I gave it:
gsh 1% grouperSession = GrouperSession.startRootSession();
edu.internet2.middleware.grouper.GrouperSession:
ab9bcf5e8d344e76a3db165491e7b23f,'GrouperSystem','application'
gsh 2% a =
AttributeDefNameFinder.findByName("Communities:LVC:LSC:MOU:mouFullName",
true);
edu.internet2.middleware.grouper.attr.AttributeDefName:
AttributeDefName[name=Communities:LVC:LSC:MOU:mouFullName,uuid=bf42403a350b4649862b776f3dac660f]
I think that means that the attribute is defined and ready to
use, correct?
So I then sent in this JSON via POST to
grouper-ws/servicesRest/json/v1_6_000/attributeAssignments :
{
"WsRestAssignAttributesLiteRequest":{
"actAsSubjectId":"GrouperSystem",
"attributeAssignOperation":"assign_attr",
"attributeAssignType":"stem",
"attributeAssignValueOperation":"assign_value",
"valueSystem":"University of Wisconsin-Milwaukee",
"wsAttributeDefNameName":"Communities:LVC:LSC:MOU:mouFullName",
"wsOwnerStemName":"Communities:LVC:LSC:MOU:UWM"
}
}
The idea is to give the stem Communities:LVC:LSC:MOU:UWM the
attribute Communities:LVC:LSC:MOU:mouFullName with value
'University of Wisconsin-Milwaukee'.
I received this (shortened) exception back:
edu.internet2.middleware.grouper.exception.GroupNotFoundException:
Cant find group by uuid: null
Any idea on what I am doing wrong?
Let me know if you want to see the entire stack trace or the
full JSON that came back.
Thanks,
Scott
P.S. I checked that the stem really does exist:
gsh 6% s = StemFinder.findByName(grouperSession,
"Communities:LVC:LSC:MOU:UWM", true);
stem: name='Communities:LVC:LSC:MOU:UWM'
displayName='Communities:LVC:LSC:MOU:UWM'
uuid='1e15cfc4-318f-4bc7-9b4d-27e831ae7583'
- [grouper-users] WsSampleAssignAttributesRest_json.txt and values, Scott Koranda, 10/09/2010
- RE: [grouper-users] WsSampleAssignAttributesRest_json.txt and values, Chris Hyzer, 10/11/2010
- Re: [grouper-users] WsSampleAssignAttributesRest_json.txt and values, Scott Koranda, 10/15/2010
- Re: [grouper-users] WsSampleAssignAttributesRest_json.txt and values, Scott Koranda, 10/15/2010
- RE: [grouper-users] WsSampleAssignAttributesRest_json.txt and values, Chris Hyzer, 10/15/2010
- Re: [grouper-users] WsSampleAssignAttributesRest_json.txt and values, Scott Koranda, 10/15/2010
- RE: [grouper-users] WsSampleAssignAttributesRest_json.txt and values, Chris Hyzer, 10/15/2010
- Re: [grouper-users] WsSampleAssignAttributesRest_json.txt and values, Scott Koranda, 10/15/2010
- Re: [grouper-users] WsSampleAssignAttributesRest_json.txt and values, Scott Koranda, 10/15/2010
- RE: [grouper-users] WsSampleAssignAttributesRest_json.txt and values, Chris Hyzer, 10/11/2010
Archive powered by MHonArc 2.6.16.