Skip to Content.
Sympa Menu

grouper-users - [grouper-users] trying to work with new attribute framework

Subject: Grouper Users - Open Discussion List

List archive

[grouper-users] trying to work with new attribute framework


Chronological Thread 
  • From: Jim Fox <>
  • To: grouper users list <>
  • Subject: [grouper-users] trying to work with new attribute framework
  • Date: Tue, 9 May 2017 16:38:14 -0700 (PDT)
  • Ironport-phdr: 9a23:AxcTChUgnjhF+mTQBBI2TJH14dzV8LGtZVwlr6E/grcLSJyIuqrYYx2Gt8tkgFKBZ4jH8fUM07OQ6PG/HzRaqsze+Fk5M7V0HycfjssXmwFySOWkMmbcaMDQUiohAc5ZX0Vk9XzoeWJcGcL5ekGA6ibqtW1aFRrwLxd6KfroEYDOkcu3y/qy+5rOaAlUmTaxe71/IRG0oAnLqsUan4RuJrgzxxDUvnZGZuNayH9yK1mOhRj8/MCw/JBi8yRUpf0s8tNLXLv5caolU7FWFSwqPG8p6sLlsxnDVhaP6WAHUmoKiBpIAhPK4w/8U5zsryb1rOt92C2dPc3rUbA5XCmp4ql3RBP0jioMKiU0+3/LhMNukK1boQqhpx1hzI7SfIGVL+d1cqfEcd8HWWZNQsNdWipcCY2+coQPFfIMM+hYoYfjulUArhWxCgawC+701j9EmmX70bEm3+k7Dw3L2hErEdIUsHTTqdX4LKMcUeGwzKLVzTvDaPxX0ir65YjGdRAgruqBXLxqfsrKyUkvFgXFjlqMqYziOTOZzPoCvHWG7+d5U++klm0pqxlprzSy2MshiZPFi4YVx1ze6yl0z5g5KcemREJlf9KoCIZcui6GO4dsX88vTH9ktDwkxrAItpO3ZjUGxZUpyhPZdveJaZKH4gj5W+aUOTp4hGxqeLa4hxuq9Eihxer8VtSo0FpUsCZJiMLMumoQ1x3d8MSIVOZy/lq51TaO0QDc9P1ELFgpmabFKJMt2Lo9m5oJvUjdESL6hl/6gLGIekk64uSo7v7oYrTipp+SLY90jQT+P7wgmsy4DuU1KQYPUHKA+eS81b3j+0L5QKlNjv0wiKXWro3VJdkDqq6jHwBVypoj6wq4Dzq+39QYh34HLE9deB2ZlYjlIkzOIOvmAvelmFShizNrx/HdPr39GZXBMGLPkLbnfbZh9UFc0gwzws5D555KEL0OPu/8WlKi/ODfWxAjNBGszvyvFc5wzJhWXWOUHufNP7nVrEeF/KcyOOSWf6cUvirwMf4o+6SogHMkzwwzZ66siLkWbTiWGeQud0uecVLzi8wBEGEFog04CuHmlQvRAnZoe3+uUvdktXkAA4W8ANKGH9j1jQ==


The situation.

I'm migrating from an old attribute version (1.6) to 2.3.
All groups had a group type of 'uwstd', with attribute 'contact' (among
others)
The migration created an AttributeDefName 'etc:legacy:attribute:legacyGroupType_uwstd' and and AttributeDefName 'etc:legacy:attribute:legacyAttribute_contact'.

I'm trying to work with the new attribute framework. With a converted group
I get:

gsh 1% root=GrouperSession.startRootSession()

that was OK

gsh 2% g=GroupFinder.findByName(root, "u:fox:browser6", true)

found it

gsh 3% g.getAttributesMap(false)

returned a hashmap, containing, among other things,

contact=Attribute[attrName=contact,groupUuid=a16...04381,id=84258...165a,value=fox],

gsh 4% g.getAttributeValue("contact", false, false)

returns 'fox' as expected.

gsh 5%
stdname=AttributeDefNameFinder.findByName("etc:legacy:attribute:legacyGroupType_uwstd",
true)

finds the name def for 'uwstd'

gsh 6%
contact=AttributeDefNameFinder.findByName("etc:legacy:attribute:legacyAttribute_contact",
true)

finds the name def for 'contact'

gsh 7% g.getAttributeDelegate().hasAttribute(stdname)

returns 'true' as I expected

gsh 8% g.getAttributeDelegate().hasAttribute(contact)

returns 'false' Why is that on false when getAttributeValue found it OK?


Then if I try to set an attribute value

gsh 12%
g.getAttributeValueDelegate().assignValue("etc:legacy:attribute:legacyAttribute_contact",
"jimfox")

I get an error.

// Error: unable to evaluate command: Sourced file: inline evaluation of:
``g.getAttributeValueDelegate().assignValue("etc:legacy:attribute:legacyAttribute_
. . . '' : Method Invocation assignValue
// See error log for full stacktrace
// caused by:
edu.internet2.middleware.grouper.exception.AttributeOwnerNotInScopeException:
// Cant find a scope definition that fits this assignment:
AttributeDef[name=etc:legacy:attribute:legacyAttributeDef_uwstd,uuid=8f2f24ef41fe4d8bbeda94f72a9f90d4],
Group[name=u:fox:browser6,uuid=a1681c3fcba3f54f759e6c9432004381]


What's a scope definition? What steps am I missing?
Thanks,

Jim

p.s. I can edit attributes in the GUI.



Archive powered by MHonArc 2.6.19.

Top of Page