WebApi failing Email, FileResources and

Hi Mike

I’m adding in the dev list, and Halvdan (who knows about file resource API). I will have a look at the start as app functionality.

···

On Thu, Jun 2, 2016 at 5:00 PM, Mike Nelushi mikeevolution@gmail.com wrote:

Hi Calle,

Apologies, forgot to add you on this thread.

Regards

Mike

On 2 Jun 2016 11:35, “Mike Nelushi” mikeevolution@gmail.com wrote:

Hi Morten,

Its Mike here from HISP-SA.

We have been strangling to send email to individual users on our new Community Service Application which is going live tomorrow. At the moment when I send an email to individuals it sends to everyone who is a DHIS2 user. Im user the dhis2.23 messageConversations web-api for this.

A. The following are the two json objects I’ve used, the first one doesn’t send messages at all the messages stays on dhis2 mail.

  1. var json_Data = {“subject”: subject, “text”: message, “users”: users};

2.var json_Data = {“subject”: subject, “text”: message, “users”: users, “organisationUnits”: organisationUnits};

The following is our email settings

B. Second Issue is that when we call fileResources webapi to save file is does work but when you retrieve the file it says the file was not saved. The following is the object:

var file = item[0].files[0];

var formData = new FormData();

formData.append(‘file’, file);

C. The start page function on Appearance settings is not working if you choice your own custom APP, when logging in it does it go to the landing page instead it goes to index.action.

Can you please help us with this issues?

Regards,

Mike


Morten

Hi

Yes, there is an issue with start page as app, I have notified the developers of the settings app

···

On Fri, Jun 3, 2016 at 9:58 AM, Morten Olav Hansen morten@dhis2.org wrote:

Hi Mike

I’m adding in the dev list, and Halvdan (who knows about file resource API). I will have a look at the start as app functionality.


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

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org


Morten

On Thu, Jun 2, 2016 at 5:00 PM, Mike Nelushi mikeevolution@gmail.com wrote:

Hi Calle,

Apologies, forgot to add you on this thread.

Regards

Mike

On 2 Jun 2016 11:35, “Mike Nelushi” mikeevolution@gmail.com wrote:

Hi Morten,

Its Mike here from HISP-SA.

We have been strangling to send email to individual users on our new Community Service Application which is going live tomorrow. At the moment when I send an email to individuals it sends to everyone who is a DHIS2 user. Im user the dhis2.23 messageConversations web-api for this.

A. The following are the two json objects I’ve used, the first one doesn’t send messages at all the messages stays on dhis2 mail.

  1. var json_Data = {“subject”: subject, “text”: message, “users”: users};

2.var json_Data = {“subject”: subject, “text”: message, “users”: users, “organisationUnits”: organisationUnits};

The following is our email settings

B. Second Issue is that when we call fileResources webapi to save file is does work but when you retrieve the file it says the file was not saved. The following is the object:

var file = item[0].files[0];

var formData = new FormData();

formData.append(‘file’, file);

C. The start page function on Appearance settings is not working if you choice your own custom APP, when logging in it does it go to the landing page instead it goes to index.action.

Can you please help us with this issues?

Regards,

Mike

Hi Mike,

In relation to api/fileResources I’m going to need more details: which version are you on, exactly what are you trying to do, etc. A full list of typically needed details can be found here, but specifically I’ll need to know whether there are any thrown errors on the server, what HTTP response you are getting and so forth.

Also, have you familiarised yourself with the documentation for the fileResource API ? In particular make sure to read and understand the constraints (i.e. a FR must be referenced by a DataValue).

···

On Fri, Jun 3, 2016 at 4:58 AM, Morten Olav Hansen morten@dhis2.org wrote:

Hi Mike

I’m adding in the dev list, and Halvdan (who knows about file resource API). I will have a look at the start as app functionality.


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


Morten

On Thu, Jun 2, 2016 at 5:00 PM, Mike Nelushi mikeevolution@gmail.com wrote:

Hi Calle,

Apologies, forgot to add you on this thread.

Regards

Mike

On 2 Jun 2016 11:35, “Mike Nelushi” mikeevolution@gmail.com wrote:

Hi Morten,

Its Mike here from HISP-SA.

We have been strangling to send email to individual users on our new Community Service Application which is going live tomorrow. At the moment when I send an email to individuals it sends to everyone who is a DHIS2 user. Im user the dhis2.23 messageConversations web-api for this.

A. The following are the two json objects I’ve used, the first one doesn’t send messages at all the messages stays on dhis2 mail.

  1. var json_Data = {“subject”: subject, “text”: message, “users”: users};

2.var json_Data = {“subject”: subject, “text”: message, “users”: users, “organisationUnits”: organisationUnits};

The following is our email settings

B. Second Issue is that when we call fileResources webapi to save file is does work but when you retrieve the file it says the file was not saved. The following is the object:

var file = item[0].files[0];

var formData = new FormData();

formData.append(‘file’, file);

C. The start page function on Appearance settings is not working if you choice your own custom APP, when logging in it does it go to the landing page instead it goes to index.action.

Can you please help us with this issues?

Regards,

Mike

Halvdan Hoem Grelland

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

I’ve now fixed this bug in the settings app and backported to 2.23 and 2.22.

···

On Fri, Jun 3, 2016 at 11:05 AM, Halvdan Hoem Grelland halvdan@dhis2.org wrote:

Hi Mike,

In relation to api/fileResources I’m going to need more details: which version are you on, exactly what are you trying to do, etc. A full list of typically needed details can be found here, but specifically I’ll need to know whether there are any thrown errors on the server, what HTTP response you are getting and so forth.

Also, have you familiarised yourself with the documentation for the fileResource API ? In particular make sure to read and understand the constraints (i.e. a FR must be referenced by a DataValue).


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

Nicolay Ramm

Front end developer, DHIS 2

University of Oslo

https://www.dhis2.org

On Fri, Jun 3, 2016 at 4:58 AM, Morten Olav Hansen morten@dhis2.org wrote:

Hi Mike

I’m adding in the dev list, and Halvdan (who knows about file resource API). I will have a look at the start as app functionality.


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


Halvdan Hoem Grelland

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org


Morten

On Thu, Jun 2, 2016 at 5:00 PM, Mike Nelushi mikeevolution@gmail.com wrote:

Hi Calle,

Apologies, forgot to add you on this thread.

Regards

Mike

On 2 Jun 2016 11:35, “Mike Nelushi” mikeevolution@gmail.com wrote:

Hi Morten,

Its Mike here from HISP-SA.

We have been strangling to send email to individual users on our new Community Service Application which is going live tomorrow. At the moment when I send an email to individuals it sends to everyone who is a DHIS2 user. Im user the dhis2.23 messageConversations web-api for this.

A. The following are the two json objects I’ve used, the first one doesn’t send messages at all the messages stays on dhis2 mail.

  1. var json_Data = {“subject”: subject, “text”: message, “users”: users};

2.var json_Data = {“subject”: subject, “text”: message, “users”: users, “organisationUnits”: organisationUnits};

The following is our email settings

B. Second Issue is that when we call fileResources webapi to save file is does work but when you retrieve the file it says the file was not saved. The following is the object:

var file = item[0].files[0];

var formData = new FormData();

formData.append(‘file’, file);

C. The start page function on Appearance settings is not working if you choice your own custom APP, when logging in it does it go to the landing page instead it goes to index.action.

Can you please help us with this issues?

Regards,

Mike

Hi Halvdan,

We are using version 2.23. The application uses a tracker program and its suppose to store documents for each user. I can store the file using fileResources api, and the response storageStatus=PENDING with no errors thrown. So from the response object I have to create a dataValue(using DE of type file) then “Store the retrieved id as the value to that data value”. Am I correct?

Regards,

Mike

···

On Fri, Jun 3, 2016 at 11:05 AM, Halvdan Hoem Grelland halvdan@dhis2.org wrote:

Hi Mike,

In relation to api/fileResources I’m going to need more details: which version are you on, exactly what are you trying to do, etc. A full list of typically needed details can be found here, but specifically I’ll need to know whether there are any thrown errors on the server, what HTTP response you are getting and so forth.

Also, have you familiarised yourself with the documentation for the fileResource API ? In particular make sure to read and understand the constraints (i.e. a FR must be referenced by a DataValue).

On Fri, Jun 3, 2016 at 4:58 AM, Morten Olav Hansen morten@dhis2.org wrote:

Hi Mike

I’m adding in the dev list, and Halvdan (who knows about file resource API). I will have a look at the start as app functionality.


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


Halvdan Hoem Grelland

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org


Morten

On Thu, Jun 2, 2016 at 5:00 PM, Mike Nelushi mikeevolution@gmail.com wrote:

Hi Calle,

Apologies, forgot to add you on this thread.

Regards

Mike

On 2 Jun 2016 11:35, “Mike Nelushi” mikeevolution@gmail.com wrote:

Hi Morten,

Its Mike here from HISP-SA.

We have been strangling to send email to individual users on our new Community Service Application which is going live tomorrow. At the moment when I send an email to individuals it sends to everyone who is a DHIS2 user. Im user the dhis2.23 messageConversations web-api for this.

A. The following are the two json objects I’ve used, the first one doesn’t send messages at all the messages stays on dhis2 mail.

  1. var json_Data = {“subject”: subject, “text”: message, “users”: users};

2.var json_Data = {“subject”: subject, “text”: message, “users”: users, “organisationUnits”: organisationUnits};

The following is our email settings

B. Second Issue is that when we call fileResources webapi to save file is does work but when you retrieve the file it says the file was not saved. The following is the object:

var file = item[0].files[0];

var formData = new FormData();

formData.append(‘file’, file);

C. The start page function on Appearance settings is not working if you choice your own custom APP, when logging in it does it go to the landing page instead it goes to index.action.

Can you please help us with this issues?

Regards,

Mike

Hi Morten,

The messageConversations web-api is still a big issue because we need to send each user specific information to their e-mails.

  1. Using {“subject”: subject, “text”: message, “users”: user} json object, the mail gets stored on DHIS2 mail and does not send it to the user e-mail.

LogUtil.java [http-apr-8080-exec-3])

  • INFO 2016-05-29 14:14:52,484 Invoking message sender: $Proxy53 (DefaultMessageService.java [http-apr-8080-exec-3])

  • INFO 2016-05-29 14:14:52,529 Invoking message sender: SmsMessageSender (DefaultMessageService.java [http-apr-8080-exec-3])

  • ERROR 2016-05-29 14:14:52,579 Unexpected error occurred invoking async method 'public java.lang.String org.hisp.dhis.message.EmailMessageSender.sendMessage(java.lang.String,java.lang.String,jav

a.lang.String,org.hisp.dhis.user.User,java.util.Set,boolean)’. (SimpleAsyncUncaughtExceptionHandler.java [taskScheduler-7])

org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: org.hisp.dhis.user.User.organisationUnits, could not initialize proxy - no Session

    at org.hibernate.collection.internal.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:569)

    at org.hibernate.collection.internal.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:188)

    at org.hibernate.collection.internal.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:139)

    at org.hibernate.collection.internal.PersistentSet.size(PersistentSet.java:156)

    at org.hisp.dhis.common.IdentifiableObjectUtils.join(IdentifiableObjectUtils.java:76)

    at org.hisp.dhis.user.User.getOrganisationUnitsName(User.java:288)

    at org.hisp.dhis.message.EmailMessageSender.renderPlainContent(EmailMessageSender.java:188)

    at org.hisp.dhis.message.EmailMessageSender.sendMessage(EmailMessageSender.java:115)

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

    at java.lang.reflect.Method.invoke(Method.java:498)

    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)

    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)

    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)

    at org.springframework.aop.interceptor.AsyncExecutionInterceptor$1.call(AsyncExecutionInterceptor.java:108)

    at java.util.concurrent.FutureTask.run(FutureTask.java:266)

    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)

    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)

    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

    at java.lang.Thread.run(Thread.java:745)

2, Using {“subject”: subject, “text”: message, “users”: users, “organisationUnits”: organisationUnits}, sends email to everyone in the Orgunit and we want to send to individuals.

Please advice.

Regards,

Mike

···

On Fri, Jun 3, 2016 at 4:58 AM, Morten Olav Hansen morten@dhis2.org wrote:

Hi Mike

I’m adding in the dev list, and Halvdan (who knows about file resource API). I will have a look at the start as app functionality.


Morten

On Thu, Jun 2, 2016 at 5:00 PM, Mike Nelushi mikeevolution@gmail.com wrote:

Hi Calle,

Apologies, forgot to add you on this thread.

Regards

Mike

On 2 Jun 2016 11:35, “Mike Nelushi” mikeevolution@gmail.com wrote:

Hi Morten,

Its Mike here from HISP-SA.

We have been strangling to send email to individual users on our new Community Service Application which is going live tomorrow. At the moment when I send an email to individuals it sends to everyone who is a DHIS2 user. Im user the dhis2.23 messageConversations web-api for this.

A. The following are the two json objects I’ve used, the first one doesn’t send messages at all the messages stays on dhis2 mail.

  1. var json_Data = {“subject”: subject, “text”: message, “users”: users};

2.var json_Data = {“subject”: subject, “text”: message, “users”: users, “organisationUnits”: organisationUnits};

The following is our email settings

B. Second Issue is that when we call fileResources webapi to save file is does work but when you retrieve the file it says the file was not saved. The following is the object:

var file = item[0].files[0];

var formData = new FormData();

formData.append(‘file’, file);

C. The start page function on Appearance settings is not working if you choice your own custom APP, when logging in it does it go to the landing page instead it goes to index.action.

Can you please help us with this issues?

Regards,

Mike

Hi Mike

I’m adding in Lars… It’s been a while since i looked at it… but I don’t think that is how it was designed, if you select an org unit… it will send to EVERYBODY connected to that (kinda like when you assign an OU to a user), if you want to send to individual users… you need to select them manually…

···

On Fri, Jun 3, 2016 at 6:24 PM, Mike Nelushi mikeevolution@gmail.com wrote:

Hi Morten,

The messageConversations web-api is still a big issue because we need to send each user specific information to their e-mails.

  1. Using {“subject”: subject, “text”: message, “users”: user} json object, the mail gets stored on DHIS2 mail and does not send it to the user e-mail.

LogUtil.java [http-apr-8080-exec-3])

  • INFO 2016-05-29 14:14:52,484 Invoking message sender: $Proxy53 (DefaultMessageService.java [http-apr-8080-exec-3])
  • INFO 2016-05-29 14:14:52,529 Invoking message sender: SmsMessageSender (DefaultMessageService.java [http-apr-8080-exec-3])
  • ERROR 2016-05-29 14:14:52,579 Unexpected error occurred invoking async method 'public java.lang.String org.hisp.dhis.message.EmailMessageSender.sendMessage(java.lang.String,java.lang.String,jav

a.lang.String,org.hisp.dhis.user.User,java.util.Set,boolean)’. (SimpleAsyncUncaughtExceptionHandler.java [taskScheduler-7])

org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: org.hisp.dhis.user.User.organisationUnits, could not initialize proxy - no Session

    at org.hibernate.collection.internal.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:569)
    at org.hibernate.collection.internal.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:188)
    at org.hibernate.collection.internal.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:139)
    at org.hibernate.collection.internal.PersistentSet.size(PersistentSet.java:156)
    at org.hisp.dhis.common.IdentifiableObjectUtils.join(IdentifiableObjectUtils.java:76)
    at org.hisp.dhis.user.User.getOrganisationUnitsName(User.java:288)
    at org.hisp.dhis.message.EmailMessageSender.renderPlainContent(EmailMessageSender.java:188)
    at org.hisp.dhis.message.EmailMessageSender.sendMessage(EmailMessageSender.java:115)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
    at org.springframework.aop.interceptor.AsyncExecutionInterceptor$1.call(AsyncExecutionInterceptor.java:108)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

2, Using {“subject”: subject, “text”: message, “users”: users, “organisationUnits”: organisationUnits}, sends email to everyone in the Orgunit and we want to send to individuals.

Please advice.

Regards,

Mike

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Fri, Jun 3, 2016 at 4:58 AM, Morten Olav Hansen morten@dhis2.org wrote:

Hi Mike

I’m adding in the dev list, and Halvdan (who knows about file resource API). I will have a look at the start as app functionality.


Morten

On Thu, Jun 2, 2016 at 5:00 PM, Mike Nelushi mikeevolution@gmail.com wrote:

Hi Calle,

Apologies, forgot to add you on this thread.

Regards

Mike

On 2 Jun 2016 11:35, “Mike Nelushi” mikeevolution@gmail.com wrote:

Hi Morten,

Its Mike here from HISP-SA.

We have been strangling to send email to individual users on our new Community Service Application which is going live tomorrow. At the moment when I send an email to individuals it sends to everyone who is a DHIS2 user. Im user the dhis2.23 messageConversations web-api for this.

A. The following are the two json objects I’ve used, the first one doesn’t send messages at all the messages stays on dhis2 mail.

  1. var json_Data = {“subject”: subject, “text”: message, “users”: users};

2.var json_Data = {“subject”: subject, “text”: message, “users”: users, “organisationUnits”: organisationUnits};

The following is our email settings

B. Second Issue is that when we call fileResources webapi to save file is does work but when you retrieve the file it says the file was not saved. The following is the object:

var file = item[0].files[0];

var formData = new FormData();

formData.append(‘file’, file);

C. The start page function on Appearance settings is not working if you choice your own custom APP, when logging in it does it go to the landing page instead it goes to index.action.

Can you please help us with this issues?

Regards,

Mike

Hi

The exact version is 2.23 version 22977, build date 26th May 2016

regards

Calle

···

On 3 June 2016 at 13:24, Mike Nelushi mikeevolution@gmail.com wrote:

Hi Morten,

The messageConversations web-api is still a big issue because we need to send each user specific information to their e-mails.

  1. Using {“subject”: subject, “text”: message, “users”: user} json object, the mail gets stored on DHIS2 mail and does not send it to the user e-mail.

LogUtil.java [http-apr-8080-exec-3])

  • INFO 2016-05-29 14:14:52,484 Invoking message sender: $Proxy53 (DefaultMessageService.java [http-apr-8080-exec-3])
  • INFO 2016-05-29 14:14:52,529 Invoking message sender: SmsMessageSender (DefaultMessageService.java [http-apr-8080-exec-3])
  • ERROR 2016-05-29 14:14:52,579 Unexpected error occurred invoking async method 'public java.lang.String org.hisp.dhis.message.EmailMessageSender.sendMessage(java.lang.String,java.lang.String,jav

a.lang.String,org.hisp.dhis.user.User,java.util.Set,boolean)’. (SimpleAsyncUncaughtExceptionHandler.java [taskScheduler-7])

org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: org.hisp.dhis.user.User.organisationUnits, could not initialize proxy - no Session

    at org.hibernate.collection.internal.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:569)
    at org.hibernate.collection.internal.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:188)
    at org.hibernate.collection.internal.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:139)
    at org.hibernate.collection.internal.PersistentSet.size(PersistentSet.java:156)
    at org.hisp.dhis.common.IdentifiableObjectUtils.join(IdentifiableObjectUtils.java:76)
    at org.hisp.dhis.user.User.getOrganisationUnitsName(User.java:288)
    at org.hisp.dhis.message.EmailMessageSender.renderPlainContent(EmailMessageSender.java:188)
    at org.hisp.dhis.message.EmailMessageSender.sendMessage(EmailMessageSender.java:115)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
    at org.springframework.aop.interceptor.AsyncExecutionInterceptor$1.call(AsyncExecutionInterceptor.java:108)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

2, Using {“subject”: subject, “text”: message, “users”: users, “organisationUnits”: organisationUnits}, sends email to everyone in the Orgunit and we want to send to individuals.

Please advice.

Regards,

Mike

On Fri, Jun 3, 2016 at 4:58 AM, Morten Olav Hansen morten@dhis2.org wrote:

Hi Mike

I’m adding in the dev list, and Halvdan (who knows about file resource API). I will have a look at the start as app functionality.


Morten

On Thu, Jun 2, 2016 at 5:00 PM, Mike Nelushi mikeevolution@gmail.com wrote:

Hi Calle,

Apologies, forgot to add you on this thread.

Regards

Mike

On 2 Jun 2016 11:35, “Mike Nelushi” mikeevolution@gmail.com wrote:

Hi Morten,

Its Mike here from HISP-SA.

We have been strangling to send email to individual users on our new Community Service Application which is going live tomorrow. At the moment when I send an email to individuals it sends to everyone who is a DHIS2 user. Im user the dhis2.23 messageConversations web-api for this.

A. The following are the two json objects I’ve used, the first one doesn’t send messages at all the messages stays on dhis2 mail.

  1. var json_Data = {“subject”: subject, “text”: message, “users”: users};

2.var json_Data = {“subject”: subject, “text”: message, “users”: users, “organisationUnits”: organisationUnits};

The following is our email settings

B. Second Issue is that when we call fileResources webapi to save file is does work but when you retrieve the file it says the file was not saved. The following is the object:

var file = item[0].files[0];

var formData = new FormData();

formData.append(‘file’, file);

C. The start page function on Appearance settings is not working if you choice your own custom APP, when logging in it does it go to the landing page instead it goes to index.action.

Can you please help us with this issues?

Regards,

Mike


Calle Hedberg

46D Alma Road, 7700 Rosebank, SOUTH AFRICA

Tel/fax (home): +27-21-685-6472

Cell: +27-82-853-5352

Iridium SatPhone: +8816-315-19119

Email: calle.hedberg@gmail.com

Skype: calle_hedberg


Before Lars answers

Mike, can you provide us with a detailed bug report on launchpad? it will help us track this bug, I can have a look on Monday

···

On Fri, Jun 3, 2016 at 6:26 PM, Morten Olav Hansen morten@dhis2.org wrote:

Hi Mike

I’m adding in Lars… It’s been a while since i looked at it… but I don’t think that is how it was designed, if you select an org unit… it will send to EVERYBODY connected to that (kinda like when you assign an OU to a user), if you want to send to individual users… you need to select them manually…

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Fri, Jun 3, 2016 at 6:24 PM, Mike Nelushi mikeevolution@gmail.com wrote:

Hi Morten,

The messageConversations web-api is still a big issue because we need to send each user specific information to their e-mails.

  1. Using {“subject”: subject, “text”: message, “users”: user} json object, the mail gets stored on DHIS2 mail and does not send it to the user e-mail.

LogUtil.java [http-apr-8080-exec-3])

  • INFO 2016-05-29 14:14:52,484 Invoking message sender: $Proxy53 (DefaultMessageService.java [http-apr-8080-exec-3])
  • INFO 2016-05-29 14:14:52,529 Invoking message sender: SmsMessageSender (DefaultMessageService.java [http-apr-8080-exec-3])
  • ERROR 2016-05-29 14:14:52,579 Unexpected error occurred invoking async method 'public java.lang.String org.hisp.dhis.message.EmailMessageSender.sendMessage(java.lang.String,java.lang.String,jav

a.lang.String,org.hisp.dhis.user.User,java.util.Set,boolean)’. (SimpleAsyncUncaughtExceptionHandler.java [taskScheduler-7])

org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: org.hisp.dhis.user.User.organisationUnits, could not initialize proxy - no Session

    at org.hibernate.collection.internal.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:569)
    at org.hibernate.collection.internal.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:188)
    at org.hibernate.collection.internal.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:139)
    at org.hibernate.collection.internal.PersistentSet.size(PersistentSet.java:156)
    at org.hisp.dhis.common.IdentifiableObjectUtils.join(IdentifiableObjectUtils.java:76)
    at org.hisp.dhis.user.User.getOrganisationUnitsName(User.java:288)
    at org.hisp.dhis.message.EmailMessageSender.renderPlainContent(EmailMessageSender.java:188)
    at org.hisp.dhis.message.EmailMessageSender.sendMessage(EmailMessageSender.java:115)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
    at org.springframework.aop.interceptor.AsyncExecutionInterceptor$1.call(AsyncExecutionInterceptor.java:108)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

2, Using {“subject”: subject, “text”: message, “users”: users, “organisationUnits”: organisationUnits}, sends email to everyone in the Orgunit and we want to send to individuals.

Please advice.

Regards,

Mike

On Fri, Jun 3, 2016 at 4:58 AM, Morten Olav Hansen morten@dhis2.org wrote:

Hi Mike

I’m adding in the dev list, and Halvdan (who knows about file resource API). I will have a look at the start as app functionality.


Morten

On Thu, Jun 2, 2016 at 5:00 PM, Mike Nelushi mikeevolution@gmail.com wrote:

Hi Calle,

Apologies, forgot to add you on this thread.

Regards

Mike

On 2 Jun 2016 11:35, “Mike Nelushi” mikeevolution@gmail.com wrote:

Hi Morten,

Its Mike here from HISP-SA.

We have been strangling to send email to individual users on our new Community Service Application which is going live tomorrow. At the moment when I send an email to individuals it sends to everyone who is a DHIS2 user. Im user the dhis2.23 messageConversations web-api for this.

A. The following are the two json objects I’ve used, the first one doesn’t send messages at all the messages stays on dhis2 mail.

  1. var json_Data = {“subject”: subject, “text”: message, “users”: users};

2.var json_Data = {“subject”: subject, “text”: message, “users”: users, “organisationUnits”: organisationUnits};

The following is our email settings

B. Second Issue is that when we call fileResources webapi to save file is does work but when you retrieve the file it says the file was not saved. The following is the object:

var file = item[0].files[0];

var formData = new FormData();

formData.append(‘file’, file);

C. The start page function on Appearance settings is not working if you choice your own custom APP, when logging in it does it go to the landing page instead it goes to index.action.

Can you please help us with this issues?

Regards,

Mike

Hi,

Since this instance is innovative and handling a somewhat unusual scenario, it might be helpful to understand the background and conceptual design:

South Africa requires around 10,000 new health graduates (doctors, nurses, physiotherapists and other professions allied to medicine) to do one year of Community Service after graduation every year, and before they take up normal work. Medical doctors also do internships in various accredited hospitals as part of their practical studies.

The CommServe instance contain routine data about the number of community service or internship positions at all relevant health facilities, together with some information on things like available accommodation and distance to the nearest town, contact details, etc.

Using a newly developed app, each of the ~10,000 graduates will in the REGISTRATION phase

(a) register as a DHIS user (user reg)

(b) register as an applicant and submit relevant demography and contact details about themselves (TRACKER app)

© submit relevant scanned PDF documents (copy of ID/Passport, marriage certificate, graduation results, etc)

(d) be allocated a “PIN-code” that ensures that the candidate (and ONLY that candidate) can log in again to the same registered “account”

(e) having the pin-code emailed to themselves (and nobody else) after the registration process is completed, so that they don’t forget it.

Logging in again to the same account using the pin-code, each graduate will in the first/second/third APPLICATION phase

(a) view available posts according to their profession (and in some cases their location or bursary status)

(b) select five facilities of their choice for their community service or internship.

After each phase, the system is running a number of algorithms to allocate graduates to health facilities, with confirmation emails / SMSs sent out to each individual.

Every allocation means that applicant is not required to re-apply and the post is removed from the available pool.

Those applicants not successful in round 1 because the applied only for over-subscribed posts (where allocation will be done by lottery, so to say) will go to round 2 and possibly 3.

In round 2 or 3, remaining applicants will again apply for 5 priority postings among those remaining.

As should be obvious from the above, it is critical that we are able to send emails to each applicant individually, and it is also critical to ensure that the uploading of scanned documents works as expected (NOTE: we hope to be able to restrict such uploads to PDF format only, and preferably also to a maximum size. Having applicants just using their smart-phones to snap large-size pictures of documents is to be avoided).

This is a high-profile application and it has already been approved by the National Health Council, so it is critical to get the last few bugs ironed out.

Regards

Calle

···

On 3 June 2016 at 13:27, Morten Olav Hansen morten@dhis2.org wrote:

Before Lars answers

Mike, can you provide us with a detailed bug report on launchpad? it will help us track this bug, I can have a look on Monday

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Fri, Jun 3, 2016 at 6:26 PM, Morten Olav Hansen morten@dhis2.org wrote:

Hi Mike

I’m adding in Lars… It’s been a while since i looked at it… but I don’t think that is how it was designed, if you select an org unit… it will send to EVERYBODY connected to that (kinda like when you assign an OU to a user), if you want to send to individual users… you need to select them manually…

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Fri, Jun 3, 2016 at 6:24 PM, Mike Nelushi mikeevolution@gmail.com wrote:

Hi Morten,

The messageConversations web-api is still a big issue because we need to send each user specific information to their e-mails.

  1. Using {“subject”: subject, “text”: message, “users”: user} json object, the mail gets stored on DHIS2 mail and does not send it to the user e-mail.

LogUtil.java [http-apr-8080-exec-3])

  • INFO 2016-05-29 14:14:52,484 Invoking message sender: $Proxy53 (DefaultMessageService.java [http-apr-8080-exec-3])
  • INFO 2016-05-29 14:14:52,529 Invoking message sender: SmsMessageSender (DefaultMessageService.java [http-apr-8080-exec-3])
  • ERROR 2016-05-29 14:14:52,579 Unexpected error occurred invoking async method 'public java.lang.String org.hisp.dhis.message.EmailMessageSender.sendMessage(java.lang.String,java.lang.String,jav

a.lang.String,org.hisp.dhis.user.User,java.util.Set,boolean)’. (SimpleAsyncUncaughtExceptionHandler.java [taskScheduler-7])

org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: org.hisp.dhis.user.User.organisationUnits, could not initialize proxy - no Session

    at org.hibernate.collection.internal.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:569)
    at org.hibernate.collection.internal.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:188)
    at org.hibernate.collection.internal.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:139)
    at org.hibernate.collection.internal.PersistentSet.size(PersistentSet.java:156)
    at org.hisp.dhis.common.IdentifiableObjectUtils.join(IdentifiableObjectUtils.java:76)
    at org.hisp.dhis.user.User.getOrganisationUnitsName(User.java:288)
    at org.hisp.dhis.message.EmailMessageSender.renderPlainContent(EmailMessageSender.java:188)
    at org.hisp.dhis.message.EmailMessageSender.sendMessage(EmailMessageSender.java:115)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
    at org.springframework.aop.interceptor.AsyncExecutionInterceptor$1.call(AsyncExecutionInterceptor.java:108)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

2, Using {“subject”: subject, “text”: message, “users”: users, “organisationUnits”: organisationUnits}, sends email to everyone in the Orgunit and we want to send to individuals.

Please advice.

Regards,

Mike

On Fri, Jun 3, 2016 at 4:58 AM, Morten Olav Hansen morten@dhis2.org wrote:

Hi Mike

I’m adding in the dev list, and Halvdan (who knows about file resource API). I will have a look at the start as app functionality.


Morten

On Thu, Jun 2, 2016 at 5:00 PM, Mike Nelushi mikeevolution@gmail.com wrote:

Hi Calle,

Apologies, forgot to add you on this thread.

Regards

Mike

On 2 Jun 2016 11:35, “Mike Nelushi” mikeevolution@gmail.com wrote:

Hi Morten,

Its Mike here from HISP-SA.

We have been strangling to send email to individual users on our new Community Service Application which is going live tomorrow. At the moment when I send an email to individuals it sends to everyone who is a DHIS2 user. Im user the dhis2.23 messageConversations web-api for this.

A. The following are the two json objects I’ve used, the first one doesn’t send messages at all the messages stays on dhis2 mail.

  1. var json_Data = {“subject”: subject, “text”: message, “users”: users};

2.var json_Data = {“subject”: subject, “text”: message, “users”: users, “organisationUnits”: organisationUnits};

The following is our email settings

B. Second Issue is that when we call fileResources webapi to save file is does work but when you retrieve the file it says the file was not saved. The following is the object:

var file = item[0].files[0];

var formData = new FormData();

formData.append(‘file’, file);

C. The start page function on Appearance settings is not working if you choice your own custom APP, when logging in it does it go to the landing page instead it goes to index.action.

Can you please help us with this issues?

Regards,

Mike


Calle Hedberg

46D Alma Road, 7700 Rosebank, SOUTH AFRICA

Tel/fax (home): +27-21-685-6472

Cell: +27-82-853-5352

Iridium SatPhone: +8816-315-19119

Email: calle.hedberg@gmail.com

Skype: calle_hedberg


Hi Calle

Out of curiosity… how can they login with this “PIN-code” is it simply the set password for their account?

···

On Fri, Jun 3, 2016 at 6:52 PM, Calle Hedberg calle.hedberg@gmail.com wrote:

Hi,

Since this instance is innovative and handling a somewhat unusual scenario, it might be helpful to understand the background and conceptual design:

South Africa requires around 10,000 new health graduates (doctors, nurses, physiotherapists and other professions allied to medicine) to do one year of Community Service after graduation every year, and before they take up normal work. Medical doctors also do internships in various accredited hospitals as part of their practical studies.

The CommServe instance contain routine data about the number of community service or internship positions at all relevant health facilities, together with some information on things like available accommodation and distance to the nearest town, contact details, etc.

Using a newly developed app, each of the ~10,000 graduates will in the REGISTRATION phase

(a) register as a DHIS user (user reg)

(b) register as an applicant and submit relevant demography and contact details about themselves (TRACKER app)

© submit relevant scanned PDF documents (copy of ID/Passport, marriage certificate, graduation results, etc)

(d) be allocated a “PIN-code” that ensures that the candidate (and ONLY that candidate) can log in again to the same registered “account”

(e) having the pin-code emailed to themselves (and nobody else) after the registration process is completed, so that they don’t forget it.

Logging in again to the same account using the pin-code, each graduate will in the first/second/third APPLICATION phase

(a) view available posts according to their profession (and in some cases their location or bursary status)

(b) select five facilities of their choice for their community service or internship.

After each phase, the system is running a number of algorithms to allocate graduates to health facilities, with confirmation emails / SMSs sent out to each individual.

Every allocation means that applicant is not required to re-apply and the post is removed from the available pool.

Those applicants not successful in round 1 because the applied only for over-subscribed posts (where allocation will be done by lottery, so to say) will go to round 2 and possibly 3.

In round 2 or 3, remaining applicants will again apply for 5 priority postings among those remaining.

As should be obvious from the above, it is critical that we are able to send emails to each applicant individually, and it is also critical to ensure that the uploading of scanned documents works as expected (NOTE: we hope to be able to restrict such uploads to PDF format only, and preferably also to a maximum size. Having applicants just using their smart-phones to snap large-size pictures of documents is to be avoided).

This is a high-profile application and it has already been approved by the National Health Council, so it is critical to get the last few bugs ironed out.

Regards

Calle

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On 3 June 2016 at 13:27, Morten Olav Hansen morten@dhis2.org wrote:

Before Lars answers

Mike, can you provide us with a detailed bug report on launchpad? it will help us track this bug, I can have a look on Monday


Calle Hedberg

46D Alma Road, 7700 Rosebank, SOUTH AFRICA

Tel/fax (home): +27-21-685-6472

Cell: +27-82-853-5352

Iridium SatPhone: +8816-315-19119

Email: calle.hedberg@gmail.com

Skype: calle_hedberg


Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Fri, Jun 3, 2016 at 6:26 PM, Morten Olav Hansen morten@dhis2.org wrote:

Hi Mike

I’m adding in Lars… It’s been a while since i looked at it… but I don’t think that is how it was designed, if you select an org unit… it will send to EVERYBODY connected to that (kinda like when you assign an OU to a user), if you want to send to individual users… you need to select them manually…

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Fri, Jun 3, 2016 at 6:24 PM, Mike Nelushi mikeevolution@gmail.com wrote:

Hi Morten,

The messageConversations web-api is still a big issue because we need to send each user specific information to their e-mails.

  1. Using {“subject”: subject, “text”: message, “users”: user} json object, the mail gets stored on DHIS2 mail and does not send it to the user e-mail.

LogUtil.java [http-apr-8080-exec-3])

  • INFO 2016-05-29 14:14:52,484 Invoking message sender: $Proxy53 (DefaultMessageService.java [http-apr-8080-exec-3])
  • INFO 2016-05-29 14:14:52,529 Invoking message sender: SmsMessageSender (DefaultMessageService.java [http-apr-8080-exec-3])
  • ERROR 2016-05-29 14:14:52,579 Unexpected error occurred invoking async method 'public java.lang.String org.hisp.dhis.message.EmailMessageSender.sendMessage(java.lang.String,java.lang.String,jav

a.lang.String,org.hisp.dhis.user.User,java.util.Set,boolean)’. (SimpleAsyncUncaughtExceptionHandler.java [taskScheduler-7])

org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: org.hisp.dhis.user.User.organisationUnits, could not initialize proxy - no Session

    at org.hibernate.collection.internal.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:569)
    at org.hibernate.collection.internal.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:188)
    at org.hibernate.collection.internal.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:139)
    at org.hibernate.collection.internal.PersistentSet.size(PersistentSet.java:156)
    at org.hisp.dhis.common.IdentifiableObjectUtils.join(IdentifiableObjectUtils.java:76)
    at org.hisp.dhis.user.User.getOrganisationUnitsName(User.java:288)
    at org.hisp.dhis.message.EmailMessageSender.renderPlainContent(EmailMessageSender.java:188)
    at org.hisp.dhis.message.EmailMessageSender.sendMessage(EmailMessageSender.java:115)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
    at org.springframework.aop.interceptor.AsyncExecutionInterceptor$1.call(AsyncExecutionInterceptor.java:108)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

2, Using {“subject”: subject, “text”: message, “users”: users, “organisationUnits”: organisationUnits}, sends email to everyone in the Orgunit and we want to send to individuals.

Please advice.

Regards,

Mike

On Fri, Jun 3, 2016 at 4:58 AM, Morten Olav Hansen morten@dhis2.org wrote:

Hi Mike

I’m adding in the dev list, and Halvdan (who knows about file resource API). I will have a look at the start as app functionality.


Morten

On Thu, Jun 2, 2016 at 5:00 PM, Mike Nelushi mikeevolution@gmail.com wrote:

Hi Calle,

Apologies, forgot to add you on this thread.

Regards

Mike

On 2 Jun 2016 11:35, “Mike Nelushi” mikeevolution@gmail.com wrote:

Hi Morten,

Its Mike here from HISP-SA.

We have been strangling to send email to individual users on our new Community Service Application which is going live tomorrow. At the moment when I send an email to individuals it sends to everyone who is a DHIS2 user. Im user the dhis2.23 messageConversations web-api for this.

A. The following are the two json objects I’ve used, the first one doesn’t send messages at all the messages stays on dhis2 mail.

  1. var json_Data = {“subject”: subject, “text”: message, “users”: users};

2.var json_Data = {“subject”: subject, “text”: message, “users”: users, “organisationUnits”: organisationUnits};

The following is our email settings

B. Second Issue is that when we call fileResources webapi to save file is does work but when you retrieve the file it says the file was not saved. The following is the object:

var file = item[0].files[0];

var formData = new FormData();

formData.append(‘file’, file);

C. The start page function on Appearance settings is not working if you choice your own custom APP, when logging in it does it go to the landing page instead it goes to index.action.

Can you please help us with this issues?

Regards,

Mike

Hi Morten,

The pinCode is not the the DHIS2-Account it is for specific program that they registered for. But the main thing is to be able to send emails and later sms because there will be a lot of notification/alerts to each user(e.g if they sent a wrong file).

Regards,

Mike

···

On Fri, Jun 3, 2016 at 2:05 PM, Morten Olav Hansen morten@dhis2.org wrote:

Hi Calle

Out of curiosity… how can they login with this “PIN-code” is it simply the set password for their account?

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Fri, Jun 3, 2016 at 6:52 PM, Calle Hedberg calle.hedberg@gmail.com wrote:

Hi,

Since this instance is innovative and handling a somewhat unusual scenario, it might be helpful to understand the background and conceptual design:

South Africa requires around 10,000 new health graduates (doctors, nurses, physiotherapists and other professions allied to medicine) to do one year of Community Service after graduation every year, and before they take up normal work. Medical doctors also do internships in various accredited hospitals as part of their practical studies.

The CommServe instance contain routine data about the number of community service or internship positions at all relevant health facilities, together with some information on things like available accommodation and distance to the nearest town, contact details, etc.

Using a newly developed app, each of the ~10,000 graduates will in the REGISTRATION phase

(a) register as a DHIS user (user reg)

(b) register as an applicant and submit relevant demography and contact details about themselves (TRACKER app)

© submit relevant scanned PDF documents (copy of ID/Passport, marriage certificate, graduation results, etc)

(d) be allocated a “PIN-code” that ensures that the candidate (and ONLY that candidate) can log in again to the same registered “account”

(e) having the pin-code emailed to themselves (and nobody else) after the registration process is completed, so that they don’t forget it.

Logging in again to the same account using the pin-code, each graduate will in the first/second/third APPLICATION phase

(a) view available posts according to their profession (and in some cases their location or bursary status)

(b) select five facilities of their choice for their community service or internship.

After each phase, the system is running a number of algorithms to allocate graduates to health facilities, with confirmation emails / SMSs sent out to each individual.

Every allocation means that applicant is not required to re-apply and the post is removed from the available pool.

Those applicants not successful in round 1 because the applied only for over-subscribed posts (where allocation will be done by lottery, so to say) will go to round 2 and possibly 3.

In round 2 or 3, remaining applicants will again apply for 5 priority postings among those remaining.

As should be obvious from the above, it is critical that we are able to send emails to each applicant individually, and it is also critical to ensure that the uploading of scanned documents works as expected (NOTE: we hope to be able to restrict such uploads to PDF format only, and preferably also to a maximum size. Having applicants just using their smart-phones to snap large-size pictures of documents is to be avoided).

This is a high-profile application and it has already been approved by the National Health Council, so it is critical to get the last few bugs ironed out.

Regards

Calle

On 3 June 2016 at 13:27, Morten Olav Hansen morten@dhis2.org wrote:

Before Lars answers

Mike, can you provide us with a detailed bug report on launchpad? it will help us track this bug, I can have a look on Monday


Calle Hedberg

46D Alma Road, 7700 Rosebank, SOUTH AFRICA

Tel/fax (home): +27-21-685-6472

Cell: +27-82-853-5352

Iridium SatPhone: +8816-315-19119

Email: calle.hedberg@gmail.com

Skype: calle_hedberg


Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Fri, Jun 3, 2016 at 6:26 PM, Morten Olav Hansen morten@dhis2.org wrote:

Hi Mike

I’m adding in Lars… It’s been a while since i looked at it… but I don’t think that is how it was designed, if you select an org unit… it will send to EVERYBODY connected to that (kinda like when you assign an OU to a user), if you want to send to individual users… you need to select them manually…

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Fri, Jun 3, 2016 at 6:24 PM, Mike Nelushi mikeevolution@gmail.com wrote:

Hi Morten,

The messageConversations web-api is still a big issue because we need to send each user specific information to their e-mails.

  1. Using {“subject”: subject, “text”: message, “users”: user} json object, the mail gets stored on DHIS2 mail and does not send it to the user e-mail.

LogUtil.java [http-apr-8080-exec-3])

  • INFO 2016-05-29 14:14:52,484 Invoking message sender: $Proxy53 (DefaultMessageService.java [http-apr-8080-exec-3])
  • INFO 2016-05-29 14:14:52,529 Invoking message sender: SmsMessageSender (DefaultMessageService.java [http-apr-8080-exec-3])
  • ERROR 2016-05-29 14:14:52,579 Unexpected error occurred invoking async method 'public java.lang.String org.hisp.dhis.message.EmailMessageSender.sendMessage(java.lang.String,java.lang.String,jav

a.lang.String,org.hisp.dhis.user.User,java.util.Set,boolean)’. (SimpleAsyncUncaughtExceptionHandler.java [taskScheduler-7])

org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: org.hisp.dhis.user.User.organisationUnits, could not initialize proxy - no Session

    at org.hibernate.collection.internal.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:569)
    at org.hibernate.collection.internal.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:188)
    at org.hibernate.collection.internal.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:139)
    at org.hibernate.collection.internal.PersistentSet.size(PersistentSet.java:156)
    at org.hisp.dhis.common.IdentifiableObjectUtils.join(IdentifiableObjectUtils.java:76)
    at org.hisp.dhis.user.User.getOrganisationUnitsName(User.java:288)
    at org.hisp.dhis.message.EmailMessageSender.renderPlainContent(EmailMessageSender.java:188)
    at org.hisp.dhis.message.EmailMessageSender.sendMessage(EmailMessageSender.java:115)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
    at org.springframework.aop.interceptor.AsyncExecutionInterceptor$1.call(AsyncExecutionInterceptor.java:108)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

2, Using {“subject”: subject, “text”: message, “users”: users, “organisationUnits”: organisationUnits}, sends email to everyone in the Orgunit and we want to send to individuals.

Please advice.

Regards,

Mike

On Fri, Jun 3, 2016 at 4:58 AM, Morten Olav Hansen morten@dhis2.org wrote:

Hi Mike

I’m adding in the dev list, and Halvdan (who knows about file resource API). I will have a look at the start as app functionality.


Morten

On Thu, Jun 2, 2016 at 5:00 PM, Mike Nelushi mikeevolution@gmail.com wrote:

Hi Calle,

Apologies, forgot to add you on this thread.

Regards

Mike

On 2 Jun 2016 11:35, “Mike Nelushi” mikeevolution@gmail.com wrote:

Hi Morten,

Its Mike here from HISP-SA.

We have been strangling to send email to individual users on our new Community Service Application which is going live tomorrow. At the moment when I send an email to individuals it sends to everyone who is a DHIS2 user. Im user the dhis2.23 messageConversations web-api for this.

A. The following are the two json objects I’ve used, the first one doesn’t send messages at all the messages stays on dhis2 mail.

  1. var json_Data = {“subject”: subject, “text”: message, “users”: users};

2.var json_Data = {“subject”: subject, “text”: message, “users”: users, “organisationUnits”: organisationUnits};

The following is our email settings

B. Second Issue is that when we call fileResources webapi to save file is does work but when you retrieve the file it says the file was not saved. The following is the object:

var file = item[0].files[0];

var formData = new FormData();

formData.append(‘file’, file);

C. The start page function on Appearance settings is not working if you choice your own custom APP, when logging in it does it go to the landing page instead it goes to index.action.

Can you please help us with this issues?

Regards,

Mike

Ok, I just saw Login using PIN-code for account, maybe you are using a custom apps for this…

I saw you bug report, we will have a look at it

···

On Fri, Jun 3, 2016 at 7:18 PM, Mike Nelushi mikeevolution@gmail.com wrote:

Hi Morten,

The pinCode is not the the DHIS2-Account it is for specific program that they registered for. But the main thing is to be able to send emails and later sms because there will be a lot of notification/alerts to each user(e.g if they sent a wrong file).

Regards,

Mike

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Fri, Jun 3, 2016 at 2:05 PM, Morten Olav Hansen morten@dhis2.org wrote:

Hi Calle

Out of curiosity… how can they login with this “PIN-code” is it simply the set password for their account?

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Fri, Jun 3, 2016 at 6:52 PM, Calle Hedberg calle.hedberg@gmail.com wrote:

Hi,

Since this instance is innovative and handling a somewhat unusual scenario, it might be helpful to understand the background and conceptual design:

South Africa requires around 10,000 new health graduates (doctors, nurses, physiotherapists and other professions allied to medicine) to do one year of Community Service after graduation every year, and before they take up normal work. Medical doctors also do internships in various accredited hospitals as part of their practical studies.

The CommServe instance contain routine data about the number of community service or internship positions at all relevant health facilities, together with some information on things like available accommodation and distance to the nearest town, contact details, etc.

Using a newly developed app, each of the ~10,000 graduates will in the REGISTRATION phase

(a) register as a DHIS user (user reg)

(b) register as an applicant and submit relevant demography and contact details about themselves (TRACKER app)

© submit relevant scanned PDF documents (copy of ID/Passport, marriage certificate, graduation results, etc)

(d) be allocated a “PIN-code” that ensures that the candidate (and ONLY that candidate) can log in again to the same registered “account”

(e) having the pin-code emailed to themselves (and nobody else) after the registration process is completed, so that they don’t forget it.

Logging in again to the same account using the pin-code, each graduate will in the first/second/third APPLICATION phase

(a) view available posts according to their profession (and in some cases their location or bursary status)

(b) select five facilities of their choice for their community service or internship.

After each phase, the system is running a number of algorithms to allocate graduates to health facilities, with confirmation emails / SMSs sent out to each individual.

Every allocation means that applicant is not required to re-apply and the post is removed from the available pool.

Those applicants not successful in round 1 because the applied only for over-subscribed posts (where allocation will be done by lottery, so to say) will go to round 2 and possibly 3.

In round 2 or 3, remaining applicants will again apply for 5 priority postings among those remaining.

As should be obvious from the above, it is critical that we are able to send emails to each applicant individually, and it is also critical to ensure that the uploading of scanned documents works as expected (NOTE: we hope to be able to restrict such uploads to PDF format only, and preferably also to a maximum size. Having applicants just using their smart-phones to snap large-size pictures of documents is to be avoided).

This is a high-profile application and it has already been approved by the National Health Council, so it is critical to get the last few bugs ironed out.

Regards

Calle

On 3 June 2016 at 13:27, Morten Olav Hansen morten@dhis2.org wrote:

Before Lars answers

Mike, can you provide us with a detailed bug report on launchpad? it will help us track this bug, I can have a look on Monday


Calle Hedberg

46D Alma Road, 7700 Rosebank, SOUTH AFRICA

Tel/fax (home): +27-21-685-6472

Cell: +27-82-853-5352

Iridium SatPhone: +8816-315-19119

Email: calle.hedberg@gmail.com

Skype: calle_hedberg


Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Fri, Jun 3, 2016 at 6:26 PM, Morten Olav Hansen morten@dhis2.org wrote:

Hi Mike

I’m adding in Lars… It’s been a while since i looked at it… but I don’t think that is how it was designed, if you select an org unit… it will send to EVERYBODY connected to that (kinda like when you assign an OU to a user), if you want to send to individual users… you need to select them manually…

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Fri, Jun 3, 2016 at 6:24 PM, Mike Nelushi mikeevolution@gmail.com wrote:

Hi Morten,

The messageConversations web-api is still a big issue because we need to send each user specific information to their e-mails.

  1. Using {“subject”: subject, “text”: message, “users”: user} json object, the mail gets stored on DHIS2 mail and does not send it to the user e-mail.

LogUtil.java [http-apr-8080-exec-3])

  • INFO 2016-05-29 14:14:52,484 Invoking message sender: $Proxy53 (DefaultMessageService.java [http-apr-8080-exec-3])
  • INFO 2016-05-29 14:14:52,529 Invoking message sender: SmsMessageSender (DefaultMessageService.java [http-apr-8080-exec-3])
  • ERROR 2016-05-29 14:14:52,579 Unexpected error occurred invoking async method 'public java.lang.String org.hisp.dhis.message.EmailMessageSender.sendMessage(java.lang.String,java.lang.String,jav

a.lang.String,org.hisp.dhis.user.User,java.util.Set,boolean)’. (SimpleAsyncUncaughtExceptionHandler.java [taskScheduler-7])

org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: org.hisp.dhis.user.User.organisationUnits, could not initialize proxy - no Session

    at org.hibernate.collection.internal.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:569)
    at org.hibernate.collection.internal.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:188)
    at org.hibernate.collection.internal.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:139)
    at org.hibernate.collection.internal.PersistentSet.size(PersistentSet.java:156)
    at org.hisp.dhis.common.IdentifiableObjectUtils.join(IdentifiableObjectUtils.java:76)
    at org.hisp.dhis.user.User.getOrganisationUnitsName(User.java:288)
    at org.hisp.dhis.message.EmailMessageSender.renderPlainContent(EmailMessageSender.java:188)
    at org.hisp.dhis.message.EmailMessageSender.sendMessage(EmailMessageSender.java:115)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
    at org.springframework.aop.interceptor.AsyncExecutionInterceptor$1.call(AsyncExecutionInterceptor.java:108)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

2, Using {“subject”: subject, “text”: message, “users”: users, “organisationUnits”: organisationUnits}, sends email to everyone in the Orgunit and we want to send to individuals.

Please advice.

Regards,

Mike

On Fri, Jun 3, 2016 at 4:58 AM, Morten Olav Hansen morten@dhis2.org wrote:

Hi Mike

I’m adding in the dev list, and Halvdan (who knows about file resource API). I will have a look at the start as app functionality.


Morten

On Thu, Jun 2, 2016 at 5:00 PM, Mike Nelushi mikeevolution@gmail.com wrote:

Hi Calle,

Apologies, forgot to add you on this thread.

Regards

Mike

On 2 Jun 2016 11:35, “Mike Nelushi” mikeevolution@gmail.com wrote:

Hi Morten,

Its Mike here from HISP-SA.

We have been strangling to send email to individual users on our new Community Service Application which is going live tomorrow. At the moment when I send an email to individuals it sends to everyone who is a DHIS2 user. Im user the dhis2.23 messageConversations web-api for this.

A. The following are the two json objects I’ve used, the first one doesn’t send messages at all the messages stays on dhis2 mail.

  1. var json_Data = {“subject”: subject, “text”: message, “users”: users};

2.var json_Data = {“subject”: subject, “text”: message, “users”: users, “organisationUnits”: organisationUnits};

The following is our email settings

B. Second Issue is that when we call fileResources webapi to save file is does work but when you retrieve the file it says the file was not saved. The following is the object:

var file = item[0].files[0];

var formData = new FormData();

formData.append(‘file’, file);

C. The start page function on Appearance settings is not working if you choice your own custom APP, when logging in it does it go to the landing page instead it goes to index.action.

Can you please help us with this issues?

Regards,

Mike

Yes, its a custom app. Thanks.

···

On Fri, Jun 3, 2016 at 2:21 PM, Morten Olav Hansen morten@dhis2.org wrote:

Ok, I just saw Login using PIN-code for account, maybe you are using a custom apps for this…

I saw you bug report, we will have a look at it

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Fri, Jun 3, 2016 at 7:18 PM, Mike Nelushi mikeevolution@gmail.com wrote:

Hi Morten,

The pinCode is not the the DHIS2-Account it is for specific program that they registered for. But the main thing is to be able to send emails and later sms because there will be a lot of notification/alerts to each user(e.g if they sent a wrong file).

Regards,

Mike

On Fri, Jun 3, 2016 at 2:05 PM, Morten Olav Hansen morten@dhis2.org wrote:

Hi Calle

Out of curiosity… how can they login with this “PIN-code” is it simply the set password for their account?

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Fri, Jun 3, 2016 at 6:52 PM, Calle Hedberg calle.hedberg@gmail.com wrote:

Hi,

Since this instance is innovative and handling a somewhat unusual scenario, it might be helpful to understand the background and conceptual design:

South Africa requires around 10,000 new health graduates (doctors, nurses, physiotherapists and other professions allied to medicine) to do one year of Community Service after graduation every year, and before they take up normal work. Medical doctors also do internships in various accredited hospitals as part of their practical studies.

The CommServe instance contain routine data about the number of community service or internship positions at all relevant health facilities, together with some information on things like available accommodation and distance to the nearest town, contact details, etc.

Using a newly developed app, each of the ~10,000 graduates will in the REGISTRATION phase

(a) register as a DHIS user (user reg)

(b) register as an applicant and submit relevant demography and contact details about themselves (TRACKER app)

© submit relevant scanned PDF documents (copy of ID/Passport, marriage certificate, graduation results, etc)

(d) be allocated a “PIN-code” that ensures that the candidate (and ONLY that candidate) can log in again to the same registered “account”

(e) having the pin-code emailed to themselves (and nobody else) after the registration process is completed, so that they don’t forget it.

Logging in again to the same account using the pin-code, each graduate will in the first/second/third APPLICATION phase

(a) view available posts according to their profession (and in some cases their location or bursary status)

(b) select five facilities of their choice for their community service or internship.

After each phase, the system is running a number of algorithms to allocate graduates to health facilities, with confirmation emails / SMSs sent out to each individual.

Every allocation means that applicant is not required to re-apply and the post is removed from the available pool.

Those applicants not successful in round 1 because the applied only for over-subscribed posts (where allocation will be done by lottery, so to say) will go to round 2 and possibly 3.

In round 2 or 3, remaining applicants will again apply for 5 priority postings among those remaining.

As should be obvious from the above, it is critical that we are able to send emails to each applicant individually, and it is also critical to ensure that the uploading of scanned documents works as expected (NOTE: we hope to be able to restrict such uploads to PDF format only, and preferably also to a maximum size. Having applicants just using their smart-phones to snap large-size pictures of documents is to be avoided).

This is a high-profile application and it has already been approved by the National Health Council, so it is critical to get the last few bugs ironed out.

Regards

Calle

On 3 June 2016 at 13:27, Morten Olav Hansen morten@dhis2.org wrote:

Before Lars answers

Mike, can you provide us with a detailed bug report on launchpad? it will help us track this bug, I can have a look on Monday


Calle Hedberg

46D Alma Road, 7700 Rosebank, SOUTH AFRICA

Tel/fax (home): +27-21-685-6472

Cell: +27-82-853-5352

Iridium SatPhone: +8816-315-19119

Email: calle.hedberg@gmail.com

Skype: calle_hedberg


Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Fri, Jun 3, 2016 at 6:26 PM, Morten Olav Hansen morten@dhis2.org wrote:

Hi Mike

I’m adding in Lars… It’s been a while since i looked at it… but I don’t think that is how it was designed, if you select an org unit… it will send to EVERYBODY connected to that (kinda like when you assign an OU to a user), if you want to send to individual users… you need to select them manually…

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Fri, Jun 3, 2016 at 6:24 PM, Mike Nelushi mikeevolution@gmail.com wrote:

Hi Morten,

The messageConversations web-api is still a big issue because we need to send each user specific information to their e-mails.

  1. Using {“subject”: subject, “text”: message, “users”: user} json object, the mail gets stored on DHIS2 mail and does not send it to the user e-mail.

LogUtil.java [http-apr-8080-exec-3])

  • INFO 2016-05-29 14:14:52,484 Invoking message sender: $Proxy53 (DefaultMessageService.java [http-apr-8080-exec-3])
  • INFO 2016-05-29 14:14:52,529 Invoking message sender: SmsMessageSender (DefaultMessageService.java [http-apr-8080-exec-3])
  • ERROR 2016-05-29 14:14:52,579 Unexpected error occurred invoking async method 'public java.lang.String org.hisp.dhis.message.EmailMessageSender.sendMessage(java.lang.String,java.lang.String,jav

a.lang.String,org.hisp.dhis.user.User,java.util.Set,boolean)’. (SimpleAsyncUncaughtExceptionHandler.java [taskScheduler-7])

org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: org.hisp.dhis.user.User.organisationUnits, could not initialize proxy - no Session

    at org.hibernate.collection.internal.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:569)
    at org.hibernate.collection.internal.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:188)
    at org.hibernate.collection.internal.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:139)
    at org.hibernate.collection.internal.PersistentSet.size(PersistentSet.java:156)
    at org.hisp.dhis.common.IdentifiableObjectUtils.join(IdentifiableObjectUtils.java:76)
    at org.hisp.dhis.user.User.getOrganisationUnitsName(User.java:288)
    at org.hisp.dhis.message.EmailMessageSender.renderPlainContent(EmailMessageSender.java:188)
    at org.hisp.dhis.message.EmailMessageSender.sendMessage(EmailMessageSender.java:115)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
    at org.springframework.aop.interceptor.AsyncExecutionInterceptor$1.call(AsyncExecutionInterceptor.java:108)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

2, Using {“subject”: subject, “text”: message, “users”: users, “organisationUnits”: organisationUnits}, sends email to everyone in the Orgunit and we want to send to individuals.

Please advice.

Regards,

Mike

On Fri, Jun 3, 2016 at 4:58 AM, Morten Olav Hansen morten@dhis2.org wrote:

Hi Mike

I’m adding in the dev list, and Halvdan (who knows about file resource API). I will have a look at the start as app functionality.


Morten

On Thu, Jun 2, 2016 at 5:00 PM, Mike Nelushi mikeevolution@gmail.com wrote:

Hi Calle,

Apologies, forgot to add you on this thread.

Regards

Mike

On 2 Jun 2016 11:35, “Mike Nelushi” mikeevolution@gmail.com wrote:

Hi Morten,

Its Mike here from HISP-SA.

We have been strangling to send email to individual users on our new Community Service Application which is going live tomorrow. At the moment when I send an email to individuals it sends to everyone who is a DHIS2 user. Im user the dhis2.23 messageConversations web-api for this.

A. The following are the two json objects I’ve used, the first one doesn’t send messages at all the messages stays on dhis2 mail.

  1. var json_Data = {“subject”: subject, “text”: message, “users”: users};

2.var json_Data = {“subject”: subject, “text”: message, “users”: users, “organisationUnits”: organisationUnits};

The following is our email settings

B. Second Issue is that when we call fileResources webapi to save file is does work but when you retrieve the file it says the file was not saved. The following is the object:

var file = item[0].files[0];

var formData = new FormData();

formData.append(‘file’, file);

C. The start page function on Appearance settings is not working if you choice your own custom APP, when logging in it does it go to the landing page instead it goes to index.action.

Can you please help us with this issues?

Regards,

Mike

Morten,

Sorry if my brief wasn’t 100% clear on that - the DHIS user reg is a separate thing. All users logging in will be able to view (but not change) the general routine stuff around positions available etc. The pin-code is used in the custom app to ensure that all applicant users can only view and edit their own registrations/applications - not others.

Regards

Calle

···

On 3 June 2016 at 14:23, Mike Nelushi mikeevolution@gmail.com wrote:

Yes, its a custom app. Thanks.

On Fri, Jun 3, 2016 at 2:21 PM, Morten Olav Hansen morten@dhis2.org wrote:

Ok, I just saw Login using PIN-code for account, maybe you are using a custom apps for this…

I saw you bug report, we will have a look at it

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Fri, Jun 3, 2016 at 7:18 PM, Mike Nelushi mikeevolution@gmail.com wrote:

Hi Morten,

The pinCode is not the the DHIS2-Account it is for specific program that they registered for. But the main thing is to be able to send emails and later sms because there will be a lot of notification/alerts to each user(e.g if they sent a wrong file).

Regards,

Mike

On Fri, Jun 3, 2016 at 2:05 PM, Morten Olav Hansen morten@dhis2.org wrote:

Hi Calle

Out of curiosity… how can they login with this “PIN-code” is it simply the set password for their account?

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Fri, Jun 3, 2016 at 6:52 PM, Calle Hedberg calle.hedberg@gmail.com wrote:

Hi,

Since this instance is innovative and handling a somewhat unusual scenario, it might be helpful to understand the background and conceptual design:

South Africa requires around 10,000 new health graduates (doctors, nurses, physiotherapists and other professions allied to medicine) to do one year of Community Service after graduation every year, and before they take up normal work. Medical doctors also do internships in various accredited hospitals as part of their practical studies.

The CommServe instance contain routine data about the number of community service or internship positions at all relevant health facilities, together with some information on things like available accommodation and distance to the nearest town, contact details, etc.

Using a newly developed app, each of the ~10,000 graduates will in the REGISTRATION phase

(a) register as a DHIS user (user reg)

(b) register as an applicant and submit relevant demography and contact details about themselves (TRACKER app)

© submit relevant scanned PDF documents (copy of ID/Passport, marriage certificate, graduation results, etc)

(d) be allocated a “PIN-code” that ensures that the candidate (and ONLY that candidate) can log in again to the same registered “account”

(e) having the pin-code emailed to themselves (and nobody else) after the registration process is completed, so that they don’t forget it.

Logging in again to the same account using the pin-code, each graduate will in the first/second/third APPLICATION phase

(a) view available posts according to their profession (and in some cases their location or bursary status)

(b) select five facilities of their choice for their community service or internship.

After each phase, the system is running a number of algorithms to allocate graduates to health facilities, with confirmation emails / SMSs sent out to each individual.

Every allocation means that applicant is not required to re-apply and the post is removed from the available pool.

Those applicants not successful in round 1 because the applied only for over-subscribed posts (where allocation will be done by lottery, so to say) will go to round 2 and possibly 3.

In round 2 or 3, remaining applicants will again apply for 5 priority postings among those remaining.

As should be obvious from the above, it is critical that we are able to send emails to each applicant individually, and it is also critical to ensure that the uploading of scanned documents works as expected (NOTE: we hope to be able to restrict such uploads to PDF format only, and preferably also to a maximum size. Having applicants just using their smart-phones to snap large-size pictures of documents is to be avoided).

This is a high-profile application and it has already been approved by the National Health Council, so it is critical to get the last few bugs ironed out.

Regards

Calle

On 3 June 2016 at 13:27, Morten Olav Hansen morten@dhis2.org wrote:

Before Lars answers

Mike, can you provide us with a detailed bug report on launchpad? it will help us track this bug, I can have a look on Monday


Calle Hedberg

46D Alma Road, 7700 Rosebank, SOUTH AFRICA

Tel/fax (home): +27-21-685-6472

Cell: +27-82-853-5352

Iridium SatPhone: +8816-315-19119

Email: calle.hedberg@gmail.com

Skype: calle_hedberg


Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Fri, Jun 3, 2016 at 6:26 PM, Morten Olav Hansen morten@dhis2.org wrote:

Hi Mike

I’m adding in Lars… It’s been a while since i looked at it… but I don’t think that is how it was designed, if you select an org unit… it will send to EVERYBODY connected to that (kinda like when you assign an OU to a user), if you want to send to individual users… you need to select them manually…

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Fri, Jun 3, 2016 at 6:24 PM, Mike Nelushi mikeevolution@gmail.com wrote:

Hi Morten,

The messageConversations web-api is still a big issue because we need to send each user specific information to their e-mails.

  1. Using {“subject”: subject, “text”: message, “users”: user} json object, the mail gets stored on DHIS2 mail and does not send it to the user e-mail.

LogUtil.java [http-apr-8080-exec-3])

  • INFO 2016-05-29 14:14:52,484 Invoking message sender: $Proxy53 (DefaultMessageService.java [http-apr-8080-exec-3])
  • INFO 2016-05-29 14:14:52,529 Invoking message sender: SmsMessageSender (DefaultMessageService.java [http-apr-8080-exec-3])
  • ERROR 2016-05-29 14:14:52,579 Unexpected error occurred invoking async method 'public java.lang.String org.hisp.dhis.message.EmailMessageSender.sendMessage(java.lang.String,java.lang.String,jav

a.lang.String,org.hisp.dhis.user.User,java.util.Set,boolean)’. (SimpleAsyncUncaughtExceptionHandler.java [taskScheduler-7])

org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: org.hisp.dhis.user.User.organisationUnits, could not initialize proxy - no Session

    at org.hibernate.collection.internal.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:569)
    at org.hibernate.collection.internal.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:188)
    at org.hibernate.collection.internal.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:139)
    at org.hibernate.collection.internal.PersistentSet.size(PersistentSet.java:156)
    at org.hisp.dhis.common.IdentifiableObjectUtils.join(IdentifiableObjectUtils.java:76)
    at org.hisp.dhis.user.User.getOrganisationUnitsName(User.java:288)
    at org.hisp.dhis.message.EmailMessageSender.renderPlainContent(EmailMessageSender.java:188)
    at org.hisp.dhis.message.EmailMessageSender.sendMessage(EmailMessageSender.java:115)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
    at org.springframework.aop.interceptor.AsyncExecutionInterceptor$1.call(AsyncExecutionInterceptor.java:108)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

2, Using {“subject”: subject, “text”: message, “users”: users, “organisationUnits”: organisationUnits}, sends email to everyone in the Orgunit and we want to send to individuals.

Please advice.

Regards,

Mike

On Fri, Jun 3, 2016 at 4:58 AM, Morten Olav Hansen morten@dhis2.org wrote:

Hi Mike

I’m adding in the dev list, and Halvdan (who knows about file resource API). I will have a look at the start as app functionality.


Morten

On Thu, Jun 2, 2016 at 5:00 PM, Mike Nelushi mikeevolution@gmail.com wrote:

Hi Calle,

Apologies, forgot to add you on this thread.

Regards

Mike

On 2 Jun 2016 11:35, “Mike Nelushi” mikeevolution@gmail.com wrote:

Hi Morten,

Its Mike here from HISP-SA.

We have been strangling to send email to individual users on our new Community Service Application which is going live tomorrow. At the moment when I send an email to individuals it sends to everyone who is a DHIS2 user. Im user the dhis2.23 messageConversations web-api for this.

A. The following are the two json objects I’ve used, the first one doesn’t send messages at all the messages stays on dhis2 mail.

  1. var json_Data = {“subject”: subject, “text”: message, “users”: users};

2.var json_Data = {“subject”: subject, “text”: message, “users”: users, “organisationUnits”: organisationUnits};

The following is our email settings

B. Second Issue is that when we call fileResources webapi to save file is does work but when you retrieve the file it says the file was not saved. The following is the object:

var file = item[0].files[0];

var formData = new FormData();

formData.append(‘file’, file);

C. The start page function on Appearance settings is not working if you choice your own custom APP, when logging in it does it go to the landing page instead it goes to index.action.

Can you please help us with this issues?

Regards,

Mike


Calle Hedberg

46D Alma Road, 7700 Rosebank, SOUTH AFRICA

Tel/fax (home): +27-21-685-6472

Cell: +27-82-853-5352

Iridium SatPhone: +8816-315-19119

Email: calle.hedberg@gmail.com

Skype: calle_hedberg


Ok, Calle, thanks for the info :slight_smile: so when you say custom app… I guess it’s Android?

···

On Fri, Jun 3, 2016 at 7:52 PM, Calle Hedberg calle.hedberg@gmail.com wrote:

Morten,

Sorry if my brief wasn’t 100% clear on that - the DHIS user reg is a separate thing. All users logging in will be able to view (but not change) the general routine stuff around positions available etc. The pin-code is used in the custom app to ensure that all applicant users can only view and edit their own registrations/applications - not others.

Regards

Calle

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On 3 June 2016 at 14:23, Mike Nelushi mikeevolution@gmail.com wrote:

Yes, its a custom app. Thanks.


Calle Hedberg

46D Alma Road, 7700 Rosebank, SOUTH AFRICA

Tel/fax (home): +27-21-685-6472

Cell: +27-82-853-5352

Iridium SatPhone: +8816-315-19119

Email: calle.hedberg@gmail.com

Skype: calle_hedberg


On Fri, Jun 3, 2016 at 2:21 PM, Morten Olav Hansen morten@dhis2.org wrote:

Ok, I just saw Login using PIN-code for account, maybe you are using a custom apps for this…

I saw you bug report, we will have a look at it

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Fri, Jun 3, 2016 at 7:18 PM, Mike Nelushi mikeevolution@gmail.com wrote:

Hi Morten,

The pinCode is not the the DHIS2-Account it is for specific program that they registered for. But the main thing is to be able to send emails and later sms because there will be a lot of notification/alerts to each user(e.g if they sent a wrong file).

Regards,

Mike

On Fri, Jun 3, 2016 at 2:05 PM, Morten Olav Hansen morten@dhis2.org wrote:

Hi Calle

Out of curiosity… how can they login with this “PIN-code” is it simply the set password for their account?

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Fri, Jun 3, 2016 at 6:52 PM, Calle Hedberg calle.hedberg@gmail.com wrote:

Hi,

Since this instance is innovative and handling a somewhat unusual scenario, it might be helpful to understand the background and conceptual design:

South Africa requires around 10,000 new health graduates (doctors, nurses, physiotherapists and other professions allied to medicine) to do one year of Community Service after graduation every year, and before they take up normal work. Medical doctors also do internships in various accredited hospitals as part of their practical studies.

The CommServe instance contain routine data about the number of community service or internship positions at all relevant health facilities, together with some information on things like available accommodation and distance to the nearest town, contact details, etc.

Using a newly developed app, each of the ~10,000 graduates will in the REGISTRATION phase

(a) register as a DHIS user (user reg)

(b) register as an applicant and submit relevant demography and contact details about themselves (TRACKER app)

© submit relevant scanned PDF documents (copy of ID/Passport, marriage certificate, graduation results, etc)

(d) be allocated a “PIN-code” that ensures that the candidate (and ONLY that candidate) can log in again to the same registered “account”

(e) having the pin-code emailed to themselves (and nobody else) after the registration process is completed, so that they don’t forget it.

Logging in again to the same account using the pin-code, each graduate will in the first/second/third APPLICATION phase

(a) view available posts according to their profession (and in some cases their location or bursary status)

(b) select five facilities of their choice for their community service or internship.

After each phase, the system is running a number of algorithms to allocate graduates to health facilities, with confirmation emails / SMSs sent out to each individual.

Every allocation means that applicant is not required to re-apply and the post is removed from the available pool.

Those applicants not successful in round 1 because the applied only for over-subscribed posts (where allocation will be done by lottery, so to say) will go to round 2 and possibly 3.

In round 2 or 3, remaining applicants will again apply for 5 priority postings among those remaining.

As should be obvious from the above, it is critical that we are able to send emails to each applicant individually, and it is also critical to ensure that the uploading of scanned documents works as expected (NOTE: we hope to be able to restrict such uploads to PDF format only, and preferably also to a maximum size. Having applicants just using their smart-phones to snap large-size pictures of documents is to be avoided).

This is a high-profile application and it has already been approved by the National Health Council, so it is critical to get the last few bugs ironed out.

Regards

Calle

On 3 June 2016 at 13:27, Morten Olav Hansen morten@dhis2.org wrote:

Before Lars answers

Mike, can you provide us with a detailed bug report on launchpad? it will help us track this bug, I can have a look on Monday


Calle Hedberg

46D Alma Road, 7700 Rosebank, SOUTH AFRICA

Tel/fax (home): +27-21-685-6472

Cell: +27-82-853-5352

Iridium SatPhone: +8816-315-19119

Email: calle.hedberg@gmail.com

Skype: calle_hedberg


Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Fri, Jun 3, 2016 at 6:26 PM, Morten Olav Hansen morten@dhis2.org wrote:

Hi Mike

I’m adding in Lars… It’s been a while since i looked at it… but I don’t think that is how it was designed, if you select an org unit… it will send to EVERYBODY connected to that (kinda like when you assign an OU to a user), if you want to send to individual users… you need to select them manually…

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Fri, Jun 3, 2016 at 6:24 PM, Mike Nelushi mikeevolution@gmail.com wrote:

Hi Morten,

The messageConversations web-api is still a big issue because we need to send each user specific information to their e-mails.

  1. Using {“subject”: subject, “text”: message, “users”: user} json object, the mail gets stored on DHIS2 mail and does not send it to the user e-mail.

LogUtil.java [http-apr-8080-exec-3])

  • INFO 2016-05-29 14:14:52,484 Invoking message sender: $Proxy53 (DefaultMessageService.java [http-apr-8080-exec-3])
  • INFO 2016-05-29 14:14:52,529 Invoking message sender: SmsMessageSender (DefaultMessageService.java [http-apr-8080-exec-3])
  • ERROR 2016-05-29 14:14:52,579 Unexpected error occurred invoking async method 'public java.lang.String org.hisp.dhis.message.EmailMessageSender.sendMessage(java.lang.String,java.lang.String,jav

a.lang.String,org.hisp.dhis.user.User,java.util.Set,boolean)’. (SimpleAsyncUncaughtExceptionHandler.java [taskScheduler-7])

org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: org.hisp.dhis.user.User.organisationUnits, could not initialize proxy - no Session

    at org.hibernate.collection.internal.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:569)
    at org.hibernate.collection.internal.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:188)
    at org.hibernate.collection.internal.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:139)
    at org.hibernate.collection.internal.PersistentSet.size(PersistentSet.java:156)
    at org.hisp.dhis.common.IdentifiableObjectUtils.join(IdentifiableObjectUtils.java:76)
    at org.hisp.dhis.user.User.getOrganisationUnitsName(User.java:288)
    at org.hisp.dhis.message.EmailMessageSender.renderPlainContent(EmailMessageSender.java:188)
    at org.hisp.dhis.message.EmailMessageSender.sendMessage(EmailMessageSender.java:115)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
    at org.springframework.aop.interceptor.AsyncExecutionInterceptor$1.call(AsyncExecutionInterceptor.java:108)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

2, Using {“subject”: subject, “text”: message, “users”: users, “organisationUnits”: organisationUnits}, sends email to everyone in the Orgunit and we want to send to individuals.

Please advice.

Regards,

Mike

On Fri, Jun 3, 2016 at 4:58 AM, Morten Olav Hansen morten@dhis2.org wrote:

Hi Mike

I’m adding in the dev list, and Halvdan (who knows about file resource API). I will have a look at the start as app functionality.


Morten

On Thu, Jun 2, 2016 at 5:00 PM, Mike Nelushi mikeevolution@gmail.com wrote:

Hi Calle,

Apologies, forgot to add you on this thread.

Regards

Mike

On 2 Jun 2016 11:35, “Mike Nelushi” mikeevolution@gmail.com wrote:

Hi Morten,

Its Mike here from HISP-SA.

We have been strangling to send email to individual users on our new Community Service Application which is going live tomorrow. At the moment when I send an email to individuals it sends to everyone who is a DHIS2 user. Im user the dhis2.23 messageConversations web-api for this.

A. The following are the two json objects I’ve used, the first one doesn’t send messages at all the messages stays on dhis2 mail.

  1. var json_Data = {“subject”: subject, “text”: message, “users”: users};

2.var json_Data = {“subject”: subject, “text”: message, “users”: users, “organisationUnits”: organisationUnits};

The following is our email settings

B. Second Issue is that when we call fileResources webapi to save file is does work but when you retrieve the file it says the file was not saved. The following is the object:

var file = item[0].files[0];

var formData = new FormData();

formData.append(‘file’, file);

C. The start page function on Appearance settings is not working if you choice your own custom APP, when logging in it does it go to the landing page instead it goes to index.action.

Can you please help us with this issues?

Regards,

Mike

Yes, this is correct. Is this what you are already doing?

To give some background: the fileResource functionality is at this point only supported as a backend for File dataValues, and not really as a generic storage mechanism for files. The reason for the two-stage process is that the server needs to perform processing and (potentially) re-uploading of the file (depending on the storage backend used) before it can be stored as a DV.

In the bundled data entry apps (tracker and aggregate) we do this by a three step process:

  1. upload the fileResource to api/fileResource and retrieve the returned uid.

  2. POST the DV with the value=

  3. (optional) Poll the fileResource/ endpoint for the status of the upload to ensure it is properly stored in the backend.

Fetching the actual file back can thus only be done on the api/dataValues/files endpoint (with query params just like on any DataValue).

···

On Fri, Jun 3, 2016 at 1:13 PM, Mike Nelushi mikeevolution@gmail.com wrote:

Hi Halvdan,

We are using version 2.23. The application uses a tracker program and its suppose to store documents for each user. I can store the file using fileResources api, and the response storageStatus=PENDING with no errors thrown. So from the response object I have to create a dataValue(using DE of type file) then “Store the retrieved id as the value to that data value”. Am I correct?

Regards,

Mike

On Fri, Jun 3, 2016 at 11:05 AM, Halvdan Hoem Grelland halvdan@dhis2.org wrote:

Hi Mike,

In relation to api/fileResources I’m going to need more details: which version are you on, exactly what are you trying to do, etc. A full list of typically needed details can be found here, but specifically I’ll need to know whether there are any thrown errors on the server, what HTTP response you are getting and so forth.

Also, have you familiarised yourself with the documentation for the fileResource API ? In particular make sure to read and understand the constraints (i.e. a FR must be referenced by a DataValue).

On Fri, Jun 3, 2016 at 4:58 AM, Morten Olav Hansen morten@dhis2.org wrote:

Hi Mike

I’m adding in the dev list, and Halvdan (who knows about file resource API). I will have a look at the start as app functionality.


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


Halvdan Hoem Grelland

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org


Morten

On Thu, Jun 2, 2016 at 5:00 PM, Mike Nelushi mikeevolution@gmail.com wrote:

Hi Calle,

Apologies, forgot to add you on this thread.

Regards

Mike

On 2 Jun 2016 11:35, “Mike Nelushi” mikeevolution@gmail.com wrote:

Hi Morten,

Its Mike here from HISP-SA.

We have been strangling to send email to individual users on our new Community Service Application which is going live tomorrow. At the moment when I send an email to individuals it sends to everyone who is a DHIS2 user. Im user the dhis2.23 messageConversations web-api for this.

A. The following are the two json objects I’ve used, the first one doesn’t send messages at all the messages stays on dhis2 mail.

  1. var json_Data = {“subject”: subject, “text”: message, “users”: users};

2.var json_Data = {“subject”: subject, “text”: message, “users”: users, “organisationUnits”: organisationUnits};

The following is our email settings

B. Second Issue is that when we call fileResources webapi to save file is does work but when you retrieve the file it says the file was not saved. The following is the object:

var file = item[0].files[0];

var formData = new FormData();

formData.append(‘file’, file);

C. The start page function on Appearance settings is not working if you choice your own custom APP, when logging in it does it go to the landing page instead it goes to index.action.

Can you please help us with this issues?

Regards,

Mike

Halvdan Hoem Grelland

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

Hi Halvdan,

I’m still failing to understand how you would link each user’s files(Tracker Program) to a datavalue(DE, PE, OU). Can you please give an example on this scenario?

Regards,

Mike

···

On Fri, Jun 3, 2016 at 1:13 PM, Mike Nelushi mikeevolution@gmail.com wrote:

Hi Halvdan,

We are using version 2.23. The application uses a tracker program and its suppose to store documents for each user. I can store the file using fileResources api, and the response storageStatus=PENDING with no errors thrown. So from the response object I have to create a dataValue(using DE of type file) then “Store the retrieved id as the value to that data value”. Am I correct?

Regards,

Mike

On Fri, Jun 3, 2016 at 11:05 AM, Halvdan Hoem Grelland halvdan@dhis2.org wrote:

Hi Mike,

In relation to api/fileResources I’m going to need more details: which version are you on, exactly what are you trying to do, etc. A full list of typically needed details can be found here, but specifically I’ll need to know whether there are any thrown errors on the server, what HTTP response you are getting and so forth.

Also, have you familiarised yourself with the documentation for the fileResource API ? In particular make sure to read and understand the constraints (i.e. a FR must be referenced by a DataValue).

On Fri, Jun 3, 2016 at 4:58 AM, Morten Olav Hansen morten@dhis2.org wrote:

Hi Mike

I’m adding in the dev list, and Halvdan (who knows about file resource API). I will have a look at the start as app functionality.


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


Halvdan Hoem Grelland

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org


Morten

On Thu, Jun 2, 2016 at 5:00 PM, Mike Nelushi mikeevolution@gmail.com wrote:

Hi Calle,

Apologies, forgot to add you on this thread.

Regards

Mike

On 2 Jun 2016 11:35, “Mike Nelushi” mikeevolution@gmail.com wrote:

Hi Morten,

Its Mike here from HISP-SA.

We have been strangling to send email to individual users on our new Community Service Application which is going live tomorrow. At the moment when I send an email to individuals it sends to everyone who is a DHIS2 user. Im user the dhis2.23 messageConversations web-api for this.

A. The following are the two json objects I’ve used, the first one doesn’t send messages at all the messages stays on dhis2 mail.

  1. var json_Data = {“subject”: subject, “text”: message, “users”: users};

2.var json_Data = {“subject”: subject, “text”: message, “users”: users, “organisationUnits”: organisationUnits};

The following is our email settings

B. Second Issue is that when we call fileResources webapi to save file is does work but when you retrieve the file it says the file was not saved. The following is the object:

var file = item[0].files[0];

var formData = new FormData();

formData.append(‘file’, file);

C. The start page function on Appearance settings is not working if you choice your own custom APP, when logging in it does it go to the landing page instead it goes to index.action.

Can you please help us with this issues?

Regards,

Mike

Morten,

Custom App is not Android - it’s a DHIS2 app. We did have some teething problems with users accessing the instance via the browser on their smartphones, but I think that’s been sorted. In any case, our recommendation to all users is to rather access the instance via a laptop or computer - should be easier to upload PDF documents and generally view available information about posts etc that way. (a customised Android app might be on the cards for next year - TBD. For now we are just trying to iron out bugs and finalise everything before it goes live for the first batch of users this month).

Regards
Calle

···

On 3 June 2016 at 14:57, Morten Olav Hansen morten@dhis2.org wrote:

Ok, Calle, thanks for the info :slight_smile: so when you say custom app… I guess it’s Android?

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Fri, Jun 3, 2016 at 7:52 PM, Calle Hedberg calle.hedberg@gmail.com wrote:

Morten,

Sorry if my brief wasn’t 100% clear on that - the DHIS user reg is a separate thing. All users logging in will be able to view (but not change) the general routine stuff around positions available etc. The pin-code is used in the custom app to ensure that all applicant users can only view and edit their own registrations/applications - not others.

Regards

Calle

On 3 June 2016 at 14:23, Mike Nelushi mikeevolution@gmail.com wrote:

Yes, its a custom app. Thanks.


Calle Hedberg

46D Alma Road, 7700 Rosebank, SOUTH AFRICA

Tel/fax (home): +27-21-685-6472

Cell: +27-82-853-5352

Iridium SatPhone: +8816-315-19119

Email: calle.hedberg@gmail.com

Skype: calle_hedberg


On Fri, Jun 3, 2016 at 2:21 PM, Morten Olav Hansen morten@dhis2.org wrote:

Ok, I just saw Login using PIN-code for account, maybe you are using a custom apps for this…

I saw you bug report, we will have a look at it

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Fri, Jun 3, 2016 at 7:18 PM, Mike Nelushi mikeevolution@gmail.com wrote:

Hi Morten,

The pinCode is not the the DHIS2-Account it is for specific program that they registered for. But the main thing is to be able to send emails and later sms because there will be a lot of notification/alerts to each user(e.g if they sent a wrong file).

Regards,

Mike

On Fri, Jun 3, 2016 at 2:05 PM, Morten Olav Hansen morten@dhis2.org wrote:

Hi Calle

Out of curiosity… how can they login with this “PIN-code” is it simply the set password for their account?

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Fri, Jun 3, 2016 at 6:52 PM, Calle Hedberg calle.hedberg@gmail.com wrote:

Hi,

Since this instance is innovative and handling a somewhat unusual scenario, it might be helpful to understand the background and conceptual design:

South Africa requires around 10,000 new health graduates (doctors, nurses, physiotherapists and other professions allied to medicine) to do one year of Community Service after graduation every year, and before they take up normal work. Medical doctors also do internships in various accredited hospitals as part of their practical studies.

The CommServe instance contain routine data about the number of community service or internship positions at all relevant health facilities, together with some information on things like available accommodation and distance to the nearest town, contact details, etc.

Using a newly developed app, each of the ~10,000 graduates will in the REGISTRATION phase

(a) register as a DHIS user (user reg)

(b) register as an applicant and submit relevant demography and contact details about themselves (TRACKER app)

© submit relevant scanned PDF documents (copy of ID/Passport, marriage certificate, graduation results, etc)

(d) be allocated a “PIN-code” that ensures that the candidate (and ONLY that candidate) can log in again to the same registered “account”

(e) having the pin-code emailed to themselves (and nobody else) after the registration process is completed, so that they don’t forget it.

Logging in again to the same account using the pin-code, each graduate will in the first/second/third APPLICATION phase

(a) view available posts according to their profession (and in some cases their location or bursary status)

(b) select five facilities of their choice for their community service or internship.

After each phase, the system is running a number of algorithms to allocate graduates to health facilities, with confirmation emails / SMSs sent out to each individual.

Every allocation means that applicant is not required to re-apply and the post is removed from the available pool.

Those applicants not successful in round 1 because the applied only for over-subscribed posts (where allocation will be done by lottery, so to say) will go to round 2 and possibly 3.

In round 2 or 3, remaining applicants will again apply for 5 priority postings among those remaining.

As should be obvious from the above, it is critical that we are able to send emails to each applicant individually, and it is also critical to ensure that the uploading of scanned documents works as expected (NOTE: we hope to be able to restrict such uploads to PDF format only, and preferably also to a maximum size. Having applicants just using their smart-phones to snap large-size pictures of documents is to be avoided).

This is a high-profile application and it has already been approved by the National Health Council, so it is critical to get the last few bugs ironed out.

Regards

Calle

On 3 June 2016 at 13:27, Morten Olav Hansen morten@dhis2.org wrote:

Before Lars answers

Mike, can you provide us with a detailed bug report on launchpad? it will help us track this bug, I can have a look on Monday


Calle Hedberg

46D Alma Road, 7700 Rosebank, SOUTH AFRICA

Tel/fax (home): +27-21-685-6472

Cell: +27-82-853-5352

Iridium SatPhone: +8816-315-19119

Email: calle.hedberg@gmail.com

Skype: calle_hedberg


Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Fri, Jun 3, 2016 at 6:26 PM, Morten Olav Hansen morten@dhis2.org wrote:

Hi Mike

I’m adding in Lars… It’s been a while since i looked at it… but I don’t think that is how it was designed, if you select an org unit… it will send to EVERYBODY connected to that (kinda like when you assign an OU to a user), if you want to send to individual users… you need to select them manually…

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Fri, Jun 3, 2016 at 6:24 PM, Mike Nelushi mikeevolution@gmail.com wrote:

Hi Morten,

The messageConversations web-api is still a big issue because we need to send each user specific information to their e-mails.

  1. Using {“subject”: subject, “text”: message, “users”: user} json object, the mail gets stored on DHIS2 mail and does not send it to the user e-mail.

LogUtil.java [http-apr-8080-exec-3])

  • INFO 2016-05-29 14:14:52,484 Invoking message sender: $Proxy53 (DefaultMessageService.java [http-apr-8080-exec-3])
  • INFO 2016-05-29 14:14:52,529 Invoking message sender: SmsMessageSender (DefaultMessageService.java [http-apr-8080-exec-3])
  • ERROR 2016-05-29 14:14:52,579 Unexpected error occurred invoking async method 'public java.lang.String org.hisp.dhis.message.EmailMessageSender.sendMessage(java.lang.String,java.lang.String,jav

a.lang.String,org.hisp.dhis.user.User,java.util.Set,boolean)’. (SimpleAsyncUncaughtExceptionHandler.java [taskScheduler-7])

org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: org.hisp.dhis.user.User.organisationUnits, could not initialize proxy - no Session

    at org.hibernate.collection.internal.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:569)
    at org.hibernate.collection.internal.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:188)
    at org.hibernate.collection.internal.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:139)
    at org.hibernate.collection.internal.PersistentSet.size(PersistentSet.java:156)
    at org.hisp.dhis.common.IdentifiableObjectUtils.join(IdentifiableObjectUtils.java:76)
    at org.hisp.dhis.user.User.getOrganisationUnitsName(User.java:288)
    at org.hisp.dhis.message.EmailMessageSender.renderPlainContent(EmailMessageSender.java:188)
    at org.hisp.dhis.message.EmailMessageSender.sendMessage(EmailMessageSender.java:115)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
    at org.springframework.aop.interceptor.AsyncExecutionInterceptor$1.call(AsyncExecutionInterceptor.java:108)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

2, Using {“subject”: subject, “text”: message, “users”: users, “organisationUnits”: organisationUnits}, sends email to everyone in the Orgunit and we want to send to individuals.

Please advice.

Regards,

Mike

On Fri, Jun 3, 2016 at 4:58 AM, Morten Olav Hansen morten@dhis2.org wrote:

Hi Mike

I’m adding in the dev list, and Halvdan (who knows about file resource API). I will have a look at the start as app functionality.


Morten

On Thu, Jun 2, 2016 at 5:00 PM, Mike Nelushi mikeevolution@gmail.com wrote:

Hi Calle,

Apologies, forgot to add you on this thread.

Regards

Mike

On 2 Jun 2016 11:35, “Mike Nelushi” mikeevolution@gmail.com wrote:

Hi Morten,

Its Mike here from HISP-SA.

We have been strangling to send email to individual users on our new Community Service Application which is going live tomorrow. At the moment when I send an email to individuals it sends to everyone who is a DHIS2 user. Im user the dhis2.23 messageConversations web-api for this.

A. The following are the two json objects I’ve used, the first one doesn’t send messages at all the messages stays on dhis2 mail.

  1. var json_Data = {“subject”: subject, “text”: message, “users”: users};

2.var json_Data = {“subject”: subject, “text”: message, “users”: users, “organisationUnits”: organisationUnits};

The following is our email settings

B. Second Issue is that when we call fileResources webapi to save file is does work but when you retrieve the file it says the file was not saved. The following is the object:

var file = item[0].files[0];

var formData = new FormData();

formData.append(‘file’, file);

C. The start page function on Appearance settings is not working if you choice your own custom APP, when logging in it does it go to the landing page instead it goes to index.action.

Can you please help us with this issues?

Regards,

Mike


Calle Hedberg

46D Alma Road, 7700 Rosebank, SOUTH AFRICA

Tel/fax (home): +27-21-685-6472

Cell: +27-82-853-5352

Iridium SatPhone: +8816-315-19119

Email: calle.hedberg@gmail.com

Skype: calle_hedberg


Hm ok, just trying to understand the workflow… to get to a d2 custom app… they need to 1) login 2) enter pin ? is that right? so its double? all d2 apps are now covered by spring sec interceptors…

···

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Fri, Jun 3, 2016 at 8:19 PM, Calle Hedberg calle.hedberg@gmail.com wrote:

Morten,

Custom App is not Android - it’s a DHIS2 app. We did have some teething problems with users accessing the instance via the browser on their smartphones, but I think that’s been sorted. In any case, our recommendation to all users is to rather access the instance via a laptop or computer - should be easier to upload PDF documents and generally view available information about posts etc that way. (a customised Android app might be on the cards for next year - TBD. For now we are just trying to iron out bugs and finalise everything before it goes live for the first batch of users this month).

Regards
Calle

On 3 June 2016 at 14:57, Morten Olav Hansen morten@dhis2.org wrote:

Ok, Calle, thanks for the info :slight_smile: so when you say custom app… I guess it’s Android?


Calle Hedberg

46D Alma Road, 7700 Rosebank, SOUTH AFRICA

Tel/fax (home): +27-21-685-6472

Cell: +27-82-853-5352

Iridium SatPhone: +8816-315-19119

Email: calle.hedberg@gmail.com

Skype: calle_hedberg


Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Fri, Jun 3, 2016 at 7:52 PM, Calle Hedberg calle.hedberg@gmail.com wrote:

Morten,

Sorry if my brief wasn’t 100% clear on that - the DHIS user reg is a separate thing. All users logging in will be able to view (but not change) the general routine stuff around positions available etc. The pin-code is used in the custom app to ensure that all applicant users can only view and edit their own registrations/applications - not others.

Regards

Calle

On 3 June 2016 at 14:23, Mike Nelushi mikeevolution@gmail.com wrote:

Yes, its a custom app. Thanks.


Calle Hedberg

46D Alma Road, 7700 Rosebank, SOUTH AFRICA

Tel/fax (home): +27-21-685-6472

Cell: +27-82-853-5352

Iridium SatPhone: +8816-315-19119

Email: calle.hedberg@gmail.com

Skype: calle_hedberg


On Fri, Jun 3, 2016 at 2:21 PM, Morten Olav Hansen morten@dhis2.org wrote:

Ok, I just saw Login using PIN-code for account, maybe you are using a custom apps for this…

I saw you bug report, we will have a look at it

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Fri, Jun 3, 2016 at 7:18 PM, Mike Nelushi mikeevolution@gmail.com wrote:

Hi Morten,

The pinCode is not the the DHIS2-Account it is for specific program that they registered for. But the main thing is to be able to send emails and later sms because there will be a lot of notification/alerts to each user(e.g if they sent a wrong file).

Regards,

Mike

On Fri, Jun 3, 2016 at 2:05 PM, Morten Olav Hansen morten@dhis2.org wrote:

Hi Calle

Out of curiosity… how can they login with this “PIN-code” is it simply the set password for their account?

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Fri, Jun 3, 2016 at 6:52 PM, Calle Hedberg calle.hedberg@gmail.com wrote:

Hi,

Since this instance is innovative and handling a somewhat unusual scenario, it might be helpful to understand the background and conceptual design:

South Africa requires around 10,000 new health graduates (doctors, nurses, physiotherapists and other professions allied to medicine) to do one year of Community Service after graduation every year, and before they take up normal work. Medical doctors also do internships in various accredited hospitals as part of their practical studies.

The CommServe instance contain routine data about the number of community service or internship positions at all relevant health facilities, together with some information on things like available accommodation and distance to the nearest town, contact details, etc.

Using a newly developed app, each of the ~10,000 graduates will in the REGISTRATION phase

(a) register as a DHIS user (user reg)

(b) register as an applicant and submit relevant demography and contact details about themselves (TRACKER app)

© submit relevant scanned PDF documents (copy of ID/Passport, marriage certificate, graduation results, etc)

(d) be allocated a “PIN-code” that ensures that the candidate (and ONLY that candidate) can log in again to the same registered “account”

(e) having the pin-code emailed to themselves (and nobody else) after the registration process is completed, so that they don’t forget it.

Logging in again to the same account using the pin-code, each graduate will in the first/second/third APPLICATION phase

(a) view available posts according to their profession (and in some cases their location or bursary status)

(b) select five facilities of their choice for their community service or internship.

After each phase, the system is running a number of algorithms to allocate graduates to health facilities, with confirmation emails / SMSs sent out to each individual.

Every allocation means that applicant is not required to re-apply and the post is removed from the available pool.

Those applicants not successful in round 1 because the applied only for over-subscribed posts (where allocation will be done by lottery, so to say) will go to round 2 and possibly 3.

In round 2 or 3, remaining applicants will again apply for 5 priority postings among those remaining.

As should be obvious from the above, it is critical that we are able to send emails to each applicant individually, and it is also critical to ensure that the uploading of scanned documents works as expected (NOTE: we hope to be able to restrict such uploads to PDF format only, and preferably also to a maximum size. Having applicants just using their smart-phones to snap large-size pictures of documents is to be avoided).

This is a high-profile application and it has already been approved by the National Health Council, so it is critical to get the last few bugs ironed out.

Regards

Calle

On 3 June 2016 at 13:27, Morten Olav Hansen morten@dhis2.org wrote:

Before Lars answers

Mike, can you provide us with a detailed bug report on launchpad? it will help us track this bug, I can have a look on Monday


Calle Hedberg

46D Alma Road, 7700 Rosebank, SOUTH AFRICA

Tel/fax (home): +27-21-685-6472

Cell: +27-82-853-5352

Iridium SatPhone: +8816-315-19119

Email: calle.hedberg@gmail.com

Skype: calle_hedberg


Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Fri, Jun 3, 2016 at 6:26 PM, Morten Olav Hansen morten@dhis2.org wrote:

Hi Mike

I’m adding in Lars… It’s been a while since i looked at it… but I don’t think that is how it was designed, if you select an org unit… it will send to EVERYBODY connected to that (kinda like when you assign an OU to a user), if you want to send to individual users… you need to select them manually…

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Fri, Jun 3, 2016 at 6:24 PM, Mike Nelushi mikeevolution@gmail.com wrote:

Hi Morten,

The messageConversations web-api is still a big issue because we need to send each user specific information to their e-mails.

  1. Using {“subject”: subject, “text”: message, “users”: user} json object, the mail gets stored on DHIS2 mail and does not send it to the user e-mail.

LogUtil.java [http-apr-8080-exec-3])

  • INFO 2016-05-29 14:14:52,484 Invoking message sender: $Proxy53 (DefaultMessageService.java [http-apr-8080-exec-3])
  • INFO 2016-05-29 14:14:52,529 Invoking message sender: SmsMessageSender (DefaultMessageService.java [http-apr-8080-exec-3])
  • ERROR 2016-05-29 14:14:52,579 Unexpected error occurred invoking async method 'public java.lang.String org.hisp.dhis.message.EmailMessageSender.sendMessage(java.lang.String,java.lang.String,jav

a.lang.String,org.hisp.dhis.user.User,java.util.Set,boolean)’. (SimpleAsyncUncaughtExceptionHandler.java [taskScheduler-7])

org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: org.hisp.dhis.user.User.organisationUnits, could not initialize proxy - no Session

    at org.hibernate.collection.internal.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:569)
    at org.hibernate.collection.internal.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:188)
    at org.hibernate.collection.internal.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:139)
    at org.hibernate.collection.internal.PersistentSet.size(PersistentSet.java:156)
    at org.hisp.dhis.common.IdentifiableObjectUtils.join(IdentifiableObjectUtils.java:76)
    at org.hisp.dhis.user.User.getOrganisationUnitsName(User.java:288)
    at org.hisp.dhis.message.EmailMessageSender.renderPlainContent(EmailMessageSender.java:188)
    at org.hisp.dhis.message.EmailMessageSender.sendMessage(EmailMessageSender.java:115)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
    at org.springframework.aop.interceptor.AsyncExecutionInterceptor$1.call(AsyncExecutionInterceptor.java:108)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

2, Using {“subject”: subject, “text”: message, “users”: users, “organisationUnits”: organisationUnits}, sends email to everyone in the Orgunit and we want to send to individuals.

Please advice.

Regards,

Mike

On Fri, Jun 3, 2016 at 4:58 AM, Morten Olav Hansen morten@dhis2.org wrote:

Hi Mike

I’m adding in the dev list, and Halvdan (who knows about file resource API). I will have a look at the start as app functionality.


Morten

On Thu, Jun 2, 2016 at 5:00 PM, Mike Nelushi mikeevolution@gmail.com wrote:

Hi Calle,

Apologies, forgot to add you on this thread.

Regards

Mike

On 2 Jun 2016 11:35, “Mike Nelushi” mikeevolution@gmail.com wrote:

Hi Morten,

Its Mike here from HISP-SA.

We have been strangling to send email to individual users on our new Community Service Application which is going live tomorrow. At the moment when I send an email to individuals it sends to everyone who is a DHIS2 user. Im user the dhis2.23 messageConversations web-api for this.

A. The following are the two json objects I’ve used, the first one doesn’t send messages at all the messages stays on dhis2 mail.

  1. var json_Data = {“subject”: subject, “text”: message, “users”: users};

2.var json_Data = {“subject”: subject, “text”: message, “users”: users, “organisationUnits”: organisationUnits};

The following is our email settings

B. Second Issue is that when we call fileResources webapi to save file is does work but when you retrieve the file it says the file was not saved. The following is the object:

var file = item[0].files[0];

var formData = new FormData();

formData.append(‘file’, file);

C. The start page function on Appearance settings is not working if you choice your own custom APP, when logging in it does it go to the landing page instead it goes to index.action.

Can you please help us with this issues?

Regards,

Mike