Welcome to the Cumulus Support forum.

Latest Cumulus MX V4 release 4.4.2 (build 4085) - 12 March 2025

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

If you are posting a new Topic about an error or if you need help PLEASE read this first viewtopic.php?p=164080#p164080

Cumulus, XML, AJAX and translations

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderator: daj

ritchie
Posts: 42
Joined: Mon 02 Feb 2009 10:25 pm
Weather Station: WS 1081
Operating System: windows 10
Location: Rieti Italy

Re: Cumulus, XML, AJAX and translations

Post by ritchie »

You're not far off, just copy the folder that contains the .css files and graphics to your web site.
Job done.

Then you have start making it look like your own :lol:
steviegal
Posts: 19
Joined: Thu 20 Nov 2008 1:19 pm
Weather Station: Davis Vantage Pro2
Location: Dorset UK

Re: Cumulus, XML, AJAX and translations

Post by steviegal »

Thanks for that.

Yes I had missed the Style folder with all relevant files.
But sorry to say even though I have now uploaded to my site, things have not improved.

I am obviously missing something.
As you can tell this is very new to me,but I am finding the learning experience very rewarding.

Any more suggestions welcome.

www.melburyosmond.co.uk/ajaxindex.htm

Thanks for your help.
Image
User avatar
aadal
Posts: 168
Joined: Tue 04 Nov 2008 8:07 pm
Weather Station: WH 1080
Location: Skodje
Contact:

Re: Cumulus, XML, AJAX and translations

Post by aadal »

steviegal wrote:Thanks for that.

Yes I had missed the Style folder with all relevant files.
But sorry to say even though I have now uploaded to my site, things have not improved.

I am obviously missing something.
As you can tell this is very new to me,but I am finding the learning experience very rewarding.

Any more suggestions welcome.

http://www.melburyosmond.co.uk/ajaxindex.htm

Thanks for your help.
File not found: http://www.melburyosmond.co.uk/style/st ... bottom.css

File not found: http://www.melburyosmond.co.uk/style/colour.css
  • Windows Vista
Image

Image
ritchie
Posts: 42
Joined: Mon 02 Feb 2009 10:25 pm
Weather Station: WS 1081
Operating System: windows 10
Location: Rieti Italy

Re: Cumulus, XML, AJAX and translations

Post by ritchie »

You have probably downloaded an interim zip file, which did not have the complete file set.
Take the zip that is in the first post of this thread, then copy over the new files, or files that you have updated, then put it all onto your web server.
steviegal
Posts: 19
Joined: Thu 20 Nov 2008 1:19 pm
Weather Station: Davis Vantage Pro2
Location: Dorset UK

Re: Cumulus, XML, AJAX and translations

Post by steviegal »

Sorted.

Thanks Ritchie and aadal for your assistance, much appreciated from a beginner.

Now to play around to get "my" look.


http://www.melburyosmond.co.uk/ajaxindex.htm

Steve G
Image
User avatar
MarkB
Posts: 68
Joined: Tue 13 Jan 2009 4:03 pm
Weather Station: Elecsa 6975 (Fine Offset)
Contact:

Re: Cumulus, XML, AJAX and translations

Post by MarkB »

Hi Ritchie

Dont know whether its me or you yet (probably me!), but I downloaded your xml test site and implemented it on my web server (no problems there :) ). Now I notice that when I have the ajaxindex page open in my browser the CPU on the server goes above 90% and stays there. I get the following (sample) of stuff in my w3 logs.

I opted to include the cumulusdata.xml file in 'realtime' processing so it's being updated every 15 seconds (with my current setup of Cumulus) - this may have some bearing on it!

I'm going in to investigate. I'd appreciate you letting me know if you already know what the problem is, otherwise I'll keep you posted.

Mark


2009-03-05 13:57:05 W3SVC1 192.168.160.20 POST /weather/xmlreturn.php - 80 - 192.168.160.100 Mozilla/4.0+
2009-03-05 13:57:05 W3SVC1 192.168.160.20 POST /weather/xmlreturn.php - 80 - 192.168.160.100 Mozilla/4.0+
2009-03-05 13:57:05 W3SVC1 192.168.160.20 POST /weather/xmlreturn.php - 80 - 192.168.160.100 Mozilla/4.0+
2009-03-05 13:57:05 W3SVC1 192.168.160.20 POST /weather/xmlreturn.php - 80 - 192.168.160.100 Mozilla/4.0+
2009-03-05 13:57:05 W3SVC1 192.168.160.20 POST /weather/xmlreturn.php - 80 - 192.168.160.100 Mozilla/4.0+
2009-03-05 13:57:05 W3SVC1 192.168.160.20 POST /weather/xmlreturn.php - 80 - 192.168.160.100 Mozilla/4.0+
2009-03-05 13:57:06 W3SVC1 192.168.160.20 POST /weather/xmlreturn.php - 80 - 192.168.160.100 Mozilla/4.0+
2009-03-05 13:57:06 W3SVC1 192.168.160.20 POST /weather/xmlreturn.php - 80 - 192.168.160.100 Mozilla/4.0+
2009-03-05 13:57:06 W3SVC1 192.168.160.20 POST /weather/xmlreturn.php - 80 - 192.168.160.100 Mozilla/4.0+
2009-03-05 13:57:06 W3SVC1 192.168.160.20 POST /weather/xmlreturn.php - 80 - 192.168.160.100 Mozilla/4.0+
2009-03-05 13:57:06 W3SVC1 192.168.160.20 POST /weather/xmlreturn.php - 80 - 192.168.160.100 Mozilla/4.0+
2009-03-05 13:57:07 W3SVC1 192.168.160.20 POST /weather/xmlreturn.php - 80 - 192.168.160.100 Mozilla/4.0+
2009-03-05 13:57:07 W3SVC1 192.168.160.20 POST /weather/xmlreturn.php - 80 - 192.168.160.100 Mozilla/4.0+
2009-03-05 13:57:07 W3SVC1 192.168.160.20 POST /weather/xmlreturn.php - 80 - 192.168.160.100 Mozilla/4.0+
2009-03-05 13:57:07 W3SVC1 192.168.160.20 POST /weather/xmlreturn.php - 80 - 192.168.160.100 Mozilla/4.0+
2009-03-05 13:57:07 W3SVC1 192.168.160.20 POST /weather/xmlreturn.php - 80 - 192.168.160.100 Mozilla/4.0+
2009-03-05 13:57:07 W3SVC1 192.168.160.20 POST /weather/xmlreturn.php - 80 - 192.168.160.100 Mozilla/4.0+
2009-03-05 13:57:07 W3SVC1 192.168.160.20 POST /weather/xmlreturn.php - 80 - 192.168.160.100 Mozilla/4.0+
2009-03-05 13:57:07 W3SVC1 192.168.160.20 POST /weather/xmlreturn.php - 80 - 192.168.160.100 Mozilla/4.0+
2009-03-05 13:57:07 W3SVC1 192.168.160.20 POST /weather/xmlreturn.php - 80 - 192.168.160.100 Mozilla/4.0+
Image
ritchie
Posts: 42
Joined: Mon 02 Feb 2009 10:25 pm
Weather Station: WS 1081
Operating System: windows 10
Location: Rieti Italy

Re: Cumulus, XML, AJAX and translations

Post by ritchie »

Ouch :x
I suggest you temporarily disable the realtime processing to see what effect that has without changing anything else.
The purpose of the xml was to releive the strain on the systems - a 15 second rewrite on the xml update, and if you left the default, the html page will be placing a refresh call to the server every 3 seconds looking for changing data elements isn't making light of the work, but the server should be able to deal with it.

It will be interesting to see what happens - xmlreturn.php has the cumulusdata.xml file open - Cumulus is trying to re-write it :twisted:
User avatar
MarkB
Posts: 68
Joined: Tue 13 Jan 2009 4:03 pm
Weather Station: Elecsa 6975 (Fine Offset)
Contact:

Re: Cumulus, XML, AJAX and translations

Post by MarkB »

ritchie wrote:I suggest you temporarily disable the realtime processing to see what effect that has without changing anything else.
Did that - no joy. I'm afraid I still get the same result. Digging deeper... ;)


Mark
Image
User avatar
aadal
Posts: 168
Joined: Tue 04 Nov 2008 8:07 pm
Weather Station: WH 1080
Location: Skodje
Contact:

Re: Cumulus, XML, AJAX and translations

Post by aadal »

3 second to fast for my server so i put it on 15 second and then all fine.

Code: Select all

	var refreshAjax = new Ajax.PeriodicalUpdater(dynamicitem.id,url,{parameters: {item: dynamicitem.id, property: 'value'} , method : 'post', frequency: '15'});				
		
All no in Norwegian, the translation working great. :D
http://www.aadal.org/weather/ajaxindex.htm
  • Windows Vista
Image

Image
User avatar
MarkB
Posts: 68
Joined: Tue 13 Jan 2009 4:03 pm
Weather Station: Elecsa 6975 (Fine Offset)
Contact:

Re: Cumulus, XML, AJAX and translations

Post by MarkB »

aadal wrote:3 second to fast for my server so i put it on 15 second and then all fine.
Thanks aadal, that has pointed me in the right direction.
15 second is too fast for my server! I need to use 30!
(The hardware was top of the range in 1999 :lol: - not so good now!)

Mark
Image
User avatar
aadal
Posts: 168
Joined: Tue 04 Nov 2008 8:07 pm
Weather Station: WH 1080
Location: Skodje
Contact:

Re: Cumulus, XML, AJAX and translations

Post by aadal »

Only now left is translating inside tag.
Is thise possible ?

xml give me :

Code: Select all

  <description>All time low temperature</description> 
  </item>
- <item name="#TtempH">
  <value>at 12:37 on 31 januar 2009</value> 
  <unit /> 
  <image /> 
  <description>Time of all time high temperature</description> 
  </item>
- <item name="#TtempL">
  <value>at 21:04 on 04 januar 2009</value> 
Want to change the at and on

Thise give me:

Code: Select all

Høy/Lav registreringer 
Høyest  temperatur 18,6  °C   at 12:37 on 31 januar 2009 
Lavest  temperatur -7,6  °C   at 21:04 on 04 januar 2009
In Norwegian

Code: Select all

Høy/Lav registreringer 
Høyest  temperatur 18,6  °C   kl. 12:37 den 31 januar 2009 
Lavest  temperatur -7,6  °C   kl. 21:04 den 04 januar 2009
  • Windows Vista
Image

Image
User avatar
aadal
Posts: 168
Joined: Tue 04 Nov 2008 8:07 pm
Weather Station: WH 1080
Location: Skodje
Contact:

Re: Cumulus, XML, AJAX and translations

Post by aadal »

MarkB wrote:
aadal wrote:3 second to fast for my server so i put it on 15 second and then all fine.
Thanks aadal, that has pointed me in the right direction.
15 second is too fast for my server! I need to use 30!
(The hardware was top of the range in 1999 :lol: - not so good now!)

Mark
Hi MarkB fine it worked out for you, with 3 second mine go into loop and page takes a long time loading.
My limit was 6 seconds but i set it to 15.

:D
  • Windows Vista
Image

Image
User avatar
MarkB
Posts: 68
Joined: Tue 13 Jan 2009 4:03 pm
Weather Station: Elecsa 6975 (Fine Offset)
Contact:

Re: Cumulus, XML, AJAX and translations

Post by MarkB »

OK I've finished digging. Here's what I uncovered - please shoot me down in flames if I got it wrong!

When ajaxindex.htm loads for the first time it makes 50-odd calls through prototype.js, each of which POSTs xmlreturn.PHP on the server to popoulate each <span> on the page. Each call through xmlreturn.PHP causes it to open the cumulusdata.xml and parse the whole file to extract the one ITEM it was looking for. Every time the Ajax.PeriodicalUpdater is called (at whatever update rate you set it to) it re-parses the xml file another 22 times. (once for each observation value on the page)

This is all too much for my ancient and creaking 10 year old hardware. :(

The xml concept is great, but I need to find a way of parsing the XML file just once for all of the values (like xmlbanner does). Now you have got me thinking!

Mark
Image
User avatar
aadal
Posts: 168
Joined: Tue 04 Nov 2008 8:07 pm
Weather Station: WH 1080
Location: Skodje
Contact:

Re: Cumulus, XML, AJAX and translations

Post by aadal »

MarkB wrote:OK I've finished digging. Here's what I uncovered - please shoot me down in flames if I got it wrong!

When ajaxindex.htm loads for the first time it makes 50-odd calls through prototype.js, each of which POSTs xmlreturn.PHP on the server to popoulate each <span> on the page. Each call through xmlreturn.PHP causes it to open the cumulusdata.xml and parse the whole file to extract the one ITEM it was looking for. Every time the Ajax.PeriodicalUpdater is called (at whatever update rate you set it to) it re-parses the xml file another 22 times. (once for each observation value on the page)

This is all too much for my ancient and creaking 10 year old hardware. :(

The xml concept is great, but I need to find a way of parsing the XML file just once for all of the values (like xmlbanner does). Now you have got me thinking!

Mark
Hi MarkB
Try thise, and i moved so head load first.
Then it gos days before caling on xml file you need to refresh to update page.

Code: Select all

    document.observe('dom:loaded', function () {
		var url = 'xmlreturn.php';	
		$$('.onceonly').each(function(staticitem) { 
			staticitem.update('leser data'); 
  			var staticAjax = new Ajax.Updater(staticitem.id,url,{parameters: {item: staticitem.id, property: 'value'} , method : 'post'});				

		});
		
		$$('.refresh').each(function(dynamicitem) { 
		 	dynamicitem.update('Oppdaterer'); 
	  		var refreshAjax = new Ajax.PeriodicalUpdater(dynamicitem.id,url,{parameters: {item: dynamicitem.id, property: 'value'} , method : 'post', frequency: '10000000'});				
		});

		$$('.unit').each(function(unit) {
			tID = unit.id;
			if (unit.id.indexOf("_") == 0) {
				tID = unit.id.substring(3);
			}
			var unitAjax = new Ajax.Updater(unit.id,url,{parameters: {item: tID, property: 'unit'} , method : 'post'});
		});
:D
  • Windows Vista
Image

Image
User avatar
MarkB
Posts: 68
Joined: Tue 13 Jan 2009 4:03 pm
Weather Station: Elecsa 6975 (Fine Offset)
Contact:

Re: Cumulus, XML, AJAX and translations

Post by MarkB »

aadal wrote:Then it gos days before caling on xml file you need to refresh to update page.
That would be around 115.75 days at a guess :D

I'm sorry, but this only avoids the problem. It still makes 22 consecutive calls to xmlreturn.log

Code: Select all

if (!($fp=@fopen("./cumulusdata.xml", "r"))) die ("Couldn't open XML.");
when the timer expires. This has to be expensive...

:cry: Mark
Image
Post Reply