Embed viz in DHIS2 2.22

Hello,
I’ve a DHIS2 2.22 running with some chart we did. I want to embed one in an external page. When I ask for “Embed” I got code like this:

I get several problems there - first of all on the CDN the v222 does not exists at all. Going on http://dhis2-cdn.org/ looks like nothing exists between 2.21 & 2.25.

The second thing is I don’t understand how this can work without any reference to the server I’m running on.

I did some test in the play with success, but that’s with the 2.25 (and looks like a quite different API). Any help for a version between 2.21 & 2.25?

Thanks,

Martin

···

**Martin Van Aken - **Freelance Enthusiast Developer

Mobile : +32 486 899 652

Follow me on Twitter : @martinvanaken

Call me on Skype : vanakenm

Hang out with me : martin@joyouscoding.com

Contact me on LinkedIn : http://www.linkedin.com/in/martinvanaken

Company website : www.joyouscoding.com

Thanks, I’ll try it out.

On the 2.25 version it’s working with a catch - even with my url whitelisted in DHIS2 Setting page, I get a “Control-Allow-Origin’ header is present on the requested resource. Origin 'http://xxxxx is therefore not allowed access.”

Thanks,

Martin

···

On Jan 18, 2017 9:45 PM, “Jan Henrik Øverland” jan@dhis2.org wrote:

Hi Martin,

We have obviously not been able to keep the cdn/docs up to date for all versions. Sorry about that.

I have put up the 2.22 chart plugin here: https://dhis2-cdn.org

To make this work, please add your client domain to the CORS whitelist in your 2.22 instance (system settings).

Then there were some parts missing in the html. Please try:

Hope this helps.

Jan

On 18 January 2017 at 16:49, Martin Van Aken martin@joyouscoding.com wrote:

Hello,
I’ve a DHIS2 2.22 running with some chart we did. I want to embed one in an external page. When I ask for “Embed” I got code like this:

I get several problems there - first of all on the CDN the v222 does not exists at all. Going on http://dhis2-cdn.org/ looks like nothing exists between 2.21 & 2.25.

The second thing is I don’t understand how this can work without any reference to the server I’m running on.

I did some test in the play with success, but that’s with the 2.25 (and looks like a quite different API). Any help for a version between 2.21 & 2.25?

Thanks,

Martin


**Martin Van Aken - **Freelance Enthusiast Developer

Mobile : +32 486 899 652

Follow me on Twitter : @martinvanaken

Call me on Skype : vanakenm

Hang out with me : martin@joyouscoding.com

Contact me on LinkedIn : http://www.linkedin.com/in/martinvanaken

Company website : www.joyouscoding.com


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

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

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

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


Jan Henrik Øverland

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

Hello,
Yes, more success there, thanks. I’m still getting error messages from my browser regarding Control-Allow-Origin - I’ll investigate that one further.

Martin

···

On Thu, Jan 19, 2017 at 7:09 PM, Jan Henrik Øverland jan@dhis2.org wrote:

Okay. Did you follow the instructions for 2.25?

https://docs.dhis2.org/2.25/en/developer/html/webapi_plugins.html#d0e7117

On Jan 19, 2017 18:40, “Martin Van Aken” martin@joyouscoding.com wrote:

Thanks, I’ll try it out.

On the 2.25 version it’s working with a catch - even with my url whitelisted in DHIS2 Setting page, I get a “Control-Allow-Origin’ header is present on the requested resource. Origin 'http://xxxxx is therefore not allowed access.”

From my own browser I can disable cors (using a chrome extension), but that’s not really sustainable. Any pointers there?

Thanks,

Martin


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

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

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

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

On Jan 18, 2017 9:45 PM, “Jan Henrik Øverland” jan@dhis2.org wrote:

Hi Martin,

We have obviously not been able to keep the cdn/docs up to date for all versions. Sorry about that.

I have put up the 2.22 chart plugin here: https://dhis2-cdn.org

To make this work, please add your client domain to the CORS whitelist in your 2.22 instance (system settings).

Then there were some parts missing in the html. Please try:

Hope this helps.

Jan

On 18 January 2017 at 16:49, Martin Van Aken martin@joyouscoding.com wrote:

Hello,
I’ve a DHIS2 2.22 running with some chart we did. I want to embed one in an external page. When I ask for “Embed” I got code like this:

I get several problems there - first of all on the CDN the v222 does not exists at all. Going on http://dhis2-cdn.org/ looks like nothing exists between 2.21 & 2.25.

The second thing is I don’t understand how this can work without any reference to the server I’m running on.

I did some test in the play with success, but that’s with the 2.25 (and looks like a quite different API). Any help for a version between 2.21 & 2.25?

Thanks,

Martin


**Martin Van Aken - **Freelance Enthusiast Developer

Mobile : +32 486 899 652

Follow me on Twitter : @martinvanaken

Call me on Skype : vanakenm

Hang out with me : martin@joyouscoding.com

Contact me on LinkedIn : http://www.linkedin.com/in/martinvanaken

Company website : www.joyouscoding.com


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

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

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

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


Jan Henrik Øverland

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

**Martin Van Aken - **Freelance Enthusiast Developer

Mobile : +32 486 899 652

Follow me on Twitter : @martinvanaken

Call me on Skype : vanakenm

Hang out with me : martin@joyouscoding.com

Contact me on LinkedIn : http://www.linkedin.com/in/martinvanaken

Company website : www.joyouscoding.com