[MAGNOLIA-6679] User and UserManager do not support multivalued properties Created: 19/Apr/16 Updated: 14/Jun/16 Resolved: 14/Jun/16 |
|
| Status: | Closed |
| Project: | Magnolia |
| Component/s: | core, security |
| Affects Version/s: | 5.4.5 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major |
| Reporter: | Teresa Miyar | Assignee: | Federico Grilli |
| Resolution: | Not an issue | Votes: | 0 |
| Labels: | architecture, support | ||
| Remaining Estimate: | 0d | ||
| Time Spent: | 0.5d | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||
| Issue Links: |
|
||||
| Template: |
|
||||
| Acceptance criteria: |
Empty
|
||||
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
||||
| Date of First Response: | |||||
| Sprint: | Basel 48 | ||||
| Story Points: | 5 | ||||
| Description |
|
When using a info.magnolia.ui.form.field.definition.LinkFieldDefinition with Multivaluetransformer, the data is saved correctly but an exception is thrown when retrieving it (see the [ in the uuid Caused by: java.lang.IllegalArgumentException: [d14950fc-7fc2-4631-92f1-b6f60a1fe40a at org.apache.jackrabbit.core.id.NodeId.<init>(NodeId.java:129) at org.apache.jackrabbit.core.id.NodeId.valueOf(NodeId.java:52) at org.apache.jackrabbit.core.SessionImpl.getNodeByIdentifier(SessionImpl.java:1098) ... 123 more OUTCOME After some debugging it seems that the issue is not due to the transformer, rather to the lack in our UserManager of a method to save a property as multivalued and User to support such properties. Whilst it is easy to workaround the limitation of not having a User API allowing to save a multivalued property, an error occurs once one tries to edit/update a User with such a property. ERROR info.magnolia.cms.security.MgnlUserManager : Could not retrieve user with name: tina javax.jcr.ValueFormatException: property /admin/tina/companies is a multi-valued property, so it's values can only be retrieved as an array at org.apache.jackrabbit.core.PropertyImpl.internalGetValue(PropertyImpl.java:483) at org.apache.jackrabbit.core.PropertyImpl.getValue(PropertyImpl.java:510) at org.apache.jackrabbit.core.PropertyImpl.getString(PropertyImpl.java:520) at info.magnolia.cms.security.MgnlUserManager.newUserInstance(MgnlUserManager.java:576) this is eventually due to User (in our case implemented by MgnlUser) not supporting multivalued properties. PROPOSAL |
| Comments |
| Comment by Federico Grilli [ 14/Jun/16 ] |
|
In the arch meeting has been decided not to proceed with the proposed solution because we do not actually intend to support multivalued properties in the users workspace. We will instead look at an alternative solution involving the profiles workspace as place fitter to hold non security-related user properties https://wiki.magnolia-cms.com/display/DEV/Preferences+and+User+profile |