On 26/09/2018 17:29, Ben.H wrote:
My setup:
I have users who are assigned groups, and the groups have anytime extensions
on them so that when I add a group to a user I have to enter the groups
extended data for that user.

I am trying to persist user data to an external database.  I need to store
the account/user data in one table, which works fine, as all the fields are
in the account object class.  However, I also need to store the groups and
there extended information in a separate table; username, groupname, and
group associated data.  However I seem to be able to only map data from
ACCOUNT or GROUP but not the extension data for the groups.

The only work around I have been able to find is I can map group information
as long as I call out each group by name (i.e.
memberships[groupname].attribute).  This means for each group and anytime a
group is added I would have to add fields to the mapping as well as updating
the scripts.

Any help would be appreciated.

Hi Ben,
glad of your interest in Apache Syncope.

It seems that you are already able to:

1. define group memberships [1] and their attributes in Syncope via Type Extensions [2] 2. map membership attributes to an external database via expressions like as 'memberships[groupname].schema' in your mapping [3] 3. put the Scripted SQL connector at work - which involves authoring some Groovy scripts

Cool :-)

As you have already discovered, mapping information is a static list of items: here's why you say

for each group and anytime a group is added I would have to add fields to the 
mapping as well

To overcome such a limitation, you can empower PropagationActions [4]: more specifically, in the before() method, you can inject the logic to dynamically enrich the set of attributes sent to the connector depending on the memberships assigned to the user being propagated.

HTH
Regards.

[1] http://syncope.apache.org/docs/reference-guide.html#memberships-relationships
[2] http://syncope.apache.org/docs/reference-guide.html#type-extensions
[3] http://syncope.apache.org/docs/reference-guide.html#mapping
[4] http://syncope.apache.org/docs/reference-guide.html#propagationactions

--
Francesco Chicchiriccò

Tirasa - Open Source Excellence
http://www.tirasa.net/

Member at The Apache Software Foundation
Syncope, Cocoon, Olingo, CXF, OpenJPA, PonyMail
http://home.apache.org/~ilgrosso/

Reply via email to