How to create new data type?

cancel
Showing results for 
Search instead for 
Did you mean: 
mire323
Active Member II

How to create new data type?

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!

3 Replies
afaust
Master

Re: How to create new data type?

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.

fegor
Senior Member

Re: How to create new data type?

But this is very bad. For example, we have problems save float data in Alfresco.

 

  • Añadir a la guía de conversación
     
    • No hay listas de palabras para Inglés -> Español...
       
    • Crear una nueva lista de palabras...
  • Copiar
afaust
Master

Re: How to create new data type?

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)...