← Back to team overview

dhis2-devs-core team mailing list archive

Re: data element patient to tracker domain type

 

Sorry for resurrecting old thread.

I just discovered when importing metadata from 2.15 to 2.16 instance I get
tripped up with:
Can not construct instance of org.hisp.dhis.dataelement.DataElementDomain
from String value 'aggregate': value not one of declared Enum instance
names: [AGGREGATE, TRACKER]

Is it worth somehow doing a toUpper() on import to allow for some
low-hanging backward compatibility?

On 16 June 2014 13:15, Tran Chau <tran.hispvietnam@xxxxxxxxx> wrote:

> Thanks, Lars :)
>
> Best regards,
> ------------------------------------------------
> Châu Thu Trân
> HISP Viet Nam
> Email: tran.hispvietnam@xxxxxxxxx
>
>
> On Mon, Jun 16, 2014 at 5:56 PM, Lars Helge Øverland <larshelge@xxxxxxxxx>
> wrote:
>
>> Hi Tran,
>>
>> the problem was that table alteror routine was running after the data
>> element default dimension startup routine. So when the latter routine tried
>> to read data elements, it would give an error, before the table alteror had
>> the chance to fix it. I have added a new table alteror startup routine
>> which is run as the very first routine which fixes this.
>>
>> Lars
>>
>>
>>
>> On Mon, Jun 16, 2014 at 7:32 AM, Tran Chau <tran.hispvietnam@xxxxxxxxx>
>> wrote:
>>
>>> Hi again,
>>>
>>> It is fixed. Please see the revision 15689 and 15690.
>>>
>>> Best regards,
>>> ------------------------------------------------
>>> Châu Thu Trân
>>> HISP Viet Nam
>>> Email: tran.hispvietnam@xxxxxxxxx
>>>
>>>
>>> On Mon, Jun 16, 2014 at 12:48 PM, Tran Chau <tran.hispvietnam@xxxxxxxxx>
>>> wrote:
>>>
>>>> I've just found out that if I use the enum in lowercase, we must run
>>>> the statement update dataelement set domaintype='*tracker*' where
>>>> domaintype='patient'; before starting tomcat, too.
>>>>
>>>> So no matter what we use enum in lowercase or uppercase, we must run
>>>> the statements to change values of domain-type column in database before
>>>> starting tomcat :'(
>>>>
>>>> --> I will modify the code with enum in uppercase and create a sql file
>>>> in resources dir to put these SQL statements.
>>>>
>>>> Thank you.
>>>>
>>>> Best regards,
>>>> ------------------------------------------------
>>>> Châu Thu Trân
>>>> HISP Viet Nam
>>>> Email: tran.hispvietnam@xxxxxxxxx
>>>>
>>>>
>>>> On Mon, Jun 16, 2014 at 7:02 AM, Tran Chau <tran.hispvietnam@xxxxxxxxx>
>>>> wrote:
>>>>
>>>>> Hi Lars,
>>>>>
>>>>> The bug in tomcat is about No Enum with name
>>>>> DataElementDomain.aggregate.
>>>>>
>>>>> But if we run the statements
>>>>>
>>>>> *update dataelement set domaintype='TRACKER' where
>>>>>> domaintype='patient';*
>>>>>> *update dataelement set domaintype='AGGREGATE' where
>>>>>> domaintype='aggregate';*
>>>>>>
>>>>> before starting tomcat, it works fine.
>>>>>
>>>>>
>>>>>
>>>>> On Jun 15, 2014, at 11:05 PM, Lars Helge Øverland <larshelge@xxxxxxxxx>
>>>>> wrote:
>>>>>
>>>>> Hi Tran,
>>>>>
>>>>> I think we should use uppercase. What kind of tomcat bug do you refer
>>>>> to?
>>>>>  On Jun 15, 2014 4:06 PM, "Tran Chau" <tran.hispvietnam@xxxxxxxxx>
>>>>> wrote:
>>>>>
>>>>>> Hi Morten,
>>>>>>
>>>>>> I know, But when I did like this *AGGREGATE( "aggregate" ), TRACKER(
>>>>>> "tracker" );* I had to change the domainType of data-element from*
>>>>>> aggregate/patient *to *AGGREGATE / **TRACKER*.
>>>>>>
>>>>>> However the statement to change the domainType as below ....
>>>>>>
>>>>>> *update dataelement set domaintype='TRACKER' where
>>>>>> domaintype='patient';*
>>>>>>
>>>>> *update dataelement set domaintype='AGGREGATE' where
>>>>>> domaintype='aggregate';*
>>>>>>
>>>>>
>>>>>> ..... didn't work when I added into the *TableAlterator* class of
>>>>>> dhis-service-code because before coming to these statements and run them,
>>>>>> the tomcat got a bug and DHIS cannot start properly. So to fix this bug, we
>>>>>> must run these statements before running tomcat. This issue make implement
>>>>>> people getting some troubles I think. That's why I used *aggregate(
>>>>>> "aggregate" ), tracker( "tracker" );*
>>>>>>
>>>>>> If you and others think it is better if we use *AGGREGATE(
>>>>>> "aggregate" ), TRACKER( "tracker" )*, I will change the code. I
>>>>>> think it is better for developers, not sure for implementation people.
>>>>>>
>>>>>>
>>>>>>
>>>>>> Best regards,
>>>>>> ------------------------------------------------
>>>>>> Châu Thu Trân
>>>>>> HISP Viet Nam
>>>>>> Email: tran.hispvietnam@xxxxxxxxx
>>>>>>
>>>>>>
>>>>>> On Sun, Jun 15, 2014 at 9:42 PM, Morten Olav Hansen <
>>>>>> mortenoh@xxxxxxxxx> wrote:
>>>>>>
>>>>>>> Just a quick not Tran, enum values are always in uppercase (they are
>>>>>>> constants)
>>>>>>>
>>>>>>> +    aggregate( "aggregate" ), tracker( "tracker" );
>>>>>>>
>>>>>>> Should be
>>>>>>>
>>>>>>> +    AGGREGATE( "aggregate" ), TRACKER( "tracker" );
>>>>>>>
>>>>>>> --
>>>>>>> Morten
>>>>>>>
>>>>>>>
>>>>>>> On Sun, Jun 15, 2014 at 3:28 PM, Tran Chau <
>>>>>>> tran.hispvietnam@xxxxxxxxx> wrote:
>>>>>>>
>>>>>>>> Hi all,
>>>>>>>>
>>>>>>>> I finished to rename the Patient domain type to tracker by using
>>>>>>>> Enum. Please take a look at it in revision 15686.
>>>>>>>>
>>>>>>>> Thank you.
>>>>>>>>
>>>>>>>> Best regards,
>>>>>>>> ------------------------------------------------
>>>>>>>> Châu Thu Trân
>>>>>>>> HISP Viet Nam
>>>>>>>> Email: tran.hispvietnam@xxxxxxxxx
>>>>>>>>
>>>>>>>>
>>>>>>>> On Sun, Jun 15, 2014 at 9:27 AM, Tran Chau <
>>>>>>>> tran.hispvietnam@xxxxxxxxx> wrote:
>>>>>>>>
>>>>>>>>> Hi all,
>>>>>>>>>
>>>>>>>>> I am working on it now.
>>>>>>>>>
>>>>>>>>> Best regards,
>>>>>>>>> ------------------------------------------------
>>>>>>>>> Châu Thu Trân
>>>>>>>>> HISP Viet Nam
>>>>>>>>> Email: tran.hispvietnam@xxxxxxxxx
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Fri, Jun 13, 2014 at 2:49 AM, Lars Helge Øverland <
>>>>>>>>> larshelge@xxxxxxxxx> wrote:
>>>>>>>>>
>>>>>>>>>> Yes we can do that since we are changing in any case.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Thu, Jun 12, 2014 at 8:02 PM, Morten Olav Hansen <
>>>>>>>>>> mortenoh@xxxxxxxxx> wrote:
>>>>>>>>>>
>>>>>>>>>>> Could I suggest using a enum for this. I want us to move that
>>>>>>>>>>> way going forward, since it makes it easier to auto-generate lists of
>>>>>>>>>>> possible choices for a certain property (which is more or less impossible
>>>>>>>>>>> using these final constants).
>>>>>>>>>>>
>>>>>>>>>>> --
>>>>>>>>>>> Morten
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On Thu, Jun 12, 2014 at 7:58 PM, Lars Helge Øverland <
>>>>>>>>>>> larshelge@xxxxxxxxx> wrote:
>>>>>>>>>>>
>>>>>>>>>>>> Hi,
>>>>>>>>>>>>
>>>>>>>>>>>> we need to change the data element domain type from "patient"
>>>>>>>>>>>> to "tracker". This includes finals on DataElement.java and data element vm
>>>>>>>>>>>> template.
>>>>>>>>>>>>
>>>>>>>>>>>> *Tran* could you please do this? This must be tested
>>>>>>>>>>>> extensively - please take your time and test well. You can use grep
>>>>>>>>>>>> (install gow
>>>>>>>>>>>> <https://github.com/bmatzelle/gow/archive/master.zip> on
>>>>>>>>>>>> windows) to search for use in javascript/vm templates.
>>>>>>>>>>>>
>>>>>>>>>>>> If *anyone* sees any places where this will break current
>>>>>>>>>>>> functionality please update after the change has been done.
>>>>>>>>>>>>
>>>>>>>>>>>> Lars
>>>>>>>>>>>>
>>>>>>>>>>>> --
>>>>>>>>>>>> Mailing list: https://launchpad.net/~dhis2-devs-core
>>>>>>>>>>>> Post to     : dhis2-devs-core@xxxxxxxxxxxxxxxxxxx
>>>>>>>>>>>> Unsubscribe : https://launchpad.net/~dhis2-devs-core
>>>>>>>>>>>> More help   : https://help.launchpad.net/ListHelp
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>
>>>
>>
>
> --
> Mailing list: https://launchpad.net/~dhis2-devs-core
> Post to     : dhis2-devs-core@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dhis2-devs-core
> More help   : https://help.launchpad.net/ListHelp
>
>

References