Problem reducing a property from <multiple> to single
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2011 04:40 AM
We have crated a custom property of type d:text, originally defined als <multiple>true</multiple>.
Trying to change it to only allow single values causes a problem when trying to delete old nodes that were created under the original model.
Exception:
Unable to delete Space due to system error: Failed to execute transaction-level behaviour public abstract void org.alfresco.repo.node.NodeServicePolicies$OnUpdateNodePolicy.onUpdateNode(org.alfresco.service.cmr.repository.NodeRef) in transaction 25c1866e-1b32-11e1-a8f2-b7e9e5abd43b
Caused by: org.alfresco.service.cmr.dictionary.DictionaryException: A single-valued property of this type may not be a collection
This makes sense to me as the old properties were obviously stored as collections, and now the new model is saying they should be Strings
BUt it raises the question: how to deal with an change of model of this nature? Is there a procedure to "update" old nodes to the new model? It would be OK in this case to simply preserve the first value in the collection and forget about the rest.
Trying to change it to only allow single values causes a problem when trying to delete old nodes that were created under the original model.
Exception:
Unable to delete Space due to system error: Failed to execute transaction-level behaviour public abstract void org.alfresco.repo.node.NodeServicePolicies$OnUpdateNodePolicy.onUpdateNode(org.alfresco.service.cmr.repository.NodeRef) in transaction 25c1866e-1b32-11e1-a8f2-b7e9e5abd43b
Caused by: org.alfresco.service.cmr.dictionary.DictionaryException: A single-valued property of this type may not be a collection
This makes sense to me as the old properties were obviously stored as collections, and now the new model is saying they should be Strings
BUt it raises the question: how to deal with an change of model of this nature? Is there a procedure to "update" old nodes to the new model? It would be OK in this case to simply preserve the first value in the collection and forget about the rest.
Labels:
- Labels:
-
Archive
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2011 10:38 AM
Before deploying the new content model you should remove or update all the old nodes created with the old content model.
Once you have updated the old nodes, then you can disable the involved model, and then update it with a new version and then you can enable it again.
To disable and enable a content model, you have to manage the Model Active property available for each model deployed as a content in the repo.
Hope this helps.
Once you have updated the old nodes, then you can disable the involved model, and then update it with a new version and then you can enable it again.
To disable and enable a content model, you have to manage the Model Active property available for each model deployed as a content in the repo.
Hope this helps.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2011 12:05 PM
Worth a try. Thank you.
