On 10/10/2014 14:06, Guido Wimmel wrote:
Hi,

I understand that Syncope schemas only support simple types (String, Enum, 
Boolean, Long, Double, Date) and byte arrays.

Is there a best practice for storing composite values?

We're thinking of managing acknowledgements of terms&conditions documents in our 
idm instance (is this usually done?) - which could be a multivalue attribute having a 
set of (reference to terms&conditions-document, date of acceptance) as values.

One way would be to use String types and serialize the values e.g. to JSON, 
which would work if one doesn't need to support efficient searches for values 
of the components of a composite value.

HI Guido,
"composite" values in Syncope is indeed a nice use case.

Certainly, using String + JSON (de)serialization could work, but it would require some considerable customization.

With Syncope 1.2.0 (SYNCOPE-131) the concept of "attribute template" is introduced for membership and roles, e.g. when you define a membership or role schema, such schema is not immediately available for all memberships and roles (as it used to be up to Syncope 1.1.X), instead, you will need to "enable" such schema for usage with a certain membership / role (e.g. you will need to create an attribute template those membership / role can instantiate).

An idea could be to implement the "composite values" use case above by creating a TermsAndConditions role (with no attributes) and to define several memberhisp schemas for all the items you need to store in the composite value; finally, to enable such membership schemas only for the new TermsAndConditions role.

WDYT?
Regards.

--
Francesco Chicchiriccò

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

Involved at The Apache Software Foundation:
member, Syncope PMC chair, Cocoon PMC, Olingo PMC
http://people.apache.org/~ilgrosso/


Reply via email to