09-21-2019 01:21 PM
Hello,
Does anyone know how to create a new data type for properties in alfresco model. I would like to make Big Decimal data type.
Thanks in advance!
09-22-2019 03:59 PM
Unfortunately, Alfresco has made it almost impossible to create a custom data type. Their internal code for handling values of properties contains a lot of direct coding for specific property types, but does not provide any extension point to add in custom type handling. Though it is technically possible to define a new property type via dictionary models, you would not be able to properly map that to the database without going in and making changes to the Alfresco core to handle your custom type.
Years ago (2011), I provided an enhancement / patch contribution to make implementation of custom property types possible. But after some initial off-JIRA discussions, there was never a follow up, and it fell victim to the big "close all old JIRA issues" purge of 2016. Since I provided the enhancement, some additional features have been added to Alfresco which made it even more difficult as it was back in 2011.
02-14-2020 06:21 AM
But this is very bad. For example, we have problems save float data in Alfresco.
02-15-2020 09:24 AM
What kind of issue do you have with regards to float data specifically? Since I don't deal with scientific metadata, I have so far only encountered issues with precision in one financial/business scenario (fine grained tender data with calculated article prices / averages to the 4th decimal), and there I was able to solve it by simply having two properties - one textual one for the full precision, Java BigDecimal representation, and one regular float value for simpler use cases (queries / sorting)...
Explore our Alfresco products with the links below. Use labels to filter content by product module.