Limit characters in Comment

Dear All,
I found that, in the Comment in data value in dataset is limit character around 360characters.

Can we extend to unlimited characters for comments?

Thank you

CHANNARA

Hi Channara,

the max is actually 255 characters, backed by a “varchar” column in the database. I’m sorry but we don’t plan to change it to a “text” type column anytime soon - reason is just that most comments are pretty short and “text” requires more storage space on disk.

Now that said you are of course free to change the column type to text directly in your database, and then apply the patch copied below this email to remove the validation.

regards,

Lars

···

On Wed, Apr 9, 2014 at 6:55 AM, channara rin rin.channara@gmail.com wrote:

Dear All,
I found that, in the Comment in data value in dataset is limit character around 360characters.

Can we extend to unlimited characters for comments?

Thank you

CHANNARA


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Great, Thank you.
SO i need to modify the 360 in history.js file?

AND another problem is. when has comment, can show highlight data value in dataset that has text in that comment? SO it is easy for us(M&E staff) to view if that data value has comment…

Thank you

CHANNARA

···

On Wed, Apr 9, 2014 at 3:02 PM, Lars Helge Øverland larshelge@gmail.com wrote:

Hi Channara,

the max is actually 255 characters, backed by a “varchar” column in the database. I’m sorry but we don’t plan to change it to a “text” type column anytime soon - reason is just that most comments are pretty short and “text” requires more storage space on disk.

Now that said you are of course free to change the column type to text directly in your database, and then apply the patch copied below this email to remove the validation.

regards,

Lars


=== modified file ‘dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/history.js’

— dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/history.js 2014-02-27 04:15:35 +0000

+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/history.js 2014-04-09 08:01:57 +0000

@@ -5,14 +5,6 @@

var commentValue = $( ‘#commentTextArea’ ).val();

  • if ( commentValue.length > 360 )
  • {
  •    markComment( COLOR_YELLOW );
    
  •    window.alert(i18n_value_too_long + " for comment field");
    
  •    return;
    
  • }

var commentSaver = new CommentSaver( currentDataElementId, currentOptionComboId, commentValue );

commentSaver.save();

On Wed, Apr 9, 2014 at 6:55 AM, channara rin rin.channara@gmail.com wrote:

Dear All,
I found that, in the Comment in data value in dataset is limit character around 360characters.

Can we extend to unlimited characters for comments?

Thank you

CHANNARA


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

The cell border will be green for fields which have comments (next time you open that form).

···

On Wed, Apr 9, 2014 at 10:27 AM, channara rin rin.channara@gmail.com wrote:

Great, Thank you.
SO i need to modify the 360 in history.js file?

AND another problem is. when has comment, can show highlight data value in dataset that has text in that comment? SO it is easy for us(M&E staff) to view if that data value has comment…

Thank you

CHANNARA

On Wed, Apr 9, 2014 at 3:02 PM, Lars Helge Øverland larshelge@gmail.com wrote:

Hi Channara,

the max is actually 255 characters, backed by a “varchar” column in the database. I’m sorry but we don’t plan to change it to a “text” type column anytime soon - reason is just that most comments are pretty short and “text” requires more storage space on disk.

Now that said you are of course free to change the column type to text directly in your database, and then apply the patch copied below this email to remove the validation.

regards,

Lars


=== modified file ‘dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/history.js’

— dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/history.js 2014-02-27 04:15:35 +0000

+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/history.js 2014-04-09 08:01:57 +0000

@@ -5,14 +5,6 @@

var commentValue = $( ‘#commentTextArea’ ).val();

  • if ( commentValue.length > 360 )
  • {
  •    markComment( COLOR_YELLOW );
    
  •    window.alert(i18n_value_too_long + " for comment field");
    
  •    return;
    
  • }

var commentSaver = new CommentSaver( currentDataElementId, currentOptionComboId, commentValue );

commentSaver.save();

On Wed, Apr 9, 2014 at 6:55 AM, channara rin rin.channara@gmail.com wrote:

Dear All,
I found that, in the Comment in data value in dataset is limit character around 360characters.

Can we extend to unlimited characters for comments?

Thank you

CHANNARA


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Dear Lars,
I tried to change in history.js

but when i enter longer than 360 in comment, and press “Save Comment”. It always jump:

CONSOLE

···

On Wed, Apr 9, 2014 at 3:29 PM, Lars Helge Øverland larshelge@gmail.com wrote:

The cell border will be green for fields which have comments (next time you open that form).

On Wed, Apr 9, 2014 at 10:27 AM, channara rin rin.channara@gmail.com wrote:

Great, Thank you.
SO i need to modify the 360 in history.js file?

AND another problem is. when has comment, can show highlight data value in dataset that has text in that comment? SO it is easy for us(M&E staff) to view if that data value has comment…

Thank you

CHANNARA

On Wed, Apr 9, 2014 at 3:02 PM, Lars Helge Øverland larshelge@gmail.com wrote:

Hi Channara,

the max is actually 255 characters, backed by a “varchar” column in the database. I’m sorry but we don’t plan to change it to a “text” type column anytime soon - reason is just that most comments are pretty short and “text” requires more storage space on disk.

Now that said you are of course free to change the column type to text directly in your database, and then apply the patch copied below this email to remove the validation.

regards,

Lars


=== modified file ‘dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/history.js’

— dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/history.js 2014-02-27 04:15:35 +0000

+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/history.js 2014-04-09 08:01:57 +0000

@@ -5,14 +5,6 @@

var commentValue = $( ‘#commentTextArea’ ).val();

  • if ( commentValue.length > 360 )
  • {
  •    markComment( COLOR_YELLOW );
    
  •    window.alert(i18n_value_too_long + " for comment field");
    
  •    return;
    
  • }

var commentSaver = new CommentSaver( currentDataElementId, currentOptionComboId, commentValue );

commentSaver.save();

On Wed, Apr 9, 2014 at 6:55 AM, channara rin rin.channara@gmail.com wrote:

Dear All,
I found that, in the Comment in data value in dataset is limit character around 360characters.

Can we extend to unlimited characters for comments?

Thank you

CHANNARA


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Did you change the database field type from varchar to text?

Regards,

Jason

···

On Wed, Apr 9, 2014 at 11:31 AM, channara rin rin.channara@gmail.com wrote:

Dear Lars,
I tried to change in history.js

but when i enter longer than 360 in comment, and press “Save Comment”. It always jump:

CONSOLE


ReferenceError: i18n_saving_comment_failed_error_code is not defined history.js:64


history.js


function handleError( xhr, textStatus, errorThrown )

{

markComment( COLOR_RED );

window.alert( i18n_saving_comment_failed_error_code + ‘\n\n’ + xhr.responseText );

}


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

On Wed, Apr 9, 2014 at 3:29 PM, Lars Helge Øverland larshelge@gmail.com wrote:

The cell border will be green for fields which have comments (next time you open that form).

On Wed, Apr 9, 2014 at 10:27 AM, channara rin rin.channara@gmail.com wrote:

Great, Thank you.
SO i need to modify the 360 in history.js file?

AND another problem is. when has comment, can show highlight data value in dataset that has text in that comment? SO it is easy for us(M&E staff) to view if that data value has comment…

Thank you

CHANNARA

On Wed, Apr 9, 2014 at 3:02 PM, Lars Helge Øverland larshelge@gmail.com wrote:

Hi Channara,

the max is actually 255 characters, backed by a “varchar” column in the database. I’m sorry but we don’t plan to change it to a “text” type column anytime soon - reason is just that most comments are pretty short and “text” requires more storage space on disk.

Now that said you are of course free to change the column type to text directly in your database, and then apply the patch copied below this email to remove the validation.

regards,

Lars


=== modified file ‘dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/history.js’

— dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/history.js 2014-02-27 04:15:35 +0000

+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/history.js 2014-04-09 08:01:57 +0000

@@ -5,14 +5,6 @@

var commentValue = $( ‘#commentTextArea’ ).val();

  • if ( commentValue.length > 360 )
  • {
  •    markComment( COLOR_YELLOW );
    
  •    window.alert(i18n_value_too_long + " for comment field");
    
  •    return;
    
  • }

var commentSaver = new CommentSaver( currentDataElementId, currentOptionComboId, commentValue );

commentSaver.save();

On Wed, Apr 9, 2014 at 6:55 AM, channara rin rin.channara@gmail.com wrote:

Dear All,
I found that, in the Comment in data value in dataset is limit character around 360characters.

Can we extend to unlimited characters for comments?

Thank you

CHANNARA


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

The default, comment field in datavalue table is longtext type.

Best Regards,

CHANNARA

···

On Wed, Apr 9, 2014 at 4:40 PM, Jason Pickering jason.p.pickering@gmail.com wrote:

Did you change the database field type from varchar to text?

Regards,

Jason

On Wed, Apr 9, 2014 at 11:31 AM, channara rin rin.channara@gmail.com wrote:

Dear Lars,
I tried to change in history.js

but when i enter longer than 360 in comment, and press “Save Comment”. It always jump:

CONSOLE


ReferenceError: i18n_saving_comment_failed_error_code is not defined history.js:64


history.js


function handleError( xhr, textStatus, errorThrown )

{

markComment( COLOR_RED );

window.alert( i18n_saving_comment_failed_error_code + ‘\n\n’ + xhr.responseText );

}


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

On Wed, Apr 9, 2014 at 3:29 PM, Lars Helge Øverland larshelge@gmail.com wrote:

The cell border will be green for fields which have comments (next time you open that form).

On Wed, Apr 9, 2014 at 10:27 AM, channara rin rin.channara@gmail.com wrote:

Great, Thank you.
SO i need to modify the 360 in history.js file?

AND another problem is. when has comment, can show highlight data value in dataset that has text in that comment? SO it is easy for us(M&E staff) to view if that data value has comment…

Thank you

CHANNARA

On Wed, Apr 9, 2014 at 3:02 PM, Lars Helge Øverland larshelge@gmail.com wrote:

Hi Channara,

the max is actually 255 characters, backed by a “varchar” column in the database. I’m sorry but we don’t plan to change it to a “text” type column anytime soon - reason is just that most comments are pretty short and “text” requires more storage space on disk.

Now that said you are of course free to change the column type to text directly in your database, and then apply the patch copied below this email to remove the validation.

regards,

Lars


=== modified file ‘dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/history.js’

— dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/history.js 2014-02-27 04:15:35 +0000

+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/history.js 2014-04-09 08:01:57 +0000

@@ -5,14 +5,6 @@

var commentValue = $( ‘#commentTextArea’ ).val();

  • if ( commentValue.length > 360 )
  • {
  •    markComment( COLOR_YELLOW );
    
  •    window.alert(i18n_value_too_long + " for comment field");
    
  •    return;
    
  • }

var commentSaver = new CommentSaver( currentDataElementId, currentOptionComboId, commentValue );

commentSaver.save();

On Wed, Apr 9, 2014 at 6:55 AM, channara rin rin.channara@gmail.com wrote:

Dear All,
I found that, in the Comment in data value in dataset is limit character around 360characters.

Can we extend to unlimited characters for comments?

Thank you

CHANNARA


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Could be. On postgres, the datavalue table (at least on my system) looks like this

CREATE TABLE datavalue

(

dataelementid integer NOT NULL,

periodid integer NOT NULL,

sourceid integer NOT NULL,

categoryoptioncomboid integer NOT NULL,

value character varying(255),

storedby character varying(100),

lastupdated timestamp without time zone,

comment character varying(360),

followup boolean,

In that case, not sure then. :-/

Regards,

Jason

···

On Wed, Apr 9, 2014 at 11:42 AM, channara rin rin.channara@gmail.com wrote:

The default, comment field in datavalue table is longtext type.

Best Regards,

CHANNARA

On Wed, Apr 9, 2014 at 4:40 PM, Jason Pickering jason.p.pickering@gmail.com wrote:

Did you change the database field type from varchar to text?

Regards,

Jason

On Wed, Apr 9, 2014 at 11:31 AM, channara rin rin.channara@gmail.com wrote:

Dear Lars,
I tried to change in history.js

but when i enter longer than 360 in comment, and press “Save Comment”. It always jump:

CONSOLE


ReferenceError: i18n_saving_comment_failed_error_code is not defined history.js:64


history.js


function handleError( xhr, textStatus, errorThrown )

{

markComment( COLOR_RED );

window.alert( i18n_saving_comment_failed_error_code + ‘\n\n’ + xhr.responseText );

}


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

On Wed, Apr 9, 2014 at 3:29 PM, Lars Helge Øverland larshelge@gmail.com wrote:

The cell border will be green for fields which have comments (next time you open that form).

On Wed, Apr 9, 2014 at 10:27 AM, channara rin rin.channara@gmail.com wrote:

Great, Thank you.
SO i need to modify the 360 in history.js file?

AND another problem is. when has comment, can show highlight data value in dataset that has text in that comment? SO it is easy for us(M&E staff) to view if that data value has comment…

Thank you

CHANNARA

On Wed, Apr 9, 2014 at 3:02 PM, Lars Helge Øverland larshelge@gmail.com wrote:

Hi Channara,

the max is actually 255 characters, backed by a “varchar” column in the database. I’m sorry but we don’t plan to change it to a “text” type column anytime soon - reason is just that most comments are pretty short and “text” requires more storage space on disk.

Now that said you are of course free to change the column type to text directly in your database, and then apply the patch copied below this email to remove the validation.

regards,

Lars


=== modified file ‘dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/history.js’

— dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/history.js 2014-02-27 04:15:35 +0000

+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/history.js 2014-04-09 08:01:57 +0000

@@ -5,14 +5,6 @@

var commentValue = $( ‘#commentTextArea’ ).val();

  • if ( commentValue.length > 360 )
  • {
  •    markComment( COLOR_YELLOW );
    
  •    window.alert(i18n_value_too_long + " for comment field");
    
  •    return;
    
  • }

var commentSaver = new CommentSaver( currentDataElementId, currentOptionComboId, commentValue );

commentSaver.save();

On Wed, Apr 9, 2014 at 6:55 AM, channara rin rin.channara@gmail.com wrote:

Dear All,
I found that, in the Comment in data value in dataset is limit character around 360characters.

Can we extend to unlimited characters for comments?

Thank you

CHANNARA


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Oh!, i am using MySQL. where i can find this sql expression?

···

On Wed, Apr 9, 2014 at 4:46 PM, Jason Pickering jason.p.pickering@gmail.com wrote:

Could be. On postgres, the datavalue table (at least on my system) looks like this

CREATE TABLE datavalue

(

dataelementid integer NOT NULL,

periodid integer NOT NULL,

sourceid integer NOT NULL,

categoryoptioncomboid integer NOT NULL,

value character varying(255),

storedby character varying(100),

lastupdated timestamp without time zone,

comment character varying(360),

followup boolean,

In that case, not sure then. :-/

Regards,

Jason

On Wed, Apr 9, 2014 at 11:42 AM, channara rin rin.channara@gmail.com wrote:

The default, comment field in datavalue table is longtext type.

Best Regards,

CHANNARA

On Wed, Apr 9, 2014 at 4:40 PM, Jason Pickering jason.p.pickering@gmail.com wrote:

Did you change the database field type from varchar to text?

Regards,

Jason

On Wed, Apr 9, 2014 at 11:31 AM, channara rin rin.channara@gmail.com wrote:

Dear Lars,
I tried to change in history.js

but when i enter longer than 360 in comment, and press “Save Comment”. It always jump:

CONSOLE


ReferenceError: i18n_saving_comment_failed_error_code is not defined history.js:64


history.js


function handleError( xhr, textStatus, errorThrown )

{

markComment( COLOR_RED );

window.alert( i18n_saving_comment_failed_error_code + ‘\n\n’ + xhr.responseText );

}


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

On Wed, Apr 9, 2014 at 3:29 PM, Lars Helge Øverland larshelge@gmail.com wrote:

The cell border will be green for fields which have comments (next time you open that form).

On Wed, Apr 9, 2014 at 10:27 AM, channara rin rin.channara@gmail.com wrote:

Great, Thank you.
SO i need to modify the 360 in history.js file?

AND another problem is. when has comment, can show highlight data value in dataset that has text in that comment? SO it is easy for us(M&E staff) to view if that data value has comment…

Thank you

CHANNARA

On Wed, Apr 9, 2014 at 3:02 PM, Lars Helge Øverland larshelge@gmail.com wrote:

Hi Channara,

the max is actually 255 characters, backed by a “varchar” column in the database. I’m sorry but we don’t plan to change it to a “text” type column anytime soon - reason is just that most comments are pretty short and “text” requires more storage space on disk.

Now that said you are of course free to change the column type to text directly in your database, and then apply the patch copied below this email to remove the validation.

regards,

Lars


=== modified file ‘dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/history.js’

— dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/history.js 2014-02-27 04:15:35 +0000

+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/history.js 2014-04-09 08:01:57 +0000

@@ -5,14 +5,6 @@

var commentValue = $( ‘#commentTextArea’ ).val();

  • if ( commentValue.length > 360 )
  • {
  •    markComment( COLOR_YELLOW );
    
  •    window.alert(i18n_value_too_long + " for comment field");
    
  •    return;
    
  • }

var commentSaver = new CommentSaver( currentDataElementId, currentOptionComboId, commentValue );

commentSaver.save();

On Wed, Apr 9, 2014 at 6:55 AM, channara rin rin.channara@gmail.com wrote:

Dear All,
I found that, in the Comment in data value in dataset is limit character around 360characters.

Can we extend to unlimited characters for comments?

Thank you

CHANNARA


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Hi there,

please follow the patch and remove the whole validation script clause - with “text” there is no real limit (1GB on postgres) so no need for validation.

···

On Wed, Apr 9, 2014 at 11:42 AM, channara rin rin.channara@gmail.com wrote:

The default, comment field in datavalue table is longtext type.

Best Regards,

CHANNARA

On Wed, Apr 9, 2014 at 4:40 PM, Jason Pickering jason.p.pickering@gmail.com wrote:

Did you change the database field type from varchar to text?

Regards,

Jason

On Wed, Apr 9, 2014 at 11:31 AM, channara rin rin.channara@gmail.com wrote:

Dear Lars,
I tried to change in history.js

but when i enter longer than 360 in comment, and press “Save Comment”. It always jump:

CONSOLE


ReferenceError: i18n_saving_comment_failed_error_code is not defined history.js:64


history.js


function handleError( xhr, textStatus, errorThrown )

{

markComment( COLOR_RED );

window.alert( i18n_saving_comment_failed_error_code + ‘\n\n’ + xhr.responseText );

}


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

On Wed, Apr 9, 2014 at 3:29 PM, Lars Helge Øverland larshelge@gmail.com wrote:

The cell border will be green for fields which have comments (next time you open that form).

On Wed, Apr 9, 2014 at 10:27 AM, channara rin rin.channara@gmail.com wrote:

Great, Thank you.
SO i need to modify the 360 in history.js file?

AND another problem is. when has comment, can show highlight data value in dataset that has text in that comment? SO it is easy for us(M&E staff) to view if that data value has comment…

Thank you

CHANNARA

On Wed, Apr 9, 2014 at 3:02 PM, Lars Helge Øverland larshelge@gmail.com wrote:

Hi Channara,

the max is actually 255 characters, backed by a “varchar” column in the database. I’m sorry but we don’t plan to change it to a “text” type column anytime soon - reason is just that most comments are pretty short and “text” requires more storage space on disk.

Now that said you are of course free to change the column type to text directly in your database, and then apply the patch copied below this email to remove the validation.

regards,

Lars


=== modified file ‘dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/history.js’

— dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/history.js 2014-02-27 04:15:35 +0000

+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/history.js 2014-04-09 08:01:57 +0000

@@ -5,14 +5,6 @@

var commentValue = $( ‘#commentTextArea’ ).val();

  • if ( commentValue.length > 360 )
  • {
  •    markComment( COLOR_YELLOW );
    
  •    window.alert(i18n_value_too_long + " for comment field");
    
  •    return;
    
  • }

var commentSaver = new CommentSaver( currentDataElementId, currentOptionComboId, commentValue );

commentSaver.save();

On Wed, Apr 9, 2014 at 6:55 AM, channara rin rin.channara@gmail.com wrote:

Dear All,
I found that, in the Comment in data value in dataset is limit character around 360characters.

Can we extend to unlimited characters for comments?

Thank you

CHANNARA


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Hi,

I’m trying to apply the below patch to allow comments longer than 360 characters. Changing the .js and .vm file works fine and the text field allows long comments, BUT the system still refuses to store the data values with long comments - 409 conflict is returned from the server. The comment column has type «longtext». Any ideas of what could be the problem?

Searching through the source code, I found two additional files where the lengt of the comments are mentioned:

  • validationUtils.java, function commentIsValid() checks for comment length

  • DataValue.hbm.xml has “”

Do these also need to be changed? If so, I guess a custom .war file will be needed (as opposed to just changing the .vm and .js files)?

Olav

···

On Wed, Apr 9, 2014 at 4:46 PM, Jason Pickering jason.p.pickering@gmail.com wrote:

Could be. On postgres, the datavalue table (at least on my system) looks like this

CREATE TABLE datavalue

(

dataelementid integer NOT NULL,

periodid integer NOT NULL,

sourceid integer NOT NULL,

categoryoptioncomboid integer NOT NULL,

value character varying(255),

storedby character varying(100),

lastupdated timestamp without time zone,

comment character varying(360),

followup boolean,

In that case, not sure then. :-/

Regards,

Jason

On Wed, Apr 9, 2014 at 11:42 AM, channara rin rin.channara@gmail.com wrote:

The default, comment field in datavalue table is longtext type.

Best Regards,

CHANNARA

On Wed, Apr 9, 2014 at 4:40 PM, Jason Pickering jason.p.pickering@gmail.com wrote:

Did you change the database field type from varchar to text?

Regards,

Jason

On Wed, Apr 9, 2014 at 11:31 AM, channara rin rin.channara@gmail.com wrote:

Dear Lars,
I tried to change in history.js

but when i enter longer than 360 in comment, and press “Save Comment”. It always jump:

CONSOLE


ReferenceError: i18n_saving_comment_failed_error_code is not defined history.js:64


history.js


function handleError( xhr, textStatus, errorThrown )

{

markComment( COLOR_RED );

window.alert( i18n_saving_comment_failed_error_code + ‘\n\n’ + xhr.responseText );

}


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

On Wed, Apr 9, 2014 at 3:29 PM, Lars Helge Øverland larshelge@gmail.com wrote:

The cell border will be green for fields which have comments (next time you open that form).

On Wed, Apr 9, 2014 at 10:27 AM, channara rin rin.channara@gmail.com wrote:

Great, Thank you.
SO i need to modify the 360 in history.js file?

AND another problem is. when has comment, can show highlight data value in dataset that has text in that comment? SO it is easy for us(M&E staff) to view if that data value has comment…

Thank you

CHANNARA

On Wed, Apr 9, 2014 at 3:02 PM, Lars Helge Øverland larshelge@gmail.com wrote:

Hi Channara,

the max is actually 255 characters, backed by a “varchar” column in the database. I’m sorry but we don’t plan to change it to a “text” type column anytime soon - reason is just that most comments are pretty short and “text” requires more storage space on disk.

Now that said you are of course free to change the column type to text directly in your database, and then apply the patch copied below this email to remove the validation.

regards,

Lars


=== modified file ‘dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/history.js’

— dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/history.js 2014-02-27 04:15:35 +0000

+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/history.js 2014-04-09 08:01:57 +0000

@@ -5,14 +5,6 @@

var commentValue = $( ‘#commentTextArea’ ).val();

  • if ( commentValue.length > 360 )
  • {
  •    markComment( COLOR_YELLOW );
    
  •    window.alert(i18n_value_too_long + " for comment field");
    
  •    return;
    
  • }

var commentSaver = new CommentSaver( currentDataElementId, currentOptionComboId, commentValue );

commentSaver.save();

On Wed, Apr 9, 2014 at 6:55 AM, channara rin rin.channara@gmail.com wrote:

Dear All,
I found that, in the Comment in data value in dataset is limit character around 360characters.

Can we extend to unlimited characters for comments?

Thank you

CHANNARA


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Hi Olav,

the datavalue.value column is of type varchar and not text. This might be unfortunate but there is an overhead in using text vs varchar. The long text vs text is more a UI setting to indicate whether to display an input field or text area.

I am not sure how huge the difference is between text and varchar these days so it could be looked into whether changing is feasible. I have seen the requirement for storing “narratives” as data a few places.

regards,

Lars

···

On Wed, Sep 10, 2014 at 8:52 AM, Olav Poppe olav.poppe@me.com wrote:

Hi,

I’m trying to apply the below patch to allow comments longer than 360 characters. Changing the .js and .vm file works fine and the text field allows long comments, BUT the system still refuses to store the data values with long comments - 409 conflict is returned from the server. The comment column has type «longtext». Any ideas of what could be the problem?

Searching through the source code, I found two additional files where the lengt of the comments are mentioned:

  • validationUtils.java, function commentIsValid() checks for comment length
  • DataValue.hbm.xml has “”

Do these also need to be changed? If so, I guess a custom .war file will be needed (as opposed to just changing the .vm and .js files)?

Olav

  1. apr. 2014 kl. 11:48 skrev channara rin rin.channara@gmail.com:

Oh!, i am using MySQL. where i can find this sql expression?


Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help : https://help.launchpad.net/ListHelp

On Wed, Apr 9, 2014 at 4:46 PM, Jason Pickering jason.p.pickering@gmail.com wrote:

Could be. On postgres, the datavalue table (at least on my system) looks like this

CREATE TABLE datavalue

(

dataelementid integer NOT NULL,

periodid integer NOT NULL,

sourceid integer NOT NULL,

categoryoptioncomboid integer NOT NULL,

value character varying(255),

storedby character varying(100),

lastupdated timestamp without time zone,

comment character varying(360),

followup boolean,

In that case, not sure then. :-/

Regards,

Jason

On Wed, Apr 9, 2014 at 11:42 AM, channara rin rin.channara@gmail.com wrote:

The default, comment field in datavalue table is longtext type.

Best Regards,

CHANNARA

On Wed, Apr 9, 2014 at 4:40 PM, Jason Pickering jason.p.pickering@gmail.com wrote:

Did you change the database field type from varchar to text?

Regards,

Jason

On Wed, Apr 9, 2014 at 11:31 AM, channara rin rin.channara@gmail.com wrote:

Dear Lars,
I tried to change in history.js

but when i enter longer than 360 in comment, and press “Save Comment”. It always jump:

CONSOLE


ReferenceError: i18n_saving_comment_failed_error_code is not defined history.js:64


history.js


function handleError( xhr, textStatus, errorThrown )

{

markComment( COLOR_RED );

window.alert( i18n_saving_comment_failed_error_code + ‘\n\n’ + xhr.responseText );

}


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

On Wed, Apr 9, 2014 at 3:29 PM, Lars Helge Øverland larshelge@gmail.com wrote:

The cell border will be green for fields which have comments (next time you open that form).

On Wed, Apr 9, 2014 at 10:27 AM, channara rin rin.channara@gmail.com wrote:

Great, Thank you.
SO i need to modify the 360 in history.js file?

AND another problem is. when has comment, can show highlight data value in dataset that has text in that comment? SO it is easy for us(M&E staff) to view if that data value has comment…

Thank you

CHANNARA

On Wed, Apr 9, 2014 at 3:02 PM, Lars Helge Øverland larshelge@gmail.com wrote:

Hi Channara,

the max is actually 255 characters, backed by a “varchar” column in the database. I’m sorry but we don’t plan to change it to a “text” type column anytime soon - reason is just that most comments are pretty short and “text” requires more storage space on disk.

Now that said you are of course free to change the column type to text directly in your database, and then apply the patch copied below this email to remove the validation.

regards,

Lars


=== modified file ‘dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/history.js’

— dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/history.js 2014-02-27 04:15:35 +0000

+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/history.js 2014-04-09 08:01:57 +0000

@@ -5,14 +5,6 @@

var commentValue = $( ‘#commentTextArea’ ).val();

  • if ( commentValue.length > 360 )
  • {
  •    markComment( COLOR_YELLOW );
    
  •    window.alert(i18n_value_too_long + " for comment field");
    
  •    return;
    
  • }

var commentSaver = new CommentSaver( currentDataElementId, currentOptionComboId, commentValue );

commentSaver.save();

On Wed, Apr 9, 2014 at 6:55 AM, channara rin rin.channara@gmail.com wrote:

Dear All,
I found that, in the Comment in data value in dataset is limit character around 360characters.

Can we extend to unlimited characters for comments?

Thank you

CHANNARA


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Hi,

in MySQL and 2.15 the type seems to be longtext (see below).

In any case, the patch suggested below is to 1) manually change the column type 2) change the history.vm and history.js. Is that supposed to enough, or are further changes required?

Olav

···

On Wed, Sep 10, 2014 at 8:52 AM, Olav Poppe olav.poppe@me.com wrote:

Hi,

I’m trying to apply the below patch to allow comments longer than 360 characters. Changing the .js and .vm file works fine and the text field allows long comments, BUT the system still refuses to store the data values with long comments - 409 conflict is returned from the server. The comment column has type «longtext». Any ideas of what could be the problem?

Searching through the source code, I found two additional files where the lengt of the comments are mentioned:

  • validationUtils.java, function commentIsValid() checks for comment length
  • DataValue.hbm.xml has “”

Do these also need to be changed? If so, I guess a custom .war file will be needed (as opposed to just changing the .vm and .js files)?

Olav

  1. apr. 2014 kl. 11:48 skrev channara rin rin.channara@gmail.com:

Oh!, i am using MySQL. where i can find this sql expression?


Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help : https://help.launchpad.net/ListHelp

On Wed, Apr 9, 2014 at 4:46 PM, Jason Pickering jason.p.pickering@gmail.com wrote:

Could be. On postgres, the datavalue table (at least on my system) looks like this

CREATE TABLE datavalue

(

dataelementid integer NOT NULL,

periodid integer NOT NULL,

sourceid integer NOT NULL,

categoryoptioncomboid integer NOT NULL,

value character varying(255),

storedby character varying(100),

lastupdated timestamp without time zone,

comment character varying(360),

followup boolean,

In that case, not sure then. :-/

Regards,

Jason

On Wed, Apr 9, 2014 at 11:42 AM, channara rin rin.channara@gmail.com wrote:

The default, comment field in datavalue table is longtext type.

Best Regards,

CHANNARA

On Wed, Apr 9, 2014 at 4:40 PM, Jason Pickering jason.p.pickering@gmail.com wrote:

Did you change the database field type from varchar to text?

Regards,

Jason

On Wed, Apr 9, 2014 at 11:31 AM, channara rin rin.channara@gmail.com wrote:

Dear Lars,
I tried to change in history.js

but when i enter longer than 360 in comment, and press “Save Comment”. It always jump:

CONSOLE


ReferenceError: i18n_saving_comment_failed_error_code is not defined history.js:64


history.js


function handleError( xhr, textStatus, errorThrown )

{

markComment( COLOR_RED );

window.alert( i18n_saving_comment_failed_error_code + ‘\n\n’ + xhr.responseText );

}


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

On Wed, Apr 9, 2014 at 3:29 PM, Lars Helge Øverland larshelge@gmail.com wrote:

The cell border will be green for fields which have comments (next time you open that form).

On Wed, Apr 9, 2014 at 10:27 AM, channara rin rin.channara@gmail.com wrote:

Great, Thank you.
SO i need to modify the 360 in history.js file?

AND another problem is. when has comment, can show highlight data value in dataset that has text in that comment? SO it is easy for us(M&E staff) to view if that data value has comment…

Thank you

CHANNARA

On Wed, Apr 9, 2014 at 3:02 PM, Lars Helge Øverland larshelge@gmail.com wrote:

Hi Channara,

the max is actually 255 characters, backed by a “varchar” column in the database. I’m sorry but we don’t plan to change it to a “text” type column anytime soon - reason is just that most comments are pretty short and “text” requires more storage space on disk.

Now that said you are of course free to change the column type to text directly in your database, and then apply the patch copied below this email to remove the validation.

regards,

Lars


=== modified file ‘dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/history.js’

— dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/history.js 2014-02-27 04:15:35 +0000

+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/history.js 2014-04-09 08:01:57 +0000

@@ -5,14 +5,6 @@

var commentValue = $( ‘#commentTextArea’ ).val();

  • if ( commentValue.length > 360 )
  • {
  •    markComment( COLOR_YELLOW );
    
  •    window.alert(i18n_value_too_long + " for comment field");
    
  •    return;
    
  • }

var commentSaver = new CommentSaver( currentDataElementId, currentOptionComboId, commentValue );

commentSaver.save();

On Wed, Apr 9, 2014 at 6:55 AM, channara rin rin.channara@gmail.com wrote:

Dear All,
I found that, in the Comment in data value in dataset is limit character around 360characters.

Can we extend to unlimited characters for comments?

Thank you

CHANNARA


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp